diff --git a/README.md b/README.md index b93cc40..8600532 100644 --- a/README.md +++ b/README.md @@ -19,8 +19,6 @@ $ git clone https://github.com/peteshadbolt/abp.git $ python setup.py install --user ``` - - ## Visualization `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. diff --git a/TODO.mkd b/TODO.mkd new file mode 100644 index 0000000..cca0b98 --- /dev/null +++ b/TODO.mkd @@ -0,0 +1,2 @@ +- Test circuit - measure - circuit - measure +- Can't make diff --git a/abp/graphstate.py b/abp/graphstate.py index 31b2d3e..bd1783e 100644 --- a/abp/graphstate.py +++ b/abp/graphstate.py @@ -326,7 +326,8 @@ class GraphState(object): # TODO def to_state_vector(self): - """ Get the full state vector corresponding to this stabilizer state. Useful for debugging, interface with other simulators. + """ Get the full state vector corresponding to this stabilizer state. Useful for debugging, interface with other simulators. + This method becomes very slow for more than about ten qubits! The output state is represented as a ``abp.qi.CircuitModel``:: @@ -334,8 +335,8 @@ class GraphState(object): |00000>: 0.18+0.00j |00001>: 0.18+0.00j ... - .. warning:: - Obviously this method becomes very slow for more than about ten qubits! + .. todo:: + Doesn't work with non-``int`` node labels """ if len(self.node) > 15: diff --git a/doc/index.rst b/doc/index.rst index 7eaba33..a9dd61f 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -71,8 +71,7 @@ It's pretty easy to build a graph state, act some gates, and do measurements:: Working with GraphStates ------------------------- -The ``abp.GraphState`` class is your main interface to ``abp``. -Here follows complete documentation +The ``abp.GraphState`` class is the main interface to ``abp``. .. autoclass:: abp.GraphState diff --git a/examples/visualization/lattice_3d.py b/examples/visualization/lattice_3d.py index 3b5ef95..e0fad0e 100644 --- a/examples/visualization/lattice_3d.py +++ b/examples/visualization/lattice_3d.py @@ -3,6 +3,7 @@ from abp.util import xyz import numpy as np import time import itertools +import networkx as nx threedee_unit_cell = ( (( 0, 0, 0), (0, 1, 0)), @@ -40,7 +41,7 @@ def lattice(unit_cell, size): nodes = set(itertools.chain(*edges)) return nodes, edges -nodes, edges = lattice(threedee_unit_cell, (4, 4, 4)) +nodes, edges = lattice(threedee_unit_cell, (1, 1, 1)) psi = GraphState() for node in nodes: @@ -49,6 +50,7 @@ for node in nodes: for edge in edges: psi.act_cz(str(edge[0]), str(edge[1])) - psi.update(0.1) +nx.rename_no +print psi.to_state_vector() diff --git a/makefile b/makefile new file mode 100644 index 0000000..9e5a11f --- /dev/null +++ b/makefile @@ -0,0 +1,13 @@ +DOC_DIR = doc + +.PHONY: doc + +doc: + $(MAKE) -C $(DOC_DIR) html + +sdist: + python setup.py build sdist + +deploy: sdist doc + $(MAKE) -C $(DOC_DIR) deploy + python setup.py sdist register upload diff --git a/setup.py b/setup.py index 0a263dc..049e00c 100755 --- a/setup.py +++ b/setup.py @@ -6,7 +6,7 @@ STATIC = glob("abp/static/*.*")+glob("abp/static/img/*.*")+glob("abp/static/scri setup( name = "abp", - version = "0.4.7", + version = "0.4.8", packages = ["abp", "abp.static"], test_suite = "tests", author = "Pete Shadbolt",