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 Colleagues:
I have a question about Kwant realization:
Can we input a initial wave packet and get the conductance or the final state?
Could you give some suggestions? 3Q
Best wishes!!!
--
Jinlong Zhang
jlzhang(a)163.com

It seems like the documentation here
<https://gitlab.kwant-project.org/kwant/kwant/blob/fdd4674/kwant/continuum/d…>
is wrong because it expects a dictionary.
I see that you do
template = kwant.continuum.discretize_symbolic(hamiltonian)
t = kwant.continuum.build_discretized(template, coords = ('x','y','z'))
However, discretize_symbolic returns two variables. Instead do:
template, coods = kwant.continuum.discretize_symbolic(hamiltonian)
t = kwant.continuum.build_discretized(template, coords)
The list of coods should be passed to discretize_symbolic. However, if you
omit it, it will be inferred from your Hamiltonian’s k_{x, y, z} terms.
Best, Bas
On Fri, Mar 29, 2019 at 3:11 PM Naveen Yadav <naveengunwal72(a)gmail.com>
wrote:
> Hi Bas,
>
> Thanks for your reply.
>
> I have used the same syntax. But it is showing an Attribute Error: 'tuple
> object has no attribute 'items'
>
> from __future__ import division
> import kwant
> import kwant.continuum
> import scipy.sparse.linalg
> import scipy.linalg
> import numpy as np
> import sympy
> from math import sin, cos, sqrt, pi
> import matplotlib.pyplot as plt
> hamiltonian = ("""k_x**2 + k_y**2 + k_z**2""")
> hamiltonian = kwant.continuum.sympify(hamiltonian)
> template = kwant.continuum.discretize_symbolic(hamiltonian)
> t = kwant.continuum.build_discretized(template, coords = ('x', 'y', 'z'))
> print(t)
>
> AttributeError Traceback (most recent call last)<ipython-input-12-9780451ce368> in <module> 11 hamiltonian = kwant.continuum.sympify(hamiltonian) 12 template = kwant.continuum.discretize_symbolic(hamiltonian)---> 13 t = kwant.continuum.build_discretized(template, coords = ('x','y','z')) 14 print(t) 15 hamiltonian
> /usr/local/lib/python3.6/dist-packages/kwant/continuum/discretizer.py in build_discretized(tb_hamiltonian, coords, grid_spacing, locals) 281 282 with reraise_warnings():--> 283 for k, v in tb_hamiltonian.items(): 284 tb_hamiltonian[k] = sympify(v, locals) 285
> AttributeError: 'tuple' object has no attribute 'items'
>
> What should I do.
>
> Naveen
>
>
> On Fri, Mar 29, 2019 at 5:37 PM Bas Nijholt <basnijholt(a)gmail.com> wrote:
>
>> Hi Naveen,
>>
>> In the documentation
>> <https://kwant-project.org/doc/dev/reference/generated/kwant.continuum.build…>
>> you can see that coords require a sequence of strings, so for example:
>>
>> coords = ('x',) # for 1D
>> coords = ('x', 'y', 'z') # for 3D
>>
>> Best, Bas
>>
>> On Fri, Mar 29, 2019 at 12:59 PM Naveen Yadav <naveengunwal72(a)gmail.com>
>> wrote:
>>
>>> I want to know more about the builid_discretized(tb_hamiltonian, coords).
>>> I did not undersand what should be the syntax to write the coords.Could
>>> you please help me by sending an example code for writing coords?
>>>
>>> Thanks in Advance.
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> Naveen
>>> Department of Physics & Astrophysics
>>> University of Delhi
>>> 110007
>>>
>>
>
> --
>
>
> With Best Regards
> NAVEEN YADAV
> Ph.D Research Scholar
> Deptt. Of Physics & Astrophysics
> University Of Delhi.
>

I want to know more about the builid_discretized(tb_hamiltonian, coords).
I did not undersand what should be the syntax to write the coords.Could you
please help me by sending an example code for writing coords?
Thanks in Advance.
Naveen
Department of Physics & Astrophysics
University of Delhi
110007

Dear Joe,
concerning to your answer
https://www.mail-archive.com/kwant-discuss@kwant-project.org/msg01808.html ,
I checked that I do not have any sign problem, as those you described,
in my system/code.
Therefore I am wandering if some fuzzy problem of matching of wavefunctions
is known, or expected, to occur when metals (leads) and semimetals
(scattering region)
are put in contact (perhaps due to symmetries of whatever), not
depending on the sign problem.
I also attach below the code that I used, and that looks me correct,
after various checks
on the spectrum of the scattering region and of the leads.
I assumed a cubic lattice with periodic boundary conditions along x
and z, while the leads are along y.
However, I checked that the problem persists also assuming open
boundary conditions.
Thank you very much for the help and best regards
L.
-----------------------------------------------------------------------------------
import kwant
import math
import cmath
import scipy.sparse.linalg as sla
import numpy
# For plotting
from matplotlib import pyplot
# For matrix support
import tinyarray
#-----------------------------------------------------
# We define Pauli-matrices
sigma_0 = tinyarray.array([[1, 0], [0, 1]])
sigma_x = tinyarray.array([[0, 1], [1, 0]])
sigma_y = tinyarray.array([[0, -1j], [1j, 0]])
sigma_z = tinyarray.array([[1, 0], [0, -1]])
# We define the variables and the constants
t = 1.0
v = 1.0
L = 13 # length y
W = 13 # length x and z
k0 = math.pi/10.
#k0 = -0.4636476090008061
m0 = math.cos(k0)
vtilde = v/math.sin(k0)
h = vtilde*m0 + 2*v
a=1
#---------------------------------------------------------------------------------------------------------
syst = kwant.Builder()
lat = kwant.lattice.cubic(a)
for i in range(W):
for j in range(L):
for k in range(W):
# On-site Hamiltonian
syst[lat(i, j, k)] = h*sigma_x
# Hopping in x-direction
if i > 0:
syst[lat(i, j, k), lat(i - 1, j, k)] = -(vtilde/2)*sigma_x
# Hopping in y-direction
if j > 0:
syst[lat(i, j, k), lat(i, j - 1, k)] =
-(v/2)*((1j)*sigma_y + sigma_x)
# Hopping in z-direction
if k > 0:
syst[lat(i, j, k), lat(i, j, k - 1)] =
-(v/2)*((1j)*sigma_z + sigma_x)
# I close hopping in x-direction, connecting W-1 and 0
for j in range(L):
for k in range(W):
syst[lat(0, j, k), lat(W-1, j, k)] = -(vtilde/2)*sigma_x
# I close the hopping in z-direction, connecting W-1 and 0
for i in range(W):
for j in range(L):
syst[lat(i, j, 0), lat(i, j, W-1)] = -(v/2)*((1j)*sigma_z + sigma_x)
#---------------------------------------------------------------------------------------------------------
# We define the right lead, along y
sym_right_lead = kwant.TranslationalSymmetry((0, a, 0))
right_lead = kwant.Builder(sym_right_lead)
for i in range(W):
for k in range(W):
right_lead[lat(i, 0, k)] = mu*sigma_0
if i > 0:
right_lead[lat(i, 0, k), lat(i-1, 0, k)] = -t*sigma_0
if k > 0:
right_lead[lat(i, 0, k), lat(i, 0, k-1)] = -t*sigma_0
right_lead[lat(i, 1, k), lat(i, 0, k)] = -t*sigma_0
# I close hopping in x-direction, connecting W-1 and 0
for k in range(W):
right_lead[lat(0, 0, k), lat(W-1, 0, k)] = -t*sigma_0
# I close hopping in z-direction, connecting W-1
for i in range(W):
right_lead[lat(i, 0, 0), lat(i, 0, W-1)] = -t*sigma_0
syst.attach_lead(right_lead)
left_lead = right_lead.reversed()
syst.attach_lead(left_lead)

Dear all,
I am just a beginner on Kwant and downloaded Kwant 1.4.
It is quite frustrated on getting syntax errors using full sample code from Kwan paper or APS tutorial
which themselves provide very good introduction.
For example, in Kwant paper Appendix D.5,
smatrix = kwant.smatrix(sys, energy, args=[phi, ""]) doesn't work.
Then I have modified to
smatrix = kwant.smatrix(sys, energy,params=(phi=phi,salt="" ) it still doesn't work.
Could anyone help? There are so many codes in Kwant paper and APS tutorial which relies on old version
of Kwant. It would really be very helpful to keep the sample codes updated.
Thanks a lot.
Clement

Dear Sir.
I have a question about Kwnat.
Can we calculate the systems considered with the dephasing effects by Kwant?
For example, just add a non-hermite terms in the onsite potential or add the non-hermite hopping between (i,j) and (j,i) leading the Hamiltonian no longer hermite ?
--
Jinlong Zhang
jlzhang(a)163.com

Dear kwant developers,
I am currently testing the new feature of kwant 1.4 - the interface with
qsymm library.
kag_lat = kwant.lattice.kagome()
kagome = kwant.Builder(kwant.TranslationalSymmetry(*kag_lat.prim_vecs))
kagome[kag_lat.shape((lambda pos: True), (0, 0))] = 0
kagome[kag_lat.neighbors(1)] = 1
kwant.plot(kagome,site_color=family_color,site_lw=0.01)
kagome = wraparound(kagome).finalized()
#dispersion_2D(kag_lat,kagome)
import kwant.qsymm
kwant.qsymm.find_builder_symmetries(kagome)
When I try to find the symmetries of the kagome lattice using the
find_builder_symmetries I get the following error. Can you please help me
fix this?
---------------------------------------------------------------------------TypeError
Traceback (most recent call
last)<ipython-input-10-b70a7b7c1860> in <module> 7
#dispersion_2D(kag_lat,kagome) 8 import kwant.qsymm----> 9
kwant.qsymm.find_builder_symmetries(kagome)
/anaconda3/lib/python3.6/site-packages/kwant/qsymm.py in
find_builder_symmetries(builder, momenta, params, spatial_symmetries,
prettify, sparse) 449 450 ham = builder_to_model(builder,
momenta=momenta,--> 451 real_space=False,
params=params) 452 453 # Use dense or sparse computation
depending on Hamiltonian size
/anaconda3/lib/python3.6/site-packages/kwant/qsymm.py in
builder_to_model(syst, momenta, real_space, params) 153 #
translation vectors. 154 if dim == 0:--> 155 proj =
np.empty((0, len(list(syst.sites())[0].pos))) 156 elif dim <
len(list(syst.sites())[0].pos): 157 proj, r =
la.qr(np.array(periods).T, mode='economic')
TypeError: 'tuple' object is not callable
Thanks
Regards,
Srilok Srinivasan

Hi everyone,
I am not excellent in using kwant. Recently I want to use kwant to model
the edge passivation to a ribbon structure (say a graphene ribbon). Can
anyone show me how to implement? Thanks a lot.
Best,
Kuangyia

Hello
I think I have updated kwant on my laptop since it gives me the version
1.4.0a1 when I write kwant.version.version. But, new libraries added to the
latest version such as kwant.kpm.conductivity or importing kwant.qsymm are
not working when I call them. What should I do?
Best regards,
Ali