from __future__ import annotations
from pathlib import Path
from typing import Iterable, Literal, Sequence
from scm.pisa.block import DriverBlock,EngineBlock,FixedBlock,FreeBlock,InputBlock
from scm.pisa.key import BoolKey,FloatKey,FloatListKey,IntKey,IntListKey,MultipleChoiceKey,PathStringKey,StringKey,BoolType
[docs]class QuantumESPRESSO(EngineBlock):
r"""
:ivar CheckInputIncompatibilities: Performs a preliminary check for incompatible input parameters before starting the calculation. If any inconsistencies are detected (e.g., attempting a Raman calculation with spin polarization), the program will stop and report the error. This helps to avoid wasted time and resources by identifying potential issues early on.
:vartype CheckInputIncompatibilities: BoolType | BoolKey
:ivar K_PointsLabels: You can provide labels for your k-points, like ``L-GAMMA-X-U-GAMMA``, separating each label with a hyphen (-) or a vertical bar (|). For example, ``L-GAMMA-X-U-GAMMA`` and ``L|GAMMA|X|U|GAMMA`` are both valid. These labels are optional and only used for display purposes when the ``K_Points`` block is specified. This option is used only if the header of the ``K_Points`` block is not ``ams_kpath``. **Important:** These labels do not determine the actual k-point coordinates. You must specify the k-point coordinates separately within the ``K_Points`` section.
:vartype K_PointsLabels: str | StringKey
:ivar KeepDataFiles: If 'False' the program will perform the following actions at the end of the calculation: 1) Remove the 'prefix.qein' file, which serves as the QE input file, 2) Delete the output data stored in the 'prefix.xml' file, and 3) Clear the contents of the 'prefix.save' directory. If you require further details, please refer to the QE user manual in the 'Data Files' section. It provides comprehensive information on the specific files and their functionalities. In particular, these files are needed to calculate the bands structure and DOS.
:vartype KeepDataFiles: BoolType | BoolKey
:ivar UseBondingEnergy: When enabled, the calculation engine uses the bonding energy (energy difference between the molecule and its constituent atoms) instead of the total energy. This facilitates comparisons of relative stability between molecular configurations. Atomic energies are consistently computed using Gamma-point sampling, Gaussian smearing (degauss = 0.01), and spin-restricted (nSpin = 1) settings within a cubic lattice of 8 angstrom side length to approximate their spherically symmetric ground states. All other parameters for the atomic calculations remain the same as those used for the molecular system.
:vartype UseBondingEnergy: BoolType | BoolKey
:ivar AVERAGE_X: This section configures the parameters for running the QE-utility ``average.x``. This utility reads files produce by produced by ``pp.x`` and compute planar and macroscopic averages of a quantity (e.g. charge) in real space on a 3D FFT mesh.
:vartype AVERAGE_X: QuantumESPRESSO._AVERAGE_X
:ivar BandStructure: This section configures the parameters for calculating the Band Structure. This involves utilizing the following utilities:
• ``kpath``: This AMS tool generates an automated high-symmetry k-path in the Brillouin zone.
• ``pw.x`` (with calculation=bands): This utility from Quantum ESPRESSO (QE) performs electronic structure calculations, particularly for bands. For more details see https://www.quantum-espresso.org/Doc/INPUT_PW.html
• ``bands.x``: Another QE utility, which calculates the band structure. For more details see https://www.quantum-espresso.org/Doc/INPUT_BANDS.html.
:vartype BandStructure: QuantumESPRESSO._BandStructure
:ivar Control: Keywords from the &CONTROL namelist in the QuantumEspresso input file.
:vartype Control: QuantumESPRESSO._Control
:ivar DOS: This section configures the parameters for calculating the Density of States (DOS). These are the utilities involved:
• ``kpath``: This AMS tool generates an automated high-symmetry k-path in the Brillouin zone.
• ``pw.x`` (with ``calculation=nscf``): This Quantum ESPRESSO (QE) utility conducts electronic structure calculations, specifically for the non-self-consistent field (nscf) computation.
• ``dos.x``: A QE utility utilized for post-processing electronic structure calculations. It analyzes the electronic wavefunctions obtained from preceding calculations to determine the density of available electronic states at different energy levels. For more details see https://www.quantum-espresso.org/Doc/INPUT_DOS.html
• ``projwfc.x``: Another QE utility employed for post-processing electronic structure calculations. It projects the wavefunctions onto atomic orbitals or basis sets, offering insights into the composition and character of electronic states. For more details see https://www.quantum-espresso.org/Doc/INPUT_PROJWFC.html
By default, the calculation sequence follows the order: ``kpath -> pw.x(calculation=nscf) -> dos.x``. However, enabling ``DOS%PDOS`` switches the calculation to use ``projwfc.x`` instead of ``dos.x``. While common parameters can be customized directly in this section, specialized adjustments should be made in either the ``DOS_X`` or ``PROJWFC_X`` section, depending on specific requirements.
:vartype DOS: QuantumESPRESSO._DOS
:ivar DOS_X: This section configures the parameters for running the QE-utility ``dos.x`` (see https://www.quantum-espresso.org/Doc/INPUT_DOS.html). This utility calculates the Density of States (DOS), separated into up and down components for DSDA.
:vartype DOS_X: QuantumESPRESSO._DOS_X
:ivar DYNMAT_X: This section configures the parameters for running the QE utility `dynmat.x` (see https://www.quantum-espresso.org/Doc/INPUT_DYNMAT.html). This utility is used to ???
:vartype DYNMAT_X: QuantumESPRESSO._DYNMAT_X
:ivar Electrons: Keywords from the &ELECTRONS namelist in the QuantumEspresso input file.
:vartype Electrons: QuantumESPRESSO._Electrons
:ivar Hubbard: Specify parameters for DFT+U models. The type of Hubbard projectors to use (e.g. ``atomic`` or ``ortho-atomic``) is specified in the header of this block.
Example input:
.. code-block:: text
Hubbard ortho-atomic
U Fe-3d 3.0
End
More examples can be found in the documentation.
:vartype Hubbard: str | Sequence[str] | FreeBlock
:ivar HubbardU: Specify parameters for DFT+U Models.
:vartype HubbardU: QuantumESPRESSO._HubbardU
:ivar K_Points: Specify the k-points to use. Available header values are: ``tpiba``, ``automatic``, ``crystal``, ``gamma``, ``tpiba_b``, ``crystal_b``, ``tpiba_c``, ``crystal_c``, and ``ams_kpath``. See the examples and QE documentation for details. If omitted, only ``gamma`` is used. For most cases, ``automatic`` (which generates a Monkhorst-Pack grid) is recommended. Note: Gamma-point calculations are significantly faster using ``gamma`` than ``automatic``, but may not be possible to use for all types of calculations or postprocessing programs.
:vartype K_Points: str | Sequence[str] | FreeBlock
:ivar MATDYN_X: This section configures the parameters for running the QE utility `matdyn.x` (see https://www.quantum-espresso.org/Doc/INPUT_MATDYN.html). This utility is used to calculate various phonon-related properties from the real-space interatomic force constants (IFC) produced by `q2r.x`. These properties include phonon dispersion curves, phonon density of states (DOS), thermodynamic properties (e.g., free energy, entropy), and more.
:vartype MATDYN_X: QuantumESPRESSO._MATDYN_X
:ivar NormalModes: This section outlines the configuration of parameters for calculating Normal Modes. The process involves using the following utilities:
• ``ph.x``: This utility from Quantum ESPRESSO (QE) calculates phonon frequencies and eigenvectors at specified q-points (wave vectors) using Density Functional Perturbation Theory (DFPT). You can set specific parameters in the section ``PH_X``. For more details, see https://www.quantum-espresso.org/Doc/INPUT_PH.html.
• ``dynmat.x``: This QE utility calculates the infrared (IR) and Raman intensities (oscillator strengths) as well as the normal modes associated with each vibrational frequency. Specific parameters can be set in the section ``DYNMAT_X``. The information from ``ph.x``, combined with the phonon frequencies, is used to generate the simulated IR/Raman absorption spectrum. For more details, see https://www.quantum-espresso.org/Doc/INPUT_DYNMAT.html.
If Normal Modes are requested in the main AMS properties section, the program automatically sets ``PH_X%asr=Yes``, ``PH_X%epsilon=Yes``, and ``PH_X%trans=Yes``. If Raman is requested in the main AMS properties section, it also sets ``PH_X%lraman=Yes`` along with the previous parameters.
:vartype NormalModes: QuantumESPRESSO._NormalModes
:ivar PH_X: This section configures the parameters for running the QE utility `ph.x` (see https://www.quantum-espresso.org/Doc/INPUT_PH.html). This utility is used for post-processing phonon calculations in Quantum ESPRESSO.
:vartype PH_X: QuantumESPRESSO._PH_X
:ivar PP_X: This section configures the parameters for running the QE-utility ``pp.x`` (see https://www.quantum-espresso.org/Doc/INPUT_PP.html). This utility reads the output produced by ``pw.x``, extracts and calculates the desired quantity/quantities (rho, V, ...), and then writes the desired quantity to file in a suitable format for various types of plotting and various plotting programs. Only a few options are supported at the moment.
:vartype PP_X: QuantumESPRESSO._PP_X
:ivar PROJWFC_X: This section configures the parameters for running the QE-utility ``projwfc.x`` (see https://www.quantum-espresso.org/Doc/INPUT_PROJWFC.html). This utility projects wavefunctions onto orthogonalized atomic wavefunctions, calculates Lowdin charges, spilling parameter, projected DOS (separated into up and down components for LSDA).
:vartype PROJWFC_X: QuantumESPRESSO._PROJWFC_X
:ivar Phonons: This section configures the parameters for calculating the Phonon Structure. This involves utilizing the following utilities:
• ``kpath``: This AMS tool generates an automated high-symmetry k-path in the Brillouin zone.
• ``ph.x``: This utility from Quantum ESPRESSO (QE) calculates phonon frequencies and eigenvectors at specified q-points (wavevectors) using Density Functional Perturbation Theory (DFPT). For more details see https://www.quantum-espresso.org/Doc/INPUT_PH.html
• ``q2r.x``: This QE utility transforms the dynamical matrix from reciprocal space (q-space) to real space (r-space). This is necessary for further post-processing steps. For more details see https://www.quantum-espresso.org/Doc/INPUT_Q2R.html.
• ``matdyn.x``: This QE utility calculates various phonon-related properties from the real-space dynamical matrix, such as phonon dispersion curves, density of states (DOS), thermodynamic properties, and more. For more details see https://www.quantum-espresso.org/Doc/INPUT_MATDYN.html.
:vartype Phonons: QuantumESPRESSO._Phonons
:ivar Properties: Configures which QE level properties to calculate for SinglePoint calculations or other important geometries (e.g. at the end of an optimization).
:vartype Properties: QuantumESPRESSO._Properties
:ivar Pseudopotentials: Selects the pseudopotential to use for the atomic species.
:vartype Pseudopotentials: QuantumESPRESSO._Pseudopotentials
:ivar Q2R_X: This section configures the parameters for running the QE utility `q2r.x` (see https://www.quantum-espresso.org/Doc/INPUT_Q2R.html). This utility is used to transform the interatomic force constants (IFC) calculated in reciprocal space (q-space) by `ph.x` into real space (r-space). The real-space IFCs are then used as input for the `matdyn.x` utility to calculate various phonon-related properties.
:vartype Q2R_X: QuantumESPRESSO._Q2R_X
:ivar Restart: This section configures restarting a Quantum Espresso calculation from previous data. You can restart from a specific Quantum Espresso results file (e.g., `quantumespresso.rkf`), or by providing the directory and file prefix of the previous calculation. This is compatible with any stand-alone Quantum Espresso version.
:vartype Restart: QuantumESPRESSO._Restart
:ivar System: Keywords from the &SYSTEM namelist in the QuantumEspresso input file.
:vartype System: QuantumESPRESSO._System
:ivar WorkFunction: This section configures the parameters for calculating the Work Function. This involves utilizing the following utilities:
• ``pp.x``: Calculates the the electrostatic potential using the results from the last Quantum ESPRESSO calculation.
• ``average.x``: Performs planar and macroscopic averages of the electrostatic potential along a specified direction, which are crucial for determining the vacuum level and subsequently the work function.
:vartype WorkFunction: QuantumESPRESSO._WorkFunction
"""
[docs] class _AVERAGE_X(FixedBlock):
r"""
This section configures the parameters for running the QE-utility ``average.x``. This utility reads files produce by produced by ``pp.x`` and compute planar and macroscopic averages of a quantity (e.g. charge) in real space on a 3D FFT mesh.
:ivar awin: The size of the window for macroscopic average (a.u.).
:vartype awin: float | FloatKey
:ivar filename: List of strings containing the name of the n files.
:vartype filename: str | StringKey
:ivar idir: 1,2 or 3. Planar average is done in the plane orthogonal to direction ``idir``, as defined for the crystal cell.
:vartype idir: int | IntKey
:ivar nfile: The number of files containing the desired quantities. All files must refer to the same physical system!
:vartype nfile: int | IntKey
:ivar npt: The number of points for the final interpolation of the planar and macroscopic averages, as written to file. If npt <= N_idir (see below) no interpolation is done, the N_idir FFT points in direction idir are printed.
:vartype npt: int | IntKey
:ivar weight: List of numbers containing the weights w_n of the quantities read from the files ``filename``.
:vartype weight: Iterable[float] | FloatListKey
"""
def __post_init__(self):
self.awin: float | FloatKey = FloatKey(name='awin', comment='The size of the window for macroscopic average (a.u.).', default=7.67, unit='Bohr')
self.filename: str | StringKey = StringKey(name='filename', comment='List of strings containing the name of the n files.', default='unknown.dat')
self.idir: int | IntKey = IntKey(name='idir', comment='1,2 or 3. Planar average is done in the plane orthogonal to direction ``idir``, as defined for the crystal cell.', default=3)
self.nfile: int | IntKey = IntKey(name='nfile', comment='The number of files containing the desired quantities. All files must refer to the same physical system!', default=1)
self.npt: int | IntKey = IntKey(name='npt', comment='The number of points for the final interpolation of the planar and macroscopic averages, as written to file. If npt <= N_idir (see below) no interpolation is done, the N_idir FFT points in direction idir are printed.', default=1000)
self.weight: Iterable[float] | FloatListKey = FloatListKey(name='weight', comment='List of numbers containing the weights w_n of the quantities read from the files ``filename``.', default=[1.0])
[docs] class _BandStructure(FixedBlock):
r"""
This section configures the parameters for calculating the Band Structure. This involves utilizing the following utilities:
• ``kpath``: This AMS tool generates an automated high-symmetry k-path in the Brillouin zone.
• ``pw.x`` (with calculation=bands): This utility from Quantum ESPRESSO (QE) performs electronic structure calculations, particularly for bands. For more details see https://www.quantum-espresso.org/Doc/INPUT_PW.html
• ``bands.x``: Another QE utility, which calculates the band structure. For more details see https://www.quantum-espresso.org/Doc/INPUT_BANDS.html.
:ivar KPathFinderConvention: This option determines how the path through the Brillouin zone is generated when using the automatic k-point mode.
Available options:
• ``Setyawan-Curtarolo`` (default for 1D and 2D lattices): Uses our built-in KPath program to find a path through high-symmetry points based on the method by Setyawan and Curtarolo (https://doi.org/10.1016/j.commatsci.2010.05.010). For 2D lattices, the path is derived from the intersection of the 3D Brillouin zone with a plane. For 1D lattices, the path is simply ``GAMMA-Z``.
• ``Hinuma``: Uses the external SeeKPath utility to generate the k-path (https://github.com/giovannipizzi/seekpath and https://doi.org/10.1016/j.commatsci.2016.10.015).
:vartype KPathFinderConvention: Literal["Setyawan-Curtarolo", "Hinuma"]
:ivar K_PointsLabels: You can provide labels for your k-points, like ``L-GAMMA-X-U-GAMMA``, separating each label with a hyphen (-) or a vertical bar (|). For example, ``L-GAMMA-X-U-GAMMA`` and ``L|GAMMA|X|U|GAMMA`` are both valid. These labels are optional and only used for display purposes when the ``K_Points`` block is specified. This option is used only if the header of the ``BandStructure%K_Points`` block is not ``ams_kpath``. **Important:** These labels do not determine the actual k-point coordinates. You must specify the k-point coordinates separately within the ``K_Points`` section.
:vartype K_PointsLabels: str | StringKey
:ivar K_PointsStep: Step size in reciprocal space for band structure calculation. Using a smaller number will produce smoother band curves at an increased computational time. This option is used only if the header of the ``BandStructure%K_Points`` block is ``ams_kpath``.
:vartype K_PointsStep: float | FloatKey
:ivar UseSymmetry: If set, only the irreducible wedge of the Wigner-Seitz cell is sampled. If not, the whole (inversion-unique) Wigner-Seitz cell is sampled. Only available for Setyawan and Curtarolo convention (see ``KPathFinderConvention``).
:vartype UseSymmetry: BoolType | BoolKey
:ivar nbnd: Number of electronic states (bands) to be calculated. Note that in spin-polarized calculations the number of k-point, not the number of bands per k-point, is doubled.
Default: 20% more (minimum of 4 additional bands) than the number used in the main 'pw.x' calculation, regardless of the material's insulating or metallic nature. Notice that this default is calculated differently than in standard QE.
:vartype nbnd: int | IntKey
:ivar K_Points: Specify the k-points to use. Choose a header appropriate for your system. Available values are: ``tpiba``, ``automatic``, ``crystal``, ``gamma``, ``tpiba_b``, ``crystal_b``, ``tpiba_c``, ``crystal_c``, and ``ams_kpath``. See the QE documentation for details. If omitted, ``ams_kpath`` will be used for 3D systems, and ``gamma`` otherwise. For most cases, ``ams_kpath`` (which generates a convenient path along high-symmetry k-points in the Brillouin zone) is recommended.
:vartype K_Points: str | Sequence[str] | FreeBlock
"""
[docs] class _K_Points(FreeBlock):
r"""
Specify the k-points to use. Choose a header appropriate for your system. Available values are: ``tpiba``, ``automatic``, ``crystal``, ``gamma``, ``tpiba_b``, ``crystal_b``, ``tpiba_c``, ``crystal_c``, and ``ams_kpath``. See the QE documentation for details. If omitted, ``ams_kpath`` will be used for 3D systems, and ``gamma`` otherwise. For most cases, ``ams_kpath`` (which generates a convenient path along high-symmetry k-points in the Brillouin zone) is recommended.
"""
def __post_init__(self):
pass
def __post_init__(self):
self.KPathFinderConvention: Literal["Setyawan-Curtarolo", "Hinuma"] = MultipleChoiceKey(name='KPathFinderConvention', comment='This option determines how the path through the Brillouin zone is generated when using the automatic k-point mode.\n\nAvailable options:\n\n• ``Setyawan-Curtarolo`` (default for 1D and 2D lattices): Uses our built-in KPath program to find a path through high-symmetry points based on the method by Setyawan and Curtarolo (https://doi.org/10.1016/j.commatsci.2010.05.010). For 2D lattices, the path is derived from the intersection of the 3D Brillouin zone with a plane. For 1D lattices, the path is simply ``GAMMA-Z``.\n\n• ``Hinuma``: Uses the external SeeKPath utility to generate the k-path (https://github.com/giovannipizzi/seekpath and https://doi.org/10.1016/j.commatsci.2016.10.015).', default='Setyawan-Curtarolo', choices=['Setyawan-Curtarolo', 'Hinuma'])
self.K_PointsLabels: str | StringKey = StringKey(name='K_PointsLabels', comment='You can provide labels for your k-points, like ``L-GAMMA-X-U-GAMMA``, separating each label with a hyphen (-) or a vertical bar (|). For example, ``L-GAMMA-X-U-GAMMA`` and ``L|GAMMA|X|U|GAMMA`` are both valid. These labels are optional and only used for display purposes when the ``K_Points`` block is specified. This option is used only if the header of the ``BandStructure%K_Points`` block is not ``ams_kpath``. **Important:** These labels do not determine the actual k-point coordinates. You must specify the k-point coordinates separately within the ``K_Points`` section.')
self.K_PointsStep: float | FloatKey = FloatKey(name='K_PointsStep', comment='Step size in reciprocal space for band structure calculation. Using a smaller number will produce smoother band curves at an increased computational time. This option is used only if the header of the ``BandStructure%K_Points`` block is ``ams_kpath``.', default=0.05, unit='1/Bohr')
self.UseSymmetry: BoolType | BoolKey = BoolKey(name='UseSymmetry', comment='If set, only the irreducible wedge of the Wigner-Seitz cell is sampled. If not, the whole (inversion-unique) Wigner-Seitz cell is sampled. Only available for Setyawan and Curtarolo convention (see ``KPathFinderConvention``).', default=True)
self.nbnd: int | IntKey = IntKey(name='nbnd', comment="Number of electronic states (bands) to be calculated. Note that in spin-polarized calculations the number of k-point, not the number of bands per k-point, is doubled.\n\nDefault: 20% more (minimum of 4 additional bands) than the number used in the main 'pw.x' calculation, regardless of the material's insulating or metallic nature. Notice that this default is calculated differently than in standard QE.", gui_name='Number of bands:')
self.K_Points: str | Sequence[str] | FreeBlock = self._K_Points(name='K_Points', comment='Specify the k-points to use. Choose a header appropriate for your system. Available values are: ``tpiba``, ``automatic``, ``crystal``, ``gamma``, ``tpiba_b``, ``crystal_b``, ``tpiba_c``, ``crystal_c``, and ``ams_kpath``. See the QE documentation for details. If omitted, ``ams_kpath`` will be used for 3D systems, and ``gamma`` otherwise. For most cases, ``ams_kpath`` (which generates a convenient path along high-symmetry k-points in the Brillouin zone) is recommended.', header=True)
[docs] class _Control(FixedBlock):
r"""
Keywords from the &CONTROL namelist in the QuantumEspresso input file.
:ivar dipfield: If True (and ``tefield`` is True) a dipole correction is also added to the bare ionic potential - implements the recipe of L. Bengtsson, PRB 59, 12301 (1999).
See keywords ``edir``, ``emaxpos``, ``eopreg`` for the form of the correction.
Must be used ONLY in a slab geometry, for surface calculations, with the discontinuity FALLING IN THE EMPTY SPACE.
:vartype dipfield: BoolType | BoolKey
:ivar disk_io: Specifies the amount of disk I/O activity:
• High: save charge to disk at each SCF step, keep wavefunctions on disk (in 'distributed' format), save mixing data as well. Do not use this option unless you have a good reason! It is no longer needed to specify 'high' in order to be able to restart from an interrupted calculation (see restart_mode).
• Medium: save charge to disk at each SCF step, keep wavefunctions on disk only if more than one k-point, per process is present, otherwise keep them in memory; save them to disk only at the end (in 'portable' format).
• Low: save charge to disk at each SCF step, keep wavefunctions in memory (for all k-points), save them to disk only at the end (in 'portable' format). Reduces I/O but increases memory wrt the previous cases.
• NoWf: save to disk only the xml data file and the charge density at convergence, never save wavefunctions. Restarting from an interrupted calculation is not possible with this option.
• Minimal: save to disk only the xml data file at convergence.
• None: do not save anything to disk.
• Default stablished by QE ('Low' for the scf case, 'Medium' otherwise.)
:vartype disk_io: Literal["High", "Medium", "Low", "NoWf", "Minimal", "None"]
:ivar lelfield: If True a homogeneous finite electric field described through the modern theory of the polarization is applied.
This is different from setting ``tefield`` to True!
:vartype lelfield: BoolType | BoolKey
:ivar max_seconds: Jobs stops after max_seconds CPU time. Use this option in conjunction with option restart_mode if you need to
split a job too long to complete into shorter jobs that fit into your batch queues. Warning! Unfortunately, AMS does not yet support restarting an SCF calculation in QE. Therefore, utilizing this option is unhelpful, unless you intend to continue the calculation directly using QE.
:vartype max_seconds: float | FloatKey
:ivar tefield: If True a saw-like potential simulating an electric field is added to the bare ionic potential.
See keywords ``edir``, ``eamp``, ``emaxpos``, ``eopreg`` for the form and size of the added potential.
:vartype tefield: BoolType | BoolKey
"""
def __post_init__(self):
self.dipfield: BoolType | BoolKey = BoolKey(name='dipfield', comment='If True (and ``tefield`` is True) a dipole correction is also added to the bare ionic potential - implements the recipe of L. Bengtsson, PRB 59, 12301 (1999).\n\nSee keywords ``edir``, ``emaxpos``, ``eopreg`` for the form of the correction.\n\nMust be used ONLY in a slab geometry, for surface calculations, with the discontinuity FALLING IN THE EMPTY SPACE.', gui_name='Dipole field:', default=False)
self.disk_io: Literal["High", "Medium", "Low", "NoWf", "Minimal", "None"] = MultipleChoiceKey(name='disk_io', comment="Specifies the amount of disk I/O activity:\n\n• High: save charge to disk at each SCF step, keep wavefunctions on disk (in 'distributed' format), save mixing data as well. Do not use this option unless you have a good reason! It is no longer needed to specify 'high' in order to be able to restart from an interrupted calculation (see restart_mode).\n\n• Medium: save charge to disk at each SCF step, keep wavefunctions on disk only if more than one k-point, per process is present, otherwise keep them in memory; save them to disk only at the end (in 'portable' format).\n\n• Low: save charge to disk at each SCF step, keep wavefunctions in memory (for all k-points), save them to disk only at the end (in 'portable' format). Reduces I/O but increases memory wrt the previous cases.\n\n• NoWf: save to disk only the xml data file and the charge density at convergence, never save wavefunctions. Restarting from an interrupted calculation is not possible with this option.\n\n• Minimal: save to disk only the xml data file at convergence.\n\n• None: do not save anything to disk.\n\n• Default stablished by QE ('Low' for the scf case, 'Medium' otherwise.)", hidden=True, choices=['High', 'Medium', 'Low', 'NoWf', 'Minimal', 'None'])
self.lelfield: BoolType | BoolKey = BoolKey(name='lelfield', comment='If True a homogeneous finite electric field described through the modern theory of the polarization is applied.\n\nThis is different from setting ``tefield`` to True!', gui_name='Homogeneous E-field:', default=False)
self.max_seconds: float | FloatKey = FloatKey(name='max_seconds', comment='Jobs stops after max_seconds CPU time. Use this option in conjunction with option restart_mode if you need to\n\nsplit a job too long to complete into shorter jobs that fit into your batch queues. Warning! Unfortunately, AMS does not yet support restarting an SCF calculation in QE. Therefore, utilizing this option is unhelpful, unless you intend to continue the calculation directly using QE.', hidden=True)
self.tefield: BoolType | BoolKey = BoolKey(name='tefield', comment='If True a saw-like potential simulating an electric field is added to the bare ionic potential.\n\nSee keywords ``edir``, ``eamp``, ``emaxpos``, ``eopreg`` for the form and size of the added potential.', gui_name='Saw-like E-field:', default=False)
[docs] class _DOS(FixedBlock):
r"""
This section configures the parameters for calculating the Density of States (DOS). These are the utilities involved:
• ``kpath``: This AMS tool generates an automated high-symmetry k-path in the Brillouin zone.
• ``pw.x`` (with ``calculation=nscf``): This Quantum ESPRESSO (QE) utility conducts electronic structure calculations, specifically for the non-self-consistent field (nscf) computation.
• ``dos.x``: A QE utility utilized for post-processing electronic structure calculations. It analyzes the electronic wavefunctions obtained from preceding calculations to determine the density of available electronic states at different energy levels. For more details see https://www.quantum-espresso.org/Doc/INPUT_DOS.html
• ``projwfc.x``: Another QE utility employed for post-processing electronic structure calculations. It projects the wavefunctions onto atomic orbitals or basis sets, offering insights into the composition and character of electronic states. For more details see https://www.quantum-espresso.org/Doc/INPUT_PROJWFC.html
By default, the calculation sequence follows the order: ``kpath -> pw.x(calculation=nscf) -> dos.x``. However, enabling ``DOS%PDOS`` switches the calculation to use ``projwfc.x`` instead of ``dos.x``. While common parameters can be customized directly in this section, specialized adjustments should be made in either the ``DOS_X`` or ``PROJWFC_X`` section, depending on specific requirements.
:ivar DeltaE: Energy grid step.
:vartype DeltaE: float | FloatKey
:ivar Emax: Maximum energy for DOS plot. If unspecified, the upper band value, plus 3 times the value of the gaussian smearing if present, will be used.
:vartype Emax: float | FloatKey
:ivar Emin: Minimum energy for DOS plot. If unspecified, the lower band value, minus 3 times the value of the gaussian smearing if present, will be used.
:vartype Emin: float | FloatKey
:ivar K_PointsStep: This option is used only if the header of the ``DOS%K_Points`` block is ``ams_kpath``.
:vartype K_PointsStep: float | FloatKey
:ivar PDOS: If true, the partial Density-Of-States (projections on atomic basis functions) is calculated and saved for visualization. It uses the QE-utility ``projwfc.x``. To configure the parameters of the calculation, please modify the options in the the section ``PROJWFC_X``.
:vartype PDOS: BoolType | BoolKey
:ivar degauss: Gaussian broadening. See more details in sections ``DOS_X`` or ``PROJWFC_X``.
:vartype degauss: float | FloatKey
:ivar nbnd: Number of electronic states (bands) to be calculated. Note that in spin-polarized calculations the number of k-point, not the number of bands per k-point, is doubled.
Default: 20% more (minimum of 4 additional bands) than the number used in the main 'pw.x' calculation, regardless of the material's insulating or metallic nature. Notice that this default is calculated differently than in standard QE.
:vartype nbnd: int | IntKey
:ivar ngauss: Type of gaussian broadening: Available options are:
• SimpleGaussian.
• Methfessel-Paxton: Methfessel-Paxton of order 1.
• ColdSmearing: Marzari-Vanderbilt-DeVita-Payne.
• Fermi-Dirac: Fermi-Dirac function.
• Default: See more details in sections ``DOS_X`` or ``PROJWFC_X``.
:vartype ngauss: Literal["0", "SimpleGaussian", "1", "Methfessel-Paxton", "-1", "ColdSmearing", "-99", "Fermi-Dirac", "Default"]
:ivar occupations: Available options are:
• Smearing: gaussian smearing for metals; see keywords ``smearing`` and ``degauss``
• Tetrahedra: Tetrahedron method, Bloechl's version: P.E. Bloechl, PRB 49, 16223 (1994). Requires uniform grid of k-points, to be automatically generated (see ``block K_Points``). Well suited for calculation of DOS, less so (because not variational) for force/optimization/dynamics calculations.
• Tetrahedra_lin: Original linear tetrahedron method. To be used only as a reference; the optimized tetrahedron method is more efficient.
• Tetrahedra_opt: optimized tetrahedron method, see M. Kawamura, PRB 89, 094515 (2014). Can be used for phonon calculations as well.
• Fixed: for insulators with a gap.
• Auto: Uses ``Tetrahedra`` for 3D and 2D systems, and ``Fixed`` for 0D and 1D systems.
:vartype occupations: Literal["Smearing", "Tetrahedra", "Tetrahedra_lin", "Tetrahedra_opt", "Fixed", "Auto"]
:ivar smearing: Available options are:
• Gaussian: ordinary Gaussian spreading
• Methfessel-Paxton: first-order spreading (see PRB 40, 3616 (1989))
• Marzari-Vanderbilt: cold smearing (see PRL 82, 3296 (1999))
• Fermi-Dirac: smearing with Fermi-Dirac function
:vartype smearing: Literal["Gaussian", "gauss", "Methfessel-Paxton", "m-p", "mp", "Marzari-Vanderbilt", "cold", "m-v", "mv", "Fermi-Dirac", "f-d", "fd"]
:ivar K_Points: Specify the k-points to use. Choose a header appropriate for your system. Available values are: ``tpiba``, ``automatic``, ``crystal``, ``gamma``, ``tpiba_b``, ``crystal_b``, ``tpiba_c``, ``crystal_c``, and ``ams_kpath``. See the QE documentation for details. If omitted, the k-points specified in the main QE calculation will be used. For most cases, ``automatic`` (which generates a Monkhorst-Pack grid) is recommended.
:vartype K_Points: str | Sequence[str] | FreeBlock
"""
[docs] class _K_Points(FreeBlock):
r"""
Specify the k-points to use. Choose a header appropriate for your system. Available values are: ``tpiba``, ``automatic``, ``crystal``, ``gamma``, ``tpiba_b``, ``crystal_b``, ``tpiba_c``, ``crystal_c``, and ``ams_kpath``. See the QE documentation for details. If omitted, the k-points specified in the main QE calculation will be used. For most cases, ``automatic`` (which generates a Monkhorst-Pack grid) is recommended.
"""
def __post_init__(self):
pass
def __post_init__(self):
self.DeltaE: float | FloatKey = FloatKey(name='DeltaE', comment='Energy grid step.', gui_name='Energy step:', default=0.1, unit='eV')
self.Emax: float | FloatKey = FloatKey(name='Emax', comment='Maximum energy for DOS plot. If unspecified, the upper band value, plus 3 times the value of the gaussian smearing if present, will be used.', unit='eV')
self.Emin: float | FloatKey = FloatKey(name='Emin', comment='Minimum energy for DOS plot. If unspecified, the lower band value, minus 3 times the value of the gaussian smearing if present, will be used.', unit='eV')
self.K_PointsStep: float | FloatKey = FloatKey(name='K_PointsStep', comment='This option is used only if the header of the ``DOS%K_Points`` block is ``ams_kpath``.', default=0.05, unit='1/Bohr')
self.PDOS: BoolType | BoolKey = BoolKey(name='PDOS', comment='If true, the partial Density-Of-States (projections on atomic basis functions) is calculated and saved for visualization. It uses the QE-utility ``projwfc.x``. To configure the parameters of the calculation, please modify the options in the the section ``PROJWFC_X``.', gui_name='Calculate PDOS and Lowdin charges:', default=False)
self.degauss: float | FloatKey = FloatKey(name='degauss', comment='Gaussian broadening. See more details in sections ``DOS_X`` or ``PROJWFC_X``.', gui_name='Broadening width:', unit='Rydberg')
self.nbnd: int | IntKey = IntKey(name='nbnd', comment="Number of electronic states (bands) to be calculated. Note that in spin-polarized calculations the number of k-point, not the number of bands per k-point, is doubled.\n\nDefault: 20% more (minimum of 4 additional bands) than the number used in the main 'pw.x' calculation, regardless of the material's insulating or metallic nature. Notice that this default is calculated differently than in standard QE.", gui_name='Number of bands:')
self.ngauss: Literal["0", "SimpleGaussian", "1", "Methfessel-Paxton", "-1", "ColdSmearing", "-99", "Fermi-Dirac", "Default"] = MultipleChoiceKey(name='ngauss', comment='Type of gaussian broadening: Available options are:\n\n• SimpleGaussian.\n\n• Methfessel-Paxton: Methfessel-Paxton of order 1.\n\n• ColdSmearing: Marzari-Vanderbilt-DeVita-Payne.\n\n• Fermi-Dirac: Fermi-Dirac function.\n\n• Default: See more details in sections ``DOS_X`` or ``PROJWFC_X``.', gui_name='Broadening type:', default='Default', choices=['0', 'SimpleGaussian', '1', 'Methfessel-Paxton', '-1', 'ColdSmearing', '-99', 'Fermi-Dirac', 'Default'], hiddenchoices=['0', '1', '-1', '-99'])
self.occupations: Literal["Smearing", "Tetrahedra", "Tetrahedra_lin", "Tetrahedra_opt", "Fixed", "Auto"] = MultipleChoiceKey(name='occupations', comment="Available options are:\n\n• Smearing: gaussian smearing for metals; see keywords ``smearing`` and ``degauss``\n\n• Tetrahedra: Tetrahedron method, Bloechl's version: P.E. Bloechl, PRB 49, 16223 (1994). Requires uniform grid of k-points, to be automatically generated (see ``block K_Points``). Well suited for calculation of DOS, less so (because not variational) for force/optimization/dynamics calculations.\n\n• Tetrahedra_lin: Original linear tetrahedron method. To be used only as a reference; the optimized tetrahedron method is more efficient.\n\n• Tetrahedra_opt: optimized tetrahedron method, see M. Kawamura, PRB 89, 094515 (2014). Can be used for phonon calculations as well.\n\n• Fixed: for insulators with a gap. \n\n• Auto: Uses ``Tetrahedra`` for 3D and 2D systems, and ``Fixed`` for 0D and 1D systems.", gui_name='Non-SCF Occupations:', default='Auto', choices=['Smearing', 'Tetrahedra', 'Tetrahedra_lin', 'Tetrahedra_opt', 'Fixed', 'Auto'])
self.smearing: Literal["Gaussian", "gauss", "Methfessel-Paxton", "m-p", "mp", "Marzari-Vanderbilt", "cold", "m-v", "mv", "Fermi-Dirac", "f-d", "fd"] = MultipleChoiceKey(name='smearing', comment='Available options are:\n\n• Gaussian: ordinary Gaussian spreading\n\n• Methfessel-Paxton: first-order spreading (see PRB 40, 3616 (1989))\n\n• Marzari-Vanderbilt: cold smearing (see PRL 82, 3296 (1999))\n\n• Fermi-Dirac: smearing with Fermi-Dirac function', gui_name='Smearing:', default='Gaussian', choices=['Gaussian', 'gauss', 'Methfessel-Paxton', 'm-p', 'mp', 'Marzari-Vanderbilt', 'cold', 'm-v', 'mv', 'Fermi-Dirac', 'f-d', 'fd'], hiddenchoices=['gauss', 'm-p', 'mp', 'cold', 'm-v', 'mv', 'f-d', 'fd'])
self.K_Points: str | Sequence[str] | FreeBlock = self._K_Points(name='K_Points', comment='Specify the k-points to use. Choose a header appropriate for your system. Available values are: ``tpiba``, ``automatic``, ``crystal``, ``gamma``, ``tpiba_b``, ``crystal_b``, ``tpiba_c``, ``crystal_c``, and ``ams_kpath``. See the QE documentation for details. If omitted, the k-points specified in the main QE calculation will be used. For most cases, ``automatic`` (which generates a Monkhorst-Pack grid) is recommended.', header=True)
[docs] class _DOS_X(FixedBlock):
r"""
This section configures the parameters for running the QE-utility ``dos.x`` (see https://www.quantum-espresso.org/Doc/INPUT_DOS.html). This utility calculates the Density of States (DOS), separated into up and down components for DSDA.
:ivar DeltaE: Energy grid step.
:vartype DeltaE: float | FloatKey
:ivar Emax: Maximum energy for DOS plot. If unspecified, the upper band value, plus 3 times the value of the gaussian smearing if present, will be used.
:vartype Emax: float | FloatKey
:ivar Emin: Minimum energy for DOS plot. If unspecified, the lower band value, minus 3 times the value of the gaussian smearing if present, will be used.
:vartype Emin: float | FloatKey
:ivar bz_sum: Keyword selecting the method for BZ summation. Available options are:
• Smearing: Integration using gaussian smearing. In fact currently any string not related to tetrahedra defaults to smearing.
• Tetrahedra: Tetrahedron method, Bloechl's version: P.E. Bloechl, PRB 49, 16223 (1994). Requires uniform grid of k-points, to be automatically generated (see ``block K_Points``).
• Tetrahedra_lin: Original linear tetrahedron method. To be used only as a reference; the optimized tetrahedron method is more efficient.
• Tetrahedra_opt: Optimized tetrahedron method, see M. Kawamura, PRB 89, 094515 (2014). Default: The default value is ``Smearing`` if ``DOS_X%degauss`` is set, otherwise it is influenced by related variables used in the previous 'pw.x' run. For more information, consult the original Quantum Espresso documentation at this link: https://www.quantum-espresso.org/Doc/INPUT_DOS.html.
:vartype bz_sum: Literal["Smearing", "Tetrahedra", "Tetrahedra_lin", "Tetrahedra_opt", "Default"]
:ivar degauss: Gaussian broadening. If not set, the default value is determined by the choice you make for ``DOS_X%bz_sum``, and it may also be influenced by related variables used in the previous 'pw.x' run. For more information, consult the original Quantum Espresso documentation at this link: https://www.quantum-espresso.org/Doc/INPUT_DOS.html.
:vartype degauss: float | FloatKey
:ivar ngauss: Type of gaussian broadening: Available options are:
• SimpleGaussian.
• Methfessel-Paxton: Methfessel-Paxton of order 1.
• ColdSmearing: Marzari-Vanderbilt-DeVita-Payne.
• Fermi-Dirac: Fermi-Dirac function.
• Default: The default value is determined by the choices you make for ``DOS_X%bz_sum`` and ``DOS_X%degauss``, and it may also be influenced by related variables used in the previous 'pw.x' run. For more information, consult the original Quantum Espresso documentation at this link: https://www.quantum-espresso.org/Doc/INPUT_DOS.html.
:vartype ngauss: Literal["0", "SimpleGaussian", "1", "Methfessel-Paxton", "-1", "ColdSmearing", "-99", "Fermi-Dirac", "Default"]
"""
def __post_init__(self):
self.DeltaE: float | FloatKey = FloatKey(name='DeltaE', comment='Energy grid step.', gui_name='Energy step:', default=0.1, unit='eV')
self.Emax: float | FloatKey = FloatKey(name='Emax', comment='Maximum energy for DOS plot. If unspecified, the upper band value, plus 3 times the value of the gaussian smearing if present, will be used.', unit='eV')
self.Emin: float | FloatKey = FloatKey(name='Emin', comment='Minimum energy for DOS plot. If unspecified, the lower band value, minus 3 times the value of the gaussian smearing if present, will be used.', unit='eV')
self.bz_sum: Literal["Smearing", "Tetrahedra", "Tetrahedra_lin", "Tetrahedra_opt", "Default"] = MultipleChoiceKey(name='bz_sum', comment="Keyword selecting the method for BZ summation. Available options are:\n\n• Smearing: Integration using gaussian smearing. In fact currently any string not related to tetrahedra defaults to smearing.\n\n• Tetrahedra: Tetrahedron method, Bloechl's version: P.E. Bloechl, PRB 49, 16223 (1994). Requires uniform grid of k-points, to be automatically generated (see ``block K_Points``).\n\n• Tetrahedra_lin: Original linear tetrahedron method. To be used only as a reference; the optimized tetrahedron method is more efficient.\n\n• Tetrahedra_opt: Optimized tetrahedron method, see M. Kawamura, PRB 89, 094515 (2014). Default: The default value is ``Smearing`` if ``DOS_X%degauss`` is set, otherwise it is influenced by related variables used in the previous 'pw.x' run. For more information, consult the original Quantum Espresso documentation at this link: https://www.quantum-espresso.org/Doc/INPUT_DOS.html.", gui_name='BZ summation method:', default='Default', choices=['Smearing', 'Tetrahedra', 'Tetrahedra_lin', 'Tetrahedra_opt', 'Default'])
self.degauss: float | FloatKey = FloatKey(name='degauss', comment="Gaussian broadening. If not set, the default value is determined by the choice you make for ``DOS_X%bz_sum``, and it may also be influenced by related variables used in the previous 'pw.x' run. For more information, consult the original Quantum Espresso documentation at this link: https://www.quantum-espresso.org/Doc/INPUT_DOS.html.", gui_name='Broadening width:', unit='Rydberg')
self.ngauss: Literal["0", "SimpleGaussian", "1", "Methfessel-Paxton", "-1", "ColdSmearing", "-99", "Fermi-Dirac", "Default"] = MultipleChoiceKey(name='ngauss', comment="Type of gaussian broadening: Available options are:\n\n• SimpleGaussian.\n\n• Methfessel-Paxton: Methfessel-Paxton of order 1.\n\n• ColdSmearing: Marzari-Vanderbilt-DeVita-Payne.\n\n• Fermi-Dirac: Fermi-Dirac function.\n\n• Default: The default value is determined by the choices you make for ``DOS_X%bz_sum`` and ``DOS_X%degauss``, and it may also be influenced by related variables used in the previous 'pw.x' run. For more information, consult the original Quantum Espresso documentation at this link: https://www.quantum-espresso.org/Doc/INPUT_DOS.html.", gui_name='Broadening type:', default='Default', choices=['0', 'SimpleGaussian', '1', 'Methfessel-Paxton', '-1', 'ColdSmearing', '-99', 'Fermi-Dirac', 'Default'], hiddenchoices=['0', '1', '-1', '-99'])
[docs] class _DYNMAT_X(FixedBlock):
r"""
This section configures the parameters for running the QE utility `dynmat.x` (see https://www.quantum-espresso.org/Doc/INPUT_DYNMAT.html). This utility is used to ???
:ivar asr: Indicates the type of Acoustic Sum Rule imposed. Allowed values: 'no', 'simple', 'crystal', 'one-dim', 'zero-dim'
:vartype asr: str | StringKey
"""
def __post_init__(self):
self.asr: str | StringKey = StringKey(name='asr', comment="Indicates the type of Acoustic Sum Rule imposed. Allowed values: 'no', 'simple', 'crystal', 'one-dim', 'zero-dim'", default='no')
[docs] class _Electrons(FixedBlock):
r"""
Keywords from the &ELECTRONS namelist in the QuantumEspresso input file.
:ivar conv_thr: Convergence threshold for selfconsistency: estimated energy error < ``conv_thr``. Note that ``conv_thr`` is extensive, like the total energy.
:vartype conv_thr: float | FloatKey
:ivar diagonalization: Available options are:
• Davidson: iterative diagonalization with overlap matrix. Fast, may in some rare cases fail.
• ConjugateGradient: Conjugate-gradient-like band-by-band diagonalization. MUCH slower than ``Davidson`` but uses less memory and is (a little bit) more robust.
• PPCG: PPCG iterative diagonalization
• ParO: ParO iterative diagonalization
• RMM-Davidson & RMM-ParO: RMM-DIIS iterative diagonalization. To stabilize the SCF loop RMM-DIIS is alternated with calls to Davidson or ParO solvers.
:vartype diagonalization: Literal["Davidson", "David", "ConjugateGradient", "CG", "PPCG", "ParO", "RMM-Davidson", "RMM-ParO"]
:ivar electron_maxstep: Maximum number of iterations in a SCF step.
:vartype electron_maxstep: int | IntKey
:ivar mixing_beta: Mixing factor for self-consistency.
Note: the default value in the AMS interface (0.3) is smaller than the default value in pw.x (0.7)
:vartype mixing_beta: float | FloatKey
:ivar mixing_mode: Available options are:
• Plain: charge density Broyden mixing
• Thomas-Fermi: as above, with simple Thomas-Fermi screening (for highly homogeneous systems)
• Local-Thomas-Fermi: as above, with local-density-dependent TF screening (for highly inhomogeneous systems)
:vartype mixing_mode: Literal["Plain", "Thomas-Fermi", "TF", "Local-Thomas-Fermi", "local-TF"]
:ivar mixing_ndim: Number of iterations used in mixing scheme. If you are tight with memory, you may reduce it to 4 or so.
:vartype mixing_ndim: int | IntKey
:ivar scf_must_converge: If .false. do not stop molecular dynamics or ionic relaxation when electron_maxstep is reached. Use with care. Important: When using the AMS interface, setting this to .true. will halt the entire AMS execution if the SCF fails; otherwise, AMS will try to continue using the unconverged results.
:vartype scf_must_converge: BoolType | BoolKey
:ivar startingpot: Available options are:
• 'atomic': starting potential from atomic charge superposition.
• 'file': start from existing 'charge-density.xml' file in the directory specified by variables prefix and outdir. **Note:** This option applies only to the main and first QE calculation. Once the QE worker is up, the results from the previous step are reused.
:vartype startingpot: Literal["atomic", "file"]
:ivar startingwfc: Available options are:
• 'atomic': Start from superposition of atomic orbitals. If not enough atomic orbitals are available, fill with random numbers the remaining wfcs. The scf typically starts better with this option, but in some high-symmetry cases one can 'loose' valence states, ending up in the wrong ground state.
• 'atomic+random': As above, plus a superimposed 'randomization' of atomic orbitals. Prevents the 'loss' of states mentioned above.
• 'random': Start from random wfcs. Slower start of scf but safe. It may also reduce memory usage in conjunction with diagonalization='cg'.
• 'file': Start from an existing wavefunction file in the directory specified by variables prefix and outdir. **Note:** This option applies only to the main and first QE calculation. Once the QE worker is up, the results from the previous step are reused.
:vartype startingwfc: Literal["atomic", "atomic+random", "random", "file"]
"""
def __post_init__(self):
self.conv_thr: float | FloatKey = FloatKey(name='conv_thr', comment='Convergence threshold for selfconsistency: estimated energy error < ``conv_thr``. Note that ``conv_thr`` is extensive, like the total energy.', gui_name='Convergence threshold:', default=1e-06, unit='Rydberg')
self.diagonalization: Literal["Davidson", "David", "ConjugateGradient", "CG", "PPCG", "ParO", "RMM-Davidson", "RMM-ParO"] = MultipleChoiceKey(name='diagonalization', comment='Available options are:\n\n• Davidson: iterative diagonalization with overlap matrix. Fast, may in some rare cases fail.\n\n• ConjugateGradient: Conjugate-gradient-like band-by-band diagonalization. MUCH slower than ``Davidson`` but uses less memory and is (a little bit) more robust.\n\n• PPCG: PPCG iterative diagonalization\n\n• ParO: ParO iterative diagonalization\n\n• RMM-Davidson & RMM-ParO: RMM-DIIS iterative diagonalization. To stabilize the SCF loop RMM-DIIS is alternated with calls to Davidson or ParO solvers.', gui_name='Diagonalization:', default='Davidson', choices=['Davidson', 'David', 'ConjugateGradient', 'CG', 'PPCG', 'ParO', 'RMM-Davidson', 'RMM-ParO'], hiddenchoices=['David', 'CG'])
self.electron_maxstep: int | IntKey = IntKey(name='electron_maxstep', comment='Maximum number of iterations in a SCF step.', gui_name='Maximum # SCF iterations:', default=100)
self.mixing_beta: float | FloatKey = FloatKey(name='mixing_beta', comment='Mixing factor for self-consistency.\n\nNote: the default value in the AMS interface (0.3) is smaller than the default value in pw.x (0.7)', gui_name='Beta', default=0.3)
self.mixing_mode: Literal["Plain", "Thomas-Fermi", "TF", "Local-Thomas-Fermi", "local-TF"] = MultipleChoiceKey(name='mixing_mode', comment='Available options are:\n\n• Plain: charge density Broyden mixing\n\n• Thomas-Fermi: as above, with simple Thomas-Fermi screening (for highly homogeneous systems)\n\n• Local-Thomas-Fermi: as above, with local-density-dependent TF screening (for highly inhomogeneous systems)', gui_name='Mixing mode:', default='Plain', choices=['Plain', 'Thomas-Fermi', 'TF', 'Local-Thomas-Fermi', 'local-TF'], hiddenchoices=['TF', 'local-TF'])
self.mixing_ndim: int | IntKey = IntKey(name='mixing_ndim', comment='Number of iterations used in mixing scheme. If you are tight with memory, you may reduce it to 4 or so.', gui_name='Dimension:', default=8)
self.scf_must_converge: BoolType | BoolKey = BoolKey(name='scf_must_converge', comment='If .false. do not stop molecular dynamics or ionic relaxation when electron_maxstep is reached. Use with care. Important: When using the AMS interface, setting this to .true. will halt the entire AMS execution if the SCF fails; otherwise, AMS will try to continue using the unconverged results.', default=True)
self.startingpot: Literal["atomic", "file"] = MultipleChoiceKey(name='startingpot', comment="Available options are:\n\n• 'atomic': starting potential from atomic charge superposition.\n\n• 'file': start from existing 'charge-density.xml' file in the directory specified by variables prefix and outdir. **Note:** This option applies only to the main and first QE calculation. Once the QE worker is up, the results from the previous step are reused.", hidden=True, default='atomic', choices=['atomic', 'file'])
self.startingwfc: Literal["atomic", "atomic+random", "random", "file"] = MultipleChoiceKey(name='startingwfc', comment="Available options are:\n\n• 'atomic': Start from superposition of atomic orbitals. If not enough atomic orbitals are available, fill with random numbers the remaining wfcs. The scf typically starts better with this option, but in some high-symmetry cases one can 'loose' valence states, ending up in the wrong ground state.\n\n• 'atomic+random': As above, plus a superimposed 'randomization' of atomic orbitals. Prevents the 'loss' of states mentioned above.\n\n• 'random': Start from random wfcs. Slower start of scf but safe. It may also reduce memory usage in conjunction with diagonalization='cg'.\n\n• 'file': Start from an existing wavefunction file in the directory specified by variables prefix and outdir. **Note:** This option applies only to the main and first QE calculation. Once the QE worker is up, the results from the previous step are reused.", hidden=True, default='atomic+random', choices=['atomic', 'atomic+random', 'random', 'file'])
[docs] class _Hubbard(FreeBlock):
r"""
Specify parameters for DFT+U models. The type of Hubbard projectors to use (e.g. ``atomic`` or ``ortho-atomic``) is specified in the header of this block.
Example input:
.. code-block:: text
Hubbard ortho-atomic
U Fe-3d 3.0
End
More examples can be found in the documentation.
"""
def __post_init__(self):
pass
[docs] class _HubbardU(FixedBlock):
r"""
Specify parameters for DFT+U Models.
:ivar Projector: The Hubbard projector to use.
:vartype Projector: Literal["atomic", "ortho-atomic", "norm-atomic", "wf", "pseudo"]
:ivar Parameter: Specify parameters for DFT+U Models.
:vartype Parameter: QuantumESPRESSO._HubbardU._Parameter
"""
[docs] class _Parameter(FixedBlock):
r"""
Specify parameters for DFT+U Models.
:ivar AtomType: The QE atom type for which this parameter applies.
:vartype AtomType: str | StringKey
:ivar State: The state for this parameter applies.
:vartype State: Literal["1s", "2s", "2p", "3s", "3p", "3d", "4s", "4p", "4d", "4f", "5s", "5p", "5d", "5f", "6s", "6p", "6d", "7s", "7p"]
:ivar Type: The type of Hubbard parameter.
:vartype Type: Literal["U", "J", "J0", "B", "V"]
:ivar Value: The value of this parameter.
:vartype Value: float | FloatKey
"""
def __post_init__(self):
self.AtomType: str | StringKey = StringKey(name='AtomType', comment='The QE atom type for which this parameter applies.', gui_type='element {GetAtomTypes QE::GetAtomTypes}')
self.State: Literal["1s", "2s", "2p", "3s", "3p", "3d", "4s", "4p", "4d", "4f", "5s", "5p", "5d", "5f", "6s", "6p", "6d", "7s", "7p"] = MultipleChoiceKey(name='State', comment='The state for this parameter applies.', choices=['1s', '2s', '2p', '3s', '3p', '3d', '4s', '4p', '4d', '4f', '5s', '5p', '5d', '5f', '6s', '6p', '6d', '7s', '7p'])
self.Type: Literal["U", "J", "J0", "B", "V"] = MultipleChoiceKey(name='Type', comment='The type of Hubbard parameter.', default='U', choices=['U', 'J', 'J0', 'B', 'V'])
self.Value: float | FloatKey = FloatKey(name='Value', comment='The value of this parameter.', unit='eV')
def __post_init__(self):
self.Projector: Literal["atomic", "ortho-atomic", "norm-atomic", "wf", "pseudo"] = MultipleChoiceKey(name='Projector', comment='The Hubbard projector to use.', gui_name='Hubbard projector:', default='ortho-atomic', choices=['atomic', 'ortho-atomic', 'norm-atomic', 'wf', 'pseudo'])
self.Parameter: QuantumESPRESSO._HubbardU._Parameter = self._Parameter(name='Parameter', comment='Specify parameters for DFT+U Models.', unique=False)
[docs] class _K_Points(FreeBlock):
r"""
Specify the k-points to use. Available header values are: ``tpiba``, ``automatic``, ``crystal``, ``gamma``, ``tpiba_b``, ``crystal_b``, ``tpiba_c``, ``crystal_c``, and ``ams_kpath``. See the examples and QE documentation for details. If omitted, only ``gamma`` is used. For most cases, ``automatic`` (which generates a Monkhorst-Pack grid) is recommended. Note: Gamma-point calculations are significantly faster using ``gamma`` than ``automatic``, but may not be possible to use for all types of calculations or postprocessing programs.
"""
def __post_init__(self):
pass
[docs] class _MATDYN_X(FixedBlock):
r"""
This section configures the parameters for running the QE utility `matdyn.x` (see https://www.quantum-espresso.org/Doc/INPUT_MATDYN.html). This utility is used to calculate various phonon-related properties from the real-space interatomic force constants (IFC) produced by `q2r.x`. These properties include phonon dispersion curves, phonon density of states (DOS), thermodynamic properties (e.g., free energy, entropy), and more.
:ivar asr: Indicates the type of Acoustic Sum Rule imposed. Allowed values:
* 'no': no Acoustic Sum Rules imposed (default)
* 'simple': previous implementation of the asr used (3 translational asr imposed by correction of the diagonal elements of the force constants matrix).
* 'crytal': 3 translational asr imposed by optimized correction of the force constants (projection).
* 'all': 3 translational asr + 3 rotational asr + 15 Huang conditions for vanishing stress tensor, imposed by optimized correction of the force constants (projection). Remember to set write_lr = .true. to write long-range force constants into file when running q2r and set read_lr = .true. when running matdyn in the case of infrared-active solids. (See npj Comput Mater 8, 236 (2022)).
* 'one-dim': 3 translational asr + 1 rotational asr imposed by optimized correction of the dyn. mat. (the rotation axis is the direction of periodicity; it will work only if this axis considered is one of the Cartesian axis).
* 'zero-dim': 3 translational asr + 3 rotational asr imposed by optimized correction of the dyn. mat.
:vartype asr: Literal["no", "simple", "crystal", "all", "one-dim", "zero-dim"]
:ivar degauss: DOS broadening in cm-1. Default: 0 - meaning use tetrahedra.
:vartype degauss: float | FloatKey
:ivar deltaE: Energy step, in cm-1, for DOS calculation: from min to max phonon energy (default: 1 cm-1 if is not specified).
:vartype deltaE: float | FloatKey
:ivar dos: If .true. calculate phonon Density of States (DOS) using tetrahedra and a uniform q-point grid (see below) NB: may not work properly in noncubic materials. If .false. calculate phonon bands from the list of q-points supplied in input (default)
:vartype dos: BoolType | BoolKey
:ivar l1: Supercell lattice vectors are original cell vectors times ``l1``, ``l2``, ``l3`` respectively (default: 1)
:vartype l1: int | IntKey
:ivar l2: Supercell lattice vectors are original cell vectors times ``l1``, ``l2``, ``l3`` respectively (default: 1)
:vartype l2: int | IntKey
:ivar l3: Supercell lattice vectors are original cell vectors times ``l1``, ``l2``, ``l3`` respectively (default: 1)
:vartype l3: int | IntKey
:ivar loto_2d: Set to .true. to activate two-dimensional treatment of LO-TO splitting
:vartype loto_2d: BoolType | BoolKey
:ivar ndos: Number of energy steps for DOS calculations (default: calculated from deltaE if not specified).
:vartype ndos: int | IntKey
:ivar nk1: Uniform q-point grid for DOS calculation (includes q=0). First direction. Must be specified if ``dos = .true.``, ignored otherwise.
:vartype nk1: int | IntKey
:ivar nk2: Uniform q-point grid for DOS calculation (includes q=0). Second direction. Must be specified if ``dos = .true.``, ignored otherwise.
:vartype nk2: int | IntKey
:ivar nk3: Uniform q-point grid for DOS calculation (includes q=0). Third direction. Must be specified if ``dos = .true.``, ignored otherwise.
:vartype nk3: int | IntKey
:ivar q_in_cryst_coord: If True, the q-points for the phonon dispersion calculation are given in crystal coordinates (i.e., as fractions of the reciprocal lattice vectors).
:vartype q_in_cryst_coord: BoolType | BoolKey
:ivar Q_Points: Specify the q-points to use for the bands calculation.
:vartype Q_Points: str | Sequence[str] | FreeBlock
"""
[docs] class _Q_Points(FreeBlock):
r"""
Specify the q-points to use for the bands calculation.
"""
def __post_init__(self):
pass
def __post_init__(self):
self.asr: Literal["no", "simple", "crystal", "all", "one-dim", "zero-dim"] = MultipleChoiceKey(name='asr', comment="Indicates the type of Acoustic Sum Rule imposed. Allowed values:\n\n* 'no': no Acoustic Sum Rules imposed (default) \n* 'simple': previous implementation of the asr used (3 translational asr imposed by correction of the diagonal elements of the force constants matrix).\n* 'crytal': 3 translational asr imposed by optimized correction of the force constants (projection).\n* 'all': 3 translational asr + 3 rotational asr + 15 Huang conditions for vanishing stress tensor, imposed by optimized correction of the force constants (projection). Remember to set write_lr = .true. to write long-range force constants into file when running q2r and set read_lr = .true. when running matdyn in the case of infrared-active solids. (See npj Comput Mater 8, 236 (2022)).\n* 'one-dim': 3 translational asr + 1 rotational asr imposed by optimized correction of the dyn. mat. (the rotation axis is the direction of periodicity; it will work only if this axis considered is one of the Cartesian axis).\n* 'zero-dim': 3 translational asr + 3 rotational asr imposed by optimized correction of the dyn. mat.", default='no', choices=['no', 'simple', 'crystal', 'all', 'one-dim', 'zero-dim'])
self.degauss: float | FloatKey = FloatKey(name='degauss', comment='DOS broadening in cm-1. Default: 0 - meaning use tetrahedra.', gui_name='Broadening width:', default=0.0)
self.deltaE: float | FloatKey = FloatKey(name='deltaE', comment='Energy step, in cm-1, for DOS calculation: from min to max phonon energy (default: 1 cm-1 if is not specified).', default=1.0)
self.dos: BoolType | BoolKey = BoolKey(name='dos', comment='If .true. calculate phonon Density of States (DOS) using tetrahedra and a uniform q-point grid (see below) NB: may not work properly in noncubic materials. If .false. calculate phonon bands from the list of q-points supplied in input (default)', default=False)
self.l1: int | IntKey = IntKey(name='l1', comment='Supercell lattice vectors are original cell vectors times ``l1``, ``l2``, ``l3`` respectively (default: 1)', default=1)
self.l2: int | IntKey = IntKey(name='l2', comment='Supercell lattice vectors are original cell vectors times ``l1``, ``l2``, ``l3`` respectively (default: 1)', default=1)
self.l3: int | IntKey = IntKey(name='l3', comment='Supercell lattice vectors are original cell vectors times ``l1``, ``l2``, ``l3`` respectively (default: 1)', default=1)
self.loto_2d: BoolType | BoolKey = BoolKey(name='loto_2d', comment='Set to .true. to activate two-dimensional treatment of LO-TO splitting', default=False)
self.ndos: int | IntKey = IntKey(name='ndos', comment='Number of energy steps for DOS calculations (default: calculated from deltaE if not specified).')
self.nk1: int | IntKey = IntKey(name='nk1', comment='Uniform q-point grid for DOS calculation (includes q=0). First direction. Must be specified if ``dos = .true.``, ignored otherwise.')
self.nk2: int | IntKey = IntKey(name='nk2', comment='Uniform q-point grid for DOS calculation (includes q=0). Second direction. Must be specified if ``dos = .true.``, ignored otherwise.')
self.nk3: int | IntKey = IntKey(name='nk3', comment='Uniform q-point grid for DOS calculation (includes q=0). Third direction. Must be specified if ``dos = .true.``, ignored otherwise.')
self.q_in_cryst_coord: BoolType | BoolKey = BoolKey(name='q_in_cryst_coord', comment='If True, the q-points for the phonon dispersion calculation are given in crystal coordinates (i.e., as fractions of the reciprocal lattice vectors).', default=False)
self.Q_Points: str | Sequence[str] | FreeBlock = self._Q_Points(name='Q_Points', comment='Specify the q-points to use for the bands calculation.', header=True)
[docs] class _NormalModes(FixedBlock):
r"""
This section outlines the configuration of parameters for calculating Normal Modes. The process involves using the following utilities:
• ``ph.x``: This utility from Quantum ESPRESSO (QE) calculates phonon frequencies and eigenvectors at specified q-points (wave vectors) using Density Functional Perturbation Theory (DFPT). You can set specific parameters in the section ``PH_X``. For more details, see https://www.quantum-espresso.org/Doc/INPUT_PH.html.
• ``dynmat.x``: This QE utility calculates the infrared (IR) and Raman intensities (oscillator strengths) as well as the normal modes associated with each vibrational frequency. Specific parameters can be set in the section ``DYNMAT_X``. The information from ``ph.x``, combined with the phonon frequencies, is used to generate the simulated IR/Raman absorption spectrum. For more details, see https://www.quantum-espresso.org/Doc/INPUT_DYNMAT.html.
If Normal Modes are requested in the main AMS properties section, the program automatically sets ``PH_X%asr=Yes``, ``PH_X%epsilon=Yes``, and ``PH_X%trans=Yes``. If Raman is requested in the main AMS properties section, it also sets ``PH_X%lraman=Yes`` along with the previous parameters.
:ivar ActiveAtoms: This is a list of atoms to be used in the linear response calculation. It can help estimate modes for a molecule adsorbed on a surface without requiring a full calculation. Please be aware that this is an approximation and may not be reliable. If you perform a linear response calculation for a specific atom, you should also do so for all symmetry-equivalent atoms. This option serves as an interface to the ``ph.x`` option ``nat_todo``. This is an experimental feature!
:vartype ActiveAtoms: Iterable[int] | IntListKey
:ivar ActiveAtomsInRegion: Specify the region of atoms to be included in the linear response calculation. It can help estimate modes for a molecule adsorbed on a surface without requiring a full calculation. Please be aware that this is an approximation and may not be reliable. If you perform a linear response calculation for a specific atom, you should also do so for all symmetry-equivalent atoms. This option serves as an interface to the ``ph.x`` option ``nat_todo``. This is an experimental feature!
:vartype ActiveAtomsInRegion: str | StringKey
:ivar asr: Indicates the type of Acoustic Sum Rule imposed. Allowed values: 'no', 'simple', 'crystal', 'one-dim', 'zero-dim'
:vartype asr: Literal["no", "simple", "crystal", "one-dim", "zero-dim"]
:ivar tr2_ph: Threshold for self-consistency. It overwrites ``PH_X%tr2_ph``.
:vartype tr2_ph: float | FloatKey
:ivar xq1: First component of the phonon wavevector (q-point) at which the IR spectrum is calculated, in units of 2pi/a0 (a0 = lattice parameter). It overwrites ``PH_X%xq1``.
:vartype xq1: float | FloatKey
:ivar xq2: Second component of the phonon wavevector (q-point) at which the IR spectrum is calculated, in units of 2pi/a0 (a0 = lattice parameter). It overwrites ``PH_X%xq2``.
:vartype xq2: float | FloatKey
:ivar xq3: Third component of the phonon wavevector (q-point) at which the IR spectrum is calculated, in units of 2pi/a0 (a0 = lattice parameter). It overwrites ``PH_X%xq3``.
:vartype xq3: float | FloatKey
"""
def __post_init__(self):
self.ActiveAtoms: Iterable[int] | IntListKey = IntListKey(name='ActiveAtoms', comment='This is a list of atoms to be used in the linear response calculation. It can help estimate modes for a molecule adsorbed on a surface without requiring a full calculation. Please be aware that this is an approximation and may not be reliable. If you perform a linear response calculation for a specific atom, you should also do so for all symmetry-equivalent atoms. This option serves as an interface to the ``ph.x`` option ``nat_todo``. This is an experimental feature!')
self.ActiveAtomsInRegion: str | StringKey = StringKey(name='ActiveAtomsInRegion', comment='Specify the region of atoms to be included in the linear response calculation. It can help estimate modes for a molecule adsorbed on a surface without requiring a full calculation. Please be aware that this is an approximation and may not be reliable. If you perform a linear response calculation for a specific atom, you should also do so for all symmetry-equivalent atoms. This option serves as an interface to the ``ph.x`` option ``nat_todo``. This is an experimental feature!', gui_type='region')
self.asr: Literal["no", "simple", "crystal", "one-dim", "zero-dim"] = MultipleChoiceKey(name='asr', comment="Indicates the type of Acoustic Sum Rule imposed. Allowed values: 'no', 'simple', 'crystal', 'one-dim', 'zero-dim'", default='no', choices=['no', 'simple', 'crystal', 'one-dim', 'zero-dim'])
self.tr2_ph: float | FloatKey = FloatKey(name='tr2_ph', comment='Threshold for self-consistency. It overwrites ``PH_X%tr2_ph``.', default=1e-12)
self.xq1: float | FloatKey = FloatKey(name='xq1', comment='First component of the phonon wavevector (q-point) at which the IR spectrum is calculated, in units of 2pi/a0 (a0 = lattice parameter). It overwrites ``PH_X%xq1``.', default=0.0)
self.xq2: float | FloatKey = FloatKey(name='xq2', comment='Second component of the phonon wavevector (q-point) at which the IR spectrum is calculated, in units of 2pi/a0 (a0 = lattice parameter). It overwrites ``PH_X%xq2``.', default=0.0)
self.xq3: float | FloatKey = FloatKey(name='xq3', comment='Third component of the phonon wavevector (q-point) at which the IR spectrum is calculated, in units of 2pi/a0 (a0 = lattice parameter). It overwrites ``PH_X%xq3``.', default=0.0)
[docs] class _PH_X(FixedBlock):
r"""
This section configures the parameters for running the QE utility `ph.x` (see https://www.quantum-espresso.org/Doc/INPUT_PH.html). This utility is used for post-processing phonon calculations in Quantum ESPRESSO.
:ivar asr: Apply Acoustic Sum Rule to dynamical matrix, effective charges Works only in conjunction with 'gamma_gamma' tricks (see above)
:vartype asr: BoolType | BoolKey
:ivar epsil: If .true. in a q=0 calculation for a non metal the macroscopic dielectric constant of the system is computed. Do not set epsil to .true. if you have a metallic system or q/=0: the code will complain and stop.
:vartype epsil: BoolType | BoolKey
:ivar k1: If specified, triggers a non-self-consistent calculation in `ph.x` with a separate Monkhorst-Pack k-point grid for phonons. This sets the k-point grid offset along the first reciprocal lattice vector for that grid.
:vartype k1: int | IntKey
:ivar k2: If specified, triggers a non-self-consistent calculation in `ph.x` with a separate Monkhorst-Pack k-point grid for phonons. This sets the k-point grid offset along the second reciprocal lattice vector for that grid.
:vartype k2: int | IntKey
:ivar k3: If specified, triggers a non-self-consistent calculation in `ph.x` with a separate Monkhorst-Pack k-point grid for phonons. This sets the k-point grid offset along the third reciprocal lattice vector for that grid.
:vartype k3: int | IntKey
:ivar ldisp: If True, phonon dispersion curves are calculated along specified high-symmetry lines in the Brillouin zone. Requires additional input defining the path.
:vartype ldisp: BoolType | BoolKey
:ivar lraman: If .true. calculate non-resonant Raman coefficients using second-order response as in: M. Lazzeri and F. Mauri, PRL 90, 036401 (2003).
:vartype lraman: BoolType | BoolKey
:ivar nk1: If specified, triggers a non-self-consistent calculation in `ph.x` with a separate Monkhorst-Pack k-point grid for phonons. This sets the number of k-points along the first reciprocal lattice vector for that grid.
:vartype nk1: int | IntKey
:ivar nk2: If specified, triggers a non-self-consistent calculation in `ph.x` with a separate Monkhorst-Pack k-point grid for phonons. This sets the number of k-points along the second reciprocal lattice vector for that grid.
:vartype nk2: int | IntKey
:ivar nk3: If specified, triggers a non-self-consistent calculation in `ph.x` with a separate Monkhorst-Pack k-point grid for phonons. This sets the number of k-points along the third reciprocal lattice vector for that grid.
:vartype nk3: int | IntKey
:ivar nq1: Sets the number of q-points along the first reciprocal lattice vector for the Monkhorst-Pack q-point grid for phonons. Default 1. Notice that this default is different than in standard QE (default 0).
:vartype nq1: int | IntKey
:ivar nq2: Sets the number of q-points along the second reciprocal lattice vector for the Monkhorst-Pack q-point grid for phonons. Default 1. Notice that this default is different than in standard QE (default 0).
:vartype nq2: int | IntKey
:ivar nq3: Sets the number of q-points along the third reciprocal lattice vector for the Monkhorst-Pack q-point grid for phonons. Default 1. Notice that this default is different than in standard QE (default 0).
:vartype nq3: int | IntKey
:ivar search_sym: Set it to .false. if you want to disable the mode symmetry analysis.
:vartype search_sym: BoolType | BoolKey
:ivar tr2_ph: Threshold for self-consistency.
:vartype tr2_ph: float | FloatKey
:ivar trans: If .false. the phonons are not computed. If trans .and. epsil are both .true., the effective charges are calculated. If ldisp is .true., trans=.false. is overridden (except for the case of electron-phonon calculations)
:vartype trans: BoolType | BoolKey
:ivar xq1: First component of the phonon wavevector, in units of 2pi/a0 (a0 = lattice parameter). Not used if ldisp=.true. or qplot=.true.
:vartype xq1: float | FloatKey
:ivar xq2: Second component of the phonon wavevector, in units of 2pi/a0 (a0 = lattice parameter). Not used if ldisp=.true. or qplot=.true.
:vartype xq2: float | FloatKey
:ivar xq3: Third component of the phonon wavevector, in units of 2pi/a0 (a0 = lattice parameter). Not used if ldisp=.true. or qplot=.true.
:vartype xq3: float | FloatKey
"""
def __post_init__(self):
self.asr: BoolType | BoolKey = BoolKey(name='asr', comment="Apply Acoustic Sum Rule to dynamical matrix, effective charges Works only in conjunction with 'gamma_gamma' tricks (see above)", default=False)
self.epsil: BoolType | BoolKey = BoolKey(name='epsil', comment='If .true. in a q=0 calculation for a non metal the macroscopic dielectric constant of the system is computed. Do not set epsil to .true. if you have a metallic system or q/=0: the code will complain and stop.', default=False)
self.k1: int | IntKey = IntKey(name='k1', comment='If specified, triggers a non-self-consistent calculation in `ph.x` with a separate Monkhorst-Pack k-point grid for phonons. This sets the k-point grid offset along the first reciprocal lattice vector for that grid.', default=0)
self.k2: int | IntKey = IntKey(name='k2', comment='If specified, triggers a non-self-consistent calculation in `ph.x` with a separate Monkhorst-Pack k-point grid for phonons. This sets the k-point grid offset along the second reciprocal lattice vector for that grid.', default=0)
self.k3: int | IntKey = IntKey(name='k3', comment='If specified, triggers a non-self-consistent calculation in `ph.x` with a separate Monkhorst-Pack k-point grid for phonons. This sets the k-point grid offset along the third reciprocal lattice vector for that grid.', default=0)
self.ldisp: BoolType | BoolKey = BoolKey(name='ldisp', comment='If True, phonon dispersion curves are calculated along specified high-symmetry lines in the Brillouin zone. Requires additional input defining the path.', default=False)
self.lraman: BoolType | BoolKey = BoolKey(name='lraman', comment='If .true. calculate non-resonant Raman coefficients using second-order response as in: M. Lazzeri and F. Mauri, PRL 90, 036401 (2003).', default=False)
self.nk1: int | IntKey = IntKey(name='nk1', comment='If specified, triggers a non-self-consistent calculation in `ph.x` with a separate Monkhorst-Pack k-point grid for phonons. This sets the number of k-points along the first reciprocal lattice vector for that grid.', default=0)
self.nk2: int | IntKey = IntKey(name='nk2', comment='If specified, triggers a non-self-consistent calculation in `ph.x` with a separate Monkhorst-Pack k-point grid for phonons. This sets the number of k-points along the second reciprocal lattice vector for that grid.', default=0)
self.nk3: int | IntKey = IntKey(name='nk3', comment='If specified, triggers a non-self-consistent calculation in `ph.x` with a separate Monkhorst-Pack k-point grid for phonons. This sets the number of k-points along the third reciprocal lattice vector for that grid.', default=0)
self.nq1: int | IntKey = IntKey(name='nq1', comment='Sets the number of q-points along the first reciprocal lattice vector for the Monkhorst-Pack q-point grid for phonons. Default 1. Notice that this default is different than in standard QE (default 0).', default=1)
self.nq2: int | IntKey = IntKey(name='nq2', comment='Sets the number of q-points along the second reciprocal lattice vector for the Monkhorst-Pack q-point grid for phonons. Default 1. Notice that this default is different than in standard QE (default 0).', default=1)
self.nq3: int | IntKey = IntKey(name='nq3', comment='Sets the number of q-points along the third reciprocal lattice vector for the Monkhorst-Pack q-point grid for phonons. Default 1. Notice that this default is different than in standard QE (default 0).', default=1)
self.search_sym: BoolType | BoolKey = BoolKey(name='search_sym', comment='Set it to .false. if you want to disable the mode symmetry analysis.', default=True)
self.tr2_ph: float | FloatKey = FloatKey(name='tr2_ph', comment='Threshold for self-consistency.', default=1e-12)
self.trans: BoolType | BoolKey = BoolKey(name='trans', comment='If .false. the phonons are not computed. If trans .and. epsil are both .true., the effective charges are calculated. If ldisp is .true., trans=.false. is overridden (except for the case of electron-phonon calculations)', default=True)
self.xq1: float | FloatKey = FloatKey(name='xq1', comment='First component of the phonon wavevector, in units of 2pi/a0 (a0 = lattice parameter). Not used if ldisp=.true. or qplot=.true.', default=0.0)
self.xq2: float | FloatKey = FloatKey(name='xq2', comment='Second component of the phonon wavevector, in units of 2pi/a0 (a0 = lattice parameter). Not used if ldisp=.true. or qplot=.true.', default=0.0)
self.xq3: float | FloatKey = FloatKey(name='xq3', comment='Third component of the phonon wavevector, in units of 2pi/a0 (a0 = lattice parameter). Not used if ldisp=.true. or qplot=.true.', default=0.0)
[docs] class _PP_X(FixedBlock):
r"""
This section configures the parameters for running the QE-utility ``pp.x`` (see https://www.quantum-espresso.org/Doc/INPUT_PP.html). This utility reads the output produced by ``pw.x``, extracts and calculates the desired quantity/quantities (rho, V, ...), and then writes the desired quantity to file in a suitable format for various types of plotting and various plotting programs. Only a few options are supported at the moment.
:ivar plot_num: Selects what to save in filplot. See ``pp.x`` documentation for more details.
:vartype plot_num: int | IntKey
"""
def __post_init__(self):
self.plot_num: int | IntKey = IntKey(name='plot_num', comment='Selects what to save in filplot. See ``pp.x`` documentation for more details.', default=-1)
[docs] class _PROJWFC_X(FixedBlock):
r"""
This section configures the parameters for running the QE-utility ``projwfc.x`` (see https://www.quantum-espresso.org/Doc/INPUT_PROJWFC.html). This utility projects wavefunctions onto orthogonalized atomic wavefunctions, calculates Lowdin charges, spilling parameter, projected DOS (separated into up and down components for LSDA).
:ivar DeltaE: Energy grid step.
:vartype DeltaE: float | FloatKey
:ivar Emax: Maximum energy for DOS plot. If unspecified, the upper band value, plus 3 times the value of the gaussian smearing if present, will be used.
:vartype Emax: float | FloatKey
:ivar Emin: Minimum energy for DOS plot. If unspecified, the lower band value, minus 3 times the value of the gaussian smearing if present, will be used.
:vartype Emin: float | FloatKey
:ivar degauss: Gaussian broadening. If not set, the default value is determined by the choice you make for ``DOS_X%bz_sum``, and it may also be influenced by related variables used in the previous 'pw.x' run. For more information, consult the original Quantum Espresso documentation at this link: https://www.quantum-espresso.org/Doc/INPUT_PROJWFC.html.
:vartype degauss: float | FloatKey
:ivar diag_basis: If False, the projections of Kohn-Sham states are done on the orthogonalized atomic orbitals in the global XYZ coordinate frame. If True, the projections of Kohn-Sham states are done on the orthogonalized atomic orbitals that are rotated to the basis in which the atomic occupation matrix is diagonal (i.e. local XYZ coordinate frame).
:vartype diag_basis: BoolType | BoolKey
:ivar lsym: If True, the projections are symmetrized, the partial density of states are computed. If False the projections are not symmetrized, the partial DOS can be computed only in the k-resolved case
:vartype lsym: BoolType | BoolKey
:ivar ngauss: Type of gaussian broadening: Available options are:
• SimpleGaussian.
• Methfessel-Paxton: Methfessel-Paxton of order 1.
• ColdSmearing: Marzari-Vanderbilt-DeVita-Payne.
• Fermi-Dirac: Fermi-Dirac function.
• Default: The default value is determined by the choices you make for ``DOS_X%bz_sum`` and ``DOS_X%degauss``, and it may also be influenced by related variables used in the previous 'pw.x' run. For more information, consult the original Quantum Espresso documentation at this link: https://www.quantum-espresso.org/Doc/INPUT_PROJWFC.html.
:vartype ngauss: Literal["0", "SimpleGaussian", "1", "Methfessel-Paxton", "-1", "ColdSmearing", "-99", "Fermi-Dirac", "Default"]
"""
def __post_init__(self):
self.DeltaE: float | FloatKey = FloatKey(name='DeltaE', comment='Energy grid step.', gui_name='Energy step:', default=0.1, unit='eV')
self.Emax: float | FloatKey = FloatKey(name='Emax', comment='Maximum energy for DOS plot. If unspecified, the upper band value, plus 3 times the value of the gaussian smearing if present, will be used.', unit='eV')
self.Emin: float | FloatKey = FloatKey(name='Emin', comment='Minimum energy for DOS plot. If unspecified, the lower band value, minus 3 times the value of the gaussian smearing if present, will be used.', unit='eV')
self.degauss: float | FloatKey = FloatKey(name='degauss', comment="Gaussian broadening. If not set, the default value is determined by the choice you make for ``DOS_X%bz_sum``, and it may also be influenced by related variables used in the previous 'pw.x' run. For more information, consult the original Quantum Espresso documentation at this link: https://www.quantum-espresso.org/Doc/INPUT_PROJWFC.html.", gui_name='Broadening width:', unit='Rydberg')
self.diag_basis: BoolType | BoolKey = BoolKey(name='diag_basis', comment='If False, the projections of Kohn-Sham states are done on the orthogonalized atomic orbitals in the global XYZ coordinate frame. If True, the projections of Kohn-Sham states are done on the orthogonalized atomic orbitals that are rotated to the basis in which the atomic occupation matrix is diagonal (i.e. local XYZ coordinate frame).', default=False)
self.lsym: BoolType | BoolKey = BoolKey(name='lsym', comment='If True, the projections are symmetrized, the partial density of states are computed. If False the projections are not symmetrized, the partial DOS can be computed only in the k-resolved case', default=True)
self.ngauss: Literal["0", "SimpleGaussian", "1", "Methfessel-Paxton", "-1", "ColdSmearing", "-99", "Fermi-Dirac", "Default"] = MultipleChoiceKey(name='ngauss', comment="Type of gaussian broadening: Available options are:\n\n• SimpleGaussian.\n\n• Methfessel-Paxton: Methfessel-Paxton of order 1.\n\n• ColdSmearing: Marzari-Vanderbilt-DeVita-Payne.\n\n• Fermi-Dirac: Fermi-Dirac function.\n\n• Default: The default value is determined by the choices you make for ``DOS_X%bz_sum`` and ``DOS_X%degauss``, and it may also be influenced by related variables used in the previous 'pw.x' run. For more information, consult the original Quantum Espresso documentation at this link: https://www.quantum-espresso.org/Doc/INPUT_PROJWFC.html.", gui_name='Broadening type:', default='Default', choices=['0', 'SimpleGaussian', '1', 'Methfessel-Paxton', '-1', 'ColdSmearing', '-99', 'Fermi-Dirac', 'Default'], hiddenchoices=['0', '1', '-1', '-99'])
[docs] class _Phonons(FixedBlock):
r"""
This section configures the parameters for calculating the Phonon Structure. This involves utilizing the following utilities:
• ``kpath``: This AMS tool generates an automated high-symmetry k-path in the Brillouin zone.
• ``ph.x``: This utility from Quantum ESPRESSO (QE) calculates phonon frequencies and eigenvectors at specified q-points (wavevectors) using Density Functional Perturbation Theory (DFPT). For more details see https://www.quantum-espresso.org/Doc/INPUT_PH.html
• ``q2r.x``: This QE utility transforms the dynamical matrix from reciprocal space (q-space) to real space (r-space). This is necessary for further post-processing steps. For more details see https://www.quantum-espresso.org/Doc/INPUT_Q2R.html.
• ``matdyn.x``: This QE utility calculates various phonon-related properties from the real-space dynamical matrix, such as phonon dispersion curves, density of states (DOS), thermodynamic properties, and more. For more details see https://www.quantum-espresso.org/Doc/INPUT_MATDYN.html.
:ivar MaxTemperature: Maximum temperature for the thermodynamic properties calculation (Internal Energy, Free Energy, Specific Heat, and Entropy). This value sets the upper limit of the temperature range considered. It is used in conjunction with ``NTemperatures`` to define the temperature grid. The calculation of thermodynamic properties is performed only if the phonon density of states (DOS) is requested (i.e., ``Phonons%DOS`` is set to ``Yes``).
:vartype MaxTemperature: float | FloatKey
:ivar NTemperatures: Number of temperature points to use in the thermodynamic properties calculation (Internal Energy, Free Energy, Specific Heat, and Entropy). This value, along with ``MaxTemperature``, determines the density of the temperature grid. The temperatures will be distributed evenly between 0 Kelvin and 'MaxTemperature'. The calculation of thermodynamic properties is performed only if the phonon density of states (DOS) is requested (i.e., ``Phonons%DOS`` is set to ``Yes``).
:vartype NTemperatures: int | IntKey
:ivar asr: Determines the acoustic sum rule (ASR) treatment. It has three options:
* 'simple': Applies a simplified ASR where the frequencies of the three acoustic modes at q=0 are forced to be zero.
* 'crystal': Applies the ASR considering the crystal symmetry to impose constraints on the frequencies at q=0.
* 'no': Does not enforce any ASR. It overwrites ``PH_X%asr`` (setting it to .TRUE. if asr is not 'no'), ``Q2R_X%zasr``, and ``MATDYN_X%asr``. Notice that the default value is different than in standard QE (default 'simple').
:vartype asr: Literal["simple", "crystal", "no"]
:ivar k1: If specified, triggers a non-self-consistent calculation in `ph.x` with a separate Monkhorst-Pack k-point grid for phonons. This sets the k-point grid offset along the first reciprocal lattice vector for that grid.
:vartype k1: int | IntKey
:ivar k2: If specified, triggers a non-self-consistent calculation in `ph.x` with a separate Monkhorst-Pack k-point grid for phonons. This sets the k-point grid offset along the second reciprocal lattice vector for that grid.
:vartype k2: int | IntKey
:ivar k3: If specified, triggers a non-self-consistent calculation in `ph.x` with a separate Monkhorst-Pack k-point grid for phonons. This sets the k-point grid offset along the third reciprocal lattice vector for that grid.
:vartype k3: int | IntKey
:ivar nk1: If specified, triggers a non-self-consistent calculation in `ph.x` with a separate Monkhorst-Pack k-point grid for phonons. This sets the number of k-points along the first reciprocal lattice vector for that grid.
:vartype nk1: int | IntKey
:ivar nk2: If specified, triggers a non-self-consistent calculation in `ph.x` with a separate Monkhorst-Pack k-point grid for phonons. This sets the number of k-points along the second reciprocal lattice vector for that grid.
:vartype nk2: int | IntKey
:ivar nk3: If specified, triggers a non-self-consistent calculation in `ph.x` with a separate Monkhorst-Pack k-point grid for phonons. This sets the number of k-points along the third reciprocal lattice vector for that grid.
:vartype nk3: int | IntKey
:ivar nq1: Sets the number of q-points along the first reciprocal lattice vector for the Monkhorst-Pack q-point grid for phonons. Default 1. Notice that this default is different than in standard QE (default 0).
:vartype nq1: int | IntKey
:ivar nq2: Sets the number of q-points along the second reciprocal lattice vector for the Monkhorst-Pack q-point grid for phonons. Default 1. Notice that this default is different than in standard QE (default 0).
:vartype nq2: int | IntKey
:ivar nq3: Sets the number of q-points along the third reciprocal lattice vector for the Monkhorst-Pack q-point grid for phonons. Default 1. Notice that this default is different than in standard QE (default 0).
:vartype nq3: int | IntKey
:ivar BandStructure: This section configures the parameters for calculating the Phonons Band Structure.
:vartype BandStructure: QuantumESPRESSO._Phonons._BandStructure
:ivar DOS: Configures the parameters for calculating the Phonons DOS.
:vartype DOS: QuantumESPRESSO._Phonons._DOS
:ivar K_Points: When these block is specified the phonon program (``ph.x``) runs a pw non-self consistent calculation with a different k-point grid thant that used for the charge density. The only available header values are ``automatic`` or ``gamma``. See the examples and QE documentation for details. This parameter is equivalent to ``nk1, nk2, nk3, k1, k2, k3`` in the QE tool ``ph.x``. If omitted, ``ph.x`` will use the same k-point grid used in the main QE calculation.
:vartype K_Points: str | Sequence[str] | FreeBlock
:ivar Q_Points: Defines the Monkhorst-Pack grid (no offset) for sampling the Brillouin zone in the phonon calculation. The grid determines the density of q-points at which phonon frequencies will be calculated. It is used when DOS or BandStructure phonon properties are requested. The only available header values are ``automatic`` or ``gamma``. See the examples and QE documentation for details. This parameter is equivalent to ``nq1, nq2, nq3`` in the QE tool ``ph.x``. If omitted, only ``gamma`` (``1 1 1 0 0 0``) is used.
:vartype Q_Points: str | Sequence[str] | FreeBlock
"""
[docs] class _BandStructure(FixedBlock):
r"""
This section configures the parameters for calculating the Phonons Band Structure.
:ivar KPathFinderConvention: This option determines how the path through the Brillouin zone is generated when using the automatic k-point mode.
Available options:
• ``Setyawan-Curtarolo`` (default for 1D and 2D lattices): Uses our built-in KPath program to find a path through high-symmetry points based on the method by Setyawan and Curtarolo (https://doi.org/10.1016/j.commatsci.2010.05.010). For 2D lattices, the path is derived from the intersection of the 3D Brillouin zone with a plane. For 1D lattices, the path is simply ``GAMMA-Z``.
• ``Hinuma``: Uses the external SeeKPath utility to generate the k-path (https://github.com/giovannipizzi/seekpath and https://doi.org/10.1016/j.commatsci.2016.10.015).
:vartype KPathFinderConvention: Literal["Setyawan-Curtarolo", "Hinuma"]
:ivar Q_PointsLabels: You can provide labels for your q-points, like ``L-GAMMA-X-U-GAMMA``, separating each label with a hyphen (-) or a vertical bar (|). For example, ``L-GAMMA-X-U-GAMMA`` and ``L|GAMMA|X|U|GAMMA`` are both valid. These labels are optional and only used for display purposes when the ``Q_Points`` block is specified. This option is used only if the header of the ``Q_Points`` block is not ``ams_kpath``. **Important:** These labels do not determine the actual k-point coordinates. You must specify the q-point coordinates separately within the ``Q_Points`` section.
:vartype Q_PointsLabels: str | StringKey
:ivar Q_PointsStep: This option is used only if the header of the ``Phonons%BandStructure%Q_Points`` block is ``ams_kpath``.
:vartype Q_PointsStep: float | FloatKey
:ivar UseSymmetry: If set, only the irreducible wedge of the Wigner-Seitz cell is sampled. If not, the whole (inversion-unique) Wigner-Seitz cell is sampled. Only available for Setyawan and Curtarolo convention (see ``KPathFinderConvention``).
:vartype UseSymmetry: BoolType | BoolKey
:ivar Q_Points: Specify the q-points to use. Available header values are: ``crystal_b``, and ``ams_kpath``. See the examples and QE documentation for details. If omitted, ``ams_kpath`` is used.
:vartype Q_Points: str | Sequence[str] | FreeBlock
"""
[docs] class _Q_Points(FreeBlock):
r"""
Specify the q-points to use. Available header values are: ``crystal_b``, and ``ams_kpath``. See the examples and QE documentation for details. If omitted, ``ams_kpath`` is used.
"""
def __post_init__(self):
pass
def __post_init__(self):
self.KPathFinderConvention: Literal["Setyawan-Curtarolo", "Hinuma"] = MultipleChoiceKey(name='KPathFinderConvention', comment='This option determines how the path through the Brillouin zone is generated when using the automatic k-point mode.\n\nAvailable options:\n\n• ``Setyawan-Curtarolo`` (default for 1D and 2D lattices): Uses our built-in KPath program to find a path through high-symmetry points based on the method by Setyawan and Curtarolo (https://doi.org/10.1016/j.commatsci.2010.05.010). For 2D lattices, the path is derived from the intersection of the 3D Brillouin zone with a plane. For 1D lattices, the path is simply ``GAMMA-Z``.\n\n• ``Hinuma``: Uses the external SeeKPath utility to generate the k-path (https://github.com/giovannipizzi/seekpath and https://doi.org/10.1016/j.commatsci.2016.10.015).', default='Setyawan-Curtarolo', choices=['Setyawan-Curtarolo', 'Hinuma'])
self.Q_PointsLabels: str | StringKey = StringKey(name='Q_PointsLabels', comment='You can provide labels for your q-points, like ``L-GAMMA-X-U-GAMMA``, separating each label with a hyphen (-) or a vertical bar (|). For example, ``L-GAMMA-X-U-GAMMA`` and ``L|GAMMA|X|U|GAMMA`` are both valid. These labels are optional and only used for display purposes when the ``Q_Points`` block is specified. This option is used only if the header of the ``Q_Points`` block is not ``ams_kpath``. **Important:** These labels do not determine the actual k-point coordinates. You must specify the q-point coordinates separately within the ``Q_Points`` section.')
self.Q_PointsStep: float | FloatKey = FloatKey(name='Q_PointsStep', comment='This option is used only if the header of the ``Phonons%BandStructure%Q_Points`` block is ``ams_kpath``.', default=0.05, unit='1/Bohr')
self.UseSymmetry: BoolType | BoolKey = BoolKey(name='UseSymmetry', comment='If set, only the irreducible wedge of the Wigner-Seitz cell is sampled. If not, the whole (inversion-unique) Wigner-Seitz cell is sampled. Only available for Setyawan and Curtarolo convention (see ``KPathFinderConvention``).', default=True)
self.Q_Points: str | Sequence[str] | FreeBlock = self._Q_Points(name='Q_Points', comment='Specify the q-points to use. Available header values are: ``crystal_b``, and ``ams_kpath``. See the examples and QE documentation for details. If omitted, ``ams_kpath`` is used.', header=True)
[docs] class _DOS(FixedBlock):
r"""
Configures the parameters for calculating the Phonons DOS.
:ivar degauss: DOS broadening in cm-1. Default: 0 - meaning use tetrahedra. It overwrites ``MATDYN_X%degauss``.
:vartype degauss: float | FloatKey
:ivar deltaE: Energy step, in cm-1, for DOS calculation: from min to max phonon energy (default: 1 cm-1). It overwrites ``MATDYN_X%deltaE``.
:vartype deltaE: float | FloatKey
:ivar nq1: Uniform q-point grid for DOS calculation (includes q=0). First direction. It overwrites ``MATDYN_X%nk1``.
:vartype nq1: int | IntKey
:ivar nq2: Uniform q-point grid for DOS calculation (includes q=0). Second direction. It overwrites ``MATDYN_X%nk2``.
:vartype nq2: int | IntKey
:ivar nq3: Uniform q-point grid for DOS calculation (includes q=0). Third direction. It overwrites ``MATDYN_X%nk3``.
:vartype nq3: int | IntKey
:ivar Q_Points: Specify the q-points to use. Only the header ``automatic`` is allowed. This option is added for consistency, it is equivalent to set ``nq1``, ``nq2``, and ``nq3`` independently.
:vartype Q_Points: str | Sequence[str] | FreeBlock
"""
[docs] class _Q_Points(FreeBlock):
r"""
Specify the q-points to use. Only the header ``automatic`` is allowed. This option is added for consistency, it is equivalent to set ``nq1``, ``nq2``, and ``nq3`` independently.
"""
def __post_init__(self):
pass
def __post_init__(self):
self.degauss: float | FloatKey = FloatKey(name='degauss', comment='DOS broadening in cm-1. Default: 0 - meaning use tetrahedra. It overwrites ``MATDYN_X%degauss``.', gui_name='Broadening width:', default=0.0)
self.deltaE: float | FloatKey = FloatKey(name='deltaE', comment='Energy step, in cm-1, for DOS calculation: from min to max phonon energy (default: 1 cm-1). It overwrites ``MATDYN_X%deltaE``.', gui_name='Energy step:', default=1.0)
self.nq1: int | IntKey = IntKey(name='nq1', comment='Uniform q-point grid for DOS calculation (includes q=0). First direction. It overwrites ``MATDYN_X%nk1``.', default=6)
self.nq2: int | IntKey = IntKey(name='nq2', comment='Uniform q-point grid for DOS calculation (includes q=0). Second direction. It overwrites ``MATDYN_X%nk2``.', default=6)
self.nq3: int | IntKey = IntKey(name='nq3', comment='Uniform q-point grid for DOS calculation (includes q=0). Third direction. It overwrites ``MATDYN_X%nk3``.', default=6)
self.Q_Points: str | Sequence[str] | FreeBlock = self._Q_Points(name='Q_Points', comment='Specify the q-points to use. Only the header ``automatic`` is allowed. This option is added for consistency, it is equivalent to set ``nq1``, ``nq2``, and ``nq3`` independently.', header=True)
[docs] class _K_Points(FreeBlock):
r"""
When these block is specified the phonon program (``ph.x``) runs a pw non-self consistent calculation with a different k-point grid thant that used for the charge density. The only available header values are ``automatic`` or ``gamma``. See the examples and QE documentation for details. This parameter is equivalent to ``nk1, nk2, nk3, k1, k2, k3`` in the QE tool ``ph.x``. If omitted, ``ph.x`` will use the same k-point grid used in the main QE calculation.
"""
def __post_init__(self):
pass
[docs] class _Q_Points(FreeBlock):
r"""
Defines the Monkhorst-Pack grid (no offset) for sampling the Brillouin zone in the phonon calculation. The grid determines the density of q-points at which phonon frequencies will be calculated. It is used when DOS or BandStructure phonon properties are requested. The only available header values are ``automatic`` or ``gamma``. See the examples and QE documentation for details. This parameter is equivalent to ``nq1, nq2, nq3`` in the QE tool ``ph.x``. If omitted, only ``gamma`` (``1 1 1 0 0 0``) is used.
"""
def __post_init__(self):
pass
def __post_init__(self):
self.MaxTemperature: float | FloatKey = FloatKey(name='MaxTemperature', comment='Maximum temperature for the thermodynamic properties calculation (Internal Energy, Free Energy, Specific Heat, and Entropy). This value sets the upper limit of the temperature range considered. It is used in conjunction with ``NTemperatures`` to define the temperature grid. The calculation of thermodynamic properties is performed only if the phonon density of states (DOS) is requested (i.e., ``Phonons%DOS`` is set to ``Yes``).', hidden=True, default=1000.0, unit='Kelvin')
self.NTemperatures: int | IntKey = IntKey(name='NTemperatures', comment="Number of temperature points to use in the thermodynamic properties calculation (Internal Energy, Free Energy, Specific Heat, and Entropy). This value, along with ``MaxTemperature``, determines the density of the temperature grid. The temperatures will be distributed evenly between 0 Kelvin and 'MaxTemperature'. The calculation of thermodynamic properties is performed only if the phonon density of states (DOS) is requested (i.e., ``Phonons%DOS`` is set to ``Yes``).", hidden=True, default=1000)
self.asr: Literal["simple", "crystal", "no"] = MultipleChoiceKey(name='asr', comment="Determines the acoustic sum rule (ASR) treatment. It has three options:\n* 'simple': Applies a simplified ASR where the frequencies of the three acoustic modes at q=0 are forced to be zero.\n* 'crystal': Applies the ASR considering the crystal symmetry to impose constraints on the frequencies at q=0.\n* 'no': Does not enforce any ASR. It overwrites ``PH_X%asr`` (setting it to .TRUE. if asr is not 'no'), ``Q2R_X%zasr``, and ``MATDYN_X%asr``. Notice that the default value is different than in standard QE (default 'simple').", gui_name='Acoustic sum rule:', default='simple', choices=['simple', 'crystal', 'no'])
self.k1: int | IntKey = IntKey(name='k1', comment='If specified, triggers a non-self-consistent calculation in `ph.x` with a separate Monkhorst-Pack k-point grid for phonons. This sets the k-point grid offset along the first reciprocal lattice vector for that grid.', default=0)
self.k2: int | IntKey = IntKey(name='k2', comment='If specified, triggers a non-self-consistent calculation in `ph.x` with a separate Monkhorst-Pack k-point grid for phonons. This sets the k-point grid offset along the second reciprocal lattice vector for that grid.', default=0)
self.k3: int | IntKey = IntKey(name='k3', comment='If specified, triggers a non-self-consistent calculation in `ph.x` with a separate Monkhorst-Pack k-point grid for phonons. This sets the k-point grid offset along the third reciprocal lattice vector for that grid.', default=0)
self.nk1: int | IntKey = IntKey(name='nk1', comment='If specified, triggers a non-self-consistent calculation in `ph.x` with a separate Monkhorst-Pack k-point grid for phonons. This sets the number of k-points along the first reciprocal lattice vector for that grid.', default=0)
self.nk2: int | IntKey = IntKey(name='nk2', comment='If specified, triggers a non-self-consistent calculation in `ph.x` with a separate Monkhorst-Pack k-point grid for phonons. This sets the number of k-points along the second reciprocal lattice vector for that grid.', default=0)
self.nk3: int | IntKey = IntKey(name='nk3', comment='If specified, triggers a non-self-consistent calculation in `ph.x` with a separate Monkhorst-Pack k-point grid for phonons. This sets the number of k-points along the third reciprocal lattice vector for that grid.', default=0)
self.nq1: int | IntKey = IntKey(name='nq1', comment='Sets the number of q-points along the first reciprocal lattice vector for the Monkhorst-Pack q-point grid for phonons. Default 1. Notice that this default is different than in standard QE (default 0).', default=1)
self.nq2: int | IntKey = IntKey(name='nq2', comment='Sets the number of q-points along the second reciprocal lattice vector for the Monkhorst-Pack q-point grid for phonons. Default 1. Notice that this default is different than in standard QE (default 0).', default=1)
self.nq3: int | IntKey = IntKey(name='nq3', comment='Sets the number of q-points along the third reciprocal lattice vector for the Monkhorst-Pack q-point grid for phonons. Default 1. Notice that this default is different than in standard QE (default 0).', default=1)
self.BandStructure: QuantumESPRESSO._Phonons._BandStructure = self._BandStructure(name='BandStructure', comment='This section configures the parameters for calculating the Phonons Band Structure.')
self.DOS: QuantumESPRESSO._Phonons._DOS = self._DOS(name='DOS', comment='Configures the parameters for calculating the Phonons DOS.')
self.K_Points: str | Sequence[str] | FreeBlock = self._K_Points(name='K_Points', comment='When these block is specified the phonon program (``ph.x``) runs a pw non-self consistent calculation with a different k-point grid thant that used for the charge density. The only available header values are ``automatic`` or ``gamma``. See the examples and QE documentation for details. This parameter is equivalent to ``nk1, nk2, nk3, k1, k2, k3`` in the QE tool ``ph.x``. If omitted, ``ph.x`` will use the same k-point grid used in the main QE calculation.', header=True)
self.Q_Points: str | Sequence[str] | FreeBlock = self._Q_Points(name='Q_Points', comment='Defines the Monkhorst-Pack grid (no offset) for sampling the Brillouin zone in the phonon calculation. The grid determines the density of q-points at which phonon frequencies will be calculated. It is used when DOS or BandStructure phonon properties are requested. The only available header values are ``automatic`` or ``gamma``. See the examples and QE documentation for details. This parameter is equivalent to ``nq1, nq2, nq3`` in the QE tool ``ph.x``. If omitted, only ``gamma`` (``1 1 1 0 0 0``) is used.', header=True)
[docs] class _Properties(FixedBlock):
r"""
Configures which QE level properties to calculate for SinglePoint calculations or other important geometries (e.g. at the end of an optimization).
:ivar BandStructure: If true, the band structure is calculated and saved for visualization. To configure the parameters of the calculation, please modify the options in the the section 'BandStructure'.
:vartype BandStructure: BoolType | BoolKey
:ivar DOS: If true, the Density-Of-States (DOS) is calculated and saved for visualization. To configure the parameters of the calculation, please modify the options in the the section 'DOS'.
:vartype DOS: BoolType | BoolKey
:ivar ForceStopAfterError: If set to true, and a Quantum Espresso property calculation fails, the entire job will stop, preventing any subsequent property calculations from running. If set to false (default), other property calculations will proceed even if one fails.
:vartype ForceStopAfterError: BoolType | BoolKey
:ivar WorkFunction: If true, the work function is calculated and saved for visualization. To configure the parameters of the calculation, please modify the options in the the section 'WorkFunction'.
:vartype WorkFunction: BoolType | BoolKey
"""
def __post_init__(self):
self.BandStructure: BoolType | BoolKey = BoolKey(name='BandStructure', comment="If true, the band structure is calculated and saved for visualization. To configure the parameters of the calculation, please modify the options in the the section 'BandStructure'.", gui_name='Calculate band structure:', default=False)
self.DOS: BoolType | BoolKey = BoolKey(name='DOS', comment="If true, the Density-Of-States (DOS) is calculated and saved for visualization. To configure the parameters of the calculation, please modify the options in the the section 'DOS'.", gui_name='Calculate DOS:', default=False)
self.ForceStopAfterError: BoolType | BoolKey = BoolKey(name='ForceStopAfterError', comment='If set to true, and a Quantum Espresso property calculation fails, the entire job will stop, preventing any subsequent property calculations from running. If set to false (default), other property calculations will proceed even if one fails.', default=False)
self.WorkFunction: BoolType | BoolKey = BoolKey(name='WorkFunction', comment="If true, the work function is calculated and saved for visualization. To configure the parameters of the calculation, please modify the options in the the section 'WorkFunction'.", gui_name='Calculate work function:', default=False)
[docs] class _Pseudopotentials(FixedBlock):
r"""
Selects the pseudopotential to use for the atomic species.
:ivar Database: Specifies the file name of the pseudopotential database located in $AMSRESOURCES/QE
:vartype Database: str | StringKey
:ivar Directory: This key is mutually exclusive with the ``Family`` and ``Files`` keywords. This key specifies a directory containing label.upf files.
Example:
.. code-block:: text
System
Atoms
H 0 0 0
H 0 0 1 QE.Label=H1
H 0 0 2 QE.Label=H2
C 0 0 3 QE.Label=C1
End
End
This will look for the files H.upf, H1.upf, H2.upf, C1.upf. If H1.upf does not exist, H.upf will be used. If H2.upf does not exist, H.upf will be used. If C1.upf does not exist, C.upf will be used.
:vartype Directory: str | Path | StringKey
:ivar Family: The pseudopotential family to use. Mutually exclusive with the ``Files`` and ``Directory`` keywords.
:vartype Family: Literal["Dojo", "GBRV", "pslibrary-PAW", "pslibrary-US", "SG15", "SSSP-Efficiency", "SSSP-Precision"]
:ivar FullyRelativistic: Whether to use fully relativistic pseudopotentials (required for spin-orbit calculations).
:vartype FullyRelativistic: BoolType | BoolKey
:ivar Functional: Exchange-correlation functional that was used to generate the pseudopotential. Not all choices are valid for all pseudopotential families.
This functional will also be used for the calculation, unless the ``input_dft`` option is set.
:vartype Functional: Literal["BLYP", "LDA", "PBE", "PBEsol", "PW91"]
:ivar Version: Version number for pseudopotentials. Currently, must be set to 'auto'.
:vartype Version: str | StringKey
:ivar Files: Selects the pseudopotentials to use for each atomic species. This key is mutually exclusive with the ``Family`` and ``Directory`` keywords.
:vartype Files: QuantumESPRESSO._Pseudopotentials._Files
"""
[docs] class _Files(FixedBlock):
r"""
Selects the pseudopotentials to use for each atomic species. This key is mutually exclusive with the ``Family`` and ``Directory`` keywords.
:ivar Label: Label for an atom corresponding to the QE.Label, or to the element symbol if QE.Label is not set.
:vartype Label: str | StringKey
:ivar Path: Path to a .upf file to use as pseudopotential. Relative paths are relative to root of the pseudopotential library shipped with AMS. Prefix a path with './' to make it relative to the starting directory of your job.
:vartype Path: str | Path | StringKey
"""
def __post_init__(self):
self.Label: str | StringKey = StringKey(name='Label', comment='Label for an atom corresponding to the QE.Label, or to the element symbol if QE.Label is not set.')
self.Path: str | Path | StringKey = PathStringKey(name='Path', comment="Path to a .upf file to use as pseudopotential. Relative paths are relative to root of the pseudopotential library shipped with AMS. Prefix a path with './' to make it relative to the starting directory of your job.", ispath=True)
def __post_init__(self):
self.Database: str | StringKey = StringKey(name='Database', comment='Specifies the file name of the pseudopotential database located in $AMSRESOURCES/QE', hidden=True, default='PPLib.db')
self.Directory: str | Path | StringKey = PathStringKey(name='Directory', comment='This key is mutually exclusive with the ``Family`` and ``Files`` keywords. This key specifies a directory containing label.upf files.\n\nExample:\n\n.. code-block:: text\n\n System\n Atoms\n H 0 0 0\n H 0 0 1 QE.Label=H1\n H 0 0 2 QE.Label=H2\n C 0 0 3 QE.Label=C1\n End\n End\n\nThis will look for the files H.upf, H1.upf, H2.upf, C1.upf. If H1.upf does not exist, H.upf will be used. If H2.upf does not exist, H.upf will be used. If C1.upf does not exist, C.upf will be used.', ispath=True, gui_type='directory')
self.Family: Literal["Dojo", "GBRV", "pslibrary-PAW", "pslibrary-US", "SG15", "SSSP-Efficiency", "SSSP-Precision"] = MultipleChoiceKey(name='Family', comment='The pseudopotential family to use. Mutually exclusive with the ``Files`` and ``Directory`` keywords.', gui_name='Pseudopotential family:', default='SSSP-Efficiency', choices=['Dojo', 'GBRV', 'pslibrary-PAW', 'pslibrary-US', 'SG15', 'SSSP-Efficiency', 'SSSP-Precision'], gui_type='postcommmand QE::PPPostCommand qe.pseudopotentials.family')
self.FullyRelativistic: BoolType | BoolKey = BoolKey(name='FullyRelativistic', comment='Whether to use fully relativistic pseudopotentials (required for spin-orbit calculations).', gui_name='Pseudopotential fully relativistic:', default=False)
self.Functional: Literal["BLYP", "LDA", "PBE", "PBEsol", "PW91"] = MultipleChoiceKey(name='Functional', comment='Exchange-correlation functional that was used to generate the pseudopotential. Not all choices are valid for all pseudopotential families.\n\nThis functional will also be used for the calculation, unless the ``input_dft`` option is set.', gui_name='Pseudopotential functional:', default='PBE', choices=['BLYP', 'LDA', 'PBE', 'PBEsol', 'PW91'], gui_type='postcommmand QE::PPPostCommand qe.pseudopotentials.functional')
self.Version: str | StringKey = StringKey(name='Version', comment="Version number for pseudopotentials. Currently, must be set to 'auto'.", hidden=True, gui_name='Version:', default='auto')
self.Files: QuantumESPRESSO._Pseudopotentials._Files = self._Files(name='Files', comment='Selects the pseudopotentials to use for each atomic species. This key is mutually exclusive with the ``Family`` and ``Directory`` keywords.', unique=False)
[docs] class _Q2R_X(FixedBlock):
r"""
This section configures the parameters for running the QE utility `q2r.x` (see https://www.quantum-espresso.org/Doc/INPUT_Q2R.html). This utility is used to transform the interatomic force constants (IFC) calculated in reciprocal space (q-space) by `ph.x` into real space (r-space). The real-space IFCs are then used as input for the `matdyn.x` utility to calculate various phonon-related properties.
:ivar loto_2d: Set to .true. to activate two-dimensional treatment of LO-TO splitting
:vartype loto_2d: BoolType | BoolKey
:ivar zasr: Determines the acoustic sum rule (ASR) treatment. It has three options:
* 'simple': Applies a simplified ASR where the frequencies of the three acoustic modes at q=0 are forced to be zero.
* 'crystal': Applies the ASR considering the crystal symmetry to impose constraints on the frequencies at q=0.
* 'no': Does not enforce any ASR.
:vartype zasr: Literal["simple", "crystal", "no"]
"""
def __post_init__(self):
self.loto_2d: BoolType | BoolKey = BoolKey(name='loto_2d', comment='Set to .true. to activate two-dimensional treatment of LO-TO splitting', default=False)
self.zasr: Literal["simple", "crystal", "no"] = MultipleChoiceKey(name='zasr', comment="Determines the acoustic sum rule (ASR) treatment. It has three options:\n* 'simple': Applies a simplified ASR where the frequencies of the three acoustic modes at q=0 are forced to be zero.\n* 'crystal': Applies the ASR considering the crystal symmetry to impose constraints on the frequencies at q=0.\n* 'no': Does not enforce any ASR.", default='no', choices=['simple', 'crystal', 'no'])
[docs] class _Restart(FixedBlock):
r"""
This section configures restarting a Quantum Espresso calculation from previous data. You can restart from a specific Quantum Espresso results file (e.g., `quantumespresso.rkf`), or by providing the directory and file prefix of the previous calculation. This is compatible with any stand-alone Quantum Espresso version.
:ivar Directory: The directory containing the restart files from a previous Quantum Espresso calculation. This typically includes the `prefix.save` directory with wavefunctions and other data. This option is used in conjunction with the `Prefix` option.
:vartype Directory: str | Path | StringKey
:ivar Path: Path to the Quantum Espresso results file (e.g., `quantumespresso.rkf`) to use to restart the calculation. When this option is used, the directory of the results file is used as the `Directory`, and the filename (without the `.rkf` extension) is used as the `Prefix`. This assumes all restart files (e.g., `prefix.save` directory) are in the same directory as the results file. This option is equivalent to the `EngineRestart` option.
:vartype Path: str | Path | StringKey
:ivar Prefix: The prefix used for the files in the previous calculation. This is usually the same as the 'prefix' specified in the input file of the original calculation. For example, if your files are named 'my_calc.save' and 'my_calc.restart_scf', the prefix would be 'my_calc'. This option is used in conjunction with the `Directory` option.
:vartype Prefix: str | StringKey
"""
def __post_init__(self):
self.Directory: str | Path | StringKey = PathStringKey(name='Directory', comment='The directory containing the restart files from a previous Quantum Espresso calculation. This typically includes the `prefix.save` directory with wavefunctions and other data. This option is used in conjunction with the `Prefix` option.', gui_name='Restart from directory:', default='', ispath=True)
self.Path: str | Path | StringKey = PathStringKey(name='Path', comment='Path to the Quantum Espresso results file (e.g., `quantumespresso.rkf`) to use to restart the calculation. When this option is used, the directory of the results file is used as the `Directory`, and the filename (without the `.rkf` extension) is used as the `Prefix`. This assumes all restart files (e.g., `prefix.save` directory) are in the same directory as the results file. This option is equivalent to the `EngineRestart` option.', gui_name='Restart from file:', ispath=True)
self.Prefix: str | StringKey = StringKey(name='Prefix', comment="The prefix used for the files in the previous calculation. This is usually the same as the 'prefix' specified in the input file of the original calculation. For example, if your files are named 'my_calc.save' and 'my_calc.restart_scf', the prefix would be 'my_calc'. This option is used in conjunction with the `Directory` option.", gui_name='Restart using prefix:', default='quantumespresso')
[docs] class _System(FixedBlock):
r"""
Keywords from the &SYSTEM namelist in the QuantumEspresso input file.
:ivar assume_isolated: Used to perform calculation assuming the system to be isolated (a molecule or a cluster in a 3D supercell).
Currently available choices:
• Auto: determines the used method based on the periodicity of the system in the AMS driver input. None for systems 3D periodicity, Martyna-Tuckerman for systems without a lattice.
• None: regular periodic calculation w/o any correction.
• Martyna-Tuckerman: correction to both total energy and scf potential. Adapted from: G.J. Martyna, and M.E. Tuckerman, A reciprocal space based method for treating long range interactions in ab-initio and force-field-based calculation in clusters, J. Chem. Phys. 110, 2810 (1999), [doi:10.1063/1.477923].
• ESM: Effective Screening Medium Method. For polarized or charged slab calculation, embeds the simulation cell within an effective semi-infinite medium in the perpendicular direction (along z). Embedding regions can be vacuum or semi-infinite metal electrodes (use esm_bc to choose boundary conditions). If between two electrodes, an optional electric field (esm_efield) may be applied. Method described in M. Otani and O. Sugino, 'First-principles calculations of charged surfaces and interfaces: A plane-wave nonrepeated slab approach', PRB 73, 115407 (2006).
• 2D: Truncation of the Coulomb interaction in the z direction for structures periodic in the x-y plane. Total energy, forces and stresses are computed in a two-dimensional framework. Linear-response calculations () done on top of a self-consistent calculation with this flag will automatically be performed in the 2D framework as well. Please refer to: Sohier, T., Calandra, M., & Mauri, F. (2017), 'Density functional perturbation theory for gated two-dimensional heterostructures: Theoretical developments and application to flexural phonons in graphene', PRB, 96, 075448 (2017).
:vartype assume_isolated: Literal["Auto", "None", "m-p", "mp", "Martyna-Tuckerman", "m-t", "mt", "ESM", "2D"]
:ivar degauss: Value of the gaussian spreading for Brillouin-zone integration in metals.
:vartype degauss: float | FloatKey
:ivar dftd3_threebody: Turn three-body terms in Grimme-D3 on.
If False two-body contributions only are computed, using two-body parameters of Grimme-D3.
If dftd3_version is set to ``2``, three-body contribution is always disabled.
:vartype dftd3_threebody: BoolType | BoolKey
:ivar dftd3_version: Version of Grimme implementation of Grimme-D3:
• 2: Original Grimme-D2 parametrization
• 3: Grimme-D3 (zero damping)
• 4: Grimme-D3 (BJ damping)
• 5: Grimme-D3M (zero damping)
• 6: Grimme-D3M (BJ damping)
• NOTE: not all functionals are parametrized.
:vartype dftd3_version: Literal["2", "3", "4", "5", "6"]
:ivar eamp: Amplitude of the electric field, in Hartree a.u. = = 51.4220632*10^10 V/m.
Used only if ``tefield`` is enabled.
The saw-like potential increases with slope ``eamp`` in the region from (``emaxpos`` + ``eopreg``- 1) to (``emaxpos``), then decreases to 0 until (``emaxpos`` + ``eopreg``), in units of the crystal vector edir.
Important: the change of slope of this potential must be located in the empty region, or else unphysical forces will result.
:vartype eamp: float | FloatKey
:ivar ecutfock: Kinetic energy cutoff for the exact exchange operator in EXX type calculations.
By default this is the same as ``ecutrho`` but in some EXX calculations, a significant speed-up can be obtained by reducing ecutfock, at the expense of some loss in accuracy.
Must be >= ``ecutwfc``.
Not implemented for stress calculation and for US-PP and PAW pseudopotentials.
Use with care, especially in metals where it may give raise to instabilities.
:vartype ecutfock: float | FloatKey
:ivar ecutrho: Kinetic energy cutoff for charge density and potential.
If this key is not specified and the ``Pseudopotential%Family`` recommends a ratio of ``ecutrho`` to ``ecutwfc``, this recommended ratio will be used.
If there is no recommended ratio, the default value is ``4 x ecutwfc``.
For norm-conserving pseudopotential you should stick to the default value, you can reduce it by a little but it will introduce noise especially on forces and stress.
If there are ultrasoft PP, a larger value than the default is often desirable (``ecutrho`` = 8 to 12 times ``ecutwfc``, typically).
PAW datasets can often be used at ``4 x ecutwfc``, but it depends on the shape of augmentation charge: testing is mandatory.
The use of gradient-corrected functional, especially in cells with vacuum, or for pseudopotential without non-linear core correction, usually requires an higher values of ``ecutrho`` to be accurately converged.
:vartype ecutrho: float | FloatKey
:ivar ecutvcut: Reciprocal space cutoff for correcting Coulomb potential divergencies at small q vectors.
:vartype ecutvcut: float | FloatKey
:ivar ecutwfc: Kinetic energy cutoff for wavefunctions.
:vartype ecutwfc: float | FloatKey
:ivar edir: ``1`` (or ``x``), 2 (or ``y``) or 3 (or ``z``). The direction of the electric field or dipole correction is parallel to the bg(:,edir) reciprocal lattice vector.
Thus the potential is constant in planes defined by FFT grid points.
Used only if ``tefield`` is enabled.
:vartype edir: Literal["1", "2", "3", "x", "y", "z"]
:ivar emaxpos: Position of the maximum of the saw-like potential along crystal axis ``edir``, within the unit cell, see also ``eopreg``.
0 < ``emaxpos`` < 1
Used only if ``tefield`` is enabled.
:vartype emaxpos: float | FloatKey
:ivar eopreg: Zone in the unit cell where the saw-like potential decreases, see also ``amp``.
Must be in range 0 < ``eopreg`` < 1.
Used only if ``tefield`` is enabled.
:vartype eopreg: float | FloatKey
:ivar exx_fraction: Fraction of EXX for hybrid functional calculations.
In the case of ``input_dft`` set to 'PBE0', the default value is 0.25, while for ``input_dft`` set to 'B3LYP' the ``exx_fraction`` default value is 0.20.
:vartype exx_fraction: float | FloatKey
:ivar exxdiv_treatment: Specific for EXX. It selects the kind of approach to be used for treating the Coulomb potential divergencies at small q vectors.
gygi-baldereschi: appropriate for cubic and quasi-cubic supercells
vcut_spherical: appropriate for cubic and quasi-cubic supercells
vcut_ws: appropriate for strongly anisotropic supercells, see also ecutvcut.
none: sets Coulomb potential at G,q=0 to 0.0 (required for GAU-PBE)
:vartype exxdiv_treatment: Literal["gygi-baldereschi", "vcut_spherical", "vcut_ws", "none"]
:ivar input_dft: Exchange-correlation functional. Some valid values are
• pbe
• blyp
• pbe0
• hse
• revpbe
• vdw-df-cx. See the documentation for more possible values.
Overrides the value read from pseudopotential files.
:vartype input_dft: str | StringKey
:ivar lspinorb: if .TRUE. the noncollinear code can use a pseudopotential with spin-orbit.
:vartype lspinorb: BoolType | BoolKey
:ivar nbnd: Number of electronic states (bands) to be calculated. Note that in spin-polarized calculations the number of k-point, not the number of bands per k-point, is doubled.
Default: For an insulator, nbnd = number of valence bands (nbnd = # of electrons /2); for a metal, 20% more (minimum 4 more)
:vartype nbnd: int | IntKey
:ivar noncolin: If True the program will perform a noncollinear calculation.
:vartype noncolin: BoolType | BoolKey
:ivar nosym: If True, symmetry is not used, and k points are forced to have the symmetry of the Bravais lattice; an automatically generated Monkhorst-Pack grid will contain all points of the grid over the entire Brillouin Zone, plus the points rotated by the symmetries of the Bravais lattice which were not in the original grid. The same applies if a k-point list is provided in input instead of a Monkhorst-Pack grid. Time reversal symmetry is assumed so k and -k are equivalent unless noinv=.true. is specified. This option differs from nosym because it forces k-points in all cases to have the full symmetry of the Bravais lattice (not all uniform grids have such property!)
:vartype nosym: BoolType | BoolKey
:ivar nqx1: Three-dimensional mesh for q (k1-k2) sampling of the Fock operator (EXX). Can be smaller than the number of k-points. Defaults to the size of the k-point mesh used.
:vartype nqx1: int | IntKey
:ivar nqx2: Three-dimensional mesh for q (k1-k2) sampling of the Fock operator (EXX). Can be smaller than the number of k-points. Defaults to the size of the k-point mesh used.
:vartype nqx2: int | IntKey
:ivar nqx3: Three-dimensional mesh for q (k1-k2) sampling of the Fock operator (EXX). Can be smaller than the number of k-points. Defaults to the size of the k-point mesh used.
:vartype nqx3: int | IntKey
:ivar nr1: Three-dimensional FFT mesh (hard grid) for charge density (and scf potential). If not specified the grid is calculated based on the cutoff for charge density (see also ``ecutrho``). Note: you must specify all three dimensions for this setting to be used (``nr1``, ``nr2``, ``nr3``).
:vartype nr1: int | IntKey
:ivar nr1s: Three-dimensional mesh for wavefunction FFT and for the smooth part of charge density ( smooth grid ). Coincides with ``nr1``, ``nr2``, ``nr3`` if ``ecutrho = 4 * ecutwfc`` ( default ). Note: you must specify all three dimensions for this setting to be used (``nr1s``, ``nr2s``, ``nr3s``).
:vartype nr1s: int | IntKey
:ivar nr2: Three-dimensional FFT mesh (hard grid) for charge density (and scf potential). If not specified the grid is calculated based on the cutoff for charge density (see also ``ecutrho``). Note: you must specify all three dimensions for this setting to be used (``nr1``, ``nr2``, ``nr3``).
:vartype nr2: int | IntKey
:ivar nr2s: Three-dimensional mesh for wavefunction FFT and for the smooth part of charge density ( smooth grid ). Coincides with ``nr1``, ``nr2``, ``nr3`` if ``ecutrho = 4 * ecutwfc`` ( default ). Note: you must specify all three dimensions for this setting to be used (``nr1s``, ``nr2s``, ``nr3s``).
:vartype nr2s: int | IntKey
:ivar nr3: Three-dimensional FFT mesh (hard grid) for charge density (and scf potential). If not specified the grid is calculated based on the cutoff for charge density (see also ``ecutrho``). Note: you must specify all three dimensions for this setting to be used (``nr1``, ``nr2``, ``nr3``).
:vartype nr3: int | IntKey
:ivar nr3s: Three-dimensional mesh for wavefunction FFT and for the smooth part of charge density ( smooth grid ). Coincides with ``nr1``, ``nr2``, ``nr3`` if ``ecutrho = 4 * ecutwfc`` ( default ). Note: you must specify all three dimensions for this setting to be used (``nr1s``, ``nr2s``, ``nr3s``).
:vartype nr3s: int | IntKey
:ivar nspin: Available options are:
• None: not spin-polarized
• Collinear: LSDA with magnetization along z-axis
• Non-Collinear: any magnetization (equivalent to setting the ``noncolin`` key to True)
:vartype nspin: Literal["1", "None", "2", "Collinear", "4", "Non-Collinear"]
:ivar occupations: Available options are:
• Smearing: gaussian smearing for metals; see keywords ``smearing`` and ``degauss``
• Tetrahedra: Tetrahedron method, Bloechl's version: P.E. Bloechl, PRB 49, 16223 (1994). Requires uniform grid of k-points, to be automatically generated (see ``block K_Points``). Well suited for calculation of DOS, less so (because not variational) for force/optimization/dynamics calculations.
• Tetrahedra_lin: Original linear tetrahedron method. To be used only as a reference; the optimized tetrahedron method is more efficient.
• Tetrahedra_opt: optimized tetrahedron method, see M. Kawamura, PRB 89, 094515 (2014). Can be used for phonon calculations as well.
• Fixed: for insulators with a gap.
:vartype occupations: Literal["Smearing", "Tetrahedra", "Tetrahedra_lin", "Tetrahedra_opt", "Fixed"]
:ivar screening_parameter: screening_parameter for HSE like hybrid functionals. For more information, see: J. Chem. Phys. 118, 8207 (2003), doi:10.1063/1.1564060 J. Chem. Phys. 124, 219906 (2006), doi:10.1063/1.2204597
:vartype screening_parameter: float | FloatKey
:ivar smearing: Available options are:
• Gaussian: ordinary Gaussian spreading
• Methfessel-Paxton: first-order spreading (see PRB 40, 3616 (1989))
• Marzari-Vanderbilt: cold smearing (see PRL 82, 3296 (1999))
• Fermi-Dirac: smearing with Fermi-Dirac function
:vartype smearing: Literal["Gaussian", "gauss", "Methfessel-Paxton", "m-p", "mp", "Marzari-Vanderbilt", "cold", "m-v", "mv", "Fermi-Dirac", "f-d", "fd"]
:ivar tot_magnetization: Total majority spin charge minus minority spin charge.
Used to impose a specific total electronic magnetization.
If unspecified then tot_magnetization variable is ignored and the amount of electronic magnetization is determined during the self-consistent cycle.
:vartype tot_magnetization: float | FloatKey
:ivar vdw_corr: Type of Van der Waals correction. Allowed values:
• Grimme-D2: Semiempirical Grimme's DFT-D2, see S. Grimme, J. Comp. Chem. 27, 1787 (2006) [doi:10.1002/jcc.20495], and V. Barone et al., J. Comp. Chem. 30, 934 (2009) [doi:10.1002/jcc.21112].
• Grimme-D3: Semiempirical Grimme's DFT-D3, see S. Grimme et al, J. Chem. Phys 132, 154104 (2010) [doi:10.1063/1.3382344].
• TS: Tkatchenko-Scheffler dispersion corrections with first-principle derived C6 coefficients, see A. Tkatchenko and M. Scheffler, PRL 102, 073005 (2009).
• MBD: Many-body dispersion (MBD) correction to long-range interactions, see A. Ambrosetti, A. M. Reilly, R. A. DiStasio, A. Tkatchenko, J. Chem. Phys. 140 18A508 (2014).
• XDM: Exchange-hole dipole-moment model, see A. D. Becke et al., J. Chem. Phys. 127, 154108 (2007) [doi:10.1063/1.2795701], and A. Otero de la Roza et al., J. Chem. Phys. 136, 174109 (2012) [doi:10.1063/1.4705760].
Note that non-local functionals (eg vdw-DF) are NOT specified here but using the ``input_dft`` keyword.
:vartype vdw_corr: Literal["None", "Grimme-D2", "DFT-D", "Grimme-D3", "DFT-D3", "TS", "ts-vdW", "tkatchenko-scheffler", "MBD", "many-body-dispersion", "mbd_vdw", "XDM"]
:ivar x_gamma_extrapolation: Specific for EXX. If .true., extrapolate the G=0 term of the potential (see README in examples/EXX_example for more) Set this to .false. for GAU-PBE.
:vartype x_gamma_extrapolation: BoolType | BoolKey
:ivar xdm_a1: Damping function parameter a1 (adimensional).
It is NOT necessary to give a value if the functional is one of B86bPBE, PW86PBE, PBE, BLYP. For functionals in this list, the coefficients are given in: http://schooner.chem.dal.ca/wiki/XDM; A. Otero de la Roza, E. R. Johnson, J. Chem. Phys. 138, 204109 (2013) [doi:10.1063/1.4705760]
:vartype xdm_a1: float | FloatKey
:ivar xdm_a2: Damping function parameter a2 (Angstrom).
It is NOT necessary to give a value if the functional is one of B86bPBE, PW86PBE, PBE, BLYP. For functionals in this list, the coefficients are given in: http://schooner.chem.dal.ca/wiki/XDM; A. Otero de la Roza, E. R. Johnson, J. Chem. Phys. 138, 204109 (2013) [doi:10.1063/1.4705760]
:vartype xdm_a2: float | FloatKey
:ivar starting_magnetization: Starting spin polarization for an atomic type in a spin polarized (LSDA or noncollinear/spin-orbit) calculation. Allowed values range between -1 (all spins down for the valence electrons of atom type 'i') to 1 (all spins up). If you expect a nonzero magnetization in your ground state, you MUST either specify a nonzero value for at least one atomic type, or constrain the magnetization using keyword ``tot_magnetization`` for LSDA, ``constrained_magnetization`` for noncollinear/spin-orbit calculations. If you don't, you will get a nonmagnetic (zero magnetization) state. In order to perform LSDA calculations for an antiferromagnetic state, define two different atomic species corresponding to sublattices of the same atomic type.
Note: If you fix the magnetization with ``tot_magnetization``, do not specify ``starting_magnetization``.
Note: In the noncollinear/spin-orbit case, starting with zero starting_magnetization on all atoms imposes time reversal symmetry. The magnetization is never calculated and is set to zero.
:vartype starting_magnetization: QuantumESPRESSO._System._starting_magnetization
"""
[docs] class _starting_magnetization(FixedBlock):
r"""
Starting spin polarization for an atomic type in a spin polarized (LSDA or noncollinear/spin-orbit) calculation. Allowed values range between -1 (all spins down for the valence electrons of atom type 'i') to 1 (all spins up). If you expect a nonzero magnetization in your ground state, you MUST either specify a nonzero value for at least one atomic type, or constrain the magnetization using keyword ``tot_magnetization`` for LSDA, ``constrained_magnetization`` for noncollinear/spin-orbit calculations. If you don't, you will get a nonmagnetic (zero magnetization) state. In order to perform LSDA calculations for an antiferromagnetic state, define two different atomic species corresponding to sublattices of the same atomic type.
Note: If you fix the magnetization with ``tot_magnetization``, do not specify ``starting_magnetization``.
Note: In the noncollinear/spin-orbit case, starting with zero starting_magnetization on all atoms imposes time reversal symmetry. The magnetization is never calculated and is set to zero.
:ivar Label: Label for an atom corresponding to the QE.Label, or to the element symbol if QE.Label is not set.
:vartype Label: str | StringKey
:ivar Value: Starting magnetization value.
:vartype Value: float | FloatKey
"""
def __post_init__(self):
self.Label: str | StringKey = StringKey(name='Label', comment='Label for an atom corresponding to the QE.Label, or to the element symbol if QE.Label is not set.')
self.Value: float | FloatKey = FloatKey(name='Value', comment='Starting magnetization value.')
def __post_init__(self):
self.assume_isolated: Literal["Auto", "None", "m-p", "mp", "Martyna-Tuckerman", "m-t", "mt", "ESM", "2D"] = MultipleChoiceKey(name='assume_isolated', comment="Used to perform calculation assuming the system to be isolated (a molecule or a cluster in a 3D supercell).\n\n Currently available choices:\n\n• Auto: determines the used method based on the periodicity of the system in the AMS driver input. None for systems 3D periodicity, Martyna-Tuckerman for systems without a lattice.\n\n• None: regular periodic calculation w/o any correction.\n\n• Martyna-Tuckerman: correction to both total energy and scf potential. Adapted from: G.J. Martyna, and M.E. Tuckerman, A reciprocal space based method for treating long range interactions in ab-initio and force-field-based calculation in clusters, J. Chem. Phys. 110, 2810 (1999), [doi:10.1063/1.477923].\n\n• ESM: Effective Screening Medium Method. For polarized or charged slab calculation, embeds the simulation cell within an effective semi-infinite medium in the perpendicular direction (along z). Embedding regions can be vacuum or semi-infinite metal electrodes (use esm_bc to choose boundary conditions). If between two electrodes, an optional electric field (esm_efield) may be applied. Method described in M. Otani and O. Sugino, 'First-principles calculations of charged surfaces and interfaces: A plane-wave nonrepeated slab approach', PRB 73, 115407 (2006).\n\n• 2D: Truncation of the Coulomb interaction in the z direction for structures periodic in the x-y plane. Total energy, forces and stresses are computed in a two-dimensional framework. Linear-response calculations () done on top of a self-consistent calculation with this flag will automatically be performed in the 2D framework as well. Please refer to: Sohier, T., Calandra, M., & Mauri, F. (2017), 'Density functional perturbation theory for gated two-dimensional heterostructures: Theoretical developments and application to flexural phonons in graphene', PRB, 96, 075448 (2017).", gui_name='Isolated system:', default='Auto', choices=['Auto', 'None', 'm-p', 'mp', 'Martyna-Tuckerman', 'm-t', 'mt', 'ESM', '2D'], hiddenchoices=['m-p', 'mp', 'm-t', 'mt'])
self.degauss: float | FloatKey = FloatKey(name='degauss', comment='Value of the gaussian spreading for Brillouin-zone integration in metals.', gui_name='Smearing width:', default=0.0, unit='Rydberg')
self.dftd3_threebody: BoolType | BoolKey = BoolKey(name='dftd3_threebody', comment='Turn three-body terms in Grimme-D3 on.\n\nIf False two-body contributions only are computed, using two-body parameters of Grimme-D3.\n\nIf dftd3_version is set to ``2``, three-body contribution is always disabled.', gui_name='Use three-body terms:', default=True)
self.dftd3_version: Literal["2", "3", "4", "5", "6"] = MultipleChoiceKey(name='dftd3_version', comment='Version of Grimme implementation of Grimme-D3:\n\n• 2: Original Grimme-D2 parametrization\n\n• 3: Grimme-D3 (zero damping)\n\n• 4: Grimme-D3 (BJ damping)\n\n• 5: Grimme-D3M (zero damping)\n\n• 6: Grimme-D3M (BJ damping)\n\n• NOTE: not all functionals are parametrized.', gui_name='Version:', default='3', choices=['2', '3', '4', '5', '6'])
self.eamp: float | FloatKey = FloatKey(name='eamp', comment='Amplitude of the electric field, in Hartree a.u. = = 51.4220632*10^10 V/m.\n\nUsed only if ``tefield`` is enabled.\n\nThe saw-like potential increases with slope ``eamp`` in the region from (``emaxpos`` + ``eopreg``- 1) to (``emaxpos``), then decreases to 0 until (``emaxpos`` + ``eopreg``), in units of the crystal vector edir.\n\nImportant: the change of slope of this potential must be located in the empty region, or else unphysical forces will result.', gui_name='Field amplitude:', default=0.001, unit='Hartree')
self.ecutfock: float | FloatKey = FloatKey(name='ecutfock', comment='Kinetic energy cutoff for the exact exchange operator in EXX type calculations.\n\nBy default this is the same as ``ecutrho`` but in some EXX calculations, a significant speed-up can be obtained by reducing ecutfock, at the expense of some loss in accuracy.\n\nMust be >= ``ecutwfc``.\n\nNot implemented for stress calculation and for US-PP and PAW pseudopotentials.\n\nUse with care, especially in metals where it may give raise to instabilities.', gui_name='Exchange operator cutoff:', unit='Rydberg')
self.ecutrho: float | FloatKey = FloatKey(name='ecutrho', comment='Kinetic energy cutoff for charge density and potential.\n\nIf this key is not specified and the ``Pseudopotential%Family`` recommends a ratio of ``ecutrho`` to ``ecutwfc``, this recommended ratio will be used.\n\nIf there is no recommended ratio, the default value is ``4 x ecutwfc``.\n\nFor norm-conserving pseudopotential you should stick to the default value, you can reduce it by a little but it will introduce noise especially on forces and stress.\n\nIf there are ultrasoft PP, a larger value than the default is often desirable (``ecutrho`` = 8 to 12 times ``ecutwfc``, typically).\n\nPAW datasets can often be used at ``4 x ecutwfc``, but it depends on the shape of augmentation charge: testing is mandatory.\n\nThe use of gradient-corrected functional, especially in cells with vacuum, or for pseudopotential without non-linear core correction, usually requires an higher values of ``ecutrho`` to be accurately converged.', gui_name='Charge density cutoff:', unit='Rydberg')
self.ecutvcut: float | FloatKey = FloatKey(name='ecutvcut', comment='Reciprocal space cutoff for correcting Coulomb potential divergencies at small q vectors.', default=0.0, unit='Rydberg')
self.ecutwfc: float | FloatKey = FloatKey(name='ecutwfc', comment='Kinetic energy cutoff for wavefunctions.', gui_name='Wavefunction energy cutoff:', default=40.0, unit='Rydberg')
self.edir: Literal["1", "2", "3", "x", "y", "z"] = MultipleChoiceKey(name='edir', comment='``1`` (or ``x``), 2 (or ``y``) or 3 (or ``z``). The direction of the electric field or dipole correction is parallel to the bg(:,edir) reciprocal lattice vector.\n\nThus the potential is constant in planes defined by FFT grid points.\n\nUsed only if ``tefield`` is enabled.', gui_name='Field direction:', choices=['1', '2', '3', 'x', 'y', 'z'], hiddenchoices=['1', '2', '3'])
self.emaxpos: float | FloatKey = FloatKey(name='emaxpos', comment='Position of the maximum of the saw-like potential along crystal axis ``edir``, within the unit cell, see also ``eopreg``.\n\n0 < ``emaxpos`` < 1 \n\nUsed only if ``tefield`` is enabled.', gui_name='Saw potential maximum:', default=0.5)
self.eopreg: float | FloatKey = FloatKey(name='eopreg', comment='Zone in the unit cell where the saw-like potential decreases, see also ``amp``.\n\nMust be in range 0 < ``eopreg`` < 1.\n\nUsed only if ``tefield`` is enabled.', gui_name='Saw potential decreasing:', default=0.1)
self.exx_fraction: float | FloatKey = FloatKey(name='exx_fraction', comment="Fraction of EXX for hybrid functional calculations.\n\nIn the case of ``input_dft`` set to 'PBE0', the default value is 0.25, while for ``input_dft`` set to 'B3LYP' the ``exx_fraction`` default value is 0.20.", gui_name='EXX fraction:')
self.exxdiv_treatment: Literal["gygi-baldereschi", "vcut_spherical", "vcut_ws", "none"] = MultipleChoiceKey(name='exxdiv_treatment', comment='Specific for EXX. It selects the kind of approach to be used for treating the Coulomb potential divergencies at small q vectors.\n\ngygi-baldereschi: appropriate for cubic and quasi-cubic supercells\n\nvcut_spherical: appropriate for cubic and quasi-cubic supercells\n\n vcut_ws: appropriate for strongly anisotropic supercells, see also ecutvcut.\n none: sets Coulomb potential at G,q=0 to 0.0 (required for GAU-PBE)', gui_name='Divergence treatment:', default='gygi-baldereschi', choices=['gygi-baldereschi', 'vcut_spherical', 'vcut_ws', 'none'])
self.input_dft: str | StringKey = StringKey(name='input_dft', comment='Exchange-correlation functional. Some valid values are\n• pbe\n• blyp\n• pbe0\n• hse\n• revpbe\n• vdw-df-cx. See the documentation for more possible values. \n\nOverrides the value read from pseudopotential files.', gui_name='Density functional:')
self.lspinorb: BoolType | BoolKey = BoolKey(name='lspinorb', comment='if .TRUE. the noncollinear code can use a pseudopotential with spin-orbit.', gui_name='Spin-orbit:')
self.nbnd: int | IntKey = IntKey(name='nbnd', comment='Number of electronic states (bands) to be calculated. Note that in spin-polarized calculations the number of k-point, not the number of bands per k-point, is doubled.\n\nDefault: For an insulator, nbnd = number of valence bands (nbnd = # of electrons /2); for a metal, 20% more (minimum 4 more) ', gui_name='Number of bands:')
self.noncolin: BoolType | BoolKey = BoolKey(name='noncolin', comment='If True the program will perform a noncollinear calculation.', hidden=True, default=False)
self.nosym: BoolType | BoolKey = BoolKey(name='nosym', comment='If True, symmetry is not used, and k points are forced to have the symmetry of the Bravais lattice; an automatically generated Monkhorst-Pack grid will contain all points of the grid over the entire Brillouin Zone, plus the points rotated by the symmetries of the Bravais lattice which were not in the original grid. The same applies if a k-point list is provided in input instead of a Monkhorst-Pack grid. Time reversal symmetry is assumed so k and -k are equivalent unless noinv=.true. is specified. This option differs from nosym because it forces k-points in all cases to have the full symmetry of the Bravais lattice (not all uniform grids have such property!)', hidden=True, default=False)
self.nqx1: int | IntKey = IntKey(name='nqx1', comment='Three-dimensional mesh for q (k1-k2) sampling of the Fock operator (EXX). Can be smaller than the number of k-points. Defaults to the size of the k-point mesh used.')
self.nqx2: int | IntKey = IntKey(name='nqx2', comment='Three-dimensional mesh for q (k1-k2) sampling of the Fock operator (EXX). Can be smaller than the number of k-points. Defaults to the size of the k-point mesh used.')
self.nqx3: int | IntKey = IntKey(name='nqx3', comment='Three-dimensional mesh for q (k1-k2) sampling of the Fock operator (EXX). Can be smaller than the number of k-points. Defaults to the size of the k-point mesh used.')
self.nr1: int | IntKey = IntKey(name='nr1', comment='Three-dimensional FFT mesh (hard grid) for charge density (and scf potential). If not specified the grid is calculated based on the cutoff for charge density (see also ``ecutrho``). Note: you must specify all three dimensions for this setting to be used (``nr1``, ``nr2``, ``nr3``).')
self.nr1s: int | IntKey = IntKey(name='nr1s', comment='Three-dimensional mesh for wavefunction FFT and for the smooth part of charge density ( smooth grid ). Coincides with ``nr1``, ``nr2``, ``nr3`` if ``ecutrho = 4 * ecutwfc`` ( default ). Note: you must specify all three dimensions for this setting to be used (``nr1s``, ``nr2s``, ``nr3s``).')
self.nr2: int | IntKey = IntKey(name='nr2', comment='Three-dimensional FFT mesh (hard grid) for charge density (and scf potential). If not specified the grid is calculated based on the cutoff for charge density (see also ``ecutrho``). Note: you must specify all three dimensions for this setting to be used (``nr1``, ``nr2``, ``nr3``).')
self.nr2s: int | IntKey = IntKey(name='nr2s', comment='Three-dimensional mesh for wavefunction FFT and for the smooth part of charge density ( smooth grid ). Coincides with ``nr1``, ``nr2``, ``nr3`` if ``ecutrho = 4 * ecutwfc`` ( default ). Note: you must specify all three dimensions for this setting to be used (``nr1s``, ``nr2s``, ``nr3s``).')
self.nr3: int | IntKey = IntKey(name='nr3', comment='Three-dimensional FFT mesh (hard grid) for charge density (and scf potential). If not specified the grid is calculated based on the cutoff for charge density (see also ``ecutrho``). Note: you must specify all three dimensions for this setting to be used (``nr1``, ``nr2``, ``nr3``).')
self.nr3s: int | IntKey = IntKey(name='nr3s', comment='Three-dimensional mesh for wavefunction FFT and for the smooth part of charge density ( smooth grid ). Coincides with ``nr1``, ``nr2``, ``nr3`` if ``ecutrho = 4 * ecutwfc`` ( default ). Note: you must specify all three dimensions for this setting to be used (``nr1s``, ``nr2s``, ``nr3s``).')
self.nspin: Literal["1", "None", "2", "Collinear", "4", "Non-Collinear"] = MultipleChoiceKey(name='nspin', comment='Available options are:\n\n• None: not spin-polarized\n\n• Collinear: LSDA with magnetization along z-axis\n\n• Non-Collinear: any magnetization (equivalent to setting the ``noncolin`` key to True)', gui_name='Magnetization:', default='None', choices=['1', 'None', '2', 'Collinear', '4', 'Non-Collinear'], hiddenchoices=['1', '2', '4'])
self.occupations: Literal["Smearing", "Tetrahedra", "Tetrahedra_lin", "Tetrahedra_opt", "Fixed"] = MultipleChoiceKey(name='occupations', comment="Available options are:\n\n• Smearing: gaussian smearing for metals; see keywords ``smearing`` and ``degauss``\n\n• Tetrahedra: Tetrahedron method, Bloechl's version: P.E. Bloechl, PRB 49, 16223 (1994). Requires uniform grid of k-points, to be automatically generated (see ``block K_Points``). Well suited for calculation of DOS, less so (because not variational) for force/optimization/dynamics calculations.\n\n• Tetrahedra_lin: Original linear tetrahedron method. To be used only as a reference; the optimized tetrahedron method is more efficient.\n\n• Tetrahedra_opt: optimized tetrahedron method, see M. Kawamura, PRB 89, 094515 (2014). Can be used for phonon calculations as well.\n\n• Fixed: for insulators with a gap.", gui_name='Occupations:', default='Fixed', choices=['Smearing', 'Tetrahedra', 'Tetrahedra_lin', 'Tetrahedra_opt', 'Fixed'])
self.screening_parameter: float | FloatKey = FloatKey(name='screening_parameter', comment='screening_parameter for HSE like hybrid functionals. For more information, see: J. Chem. Phys. 118, 8207 (2003), doi:10.1063/1.1564060 J. Chem. Phys. 124, 219906 (2006), doi:10.1063/1.2204597', gui_name='Screening parameter:', default=0.106)
self.smearing: Literal["Gaussian", "gauss", "Methfessel-Paxton", "m-p", "mp", "Marzari-Vanderbilt", "cold", "m-v", "mv", "Fermi-Dirac", "f-d", "fd"] = MultipleChoiceKey(name='smearing', comment='Available options are:\n\n• Gaussian: ordinary Gaussian spreading\n\n• Methfessel-Paxton: first-order spreading (see PRB 40, 3616 (1989))\n\n• Marzari-Vanderbilt: cold smearing (see PRL 82, 3296 (1999))\n\n• Fermi-Dirac: smearing with Fermi-Dirac function', gui_name='Smearing:', default='Gaussian', choices=['Gaussian', 'gauss', 'Methfessel-Paxton', 'm-p', 'mp', 'Marzari-Vanderbilt', 'cold', 'm-v', 'mv', 'Fermi-Dirac', 'f-d', 'fd'], hiddenchoices=['gauss', 'm-p', 'mp', 'cold', 'm-v', 'mv', 'f-d', 'fd'])
self.tot_magnetization: float | FloatKey = FloatKey(name='tot_magnetization', comment='Total majority spin charge minus minority spin charge.\n\nUsed to impose a specific total electronic magnetization.\n\nIf unspecified then tot_magnetization variable is ignored and the amount of electronic magnetization is determined during the self-consistent cycle.', gui_name='Fix total magnetization:')
self.vdw_corr: Literal["None", "Grimme-D2", "DFT-D", "Grimme-D3", "DFT-D3", "TS", "ts-vdW", "tkatchenko-scheffler", "MBD", "many-body-dispersion", "mbd_vdw", "XDM"] = MultipleChoiceKey(name='vdw_corr', comment="Type of Van der Waals correction. Allowed values:\n\n• Grimme-D2: Semiempirical Grimme's DFT-D2, see S. Grimme, J. Comp. Chem. 27, 1787 (2006) [doi:10.1002/jcc.20495], and V. Barone et al., J. Comp. Chem. 30, 934 (2009) [doi:10.1002/jcc.21112].\n\n• Grimme-D3: Semiempirical Grimme's DFT-D3, see S. Grimme et al, J. Chem. Phys 132, 154104 (2010) [doi:10.1063/1.3382344].\n\n• TS: Tkatchenko-Scheffler dispersion corrections with first-principle derived C6 coefficients, see A. Tkatchenko and M. Scheffler, PRL 102, 073005 (2009).\n\n• MBD: Many-body dispersion (MBD) correction to long-range interactions, see A. Ambrosetti, A. M. Reilly, R. A. DiStasio, A. Tkatchenko, J. Chem. Phys. 140 18A508 (2014).\n\n• XDM: Exchange-hole dipole-moment model, see A. D. Becke et al., J. Chem. Phys. 127, 154108 (2007) [doi:10.1063/1.2795701], and A. Otero de la Roza et al., J. Chem. Phys. 136, 174109 (2012) [doi:10.1063/1.4705760].\n\nNote that non-local functionals (eg vdw-DF) are NOT specified here but using the ``input_dft`` keyword.", gui_name='Dispersion correction:', default='None', choices=['None', 'Grimme-D2', 'DFT-D', 'Grimme-D3', 'DFT-D3', 'TS', 'ts-vdW', 'tkatchenko-scheffler', 'MBD', 'many-body-dispersion', 'mbd_vdw', 'XDM'], hiddenchoices=['DFT-D', 'DFT-D3', 'ts-vdW', 'tkatchenko-scheffler', 'many-body-dispersion', 'mbd_vdw'])
self.x_gamma_extrapolation: BoolType | BoolKey = BoolKey(name='x_gamma_extrapolation', comment='Specific for EXX. If .true., extrapolate the G=0 term of the potential (see README in examples/EXX_example for more) Set this to .false. for GAU-PBE.', gui_name='Gamma extrapolation:', default=True)
self.xdm_a1: float | FloatKey = FloatKey(name='xdm_a1', comment='Damping function parameter a1 (adimensional).\n\nIt is NOT necessary to give a value if the functional is one of B86bPBE, PW86PBE, PBE, BLYP. For functionals in this list, the coefficients are given in: http://schooner.chem.dal.ca/wiki/XDM; A. Otero de la Roza, E. R. Johnson, J. Chem. Phys. 138, 204109 (2013) [doi:10.1063/1.4705760]', gui_name='a1:', default=0.6836)
self.xdm_a2: float | FloatKey = FloatKey(name='xdm_a2', comment='Damping function parameter a2 (Angstrom).\n\nIt is NOT necessary to give a value if the functional is one of B86bPBE, PW86PBE, PBE, BLYP. For functionals in this list, the coefficients are given in: http://schooner.chem.dal.ca/wiki/XDM; A. Otero de la Roza, E. R. Johnson, J. Chem. Phys. 138, 204109 (2013) [doi:10.1063/1.4705760]', gui_name='a2:', default=1.5045, unit='Angstrom')
self.starting_magnetization: QuantumESPRESSO._System._starting_magnetization = self._starting_magnetization(name='starting_magnetization', comment="Starting spin polarization for an atomic type in a spin polarized (LSDA or noncollinear/spin-orbit) calculation. Allowed values range between -1 (all spins down for the valence electrons of atom type 'i') to 1 (all spins up). If you expect a nonzero magnetization in your ground state, you MUST either specify a nonzero value for at least one atomic type, or constrain the magnetization using keyword ``tot_magnetization`` for LSDA, ``constrained_magnetization`` for noncollinear/spin-orbit calculations. If you don't, you will get a nonmagnetic (zero magnetization) state. In order to perform LSDA calculations for an antiferromagnetic state, define two different atomic species corresponding to sublattices of the same atomic type.\n\n Note: If you fix the magnetization with ``tot_magnetization``, do not specify ``starting_magnetization``.\n\n Note: In the noncollinear/spin-orbit case, starting with zero starting_magnetization on all atoms imposes time reversal symmetry. The magnetization is never calculated and is set to zero.", unique=False)
[docs] class _WorkFunction(FixedBlock):
r"""
This section configures the parameters for calculating the Work Function. This involves utilizing the following utilities:
• ``pp.x``: Calculates the the electrostatic potential using the results from the last Quantum ESPRESSO calculation.
• ``average.x``: Performs planar and macroscopic averages of the electrostatic potential along a specified direction, which are crucial for determining the vacuum level and subsequently the work function.
:ivar awin: The size of the window for macroscopic average (a.u.).
:vartype awin: float | FloatKey
:ivar centralize: Translates the calculated electrostatic potential along the ``idir`` coordinate, respecting periodic boundary conditions, so that the geometric center of the system is at the center of the coordinate.
:vartype centralize: BoolType | BoolKey
:ivar idir: ``1`` (or ``x``), 2 (or ``y``) or 3 (or ``z``). Planar average is done in the plane orthogonal to direction ``idir``, as defined for the crystal cell. The ``idir`` parameter defaults to the value of ``System%edir`` if it's set. Otherwise, ``idir`` is set to 3.
:vartype idir: Literal["1", "2", "3", "x", "y", "z"]
:ivar npt: Number of points used for the final interpolation of the planar and macroscopic averages of the electrostatic potential. This controls the resolution of the averaged potential data. If npt is less than or equal to N_idir (the number of FFT grid points along the specified direction), no interpolation is performed and the raw FFT data is used. The default value is 10 * N_idir, which typically provides sufficient resolution for accurate work function calculations.
:vartype npt: int | IntKey
"""
def __post_init__(self):
self.awin: float | FloatKey = FloatKey(name='awin', comment='The size of the window for macroscopic average (a.u.).', hidden=True, default=7.67, unit='Bohr')
self.centralize: BoolType | BoolKey = BoolKey(name='centralize', comment='Translates the calculated electrostatic potential along the ``idir`` coordinate, respecting periodic boundary conditions, so that the geometric center of the system is at the center of the coordinate.', gui_name='Center system:', default=True)
self.idir: Literal["1", "2", "3", "x", "y", "z"] = MultipleChoiceKey(name='idir', comment="``1`` (or ``x``), 2 (or ``y``) or 3 (or ``z``). Planar average is done in the plane orthogonal to direction ``idir``, as defined for the crystal cell. The ``idir`` parameter defaults to the value of ``System%edir`` if it's set. Otherwise, ``idir`` is set to 3.", gui_name='Use plane orthogonal to direction:', default='3', choices=['1', '2', '3', 'x', 'y', 'z'], hiddenchoices=['1', '2', '3'])
self.npt: int | IntKey = IntKey(name='npt', comment='Number of points used for the final interpolation of the planar and macroscopic averages of the electrostatic potential. This controls the resolution of the averaged potential data. If npt is less than or equal to N_idir (the number of FFT grid points along the specified direction), no interpolation is performed and the raw FFT data is used. The default value is 10 * N_idir, which typically provides sufficient resolution for accurate work function calculations.', gui_name='Number of interpolation points:')
def __post_init__(self):
self.CheckInputIncompatibilities: BoolType | BoolKey = BoolKey(name='CheckInputIncompatibilities', comment='Performs a preliminary check for incompatible input parameters before starting the calculation. If any inconsistencies are detected (e.g., attempting a Raman calculation with spin polarization), the program will stop and report the error. This helps to avoid wasted time and resources by identifying potential issues early on.', hidden=True, default=True)
self.K_PointsLabels: str | StringKey = StringKey(name='K_PointsLabels', comment='You can provide labels for your k-points, like ``L-GAMMA-X-U-GAMMA``, separating each label with a hyphen (-) or a vertical bar (|). For example, ``L-GAMMA-X-U-GAMMA`` and ``L|GAMMA|X|U|GAMMA`` are both valid. These labels are optional and only used for display purposes when the ``K_Points`` block is specified. This option is used only if the header of the ``K_Points`` block is not ``ams_kpath``. **Important:** These labels do not determine the actual k-point coordinates. You must specify the k-point coordinates separately within the ``K_Points`` section.', hidden=True)
self.KeepDataFiles: BoolType | BoolKey = BoolKey(name='KeepDataFiles', comment="If 'False' the program will perform the following actions at the end of the calculation: 1) Remove the 'prefix.qein' file, which serves as the QE input file, 2) Delete the output data stored in the 'prefix.xml' file, and 3) Clear the contents of the 'prefix.save' directory. If you require further details, please refer to the QE user manual in the 'Data Files' section. It provides comprehensive information on the specific files and their functionalities. In particular, these files are needed to calculate the bands structure and DOS.", hidden=True, default=True)
self.UseBondingEnergy: BoolType | BoolKey = BoolKey(name='UseBondingEnergy', comment='When enabled, the calculation engine uses the bonding energy (energy difference between the molecule and its constituent atoms) instead of the total energy. This facilitates comparisons of relative stability between molecular configurations. Atomic energies are consistently computed using Gamma-point sampling, Gaussian smearing (degauss = 0.01), and spin-restricted (nSpin = 1) settings within a cubic lattice of 8 angstrom side length to approximate their spherically symmetric ground states. All other parameters for the atomic calculations remain the same as those used for the molecular system.', hidden=True, default=False)
self.AVERAGE_X: QuantumESPRESSO._AVERAGE_X = self._AVERAGE_X(name='AVERAGE_X', comment='This section configures the parameters for running the QE-utility ``average.x``. This utility reads files produce by produced by ``pp.x`` and compute planar and macroscopic averages of a quantity (e.g. charge) in real space on a 3D FFT mesh.', hidden=True)
self.BandStructure: QuantumESPRESSO._BandStructure = self._BandStructure(name='BandStructure', comment='This section configures the parameters for calculating the Band Structure. This involves utilizing the following utilities:\n\n• ``kpath``: This AMS tool generates an automated high-symmetry k-path in the Brillouin zone.\n\n• ``pw.x`` (with calculation=bands): This utility from Quantum ESPRESSO (QE) performs electronic structure calculations, particularly for bands. For more details see https://www.quantum-espresso.org/Doc/INPUT_PW.html\n\n• ``bands.x``: Another QE utility, which calculates the band structure. For more details see https://www.quantum-espresso.org/Doc/INPUT_BANDS.html.')
self.Control: QuantumESPRESSO._Control = self._Control(name='Control', comment='Keywords from the &CONTROL namelist in the QuantumEspresso input file.')
self.DOS: QuantumESPRESSO._DOS = self._DOS(name='DOS', comment='This section configures the parameters for calculating the Density of States (DOS). These are the utilities involved:\n\n• ``kpath``: This AMS tool generates an automated high-symmetry k-path in the Brillouin zone.\n\n• ``pw.x`` (with ``calculation=nscf``): This Quantum ESPRESSO (QE) utility conducts electronic structure calculations, specifically for the non-self-consistent field (nscf) computation.\n\n• ``dos.x``: A QE utility utilized for post-processing electronic structure calculations. It analyzes the electronic wavefunctions obtained from preceding calculations to determine the density of available electronic states at different energy levels. For more details see https://www.quantum-espresso.org/Doc/INPUT_DOS.html\n\n• ``projwfc.x``: Another QE utility employed for post-processing electronic structure calculations. It projects the wavefunctions onto atomic orbitals or basis sets, offering insights into the composition and character of electronic states. For more details see https://www.quantum-espresso.org/Doc/INPUT_PROJWFC.html\n\nBy default, the calculation sequence follows the order: ``kpath -> pw.x(calculation=nscf) -> dos.x``. However, enabling ``DOS%PDOS`` switches the calculation to use ``projwfc.x`` instead of ``dos.x``. While common parameters can be customized directly in this section, specialized adjustments should be made in either the ``DOS_X`` or ``PROJWFC_X`` section, depending on specific requirements.')
self.DOS_X: QuantumESPRESSO._DOS_X = self._DOS_X(name='DOS_X', comment='This section configures the parameters for running the QE-utility ``dos.x`` (see https://www.quantum-espresso.org/Doc/INPUT_DOS.html). This utility calculates the Density of States (DOS), separated into up and down components for DSDA.', hidden=True)
self.DYNMAT_X: QuantumESPRESSO._DYNMAT_X = self._DYNMAT_X(name='DYNMAT_X', comment='This section configures the parameters for running the QE utility `dynmat.x` (see https://www.quantum-espresso.org/Doc/INPUT_DYNMAT.html). This utility is used to ???', hidden=True)
self.Electrons: QuantumESPRESSO._Electrons = self._Electrons(name='Electrons', comment='Keywords from the &ELECTRONS namelist in the QuantumEspresso input file.')
self.Hubbard: str | Sequence[str] | FreeBlock = self._Hubbard(name='Hubbard', comment='Specify parameters for DFT+U models. The type of Hubbard projectors to use (e.g. ``atomic`` or ``ortho-atomic``) is specified in the header of this block.\nExample input:\n\n.. code-block:: text\n\n Hubbard ortho-atomic\n U Fe-3d 3.0\n End\n\nMore examples can be found in the documentation.', header=True)
self.HubbardU: QuantumESPRESSO._HubbardU = self._HubbardU(name='HubbardU', comment='Specify parameters for DFT+U Models.', hidden=True)
self.K_Points: str | Sequence[str] | FreeBlock = self._K_Points(name='K_Points', comment='Specify the k-points to use. Available header values are: ``tpiba``, ``automatic``, ``crystal``, ``gamma``, ``tpiba_b``, ``crystal_b``, ``tpiba_c``, ``crystal_c``, and ``ams_kpath``. See the examples and QE documentation for details. If omitted, only ``gamma`` is used. For most cases, ``automatic`` (which generates a Monkhorst-Pack grid) is recommended. Note: Gamma-point calculations are significantly faster using ``gamma`` than ``automatic``, but may not be possible to use for all types of calculations or postprocessing programs. ', header=True)
self.MATDYN_X: QuantumESPRESSO._MATDYN_X = self._MATDYN_X(name='MATDYN_X', comment='This section configures the parameters for running the QE utility `matdyn.x` (see https://www.quantum-espresso.org/Doc/INPUT_MATDYN.html). This utility is used to calculate various phonon-related properties from the real-space interatomic force constants (IFC) produced by `q2r.x`. These properties include phonon dispersion curves, phonon density of states (DOS), thermodynamic properties (e.g., free energy, entropy), and more.', hidden=True)
self.NormalModes: QuantumESPRESSO._NormalModes = self._NormalModes(name='NormalModes', comment='This section outlines the configuration of parameters for calculating Normal Modes. The process involves using the following utilities:\n\n• ``ph.x``: This utility from Quantum ESPRESSO (QE) calculates phonon frequencies and eigenvectors at specified q-points (wave vectors) using Density Functional Perturbation Theory (DFPT). You can set specific parameters in the section ``PH_X``. For more details, see https://www.quantum-espresso.org/Doc/INPUT_PH.html.\n\n• ``dynmat.x``: This QE utility calculates the infrared (IR) and Raman intensities (oscillator strengths) as well as the normal modes associated with each vibrational frequency. Specific parameters can be set in the section ``DYNMAT_X``. The information from ``ph.x``, combined with the phonon frequencies, is used to generate the simulated IR/Raman absorption spectrum. For more details, see https://www.quantum-espresso.org/Doc/INPUT_DYNMAT.html.\n\nIf Normal Modes are requested in the main AMS properties section, the program automatically sets ``PH_X%asr=Yes``, ``PH_X%epsilon=Yes``, and ``PH_X%trans=Yes``. If Raman is requested in the main AMS properties section, it also sets ``PH_X%lraman=Yes`` along with the previous parameters.')
self.PH_X: QuantumESPRESSO._PH_X = self._PH_X(name='PH_X', comment='This section configures the parameters for running the QE utility `ph.x` (see https://www.quantum-espresso.org/Doc/INPUT_PH.html). This utility is used for post-processing phonon calculations in Quantum ESPRESSO.', hidden=True)
self.PP_X: QuantumESPRESSO._PP_X = self._PP_X(name='PP_X', comment='This section configures the parameters for running the QE-utility ``pp.x`` (see https://www.quantum-espresso.org/Doc/INPUT_PP.html). This utility reads the output produced by ``pw.x``, extracts and calculates the desired quantity/quantities (rho, V, ...), and then writes the desired quantity to file in a suitable format for various types of plotting and various plotting programs. Only a few options are supported at the moment.', hidden=True)
self.PROJWFC_X: QuantumESPRESSO._PROJWFC_X = self._PROJWFC_X(name='PROJWFC_X', comment='This section configures the parameters for running the QE-utility ``projwfc.x`` (see https://www.quantum-espresso.org/Doc/INPUT_PROJWFC.html). This utility projects wavefunctions onto orthogonalized atomic wavefunctions, calculates Lowdin charges, spilling parameter, projected DOS (separated into up and down components for LSDA).', hidden=True)
self.Phonons: QuantumESPRESSO._Phonons = self._Phonons(name='Phonons', comment='This section configures the parameters for calculating the Phonon Structure. This involves utilizing the following utilities:\n\n• ``kpath``: This AMS tool generates an automated high-symmetry k-path in the Brillouin zone.\n\n• ``ph.x``: This utility from Quantum ESPRESSO (QE) calculates phonon frequencies and eigenvectors at specified q-points (wavevectors) using Density Functional Perturbation Theory (DFPT). For more details see https://www.quantum-espresso.org/Doc/INPUT_PH.html\n\n• ``q2r.x``: This QE utility transforms the dynamical matrix from reciprocal space (q-space) to real space (r-space). This is necessary for further post-processing steps. For more details see https://www.quantum-espresso.org/Doc/INPUT_Q2R.html.\n\n• ``matdyn.x``: This QE utility calculates various phonon-related properties from the real-space dynamical matrix, such as phonon dispersion curves, density of states (DOS), thermodynamic properties, and more. For more details see https://www.quantum-espresso.org/Doc/INPUT_MATDYN.html.')
self.Properties: QuantumESPRESSO._Properties = self._Properties(name='Properties', comment='Configures which QE level properties to calculate for SinglePoint calculations or other important geometries (e.g. at the end of an optimization).')
self.Pseudopotentials: QuantumESPRESSO._Pseudopotentials = self._Pseudopotentials(name='Pseudopotentials', comment='Selects the pseudopotential to use for the atomic species.')
self.Q2R_X: QuantumESPRESSO._Q2R_X = self._Q2R_X(name='Q2R_X', comment='This section configures the parameters for running the QE utility `q2r.x` (see https://www.quantum-espresso.org/Doc/INPUT_Q2R.html). This utility is used to transform the interatomic force constants (IFC) calculated in reciprocal space (q-space) by `ph.x` into real space (r-space). The real-space IFCs are then used as input for the `matdyn.x` utility to calculate various phonon-related properties.', hidden=True)
self.Restart: QuantumESPRESSO._Restart = self._Restart(name='Restart', comment='This section configures restarting a Quantum Espresso calculation from previous data. You can restart from a specific Quantum Espresso results file (e.g., `quantumespresso.rkf`), or by providing the directory and file prefix of the previous calculation. This is compatible with any stand-alone Quantum Espresso version.')
self.System: QuantumESPRESSO._System = self._System(name='System', comment='Keywords from the &SYSTEM namelist in the QuantumEspresso input file.')
self.WorkFunction: QuantumESPRESSO._WorkFunction = self._WorkFunction(name='WorkFunction', comment='This section configures the parameters for calculating the Work Function. This involves utilizing the following utilities:\n\n• ``pp.x``: Calculates the the electrostatic potential using the results from the last Quantum ESPRESSO calculation.\n\n• ``average.x``: Performs planar and macroscopic averages of the electrostatic potential along a specified direction, which are crucial for determining the vacuum level and subsequently the work function.')