I was implementing controlled S and T gates in qiskit and was wondering if there is any difference between using the cu1
and crz
gates for this purpose. Qiskit doesn't seem to include explicit versions of these two gates.
circuit = qiskit.QuantumCircuit(2)
# a)
circuit.crz(theta=math.pi/2, control_qubit=0, target_qubit=1)
# b)
circuit.cu1(theta=math.pi/2, control_qubit=0, target_qubit=1)
In terms of the unitary the cu1
gate seems closer to what one would want, I would assume. Are there any other consequences I should be aware of?
cp
will be more concise, but luciano's answer using Gate().control renders more nicely in diagrams (as controlled S not as controlled P (pi/2)) $\endgroup$