Dear Mohit,

I see the formula you are mentioning using the matsubara frequencies. 

To use that expression, you need to use imaginary energies.
The steps are;

Sites1=[lat(5,j) for j in range(W)]  # the sites where to mount lead 2
Sites2=[lat(6,j) for j in range(W)]  # the sites where to mount lead 3

mount_vlead(sys, Sites1, 4)     # number of orbitals =4. Here we mount lead number 2
mount_vlead(sys, Sites2, 4)     # number of orbitals =4. Here we mount lead number 3
syst=sys.finalized()
G12=greens_function(syst, energy=-1.8*1j, in_leads=[3],out_leads=[2], check_hermiticity=False).data
G21=greens_function(syst, ,energy=-1.8*1j, in_leads=[2],out_leads=[3], check_hermiticity=False).data
H12=syst.hamiltonian_submatrix(to_sites=Sites1, from_sites=Sites2)
H21=syst.hamiltonian_submatrix(to_sites=Sites2, from_sites=Sites1)

Notices that, we had to use "check_hermiticity=False" because for these complex energies, the system is not hermitian

Trace(np.dot(H21, G12)-np.dot(H12,G21) ))  # check if the order is correct.


I hope this helps.
Adel


On Wed, Jun 17, 2020 at 6:51 PM <mohit.gupta9607@gmail.com> wrote:
Dear Abbout,
I apologize for not being clear in my question. My system is infinite (that is there are leads attached to the system) and I mounted virtual leads at points where I wanted kwant to evaluate green's function. Sorry about that.

The formula that I am using is from the supplementary material of the following  paper:
https://journals.aps.org/prl/abstract/10.1103/PhysRevLett.120.047702
It is possible that I am misinterpreting the formula as given in the paper as am very new to the subject.

I want to evaluate critical current in the Josephson Junction by maximizing current-phase dependency, for that I need total current in the system as a function of phase difference phi, I am not sure how to do that with local current operator in kwant.

Thank you for clarifying the output of green's function I am now sure that I was reading the output wrong which must have been the primary reason for getting zero.

I again apologize if I am not clear about what I am saying.


--
Abbout Adel