Dear Gabriel,
Try this:
from matplotlib import pyplot as plt
from matplotlib import backends
import kwant
t = 1 # hopping parameter
L=5
lat = kwant.lattice.general([(1,0),(0,1)],[(0,0),(.5,0)], norbs=1)
a, b = lat.sublattices
syst = kwant.Builder()
# Scattering region
for i in range(L):
syst[a(i, 0)] = 0
syst[b(i, 0)] = 0
syst[kwant.builder.HoppingKind((0, 0), a, b)] = -t
syst[kwant.builder.HoppingKind((1, 0), a, b)] = -t
#syst[lat.neighbors()]=-t
kwant.plot(syst)
plt.show()
# leaft lead (lead 1)
lat_lead1 = kwant.lattice.general([(1,0),(0,1)],[(0,0)], norbs=1).sublattices[0]
sym_lead1 = kwant.TranslationalSymmetry((-1, 0))
syst[lat_lead1(-1,0)] = 0
syst[lat_lead1(-1,0),lat_lead1(0,0)] = -t
syst[lat_lead1(5,0)] = 0
syst[lat_lead1(5,0),b(4,0)] = -t
lead1 = kwant.Builder(sym_lead1)
lead1[lat_lead1(0,0)] = 0
lead1[lat_lead1.neighbors()] = -t
syst.attach_lead(lead1)
syst.attach_lead(lead1.reversed())
kwant.plot(syst)
# In[77]:
import numpy as np
sysf=syst.finalized()
# In[78]:
Trans=[]
energies=np.linspace(-1.99,1.99,100)
for energy in energies:
SM=kwant.smatrix(sysf,energy)
T=SM.transmission(0,1)
Trans.append(T)
# In[79]:
from matplotlib import pyplot
pyplot.plot(energies,Trans)
pyplot.show()
Regards,