PAOFLOW.GPAO#

Classes#

Module Contents#

class PAOFLOW.GPAO.GPAO[source]#
plot_dos(fname, title=None, x_lim=None, y_lim=None, vertical=False, col='black')[source]#

Plot the density of states.

Arguments:

fname (str): File name (including relative path) title (str): A title for the plot x_lim (tuple): Pair of axis limits (x_min, x_max) y_lim (tuple): Pair of axis limits (y_min, y_max) vertical (bool): Set True to plot energy on the y-axis and elec/eV on the x-axis. col (str or tuple): A string recognized by matplotlib or a 3-tuple (R,G,B)

plot_pdos(fnames, title=None, x_lim=None, y_lim=None, vertical=False, cols=None, labels=None, legend=True, psum_inds=None)[source]#

Plot the projected density of states.

Arguments:

fnames (list): List of file names (including relative path) title (str): A title for the plot x_lim (tuple): Pair of axis limits (x_min, x_max) y_lim (tuple): Pair of axis limits (y_min, y_max) vertical (bool): Set True to plot energy on the y-axis and elec/eV on the x-axis. cols (str or tuple): A list of string recognized by matplotlib or 3-tuples (R,G,B) with the same dimension as the number of files labels (list): List of strings with same dimension as the number of files psum_inds (list): A list of lists. Each inner list contains indices for the dos files elements to sum together. There is one line plotted for each inner list.

plot_weighted_bands(outputdir, fname, sym_points=None, title=None, cbar_label=None, label=None, filename=None, y_lim=None, col='black')[source]#

Plot the band structure

Arguments:

fname (str): File name (including relative path) sym_points (str or tuple): File name for the kpath_points produced by PAOFLOW. Otherwise, provide a tuple of two lists. The first contains indices of the high sym points, the second contains labels for the high sym points. title (str): A title for the plot y_lim (tuple): Pair of axis limits (y_min, y_max) col (str or tuple): A string recognized by matplotlib or a 3-tuple (R,G,B)

plot_bands(fnames, sym_points=None, title=None, label=None, labels=None, y_lim=None, cols=None, legend=True)[source]#

Plot one or more band structures for comparison.

Arguments:

fnames (str or list): File name or list of file names (including relative path). sym_points (str or tuple): File name for the kpath_points produced by PAOFLOW. Otherwise, provide a tuple of two lists. The first contains indices of the high sym points, the second contains labels for the high sym points. title (str): A title for the plot label (str): y-axis label labels (list): Legend labels, one per file (e.g. [‘DFT’,’SK model’]) y_lim (tuple): Pair of axis limits (y_min, y_max) cols (list or str): Color(s) for each dataset. A list of strings/3-tuples recognized by matplotlib. legend (bool): Show legend when labels are provided (default True)

plot_berry(fname, sym_points=None, title=None, label=None, x_lim=None, y_lim=None, col='black', dos_ticks=False)[source]#

Plot the band structure

Arguments:

fname (str): File name (including relative path) sym_points (str or tuple): File name for the kpath_points produced by PAOFLOW. Otherwise, provide a tuple of two lists. The first contains indices of the high sym points, the second contains labels for the high sym points. title (str): A title for the plot y_lim (tuple): Pair of axis limits (y_min, y_max) col (str or tuple): A string recognized by matplotlib or a 3-tuple (R,G,B)

plot_dos_beside_bands(fn_dos, fn_bands, sym_points=None, title=None, band_label=None, x_lim=None, y_lim=None, col='black', dos_ticks=False)[source]#

Plot the density of states beside the band structure

Arguments:

fn_dos (str): File name for dos (including relative path) fn_bands (str): File name for bands (including relative path) sym_points (str or tuple): File name for the kpath_points produced by PAOFLOW. Otherwise, provide a tuple of two lists. The first contains indices of the high sym points, the second contains labels for the high sym points. title (str): A title for the plot x_lim (tuple): Pair of axis limits (x_min, x_max) y_lim (tuple): Pair of axis limits (y_min, y_max) col (str or tuple): A string recognized by matplotlib or a 3-tuple (R,G,B)

plot_berry_under_bands(fn_berry, fn_bands, sym_points=None, title=None, x_lim=None, y_lim=None, col='black', dos_ticks=False, band_label=None, berry_label=None)[source]#

Plot the berry phase below the band structure

Arguments:

fn_berry (str): File name for berry (including relative path) fn_bands (str): File name for bands (including relative path) sym_points (str or tuple): File name for the kpath_points produced by PAOFLOW. Otherwise, provide a tuple of two lists. The first contains indices of the high sym points, the second contains labels for the high sym points. title (str): A title for the plot x_lim (tuple): Pair of axis limits (x_min, x_max) y_lim (tuple): Pair of axis limits (y_min, y_max) col (str or tuple): A string recognized by matplotlib or a 3-tuple (R,G,B)

plot_electrical_conductivity(fname, t_ele=[(0, 0), (1, 1), (2, 2)], vE=None, title='Sigma vs Energy', x_lim=None, y_lim=None, col=[(1, 0, 0), (0, 1, 0), (0, 0, 1)], legend=True)[source]#

Plot the electrical conductivity. If multiple Temperatures are computed the default behavior is to plot the full energy range for every temperature. If a conductivity vs temperature plot is desired, set vE to the energy at which conductivity should be collected for each temperature.

Arguments:

fname (str): File name (including relative path) t_ele (list): Tensor elements as tuple pairs (e.g. (1,2) for (y,z)). Default behavior is to plot the 3 diagonal elements seprately. Providing an empty list will average the diagonal components title (str): A title for the plot x_lim (tuple): Pair of axis limits (x_min, x_max) y_lim (tuple): Pair of axis limits (y_min, y_max) col (list): A list of 3-tuples (R,G,B), one for each tensor element. vE (float): Set to an energy to plot the conductivity vs temperature. The value of conductivity is taken at the provided energy for each temperature.

plot_seebeck(fname, t_ele=[(0, 0), (1, 1), (2, 2)], vE=None, title='Seebeck vs Energy', x_lim=None, y_lim=None, col=[(1, 0, 0), (0, 1, 0), (0, 0, 1)], legend=True)[source]#

Plot the Seebeck coefficient. If multiple Temperatures are computed the default behavior is to plot the full energy range for every temperature. If a conductivity vs temperature plot is desired, set vE to the energy at which conductivity should be collected for each temperature.

Arguments:

fname (str): File name (including relative path) t_ele (list): Tensor elements as tuple pairs (e.g. (1,2) for (y,z)). Default behavior is to plot the 3 diagonal elements seprately. Providing an empty list will average the diagonal components vE (float): Set to an energy to plot the conductivity vs temperature. The value of conductivity is taken at the provided energy for each temperature. title (str): A title for the plot x_lim (tuple): Pair of axis limits (x_min, x_max) y_lim (tuple): Pair of axis limits (y_min, y_max) col (list): A list of 3-tuples (R,G,B), one for each tensor element.

plot_shc(fname, title='SHC vs Energy', x_lim=None, y_lim=None, cols=None, legend=True)[source]#

Plot the Seebeck coefficient. If multiple Temperatures are computed the default behavior is to plot the full energy range for every temperature. If a conductivity vs temperature plot is desired, set vE to the energy at which conductivity should be collected for each temperature.

Arguments:

fname (str): File name (including relative path) title (str): A title for the plot x_lim (tuple): Pair of axis limits (x_min, x_max) y_lim (tuple): Pair of axis limits (y_min, y_max) cols (list): A list of 3-tuples (R,G,B), one for each tensor element.

plot_ahc(fname, title='AHC vs Energy', x_lim=None, y_lim=None, cols=None, legend=True)[source]#

Plot the anomalous Hall conductivity vs energy.

PAOFLOW writes one ahcEf_{ipol}{jpol}.dat file per requested tensor element (two columns: energy and conductivity). Pass a single file name to plot one component, or a list of file names to overlay several components on the same axes.

Arguments:

fname (str or list): File name or list of file names (including relative path) title (str): A title for the plot x_lim (tuple): Pair of axis limits (x_min, x_max) y_lim (tuple): Pair of axis limits (y_min, y_max) cols (list): A 3-tuple (R,G,B) or list of them, one for each tensor element. legend (bool): Show the legend when several components are plotted.

plot_dielectric(fname, title=None, x_lim=None, y_lim=None, cols=None, labels=None, legend=True, legend_outside=False)[source]#

Plot an optical / dielectric spectrum vs energy.

The dielectric-tensor module writes two-column .dat files such as epsi_xx.dat (Im eps), epsr_xx.dat (Re eps), eels_xx.dat, sigmar_xx.dat etc. Pass a single file name to plot one spectrum, or a list of file names to overlay several on the same axes.

Arguments:

fname (str or list): File name or list of file names (including relative path) title (str): A title for the plot x_lim (tuple): Pair of axis limits (x_min, x_max) y_lim (tuple): Pair of axis limits (y_min, y_max) cols (str/tuple or list): Color or list of colors, one per file. labels (list): Legend labels, one per file (defaults to the file tags). legend (bool): Show the legend when several spectra are plotted. legend_outside (bool): Place the legend in a panel to the right of

the axes instead of inside (avoids overlapping crowded curves).

OPTICAL_PROPERTIES[source]#
plot_optical(properties, path='.', component='xx', spin=None, title=None, x_lim=None, y_lim=None, cols=None, labels=None, legend=True)[source]#

Plot a user-selected set of optical / emissivity spectra together.

Resolves each requested property to the two-column .dat file written by PAOFLOW.dielectric_tensor() and overlays the curves on one figure. This lets the user choose exactly which optical quantities to display instead of plotting raw file names.

Recognized property keys (file prefixes): epsi, epsr, ieps, eels, nref, kref, alpha, refl, sigmar, sigmai (dielectric / optical), plus the emissivity outputs emish (spectral hemispherical), emist (total hemispherical vs temperature) and the directional spectra written per incidence angle, e.g. refl_th30 and emis_th30.

Arguments:

properties (str or list): One key or a list of keys to overlay. path (str): Directory containing the .dat files. Default ‘.’. component (str or list): Diagonal tensor component to read (‘xx’,

‘yy’, ‘zz’). A list/tuple overlays several components on one figure (e.g. ['xx', 'yy', 'zz']).

spin (int): Spin channel (0 or 1) for spin-polarized runs; None

for the spin-unpolarized files.

title (str): A title for the plot. x_lim (tuple): Pair of axis limits (x_min, x_max). y_lim (tuple): Pair of axis limits (y_min, y_max). cols (str/tuple or list): Color or list of colors, one per property. labels (list): Legend labels, one per property (defaults to the

property names).

legend (bool): Show the legend.

Note:

emist (total emissivity) is tabulated versus temperature, not photon energy; do not overlay it with energy-axis spectra in the same call.

optical_color(path='.', component='avg', spin=None, illuminant='E', title=None, label=None, show=True)[source]#

Derive the perceived visible color (sRGB) of a material from its normal-incidence reflectivity and display it as a color swatch.

The reflectivity spectra refl_<component>.dat written by PAOFLOW.dielectric_tensor() are passed through the CIE 1931 color-matching functions under the chosen illuminant to obtain a CIE XYZ tristimulus, which is converted to an sRGB color.

Arguments:

path (str): Directory containing the refl_*.dat files. Default ‘.’. component (str): Diagonal tensor component (‘xx’, ‘yy’, ‘zz’) or

‘avg’ to average the available diagonal components (default).

spin (int): Spin channel (0 or 1) for spin-polarized runs; None

for the spin-unpolarized files.

illuminant (str or float): ‘E’ equal-energy (intrinsic color, default),

‘D65’ daylight, or a blackbody temperature in kelvin.

title (str): A title for the swatch figure. label (str): Optional text drawn on the swatch (e.g. the material). show (bool): Render the swatch (set False to only return the color).

Returns:

tuple: (rgb01, rgb255, hexstr) – sRGB in [0, 1], in [0, 255], and as a '#rrggbb' string.

plot_phonons(band_file, dos_file=None, labels_file=None, title=None, y_lim=None, col='black', units='THz', filename=None)[source]#

Plot a phonon dispersion (and optional DOS) from PAOFLOW output files.

Arguments:

band_file (str): Path to <fname>_band.dat (distance + frequencies). dos_file (str): Optional path to <fname>_dos.dat (frequency + DOS). labels_file (str): Optional path to <fname>_band.labels produced

alongside the band file; supplies the high-symmetry tick marks.

title (str): A title for the plot. y_lim (tuple): Pair of frequency-axis limits (y_min, y_max). col (str or tuple): Line colour recognised by matplotlib. units (str): Frequency unit string for the axis label. filename (str): If given, save the figure to this path.

plot_gruneisen_band(band_file, labels_file=None, title=None, y_lim=None, col='black', filename=None)[source]#

Plot the mode Grueneisen dispersion from PAOFLOW output files.

Arguments:
band_file (str): Path to <fname>_gruneisen_band.dat (distance +

per-branch [gruneisen, frequency] columns).

labels_file (str): Optional path to <fname>_gruneisen_band.labels

supplying the high-symmetry tick marks.

title (str): A title for the plot. y_lim (tuple): Pair of Grueneisen-axis limits (y_min, y_max). col (str or tuple): Line colour recognised by matplotlib. filename (str): If given, save the figure to this path.

plot_phonon_thermal(thermal_file, title=None, filename=None)[source]#

Plot harmonic thermal properties from a PAOFLOW output file.

Arguments:
thermal_file (str): Path to <fname>_thermal.dat with columns

temperature (K), free energy (kJ/mol), entropy (J/K/mol) and constant-volume heat capacity (J/K/mol).

title (str): A title for the plot. filename (str): If given, save the figure to this path.

plot_ir_spectrum(spectrum_file, modes_file=None, title=None, x_lim=None, col='black', units='cm-1', filename=None)[source]#

Plot an infrared spectrum from PAOFLOW output files.

Arguments:
spectrum_file (str): Path to <fname>_ir_spectrum.dat (frequency +

broadened intensity).

modes_file (str): Optional path to <fname>_ir_modes.dat; when given

the discrete mode intensities are drawn as vertical sticks.

title (str): A title for the plot. x_lim (tuple): Pair of frequency-axis limits (x_min, x_max). col (str or tuple): Line colour recognised by matplotlib. units (str): Frequency unit string for the axis label. filename (str): If given, save the figure to this path.

plot_qha(volume_file=None, thermal_expansion_file=None, bulk_modulus_file=None, heat_capacity_file=None, gruneisen_file=None, ev_file=None, title=None, filename=None)[source]#

Plot quasi-harmonic quantities from PAOFLOW output files.

Each argument is the path to one qha_*.dat table written by PAOFLOW.PAOFLOW.quasi_harmonic(). Missing / None files are skipped, so a subset can be plotted. All temperature-resolved tables share the same temperature grid (column 0).

Arguments:

volume_file (str): <fname>_volume.dat (T, V in Ang^3). thermal_expansion_file (str): <fname>_thermal_expansion.dat

(T, alpha in 1/K).

bulk_modulus_file (str): <fname>_bulk_modulus.dat (T, B in GPa). heat_capacity_file (str): <fname>_heat_capacity.dat (T, Cp in

J/K/mol).

gruneisen_file (str): <fname>_gruneisen.dat (T, gamma). ev_file (str): <fname>_ev.dat (volume in Ang^3, static energy eV). title (str): A title for the figure. filename (str): If given, save the figure to this path.

plot_raman_spectrum(spectrum_file, modes_file=None, title=None, x_lim=None, col='black', units='cm-1', filename=None)[source]#

Plot a Raman spectrum from PAOFLOW output files.

Arguments:
spectrum_file (str): Path to <fname>_raman_spectrum.dat (frequency
  • broadened intensity).

modes_file (str): Optional path to <fname>_raman_modes.dat; when

given the discrete mode intensities are drawn as vertical sticks.

title (str): A title for the plot. x_lim (tuple): Pair of frequency-axis limits (x_min, x_max). col (str or tuple): Line colour recognised by matplotlib. units (str): Frequency unit string for the axis label. filename (str): If given, save the figure to this path.