Re: [Kwant] parametrization of a system
Dear Anton, thank you very much for your reply. To be more specific, my problem is the following : in the example closed_system.py, if I put the B dependance in the make_system function as make_system(a=1, t=1.0, r=10, B=0.): and simply put the expression of the B-dependant hopping terms instead of using the hopx subfunction, then I will obtain a spectrum which is B-independent. Best, Anil Le Lun 20 janvier 2014 11:50, Anton Akhmerov a écrit : > Dear Anli, > > > In Kwant there are two ways to alter the values of matrix elements of > the Hamiltonian after the system have been finalized. The first one, and > also the preferred one is to use the 'args' argument to the value > functions. The other option is to use the fact that the functions can > access e.g. global variables. However both methods have exactly the same > scope, and there is hence no reason to not use the 'args' argument. > > Can you be more specific with what you mean by "This seems not to > always work", perhaps the problem is with the way you used the extra > parameter for the functions? > > Best, > Anton > > > On Sun, Jan 19, 2014 at 11:38 PM, Anil Murani <anil.murani@u-psud.fr> > wrote: > >> Dear all, >> >> >> I am facing a problem when it comes to parametrize a system in Kwant : >> I am >> using the same "trick" as in the example on closed system >> (closed_system.py) >> where the parameter B is defined in a subfunction of make_system. This >> seems not to always work ; do you have a better alternative which avoids >> to finalize the system with different magnetic fields ? >> >> Regards, >> >> >> Anil >> >
Dear Anil, I understand your problem now. You provide the argument right when you are creating the system. Please look more carefully at how it is done in the kwant tutorial, http://kwant-project.org/doc/1.0/_downloads/closed_system.py There the creation of the system is done without magnetic field as an argument. Instead, the magnetic field is an extra argument to one of the value functions (namely 'hopx'). The values of the magnetic field used in the calculation are then provided in the function 'plot_spectrum'. Best, Anton On Thu, Jan 23, 2014 at 9:37 AM, Anil Murani <anil.murani@u-psud.fr> wrote:
Dear Anton,
thank you very much for your reply. To be more specific, my problem is the following :
in the example closed_system.py, if I put the B dependance in the make_system function as
make_system(a=1, t=1.0, r=10, B=0.):
and simply put the expression of the B-dependant hopping terms instead of using the hopx subfunction, then I will obtain a spectrum which is B-independent.
Best,
Anil
Le Lun 20 janvier 2014 11:50, Anton Akhmerov a écrit :
Dear Anli,
In Kwant there are two ways to alter the values of matrix elements of
the Hamiltonian after the system have been finalized. The first one, and
also the preferred one is to use the 'args' argument to the
value
functions. The other option is to use the fact that the functions can
access e.g. global variables. However both methods have exactly the same
scope, and there is hence no reason to not use the 'args'
argument.
Can you be more specific with what you mean by "This seems not to
always work", perhaps the problem is with the way you used the extra
parameter for the functions?
Best,
Anton
On Sun, Jan 19, 2014 at 11:38 PM, Anil Murani <anil.murani@u-psud.fr>
wrote:
Dear all,
I am facing a problem when it comes to parametrize a system in Kwant :
I am
using the same "trick" as in the example on closed system
(closed_system.py)
where the parameter B is defined in a subfunction of make_system. This
seems not to always work ; do you have a better alternative which avoids
to finalize the system with different magnetic fields ?
Regards,
Anil
participants (2)
-
Anil Murani
-
Anton Akhmerov