-
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 UnitarySynthesis
for 3+ qubits when compiled for a backend
#13591
base: main
Are you sure you want to change the base?
Conversation
One or more of the following people are relevant to this code:
|
Pull Request Test Coverage Report for Build 12434705540Details
💛 - Coveralls |
Fixed a bug in the :class:`.UnitarySynthesis` transpiler pass, where blocks of | ||
:class:`.UnitaryGate`\s of 3 qubits or more were not correctly synthesized. | ||
This lead e.g. to the circuit being overwritten with the last processed block or | ||
to internal panics when encountering measurements after a such a block. | ||
Fixed `#13586 <https://github.com/Qiskit/qiskit/issues/13586>`__. |
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.
Fixed a bug in the :class:`.UnitarySynthesis` transpiler pass, where blocks of | |
:class:`.UnitaryGate`\s of 3 qubits or more were not correctly synthesized. | |
This lead e.g. to the circuit being overwritten with the last processed block or | |
to internal panics when encountering measurements after a such a block. | |
Fixed `#13586 <https://github.com/Qiskit/qiskit/issues/13586>`__. | |
Fixed a bug in the :class:`.UnitarySynthesis` transpiler pass, where blocks of | |
:class:`.UnitaryGate`\s on 3 qubits or more were not correctly synthesized. | |
This led, e.g., to the circuit being overwritten with the last processed block or | |
to internal panics when encountering measurements after such a block. | |
Fixed `#13586 <https://github.com/Qiskit/qiskit/issues/13586>`__. |
Thanks for the fix, @Cryoris! Looks good! (modulo some minor spell-checking nitpicks about the release notes)
Are you planning to add a test for that (like the one you have in the code snippet in the description)? |
Summary
When encountering a 3+ qubit
UnitaryGate
,UnitarySynthesis
currently replaces the whole dag with the definition of the block instead of appending it, seeqiskit/crates/accelerate/src/unitary_synthesis.rs
Line 375 in 079f69f
Details and comments
This also leads to #13586 because the qubit/clbit interners are overwritten, but maybe more importantly this can lead to issues when multiple 3-qubit blocks are present in the circuit. E.g. running
produces an empty circuit, since the last block implements the identity.
Some additional tests, such as the precise case of #13586 and a series of 3q
UnitaryGate
s, should be added.