Deprecate CU1Gate
U1Gate is deprecated, so it seems sensible that CU1Gate should also be deprecated. I'm looking at the docs, where U1Gate has a deprecation warning but CU1Gate does not:
- https://docs.quantum.ibm.com/api/qiskit/qiskit.circuit.library.U1Gate
- https://docs.quantum.ibm.com/api/qiskit/qiskit.circuit.library.CU1Gate
This seems sensible - CPhaseGate is a direct replacement. Fwiw, we didn't deprecate U1Gate and friends formally in code, they're just deprecated by the documentation notice. The reason is roughly that there's still a lot of extant circuits / OQ2 code / etc out there that uses them, and keeping the gate class around so they can still be represented doesn't really hurt us.
We did deprecate (and remove) the circuit methods u1, u2 and u3, though, and I think deprecating and removing QuantumCircuit.cu1 would be equally appropriate.
There is the awkward question about CU3Gate, though; we don't have a direct replacement for that (CUGate exists, but it's a lot more awkward to use because it breaks the typical controlled-gate flow by adding in a control-phase parameter).
There is the awkward question about CU3Gate, though; we don't have a direct replacement for that (CUGate exists, but it's a lot more awkward to use because it breaks the typical controlled-gate flow by adding in a control-phase parameter).
True, though we're replacing calling CU3Gate directly, which could be (almost) directly replaced with CUGate, no?
Hi @kevinsung @jakelishman I can work on this
Sounds good @melechlapson, let us know if you want to discuss something -- otherwise @jakelishman's comment above points out some places to start 🙂
@Cryoris Should I add a deprecation warning to MCU1 as well?
Yes, as MCPhaseGate is a direct replacement we can also deprecate MCU1Gate 👍🏻
We did deprecate (and remove) the circuit methods u1, u2 and u3, though, and I think deprecating and removing QuantumCircuit.cu1 would be equally appropriate.
@jakelishman Isn't QuantumCircuit.cu1 already removed and deprecated? It's just the CU1Gate that remains
@Cryoris I opened https://github.com/Qiskit/qiskit/pull/13115 to address this. Could you review when you have time?
make sure you link it to this pull request @melechlapson or else it likely can't be found.
@Cryoris #13115 was merged, however this issue is still open, is this issue yet to be resolved?
@alphashiv27 it seems we just forgot to link the PR to this issue -- thanks for the reminder!