Pete Shadbolt před 8 roky
rodič
revize
b88341a91b
7 změnil soubory, kde provedl 25 přidání a 10 odebrání
  1. +0
    -2
      README.md
  2. +2
    -0
      TODO.mkd
  3. +4
    -3
      abp/graphstate.py
  4. +1
    -2
      doc/index.rst
  5. +4
    -2
      examples/visualization/lattice_3d.py
  6. +13
    -0
      makefile
  7. +1
    -1
      setup.py

+ 0
- 2
README.md Zobrazit soubor

@@ -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.


+ 2
- 0
TODO.mkd Zobrazit soubor

@@ -0,0 +1,2 @@
- Test circuit - measure - circuit - measure
- Can't make

+ 4
- 3
abp/graphstate.py Zobrazit soubor

@@ -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:


+ 1
- 2
doc/index.rst Zobrazit soubor

@@ -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



+ 4
- 2
examples/visualization/lattice_3d.py Zobrazit soubor

@@ -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()


+ 13
- 0
makefile Zobrazit soubor

@@ -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

+ 1
- 1
setup.py Zobrazit soubor

@@ -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",


Načítá se…
Zrušit
Uložit