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.

17 rindas
442B

  1. from abp import GraphState
  2. from anders_briegel import graphsim
  3. def test_measurements():
  4. g = GraphState([0])
  5. print g
  6. assert all(g.measure(0, "pz") == 0 for i in range(100)), "Measuring |0> in Z gives 0"
  7. def test_z_measurement_against_ab():
  8. for i in range(10):
  9. a = graphsim.GraphRegister(1)
  10. b = GraphState()
  11. b.add_node(0)
  12. #print a.measure(0, graphsim.lco_Z)
  13. #print b.measure(0, "pz")