-
Notifications
You must be signed in to change notification settings - Fork 118
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
A little inconsistency of the gate RZ #70
Comments
Thanks! The only issue is that a phase becomes important in a controlled-operation. Say that the matrix is Currently the qasm Line 73 in 0aced69
But if one uses qiskit, one would expect (as you mentioned), to have I assume that the other rotations don't have inconsistencies ( |
So I ended up implementing |
Great. A well-thought-out solution. Thanks. The rx and ry are consistent. |
The current implementation of the gate RZ is simply to call
Rn(theta, {0, 0, 1})
. That is good. The current definition of the rz in the QASM isgate rz(phi) a { u1(phi) a; }
. They will end up with two different matrices. Both are correct, but they just look different. Let me illustrate them in this image:The
Rn(theta, {0, 0, 1})
will be in the form of "A";gate rz(phi) a { u1(phi) a; }
"B".Since the latter looks prettier, would it be nice to shift the phase by θ/2, as suggested in the image, before the
cmat RZ(double theta) const
returns?How do you think?
The text was updated successfully, but these errors were encountered: