Hi there,

I'm trying to simulate a scattering region confined between two 
reservoirs(leads) for that purpose I defines a wire with linearly increasing 
onsite potentials. Now I want to find the local current density at each site 
on the wire but I don't know how to do it. Can anyone guide me through this? 
:) 

def make_system(a=1, t=1.0, W = 60, L = 100, pot=-0.2):

    lat = kwant.lattice.square(a)

    sys = kwant.Builder()

    def hop(site1, site2, B=0):
        # The magnetic field is controlled by the parameter B
        x1, y1 = site1.pos
        x2, y2 = site2.pos
        return -t * exp(0.5j * B * (y1+y2)* (x1-x2))#exp(0.5j * B * (y1-x1))

    def potential_prof(i,L,pot):
        #potential profile linearly determined here
        return (L-i)*pot/L
    # Define the scattering region

    for i in xrange(L):
        for j in xrange(W):
            # On-site Hamiltonian
            sys[lat(i, j)] = 4 * t+potential_prof(i,L,pot)



    sys[kwant.builder.HoppingKind((1, 0), lat, lat)] = hop

    sys[kwant.builder.HoppingKind((0, 1), lat, lat)] = hop

    sym_left_lead = kwant.TranslationalSymmetry((-a, 0))
    left_lead = kwant.Builder(sym_left_lead)

    for j in xrange(W):
        left_lead[lat(0, j)] = 4 * t+pot
        if j > 0:
            left_lead[lat(0, j), lat(0, j - 1)] = -t
        left_lead[lat(1, j), lat(0, j)] = -t

    sys.attach_lead(left_lead)

    sym_right_lead = kwant.TranslationalSymmetry((a, 0))
    right_lead = kwant.Builder(sym_right_lead)

    for j in xrange(W):
        right_lead[lat(0, j)] = 4 * t
        if j > 0:
            right_lead[lat(0, j), lat(0, j - 1)] = -t
        right_lead[lat(1, j), lat(0, j)] = -t

    sys.attach_lead(right_lead)
    # Modify the scattering region
    del sys[lat(85, 2)]
    del sys[lat(87, 2)]
    del sys[lat(86, 3)]

    del sys[lat(25, 37)]
    del sys[lat(27, 37)]
    del sys[lat(26, 38)]

    sys = sys.finalized()
    
    return sys


Reply via email to