kwant.plotter.current(syst, current, relwidth=0.05, **kwargs)[source]

Show an interpolated current defined for the hoppings of a system.

The system graph together with current intensities defines a “discrete” current density field where the current density is non-zero only on the straight lines that connect sites that are coupled by a hopping term.

To make this scalar field easier to visualize and interpret at different length scales, it is smoothed by convoluting it with the bell-shaped bump function f(r) = max(1 - (2*r / width)**2, 0)**2. The bump width is determined by the relwidth parameter.

This routine samples the smoothed field on a regular (square or cubic) grid and displays it using an enhanced variant of matplotlib’s streamplot.

This is a convenience function that is equivalent to streamplot(*interpolate_current(syst, current, relwidth), **kwargs). The longer form makes it possible to tweak additional options of interpolate_current.


The system for which to plot the current.

currentsequence of float

Sequence of values defining currents on each hopping of the system. Ordered in the same way as syst.graph. This typically will be the result of evaluating a Current operator.

relwidthfloat or None

Relative width of the bumps used to smooth the field, as a fraction of the length of the longest side of the bounding box.


Keyword args to be passed verbatim to kwant.plotter.streamplot.

figmatplotlib figure

A figure with the output if ax is not set, else None.

Previous topic


Next topic


This Page