Anders and Briegel in Python
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
420B

  1. import abp
  2. import numpy as np
  3. from anders_briegel import graphsim
  4. def wah():
  5. N = 10
  6. a = graphsim.GraphRegister(N)
  7. for i in range(1000):
  8. if np.random.random()>0.5:
  9. j = np.random.randint(0, N-1)
  10. a.hadamard(j)
  11. else:
  12. q = np.random.randint(0, N-2)
  13. a.cphase(q, q+1)
  14. a.print_stabilizer()
  15. u = abp.GraphState(xrange(2))
  16. print u.to_stabilizer()