Skip to content

Commit

Permalink
Actually do that
Browse files Browse the repository at this point in the history
  • Loading branch information
thangleiter committed Oct 13, 2024
1 parent ca46833 commit 46ab275
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions tests/test_basis.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,16 +152,22 @@ def test_basis_properties(self):

base._print_checks()

orthonorm = stats.ortho_group(d).rvs()
# single element always considered orthonormal
orthonorm = rng.normal(size=(d, d))
self.assertTrue(orthonorm.view(ff.Basis).isorthonorm)

herm = 1j * linalg.logm(stats.unitary_group(d).rvs())
herm = testutil.rand_herm(d).squeeze()
self.assertTrue(herm.view(ff.Basis).isherm)

traceless = stats.multivariate_normal().rvs((d, d))
traceless -= traceless.trace() / d
herm[0, 1] += 1
self.assertFalse(herm.view(ff.Basis).isherm)

traceless = testutil.rand_herm_traceless(d).squeeze()
self.assertTrue(traceless.view(ff.Basis).istraceless)

traceless[0, 0] += 1
self.assertFalse(traceless.view(ff.Basis).istraceless)

def test_transpose(self):
arr = rng.normal(size=(2, 3, 3))
b = arr.view(ff.Basis)
Expand Down

0 comments on commit 46ab275

Please sign in to comment.