Anders and Briegel in Python
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

test_stabilizer.py 574B

123456789101112131415161718192021
  1. from abp import GraphState
  2. from tqdm import tqdm
  3. import mock
  4. REPEATS = 1000
  5. def test_stabilizers_against_anders_and_briegel(n=10):
  6. """ Test that stabilizers are line-for-line equivalent """
  7. for i in tqdm(range(REPEATS), "Stabilizer representation VS A&B"):
  8. c = mock.random_stabilizer_circuit(n)
  9. g = mock.AndersWrapper(range(n))
  10. g.act_circuit(c)
  11. da = g.get_full_stabilizer().to_dictionary()
  12. g = mock.ABPWrapper(range(n))
  13. g.act_circuit(c)
  14. db = g.to_stabilizer().to_dictionary()
  15. assert da == db