-
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
Use InverseCancellation in opt level 1 instead of CXCancellation #11210
Conversation
This commit updates the default optimization stage plugin to use the InverseCancellation pass instead of CXCancellation for optimization level 1. The CXCancellation pass was hard coded to only cancel runs of CX gates on the same qubits. This was fine when CX is the target, but for other targets which aren't using CX the pass had no value. An alternative, more general, inverse cancellation pass was added in Qiskit#6855 that enables defining arbitrary inverse cancellation rules and simplifying a dag based on it. This commit updates the default optimization plugin at optimization level 1 to use this with some common inverse rules for 2q gates from the standard gate library. Closes: Qiskit#6576 Closes: Qiskit#7016 Related-to: Qiskit#7112
One or more of the the following people are requested to review this:
|
2b21bc0
to
a534744
Compare
Pull Request Test Coverage Report for Build 6798322136
💛 - 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.
This seems like a sensible, logical improvement overall. With #11211 also in place, are we expecting any meaningful slowdown from switching to this?
I suspect that this switch will help out the quality of discrete-basis transpilation to the Clifford set in the short term.
I wasn't expecting a significant slowdown it's just in the worst case we go from 1 unconditional call to |
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.
Sounds good, and that matches with what I'd have expected from the changeset as well.
Summary
This commit updates the default optimization stage plugin to use the InverseCancellation pass instead of CXCancellation for optimization level 1. The CXCancellation pass was hard coded to only cancel runs of CX gates on the same qubits. This was fine when CX is the target, but for other targets which aren't using CX the pass had no value. An alternative, more general, inverse cancellation pass was added in #6855 that enables defining arbitrary inverse cancellation rules and simplifying a dag based on it. This commit updates the default optimization plugin at optimization level 1 to use this with some common inverse rules from the standard gate library.
Details and comments
Closes #6576
Closes #7016
Related-to: #7112