| @@ -19,8 +19,6 @@ $ git clone https://github.com/peteshadbolt/abp.git | |||||
| $ python setup.py install --user | $ python setup.py install --user | ||||
| ``` | ``` | ||||
| ## Visualization | ## 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. | `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. | ||||
| @@ -0,0 +1,2 @@ | |||||
| - Test circuit - measure - circuit - measure | |||||
| - Can't make | |||||
| @@ -326,7 +326,8 @@ class GraphState(object): | |||||
| # TODO | # TODO | ||||
| def to_state_vector(self): | 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``:: | The output state is represented as a ``abp.qi.CircuitModel``:: | ||||
| @@ -334,8 +335,8 @@ class GraphState(object): | |||||
| |00000>: 0.18+0.00j | |00000>: 0.18+0.00j | ||||
| |00001>: 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: | if len(self.node) > 15: | ||||
| @@ -71,8 +71,7 @@ It's pretty easy to build a graph state, act some gates, and do measurements:: | |||||
| Working with GraphStates | 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 | .. autoclass:: abp.GraphState | ||||
| @@ -3,6 +3,7 @@ from abp.util import xyz | |||||
| import numpy as np | import numpy as np | ||||
| import time | import time | ||||
| import itertools | import itertools | ||||
| import networkx as nx | |||||
| threedee_unit_cell = ( | threedee_unit_cell = ( | ||||
| (( 0, 0, 0), (0, 1, 0)), | (( 0, 0, 0), (0, 1, 0)), | ||||
| @@ -40,7 +41,7 @@ def lattice(unit_cell, size): | |||||
| nodes = set(itertools.chain(*edges)) | nodes = set(itertools.chain(*edges)) | ||||
| return nodes, edges | return nodes, edges | ||||
| nodes, edges = lattice(threedee_unit_cell, (4, 4, 4)) | |||||
| nodes, edges = lattice(threedee_unit_cell, (1, 1, 1)) | |||||
| psi = GraphState() | psi = GraphState() | ||||
| for node in nodes: | for node in nodes: | ||||
| @@ -49,6 +50,7 @@ for node in nodes: | |||||
| for edge in edges: | for edge in edges: | ||||
| psi.act_cz(str(edge[0]), str(edge[1])) | psi.act_cz(str(edge[0]), str(edge[1])) | ||||
| psi.update(0.1) | |||||
| nx.rename_no | |||||
| print psi.to_state_vector() | |||||
| @@ -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 | |||||
| @@ -6,7 +6,7 @@ STATIC = glob("abp/static/*.*")+glob("abp/static/img/*.*")+glob("abp/static/scri | |||||
| setup( | setup( | ||||
| name = "abp", | name = "abp", | ||||
| version = "0.4.7", | |||||
| version = "0.4.8", | |||||
| packages = ["abp", "abp.static"], | packages = ["abp", "abp.static"], | ||||
| test_suite = "tests", | test_suite = "tests", | ||||
| author = "Pete Shadbolt", | author = "Pete Shadbolt", | ||||