From 51bdb17d31701653505715c9fb2c37ed5c4560eb Mon Sep 17 00:00:00 2001 From: Pete Shadbolt Date: Thu, 5 May 2016 18:22:46 +0100 Subject: [PATCH] Comments --- cz_table.py | 1 + tables.py | 1 - tests/test_graph.py | 7 +++++-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/cz_table.py b/cz_table.py index f6770de..19ca112 100644 --- a/cz_table.py +++ b/cz_table.py @@ -11,6 +11,7 @@ no_bond = np.kron(qi.plus, qi.plus) for u in tables.unitaries: psi = qi.cz*np.kron(u, qi.ha)*bond + print u for bb in bond, no_bond: for a in tables.unitaries: diff --git a/tables.py b/tables.py index 3e4ddcd..826a32c 100644 --- a/tables.py +++ b/tables.py @@ -50,7 +50,6 @@ def construct_tables(filename="tables.cache"): cPickle.dump(output, f) return output - decompositions = ("xxxx", "xx", "zzxx", "zz", "zxx", "z", "zzz", "xxz", "xzx", "xzxxx", "xzzzx", "xxxzx", "xzz", "zzx", "xxx", "x", "zzzx", "xxzx", "zx", "zxxx", "xxxz", "xzzz", "xz", "xzxx") diff --git a/tests/test_graph.py b/tests/test_graph.py index a8e25f1..6011fc7 100644 --- a/tests/test_graph.py +++ b/tests/test_graph.py @@ -4,6 +4,7 @@ import time def demograph(): + """ A graph for testing with """ g = GraphState() g.add_edge(0, 1) g.add_edge(1, 2) @@ -13,7 +14,8 @@ def demograph(): return g -def test_graph(): +def test_graph_basic(): + """ Test that we can construct graphs, delete edges, whatever """ g = demograph() assert g.ngbh[0] == set([1, 2, 3]) g.del_edge(0, 1) @@ -58,9 +60,10 @@ def test_edgelist(): def test_million_sites(): - """ Testing that making a graph of tent housand qubits takes less than half a second""" + """ Testing that making a graph of ten thousand qubits takes less than half a second""" g = GraphState() t = time.clock() for i in xrange(100000): g.add_edge(i, i + 1) assert time.clock() - t < .5 +