From e7ae0841dc90ee7127ba7ca66c0a817f34d1e2e0 Mon Sep 17 00:00:00 2001 From: Pete Shadbolt Date: Sat, 19 Nov 2016 18:51:29 -0800 Subject: [PATCH] Fix up 2D lattice example. --- examples/visualization/lattice_2d.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/examples/visualization/lattice_2d.py b/examples/visualization/lattice_2d.py index cd4450c..256d867 100644 --- a/examples/visualization/lattice_2d.py +++ b/examples/visualization/lattice_2d.py @@ -1,4 +1,4 @@ -from abp.fancy import GraphState +from abp import GraphState, VizClient from abp.util import xyz import numpy as np import time @@ -33,12 +33,13 @@ def lattice(unit_cell, size): nodes, edges = lattice(square_unit_cell, (10, 10)) psi = GraphState() +v = VizClient() for node in nodes: psi.add_qubit(str(node), position=xyz(node[0], node[1])) psi.act_hadamard(str(node)) - psi.update(0.1) + v.update(psi, 0.1) for edge in edges: psi.act_cz(str(edge[0]), str(edge[1])) -psi.update(0.1) +v.update(psi, 0.1)