Skip to content
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

Add Circuit Optimizer for sqrt-iSWAP #4224

Merged
merged 11 commits into from Jul 7, 2021
Merged

Conversation

cduck
Copy link
Collaborator

@cduck cduck commented Jun 17, 2021

Follow up to #4213. Fixes #4083. (Also contains a one-line change to fix #4225.)

I'm open to name suggestions for MergeInteractionsToSqrtIswap.

@cduck cduck requested review from vtomole and a team as code owners June 17, 2021 22:59
@cduck cduck requested a review from mpharrigan June 17, 2021 22:59
@google-cla google-cla bot added the cla: yes Makes googlebot stop complaining. label Jun 17, 2021
@balopat balopat added the pr/blocked This PR is blocked on another issue label Jun 30, 2021
@balopat
Copy link
Contributor

balopat commented Jun 30, 2021

Blocked on #4213.

@cduck
Copy link
Collaborator Author

cduck commented Jul 3, 2021

This is unblocked now @tanujkhattar. I changed the API to match the updates in #4213.

@cduck
Copy link
Collaborator Author

cduck commented Jul 3, 2021

Fixed tricky merge issues caused by the @staticmethod refactor PR #4231.

@cduck cduck removed the pr/blocked This PR is blocked on another issue label Jul 4, 2021
Copy link
Collaborator

@tanujkhattar tanujkhattar left a comment

Choose a reason for hiding this comment

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

Left a first round of comments. PTAL.

cirq-core/cirq/optimizers/merge_interactions.py Outdated Show resolved Hide resolved
cirq.EjectZ().optimize_circuit,
cirq.DropNegligible().optimize_circuit,
cirq.DropEmptyMoments().optimize_circuit,
]
Copy link
Collaborator

Choose a reason for hiding this comment

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

What's the idea behind testing the behavior caused by other follow-up optimizations here? I think this has the risk of making the unit tests brittle. Maybe we should have a separate place for such integration tests where we actually prescribe this sequence of optimizations and then test their combined behavior?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I copied most of the tests from merge_interactions_test.py. I think the test is trying to be less brittle to changes in the two-qubit synthesis method by relying on more basic optimizers.

Copy link
Collaborator

@tanujkhattar tanujkhattar left a comment

Choose a reason for hiding this comment

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

LGTM

cirq-core/cirq/optimizers/merge_interactions.py Outdated Show resolved Hide resolved
@cduck cduck added the automerge Tells CirqBot to sync and merge this PR. (If it's running.) label Jul 7, 2021
@CirqBot CirqBot added the front_of_queue_automerge CirqBot uses this label to indicate (and remember) what's being merged next. label Jul 7, 2021
@CirqBot CirqBot merged commit d850bd0 into quantumlib:master Jul 7, 2021
@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 Jul 7, 2021
rht pushed a commit to rht/Cirq that referenced this pull request May 1, 2023
Follow up to quantumlib#4213.  Fixes quantumlib#4083.  (Also contains a one-line change to fix quantumlib#4225.)

I'm open to name suggestions for `MergeInteractionsToSqrtIswap`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes Makes googlebot stop complaining.
Projects
None yet
4 participants