Update MCX synthesis to use `PhaseGate` instead of `U1Gate`
Summary
We should update the synthesis methods to use the PhaseGate instead of the IBM-legacy U1Gate, if possible.
See https://github.com/Qiskit/qiskit/pull/12961#discussion_r1719719621.
RZGate also should be fine if you prefer to centralise on the rx/ry/rz set to make the logic simpler - just needs a couple of local operations to account for the phase difference.
Hello.. if nobody is working on this, I would like to take this up.
Hi @Ak-ash22, yes that would be great! 🙂 You can start by having a look at the functions in https://github.com/Qiskit/qiskit/blob/5757fa0a34ea3edd4565555e2ebdecbbeb0db387/qiskit/synthesis/multi_controlled/mcx_synthesis.py and see whether any tests fail if substituting the U1/CU1/MCU1Gate for the Phase/CPhase/MCPhaseGate 🙂
Hi @Cryoris @jakelishman I changed the CU1/MCU1Gate to the CPhase/MCPhaseGate . I didnt find the file mcx_synthesis.py using U1Gate in it though.
For these changes in the file, the test seems to be holding up.
I did the following tests:
- tox -eblack
- tox -elint-incr
- tox -epy ----- this throws a error in the file
qiskit/qiskit/__init__.pywith some moduleqiskit._accelerate.circuit, which I think is not because of my changes.
Is this all good? Am I missing something?
Could you open a draft PR with your changes? Without code to look at it's difficult to give feedback. 🙂