From eb6580852596a5bc85ca2fe7ade0403fdb7755f1 Mon Sep 17 00:00:00 2001 From: Pete Shadbolt Date: Mon, 25 Jul 2016 01:26:44 +0100 Subject: [PATCH] Update README and docs --- README.md | 7 +++---- abp/clifford.py | 2 +- doc/index.rst | 19 +++++++++---------- 3 files changed, 13 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 491ecaf..bb9fdf5 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,8 @@ Python port of Anders and Briegel' s [method](https://arxiv.org/abs/quant-ph/0504117) for fast simulation of Clifford circuits. Should do thousands of qubits without much trouble. +**You can read the full documentation [here](https://peteshadbolt.co.uk/abp/)**. + ![demo](examples/demo.gif) ## Installation @@ -19,9 +21,6 @@ $ git clone https://github.com/peteshadbolt/abp.git $ python setup.py install --user ``` -# Documentation - -You can read the documentation [here](https://peteshadbolt.co.uk/abp/). ## Visualization @@ -65,4 +64,4 @@ $ nosetests 53 tests run in 39.5 seconds (53 tests passed) ``` -Currently I use some reference implementations of `CHP` and `graphsim` which you won't have installed, hence some tests will fail with `ImportErrors`. You can ignore those :feelsgood:. +Currently I use some reference implementations of `CHP` and `graphsim` which you won't have installed, hence some tests will fail with `ImportErrors`. You can ignore those. diff --git a/abp/clifford.py b/abp/clifford.py index 33d3063..c22437e 100644 --- a/abp/clifford.py +++ b/abp/clifford.py @@ -47,7 +47,7 @@ def conjugate(operator, unitary): return measurement_table[operator, unitary] def use_old_cz(): - """ Use the CZ table from A&B's code """ + """ Use the CZ lookup table from A&B's code, rather than our own. Useful for testing. """ global cz_table from anders_cz import cz_table diff --git a/doc/index.rst b/doc/index.rst index 411476f..34de1b3 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -104,6 +104,13 @@ The Clifford group .. automodule:: abp.clifford +| + +The ``clifford`` module provides a few useful functions: + +.. autofunction:: abp.clifford.use_old_cz + :noindex: + Visualization ---------------------- @@ -121,17 +128,9 @@ Then browse to ``http://localhost:5001/`` (in some circumstances ``abp`` will au Now, in another terminal, use ``abp.fancy.GraphState`` to run a Clifford circuit:: >>> from abp.fancy import GraphState - >>> g = GraphState(10) >>> g = GraphState(range(10)) - >>> for i in range(10): - ... g.act_hadamard(i) - ... - >>> g.update() - >>> for i in range(9): - ... g.act_cz(i, i+1) - ... - >>> g.update() - ``` + >>> g.act_circuit([(i, "hadamard") for i in range(10)]) + >>> g.act_circuit([((i, i+1), "cz") for i in range(9)]) And you should see a 3D visualization of the state.