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.

21 lines
444B

  1. from abp.viz import VisibleGraphState
  2. from abp.util import xyz
  3. from abp.clifford import *
  4. psi = VisibleGraphState()
  5. psi.add_node(0, position = xyz(0, 0))
  6. psi.add_node(1, position = xyz(1, 1))
  7. psi.add_node(2, position = xyz(3, 2))
  8. psi.add_node(3, position = xyz(0, 3))
  9. for n in psi.node:
  10. psi.act_hadamard(n)
  11. psi.act_cz(0, 1)
  12. psi.act_cz(0, 3)
  13. psi.act_cz(1, 3)
  14. psi.act_cz(1, 2)
  15. while True:
  16. psi.update()
  17. psi.local_complementation(1)