Conversation
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.
|
One or more of the following people are relevant to this code:
|
| 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() |
There was a problem hiding this comment.
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.
|
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. |
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: