Hi,

I want to add two leads on left instead. I have attached two leads and try
to find conductance and compare with just one lead on left. The results for
two leads and just one lead is not same. Can you help me what I am doing
wrong here?

I have attached my code here.

import kwant                      # Recursive green function method
import numpy as np                # Module with advanced math commands
from matplotlib import pyplot
from numpy import sqrt
from math import *


#======================================================================
# Define the shape -------------------
#======================================================================
def wv_shape(pos):
    x, y = pos
    return (np.abs(2.0*x)<=L)&(np.abs(y)<W1/2.0)
#----------------------------------------------------------------------

a      = 1;     # Lattice constant
t      = 1;     # Coupling between sites
E0L    = 0*t    # On-site potential in the lead
L      = 18;  # Length of the
W1   = 90;  # Width on the left

# Define geometry
--------------------------------------------------------------------------
sys0 = kwant.Builder()
lat  = kwant.lattice.square(a)
#--------------------------------------------------------------------------------------------
# Define onsite energies and couplings
----------------------------------------------------
sys0[lat.shape(wv_shape,(0,0))] = E0     # To make all sites the same
sys0[lat.neighbors()]           = t
#--------------------------------------------------------------------------------------------

# Left lead
----------------------------------------------------------------------------------
left_lead1 = kwant.Builder(kwant.TranslationalSymmetry([-1,0]))   # The
lead goes to minus infinity
left_lead2 = kwant.Builder(kwant.TranslationalSymmetry([-1,0]))   # The
lead goes to minus infinity
left_lead1[(lat(0,y) for y in range(int(-W1/2+1),0))] = E0L
left_lead2[(lat(0,y) for y in range(0,int(W1/2)))] = E0L
left_lead1[lat.neighbors()] = t                                   #
Couplings in the lead
left_lead2[lat.neighbors()] = t                                   #
Couplings in the lead
sys0.attach_lead(left_lead1);
sys0.attach_lead(left_lead2);

#--------------------------------------------------------------------------------------------
# Right lead
---------------------------------------------------------------------------------
right_lead = kwant.Builder(kwant.TranslationalSymmetry([1,0]))   # The lead
goes to plus infinity
right_lead[(lat(0,y) for y in range(int(-W1/2+1),int(W1/2)))] = E0L
right_lead[lat.neighbors()] = t                                  #
Couplings in the lead
sys0.attach_lead(right_lead);
#---------------------------------------------------------------------------------------------
sys = sys0.finalized()
kwant.plot(sys);                                             # Plots the
shape


def plot_conductance(sys, energies):

    data = []
    for energy in energies:
        smatrix = kwant.smatrix(sys, energy)
        data.append(smatrix.transmission(2, 0)+smatrix.transmission(1,2) )
        #transmission from left 2 leads to right lead

    pyplot.figure()
    pyplot.plot(energies, data)
    pyplot.xlabel("energy [t]")
    pyplot.ylabel("conductance [e^2/h]")
    pyplot.show()
energies=[-3+i*0.02 for i in range(100)]
plot_conductance(sys,energies)

Reply via email to