kwant.plotter.interpolate_current

kwant.plotter.interpolate_current#

kwant.plotter.interpolate_current(syst, current, relwidth=None, abswidth=None, n=9)[source]#

Interpolate currents in a system onto a regular grid.

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 vector 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 and abswidth parameters.

This routine samples the smoothed field on a regular (square or cubic) grid.

Parameters:
  • syst (A finalized system) – The system on which we are going to calculate the field.

  • current ('1D array of float') – Must contain the intensity on each hoppings in the same order that they appear in syst.graph.

  • relwidth (float or None) – Relative width of the bumps used to generate the field, as a fraction of the length of the longest side of the bounding box. This argument is only used if abswidth is not given.

  • abswidth (float or None) – Absolute width of the bumps used to generate the field. Takes precedence over relwidth. If neither is given, the bump width is set to four times the length of the shortest hopping.

  • n (int) – Number of points the grid must have over the width of the bump.

Returns:

  • field (n-d arraylike of float) – n-d array of n-d vectors.

  • box (sequence of 2-sequences of float) – the extents of field: ((x0, x1), (y0, y1), …)