Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
K
kwant
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Joseph Weston
kwant
Commits
cc717c32
Commit
cc717c32
authored
6 years ago
by
Joseph Weston
Browse files
Options
Downloads
Patches
Plain Diff
add whatsnew entry for 'System.parameters'
parent
ec47af18
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
doc/source/pre/whatsnew/1.4.rst
+32
-0
32 additions, 0 deletions
doc/source/pre/whatsnew/1.4.rst
with
32 additions
and
0 deletions
doc/source/pre/whatsnew/1.4.rst
+
32
−
0
View file @
cc717c32
...
...
@@ -138,6 +138,38 @@ the scattering region and leads, one could do the following::
kwant.smatrix(syst, params=dict(V_dot=0, V_lead=1))
System parameters can now be inspected
--------------------------------------
In modern Kwant the preferred way to pass arguments to your models
is by *name*, using a dictionary and ``params``::
def onsite(site, magnetic_field, voltage):
return magnetic_field * sigma_z + voltage * sigma_0
def lead_onsite(site, lead_voltage):
return lead_voltage * sigma_0
syst = make_system(onsite)
syst.attach_lead(make_lead(lead_onsite))
syst = syst.finalized()
# naming the arguments makes things clear!
kwant.smatrix(syst, params=dict(magnetic_field=0.5, voltage=1,
lead_voltage=0.2))
This is a much clearer and less error prone than passing arguments by
*position* using ``args``, as was required in older versions of Kwant.
In this version of Kwant we introduce the ``parameters`` attribute of
*finalized systems*, which allows inspection of the names of the
parameters that the system (and its leads) expects::
>>> syst.parameters
frozenset({'magnetic_field', 'voltage'})
>>> syst.leads[0].parameters
frozenset({'V_lead'})
This is a provisional API that may be changed in a future version of Kwant.
Interpolated density plots
--------------------------
A new function `~kwant.plotter.density` has been added that can be used to
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment