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_arpes(intensity_map, fname=None, cut='band_map', value=0.0, path_labels=None, title=None, cmap='Greys_r', broadened=True, ax=None)[source]#

Plot an ARPES simulation (PAOFLOW.arpes.IntensityMap).

Arguments:

intensity_map (IntensityMap): Result of PAOFLOW.arpes / PAOFLOW.arpes.simulate. fname (str): File name of the figure (None shows it). cut (str): 'band_map' (energy vs the path index, or vs k_x at k_y = value

for a mesh), 'constant_energy' (k_x-k_y map at the energy value), 'edc' (energy distribution curve at k-point index value).

value (float or int): Energy (eV), k_y (1/A) or k index of the cut. path_labels (tuple): (indices, labels) of the high-symmetry points of a path. title (str): A title. cmap (str): Colour map. broadened (bool): Resolution-broadened (True) or raw intensity. ax (matplotlib axis): Draw into an existing axis.

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_ohc(fname, title='OHC vs Energy', x_lim=None, y_lim=None, cols=None, legend=True)[source]#

Plot the orbital Hall conductivity vs energy.

PAOFLOW writes one ohcEf_{spol}_{ipol}{jpol}.dat file per requested tensor element (two columns: energy and conductivity), the orbital counterpart of the spin Hall files. Pass a single file name to plot one component, or a list of file names to overlay several components.

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_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.

plot_migdal_eliashberg(npz_file, temps=None, title=None, filename=None, real_axis_max_mev=60.0)[source]#

Plot the isotropic Migdal-Eliashberg results (gap, Z, real axis, Delta(T), Tc).

Parameters:
  • npz_file (str) – migdal_eliashberg.npz written by PAOFLOW.elphon.migdal_eliashberg.write_me_outputs().

  • temps (list of float, optional) – Temperatures (K) shown in the frequency-resolved panels; defaults to up to four temperatures with a non-zero gap.

  • title (str, optional) – A title for the figure.

  • filename (str, optional) – If given, the figure is also saved to this path.

  • real_axis_max_mev (float, optional) – Upper frequency (meV) of the real-axis panels (default 60), capped at wscut.

Returns:

Shows the figure (PAOFLOW.graphics.plot_functions.plot_migdal_eliashberg()).

Return type:

None

plot_phonon_assisted_absorption(npz_file, eta_ev=0.05, temperature=None, epw_indabs_file=None, title=None, filename=None)[source]#

Plot the phonon-assisted and direct optical absorption.

Parameters:
  • npz_file (str) – absorption.npz written by PAOFLOW.elphon.phonon_assisted_absorption.write_absorption_outputs().

  • eta_ev (float, optional) – Intermediate-state broadening (eV) shown (closest computed value).

  • temperature (float, optional) – Temperature (K) of the dielectric-function panel (default: the first).

  • epw_indabs_file (str, optional) – EPW epsilon2_indabs_<T>K.dat overlaid for comparison.

  • title (str, optional) – A title for the figure.

  • filename (str, optional) – If given, the figure is also saved to this path.

Returns:

Shows the figure (PAOFLOW.graphics.plot_functions.plot_phonon_assisted_absorption()).

Return type:

None

plot_thermal_emissivity(npz_file, temps=None, title=None, filename=None)[source]#

Plot the spectral and total hemispherical emissivity versus temperature.

Parameters:
Returns:

Shows the figure (PAOFLOW.graphics.plot_functions.plot_thermal_emissivity()).

Return type:

None

plot_metal_transport(eliashberg_npz, resistivity_file, experiment_file=None, title=None, filename=None)[source]#

Plot alpha^2F, alpha^2F_tr and the resistivity of a metal.

Parameters:
  • eliashberg_npz (str) – eliashberg.npz of main.elphon.py --transport.

  • resistivity_file (str) – resistivity.dat of transport.elphon.py (T, total and per-channel resistivity in micro-ohm cm; channel names in the header).

  • experiment_file (str, optional) – Two columns: temperature (K), measured resistivity (micro-ohm cm).

  • title (str, optional) – A title for the figure.

  • filename (str, optional) – If given, the figure is also saved to this path.

Returns:

Shows the figure (PAOFLOW.graphics.plot_functions.plot_metal_transport()).

Return type:

None

plot_carrier_mobility(mobility_file, scattering_npz=None, temperature_k=300.0, experiment_file=None, title=None, filename=None)[source]#

Plot the phonon-limited mobilities (SERTA/MRTA) and the scattering rates.

Parameters:
  • mobility_file (str) – mobility.dat of PAOFLOW.elphon.carrier_scattering.write_mobility_outputs().

  • scattering_npz (str, optional) – carrier_scattering.npz of the same run; adds the rates panel.

  • temperature_k (float, optional) – Temperature of the rates panel.

  • experiment_file (str, optional) – Three columns: temperature (K), measured electron and hole mobilities (cm^2/(V s)); NaN skips a value.

  • title (str, optional) – A title for the figure.

  • filename (str, optional) – If given, the figure is also saved to this path.

Returns:

Shows the figure (PAOFLOW.graphics.plot_functions.plot_carrier_mobility()).

Return type:

None

plot_migdal_eliashberg_aniso(npz_file, temps=None, iso_npz_file=None, title=None, filename=None, distribution_scale=0.003)[source]#

Plot the anisotropic Migdal-Eliashberg results (gap distributions, DOS, lambda_nk).

Parameters:
  • npz_file (str) – migdal_eliashberg_aniso.npz written by PAOFLOW.elphon.anisotropic_eliashberg.write_me_aniso_outputs().

  • temps (list of float, optional) – Temperatures (K) shown in the distribution and quasiparticle-DOS panels; defaults to up to four temperatures with a non-zero gap.

  • iso_npz_file (str, optional) – Isotropic migdal_eliashberg.npz, whose gap is drawn for comparison.

  • title (str, optional) – A title for the figure.

  • filename (str, optional) – If given, the figure is also saved to this path.

  • distribution_scale (float, optional) – Horizontal scale (K per 1/eV^2) of the gap distributions drawn at each temperature (default 3e-3, as EPW tutorial 04).

Returns:

Shows the figure (PAOFLOW.graphics.plot_functions.plot_migdal_eliashberg_aniso()).

Return type:

None