Ejemplo n.º 1
0
import majoranaJJ.operators.sparse.qmsops as spop #sparse operators
import majoranaJJ.lattice.nbrs as nb #neighbor arrays
import majoranaJJ.lattice.shapes as shps #lattice shapes
import majoranaJJ.modules.plots as plots #plotting functions

R = 20

coor = shps.halfdisk(R)
NN = nb.NN_Arr(coor)
NNb = nb.Bound_Arr(coor)

idx = 0
plots.lattice(idx, coor, NN = NN)
plots.lattice(idx, coor, NNb = NNb)
Ejemplo n.º 2
0
coor = shps.halfdisk(R)
print("size: ", coor.shape[0])
print("")

###########################################

#Using old method, scaled by N^2 due to a loop within a loop
start = time.time()
NN_old = nb2.NN_Arr(coor)
end = time.time()
print("Time to create Nbr_Arr with original method = {} [s]".format(end -
                                                                    start))
print(NN_old[0:5, :])

idx = 0
plots.lattice(idx, coor, NN=NN_old)
print(" ")

###########################################

start = time.time()
NN_new = nb.NN_Arr(coor)
end = time.time()
print("Time to create Nbr_Arr with revised method = {} [s]".format(end -
                                                                   start))
print(NN_new[0:5, :])

idx = 0
plots.lattice(idx, coor, NN=NN_new)
print(" ")