Skip to content

[WIP] Make RVGate a standard gate#15171

Open
mtreinish wants to merge 1 commit intoQiskit:mainfrom
mtreinish:rv-as-standard
Open

[WIP] Make RVGate a standard gate#15171
mtreinish wants to merge 1 commit intoQiskit:mainfrom
mtreinish:rv-as-standard

Conversation

@mtreinish
Copy link
Copy Markdown
Member

@mtreinish mtreinish commented Oct 13, 2025

Summary

This commit moves the RVGate from the generalized gate module and makes it a standard gate. This involves defining it as a standard gate in Rust so that there is an efficient representation of the gate in rust like the other standard gates.

This is step 1 towards reimplementing the synthesis from #6048 in modern qiskit. The next PR after this will implement RV gate as a supported basis target in the one qubit decomposer.

Details and comments

TODO:

  • Fix definition for parametrized gates
  • deprecate basis argument on constructor
  • add missing versor implementation
  • Add tests to explicitly verify parameterexpression definition path is correct

This commit moves the RVGate from the generalized gate module and
makes it a standard gate. This involves defining it as a standard gate
in Rust so that there is an efficient representation of the gate in rust
like the other standard gates.

This is step 1 towards reimplementing the synthesis from Qiskit#6048 in modern
qiskit. The next PR after this will implement RV gate as a supported
basis target in the one qubit decomposer.
@mtreinish mtreinish added this to the 2.3.0 milestone Oct 13, 2025
@mtreinish mtreinish requested a review from a team as a code owner October 13, 2025 18:20
@mtreinish mtreinish added Changelog: None Do not include in the GitHub Release changelog. mod: circuit Related to the core of the `QuantumCircuit` class or the circuit library labels Oct 13, 2025
@qiskit-bot
Copy link
Copy Markdown
Collaborator

One or more of the following people are relevant to this code:

  • @Cryoris
  • @Qiskit/terra-core
  • @ajavadia

@mtreinish mtreinish changed the title Make RVGate a standard gate [WIP] Make RVGate a standard gate Oct 13, 2025
Comment on lines +116 to +119
det_arg = (real_det / im_det).arctan()
theta = 2 * (u00.abs() / u10.abs()).arctan()
ang1 = (u11_re / u11_im).arctan()
ang2 = (u10_re / u10_im).arctan()
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW, I'm aware these don't handle the denominator being negative correctly. But there isn't a way in a parameter expression to know at this point. This probably means we can't do it this way or come up with a different formula to go from rv -> u. But I spent the time to type all this out before realizing it so I wanted to push it up at least in a draft before reverting to this path returning None instead of a circuit.

@Cryoris
Copy link
Copy Markdown
Collaborator

Cryoris commented Oct 14, 2025

Is #6048 still something we want? What are it's applications? (pinging @ajavadia since you opened the original PR 😄)

@jakelishman
Copy link
Copy Markdown
Member

Julien: we can't accept the API changes of #6048 (see #6048 (comment)), but we kept the PR open so there was an easy handle to the synthesis, which is valid and a fine addition. It's quite nice in principle to have both Euler-angle and axis-angle decompositions accessible by default, even if we don't use the latter much.

@ShellyGarion
Copy link
Copy Markdown
Member

ShellyGarion commented Nov 19, 2025

There are now many tranpiler passes in rust that have hard-coded lists of standard gates (see e.g. #15047 and #15502), so it's worth to check how this will impact them.

@mtreinish mtreinish modified the milestones: 2.3.0, 2.4.0 Nov 21, 2025
@mtreinish mtreinish removed this from Qiskit 2.3 Nov 21, 2025
@alexanderivrii alexanderivrii modified the milestones: 2.4.0, 2.5.0 Feb 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Changelog: None Do not include in the GitHub Release changelog. mod: circuit Related to the core of the `QuantumCircuit` class or the circuit library

Projects

Status: Ready

Development

Successfully merging this pull request may close these issues.

6 participants