From e139f8994e90506d0cc6544dbfaef6d001797f86 Mon Sep 17 00:00:00 2001 From: "Kevin J. Sung" Date: Wed, 8 May 2024 12:05:52 -0400 Subject: [PATCH] simplify givens rotation test --- tests/python/linalg/givens_test.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tests/python/linalg/givens_test.py b/tests/python/linalg/givens_test.py index 304584ddd..ff3c9c5de 100644 --- a/tests/python/linalg/givens_test.py +++ b/tests/python/linalg/givens_test.py @@ -53,11 +53,9 @@ def test_givens_decomposition_reconstruct(dim: int): for i, phase_shift in enumerate(phase_shifts): reconstructed[i] *= phase_shift for c, s, i, j in givens_rotations[::-1]: - reconstructed = reconstructed.T.copy() - reconstructed[j], reconstructed[i] = zrot( - reconstructed[j], reconstructed[i], c, s.conjugate() + reconstructed[:, j], reconstructed[:, i] = zrot( + reconstructed[:, j], reconstructed[:, i], c, s.conjugate() ) - reconstructed = reconstructed.T np.testing.assert_allclose(reconstructed, mat)