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.

20 lines
371B

  1. from abp.graphstate import GraphState
  2. from anders_briegel import graphsim
  3. def test_1():
  4. N=10
  5. a = graphsim.GraphRegister(N)
  6. b = GraphState()
  7. for i in range(N):
  8. a.hadamard(i)
  9. b.add_vertex(i)
  10. b.act_hadamard(i)
  11. for i in range(N-1):
  12. a.cphase(i, i+1)
  13. b.act_cz(i, i+1)
  14. assert a.get_adj_list() == b.adj_list()