Dear Sir,
I am a PhD student of Hong Kong University of Science and Technology. I
want to use KWANT to caculate Hall resistance of a Hall bar structure.We
can get the conductance between 6 electrodes, but how to get hall
resistance? Can you give me some help? Thank you very much.
Best Regards,
Zhang Bing

Dear all,
I am using Kwant to study a system with both spins and electron and hole,
so the hopping matrix is 4X4. Now I want to know how to separate the spins,
electron and hole. I study this through the "2.6. Superconductors: orbital
degrees of freedom, conservation laws and symmetries"
smatrix = kwant.smatrix(syst, energy)
data.append(smatrix.submatrix((0, 0), (0, 0)).shape[0]
-smatrix.transmission((0, 0), (0, 0)) +smatrix.transmission((0, 1), (0, 0)))
I do not find more information about this for kwant.
For my system, if I have 3 leads, and the hopping and onsite energy is set
in this order:
(e↑,0,0,0)- spin up electron,first row of the 4X4matrix
(0,e↓,0,0)- spin down electron,second row of the 4X4matrix
(0,0, h↑ ,0)- spin up hole,third row of the 4X4matrix
(0,0, 0, h ↓ )- spin down hole,fourth row of the 4X4matrix
I want to obtain the transmissions from 0 →2.
smatrix = kwant.smatrix(syst, energy)
The transmission from h↑ to e↑ is: smatrix.transmission((2, 1), (0, 2))
The transmission from h ↓ to e↑ is: smatrix.transmission((2, 1), (0, 3))
Is my understanding correct?
Thanks very much in advance!
Hosein Khani

Hello
I felt confusing, when I use pyplot.plt. The data in figure is different from the printed.
There are the codes:
# ================================================================
# Physics background
# ------------------
# Kwant features highlighted
# --------------------------
# - Numpy matrices as values in Builder
import kwant
import numpy as np
# For plotting
import matplotlib.pyplot as plt
# For matrix support
import tinyarray
import kwant.qsymm
# define Pauli-matrices for convenience
s_0 = tinyarray.array([[1, 0], [0, 1]])
s_x = tinyarray.array([[0, 1], [1, 0]])
s_y = tinyarray.array([[0, -1j], [1j, 0]])
s_z = tinyarray.array([[1, 0], [0, -1]])
mz=0 # AFM
mu=0.0 # stargged chemical potential
n_theta=12
def make_system(constant=1, W=30, L=30, mz=0, m_in=0, mu=0):
lat = kwant.lattice.honeycomb(a=constant,norbs=2, name=['a', 'b'])
# a, b = lat.sublattices
sym = kwant.TranslationalSymmetry(lat.vec((1, 0)))
syst = kwant.Builder()
def onsite_a(site,theta):
return mz*s_z+m_in*(np.cos(theta)*s_x+np.sin(theta)*s_y)+mu*s_0
def onsite_b(site,theta):
return -mz*s_z+m_in*(np.cos(theta)*s_x+np.sin(theta)*s_y)-mu*s_0
syst[(lat.a(x, y) for x in range(L) for y in range(W))] = onsite_a
syst[(lat.b(x, y) for x in range(L) for y in range(W))] = onsite_b
syst[lat.neighbors()] = s_0
# define lead
left_sym=kwant.TranslationalSymmetry(lat.vec((1, 0)))
left_lead=kwant.Builder(left_sym)
left_lead[(lat.a(0, y) for y in range(W))] = onsite_a
left_lead[(lat.b(0, y) for y in range(W))] = onsite_b
left_lead[lat.neighbors()] = s_0
syst.attach_lead(left_lead)
syst.attach_lead(left_lead.reversed())
return syst
def plot_conductance(syst, energy, theta_list):
# Compute conductance
data = np.zeros(n_theta)
num_i=-1
for theta_i in theta_list:
num_i=num_i+1
smatrix = kwant.smatrix(syst, energy, params=dict(theta=theta_i))
data[num_i]=smatrix.transmission(1, 0)
plt.figure()
# x=np.linspace(-1,1,n_theta)
# data_i=np.linspace(0,0,n_theta)
# print(x,data_i)
# plt.plot(x,data_i,'ow')
print(data)
plt.plot(theta_list, data)
plt.xlabel(r'$\theta/\pi$')
plt.ylabel("conductance [e^2/h]")
plt.savefig('tran_PHE.jpg')
#plt.show()
def main():
syst = make_system(m_in=0.0001)
# Check that the system looks as intended.
kwant.plot(syst,file='transport_lattice.pdf')
syst = syst.finalized()
theta_num=np.linspace(-np.pi,np.pi,num=n_theta)
plot_conductance(syst, energy=0.0001,
theta_list=theta_num)
if __name__ == '__main__':
main()
The result would be printed in terminal: [1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1.].
However, the figure plotted is wrong.
--
Best Wishes
Jinlong Zhang
jlzhang(a)163.com

Hello,
I want to create a three-wire "(1D each wire) junction for calculating conductance. Can I use kwant.lattice.chain() to use three separate chains and then join them somehow? I also need to change the angle between these 3 wires. It would be really helpful if anyone can give me the idea to make such a graph (lattice ) in kwant.
Thanks,
Sayandip Dhara

Dear Pablo,
in the example here:
https://kwant-project.org/doc/dev/tutorial/kpm
you write:
..
fsyst_staggered = make_syst_staggered().finalized()
# find 'A' and 'B' sites in the unit cell at the center of the disk
center_tag = np.array([0, 0])
where = lambda s: s.tag == center_tag
# make local vectors
vector_factory = kwant.kpm.LocalVectors(fsyst_staggered, where)
and plot their respective local density of states.
# 'num_vectors' can be unspecified when using 'LocalVectors'
local_dos = kwant.kpm.SpectralDensity(fsyst_staggered, num_vectors=None,
vector_factory=vector_factory,
mean=False,
rng=0)
energies, densities = local_dos()
.
My question is: how do I know which sublattice LDOS comes out first in
the result?
I plan to compute LDOS in a lot of point (say, 50 points) at a given set
of energies. So, what will be the ordering of vectors given by
vector_factory. Or, can I create those vectors manually without the
vector factory?
Thank you,
Sergey