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
>>
>