forked from Qiskit/qiskit
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix UnitaryGate.qasm() with unused qubits (Qiskit#8234)
The OpenQASM 2 exporter has a special case for providing `gate` definitions, which was implemented purely for `UnitaryGate`. This is stateful per instruction, and does not generally behave well with the rest of the exporter. This commit fixes one misbehaviour: the way the qubit operands for the definition was calculated was unreliable in both order and number of qubits, if any of the qubits were unaffected by the gate operation. Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
- Loading branch information
1 parent
ebf800a
commit 8d5e3ca
Showing
3 changed files
with
24 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
releasenotes/notes/fix-qasm2-identity-as-unitary-aa2feeb05707a597.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
fixes: | ||
- | | ||
The OpenQASM 2 exporter (:meth:`.QuantumCircuit.qasm`) will now correctly | ||
define the qubit parameters for :class:`.UnitaryGate` operations that do | ||
not affect all the qubits they are defined over. | ||
Fixed `#8224 <https://github.com/Qiskit/qiskit-terra/issues/8224>`__. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters