Hello everyone, i would appreciate any suggestion you could give me to
solve this
I'm trying to attach a couple of leads to my structure, I have the code for
both, but I want to know how to make that both leads begin with the same
atom,
In the code below you can see that the left lead starts in a gray atom,
while the lead in the right side starts in the couple of atoms blue and
yellow, if I increase the size of the structure it only creates another
primitive cell and the case is the same
Is there a way to make that the right lead starts in a gray atom as the
left lead, like only creating half primitive cell?
Thanks in advance
Here is the code
import kwant
from matplotlib import pyplot
%matplotlib tk
PrimVec = [(3.176, 0, 0), (1.588, 2.7504, 0), (0, 0, 17.49)]
base = [(0, 0, 0), (1.588, 0.9168, 0.8745), (0, 0, 1.749)]
lat = kwant.lattice.general(prim_vecs = PrimVec, basis = base)
d, e, f= lat.sublattices
def make_cuboid(t=1.0, a=15, b=10, c=5):
def cuboid_shape(pos):
x, y, z = pos
return 0 <= x < a and 0 <= y < b and 0 <= z < c
syst = kwant.Builder()
syst[lat.shape(cuboid_shape, (0, 0, 0))] = 4 * t
hoppings = (((1, 0, 0), d, e), ((0, 0, 0), d, e),((0, 1, 0), d, e),
((0, 0, 0), f, e), ((1, 0, 0), f, e), ((0, 1, 0), f, e))
syst[[kwant.builder.HoppingKind(*hopping) for hopping in hoppings]] = -6
lead = kwant.Builder(kwant.TranslationalSymmetry((-3.176, 0, 0)))
def lead_shape(pos):
return 0 <= pos[1] < b and 0 <= pos[2] < c
lead[lat.shape(lead_shape, (0, 0, 0))] = 4 * t
lead[[kwant.builder.HoppingKind(*hopping) for hopping in hoppings]] = -6
syst.attach_lead(lead)
syst.attach_lead(lead.reversed())
return syst
def main():
syst = make_cuboid(a=30, b=14, c=4)
def family_colors(site):
if site.family == d:
return 'yellow'
elif site.family == e:
return 'gray'
else:
return 'blue'
kwant.plot(syst, site_size=0.25, site_lw=0.025, hop_lw=0.05,
site_color=family_colors)
syst = syst.finalized()
if __name__ == '__main__':
main()