I know that U1 equivalent gate of Qiskit in Q# is R1, but I would like to implement U2 and U3 gate of Qiskit in Q#, what is the best way ?
Thank you.
Quantum Computing Stack Exchange is a question and answer site for engineers, scientists, programmers, and computing professionals interested in quantum computing. It only takes a minute to sign up.
Sign up to join this communityI know that U1 equivalent gate of Qiskit in Q# is R1, but I would like to implement U2 and U3 gate of Qiskit in Q#, what is the best way ?
Thank you.
The gates Rx, Ry and Rz in Q# have the same definition as RXGate, RYGate and RZGate in Qiskit, and the U2Gate and U3Gate documentation offers decomposition of these gates into Rx, Ry and Rz, so I would just use that decomposition:
operation U2(psi : Double, lambda : Double, q : Qubit) : Unit is Adj + Ctl {
Rz(lambda, q);
Ry(0.5 * PI(), q);
Rz(psi, q);
}
and a similar one for U3.