-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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 4-pi periodicity of controlled rotations in the CommutationChecker
#13670
Conversation
One or more of the following people are relevant to this code:
|
CommutationChecker
CommutationChecker
Pull Request Test Coverage Report for Build 12811238577Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
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.
LGTM! This is the typical tricky bug, I just left a tiny suggestions for the test docstring.
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.
Thank you for identifying and fixing the bug. I have left a few tiny comments.
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.
LGTM! Thanks for addressing the comments.
…er` (#13670) (#13676) * start * fix 4pi periodicity of controlled pauli rots * review comments by Elena & Sasha (cherry picked from commit dffc2df) # Conflicts: # crates/accelerate/src/commutation_checker.rs Co-authored-by: Julien Gacon <[email protected]>
Summary
The commutation checker currently wrongly assumes that the controlled Pauli rotations CRX/Y/Z are equivalent to the identity for multiples of$2\pi$ . However, this is only true for $4\pi$ . Note that CP is indeed $2\pi$ periodic.
Details and comments
The tests were modified to compare the output of the commutation checker to a numeric result instead of a hardcoded one, such that this error shouldn't arise in the future again.