Sfoglia il codice sorgente

Update example

master
Pete Shadbolt 8 anni fa
parent
commit
86bc79156a
1 ha cambiato i file con 2 aggiunte e 21 eliminazioni
  1. +2
    -21
      examples/mercedes_demo.py

+ 2
- 21
examples/mercedes_demo.py Vedi File

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





Loading…
Annulla
Salva