I'm doing a self consistent calculation and I need the matrix element for a
site when setting the coupling.

I got it working but I wanted to know if there was a correct way.
Here is my code which uses scipy.spatial.

def onsite(site, Delta=None, coords=None):
    if (Delta is None and coords is None):
        Delta_r = Delta_0
    else:
        _, i = spatial.KDTree(coords).query(site.pos)
        Delta_r = Delta[i]
    return -mu * tau_z + Delta_r * tau_x


where coords is obtained by

sites = kwant.plotter.sys_leads_sites(syst, 0)[0]
coords = kwant.plotter.sys_leads_pos(syst, sites)

I feel like this may be a roundabout solution but it is working.
Any help would be appreciated.

Thanks,
Eric

Reply via email to