Anders and Briegel in Python
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

try_stabilizing.py 420B

8 년 전
123456789101112131415161718192021
  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()