|
|
@@ -4,11 +4,12 @@ import numpy as np |
|
|
|
import time |
|
|
|
import itertools |
|
|
|
|
|
|
|
square_unit_cell = ( |
|
|
|
((0, 0), (0, 1)), ((0, 0), (1, 0)), ((1, 0), (1, 1)), ((0, 1), (1, 1))) |
|
|
|
funny_unit_cell = (((0, 0), (0, 1)), ((0, 0), (1, 0)), |
|
|
|
((1, 0), (1, 1)), ((0, 1), (1, 1)), ((0, 0), (.5, .5))) |
|
|
|
|
|
|
|
threedee_unit_cell = ( |
|
|
|
(( 0, 0, 0), (0, 1, 0)), |
|
|
|
(( 0, 0, 0), (1, 0, 0)), |
|
|
|
(( 1, 0, 0), (1, 1, 0)), |
|
|
|
(( 0, 1, 0), (1, 1, 0))) |
|
|
|
) |
|
|
|
|
|
|
|
def add_offset(vector, offset): |
|
|
|
""" Offset a vector in n-dimensional space """ |
|
|
@@ -29,7 +30,7 @@ def lattice(unit_cell, size): |
|
|
|
nodes = set(itertools.chain(*edges)) |
|
|
|
return nodes, edges |
|
|
|
|
|
|
|
nodes, edges = lattice(funny_unit_cell, (4, 4)) |
|
|
|
nodes, edges = lattice(threedee_unit_cell, (4, 4, 4)) |
|
|
|
|
|
|
|
for j in range(100): |
|
|
|
psi = GraphState() |
|
|
|