Graphene例子
import kwant
# Define the scattering Region
L = 15
W = 10
lat = kwant.lattice.honeycomb()
subA, subB = lat.sublattices
def family_color(site):
if site.family == subA:
return 'red'
if site.family == subB:
return 'blue'
syst = kwant.Builder()
syst[(subA(i, j) for i in range(L) for j in range(W))] = 0
syst[(subB(i, j) for i in range(L) for j in range(W))] = 0
syst[lat.neighbors()] = -1
def in_hole(site):
x, y = site.pos # position relative to centre
return y == 0 or y > 8
for site in filter(in_hole, list(syst.sites())):
del syst[site]
# left lead
sym0 = kwant.TranslationalSymmetry(lat.vec((-1, 0)))
sym1 = kwant.TranslationalSymmetry(lat.vec((1, 0)))
def lead_shape(pos):
x, y = pos
return (0 < y < 8)
lead0 = kwant.Builder(sym0)
lead0[lat.shape(lead_shape, (0, 0))] = 0
lead0