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

Hi,
Firstly, thanks for creating Kwant - it's so nice to use physics code
written by people who understand software-engineering as well as physics :)
I've got a few questions about units and density-of-states in Kwant, please
respond if you know anything about any of them; don't feel the need to
respond to them all at once.
I'm trying to add self-consistent electrostatics to my Kwant system (using
FiPy as a finite-element/volume Poisson-solver). Obviously, I need to
calculate the electron-carrier-density of the system by integrating over
the Fermi-Dirac occupation, then feed that (via real-space basis functions)
to my Poisson solver. I'm not quite sure how to handle the density of
states in the context of Kwant:
I assume that just summing over the LDOS (integrating over all space) will
give the density of states as a function of energy, D(E). Plotting it seems
to produce reasonable bands, but I'm not quite sure about the units, or how
it scales with system size. In the system I'm modelling (low-temperature
p-donors in silicon), every lattice site adds an electron to the system
(the temperatures are low enough that the silicon is frozen-out as a
conductor and can just be treated as a background dielectric constant). I
should be able to integrate over the density-of-states until the total
equals the (known) number of electrons, but the density of states obtained
by summing over the LDOS calculated by Kwant does not scale properly with
the number of sites in the system; larger systems always need higher Fermi
energies, which isn't physical at all.
What am I missing here? Are the units of the LDOS Kwant calculates somehow
normalised? How can I get a density-of-states which scales appropriately
with the total number of electrons/sites in my system?
The lead unit-cell of my system will need to be solved self-consistently
too; how can I calculate the local density of states (and thus, via
Fermi-Dirac, the electron-density) of a lead?
Am I correct in assuming that the LDOS produced by Kwant is equivalent to
summing over the state-density-weighted scattering-wavefunctions from the
modes in all leads (and thus that integrating it over the occupied-energies
will produce a sensible total electron-density)?
Finally, and slightly unrelated, do my chosen energy-units need to be
accounted-for anywhere in Kwant's Schroedinger-solutions? I'm writing my
Hamiltonian terms in meV; will bands, LDOS etc. all naturally scale to make
this choice transparent? Similarly, does effective electron-mass need to be
accounted for at all?
Thanks so much for your help,
Daniel R-P

Dear authors,
I am trying to simulate graphene using KWANT.But I am not sure about on
site energies and hopping paramater.I am sending you the code Please tell
me how to impregnate these all.
ANANT VIJAY VARMA
IISER KOLKATA
INDIA

Hello,
I have been trying to build an antiferromagnetic g-type lead with the code
attached below.
It seems i have a problem with the band-structure because i was expecting to
have a ferromagnet if if set
m1 = m2 = 0.0
in the code below. (But apparently i got a different band structure with
that of a ferromagnet)
I will appreciate your help.
best Regards
Colins
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
import kwant
# For plotting.
from matplotlib import pyplot
from math import *
from numpy import *
from mpl_toolkits.mplot3d.axes3d import Axes3D # imports 3D plotting
from matplotlib import cm # module for color pattern
from random import seed
from random import uniform
import tinyarray
import time
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]])
def make_lead(a=1, t=1.0, Vat= 0.0, EF= 7.0, Jex=-1.0, W=40):
# Start with an empty lead with a single square lattice
lat = kwant.lattice.square(a)
sym_lead = kwant.TranslationalSymmetry((-2*a, 0))
lead = kwant.Builder(sym_lead)
# build up one unit cell of the lead, and add the hoppings
# to the next unit cell
for j in xrange(W):
mz1 = cos((1.0 + j) * pi)
mz2 = cos(j * pi)
lead[lat(0, j)] = (4 * t + Vat)* s_0 + Jex * mz1 * s_z
lead[lat(1, j)] = (4 * t + Vat)* s_0 + Jex * mz2 * s_z
if j > 0:
lead[lat(0, j), lat(0, j - 1)] = -t * s_0
lead[lat(1, j), lat(1, j - 1)] = -t * s_0
lead[lat(1, j), lat(0, j)] = -t * s_0
lead[lat(2, j), lat(1, j)] = -t * s_0
return lead
def main():
lead = make_lead().finalized()
kwant.plotter.bands(lead, show=False)
pyplot.xlabel("momentum [(lattice constant)^-1]")
pyplot.ylabel("energy [t]")
pyplot.title("Band structure G-type AF")
pyplot.show()
if __name__ == '__main__':
main()
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

Hello,
I have a question regarding the construction of leads with periods greater
than one lattice constant and having longer hoppings in those leads. I have
constructed such a lead, but when I plot its band structure I am getting a
different result than when plotting band structure of the exactly same
system in PythTB (from David Vanderbilt's group at Rutgers University). My
minimal working examples showing the issue are included below the message (I
uploaded the resulting images to imgur: http://imgur.com/a/5uzyo , first
image being the kwant's output). The band structure calculated by kwant
seems to be folded in half - the energies in both programs are exactly the
same, but they correspond to different crystal momentum. Am I defining the
lead period in a wrong way?
Best regards,
Michal Papaj
Kwant code:
import kwant
import matplotlib.pyplot as plt
E = 0.0
t1 = 1.0
t2 = -1.0
width = 50
lat = kwant.lattice.square(1)
sym = kwant.TranslationalSymmetry((-2, 0))
lead = kwant.Builder(sym)
lead[(lat(0, y) for y in range(width))] = E
lead[(lat(-1, y) for y in range(width))] = E
lead[kwant.builder.HoppingKind((1, 0), lat, lat)] = t1
lead[kwant.builder.HoppingKind((0, 1), lat, lat)] = t1
lead[kwant.builder.HoppingKind((2, 0), lat, lat)] = t2
lead[kwant.builder.HoppingKind((0, 2), lat, lat)] = t2
kwant.plotter.bands(lead.finalized(), momenta=100)
PythTB code:
from pythtb import *
import pylab as pl
E = 0.0
t1 = 1.0
t2 = -1.0
width = 50
lat=[[1.0, 0.0],[0.0, 1.0]]
orb=[[0.0,0.0]]
test_model = tb_model(2,2,lat, orb)
test_model.set_onsite([E])
test_model.set_hop(t1,0,0,[1.0,0.0])
test_model.set_hop(t1,0,0,[0.0,1.0])
test_model.set_hop(t2,0,0,[2.0,0.0])
test_model.set_hop(t2,0,0,[0.0,2.0])
test_model_cut=test_model.cut_piece(width,1,glue_edgs=False)
path=[[-0.5],[0.0],[0.5]]
kpts=k_path(path,50)
evals_cut=test_model_cut.solve_all(kpts)
fig=pl.figure()
for i in range(width):
pl.plot(evals_cut[i])
pl.show()

Hello,
When trying to use kwant with matplotlib 1.4.0 (which is the last
released version), I had a problem when trying to draw a system. For
exemple, the following code
import kwant
import matplotlib as mpl
import matplotlib.pyplot as plt
%matplotlib inline # to be used in ipython notebook
lat = kwant.lattice.square(1.)
sys = kwant.Builder()
sys[(lat(x, y) for x in xrange(20) for y in xrange(10))] = 1.
sys[lat.neighbors(1)] = 1.
lead = kwant.Builder(kwant.TranslationalSymmetry((-1, 0)))
lead[(lat(0, y) for y in xrange(10))] = 1.
sys.attach_lead(lead)
sys.attach_lead(lead.reversed())
p = kwant.plot(sys, show=False)
plt.show()
produces a huge traceback ending with
ValueError: Transforms must be a Nx3x3 numpy array
The exact result depends on the matplotlib backend, but when an image is
produced, the sites of the leads are not drawn.
The bug seems to come from an update in matplotlib API, and is (in this
case) fixed by changing line 94 of plotter.py
(http://git.kwant-project.org/kwant/tree/kwant/plotter.py#n94) from
self._transforms = [matplotlib.transforms.Affine2D().scale(x) for x in
sizes]
to
self._transforms =
[matplotlib.transforms.Affine2D().scale(x).get_matrix() for x in sizes]
There may be other instances of this in kwant, but fixing this one is
enough to make the previous code work. A similar issue in 3D is
described in
https://www.mail-archive.com/kwant-discuss@kwant-project.org/msg00111.html
(I did not look further into this one.)
Best,
Michel