Anders and Briegel in Python
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

26 řádky
658B

  1. from abp import GraphState
  2. import mock
  3. import pytest
  4. ab = pytest.importorskip("ab")
  5. REPEATS = 1000
  6. def test_stabilizers_against_anders_and_briegel(n=10):
  7. """ Test that stabilizers are line-for-line equivalent """
  8. for i in list(range(REPEATS)):
  9. c = mock.random_stabilizer_circuit(n)
  10. g = ab.AndersWrapper(list(range(n)))
  11. g.act_circuit(c)
  12. da = g.get_full_stabilizer().to_dictionary()
  13. g = mock.ABPWrapper(list(range(n)))
  14. g.act_circuit(c)
  15. db = g.to_stabilizer().to_dictionary()
  16. assert da == db
  17. def test_stabilizer_access():
  18. g = GraphState(3)
  19. print(g.to_stabilizer()[0, 0])