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.
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
-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!
Dear Kwant developers,
I am having a error with "gauge" when I am adding 1D leads (Chains)
to my 3D system. (I have both Chain leads, where I do not need gauge,
and nirmal leads, where I do need gauge)
gauge = kwant.physics.magnetic_gauge(sys)
returns a error:
'not enough values to unpack (expected 2, got 0)',
coming from the
rows, cols = np.array([(i, j)for i, jin syst.graph
if i < nand j < n]).transpose()
In my case, n = 1 for a simple chain and so rows, cols are empty.
I am new to Kwant and try to play a little with some of the examples. I have a bit of experience in calculating the transmission in SN- or SNS-junction so I tried to play a little with the example in 2.6. "Superconductors: orbital degrees of freedom, conservation laws and symmetries".
Something strange come up with it.
If I try to calculate the transmission into the superconductor lead by exchanging the calculation of the conductance in line 74 of the example file by
data.append(smatrix.transmission((1, 1), (0, 1)))
I get an error message which tells me that there exists no second subblock. Nevertheless, it should be possible to calculate the transmission of holes from the normal lead into hole-like quasiparticles in the superconductor lead. (This is what I have intended to do there.)
So the question rather is why is there a hole degree of freedom in the normal conductor but not in the superconductor lead?
I'm trying to calculate the conductance as a function of energy in a normal metal - superconductor junction with a hexagonal lattice (instead of a square lattice). The figure I want to reproduce and the Hamiltonian is given in the PDF attachment.
In the attached .py file I have tried to calculate the conductance, taking inspiration from tutorial 2.6 in the documentation. However, the conductance I obtain is not what I expect. Is there an issue with how I define my scattering region and leads?
Any feedback would be highly appreciated.
I hope you are doing well.
I am having troubles when using parallel distribution to run my python
script using kwant.
I went through kwant discuss mailing list and tried to read about similar
issues. I have red for instance the comment made by hristoph Groth Mon, 08 *Aug
2016 08:12:46 -0700.*
*add "from mpi4py import MPI" in the preamble,• substitute kwant.smatrix(…)
-> kwant.smatrix(…, comm=MPI.COMM_WORLD), • execute the script using
I have got an error while using kwant.smatrix(comm=MPI.COMM_WORLD).
kwant does not recognize comm
TypeError: got an unexpected keyword argument 'comm'
I have also tried without comm but with the following command
mpiexec -n 4 python file.py
mpirun.openmpi -n 4 -x OMP_NUM_THREADS=1 python file.py
but I got the result 4 times
I want to calculate the transmission vs incident angle in graphene with a
potential barrier. I use sys = kwant.wraparound.wraparound(sys) and lead
= kwant.wraparound.wraparound(lead, keep=0) to construct the periodical
system. I almost get the correct results, but I find that the definition of
angle is different. Could you please help me to find out the reason. The
results comparison is also attached.
my code is:
import numpy as np
import matplotlib.pyplot as plt
from numpy import pi,sqrt
from numpy import pi
from math import asin
from matplotlib import pyplot
a = 1.
V0 = 0.0
W = 2.
L = 448
t = 3
return 0<=x<=L and -0.5<=y<=W
sin_30, cos_30 = (1 / 2, sqrt(3) / 2)
lat = kwant.lattice.general([(1, 0), (sin_30, cos_30)],
[(0, 0), (1/2, 1 / (2*sqrt(3)))])
sys = kwant.Builder(kwant.TranslationalSymmetry(lat.vec((-1, 2))))
sys[lat.neighbors(1)] = -t
sys = kwant.wraparound.wraparound(sys)
lead = kwant.Builder(kwant.TranslationalSymmetry((1, 0), lat.vec((-1, 2))))
lead[lat.shape(lead_shape,(0,0.6))] = 0.
lead[lat.neighbors(1)] = -t
lead = kwant.wraparound.wraparound(lead, keep=0)
sys = sys.finalized()
momenta = [-2*pi + 0.002 * 2*pi * i for i in range(1001)]
bands = kwant.physics.Bands(sys.leads,[ky])
energies = [bands(k) for k in momenta]
pyplot.xlabel("momentum [(lattice constant)^-1]")
kys = np.arange(-0.08, 0.08, 0.0002)
kysp =np.arange(-90, 90, 0.225)
transmission = 
num_prop = 
for ky in kys:
smatrix = kwant.smatrix(sys, energy, [ky])
Dear Kwant developers,
I would like to ask the following questions about mode wave functions.
1. The mode wave functions can be obtained in three ways: using the smatrix.lead_info, using finalised_lead.mode.wavefunction and using the physics.Progatingmodes. Are they the same? To find the modes used to obtain the s matrix, we should use the modes of matrix.lead_info. Am I correct?
2. I want to find the sites of the mode wave functions obtained from s matrix. Is it correct to use finalised_system.leads[n].sites as mentioned in one of the discussions. I print out finalised_system.leads[n].sites, which is a long list of
Site(kwant.lattice.Monatomic([[1.7320508075688772, 0.0], [0.0, 1.0]], [0.2886751345948129, 0.0], '1', 1), array([0, 0]))
Could you please help me to find out what the information represents?
3. Is it correct to use finalised_system.leads to find the sites information for the mode wave function obtained from the s matrix?
I should be grateful, if you could help me in this regard. Thank you in advance.
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.
Dear participants of the kwant-discuss list,
This morning, a person or bot subscribed to this list and sent four
unsolicited messages. We apologize for the disturbance that this has
As a consequence, we changed the moderation rules of this list. Up to
now, new members who went through the subscription process could post to
the list immediately. From now on, the first posting of new members
will be put on hold for moderation, just like it is already the case for
postings by non-members.
Christoph on behalf of the Kwant team