kwant.plotter.bands

Contents

kwant.plotter.bands#

kwant.plotter.bands(sys, args=(), momenta=65, file=None, show=True, dpi=None, fig_size=None, ax=None, *, params=None)[source]#

Plot band structure of a translationally invariant 1D system.

Parameters:
  • sys (kwant.system.InfiniteSystem) – A system bands of which are to be plotted.

  • args (tuple, defaults to empty) – Positional arguments to pass to the hamiltonian method. Deprecated in favor of ‘params’ (and mutually exclusive with it).

  • momenta (int or 1D array-like) – Either a number of sampling points on the interval [-pi, pi], or an array of points at which the band structure has to be evaluated.

  • file (string or file object or None) – The output file. If None, output will be shown instead. If plotly is selected as the engine, the filename has to end with a html extension.

  • show (bool) – For matplotlib engine, whether matplotlib.pyplot.show() is to be called, and the output is to be shown immediately. For the plotly engine, a call to iplot(fig) is made if show is True. Defaults to True for both engines.

  • dpi (float) – Number of pixels per inch. If not set the matplotlib default is used. Only for matplotlib engine. If the plotly engine is selected and this argument is not None, then a RuntimeError will be triggered.

  • fig_size (tuple) – Figure size (width, height) in inches. If not set, the default matplotlib value is used. Only for matplotlib engine. If the plotly engine is selected and this argument is not None, then a RuntimeError will be triggered.

  • ax (matplotlib.axes.Axes instance or None) – If ax is not None, no new figure is created, but the plot is done within the existing Axes ax. in this case, file, show, dpi and fig_size are ignored. Only for matplotlib engine. If the plotly engine is selected and this argument is not None, then a RuntimeError will be triggered.

  • params (dict, optional) – Dictionary of parameter names and their values. Mutually exclusive with ‘args’.

Returns:

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

Return type:

matplotlib figure or plotly Figure object

Notes

See Bands for the calculation of dispersion without plotting.