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.

23 lines
534B

  1. from abp import GraphState
  2. from anders_briegel import graphsim
  3. def test_z_measurement():
  4. g = GraphState([0])
  5. assert g.measure_z(0, 0) == 0
  6. assert g.measure_z(0, 1) == 1
  7. def test_y_measurement():
  8. g = GraphState([0])
  9. assert g.measure_y(0, 0) == 0
  10. assert g.measure_y(0, 1) == 1
  11. #def test_z_measurement_against_ab():
  12. #for i in range(10):
  13. #a = graphsim.GraphRegister(1)
  14. #b = GraphState()
  15. #b.add_node(0)
  16. #print a.measure(0, graphsim.lco_Z)
  17. #print b.measure(0, "pz")