Skip to content
Snippets Groups Projects
Commit fa02680f authored by Joseph Weston's avatar Joseph Weston
Browse files

declare 'args' as deprecated in whatsnew

parent e9557cf7
No related branches found
No related tags found
No related merge requests found
...@@ -170,6 +170,27 @@ parameters that the system (and its leads) expects:: ...@@ -170,6 +170,27 @@ parameters that the system (and its leads) expects::
This is a provisional API that may be changed in a future version of Kwant. This is a provisional API that may be changed in a future version of Kwant.
Passing system arguments via ``args`` is deprecated in favor of ``params``
--------------------------------------------------------------------------
It is now deprecated to pass arguments to systems by providing the
``args`` parameter (in ``kwant.smatrix`` and elsewhere). This is
error prone and requires that all value functions take the same
formal parameters, even if they do not depend on all of them. The
preferred way of passing parameters to Kwant systems is by passing
a dictionary using ``params``::
def onsite(site, magnetic_field, voltage):
return magnetic_field * sigma_z + voltage * sigma_0
syst = make_system(onsite).finalized()
kwant.smatrix(syst, params=dict(magnetic_field=0.5, voltage=0.2))
# Compare this to the deprecated 'args'
kwant.smatrix(syst, args=(0.5, 0.2))
The ability to provide ``args`` will be removed in a future Kwant version.
Interpolated density plots Interpolated density plots
-------------------------- --------------------------
A new function `~kwant.plotter.density` has been added that can be used to A new function `~kwant.plotter.density` has been added that can be used to
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment