Anders and Briegel in Python
Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

vor 7 Jahren
vor 7 Jahren
vor 7 Jahren
vor 7 Jahren
vor 7 Jahren
vor 7 Jahren
vor 7 Jahren
vor 7 Jahren
vor 7 Jahren
vor 7 Jahren
vor 7 Jahren
vor 7 Jahren
vor 7 Jahren
vor 7 Jahren
vor 7 Jahren
vor 7 Jahren
vor 7 Jahren
vor 7 Jahren
vor 7 Jahren
vor 7 Jahren
vor 7 Jahren
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. # abp
  2. Python port of Anders and Briegel' s [method](https://arxiv.org/abs/quant-ph/0504117) for fast simulation of Clifford circuits. You can read the full documentation [here](https://peteshadbolt.co.uk/abp/).
  3. ![demo](examples/demo.gif)
  4. ## Installation
  5. It's easiest to install with `pip`:
  6. ```shell
  7. $ pip install --user abp
  8. ```
  9. Or clone and install in `develop` mode:
  10. ```shell
  11. $ git clone https://github.com/peteshadbolt/abp.git
  12. $ cd abp
  13. $ python setup.py develop --user
  14. $ python setup.py develop --user --prefix= # Might be required on OSX
  15. ```
  16. ## Visualization
  17. `abp` comes with a tool to visualize graph states in a WebGL compatible web browser (Chrome, Firefox, Safari etc). It uses a client-server architecture.
  18. First, run `abpserver` in a terminal:
  19. ```shell
  20. $ abpserver
  21. Listening on port 5000 for clients..
  22. ```
  23. Then browse to `http://localhost:5001/` (in some circumstances `abp` will automatically pop a browser window).
  24. Now, in another terminal, use `abp.fancy.GraphState` to run a Clifford circuit:
  25. ```python
  26. >>> from abp.fancy import GraphState
  27. >>> g = GraphState(range(10))
  28. >>> for i in range(10):
  29. ... g.act_hadamard(i)
  30. ...
  31. >>> g.update()
  32. >>> for i in range(9):
  33. ... g.act_cz(i, i+1)
  34. ...
  35. >>> g.update()
  36. ```
  37. And you should see a visualization of the state:
  38. ![demo](examples/viz.png)
  39. ## Testing
  40. `abp` has a bunch of tests. You can run them all with `nose`:
  41. ```shell
  42. $ nosetests
  43. 53 tests run in 39.5 seconds (53 tests passed)
  44. ```
  45. Currently I use some reference implementations of `CHP` and `graphsim` which you won't have installed, so a bunch of tests will be skipped. That's expected.