Open aeddins-ibm opened 7 months ago
Currently, the RZGate(np.pi)
is a Clifford gate, and can be transformed into a Clifford
operator, so this code should work:
from qiskit.quantum_info import *
qc = QuantumCircuit(1)
qc.rz(np.pi, 0)
cliff = Clifford(qc)
Pauli('X').evolve(cliff)
but since the RZGate
definition contains non-Clifford gates, when appending it to a QuantumCircuit
, it's being decomposed into non-Clifford gates, and that's why your code doesn't work.
See also the discussion here: https://github.com/Qiskit/qiskit/issues/9576 and here: https://github.com/Qiskit/qiskit/pull/9475#issuecomment-1431014041
I think that this can be handled similarly to the way that the RZGate
was added to the Clifford class in https://github.com/Qiskit/qiskit/pull/9475
Environment
What is happening?
The above call to
evolve()
raises an error even thoughqc
contains only Clifford gates.For comparison, qiskit_aer's AerSimulator with method='stabilizer' does not have this problem. Transpiling for this backend leaves the circuit invariant (does not turn the
rz
into az
), so I can't use that as a quick workaround.How can we reproduce the issue?
What should happen?
Common 1- and 2-qubit rotations (rx, ry, rz, rxx, ...) should be recognized as Clifford gates when their gate angles are multiples of pi/2, and the Pauli should evolve successfully. (
if not gate_angle%(np.pi/2): ...
)Related: #12086
Any suggestions?
No response