Dear Kristjan,

First, I would like to say that your problem is not very clear. If what you want is to calculate the conductance in the x direction for a system infinite in the x and y directions, you should know that the result is infinite.On Mon, Feb 13, 2017 at 3:28 PM, Kristjan Eimre <kristjaneimre@gmail.com> wrote:

Hello once again,Thanks for all the help so far.In my initial problem, I wanted to calculate the tunneling probability from bulk metal to "bulk" vacuum. The potential landscape is periodic in the "transverse" directions and assuming the free electron model, plane waves should come from the bulk and try to tunnel through the barrier. The main result I want is the tunneling probability dependence on the wave vector or D(k).At first, I naively though that I could just point the finite-width leads at different angles (different k vectors) at the surface and have a big lead in the vacuum as the output. This doesn't work very well, as the result depends heavily on the size of the leads, orientation of the vacuum lead and on the shape of the scattering region. In the ideal case, I would like the result to be independent of these parameters.For example, the tunneling probability through the rectangular barrier matches with the analytical case if the scattering region is the same width as the leads, but if I change the shape and/or add periodic boundary conditions, the result doesn't match with the analytical case any more.I have looked around and found the wraparound module (https://gitlab.kwant-project.org/cwg/wraparound ), which looks like it's exactly the thing I need. However the demo code doesn't really illustrate how to calculate transmission with arbitrary k vectors. How should I attach the leads and how to make them also periodic? As the first step, I would like to use this wraparound code on a system of infinite plane of rectangular barrier and reproduce the analytical result (when the incident plane wave is normal to the barrier). Could you give me some advice on how to achieve this?Best regards,KristjanOn Mon, Dec 19, 2016 at 8:15 PM, Abbout Adel <abbout.adel@gmail.com> wrote:Dear Kristjan,>>> " And the conductance is the sum of the transmission probabilities of the conduction channels, right? "Yes this is correct.The number of conducting channels goes to zeros at higher energies because you work in a lattice: the dispersion relation is not anymore E=k^2 .In a lattice, the dispersion relation for a mode 'm' is E_m=4t-e_m-2*cos(k) (where e_m=-2*cos(m*pi/(W+1)))in order to recover the results of the continuum, you need to work at low energies.in your case, you need to change the theoretical relation by putting a shift 2-2*cos(pi/(W+1)) for the energies and this will work for the first mode. you need to do the same thing (shift 2-e_m) for the other modes and make a sum of the transmissions to obtain the results for higher modes.a script is included below to show how we recover the exact result.I hope that this helpsAdelimport kwantfrom numpy import sqrt,sin,cos,pi,sinh# For plottingfrom matplotlib import pyplotdef make_system(a=1, t=1.0, W=10, L=30,V0=0):lat = kwant.lattice.square(a)sys = kwant.Builder()sys[(lat(x, y) for x in range(L) for y in range(W))] = 4*t+V0sys[lat.neighbors()] = -t#### Define and attach the leads. ####lead = kwant.Builder(kwant.TranslationalSymmetry((-a, 0))) lead[(lat(0, j) for j in range(W))] = 4 * tlead[lat.neighbors()] = -tsys.attach_lead(lead)sys.attach_lead(lead.reversed()) return sysdef plot_conductance(sys, energies):# Compute conductancedata = []for energy in energies:smatrix = kwant.smatrix(sys, energy)data.append(smatrix.transmission(1, 0)) # pyplot.figure()pyplot.plot(energies, data,lw=2,label="numerics")pyplot.xlabel("well depth [t]")pyplot.ylabel("conductance [e^2/h]")pyplot.legend()pyplot.show()def main():V0=0.1sys = make_system(V0=V0)# Check that the system looks as intended.# kwant.plot(sys)# Finalize the system.sys = sys.finalized()e1=2-2*cos(pi/11) #energy of the first transverse modedef Cond(E,V0,L=30):if E-e1-V0<=0:k=sqrt(-E+e1+V0)return 1/(1+((V0*sinh(k*L))**2 )/(4*(E-e1)*(-E+e1+V0)))else:k=sqrt(E-e1-V0)return 1/(1+((V0*sin(k*L))**2 )/(4*(E-e1)*(E-e1-V0)))energies=[0.1+0.001 * i for i in range(300)]Cond_analytic=[Cond(E,V0) for E in energies]pyplot.plot(energies,Cond_analytic,"ro",label="analytic") # We should see conductance steps.plot_conductance(sys, energies)# Call the main function if the script gets executed (as opposed to imported).if __name__ == '__main__':main()--On Mon, Dec 19, 2016 at 4:25 PM, Kristjan Eimre <kristjaneimre@gmail.com> wrote:Hello again,Thanks for the ideas. I have fiddled around with Kwant a bit now, and I'm trying to recreate quantum tunneling through rectangular potential barrier (see [1] for analytical solution). I have also added a figure of the analytical solution (rect_trans.png), which shows the transmission probability dependence on electron energy.I modified the 1st tutorial code to include the rectangular barrier (see my code in [2]). I have attached the figures i got from the code (conductance.png and rect_trans.png). If i have understood correctly, then Kwant outputs the conductance depending on excitation energy. And the conductance is the sum of the transmission probabilities of the conduction channels, right?I probably should delve deep into books on quantum transport to understand some of these things, but perhaps you could give me some answers for a good start. I have also calculated the number of conduction channels, but this goes to 0 at higher energies. Why does this occur? In the simple analytical case, there is no upper bound on electron energies.Is it even possible to recreate the analytical quantum tunneling result for the rectangle barrier in Kwant?Best regards,

KristjanAbbout Adel

--

Abbout Adel