Skip to content

Commit

Permalink
Debug euler_angles_1q()
Browse files Browse the repository at this point in the history
  • Loading branch information
WrathfulSpatula committed Nov 15, 2024
1 parent 059dad0 commit fd0a5c6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pyqrack/qrack_circuit.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@

def euler_angles_1q(m):
phase = (m[0][0] * m[1][1] - m[0][1] * m[1][1]) ** (-1.0/2.0)
U = [phase * m[0][0], phase * m[0][1], phase * m[1][0], phase * m[1][1]]
U = [[phase * m[0][0], phase * m[0][1]], [phase * m[1][0], phase * m[1][1]]]

theta = 2 * math.atan2(abs(U[1]), abs(U[0]))
theta = 2 * math.atan2(abs(U[1][0]), abs(U[0][0]))

# Find phi and lambda
phiplambda = 2 * np.angle(U[3])
phimlambda = 2 * np.angle(U[1])
phiplambda = 2 * np.angle(U[1][1])
phimlambda = 2 * np.angle(U[1][0])

phi = (phiplambda + phimlambda) / 2.0
lamb = (phiplambda - phimlambda) / 2.0
Expand Down

0 comments on commit fd0a5c6

Please sign in to comment.