Hi Anton, You wrote:
... the spin is still defined, and the two degrees of freedom correspond to local spin polarizations up or down...
Exactly, therefore I have prepared the following function which, I think, plots averages <S_x>, <S_y> and <S_z> at each site:
def plot_Si(sys, energy, n_lead): # Compute wave function psi = kwant.wave_function(sys, energy) psi_n = psi(n_lead).sum(axis=0) # Calculate <Si> per site Nsites = psi_n.shape / 2 sx = zeros((Nsites,)) sy = zeros((Nsites,)) sz = zeros((Nsites,)) psi_i = array([[0.0], [0.0]])
for i in xrange(Nsites): psi_i = array([[psi_n[i * 2]], [psi_n[i * 2 + 1]]]) sx[i] = abs(dot(psi_i.conj().T, dot(sigma_x, psi_i)))[0, 0] sy[i] = abs(dot(psi_i.conj().T, dot(sigma_y, psi_i)))[0, 0] sz[i] = abs(dot(psi_i.conj().T, dot(sigma_z, psi_i)))[0, 0] # Plot kwant.plotter.map(sys, sx, num_lead_cells=5) kwant.plotter.map(sys, sy, num_lead_cells=5) kwant.plotter.map(sys, sz, num_lead_cells=5)
It seems that it works for a 2-terminal quantum wire (like the one defined in spin_orbit.py). For example with just one transmitted mode and \alpha=0.5, ez = 0.0, a nice "snapshot" of the spin precession is obtained (run the attached spin_orbit_jw1.py script).
However, there must be something wrong with this function, since for 3-terminal T-shaped device (like the one defined in spin_orbit_T_jw1.py) the <S_i> patterns, without spin-orbit interaction (\alpha=0.), are asymmetrical. This is strange, since the device is symmetric along lead axis, from which the wave function is emanated. There is no such a problem for 2-terminal wire, in that case each <S_i> looks much like ldos for \alpha=0.
Any hint what is wrong will be appreciated. I suspect the mysterious psi_n = psi(n_lead).sum(axis=0) command, since psi(n_lead) consist of two rows of length 2Nsites, even for just one (spin degenerate) mode. What is stored in each row?
Regards, Jerzy P.S. I use python27 under win8.