File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -152,16 +152,22 @@ def test_basis_properties(self):
152
152
153
153
base ._print_checks ()
154
154
155
- orthonorm = stats .ortho_group (d ).rvs ()
155
+ # single element always considered orthonormal
156
+ orthonorm = rng .normal (size = (d , d ))
156
157
self .assertTrue (orthonorm .view (ff .Basis ).isorthonorm )
157
158
158
- herm = 1j * linalg . logm ( stats . unitary_group ( d ).rvs () )
159
+ herm = testutil . rand_herm ( d ).squeeze ( )
159
160
self .assertTrue (herm .view (ff .Basis ).isherm )
160
161
161
- traceless = stats .multivariate_normal ().rvs ((d , d ))
162
- traceless -= traceless .trace () / d
162
+ herm [0 , 1 ] += 1
163
+ self .assertFalse (herm .view (ff .Basis ).isherm )
164
+
165
+ traceless = testutil .rand_herm_traceless (d ).squeeze ()
163
166
self .assertTrue (traceless .view (ff .Basis ).istraceless )
164
167
168
+ traceless [0 , 0 ] += 1
169
+ self .assertFalse (traceless .view (ff .Basis ).istraceless )
170
+
165
171
def test_transpose (self ):
166
172
arr = rng .normal (size = (2 , 3 , 3 ))
167
173
b = arr .view (ff .Basis )
You can’t perform that action at this time.
0 commit comments