Anders and Briegel in Python
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

21 lines
432B

  1. from abp.fancy import GraphState
  2. from abp.util import xyz
  3. from abp.clifford import *
  4. psi = GraphState()
  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)