Quellcode durchsuchen

Tidy up examples, remove images from docs & readme

master
Pete Shadbolt vor 7 Jahren
Ursprung
Commit
d41fff969c
7 geänderte Dateien mit 19 neuen und 41 gelöschten Zeilen
  1. +1
    -5
      README.md
  2. +0
    -4
      doc/index.rst
  3. BIN
      examples/demo.gif
  4. +0
    -24
      examples/mercedes_demo.py
  5. +0
    -8
      examples/tidying_vops.py
  6. +18
    -0
      examples/visualization/issues/unpositioned_nodes.py
  7. BIN
      examples/viz.png

+ 1
- 5
README.md Datei anzeigen

@@ -2,8 +2,6 @@

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/).

![demo](examples/demo.gif)

## Installation

It's easiest to install with `pip`:
@@ -48,9 +46,7 @@ Now, in another terminal, use `abp.fancy.GraphState` to run a Clifford circuit:
>>> g.update()
```

And you should see a visualization of the state:

![demo](examples/viz.png)
And you should see a visualization of the state.

## Testing



+ 0
- 4
doc/index.rst Datei anzeigen

@@ -19,8 +19,6 @@ This is the documentation for ``abp``. It's a work in progress.
``abp`` is a Python port of Anders and Briegel' s `method <https://arxiv.org/abs/quant-ph/0504117>`_ for fast simulation of Clifford circuits.
That means that you can make quantum states of thousands of qubits, perform any sequence of Clifford operations, and measure in any of :math:`\{\sigma_x, \sigma_y, \sigma_z\}`.

.. image:: ../examples/demo.gif

Installing
----------------------------

@@ -119,8 +117,6 @@ Now, in another terminal, use ``abp.fancy.GraphState`` to run a Clifford circuit

And you should see a 3D visualization of the state. You can call ``update()`` in a loop to see an animation.

.. image:: ../examples/viz.png

Reference
----------------------------



BIN
examples/demo.gif Datei anzeigen

Vorher Nachher
Breite: 381  |  Höhe: 302  |  Größe: 517KB

+ 0
- 24
examples/mercedes_demo.py Datei anzeigen

@@ -1,24 +0,0 @@
from abp.fancy import GraphState as FGS
import abp
from abp.util import xyz

def linear_cluster(n):
g = FGS(range(n), deterministic=False)
g.act_circuit([(i, "hadamard") for i in range(n)])
g.act_circuit([((i, i+1), "cz") for i in range(n-1)])
return g


def test_mercedes_example_1():
""" Run an example provided by mercedes """

g = linear_cluster(5)
g.measure(2, "px", 1)
g.measure(3, "px", 1)
g.remove_vop(0, 1)
g.remove_vop(1, 0)
print g.node

if __name__ == '__main__':
test_mercedes_example_1()

+ 0
- 8
examples/tidying_vops.py Datei anzeigen

@@ -1,8 +0,0 @@
import abp

# TODO

# make a random state

# try to tidy up such that all VOPs are in (X, Y, Z)


+ 18
- 0
examples/visualization/issues/unpositioned_nodes.py Datei anzeigen

@@ -0,0 +1,18 @@
from abp.fancy import GraphState
import networkx as nx

edges = [(0,1),(1,2),(2,3),(3,4)]
nodes = [(i, {'x': i, 'y': 0, 'z':0}) for i in range(5)]
gs = GraphState()

for node, position in nodes:
gs.add_qubit(node, position=position)
gs.act_hadamard(node)

for edge in edges:
gs.act_cz(*edge)
gs.update(3)
# a single line of qubits are created along the x axis
gs.add_qubit('start')
gs.update(0)
# a curved 5-qubit cluster and single qubit is depicted

BIN
examples/viz.png Datei anzeigen

Vorher Nachher
Breite: 529  |  Höhe: 321  |  Größe: 10KB

Laden…
Abbrechen
Speichern