Hi,

As Majorana polarization is a vector field, I am trying to plot the values using quiver by adding the two functions:

def plot_vector_field(sys, Maj_x, Maj_y):
    xmin, ymin = min(s.tag for s in sys.sites)
    xmax, ymax = max(s.tag for s in sys.sites)
    x, y = np.meshgrid(np.arange(xmin, xmax+1), np.arange(ymin, ymax+1))

    plt.quiver(x, y, Maj_x, Maj_y)
    plt.show()

def majorana_polarization(sys, energy):
wf = kwant.wave_function(sys, energy)
psi = wf(0)
eup, edown, hup, hdown = psi[::2], psi[1::2], psi[3::2], - psi[2::2]
Maj = eup * hup + edown * hdown
print(Maj)
Maj_x = np.real(Maj)
Maj_y = np.imag(Maj)
plot_vector_field(sys, Maj_x, Maj_y)

But since I am dealing with a honeycomb lattice the meshgrid will not work. How could I generate that using the sys sites?

2017-10-30 19:10 GMT-02:00 Anton Akhmerov <anton.akhmerov+kd@gmail.com>:
Dear Antonio,

In Kwant 1.3 you can compute expectation values of any local operator,
applied to any wave function, as described in this Kwant tutorial:
https://kwant-project.org/doc/1/tutorial/operators

It is also possible that you can compute what you want using the
output of ldos. The ordering of internal degrees of freedom of each
there is the same as in the Hamiltonian you define.

Best,
Anton

On Mon, Oct 30, 2017 at 9:44 PM, Antonio Lucas Rigotti Manesco
<antoniolrm@usp.br> wrote:
> Dear Kwant users,
>
> I am interested to calculate Majorana polarization for a system I am
> currently studying. I was wondering if it is possible to obtain it from
> kwant.ldos. The system is constructed as a kronecker product between
> particle-hole  and spin in that order but I am not sure how kwant.ldos
> orders the internal degrees of freedom. Does any of you have some hint about
> that?
>
> Thanks in advance.



--
Antônio Lucas Rigotti Manesco
PhD fellow - University of São Paulo, Brazil