|
|
@@ -19,7 +19,7 @@ raussendorf_unit_cell = ( |
|
|
|
((2, 1, 0), (2, 1, 1)), ((2, 0, 1), (2, 1, 1)), |
|
|
|
((2, 1, 2), (2, 1, 1)), ((2, 2, 1), (2, 1, 1)), |
|
|
|
((1, 0, 0), (1, 0, 1)), ((0, 0, 1), (1, 0, 1)), |
|
|
|
((1, 0, 2), (1, 0, 1)), ((2, 0, 1), (1, 0, 1)), |
|
|
|
((1, 0, 2), (1, 0, 1)), ((2, 0, 1), (1, 0, 1)), |
|
|
|
((1, 2, 0), (1, 2, 1)), ((0, 2, 1), (1, 2, 1)), |
|
|
|
((1, 2, 2), (1, 2, 1)), ((2, 2, 1), (1, 2, 1))) |
|
|
|
|
|
|
@@ -31,7 +31,8 @@ def add_offset(vector, offset): |
|
|
|
|
|
|
|
def offset_unit_cell(unit_cell, offset): |
|
|
|
""" Offset a unit cell """ |
|
|
|
return {(add_offset(a, offset), add_offset(b, offset)) for a, b in unit_cell} |
|
|
|
return {(add_offset(a, offset), add_offset(b, offset)) |
|
|
|
for a, b in unit_cell} |
|
|
|
|
|
|
|
|
|
|
|
def lattice(unit_cell, size): |
|
|
@@ -43,12 +44,13 @@ def lattice(unit_cell, size): |
|
|
|
nodes = set(itertools.chain(*edges)) |
|
|
|
return nodes, edges |
|
|
|
|
|
|
|
nodes, edges = lattice(raussendorf_unit_cell, (2, 2, 3 )) |
|
|
|
|
|
|
|
nodes, edges = lattice(raussendorf_unit_cell, (2, 2, 3)) |
|
|
|
|
|
|
|
psi = GraphState() |
|
|
|
for node in nodes: |
|
|
|
x, y, z = node |
|
|
|
color = "red" if (x+y+z) % 2 > 0 else "black" |
|
|
|
color = "red" if (x+y+z) % 2 > 0 else "black" |
|
|
|
psi.add_qubit(node, position=xyz(*node), color=color) |
|
|
|
psi.act_hadamard(node) |
|
|
|
|
|
|
@@ -56,4 +58,3 @@ for edge in edges: |
|
|
|
psi.act_cz(edge[0], edge[1]) |
|
|
|
|
|
|
|
psi.push() |
|
|
|
|