Anders and Briegel in Python
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

mercedes_demo.py 556B

pirms 8 gadiem
pirms 8 gadiem
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()