diff --git a/thewalrus/symplectic.py b/thewalrus/symplectic.py index 19a1ccfd8..6e698340c 100644 --- a/thewalrus/symplectic.py +++ b/thewalrus/symplectic.py @@ -279,4 +279,4 @@ def rotation(theta): array: rotation matrix by angle theta """ V = np.identity(1) * np.exp(1j * theta) - return V + return interferometer(V) diff --git a/thewalrus/tests/test_symplectic.py b/thewalrus/tests/test_symplectic.py index e6a8c3d78..c5c9f11b5 100644 --- a/thewalrus/tests/test_symplectic.py +++ b/thewalrus/tests/test_symplectic.py @@ -175,9 +175,8 @@ def test_beamsplitter(self, tol): def test_rotation(self, tol): """Test that a rotation returns the correct symplectic for an abritrary angle""" theta = 0.98 - U = symplectic.rotation(theta) - S = symplectic.interferometer(U) - expected = np.block([[U.real, -U.imag], [U.imag, U.real]]) + S = symplectic.rotation(theta) + expected = np.block([[np.cos(theta), -np.sin(theta)], [np.sin(theta), np.cos(theta)]]) np.allclose(S, expected, atol=tol, rtol=0)