-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Adjust pulse optimal cx two qubit decomposer to avoid RZ(0) #14629
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
Adjust pulse optimal cx two qubit decomposer to avoid RZ(0) #14629
Conversation
In the TwoQubitBasisDecomposer there was a special code path to do pulse optimal decomposition. This code path could occasionally result in a 0 degree angle rz gate being emitted. This would mean the sequence of SX - RZ(0) - SX would be generated which is just an X gate. This commit updates the decomposition to just use an X gate in these cases if they're encountered. This is essentially the same optimization that was done in Qiskit#5937/Qiskit#5827 for the single qubit euler decomposer but this applies it to the pulse optimal 2q decomposition.
One or more of the following people are relevant to this code:
|
Pull Request Test Coverage Report for Build 16630282067Warning: 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.
would you like to add a test? other than that, looks good!
I added tests in: b41e62d |
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 bug!
and thanks to @t-imamichi for finding it!
Summary
In the TwoQubitBasisDecomposer there was a special code path to do pulse optimal decomposition. This code path could occasionally result in a 0 degree angle rz gate being emitted. This would mean the sequence of SX - RZ(0) - SX would be generated which is just an X gate. This commit updates the decomposition to just use an X gate in these cases if they're encountered. This is essentially the same optimization that was done in #5937/#5827 for the single qubit euler decomposer but this applies it to the pulse optimal 2q decomposition.
Details and comments