Dear Mohit,

The Caroli et al formula gives the tunneling current in a system connected to electrodes (leads in our terminology).
A lead is an infinite system which has the important characteristics that it exhibits a complex self energy with a negative imaginary part. 

If you had constructed your leads normally, this imaginary part would have been  present automatically in the conduction region (the bands).
Since you put fictitious leads with a zero self energy, you will obtain no current.

Change your self energy to something like: -1j* Gamma/2 where Gamma is a norbs x norbs definite positive matrix. It should work like this.


I hope this helps,
Adel 

On Wed, Jun 10, 2020 at 4:22 AM <mohit.gupta9607@gmail.com> wrote:
I have been trying to evaluate current through a josephson junction using the green function formalism using the following formula:
   I=2 (e Kb T)/hbar(sum over matsubara freq.)(H_ij G_ij-H_ji G_ji)
To calculate current I have mounted two virtual leads on the slabs where I want to evaluate the current using the following code:

def mount_vlead(sys, vlead_interface, norb):
    dim = len(vlead_interface)*norb
    zero_array = np.zeros((dim, dim), dtype=float)
    def selfenergy_func(energy, args=()):
        return zero_array

    vlead = kwant.builder.SelfEnergyLead(selfenergy_func, vlead_interface,())
    sys.leads.append(vlead)

where vlead_interace was supplied using the following code:

v1=kwant.Builder()
v1[(lat(nx_1,i) for i in range(ny))]=(2*t-mu_n)*tau_z
v1[lat.neighbors()]=-t*tau_z
v2=kwant.Builder()
v2[(lat(nx_2,i) for i in range(ny))]=(2*t-mu_n)*tau_z
v2[lat.neighbors()]=-t*tau_z
mount_vlead(syst,v2.sites(),2)

Here nx_1 and nx_2 are the two points where the points where I have mounted virtual leads. Then I have used the greens_function solver in kwant to evaluate green function for a given matsubara frequency.
The issue that i am facing is that I am getting identical diagonal elements in green_function.submatrix(v1,v2) and green_function.submatrix(v2,v1), thus when taking trace it gives me zero as the hopping matrix is same.


--
Abbout Adel