-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Simplify decomposition of controlled eigengates with global phase #7383
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
Open
daxfohl
wants to merge
7
commits into
quantumlib:main
Choose a base branch
from
daxfohl:remove-controlled-cz-case
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+178
−66
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #7383 +/- ##
=======================================
Coverage 98.69% 98.69%
=======================================
Files 1112 1112
Lines 97910 97976 +66
=======================================
+ Hits 96632 96698 +66
Misses 1278 1278 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
daxfohl
commented
Jun 10, 2025
daxfohl
commented
Jun 10, 2025
daxfohl
commented
Jun 10, 2025
daxfohl
commented
Jun 10, 2025
daxfohl
commented
Jun 10, 2025
github-merge-queue bot
pushed a commit
that referenced
this pull request
Jun 17, 2025
…7405) This addresses an issue I found while working on #7291 Currently `merge_single_qubit_moments_to_phxz` will not merge moments that have a global phase, meaning that moments that could theoretically be merged are not. I updated it so that global phase is also supported. I added two tests to show the issue. Perhaps this situation is not common right now, but if #7383 is committed and the flag is used, it may become more common. @daxfohl Note that I'm not merging the global phase operations in a single one, because I'm thinking some phases could be parametrized; should I attempt to do this?
BichengYing
pushed a commit
to BichengYing/Cirq
that referenced
this pull request
Jun 20, 2025
…uantumlib#7405) This addresses an issue I found while working on quantumlib#7291 Currently `merge_single_qubit_moments_to_phxz` will not merge moments that have a global phase, meaning that moments that could theoretically be merged are not. I updated it so that global phase is also supported. I added two tests to show the issue. Perhaps this situation is not common right now, but if quantumlib#7383 is committed and the flag is used, it may become more common. @daxfohl Note that I'm not merging the global phase operations in a single one, because I'm thinking some phases could be parametrized; should I attempt to do this?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #7238
DecomposeContext
to configure extraction of terminal gates' global phases into distinct GlobalPhaseGates.a. This flag defaults to False for backward compatibility.
a. Added some convenience methods in GlobalPhaseGate to help.
b. Updated some unrelated existing code to use these convenience methods for clarity.
ControlledGate.decompose
to attempt decompose the subgate before attempting the brute-force approach.a. This is what ultimately simplifies the decomposition result.
b. Step 2 also allowed removal of the entire CZPowGate instanceof block there, since it was about extracting global phase.