qiskit/releasenotes/notes/1.0/fix-parameterized-self-inve...

24 lines
686 B
YAML

---
fixes:
- |
Fixed an issue with the :class:`~.InverseCancellation` pass where it would
incorrectly cancel gates passed in as self-inverses with a parameter
value, if a run of gates had a different parameter value. For example::
from math import pi
from qiskit.circuit.library import RZGate
from qiskit.circuit import QuantumCircuit
from qiskit.transpiler.passes import InverseCancellation
inverse_pass = InverseCancellation([RZGate(0)])
qc = QuantumCircuit(1)
qc.rz(0, 0)
qc.rz(pi, 0)
qc.rz(0, 0)
inverse_pass(qc)
would previously have incorrectly cancelled two of the rz gates.