providing params via system interface
After #77 (closed) the call signature of kwant.smatrix
and other consumers of System
have a rather lengthy call signature: kwant.smatrix(syst, energy, args=..., params=...)
. It is counter-intuitive to supply arguments that the system consumes using awkward syntax and via an unrelated function.
I propose an alternative pathway for doing so. A method System.update_parameters(*args, **kwargs)
that will return a shallow copy of the system that stores its arguments and keyword arguments such that the user doesn't need to provide them elsewhere. Example usage:
[kwant.smatrix(syst.update_parameters(0, B=5)) for B in fields]
Extra considerations
-
System
s already have a methodprecalculate
that returns a modified shallow copy. - This change is fully backwards-compatible (old way of providing parameters would still work).
Edited by Anton Akhmerov