Simulate graph states in the browser
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

test.py 434B

1234567891011121314151617181920
  1. """
  2. Makes a dummy post to the test server
  3. """
  4. import requests
  5. import json
  6. import abp
  7. def test_graph():
  8. N = 100
  9. g = abp.NXGraphState(range(N), vop="hadamard")
  10. for i in range(N-1):
  11. g.act_cz(i, i+1)
  12. g.layout()
  13. return g
  14. if __name__ == '__main__':
  15. data = json.dumps(test_graph().to_json(stringify=False))
  16. r = requests.post("http://localhost:5000/graph", data=data)
  17. print r.status_code, r.content