Skip to content

Commit

Permalink
simplify givens rotation test
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinsung committed May 8, 2024
1 parent b80e6a0 commit e139f89
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions tests/python/linalg/givens_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)


Expand Down

0 comments on commit e139f89

Please sign in to comment.