# Re: [Kwant] Conductance for a rectangular geometry

Dear Amrita,

This is a normal result: your two systems are different. In fact, if you
zoom on your left lead you will see that the upper and the bottom parts of
your lead do not communicate. There are hoppings missing and thus the two
situations are not the same. (check the enclosed figure).

I hope this helps.

On Thu, Feb 22, 2018 at 2:23 AM, amrita chapagain <amritachapag...@gmail.com
> wrote:

> Hi,
>
> 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_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
>
> #-----------------------------------------------------------
> ---------------------------------
> ---------------------
> 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
> #-----------------------------------------------------------
> ----------------------------------
> 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) )
>
>     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)
>

--