@@ -11,6 +11,7 @@ no_bond = np.kron(qi.plus, qi.plus) | |||||
for u in tables.unitaries: | for u in tables.unitaries: | ||||
psi = qi.cz*np.kron(u, qi.ha)*bond | psi = qi.cz*np.kron(u, qi.ha)*bond | ||||
print u | |||||
for bb in bond, no_bond: | for bb in bond, no_bond: | ||||
for a in tables.unitaries: | for a in tables.unitaries: | ||||
@@ -50,7 +50,6 @@ def construct_tables(filename="tables.cache"): | |||||
cPickle.dump(output, f) | cPickle.dump(output, f) | ||||
return output | return output | ||||
decompositions = ("xxxx", "xx", "zzxx", "zz", "zxx", "z", "zzz", "xxz", | decompositions = ("xxxx", "xx", "zzxx", "zz", "zxx", "z", "zzz", "xxz", | ||||
"xzx", "xzxxx", "xzzzx", "xxxzx", "xzz", "zzx", "xxx", "x", | "xzx", "xzxxx", "xzzzx", "xxxzx", "xzz", "zzx", "xxx", "x", | ||||
"zzzx", "xxzx", "zx", "zxxx", "xxxz", "xzzz", "xz", "xzxx") | "zzzx", "xxzx", "zx", "zxxx", "xxxz", "xzzz", "xz", "xzxx") | ||||
@@ -4,6 +4,7 @@ import time | |||||
def demograph(): | def demograph(): | ||||
""" A graph for testing with """ | |||||
g = GraphState() | g = GraphState() | ||||
g.add_edge(0, 1) | g.add_edge(0, 1) | ||||
g.add_edge(1, 2) | g.add_edge(1, 2) | ||||
@@ -13,7 +14,8 @@ def demograph(): | |||||
return g | return g | ||||
def test_graph(): | |||||
def test_graph_basic(): | |||||
""" Test that we can construct graphs, delete edges, whatever """ | |||||
g = demograph() | g = demograph() | ||||
assert g.ngbh[0] == set([1, 2, 3]) | assert g.ngbh[0] == set([1, 2, 3]) | ||||
g.del_edge(0, 1) | g.del_edge(0, 1) | ||||
@@ -58,9 +60,10 @@ def test_edgelist(): | |||||
def test_million_sites(): | 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() | g = GraphState() | ||||
t = time.clock() | t = time.clock() | ||||
for i in xrange(100000): | for i in xrange(100000): | ||||
g.add_edge(i, i + 1) | g.add_edge(i, i + 1) | ||||
assert time.clock() - t < .5 | assert time.clock() - t < .5 | ||||