-
Joseph Weston authoredJoseph Weston authored
What's new in Kwant 1.4
This article explains the user-visible changes in Kwant 1.4.0. See also the full list of changes up to the most recent bugfix release of the 1.4 series.
Configurable maximum velocity in stream plots
The function ~kwant.plotter.streamplot has got a new option vmax
. Note
that this option is not available in ~kwant.plotter.current. In order to use
it, one has to call streamplot
directly as shown in the docstring of
current
.
Improved heuristic for colorscale limits in kwant.plotter.map
Previously ~kwant.plotter.map would set the limits for the color scale
to the extrema of the data being plotted when vmin
and vmax
were
not provided. This is the behaviour of matplotlib.imshow
. When the data
to be plotted has very sharp and high peaks this would mean that most of the
data would appear near the bottom of the color scale, and all of the features
would be washed out by the presence of the peak. Now ~kwant.plotter.map
employs a heuristic for setting the colorscale when there are outliers,
and will emit a warning when this is detected.
System parameter names can be modified
After the introduction of Builder.fill
it has become common to construct
Kwant systems by first creating a "model" system with high symmetry and then
filling a lower symmetry system with this model. Often, however, you want
to use different parameter values in different parts of your system. In
previous versions of Kwant this was difficult to achieve.
Builders now have a method subs
that makes it easy to substitute different
names for parameters. For example if you have a Builder model
that has
a parameter V
, and you wish to have different values for V
in your
scattering region and leads you could do the following:
syst = kwant.Builder()
syst.fill(model.subs(V='V_dot', ...))
lead = kwant.Builder()
lead.fill(model.subs(V='V_lead'), ...)
syst.attach_lead(lead)
fsyst = syst.finalized()
kwant.smatrix(syst, params=dict(V_dot=0, V_lead=1))
Interpolated density plots
A new function ~kwant.plotter.density has been added that can be used to visualize a density defined over the sites of a Kwant system. This convolves the "discrete" density (defined over the system sites) with a "bump" function in realspace. The output of ~kwant.plotter.density can be more informative that ~kwant.plotter.map when plotting systems with many sites, where it is not important to see the individual contribution from each site.