import kwant
import numpy as np
import matplotlib.pyplot as plt
from numpy import pi, sin, cos
sqrt3 = np.sqrt(3)
def onsite(site, mu, dis, salt):
return -mu
def hopping(site1, site2, t, delta):
return t
def len_vec(site, pos0=(0., 0.)):
return np.sqrt((site.pos[0] - pos0[0])**2 +
(site.pos[1] - pos0[1])**2)
# Unit vectors of graphene lattice
unit_vecs_graphene = np.array([sqrt3 * np.array([cos(phi), sin(phi)]) for phi in 2*pi/3*np.arange(3)])
# Unit vectors of Kekule lattice
unit_vecs_kekule = np.array([3. * np.array([cos(phi), sin(phi)]) for phi in pi/6 + 2*pi/3*np.arange(3)])
# Shifts of sublattices in graphene
sublat_shifts = [(cos(phi), sin(phi)) for phi in pi/6+pi/3*np.arange(2)]
Constructing graphene prototype builder:
# Constructing graphene prototype builder
lat_graphene = kwant.lattice.general(unit_vecs_graphene[:2], sublat_shifts)
l0, l1 = lat_graphene.sublattices
graphene = kwant.Builder(kwant.TranslationalSymmetry(*unit_vecs_graphene[:2]))
graphene[l0(0, 0)] = onsite
graphene[l1(0, 0)] = onsite
graphene[kwant.HoppingKind((0, 0), l1, l0)] = hopping
graphene[kwant.HoppingKind((1, 0), l1, l0)] = hopping
graphene[kwant.HoppingKind((0, 1), l0, l1)] = hopping
len(list(graphene.sites()))
2
Testing graphene prototype builder:
test_syst = kwant.Builder()
test_syst.fill(graphene, lambda s: len_vec(s) < 12, (0, 0));
kwant.plot(test_syst);
Increasing sites of unit cell to host six sites around (0, 0). Expecting to have 6 sites in unit cell.
kekule = kwant.Builder(kwant.TranslationalSymmetry(*unit_vecs_kekule[:2]))
kekule.fill(graphene, lambda s: len_vec(s) < 1.5, (0, 0))
len(list(kekule.sites()))
4
Missing sites:
test_syst = kwant.Builder()
test_syst.fill(kekule, lambda s: len_vec(s) < 12, (0, 0));
kwant.plot(test_syst);
Workaround: take larger radius
kekule = kwant.Builder(kwant.TranslationalSymmetry(*unit_vecs_kekule[:2]))
kekule.fill(graphene, lambda s: len_vec(s) < 2.5, (0, 0))
len(list(kekule.sites()))
6
test_syst = kwant.Builder()
test_syst.fill(kekule, lambda s: len_vec(s) < 12, (0, 0));
kwant.plot(test_syst);