-
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 Rust-space TwoQubitBasisDecomposer
for non-standard KAK gate
#13014
Conversation
…en KAK gate is a Rust-space StandardGate
One or more of the following people are relevant to this code:
|
TwoQubitBasisDecomposer
for not Rust-space standard KAK gateTwoQubitBasisDecomposer
for non-standard KAK gate
Pull Request Test Coverage Report for Build 10527903608Details
💛 - 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.
Thanks for fixing this, the fix looks good, just one comment on the tests.
Reproduce from: https://github.com/Qiskit/qiskit/issues/12998 | ||
""" | ||
# note that `CXGate(ctrl_state=0)` is not handled as a "standard" gate. | ||
TwoQubitBasisDecomposer(CXGate(ctrl_state=0))(CXGate()) |
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.
The bug was only present when building the circuit. Can you update this to pass it a unitary matrix to synthesize and maybe assert the output circuit's operator is equivalent to the input and your pygate is correctly used.
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.
Oh I misread this it is creating a circuit from cx's matrix. It'd still be good to add the assertions though.
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.
That's totally on me, I just copied the reproducing example without trying to make it readable. It should look better now :)
Co-authored-by: Matthew Treinish <[email protected]>
…13014) * Get rid of encoded assumption in TwoQubitBasisDecomposer that the given KAK gate is a Rust-space StandardGate * Improve unit test * Update test/python/synthesis/test_synthesis.py Co-authored-by: Matthew Treinish <[email protected]> --------- Co-authored-by: Matthew Treinish <[email protected]> (cherry picked from commit a4bf87b)
…13014) (#13026) * Get rid of encoded assumption in TwoQubitBasisDecomposer that the given KAK gate is a Rust-space StandardGate * Improve unit test * Update test/python/synthesis/test_synthesis.py Co-authored-by: Matthew Treinish <[email protected]> --------- Co-authored-by: Matthew Treinish <[email protected]> (cherry picked from commit a4bf87b) Co-authored-by: Elena Peña Tapia <[email protected]> Co-authored-by: Elena Peña Tapia <[email protected]>
Summary
Proposal to fix #12998. I can probably extend the unit tests further.
Details and comments