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

transpiler introduces non-clifford gates in a purely clifford circuit #12363

Open
ajavadia opened this issue May 7, 2024 · 0 comments
Open
Labels
bug Something isn't working mod: transpiler Issues and PRs related to Transpiler

Comments

@ajavadia
Copy link
Member

ajavadia commented May 7, 2024

Environment

  • Qiskit version: 1.1
  • Python version: 3.10
  • Operating system: macOS

What is happening?

Given a circuit with only clifford gates (i.e all angles multiples of pi/2), the transpiler sometimes introduces non-clifford angles. This can be a problem as many optimizations work best when dealing with Clifford angles rather than arbitrary angles, so the transpiler is making it harder for downstream passes.

How can we reproduce the issue?

consider the following example circuit

OPENQASM 2.0;
include "qelib1.inc";
qreg q[5];
u2(-pi,0) q[1];
u2(-pi,0) q[2];
u2(-pi,0) q[3];
u2(-pi,0) q[4];
cx q[4],q[0];
ry(-pi/2) q[4];
cx q[4],q[0];
u2(-pi,-pi) q[4];
cx q[3],q[4];
ry(-pi/2) q[3];
ry(-pi/2) q[4];

image

This circuit is purely Clifford (i.e. all angles are integer multiples of pi/2). However when transpiled with optimization levels 1 and above, the transpiler introduces non-clifford angles.

image

What should happen?

The transpiler should preserve the clifford property of circuits and not introduce arbitrary angles.

Any suggestions?

The culprit is probably OneQubitEulerDecomposer or TwoQubitBasisDecomposer although I have not investigated deeply.

@ajavadia ajavadia added the bug Something isn't working label May 7, 2024
@ajavadia ajavadia changed the title OneQubitEulerDecomposer introduces non-clifford gates in a purely clifford circuit transpiler introduces non-clifford gates in a purely clifford circuit May 7, 2024
@ShellyGarion ShellyGarion added the mod: transpiler Issues and PRs related to Transpiler label May 8, 2024
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: transpiler Issues and PRs related to Transpiler
Projects
None yet
Development

No branches or pull requests

2 participants