Skip to content

Make CircuitOp.fromjson more efficient #5527

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jun 15, 2022
Merged

Conversation

daxfohl
Copy link
Collaborator

@daxfohl daxfohl commented Jun 15, 2022

Call the circuitop constructor with all the fields, rather than using with... for each field and repeating a potentially expensive validation at each step. @95-martin-orion

Fixes #5516

@daxfohl daxfohl requested review from a team, vtomole and cduck as code owners June 15, 2022 16:59
@daxfohl daxfohl requested a review from tanujkhattar June 15, 2022 16:59
@CirqBot CirqBot added the size: S 10< lines changed <50 label Jun 15, 2022
@daxfohl daxfohl marked this pull request as draft June 15, 2022 18:15
@daxfohl daxfohl marked this pull request as ready for review June 15, 2022 20:32
Copy link
Collaborator

@95-martin-orion 95-martin-orion left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm sure there was a reason for this at the time, but given that tests are unaffected it's probably no longer relevant. LGTM

@95-martin-orion 95-martin-orion added the automerge Tells CirqBot to sync and merge this PR. (If it's running.) label Jun 15, 2022
@CirqBot CirqBot added the front_of_queue_automerge CirqBot uses this label to indicate (and remember) what's being merged next. label Jun 15, 2022
@CirqBot CirqBot merged commit 0e0be51 into quantumlib:master Jun 15, 2022
@CirqBot CirqBot removed automerge Tells CirqBot to sync and merge this PR. (If it's running.) front_of_queue_automerge CirqBot uses this label to indicate (and remember) what's being merged next. labels Jun 15, 2022
@daxfohl daxfohl deleted the fromjson branch June 24, 2022 05:29
rht pushed a commit to rht/Cirq that referenced this pull request May 1, 2023
Call the circuitop constructor with all the fields, rather than using `with...` for each field and repeating a potentially expensive validation at each step. @95-martin-orion 

Fixes quantumlib#5516
harry-phasecraft pushed a commit to PhaseCraft/Cirq that referenced this pull request Oct 31, 2024
Call the circuitop constructor with all the fields, rather than using `with...` for each field and repeating a potentially expensive validation at each step. @95-martin-orion 

Fixes quantumlib#5516
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size: S 10< lines changed <50
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CircuitOp json parsing inefficient
3 participants