-
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 InverseCancellation pass to handle gates of different names. #7383
Fix InverseCancellation pass to handle gates of different names. #7383
Conversation
As reported in QiskitGH-7378, the InverseCancellation optimization pass previously assumed that inverse gate pairs would always share a common name, but this is not universally true. This commit updates the pass to search for runs containing any of the gate names in the gates_to_cancel list, instead of only the first. Co-authored-by: Bruno Schmitt <bruno.schmitt@epfl.ch>
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 LGTM, this was clearly a bug assuming the names were equal for inverse pairs so this is the simple fix that we can easily backport for 0.19.1. But, I also agree with @boschmitt in #7378 having a way to transform things into a canonical form is probably a good/better way to handle this longer term as part of 0.20.0.
Pull Request Test Coverage Report for Build 1556245160
💛 - Coveralls |
As reported in GH-7378, the InverseCancellation optimization pass previously assumed that inverse gate pairs would always share a common name, but this is not universally true. This commit updates the pass to search for runs containing any of the gate names in the gates_to_cancel list, instead of only the first. Co-authored-by: Bruno Schmitt <bruno.schmitt@epfl.ch> Co-authored-by: Bruno Schmitt <bruno.schmitt@epfl.ch> (cherry picked from commit d9ab98f)
…) (#7384) As reported in GH-7378, the InverseCancellation optimization pass previously assumed that inverse gate pairs would always share a common name, but this is not universally true. This commit updates the pass to search for runs containing any of the gate names in the gates_to_cancel list, instead of only the first. Co-authored-by: Bruno Schmitt <bruno.schmitt@epfl.ch> Co-authored-by: Bruno Schmitt <bruno.schmitt@epfl.ch> (cherry picked from commit d9ab98f) Co-authored-by: Kevin Krsulich <kevin.krsulich@ibm.com>
As reported in GH-7378, the InverseCancellation optimization pass
previously assumed that inverse gate pairs would always share a
common name, but this is not universally true. This commit updates
the pass to search for runs containing any of the gate names in the
gates_to_cancel list, instead of only the first.
Co-authored-by: Bruno Schmitt bruno.schmitt@epfl.ch
Summary
Details and comments