Hello Camilla,

Now that you are using two lattices, the number of sites doubled in your system. So, to plot potential or the the trace you mentioned in your question, I suggest for you to use two Builders for the system? one for the spin up and the other for spin down

    sys1[(lat_e(x, y) for x in range(L) for y in range(W))] = 4 * t - mu
    sys2[(lat_h(x, y) for x in range(L) for y in range(W))] = mu - 4 * t


and define later:
Sys+=sys1
Sys+=sys2

at the end your function make system will return:
 return Sys, sys1,sys2



now to plot the quantity you want, you can define:

 def V(site):
        x,y=site.pos
        sites1=[(j.pos[0],j.pos[1]) for j in sys1.finalized().sites]
        ind1=sites1.index((x,y))
        ham1 = sys1.finalized().hamiltonian(ind1,ind1)
        sites2=[(j.pos[0],j.pos[1]) for j in sys2.finalized().sites]
        ind2=sites2.index((x,y))
        ham2 = sys2.finalized().hamiltonian(ind2,ind2)

        return ham1.real-ham2.real

and 

kwant.plotter.map(sys1,V)


This is not the fanciest way, but it should work.
I changed the example of superconductor_transport.py  present in the documentation to show you how it works.
the program is attached below.

Hope it will help

Adel


On Tue, Nov 8, 2016 at 4:18 PM, Camilla Espedal <camilla.espedal@ntnu.no> wrote:

Hello Antônio,

 

So here is what I want to do. I have a system where I have defined two lattices, lat_up and lat_down, and they overlap spatially (instead of using matrices in the voltage and hopping, so that it is easier to obtain spin-resolved data). They are defined like this:

 

lat_up = kwant.lattice.general([(a,a),(a,-a)],[(0,0),(a,0)], name='up')

A_up, B_up = lat_up.sublattices

lat_down = kwant.lattice.general([(a,a),(a,-a)],[(0+d,0),(a+d,0+d)], name='down')

A_down, B_down = lat_down.sublattices

 

I want to calculate the trace of the dot product between sigma_z and the spinor psi = (psi_up psi_down), and plot it over the system.  That is H(lat_up(i,i)) – H(lat_down(i,i)).

 

This was easy to do, when I used matrices for spin, but now that I have implemented it using two lattices instead I don’t know how to do it. If I use the same approach as before, I get two values for each (spatial) lattice point, and the result looks completely random.

 

I hope my explanation was understandable.

 

Best,

Camilla

 




--
Abbout Adel