Hello,

Definetively I didn't help at all with my previous email.


I want to check that the Haldane model in a ribbon is a gapped system in the 
bulk with edge states. For that purpose, I have modified my jcurrent function 
(attached at the end) and now I obtain correctly the current  through all the 
hopping parameters of the system.


I am trying to plot (not necessarily with Kwant) the total local density 
current in the x and y direction. For that I want to define for each (A/B) atom 
the outgoing current as the vector sum of all the bond currents in each atom 
(each atom has 9 relevant neighbors, except the ones in the edges).


Is there any way of doing that in a simple way with the new current function?

Thanks a lot for your time,

Enrique



def jcurrent(syst):
    wfs = kwant.wave_function(syst, energy=0.01)
    J = kwant.operator.Current(syst)
    wf=wfs(0)[0]
    j = J(wf)

    #for (i,j), current in zip(syst.graph, j):
       #print('current from site {} to {} is {}'.format(syst.sites[i].tag, 
syst.sites[j].tag, current))




El 07/03/2017 a las 9:25, Joseph Weston escribió:

Hi,



I am using kwant1.3, I have read the new two threads [1] and [2], and I
have read [3]. However, I am still unable to compute and plot the local
density current for my system in the scattering region.


In general you should aim to give more information about precisely what
it is that is not working. Please try and phrase your problem as "I am
trying to do X; I expect the output of this code to be Y, but I receive Z".

Just stating that you are unable to do something does not give anyone
wishing to help enough information to be able to do so.

That being said, I did notice that in the following function:



def jcurrent(sys):

   J=kwant.operator.Current(sys)
   wfs = kwant.wave_function(sys)
   wf= wfs[0]
   j=J(wf)
   kwant.plotter.map(sys, j)


You attempt to plot the output of a kwant operator using
'kwant.plotter.map'. This will raise an error because
'kwant.operator.Current's return the current defined on all *hoppings*
of the system, whereas 'kwant.plotter.map' only knows how to plot
quantities defined on all *sites* in the system. We are currently
working on adding a function 'kwant.plotter.vector_map' that will be
able to plot quantities defined on hoppings (such as the current),
however this is presently not available in Kwant (not even the
development version).

I already responded to Sverre Gulbrandsen overe here [1] where I give
some examples of using current operators. Hopefully that will be enough
to get you started. There will be a full tutorial on operators when
Kwant 1.3 is released.

Happy Kwanting,

Joe


[1]: https://www.mail-archive.com/kwant-discuss@kwant-project.org/msg01150.html


Reply via email to