Translational symmetry with generator defined hoppings
While constructing series of hopping automatically using the hopping_generator modifier I noted that the model created in this way has troubles in dealing with periodic boundary conditions.
I attach a simple example for a basic graphene system
from math import pi, sqrt
import numpy as np
from scipy.spatial import cKDTree
import matplotlib.pyplot as plt
import pybinding as pb
from pybinding.repository.graphene import a, a_cc, t
def monolayer_graphene():
lat = pb.Lattice([a/2, a*np.sqrt(3)/2], [-a/2, a*np.sqrt(3)/2])
lat.add_sublattices(("A", [0, 0]),
("B", [0, a_cc]))
return lat
@pb.hopping_generator("intralayer", energy=t)
def intralayer_generator(x, y, z):
positions = np.stack([x, y, z], axis=1)
layer = (z == 0)
d_min = a_cc * 0.98
d_max = a_cc * 1.1
kdtree1 = cKDTree(positions[layer])
kdtree2 = cKDTree(positions[layer])
coo = kdtree1.sparse_distance_matrix(kdtree2, d_max, output_type='coo_matrix')
idx = coo.data > d_min
abs_idx = np.flatnonzero(layer)
row, col = abs_idx[coo.row[idx]], abs_idx[coo.col[idx]]
return row, col
lattice = monolayer_graphene()
model = pb.Model(lattice, intralayer_generator, pb.translational_symmetry())
solver = pb.solver.lapack(model)
Gamma = [0, 0]
K1 = [-4*pi / (3*sqrt(3)*a_cc), 0]
M = [0, 2*pi / (3*a_cc)]
K2 = [2*pi / (3*sqrt(3)*a_cc), 2*pi / (3*a_cc)]
bands = solver.calc_bands(K1, Gamma, M, K2)
bands.plot(point_labels=['K', r'$\Gamma$', 'M', 'K'])
The bands are computed incorrectly (they're simply confused with the starting Hamiltonian eigenvalues). Is there a way to enforce translation symmetry for a lattice with hoppings created by a generator?
Hi Currently, the hopping generator does not work over boundaries. We are currently doing that by constructing a large lattice and defining the hoppings 'by hand' in a script. This code is too long to share here, but it's something that on the lists of ideas to add. If you are using pybinding, you can get the latest version by 'pio install pybinding-dev'. There are some problems I'll fix by next week, mainly due to updating the dependencies. Best Bert