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.

19 lines
463B

  1. from abp.fancy import GraphState
  2. import networkx as nx
  3. edges = [(0,1),(1,2),(2,3),(3,4)]
  4. nodes = [(i, {'x': i, 'y': 0, 'z':0}) for i in range(5)]
  5. gs = GraphState()
  6. for node, position in nodes:
  7. gs.add_qubit(node, position=position)
  8. gs.act_hadamard(node)
  9. for edge in edges:
  10. gs.act_cz(*edge)
  11. gs.update(3)
  12. # a single line of qubits are created along the x axis
  13. gs.add_qubit('start')
  14. gs.update(0)
  15. # a curved 5-qubit cluster and single qubit is depicted