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
381B

  1. from abp import GraphState, VizClient
  2. from abp.util import xyz
  3. # Prepare to visualize
  4. v = VizClient()
  5. # Make a graph state with position attributes
  6. g = GraphState()
  7. for i in range(5):
  8. g.add_qubit(i, position=xyz(i, 0, 0), vop="identity")
  9. g.act_czs((0,1),(1,2),(2,3),(3,4))
  10. # Show it
  11. v.update(g, 3)
  12. # Add a qubit with no position
  13. g.add_qubit('start')
  14. # Show it
  15. v.update(g)