Band Utilities#

class fireballpy.bands.BandPath(*, path, npoints, atoms=None, fbobj=None, special_points=None)[source]#

Object to create a bandpath plot from a Fireball DFT calculation.

The implementation is based on ASE’s ase.dft.kpoints.BandPath but it is specialized for Fireball computations, allowing for faster and simpler bandpath computation. As such, it will only accept objects which have been interfaced with fireballpy. The usage of this class will be the same for all objects interfaced with Fireball.

Parameters:
pathstr | ArrayLike[float]

This parameter may be a str with the points in the path in which case we will try to assign the corresponding k-points. The string should look as the collection of all the point names in the path in order, using commas to separate non-contiguous paths. For more details on how each point may be identified see the documentation for the special_points parameter. It may also be a nkpts x 3 array with the points to consider in the path. Note that if specified in this form, the path must be continuous.

npointsint

Number of k-points that will be computed for the path. This number must be equal or bigger than the number of k-points specified in the path property.

atomsase.Atoms | None

An ase.Atoms object with a Fireball attached as calculator. The SCF loop must be computed before. This parameter is not compatible with fbobj.

fbobjBaseFireball | None

Directly a low-level BaseFireball object. In general this is reserved only for advanced users. The SCF loop must be computed before. This parameter is not compatible with atoms.

special_pointsdict | None:

Dictionary with the map from the number of a point to its coordinates in units of the reciprocal cell. Each of the points is defined by an uppercase letter, an arbitrary number of lowercase letters and an arbitrary number of numbers. If this parameter is not provided, then we will rely on ase.dft.kpoints.get_special_points() to identify the form of the cell and the mapping of point names to their corresponding coordinates.

Methods

plot()

Plot the bandpath using matplotlib.

Raises:
ValueError

If more than one fireballpy object is passed.

RuntimeError

If the SCF loop was not computed.

plot(*, emin=None, emax=None, bands_fmt='-k', fermi_level_fmt='--r', center=False, ax=None, figsize=None, show_grid=False, line_kws=None, font_kws=None)[source]#

Plot the bandpath using matplotlib.

Parameters:
eminfloat | None

Lower y-axis bound for the plot.

emaxfloat | None

Upper y-axis bound for the plot.

bands_fmtstr

Format string for the band lines. Default is '-k' (continous black lines).

fermi_level_fmtstr

Format string for the Fermi level. Default is '--r' (discontinous red line). To avoid the printing of the line use the empty string: ''.

center: bool

Whether to shift the eigenvalues so that the Fermi level lands at the zero energy mark (True) or not (False, default).

ax: plt.Axes | None

If an instance of matplotlib.pyplot.Axes is provided, it will be used to draw the bandpath on it.

figsize: tuple[float, float] | None

Size of the figure (width, height).

show_grid: bool

Show x axis grid or not (default False).

line_kws: dict | None

Extra arguments to provide to the calls of matplotlib.pyplot.Axes.plot().

font_kws: dict | None

Extra arguments to provide to the font-related methods.