Skip to content

Commit

Permalink
fix angles in orbital_rotation
Browse files Browse the repository at this point in the history
  • Loading branch information
bartandrews committed Nov 8, 2024
1 parent f2b9e90 commit e99a1fd
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions python/ffsim/tenpy/circuits/gates.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
# copyright notice, and modified files need to carry a notice indicating
# that they have been altered from the originals.

import cmath
import math

import numpy as np
import scipy as sp
import tenpy.linalg.np_conserved as npc
Expand Down Expand Up @@ -359,9 +362,8 @@ def apply_orbital_rotation(

# apply the Givens rotation gates
for gate in givens_list:
theta = np.arccos(gate.c)
s = np.conj(gate.s)
phi = np.real(1j * np.log(-s / np.sin(theta))) if theta else 0
theta = math.acos(gate.c)
phi = cmath.phase(gate.s) - np.pi
conj = True if gate.j < gate.i else False
apply_gate2(
psi,
Expand Down

0 comments on commit e99a1fd

Please sign in to comment.