Dear Joe,
Thanks for your reply. Now I can try some calculations through Green's function.
Best wishes,
Weiyuan Tong

On Thu, May 14, 2015 at 2:05 AM, Joseph Weston <joseph.weston@cea.fr> wrote:
Hi,

> Dear authors,
> I found a description for the greens_function in the Kwant document:
> "This function can be used to calculate the conductance and other
> transport properties of a system", so, we can also use the fisher-lee
> relation to calculate the conductance in Kwant?

Absolutely! In fact, if you look in the kwant source code in
solvers/common.py around line 778 you'll see the calculation of:

        Tr(Γ_out G_out Γ_in G⁺_in)

Which is exactly the expression for the transmission using the
Fisher-Lee relation. In general it is better to use the scattering
matrix to calculate transmissions, as the calculation is more stable (as
noted in the kwant docs), but using Greens functions can be useful when
trying to calculate more complicated currents (e.g. spin current)
when the scattering modes are not eigenvectors of the associated
"charge" operator (e.g spin).

> I read from Joe's reply email that the Green's function can be used like:
> G = kwant.greens_function(sys, energy)
> G.submatrix(1, 0)      # from lead 0 to lead 1
> this is the retarded Green's function? So the advanced Green's function is
> G'=[G]+?
Yes, this is correct.

> How to calculate the self-energy for lead 0 and lead 1?
> Since there is no example in the tutorial, can you give us some
> suggestions or simple examples?
If you finalize a lead you will get an instance of an `InfiniteSystem`.
If we look in the documentation of such an object (http://goo.gl/BHy24i)
there is a method `selfenergy` which calculates the self-energy of the
lead at a given energy. An example could be:

        W = 5
        lat = kwant.lattice.square()
        lead = kwant.Builder(kwant.TranslationalSymmetry((-1, 0)))
        lead[lat(0, j) for j in xrange(W)] = 2
        lead[lat.neighbors()] = -1 ;

        flead = lead.finalized()
        sigma = flead.selfenergy(energy=1)

`sigma` is then a W x W matrix, which is the self-energy of the lead
at the given energy. Anything more specific will depend on what you want
to calculate with the self-energy.

Hope that clarifies,

Joe