Dear Kwant developers,
I am trying to calculate conductance of a system with disorder at different chemical potentials. The geometry is constant, so I want to finalize() only once. The question:how do I change onsite potential after finalization?
There is an example from the manual with conductance through a well of variable depth, but if I do it that way, I would generate new onsite potential every time I change chemical potential, which I would like to avoid.
Thank you, Pavlo
Hi Pavlo,
- You may make the Hamiltonian have an arbitrary functional dependence on a parameter say def h(site, mu, x0): return mu * tanh(site.pos[0] - x0) This is described in this tutorial: https://kwant-project.org/doc/1/tutorial/spin_potential_shape#spatially-depe... - For even more flexibility you may make an arbitrary function a parameter of your Hamiltonian, e.g. def h(site, mu): return mu(site.pos)
Best, Anton
On Thu, May 23, 2019 at 10:14 PM Pavlo Bulanchuk pavlo.o.bulanchuk@gmail.com wrote:
Dear Kwant developers,
I am trying to calculate conductance of a system with disorder at different chemical potentials. The geometry is constant, so I want to finalize() only once. The question:how do I change onsite potential after finalization?
There is an example from the manual with conductance through a well of variable depth, but if I do it that way, I would generate new onsite potential every time I change chemical potential, which I would like to avoid.
Thank you, Pavlo
Hi Anton,
Thanks for the response. The example you sent is exactly the one I was talking about. There is a problem with it for my case. I am using randomly distributed onsite potential: def onsite(site): return np.random.uniform(-0.1,0.1)
I have two concerns about this: 1. Does it produce a correct S-matrix and conductance? Will I get a conductance averaged over disorder if I average the transmission coefficient of the S-matrix? 2. I need to calculate conductance at different chemical potentials for the *same disordered system. *If I use the onsite function, mentioned above, each time I calculate the S-matrix, disorder will change. Is there a way to fix the disorder but still be able to change the potential later without rebuilding the system?
Thank you, Pavlo
On Thu, May 23, 2019 at 11:25 PM Anton Akhmerov anton.akhmerov+kd@gmail.com wrote:
Hi Pavlo,
- You may make the Hamiltonian have an arbitrary functional dependence
on a parameter say def h(site, mu, x0): return mu * tanh(site.pos[0] - x0) This is described in this tutorial:
https://kwant-project.org/doc/1/tutorial/spin_potential_shape#spatially-depe...
- For even more flexibility you may make an arbitrary function a
parameter of your Hamiltonian, e.g. def h(site, mu): return mu(site.pos)
Best, Anton
On Thu, May 23, 2019 at 10:14 PM Pavlo Bulanchuk pavlo.o.bulanchuk@gmail.com wrote:
Dear Kwant developers,
I am trying to calculate conductance of a system with disorder at
different chemical potentials. The geometry is constant, so I want to finalize() only once. The question:how do I change onsite potential after finalization?
There is an example from the manual with conductance through a well of
variable depth, but if I do it that way, I would generate new onsite potential every time I change chemical potential, which I would like to avoid.
Thank you, Pavlo
Pavlo Bulanchuk wrote:
def onsite(site): return np.random.uniform(-0.1,0.1)
I have two concerns about this:
- Does it produce a correct S-matrix and conductance? Will I get a
conductance averaged over disorder if I average the transmission coefficient of the S-matrix?
Your approach might work, if each onsite Hamiltonian is requested only once, which I believe should be the case when calling 'transmission'. But we do not recommend using a regular random number generator inside a value function. It's too fragile and error-prone.
- I need to calculate conductance at different chemical potentials
for the same disordered system. If I use the onsite function, mentioned above, each time I calculate the S-matrix, disorder will change. Is there a way to fix the disorder but still be able to change the potential later without rebuilding the system?
The module kwant.digest was created precisely to solve this problem. Please see the documentation and also the relevant section of the Kwant paper.
If you prefer to use a conventional random number generator, then do not call it from the value function. Rather store the potential in an array and pass that array as a parameter to the system.