-
Notifications
You must be signed in to change notification settings - Fork 631
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
Fix handling of cumulative_angles
in merge_rotations
#7011
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
I've deleted the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just had a minor suggestion for readability, otherwise LGTM 🚀
Thanks for this upgrade @andrijapau 🎉
Co-authored-by: David Wierichs <[email protected]>
cumalative_angles
in merge_rotations
cumulative_angles
in merge_rotations
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #7011 +/- ##
=======================================
Coverage 99.60% 99.60%
=======================================
Files 485 485
Lines 46361 46365 +4
=======================================
+ Hits 46178 46182 +4
Misses 183 183 ☔ View full report in Codecov by Sentry. |
Context:
For the
Rot
gate, the angles can cancel in a non-trivial way (e.g. Rot(φ,0,-φ) = RZ(φ) RY(0) RZ(-φ) = RZ(0) = I).Unlike
single_qubit_fusion
, this was not being handled correctly and only the trivial case where all angles are zero was being checked.Description of the Change:
angles_cancel
that determines whether the operator is the identity and can be ignored in the transformed tape.Benefits: Correct behaviour.
Possible Drawbacks: None identified.
Related GitHub Issues: Fixes #7010
[sc-85327]