def test_random_product_state(self, pre_c): p = qu.rand_product_state(3) qids = qu.qid(p, dims=[2, 2, 2], inds=[0, 1, 2], precomp_func=pre_c) assert_allclose(qids(p) if pre_c else qids, [2, 2, 2])
def test_bell_state(self, bs, pre_c): p = qu.bell_state(bs) qids = qu.qid(p, dims=[2, 2], inds=[0, 1], precomp_func=pre_c) assert_allclose(qids(p) if pre_c else qids, [3, 3])