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.

25 lignes
637B

  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 list(range(REPEATS)):
  8. c = mock.random_stabilizer_circuit(n)
  9. g = mock.AndersWrapper(list(range(n)))
  10. g.act_circuit(c)
  11. da = g.get_full_stabilizer().to_dictionary()
  12. g = mock.ABPWrapper(list(range(n)))
  13. g.act_circuit(c)
  14. db = g.to_stabilizer().to_dictionary()
  15. assert da == db
  16. def test_stabilizer_access():
  17. g = GraphState(3)
  18. print(g.to_stabilizer()[0, 0])