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.

25 lines
556B

  1. from abp.fancy import GraphState as FGS
  2. import abp
  3. from abp.util import xyz
  4. def linear_cluster(n):
  5. g = FGS(range(n), deterministic=False)
  6. g.act_circuit([(i, "hadamard") for i in range(n)])
  7. g.act_circuit([((i, i+1), "cz") for i in range(n-1)])
  8. return g
  9. def test_mercedes_example_1():
  10. """ Run an example provided by mercedes """
  11. g = linear_cluster(5)
  12. g.measure(2, "px", 1)
  13. g.measure(3, "px", 1)
  14. g.remove_vop(0, 1)
  15. g.remove_vop(1, 0)
  16. print g.node
  17. if __name__ == '__main__':
  18. test_mercedes_example_1()