-
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
Generalize CXCancellation
optimization pass to generic gate-inverse pairs
#6576
Labels
Comments
2 tasks
This PR #6855 can be used to complete this feature request -- all that would be required would be to search for the correct inputs for the new pass prior to running. I unlinked the PR to leave this issue open after it's merged. |
mtreinish
added a commit
to mtreinish/qiskit-core
that referenced
this issue
Nov 7, 2023
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
mtreinish
added a commit
to mtreinish/qiskit-core
that referenced
this issue
Nov 7, 2023
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
github-merge-queue bot
pushed a commit
that referenced
this issue
Nov 8, 2023
) * Use InverseCancellation in opt level 1 instead of CXCancellation 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 for 2q gates from the standard gate library. Closes: #6576 Closes: #7016 Related-to: #7112 * Add sx sx dagger inverse pair to pass
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What is the expected enhancement?
The
CXCancellation
pass currently only looks for adjacent CX-CX gates (on the same qubits) as opportunities for optimization, but it should support a broader set of both self-inverse gates and generic gate-inverse pairs.One option (similar to what was done for
CXDirection
in #5609 ) would be to include inCXCancellation
additional gate-inverse rules for which it can search the circuit to find applications. It would be better though to add an optional attribute toInstruction
instances to denote whichInstruction
(if any) is know ahead of time to be an instruction's inverse.The text was updated successfully, but these errors were encountered: