Anders and Briegel in Python
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

26 lignes
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])