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 was consulting the example of the current in a *closed system* and I am a
little bit confused:
The figure showing the current flowing inside a circle [1] is obtained for
a magnetic field B=0 !
But we know that for B=0, the Hamiltonian is a real symmetric matrix and
thus diagonalized by a real orthogonal matrix, so the eigenvectors are real
(any phase is just artificial.)
By using the formula giving the current we should find zero !
moreover we can ask why we have a current flowing clockwise and not
anticlockwise (I remind that B=0) !
When we put B=0.05, we obtain the figures below for the current and the
wave function.
the wave function has circular symmetry but not the current. Moreover, x
and y play exactly the same role so the current should be the same on x and
on y (independently from the used gauge)
Am I missing something ?
Thank you in advance.
Adel
[1] https://kwant-project.org/doc/1/tutorial/spectrum

Dear Kwant developer,
Thank you for your effort in developing Kwant.
I have a question about the definition of the direction of momentum in the smatrix.lead_info. Assume a lead lies along the y direction with primitive vector (0,1). The symmetry operation of a lead is (0,1) if the lead goes towards the positive direction and is (0,-1) if the lead goes towards the negative direction. For the momenta contained in smatrix.lead_info for these two leads , do they use the same coordinate system? Positive momenta mean the direction (0,1), negative momenta mean the direction (0,-1). For velocity, in smatrix.lead_info, it has nothing to do with the coordinate system. Positive means outgoing, negative means incoming in the lead.
Thank you
KS Chan
Disclaimer: This email (including any attachments) is for the use of the intended recipient only and may contain confidential information and/or copyright material. If you are not the intended recipient, please notify the sender immediately and delete this email and all copies from your system. Any unauthorized use, disclosure, reproduction, copying, distribution, or other form of unauthorized dissemination of the contents is expressly prohibited.

Hello,
I am currently completing my thesis using Kwant, per discussions with my supervisor we would like to plot the current density as a streamplot of our 3d system for different z-axis 'slices' of the system (our system has an exponentially decaying potential in the z direction, so we'd expect current to flow differently through each layer).
I have tried tinkering with the new current functions implemented in 1.3 but the plotting function can only plot 2d systems. Is there a way to obtain the current density streamplot for a 2d 'slice' of our 3d system.
Thank You,
Mitchell Greenberg

Dear all,
in the tutorial
https://kwant-project.org/doc/1/tutorial/superconductors
one calculates the conductance from left lead to right lead, G_10, as
G_00 = e^2/h (N-R_ee+R_he)
assuming that, due to the current conservation,
G_10 = G_00.
My question is, what happens if we detach the superconducting lead L1. Intuitively, I would expect
G_00 = 0. But using the formula above one obtains non-zero values, and making the finite superconducting
region (the part of the scattering region) large enough, the subgap transport is exactly as if
the lead L1 was attached. This means that the current conservation is violated, and something is wrong.
Below is slightly modified code from the tutorial to generate a plot comparing G_00 for a system with and
without lead L1. You can see, that if parameter L (the superconducting part of the scattering region) is large
enough, the subgap transport is the same whether L1 is attached or not.
Why is this happening, can someone point out the error?
Best,
Tibor
import kwant
import tinyarray
import numpy as np
%matplotlib inline
from matplotlib import pyplot as plt
tau_x = tinyarray.array([[0, 1], [1, 0]])
tau_y = tinyarray.array([[0, -1j], [1j, 0]])
tau_z = tinyarray.array([[1, 0], [0, -1]])
L=80
barrier=1.5
W=10
def make_system(a=1, W=W, L=L, barrier=barrier, barrierpos=(3, 4),
mu=0.4, Delta=0.1, Deltapos=4, t=1.0, phs=True):
lat = kwant.lattice.square(norbs=2)
syst = kwant.Builder()
syst[(lat(x, y) for x in range(0,Deltapos) for y in range(W))] = (4 * t - mu) * tau_z
syst[(lat(x, y) for x in range(Deltapos, L) for y in range(W))] = (4 * t - mu) * tau_z + Delta * tau_x
# The tunnel barrier
syst[(lat(x, y) for x in range(barrierpos[0], barrierpos[1])
for y in range(W))] = (4 * t + barrier - mu) * tau_z
# Hoppings
syst[lat.neighbors()] = -t * tau_z
sym_left = kwant.TranslationalSymmetry((-a, 0))
lead0 = kwant.Builder(sym_left, conservation_law=-tau_z, particle_hole=tau_y)
lead0[(lat(0, j) for j in range(W))] = (4 * t - mu) * tau_z
lead0[lat.neighbors()] = -t * tau_z
sym_right = kwant.TranslationalSymmetry((a, 0))
lead1 = kwant.Builder(sym_right)
lead1[(lat(0, j) for j in range(W))] = (4 * t - mu) * tau_z + Delta * tau_x
lead1[lat.neighbors()] = -t * tau_z
syst.attach_lead(lead0)
syst.attach_lead(lead1)
return syst
syst = make_system()
kwant.plot(syst)
syst = syst.finalized()
data = []
energies=[0.002 * i for i in range(0,100)]
for energy in energies:
smatrix = kwant.smatrix(syst, energy)
# Conductance is N - R_ee + R_he
data.append(smatrix.submatrix((0, 0), (0, 0)).shape[0] -
smatrix.transmission((0, 0), (0, 0)) +
smatrix.transmission((0, 1), (0, 0)))
syst = make_system()
del syst.leads[-1]
# Check that the system looks as intended.
kwant.plot(syst)
# Finalize the system.
syst = syst.finalized()
data2 = []
for energy in energies:
smatrix = kwant.smatrix(syst, energy)
# Conductance is N - R_ee + R_he
data2.append(smatrix.submatrix((0, 0), (0, 0)).shape[0] -
smatrix.transmission((0, 0), (0, 0)) +
smatrix.transmission((0, 1), (0, 0)))
fig , (ax0) = plt.subplots(1, 1, sharey = True, figsize = [5, 5])
ax0.plot(energies, data, label = 'with lead 1')
ax0.plot(energies, data2, label = 'without lead 1')
ax0.set_xlabel("energy [t]")
ax0.set_ylabel("conductance [e^2/h]")
ax0.set_ylim(0,3.5)
ax0.legend()
fig.savefig('NS_conductance.png')

Dear kwant community,
I am new in Transport and kwant.
I have two simple questions regarding the lead, I appreciate any reply.
1-The lead's self energy is in principle a complex number. In kwant, If I
want to add the self energy of a lead by hand, I can add the real part of
it to the on-site energy of the site that lead is connected to. Where
should I add the imaginary part of the self energy?
2- If I know the value of the level width function (\Gamma = 2πρt^2 = 1),
and the lead is a 1D chain, can I calculate the value of the coupling
parameter, t? Is there a way to obtain the DOS of the lead and then get t?
Bests
Chung

Dear kwant users,
If I want to attach a continuous lead instead of its discrete counterpart
to a discrete system, I get the error message 'Use site_family(1, 2)
instead of site_family((1, 2))!'.
The discrete lead is according to the following
prim_vecs=tinyarray.array([(a,0.,0.),(0.,a,0.),(0.,0.,a)])
offset1=tinyarray.array((-0.7, 0.0, 0.0))
lat1=kwant.lattice.Monatomic(prim_vecs, offset1, norbs=no)
syst[lat1(0, 0, -1)] = e1*sigma_0
syst[amorphous_lat(0), lat1(0, 0, -1)] = tl*sigma_0
syst[amorphous_lat(N), lat1(0, 0, -1)] = tl*sigma_0
sym = kwant.TranslationalSymmetry([0, 0, -a])
dn_lead = kwant.Builder(sym, conservation_law=-sigma_z)
if discrete:
sym = kwant.TranslationalSymmetry([0, 0, -a])
dn_lead = kwant.Builder(sym, conservation_law=-sigma_z)
dn_lead[lat1(0, 0, -2)] = e1*sigma_0
dn_lead[lat1.neighbors()] = t0*sigma_0
syst.attach_lead(dn_lead)
Now if I replace the 'if discrete:' part with the following
if continuous:
t00=0.0
Leadham =
"t00*sigma_0*k_x**2+t00*sigma_0*k_y**2-t0*sigma_0*k_z**2+(2*t0+e1)*sigma_0"
template = kwant.continuum.discretize(Leadham grid_spacing=a)
dn_lead.fill(template, lat1, lat1(0, 0, -2))
syst.attach_lead(dn_lead)
I have to add k_x and k_y with zero coefficient (t00) to solve the symmetry
complain (is there a neater way?)
where is the error message ('Use site_family(1, 2) instead of
site_family((1, 2))!') originated from?
Thanks
Patrik