-
Notifications
You must be signed in to change notification settings - Fork 603
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
CNOT decomposition method returns DecompositionUndefinedError #6039
Conversation
[sc-63619] |
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.
Looks good to me overall, leaving a preliminary review :)
It might be good to add an explicit test of the CNOT decomposition, in case you were not planning to do that anyways. :)
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #6039 +/- ##
==========================================
- Coverage 99.66% 99.65% -0.01%
==========================================
Files 428 430 +2
Lines 41182 41169 -13
==========================================
- Hits 41042 41028 -14
- Misses 140 141 +1 ☔ View full report in Codecov by Sentry. |
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.
Thanks @lillian542
Would be nice to update the comment regarding mapped_op.has_decomposition
, otherwise LGTM! 🚀
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.
👍 minor, non-blocking suggestions.
Co-authored-by: Christina Lee <[email protected]>
Context:
Before CNOT inherited from
Controlled
, its decomposition method returned aDecompositionUndefinedError
. Now it uses the smart decomposition functions fromControlled
, which in this case make it decompose to itself.The change in the decomposition method of CNOT was unintentional, and operators should not decompose to themselves.
Description of the Change:
We put it back how it was:
Related GitHub Issues:
#5711