Browse Source

Making progress on #20 - stable operation.

master
Pete Shadbolt 8 years ago
parent
commit
789f3d5fa8
1 changed files with 6 additions and 4 deletions
  1. +6
    -4
      examples/visualization/stress_test.py

+ 6
- 4
examples/visualization/stress_test.py View File

@@ -1,4 +1,4 @@
from abp.fancy import GraphState
from abp import GraphState, VizClient
from abp.util import xyz from abp.util import xyz
import numpy as np import numpy as np
import time import time
@@ -31,14 +31,16 @@ def lattice(unit_cell, size):


nodes, edges = lattice(threedee_unit_cell, (4, 4, 4)) nodes, edges = lattice(threedee_unit_cell, (4, 4, 4))


psi = GraphState()
v = VizClient()
while True: while True:
psi = GraphState()
for node in nodes: for node in nodes:
v.update(psi, 0.1)
psi.add_qubit(str(node), position=xyz(node[0], node[1], node[2]), vop="identity") psi.add_qubit(str(node), position=xyz(node[0], node[1], node[2]), vop="identity")
psi.update(0.1)


for edge in edges: for edge in edges:
v.update(psi, 0.1)
psi.act_cz(str(edge[0]), str(edge[1])) psi.act_cz(str(edge[0]), str(edge[1]))
psi.update(0.1)
del psi





Loading…
Cancel
Save