Anders and Briegel in Python
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

mercedes_demo.py 556B

123456789101112131415161718192021222324
  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()