Skip to content

Support half-integer Pi angle RZ gates in "stabilizer" and "clifford" methods #1928

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

Closed
chriseclectic opened this issue Sep 6, 2023 · 2 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@chriseclectic
Copy link
Member

What is the expected behavior?

The qiskit transpiler has a lot of issues wrt to Clifford basis circuits which makes testing larger circuits on the clifford or
stabilizer simulator difficult.

Probably the most straightforward way to "fix" this is to allow "rz" basis gates in Aer for the "stabilizer" when the parameter is a half-integer multiple of pi, (k * pi /2), possible with some modification of terras transpiler passes to make sure 1Q synthesis and basis decomposition keeps RZ gates as Cliffords whenever possible.

This validation could happen when the circuit is loaded in to the simulator (if we want to be able to choose the stabilizer method for the "automatic" case). Another option to just make this work with the stablizer/clifford methods would be runtime validation whenever the simulator goes to apply an RZGate, to check the angle is mod 2pi is half integer multiple of Pi, and then apply the appropriate I, Z, S, or Sdg gate based on the value (or raise an exception of it is an invalid value).

@chriseclectic chriseclectic added the enhancement New feature or request label Sep 6, 2023
@doichanj doichanj self-assigned this Sep 7, 2023
@ikkoham
Copy link
Collaborator

ikkoham commented Sep 12, 2023

Do you have a plan to support Rx and Ry as well? RzGates come from transpilation for IBM Quantum processor, but qiskit is backend agnostic.

@mtreinish
Copy link
Member

FWIW, the Target class supports specifying supported gates with fixed angle values. For example: https://github.com/Qiskit/qiskit/blob/main/qiskit/providers/fake_provider/fake_mumbai_v2.py#L441 the transpiler probably doesn't fully work with a target specified like this as this feature is undertested. But it at least in theory lets aer advertise to users and the transpiler that it only supports multiple fixed angle values for a rotation gate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants