schrodinger.application.matsci.espresso.qeoutput module¶
Classes and functions to deal reading XML generated by Quantum Espresso.
Copyright Schrodinger, LLC. All rights reserved.
-
class
schrodinger.application.matsci.espresso.qeoutput.
KptLegend
(label, coords)¶ Bases:
tuple
-
coords
¶ Alias for field number 1
-
label
¶ Alias for field number 0
-
-
class
schrodinger.application.matsci.espresso.qeoutput.
WfcType
(atom_idx, atom_type, n_qn, l_qn, m_qn)¶ Bases:
tuple
-
atom_idx
¶ Alias for field number 0
-
atom_type
¶ Alias for field number 1
-
l_qn
¶ Alias for field number 3
-
m_qn
¶ Alias for field number 4
-
n_qn
¶ Alias for field number 2
-
-
class
schrodinger.application.matsci.espresso.qeoutput.
EsmType
(data, bc_type, efield)¶ Bases:
tuple
-
bc_type
¶ Alias for field number 1
-
data
¶ Alias for field number 0
-
efield
¶ Alias for field number 2
-
-
class
schrodinger.application.matsci.espresso.qeoutput.
OutStruct
(struct, std_struct)¶ Bases:
tuple
-
std_struct
¶ Alias for field number 1
-
struct
¶ Alias for field number 0
-
-
schrodinger.application.matsci.espresso.qeoutput.
gaussian_delta
(eigenval, energies, degauss)¶ Get Gaussian-function values
Parameters: - eigenval (float) – Energy at which to calculate Gaussian delta
- energies (
numpy.array
) – Energy grid - degauss (float) – Broadening
Return type: numpy.array
Returns: delta values on the grid
-
class
schrodinger.application.matsci.espresso.qeoutput.
OrderedDefaultDict
(default_factory=None, *args, **kwargs)¶ Bases:
collections.OrderedDict
This class implements ordered default dict functionality.
-
class
schrodinger.application.matsci.espresso.qeoutput.
KPoint
(tag, vecs=None)¶ Bases:
object
Class to hold information about a k-point.
-
getCoords
(coords_str)¶ Return list of coordinates.
Parameters: coords_str (str) – String representing K-point coordinates Return type: list of three floats Returns: K-point coordinates
-
getCoordsStr
(frac=False)¶ Get string representation of the coordinates.
Parameters: frac (bool) – If True, self.frac_coords are returned, otherwise self.cart_coords Return type: str Returns: String representation of the coordinates
-
static
getKptFromCfg
(kpt)¶
-
-
class
schrodinger.application.matsci.espresso.qeoutput.
DOS
(band, dos_fn)¶ Bases:
object
Basic DOS class, based on the class from pymatgen (MIT license).
-
getDOS
(degauss, delta_e=0.01)¶ Broaden energies and set DOS in self.dos. This requires self.band to be set in the constructor.
Parameters: - degauss (float) – Used only if dos is True, broadening (eV) for computing DOS
- delta_e (float) – Used only if dos is True, energy grid spacing (in eV)
Raises: ValueError – If self.band is None
-
getDensities
(spin=None)¶ Get density of states for a particular spin.
Parameters: spin (str or None) – Can be SPIN_UP or SPIN_DW or None. Return type: numpy.array
Returns: Density of states for a particular spin. If Spin is None, the sum of all spins is returned.
-
getCbmVbm
(tol=0.001, abs_tol=False, spin=None)¶ Get Conduction Band Minimum (cbm) and Valence Band Maximum (vbm).
Param: tolerance in occupations for determining the cbm/vbm
Parameters: - abs_tol (bool) – An absolute tolerance (True) or a relative one (False)
- spin (str or None) – Possible values are None - finds the cbm/vbm in the summed densities, SPIN_UP - finds the cbm/vbm in the up spin channel, SPIN_DW - finds the cbm/vbm in the down spin channel.
Return type: float, float
Returns: cbm and vbm in Ry corresponding to the gap
-
getGap
(tol=0.001, abs_tol=False, spin=None)¶ Get the gap.
Param: tolerance in occupations for determining the gap
Parameters: - abs_tol (bool) – An absolute tolerance (True) or a relative one (False)
- spin (str or None) – Possible values are None - finds the gap in the summed densities, SPIN_UP - finds the gap in the up spin channel, SPIN_DW - finds the gap in the down spin channel.
Return type: float
Returns: gap in Ry or 0.0, if it is a metal
-
-
class
schrodinger.application.matsci.espresso.qeoutput.
PhDOS
(file_fh)¶ Bases:
object
Phonon DOS class.
-
c_v
(temperature)¶ Constant volume specific heat C_v at temperature T obtained from the integration of the DOS. Only positive frequencies will be used. Result in J/(K*mol-c). A mol-c is the abbreviation of a mole-cell, that is, the number of Avogadro times the atoms in a unit cell. To compare with experimental data the result should be divided by the number of unit formulas in the cell. If the structure is provided the division is performed internally and the result is in J/(K*mol).
Parameters: temperature (float) – Temperature at which to evaluate C_v, in K Return type: float Returns: Constant volume specific heat C_v in J/(K*mol)
-
entropy
(temperature)¶ Vibrational entropy at temperature T obtained from the integration of the DOS. Only positive frequencies will be used. Result in J/(K*mol-c). A mol-c is the abbreviation of a mole-cell, that is, the number of Avogadro times the atoms in a unit cell. To compare with experimental data the result should be divided by the number of unit formulas in the cell. If the structure is provided the division is performed internally and the result is in J/(K*mol).
Parameters: temperature (float) – Temperature at which to evaluate C_v, in K Return type: float Returns: Vibrational entropy in J/(K*mol)
-
internal_energy
(temperature)¶ Phonon contribution to the internal energy at temperature T obtained from the integration of the DOS. Only positive frequencies will be used. Result in J/mol-c. A mol-c is the abbreviation of a mole-cell, that is, the number of Avogadro times the atoms in a unit cell. To compare with experimental data the result should be divided by the number of unit formulas in the cell. If the structure is provided the division is performed internally and the result is in J/mol.
Parameters: temperature (float) – Temperature at which to evaluate energy, in K Return type: float Returns: Phonon contribution to the internal energy, in J/mol.
-
helmholtz_free_energy
(temperature)¶ Phonon contribution to the Helmholtz free energy at temperature T obtained from the integration of the DOS. Only positive frequencies will be used. Result in J/mol-c. A mol-c is the abbreviation of a mole-cell, that is, the number of Avogadro times the atoms in a unit cell. To compare with experimental data the result should be divided by the number of unit formulas in the cell. If the structure is provided the division is performed internally and the result is in J/mol.
Parameters: temperature (float) – Temperature at which to evaluate free energy, in K Return type: float Returns: Phonon contribution to the Helmholtz free energy, in J/mol
-
zero_point_energy
()¶ Zero point energy energy of the system. Only positive frequencies will be used. Result in J/mol-c. A mol-c is the abbreviation of a mole-cell, that is, the number of Avogadro times the atoms in a unit cell. To compare with experimental data the result should be divided by the number of unit formulas in the cell. If the structure is provided the division is performed internally and the result is in J/mol.
Parameters: temperature (float) – Temperature at which to evaluate ZPE, in K Return type: float Returns: Phonon contribution to ZPE, in J/mol
-
-
class
schrodinger.application.matsci.espresso.qeoutput.
PDOS
(proj, wfc_types, efermi, band)¶ Bases:
object
Class that holds partial DOS (PDOS) data. Call getPDOS to get broadened data.
-
NUM_IDX
= 5¶
-
LDOS_IDX
= 0¶
-
ADOS_IDX
= 1¶
-
EDOS_IDX
= 2¶
-
AIDOS_IDX
= 3¶
-
ALDOS_IDX
= 4¶
-
getPDOS
(degauss, delta_e=0.01)¶ Calculate PDOS and set in self.pdos.
Parameters: - degauss (float) – Broadening (eV) for computing PDOS
- delta_e (float) – Energy grid spacing eV
-
-
class
schrodinger.application.matsci.espresso.qeoutput.
BandStructure
(kpoints, eigenvals, efermi, struct=None)¶ Bases:
object
This class is based on the class from pymatgen (MIT license).
-
isMetal
()¶ Check if the band structure indicates a metal by looking if the Fermi level crosses a band.
Return type: bool Returns: True, if the system is metallic
-
getVbmCbm
(vbm=True)¶ Return data about the valence band maximum (VBM) or conduction band minimum (CBM).
Parameters: vbm (bool) – If True calculates VBM, if False CBM Return type: dict Returns: - dict with keys BAND_INDEX_KEY, KPOINT_INDEX_KEY, KPOINT_KEY,
- ENERGY_KEY
- BAND_INDEX_KEY: A dict with spin keys pointing to a list of the
indices of the band containing the VBM (please note that you can have several bands sharing the VBM) {SPIN_UP:[], SPIN_DW:[]} - KPOINT_INDEX_KEY: The list of indices in self.kpoints for the kpoint vbm. Please note that there can be several kpoint_indices relating to the same kpoint (e.g., Gamma can occur at different spots in the band structure line plot) - KPOINT_KEY: The kpoint (as a kpoint object) - ENERGY_KEY: The energy of the VBM
-
getBandGap
()¶ Get band gap data.
Return type: dict Returns: dict with keys ENERGY_KEY, DIRECT_KEY, TRANSITION_KEY: ENERGY_KEY: band gap energy DIRECT_KEY: A boolean telling if the gap is direct or not TRANSITION_KEY: kpoint labels of the transition (e.g., “Gamma-X”)
-
generatePlotData
()¶ Generate distances between k-points (in self.distances) for plotting band structure.
-
-
class
schrodinger.application.matsci.espresso.qeoutput.
Output
(qegz_fn, struct=False, band=False, dos=False, pdos=False, esm=False, neb=False, phdos=False, phband=False, dynamics=False, tree=None)¶ Bases:
object
Class to deal with QE XML output parsing.
-
getMDStepStruct
(step, timestep)¶ Extract MD step structure from step XML.
Parameters: - step (
xml.etree.ElementTree.Element
) – step element - timestep (float) – MD time step
Return type: structure.Structure
,structure.Structure
or NoneReturns: Structure of the MD step, standardized structure if requested and found
- step (
-