You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
That's a design choice we made: U is a general 1-qubit gate and CU is a general 2-qubit gate, which needs the additional angle. I agree this can be confusing coming from the circuit method usage. We could consider adding a dispatch that allows to handle the case where only 3 parameters are given to the cu method, though this might open the door to accidentally using the wrong signature...
URL to the relevant documentation
https://docs.quantum.ibm.com/api/qiskit/qiskit.circuit.library.CU1Gate
Select all that apply
Describe the fix.
from qiskit import QuantumCircuit
from math import pi
#create the circuit
circuit = QuantumCircuit(4, 4)
circuit.cu(-pi/2, -pi/2, pi/2,0, 1, 3)
circuit.cu(-pi/2, 0 , 0, 3,2, 1)
circuit.draw(output='mpl', plot_barriers=False, fold=-1)
It is strange to show the four phase in a cu gate while useful parameter is only the three phase and the control qubit and target qubit
#easier form to understand which keeps receiving Error - cu() missing 1 required positional argument: 'target_qubit'
circuit.cu(-pi/2, -pi/2, pi/2, 1, 3)
The text was updated successfully, but these errors were encountered: