Skip to content
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

Pauli.evolve() should recognize common rotations by (n*pi/2) as Clifford gates #12085

Open
aeddins-ibm opened this issue Mar 26, 2024 · 3 comments
Labels
bug Something isn't working mod: quantum info Related to the Quantum Info module (States & Operators)

Comments

@aeddins-ibm
Copy link
Contributor

aeddins-ibm commented Mar 26, 2024

Environment

  • Qiskit version: 1.x
  • Python version: 3.11
  • Operating system: MacOS

What is happening?

qc = QuantumCircuit(1)
qc.rz(np.pi)
qi.Pauli('X').evolve(qc)

The above call to evolve() raises an error even though qc 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 a z), so I can't use that as a quick workaround.

How can we reproduce the issue?

qc = QuantumCircuit(1)
qc.rz(np.pi)
qi.Pauli('X').evolve(qc)

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

@aeddins-ibm aeddins-ibm added the bug Something isn't working label Mar 26, 2024
@ShellyGarion ShellyGarion added the mod: quantum info Related to the Quantum Info module (States & Operators) label Mar 27, 2024
@ShellyGarion
Copy link
Member

ShellyGarion commented Mar 27, 2024

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.

@ShellyGarion
Copy link
Member

See also the discussion here: #9576
and here: #9475 (comment)

@ShellyGarion
Copy link
Member

I think that this can be handled similarly to the way that the RZGate was added to the Clifford class in #9475

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working mod: quantum info Related to the Quantum Info module (States & Operators)
Projects
None yet
Development

No branches or pull requests

2 participants