aiida_quantumespresso.workflows.pdos#

Workchain to run Quantum ESPRESSO calculations that generate DoS and PDoS for a structure.

This requires four computations:

  • SCF (pw.x), to generate the initial wavefunction.

  • NSCF (pw.x), to generate eigenvalues, generally with a denser k-point mesh and tetrahedra occupations.

  • Total DoS (dos.x), to generate total densities of state.

  • Partial DoS (projwfc.x), to generate partial densities of state, by projecting wavefunctions onto atomic orbitals.

Additional functionality:

  • Setting 'align_to_fermi': True in the inputs will ensure that the energy range is centred around the Fermi energy when Emin and Emax are provided for both the dos and projwfc inputs. This is useful when you are only interested in a certain energy range around the Fermi energy. By default the energy range is extracted from the NSCF calculation.

Storage memory management:

The wavefunction file(s) created by the nscf calculation can get very large (>100Gb). These files must be copied to dos and projwfc calculations, so storage memory limits can easily be exceeded. If this is an issue, setting the input serial_clean to True will not run these calculations in parallel, but instead run in serial and clean directories when they are no longer required:

  • Run the scf workchain

  • Run the nscf workchain, then clean the scf calculation directories

  • Run the dos calculation, then clean its directory

  • Run the projwfc calculation, then clean its directory

Setting the input clean_workdir to True, will clean any remaining directories, after the whole workchain has terminated.

Also note that projwfc will fail if the scf/nscf calculations were run with a different number of procs/pools and wf_collect=.false. (this setting is deprecated in newer version of QE).

Related Resources:

Warning

For QE v6.1, there is an issue using tetrahedra occupations, as is recommended for nscf, and both dos.x and projwfc.x will raise errors when reading the xml file (see this post).

Module Contents#

Classes#

PdosWorkChain

A WorkChain to compute Total & Partial Density of States of a structure, using Quantum Espresso.

Functions#

get_parameter_schema()

Return the PdosWorkChain input parameter schema.

validate_inputs(value, _)

Validate the top level namespace.

validate_scf(value, _)

Validate the scf parameters.

validate_nscf(value, _)

Validate the nscf parameters.

validate_dos(value, _)

Validate DOS parameters.

validate_projwfc(value, _)

Validate DOS parameters.

clean_calcjob_remote(node)

Clean the remote directory of a CalcJobNode.

clean_workchain_calcs(workchain)

Clean all remote directories of a workchain's descendant calculations.

Attributes#

PwBaseWorkChain

DosCalculation

ProjwfcCalculation

aiida_quantumespresso.workflows.pdos.get_parameter_schema()[source]#

Return the PdosWorkChain input parameter schema.

aiida_quantumespresso.workflows.pdos.validate_inputs(value, _)[source]#

Validate the top level namespace.

  • Check that either the scf or nscf.pw.parent_folder inputs is provided.

  • Check that the Emin, Emax and DeltaE inputs are the same for the dos and projwfc namespaces.

  • Check that Emin and Emax are provided in case align_to_fermi is set to True.

aiida_quantumespresso.workflows.pdos.validate_scf(value, _)[source]#

Validate the scf parameters.

aiida_quantumespresso.workflows.pdos.validate_nscf(value, _)[source]#

Validate the nscf parameters.

aiida_quantumespresso.workflows.pdos.validate_dos(value, _)[source]#

Validate DOS parameters.

  • shared: Emin | Emax | DeltaE

  • dos.x only: ngauss | degauss | bz_sum

  • projwfc.x only: ngauss | degauss | pawproj | n_proj_boxes | irmin(3,n_proj_boxes) | irmax(3,n_proj_boxes)

aiida_quantumespresso.workflows.pdos.validate_projwfc(value, _)[source]#

Validate DOS parameters.

  • shared: Emin | Emax | DeltaE

  • dos.x only: ngauss | degauss | bz_sum

  • projwfc.x only: ngauss | degauss | pawproj | n_proj_boxes | irmin(3,n_proj_boxes) | irmax(3,n_proj_boxes)

aiida_quantumespresso.workflows.pdos.clean_calcjob_remote(node)[source]#

Clean the remote directory of a CalcJobNode.

aiida_quantumespresso.workflows.pdos.clean_workchain_calcs(workchain)[source]#

Clean all remote directories of a workchain’s descendant calculations.

aiida_quantumespresso.workflows.pdos.PwBaseWorkChain[source]#
aiida_quantumespresso.workflows.pdos.DosCalculation[source]#
aiida_quantumespresso.workflows.pdos.ProjwfcCalculation[source]#
class aiida_quantumespresso.workflows.pdos.PdosWorkChain(inputs: dict | None = None, logger: logging.Logger | None = None, runner: aiida.engine.runners.Runner | None = None, enable_persistence: bool = True)[source]#

Bases: aiida_quantumespresso.workflows.protocols.utils.ProtocolMixin, aiida.engine.WorkChain

A WorkChain to compute Total & Partial Density of States of a structure, using Quantum Espresso.

classmethod define(spec)[source]#

Define the process specification.

classmethod get_protocol_filepath()[source]#

Return pathlib.Path to the .yaml file that defines the protocols.

classmethod get_builder_from_protocol(pw_code, dos_code, projwfc_code, structure, protocol=None, overrides=None, options=None, **kwargs)[source]#

Return a builder prepopulated with inputs selected according to the chosen protocol.

Parameters:
  • pw_code – the Code instance configured for the quantumespresso.pw plugin.

  • dos_code – the Code instance configured for the quantumespresso.dos plugin.

  • projwfc_code – the Code instance configured for the quantumespresso.projwfc plugin.

  • structure – the StructureData instance to use.

  • protocol – protocol to use, if not specified, the default will be used.

  • overrides – optional dictionary of inputs to override the defaults of the protocol.

  • options – A dictionary of options that will be recursively set for the metadata.options input of all the CalcJobs that are nested in this work chain.

  • kwargs – additional keyword arguments that will be passed to the get_builder_from_protocol of all the sub processes that are called by this workchain.

Returns:

a process builder instance with all inputs defined ready for launch.

setup()[source]#

Initialize context variables that are used during the logical flow of the workchain.

serial_clean()[source]#

Return whether dos and projwfc calculations should be run in serial.

The calculation remote folders will be cleaned before the next process step.

should_run_scf()[source]#

Return whether the work chain should run an SCF calculation.

run_scf()[source]#

Run an SCF calculation, to generate the wavefunction.

inspect_scf()[source]#

Verify that the SCF calculation finished successfully.

run_nscf()[source]#

Run an NSCF calculation, to generate eigenvalues with a denser k-point mesh.

This calculation modifies the base scf calculation inputs by:

  • Using the parent folder from the scf calculation.

  • Replacing the kpoints, if an alternative is specified for nscf.

  • Changing SYSTEM.occupations to ‘tetrahedra’.

  • Changing SYSTEM.nosym to True, to avoid generation of additional k-points in low symmetry cases.

  • Replace the pw.metadata.options, if an alternative is specified for nscf.

inspect_nscf()[source]#

Verify that the NSCF calculation finished successfully.

_generate_dos_inputs()[source]#

Run DOS calculation, to generate total Densities of State.

_generate_projwfc_inputs()[source]#

Run Projwfc calculation, to generate partial Densities of State.

run_dos_serial()[source]#

Run DOS calculation.

inspect_dos_serial()[source]#

Verify that the DOS calculation finished successfully, then clean its remote directory.

run_projwfc_serial()[source]#

Run Projwfc calculation.

inspect_projwfc_serial()[source]#

Verify that the Projwfc calculation finished successfully, then clean its remote directory.

run_pdos_parallel()[source]#

Run DOS and Projwfc calculations in parallel.

inspect_pdos_parallel()[source]#

Verify that the DOS and Projwfc calculations finished successfully.

results()[source]#

Attach the desired output nodes directly as outputs of the workchain.

on_terminated()[source]#

Clean the working directories of all child calculations if clean_workdir=True in the inputs.