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
b416e486
Commit
b416e486
authored
6 years ago
by
Christoph Groth
Browse files
Options
Downloads
Patches
Plain Diff
expand whatsnew item about defaults values being no longer allowed
parent
68d49654
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#12380
passed with warnings
6 years ago
Stage: build
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
doc/source/pre/whatsnew/1.4.rst
+12
-2
12 additions, 2 deletions
doc/source/pre/whatsnew/1.4.rst
with
12 additions
and
2 deletions
doc/source/pre/whatsnew/1.4.rst
+
12
−
2
View file @
b416e486
...
...
@@ -6,8 +6,8 @@ See also the `full list of changes up to the most recent bugfix
release of the 1.4 series
<https://gitlab.kwant-project.org/kwant/kwant/compare/v1.4.0...latest-1.4>`_.
Value functions no longer
accept
default values for parameters
--------------------------------------------------------------
Value functions
may
no longer
have
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
...
...
@@ -35,6 +35,16 @@ Concretely, the above means that the following no longer works::
# Raises ValueError
syst = syst.finalized()
As a solution, simply remove the default values and always provide ``t``.
To deal with many parameters, the following idiom may be useful::
defaults = dict(a=0, b=1, c=2, d=3)
...
smatrix = kwant.smatrix(syst, E, params=dict(defaults, d=4, e=5))
Note that it allows to override defaults as well as to add additional
parameters.
System parameter substitution
-----------------------------
After the introduction of ``Builder.fill`` it has become possible to construct
...
...
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