Exemple #1
0
 def test_op(self):
     x = np.matrix([[1, 0], [0, 0]])
     assert (not isket(x))
     assert (not isbra(x))
     assert (isop(x))
     assert (not isvec(x))
     x = sp.csr_matrix(x)
     assert (not isket(x))
     assert (not isbra(x))
     assert (isop(x))
     assert (not isvec(x))
Exemple #2
0
 def test_dot_sparse_dense_ket(self, mat_s, ket_d):
     cq = dot(mat_s, ket_d)
     cn = mat_s @ ket_d
     assert not issparse(cq)
     assert isdense(cq)
     assert isket(cq)
     assert_allclose(cq.A, cn)