Skip to content

Fix behavior of MergeInteractions for tagged partial CZ gates #4288

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 2 commits into from
Jul 6, 2021

Conversation

cduck
Copy link
Collaborator

@cduck cduck commented Jul 5, 2021

Fixes #4287.

MergeInteractions skips merging CZ gates if there are already equal or fewer in a sequence than the synthesized result (to prevent increasing the gate count). Previously, a tagged partial CZ gate could slip through and not be optimized even if allow_partial_czs=False.

@cduck cduck added the BREAKING CHANGE For pull requests that are important to mention in release notes. label Jul 5, 2021
@cduck cduck requested a review from tanujkhattar July 5, 2021 18:07
@cduck cduck requested review from vtomole and a team as code owners July 5, 2021 18:07
@google-cla google-cla bot added the cla: yes Makes googlebot stop complaining. label Jul 5, 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.

LGTM

@tanujkhattar tanujkhattar merged commit 504bdbb into quantumlib:master Jul 6, 2021
@tanujkhattar tanujkhattar self-assigned this Jul 6, 2021
@cduck cduck deleted the fix-merge branch July 6, 2021 21:23
rht pushed a commit to rht/Cirq that referenced this pull request May 1, 2023
…mlib#4288)

* Add test for the failing case with a tagged operation

* Fix merge interactions for tagged operation
harry-phasecraft pushed a commit to PhaseCraft/Cirq that referenced this pull request Oct 31, 2024
…mlib#4288)

* Add test for the failing case with a tagged operation

* Fix merge interactions for tagged operation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BREAKING CHANGE For pull requests that are important to mention in release notes. cla: yes Makes googlebot stop complaining.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MergeInteractions optimizer doesn't behave well with TaggedOperations
2 participants