Dear kwant community:

I am investigating the `kwant.greens_function`。 I would like to get the lead 
self-energies and add to the original system Hamiltonian and then inverse it, 
thus obtaining the retarded green's function. I tested, but the resulted 
green's function is not identical to the one kwant calculated. I want to know 
the reason. Is it because what I describe in the title?

Below is a minimal code example:

```
lat = kwant.lattice.square()

def make_system(r=20, t=-1):

    def circle(pos):
        x, y = pos
        return x**2 + y**2 < r**2

    syst = kwant.Builder()
    syst[lat.shape(circle, (0, 0))] = 0
    syst[lat.neighbors()] = t
    syst.eradicate_dangling()

    def lead_shape(pos):
        return -12 < pos[0] < 12  
        
    lead = kwant.Builder( kwant.TranslationalSymmetry((0, 1)))

    lead[lat.shape(lead_shape, (0, 0))] = 0
    lead[lat.neighbors()] = -t
    syst.attach_lead(lead)
    return syst

syst = make_system()
fsyst = syst.finalized()
kwant.plot(fsyst)


greens_function=kwant.greens_function(fsyst)
Hc = fsyst.hamiltonian_submatrix(sparse=False)

index = fsyst.lead_interfaces[0]
Hc[np.ix_(index, index)] += greens_function.lead_info[0]

Gr = np.linalg.inv(-Hc)

Gr[np.ix_(index, index)]-greens_function.submatrix(0, 0)  # should be a zero 
matrix

```


Bests,
  Wilson

Reply via email to