-
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 an error in qasm3 exporter when operating on unitary gates #13633
Conversation
One or more of the following people are relevant to this code:
|
Pull Request Test Coverage Report for Build 12769245443Warning: 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.
I think this is a fine way to go about solving the problem, thanks. At first I was a bit nervous because the gate models of OQ2 and OQ3 aren't necessarily identical (OQ3 has scope to be more permissive), but in practice I doubt it'll come up any time soon, if ever. If it does, we'll deal with it then.
Co-authored-by: Jake Lishman <jake@binhbar.com>
Co-authored-by: Jake Lishman <jake@binhbar.com>
* Fix error in qasm3 exporter when operating on unitary gates * Update test/python/qasm3/test_export.py Co-authored-by: Jake Lishman <jake@binhbar.com> * Update releasenotes/notes/fix-qasm-3-unitary-2da190be6ba25bbd.yaml Co-authored-by: Jake Lishman <jake@binhbar.com> --------- Co-authored-by: Jake Lishman <jake@binhbar.com> (cherry picked from commit 087e393)
… (#13663) * Fix error in qasm3 exporter when operating on unitary gates * Update test/python/qasm3/test_export.py Co-authored-by: Jake Lishman <jake@binhbar.com> * Update releasenotes/notes/fix-qasm-3-unitary-2da190be6ba25bbd.yaml Co-authored-by: Jake Lishman <jake@binhbar.com> --------- Co-authored-by: Jake Lishman <jake@binhbar.com> (cherry picked from commit 087e393) Co-authored-by: gadial <gadial@gmail.com>
Summary
Fixes a bug causing the qasm3 exporter to crash on circuits containing a unitary gate.
Fixes #13362.
Details and comments
The bug results from the
params
field of the unitaryoperation
being handled incorrectly, due to it being a somewhat nonstandard field (as opposed to theparams
field ofu
gate, for instance, which is used differently).This problem was already handled in the
qasm2
exporter by a call to_qasm2_decomposition
in the operation, if present. This PR integrates the same solution in the qasm3 exporter, renaming the method to_qasm_decomposition
.