Skip to content

Commit

Permalink
progress
Browse files Browse the repository at this point in the history
  • Loading branch information
ziofil committed Dec 19, 2024
1 parent 15ac3bb commit 1e75cd3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
15 changes: 8 additions & 7 deletions mrmustard/physics/triples.py
Original file line number Diff line number Diff line change
Expand Up @@ -812,14 +812,15 @@ def complex_fourier_transform_Abc(n_modes: int) -> tuple[Matrix, Vector, Scalar]
Returns:
The ``(A, b, c)`` triple of the complex fourier transform.
"""
O2n = math.zeros((2 * n_modes, 2 * n_modes))
On = math.zeros((n_modes, n_modes))
In = math.eye(n_modes)
Omega = math.block([[On, In], [-In, In]])
mOmega = math.block([[On, -In], [In, In]])
A = math.block([[O2n, mOmega], [Omega, O2n]])
O = math.zeros((n_modes, n_modes))
I = math.eye(n_modes)
# A = math.block([[O, O, O, -I],
# [O, O, I, -I],
# [O, I, O, O],
# [-I,-I, O, O]])
A = math.block([[O, O, O, -I], [O, O, I, O], [O, I, O, O], [-I, O, O, O]])
b = _vacuum_B_vector(4 * n_modes)
c = (1.0 + 0j) * np.pi ** (n_modes)
c = 1.0 + 0j # * np.pi ** (n_modes)
return A, b, c


Expand Down
4 changes: 2 additions & 2 deletions tests/test_lab_dev/test_transformations/test_cft.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def test_init(self):
def test_wigner_function(self):
r"""
Tests that the characteristic function is converted to the Wigner function
for a single-mode squeezed state.
for a single-mode displaced squeezed state.
"""

state = Ket.random([0]) >> Dgate([0], x=1.0, y=0.1)
Expand All @@ -45,7 +45,7 @@ def test_wigner_function(self):
vec = np.linspace(-5, 5, 100)
wigner, _, _ = wigner_discretized(dm, vec, vec)

Wigner = (state >> CFT([0]).inverse() >> BtoPS([0], s=0)).ansatz
Wigner = (state >> CFT([0]) >> BtoPS([0], s=0)).ansatz
X, Y = np.meshgrid(
vec * np.sqrt(2 / settings.HBAR), vec * np.sqrt(2 / settings.HBAR)
) # scaling to take care of HBAR
Expand Down

0 comments on commit 1e75cd3

Please sign in to comment.