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)
def test_dot_sparse_dense(self, mat_s, ket_d): cq = dot(mat_s, ket_d) assert isinstance(cq, qarray) cq = mat_s @ ket_d assert isinstance(cq, qarray) cn = mat_s._mul_vector(ket_d) assert not issparse(cq) assert isdense(cq) assert_allclose(cq.A.ravel(), cn)
def test_dot_ket(self, mat_d, ket_d): ca = dot(mat_d, ket_d) assert isinstance(ca, qarray) cn = mat_d @ ket_d assert_allclose(ca, cn)
def test_dot_sparse_sparse(self, mat_s, mat_s2): cq = dot(mat_s, mat_s2) cn = mat_s @ mat_s2 assert issparse(cq) assert_allclose(cq.A, cn.A)
def test_dot_matrix(self, mat_d, mat_d2): ca = dot(mat_d, mat_d2) assert isinstance(ca, qarray) cn = mat_d @ mat_d2 assert_allclose(ca, cn)