I am thinking of calculating the conductivity with Kwant's KPM method of a 3D system with disorder and periodic boundary conditions (PBC) in every direction (no leads).
Reading some old posts, it seems to be some problem with multiple translational symmetries (or PBCs?). In my case, because of adding disorder potential, I only want PBC rather than translational symmetry. So I presume the wraparound module is irrelevant here.
Is that possible and if any problem when further calculating its conductivity?
Naively we only need to manually add hoppings that 'wrap around' the lattice. Does this cause any problem in Kwant and is there any good practice/trick for this?
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.
Dear Kwant authors
I am Yongping Du from Nanjing University of Science and Technology. I have been using the KPM method to calculate the transport properties of various graphene nanostructures, together with Prof. A. P. Jauho. As a benchmark, I calculated the conductance and density of states of the Haldane model. To my surprise, I found some differences between my numerical results and the ones obtained with Kwant. I carefully checked every term of Haldane model in my implementation and found that the hopping direction of two next nearest neighbor hopping terms was the key to those differences. By reversing the direction of the hopping term in my program, I could reproduce the results from Kwant. However, I can find no physical justification for this change.
I would be most grateful if you can help me to remove this discrepancy.
Hello Kwant Community,
In the 2014 kwant paper New J. Phys. 16 063065, Fig. 6 gives the conductance computation time scaling for 2D systems of side length L:
O(L^2) for construction, O(L^3) for solving with the MUMPS-based solver, and O(L^4) for solving with RGF.
I was wondering what the general scaling is for other dimensions. I presume it is known to experts and might be helpful to many users.
I am a B.Tech Student using Kwant for simulations.Python Version: 3.7.8
Kwant Version: 1.4.2Ubuntu 20The Error I faced is given below.
AttributeError Traceback (most recent call last)
<ipython-input-6-c80da766c4bb> in <module>
17 pyplot.ylabel("conductance [e^2/h]")
---> 19 solving(model.tokwant())
<ipython-input-6-c80da766c4bb> in solving(sys)
7 energy = ie * 0.01
8 # compute the scattering matrix at a given energy
----> 9 smatrix = kwant.greens_function(sys, energy,check_hermiticity=False)
10 # compute the transmission probability from lead 0 to
11 # lead 1
~/Downloads/112358/lib/python3.7/site-packages/kwant/_common.py in inner(*args, **kwargs)
70 if sig.bind(*args, **kwargs).arguments.get(parameter_name):
---> 72 return f(*args, **kwargs)
74 return inner
~/Downloads/112358/lib/python3.7/site-packages/kwant/solvers/common.py in greens_function(self, sys, energy, args, out_leads, in_leads, check_hermiticity, params)
485 rhs = sp.bmat([[i for i in linsys.rhs if i.shape]],
--> 487 flhs = self._factorized(linsys.lhs)
488 data = self._solve_linear_sys(flhs, rhs, kept_vars)
~/Downloads/112358/lib/python3.7/site-packages/kwant/solvers/mumps.py in _factorized(self, a)
102 def _factorized(self, a):
103 inst = mumps.MUMPSContext()
--> 104 inst.factor(a, ordering=self.ordering)
105 return inst
~/Downloads/112358/lib/python3.7/site-packages/kwant/linalg/mumps.py in factor(self, a, ordering, ooc, pivot_tol, reuse_analysis, overwrite_a)
318 row, col, data)
--> 320 self.analyze(a, ordering=ordering, overwrite_a=overwrite_a)
322 self.mumps_instance.icntl = 1 if ooc else 0
~/Downloads/112358/lib/python3.7/site-packages/kwant/linalg/mumps.py in analyze(self, a, ordering, overwrite_a)
228 if dtype != self.dtype:
--> 229 self.mumps_instance = getattr(_mumps, dtype+"mumps")(self.verbose)
230 self.dtype = dtype
AttributeError: module 'kwant.linalg._mumps' has no attribute 'dmumps'
Kindly guide me so I can overcome this error.
Dear Kwant Users,
I am trying to calculate the bulk density of states for an infinite(in x) homogenous 2D superconductor with spin orbit and Zeeman field with 3 sites in the y direction. I have defined the leads and the system according to the superconducting hamiltonian. For the same, I calculate the dos for the first layer(in y) using the following piece of code:
X1 = np.sum(ldos1[0:4])
Now, the result I get is physically correct, although I would want the DOS to be a little smoother. In the traditional way of doing things, a retarded greens function would have a small imaginary part, increasing which would give me a smoother curve. Is there any way in kwant, that I can control such a broadening parameter?
Thanking you in advance,
In follow-up to a recent question "Numerical precision of smatrix" https://firstname.lastname@example.org/thread/LZ22X… , I am also having issues with numerical precision and/or convergence of the wave functions inside the scattering region when using the default solver. Specifically, I am calculating tunnel couplings from a lead to a well through a barrier. There are resonances in the density of states at the energies of bound states inside the well, whose linewidth depends on the barrier height. When the resonances become too sharp, the DOS computed by Kwant becomes choppy and loses its well defined resonance characteristics. How can I improve the tolerance/precision of this calculation?
The code to compute the DOS would look like this:
wfs = kwant.wave_function(sys,energy=energy);
wf = wfs(leadNum)[leadBandNum]
rho = kwant.operator.Density(sys);
density = rho(wf);
We are writing this email as we would like to ask about the application of the bound state algorithm (described in https://scipost.org/10.21468/SciPostPhys.4.5.026) to higher-dimensional systems. In particular, we are trying to apply the algorithm to solve for proximitised 3DTIs, and for reference have been trying to understand the example cases of the quantum billiards and 2D topological insulator in the paper. Essentially, we would like to clarify if the reduction of higher-dimensional systems to quasi-1D is necessary for the bound state algorithm to work correctly.
To solve for the 2D BHZ model (Section 5.2), the system was reduced to a quasi-1D system through the use of the Bloch theorem, and was then fed into the bound state algorithm. In section 4 however, a system of quantum billiards was considered without any mention of reduction to a quasi-1D system. As we are trying to apply the algorithm to a 3D system, we are wondering if this is a necessary step for the algorithm to work as intended. In the proximitised 3DTI systems we are considering, the leads are translationally invariant only in 1 direction, so we are wondering if the algorithm can be applied if we do need to reduce the system like in section 5.2.
Thank you very much!
Ryan and Chi
This might be a bit off topic. I've been using kwant via anaconda for a while because it was easier to install, but recently I've moved to a standard virtualenv and compiled kwant on my own (including mumps and openblas). But I've notice that my code is running much faster in conda+kwant than in my virtualenv+kwant.
I'm still tracking why is there such a huge difference. The code basically builds a system without leads, extract the "hamiltonian_submatrix" for a given set of parameters and calculates the eigenvalues. Then I loop over a set of parameters. Running the code in the conda environment, it takes 15 minutes, but in my own virtualenv with compiled kwant it takes 2 hours!! It's exactly the same code.
In conda the numpy runs with MKL, while in my virtualenv it runs with openblas. I've run a benchmark and the MKL is giving a near 2x speedup over OpenBlas for SVD and eigenvalues.
I've compiled kwant with MUMPS and it seems ok. I've also tested with the kwant binary from Debian packages by setting "include-system-site-packages = false" and it get the same result (2h running time).
Is there anything else I could be missing that would speed up the code? It seems that numpy is not the problem, since the MKL vs OpenBlas is at most a factor of 2. Maybe my compilation is not properly linking to MUMPS? How can I check if my kwant compilation is properly using openblas and MUMPS?
I am attempting to approximate the first derivate over the system's wavefunction values, yet it seems there is no neighbors() function to call after finalization of the system.
What would be the method to attain a list of neighboring sites after finalizaion? Is the ordering of the sites preserved before and after finalization?