FermiSurfacePlotter#

class ifermi.plot.FermiSurfacePlotter(fermi_surface, symprec=0.001)[source]#

Bases: object

Class to plot a FermiSurface.

Parameters:
  • fermi_surface (FermiSurface) – A FermiSurface object.

  • symprec (float) – The symmetry precision in Angstrom for determining the high symmetry k-point labels.

get_plot(plot_type='plotly', spin=None, colors=None, azimuth=45.0, elevation=35.0, color_properties=True, vector_properties=False, projection_axis=None, vector_spacing=0.2, cmin=None, cmax=None, vnorm=None, hide_surface=False, hide_labels=False, hide_cell=False, plot_index=None, **plot_kwargs)[source]#

Plot the Fermi surface.

Parameters:
  • plot_type (str) – Method used for plotting. Valid options are: “matplotlib”, “plotly”, “mayavi”, “crystal_toolkit”.

  • spin (Optional[Spin]) – Which spin channel to plot. By default plot both spin channels if available.

  • azimuth (float) – The azimuth of the viewpoint in degrees. i.e. the angle subtended by the position vector on a sphere projected on to the x-y plane.

  • elevation (float) – The zenith angle of the viewpoint in degrees, i.e. the angle subtended by the position vector and the z-axis.

  • colors (UnionType[str, dict, list, None]) –

    The color specification for the iso-surfaces. Valid options are:

    • A single color to use for all Fermi surfaces, specified as a tuple of rgb values from 0 to 1. E.g., red would be (1, 0, 0).

    • A list of colors, specified as above.

    • A dictionary of {Spin.up: color1, Spin.down: color2}, where the colors are specified as above.

    • A string specifying which matplotlib colormap to use. See https://matplotlib.org/tutorials/colors/colormaps.html for more information.

    • None, in which case the default colors will be used.

  • color_properties (str | bool) – Whether to use the properties to color the Fermi surface. If the properties is a vector then the norm of the properties will be used. Note, this will only take effect if the Fermi surface has properties. If set to True, the viridis colormap will be used. Alternative colormaps can be selected by setting color_properties to a matplotlib colormap name. This setting will override the colors option. For vector properties, the arrows are colored according to the norm of the properties by default. If used in combination with the projection_axis option, the color will be determined by the dot product of the properties with the projection axis.

  • vector_properties (str | bool) – Whether to plot arrows for vector properties. Note, this will only take effect if the Fermi surface has vector properties. If set to True, the viridis colormap will be used. Alternative colormaps can be selected by setting vector_properties to a matplotlib colormap name. By default, the arrows are colored according to the norm of the properties. If used in combination with the projection_axis option, the color will be determined by the dot product of the properties with the projection axis.

  • projection_axis (Optional[tuple[int, int, int]]) – Projection axis that can be used to calculate the color of vector properties. If None, the norm of the properties will be used, otherwise the color will be determined by the dot product of the properties with the projection axis. Only has an effect when used with the vector_properties option.

  • vector_spacing (float) – The rough spacing between arrows. Uses a custom algorithm for resampling the Fermi surface to ensure that arrows are not too close together. Only has an effect when used with the vector_properties option.

  • cmin (Optional[float]) – Minimum intensity for normalising properties colors (including vector colors). Only has an effect when used with color_properties or vector_properties options.

  • cmax (Optional[float]) – Maximum intensity for normalising properties colors (including vector colors). Only has an effect when used with color_properties or vector_properties options.

  • vnorm (Optional[float]) – The value by which to normalize the vector lengths. For example, spin properties should typically have a norm of 1 whereas group velocity properties can have larger or smaller norms depending on the structure. By changing this number, the size of the vectors will be scaled. Note that the properties of two materials can only be compared quantitatively if a fixed values is used for both plots. Only has an effect when used with the vector_properties option.

  • hide_surface (bool) – Whether to hide the Fermi surface. Only recommended in combination with the vector_properties option.

  • hide_labels (bool) – Whether to show the high-symmetry k-point labels.

  • hide_cell (bool) – Whether to show the reciprocal cell boundary.

  • plot_index (list[int] | dict[Spin, list[int] | int] | int) –

    A choice of band indices (0-based). Valid options are:

    • A single integer, which will select that band index in both spin channels (if both spin channels are present).

    • A list of integers, which will select that set of bands from both spin channels (if both are present).

    • A dictionary of {Spin.up: band_index_1, Spin.down: band_index_2}, where band_index_1 and band_index_2 are either single integers (if one wishes to plot a single band for that particular spin) or a list of integers. Note that the choice of integer and list can be different for different spin channels.

    • None in which case all bands will be plotted.

  • **plot_kwargs – Other keyword arguments supported by the individual plotting methods.

static get_symmetry_points(fermi_surface, symprec=0.001)[source]#

Get the high symmetry k-points and labels for the Fermi surface.

Parameters:
  • fermi_surface (FermiSurface) – A fermi surface.

  • symprec (float) – The symmetry precision in Angstrom.

Return type:

tuple[ndarray, list[str]]

Returns:

The high symmetry k-points and labels.