Quellcode durchsuchen

Update example

master
Pete Shadbolt vor 8 Jahren
Ursprung
Commit
86bc79156a
1 geänderte Dateien mit 2 neuen und 21 gelöschten Zeilen
  1. +2
    -21
      examples/mercedes_demo.py

+ 2
- 21
examples/mercedes_demo.py Datei anzeigen

@@ -3,7 +3,7 @@ import abp
from abp.util import xyz

def linear_cluster(n):
g = FGS(range(n), deterministic=True)
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
@@ -13,30 +13,11 @@ 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.measure(2, "px", 0)
g.remove_nodes_from((2, 3))
print g.node

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


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





Laden…
Abbrechen
Speichern