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
Hello All,
I am trying to simulate black phosphorous quantum dots of circular shape,
but with their ends (that will be attached to the leads) will be broad. The
shape would be something like a circle with two thick lines on either side
of the circle. I have the following code for it, but the problem I face is
that the two thick lines are disconnected from the circle. I am not able to
understand the reason behind it and rectify it. If any of you could help
me, it would be of great value to me.
 CODE 
*import kwant*
*from matplotlib import pyplot*
*import numpy as np*
*h = 2.707 * np.cos(13.69*np.pi/180)*
*dx = 4.43*
*dy = 3.27*
*shift_x = 2.164 * np.cos(0.5*98.15*np.pi/180)*
*shift_y = 2.164 * np.sin(0.5*98.15*np.pi/180)*
*r_const = 20*
*lat0 = kwant.lattice.general([(dx, 0, 0), (0, dy, 0)], [(0, 0, 0),
(shift_x, shift_y, 0)])*
*lat1 = kwant.lattice.general([(dx, 0, 0), (0, dy, 0)], [(0.5*dx, 0.5*dy,
h), (0.5*dx + shift_x, 0.5*dy + shift_y, h)])*
*def cuboid_shape(pos):*
* x, y, z = pos*
* if 1.2*r_const <= x < r_const:*
* return abs(y) < r_const*
* if r_const <= x <= r_const:*
* return x**2 + y**2 <= r_const**2*
* if r_const < x <= 1.2*r_const:*
* return abs(y) < r_const*
*def potential(site):*
* x, y, z = site.pos*
* return (tanh(5*(xr_const))  tanh(5*(x+r_const))) * pot*
*sys = kwant.Builder()*
*sys[lat0.shape(cuboid_shape, (0, 0, 0))] = potential*
*sys[lat0.neighbors(1)] = 1*
*sys[lat0.neighbors(2)] = 1*
*sys[lat1.shape(cuboid_shape, (0.5*dx, 0.5*dy, h))] = potential*
*sys[lat1.neighbors(1)] = 1*
*sys[lat1.neighbors(2)] = 1*
*lat0_0 = [ ]*
*lat0_1 = [ ]*
*lat1_0 = [ ]*
*lat1_1 = [ ]*
*for site in kwant.Builder.sites(sys):*
* if site.family == lat0.sublattices[0]:*
* lat0_0.append(site[1])*
* elif site.family == lat0.sublattices[1]:*
* lat0_1.append(site[1])*
* elif site.family == lat1.sublattices[0]:*
* lat1_0.append(site[1])*
* elif site.family == lat1.sublattices[1]:*
* lat1_1.append(site[1])*
*for w in lat0_0:*
* for v in lat0_1:*
* for k in lat1_0:*
* for l in lat1_1:*
* if v == k:*
* sys[lat0.sublattices[1](v[0],v[1]),
lat1.sublattices[0](k[0],k[1])] = 2*
* if w == l:*
* if (w[0]+1,w[1]+1) in lat0_0:*
* sys[lat0.sublattices[0](w[0]+1,w[1]+1),
lat1.sublattices[1](l[0],l[1])] = 2*
* if w == l:*
* if (l[0]1,l[1]1) in lat1_1:*
* sys[lat0.sublattices[0](w[0],w[1]),
lat1.sublattices[1](l[0]1,l[1]1)] = 2*
*kwant.plot(sys, site_size=0.2, hop_lw=0.1)*
Any help would be greatly appreciated.
Regards,
Shivang Agarwal

*Shivang Agarwal*
Senior Undergraduate
Coordinator  Academic Discussion Hours
Discipline of Electrical Engineering
IIT Gandhinagar
Contact: +919869321451
Hi.
Im trying to install kwant on Anaconda 3. The install page said the package is in the condaforge but it is not there. You can look at this list of package in the condaforge.
Package repository for condaforge :: Anaconda Cloud


 
Package repository for condaforge :: Anaconda Cloud



As you can see there is no package by name kwant.
Thank you.
Hello everyone,
I am trying to reproduce the QHE bar device calculations
http://nbviewer.jupyter.org/github/topocm/topocm_content/blob/master/w3_pum…
However, I am having difficulty with the onsite and hopping values as
I am using TBModels
https://github.com/Z2PackDev/TBmodels
and therefore the values are not the same for all sites.
The problem is that after the scalar values have been passed on to the
Builder, these will then be overriden when using functions for the
positiondependent Hamiltonian.
I tried making a deep copy of the model, which would then serve as a
data structure where to draw the scalar values from when calling the
Onsite and Hopping functions. The problem with this is
a) I am getting a KeyError which I am still not sure why it happens
b) It does not feel very memoryefficient.
I am wondering if there is another way that this could be done on the
Kwant side that I have not been able to think of.
Regards

Dr. Eleni Chatzikyriakou
Computational Physics lab
Aristotle University of Thessaloniki
elchatz(a)auth.gr  tel:+30 2310 998109
Dear Developers and Users of Kwant,
I have been using Kwant for quantum transport calculations. Recently, I
came across a bit complicated model problem, which can be described as
follows:
Suppose I have two scattering regions (S1 and S2) which are defined with
two shape functions (shape_function_1 and shape_function_2) and connected
with their interface. So I am wondering a feasible way to implement
different hoppings in regions S1 and S2. And after that, how to deal with
the hoppings across the interface?
I also see Prof. Christoph Groth already giving some solutions on the
relevant issue, see here:
https://mailmanmail5.webfaction.com/pipermail/kwantdiscuss/2016November/….
<https://mailmanmail5.webfaction.com/pipermail/kwantdiscuss/2016November/…>
However, these solutions are still not clear to me.
Can you help solve my problem? Your help is greatly appreciated.
Best regards,
Kuangyia Lee
Dear Kwant Developers,
I am a graduate student learning Kwant for my academics project related
purposes.
With reference to the Kwant 1.3.1 Documentation (vide page no.45), the
honeycomb lattice for the zigzag edged graphene has been defined as:
> graphene = kwant.lattice.general([(1, 0), (sin_30, cos_30)], [(0, 0), (0,
1 / sqrt(3))])
where, as per my understanding, the first argument to the *general*
function is the list of *primitive vectors* of the lattice; the second one
is the *coordinates of basis atoms*.
According to the physics of graphene, the carboncarbon bond length is
approximately 0.142 nm. But after running the above code, I checked that
the CC bond length of the honeycomb lattice is coming as 1/sqrt(3) nm i.e.
~0.58 nm. Therefore, I am feeling quite confused as I am failing to
understand where I am going wrong or whether am overlooking any fundamental
concepts.
I had also raised my query earlier here, regarding defining the lattice for
armchair edged graphene (vide Volume 59, Issue 6), but it seems that
unfortunately it has missed your notice. So my understandings on this
specific domain are still quite hazy.
It would be of great help if you look into the matter and kindly guide me
to find solution for the above mentioned queries.
Thanks
Regards
Arunabha Ghoshal
Dear sir,
Please help me with the following error in the program
from __future__ import print_function
from ipywidgets import interact, interactive, fixed, interact_manual
import ipywidgets as widgets
import kwant
from matplotlib import pyplot
import numpy as np
from holoviews.core.options import Cycle
from types import SimpleNamespace
def nanowire_chain():
lat = kwant.lattice.chain()
sys = kwant.Builder(kwant.TranslationalSymmetry(*lat.prim_vecs))
def onsite(onsite, p):
return (2 * p.t  p.mu) * pauli.szs0 + p.B *
(np.cos(p.phi)*pauli.s0sz+
np.sin(p.phi)*np.sin(p.theta)*pauli.s0sy+np.sin(p.phi)*np.sin(p.theta)*pauli.s0sx)+
p.delta * pauli.sxs0
sys[lat(0)] = onsite
def hop(site1, site2, p):
return p.t * pauli.szs0  .5j * p.alpha * pauli.szsx
sys[kwant.HoppingKind((1,), lat)] = hop
return sys
def spinful_kitaev_chain():
lat = kwant.lattice.chain()
sys = kwant.Builder(kwant.TranslationalSymmetry(*lat.prim_vecs))
def onsite(site, p):
return (2 * p.t  p.mu) * pauli.szs0 + p.B * pauli.szsz
sys[lat(0)] = onsite
def hop(site1, site2, p):
return p.t * pauli.szs0  1j * p.delta * pauli.sys0
sys[kwant.HoppingKind((1,), lat)] = hop
return sys
def find_gap(sys, p, resolution=1e4):
"""Find gap in a system by doing a binary search in energy."""
# This tells us if there are modes at a certain energy.
if len(sys.modes(energy=0, args=[p])[0].momenta):
return 0
gap = step = min(abs(kwant.physics.Bands(sys, args=[p])(k=0))) / 2
while step > resolution:
step /= 2
if len(sys.modes(gap, args=[p])[0].momenta):
gap = step
else:
gap += step
return gap
def spinorbit_band_gap(sys, mu, t, delta, Bs):
sys = sys.finalized()
alphas = [0.0, 0.1, 0.2, 0.3]
p = SimpleNamespace(mu=mu, t=t, delta=delta,theta=theta,phi=phi)
def gap(sys, p, alpha, B):
p.alpha = alpha
p.B = B
return find_gap(sys, p)
gaps = [gap(sys, p, alpha, B) for alpha in alphas for B in Bs]
gaps = np.reshape(gaps, (len(alphas), 1))
dims = {'kdims': [r'$B$'], 'vdims': ['Band gap']}
B_crit = holoviews.VLine(np.sqrt(p.delta**2 + p.mu**2))
plot = [holoviews.Curve((Bs, gaps[i]), label=r'$\alpha={}$'.format(
alphas[i]), **dims) * B_crit for i, alpha in enumerate(alphas)]
title = r'$\Delta={delta}$, $\mu={mu}$'.format(delta=np.round(p.delta,
2), mu=np.round(p.mu, 2))
style = {'xticks': [0, 0.1, 0.2, 0.3], 'yticks': [0, 0.05, 0.1],
'fig_size': 150}
plot = holoviews.Overlay(plot)
return plot(plot=style)
def title(p):
try:
title = r"$\alpha={alpha}$, $\mu={mu}$, $B={B}$, $\Delta={delta}$"
title = title.format(alpha=np.round(p.alpha, 2),
mu=np.round(p.mu, 2),
B=np.round(p.B, 2),
delta=np.round(p.delta, 2))
except AttributeError:
title = r"$\mu={mu}$, $B={B}$, $\Delta={delta}$"
title = title.format(mu=np.round(p.mu, 2),
B=np.round(p.B, 2),
delta=np.round(p.delta, 2))
return title
style = {'k_x': np.linspace(1, 1, 101),
'xdim': r'$k$',
'ydim': r'$E/t$',
'xticks': [1, 0, 1],
'yticks': [1, 0, 1],
'xlims': [1, 1],
'ylims': [1.5, 1.5],
'title': title}
sys = nanowire_chain()
p = SimpleNamespace(t=1, mu=0.1, delta=0.1, B=0.3,theta=np.pi/2,phi=np.pi/2)
alphas = np.linspace(0, 0.4, 10)
holoviews.HoloMap({alpha: spectrum(sys, p.update(alpha=alpha), **style) for
alpha in alphas}, kdims=[r'$\alpha$'])
c:\python36\lib\sitepackages\kwant\linalg\lll.py:103: FutureWarning:
`rcond` parameter will change to the default of machine precision
times ``max(M, N)`` where M and N are the input matrix dimensions.
To use the future default and silence this warning we advise to pass
`rcond=None`, to keep using the old, explicitly pass `rcond=1`.
coefs = np.linalg.lstsq(vecs_orig.T, vecs.T)[0]
c:\python36\lib\sitepackages\kwant\linalg\lll.py:144: FutureWarning:
`rcond` parameter will change to the default of machine precision
times ``max(M, N)`` where M and N are the input matrix dimensions.
To use the future default and silence this warning we advise to pass
`rcond=None`, to keep using the old, explicitly pass `rcond=1`.
center_coords = np.array(np.round(np.linalg.lstsq(basis.T, vec)[0]), int)
NameError
Traceback (most recent call
last)<ipythoninput39ff9219a759e> in <module>() 2 p =
SimpleNamespace(t=1, mu=0.1, delta=0.1,
B=0.3,theta=np.pi/2,phi=np.pi/2) 3 alphas = np.linspace(0, 0.4,
10)> 4 holoviews.HoloMap({alpha: spectrum(sys,
p.update(alpha=alpha), **style) for alpha in alphas},
kdims=[r'$\alpha$'])
NameError: name 'holoviews' is not defined