Exemple #1
0
 def test_circuit_extract_preserves_semantics(self):
     random.seed(SEED)
     g = cliffordT(5, 70, 0.15)
     t = g.to_tensor()
     clifford_simp(g, quiet=True)
     c = streaming_extract(g)
     t2 = c.to_tensor()
     self.assertTrue(compare_tensors(t, t2))
Exemple #2
0
 def test_streaming_extract(self):
     random.seed(SEED)
     for i in range(5):
         circ = cliffordT(4,50,0.1)
         t = tensorfy(circ)
         clifford_simp(circ,quiet=True)
         with self.subTest(i=i):
             c = streaming_extract(circ)
             t2 = c.to_tensor()
             self.assertTrue(compare_tensors(t,t2))