-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cu3 simulated matrix false on unitary simulator #546
Comments
It appears there that the definition of (Less important but you swapped the target and control qubits between the two cases, the "standard" cnot in qiskit is |
This is in the tutorial and i have not decided what we should do. i am leaning towards deleting this gate and making a new one that we call cU which is a four parameter gate that has the three phases in cU3 and a relative phase. I would also like to change the name of cU1(theta) to cphase(theta) |
I am aware of the difference of u3 in the formula with what we have. I wrote a note emphasizing the importance of global phase in control-U and its difference with just U. But that part is now missing. I will try to recover that part. |
Okey so the c-U3 is false in the current implementation. I corrected the phase shift with a c-RZZ: from sympy import pi
def crzz(circuit, theta, ctrl, target):
circuit.cu1(theta, ctrl, target)
circuit.cx(ctrl, target)
circuit.cu1(theta, ctrl, target)
circuit.cx(ctrl, target)
def crx(circuit, theta, ctrl, target):
# Apply the supposed c-RX operation.
circuit.cu3(theta, pi/2, 3*pi/2, ctrl, target)
# For the moment, QISKit adds a phase to the U-gate, so we
# need to correct this phase with a controlled Rzz.
crzz(circuit, pi, ctrl, target) About the representation of quantum gates, I think there should be a huge warning somewhere that the representation used by QISKit is not the one used in the literature.
|
cU3 is ambiguous and i agree we need to make it clearer. A real cU should have 4 variables not 3. The tensor order has been described in many places (see the tutorials) and it will be clearer in the documentation when we redo it. |
Closed by #2755 |
Informations
What is the current behavior?
The
cu3
gate simulated with thelocal_unitary_simulator
does not produce the expected matrix for acu3
gate.Steps to reproduce the problem
Execute the script:
Output on my machine:
What is the expected behavior?
The two printed matrices should be equal.
Suggested solutions
The problem might be in:
cu3
gate inqiskit.extensions.standard.header
.I don't have any solution for the moment.
The text was updated successfully, but these errors were encountered: