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
d2145780
Commit
d2145780
authored
6 years ago
by
Joseph Weston
Browse files
Options
Downloads
Patches
Plain Diff
explain that kwant no longer accepts default values in value functions
parent
0a7bc483
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
+29
-0
29 additions, 0 deletions
doc/source/pre/whatsnew/1.4.rst
with
29 additions
and
0 deletions
doc/source/pre/whatsnew/1.4.rst
+
29
−
0
View file @
d2145780
...
...
@@ -48,6 +48,35 @@ the scattering region and leads, one could do the following::
kwant.smatrix(syst, params=dict(V_dot=0, V_lead=1))
Value functions no longer accept default values for parameters
--------------------------------------------------------------
Using value functions with default values for parameters can be
problematic, especially when re-using value functions between simulations.
When parameters have default values it is easy to forget that such a
parameter exists at all, because it is not necessary to provide them explicitly
to functions that use the Kwant system. This means that other value functions
might be introduced that also depend on the same parameter,
but in an inconsistent way (e.g. a parameter 'phi' that is a superconducting
phase in one value function, but a peierls phase in another). This leads
to bugs that are confusing and hard to track down.
Concretely, the above means that the following no longer works::
syst = kwant.Builder()
# Parameter 't' has a default value of 1
def onsite(site, V, t=1):
return V = 2 * t
def hopping(site_a, site_b, t=1):
return -t
syst[...] = onsite
syst[...] = hopping
# Raises ValueError
syst = syst.finalized()
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