Anders and Briegel in Python
No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.

21 líneas
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)