aiida_quantumespresso.workflows.xps#

Workchain to compute the X-ray photoelectron spectroscopy (XPS) for a given structure.

Uses QuantumESPRESSO pw.x.

Module Contents#

Classes#

XpsWorkChain

Workchain to compute X-ray photoelectron spectra (XPS) for a given structure.

Functions#

validate_inputs(inputs, _)

Validate the inputs before launching the WorkChain.

Attributes#

PwCalculation

PwBaseWorkChain

PwRelaxWorkChain

XyData

aiida_quantumespresso.workflows.xps.PwCalculation[source]#
aiida_quantumespresso.workflows.xps.PwBaseWorkChain[source]#
aiida_quantumespresso.workflows.xps.PwRelaxWorkChain[source]#
aiida_quantumespresso.workflows.xps.XyData[source]#
aiida_quantumespresso.workflows.xps.validate_inputs(inputs, _)[source]#

Validate the inputs before launching the WorkChain.

class aiida_quantumespresso.workflows.xps.XpsWorkChain(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

Workchain to compute X-ray photoelectron spectra (XPS) for a given structure.

The WorkChain itself firstly calls the PwRelaxWorkChain to relax the input structure if required. Then determines the input settings for each XPS calculation automatically using get_xspectra_structures(). The input structures are generated from the standardized structure by converting each to a supercell with cell dimensions of at least 8.0 angstrom in each periodic dimension in order to sufficiently reduce the unphysical interaction of the core-hole with neighbouring images. The size of the minimum size requirement can be overriden by the user if required. Then the standard Delta-Self-Consistent-Field (ΔSCF) method is used to get the XPS binding energy. Finally, the XPS spectrum is calculated using the Voigt profile.

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_default_treatment() str[source]#

Return the default core-hole treatment.

Parameters:

cls – the workflow class.

Returns:

the default core-hole treatment

classmethod get_available_treatments() dict[source]#

Return the available core-hole treatments.

Parameters:

cls – the workflow class.

Returns:

dictionary of available treatments, where each key is a treatment and value is another dictionary that contains at least the key description and optionally other keys with supplimentary information.

classmethod get_treatment_inputs(treatment: dict | None = None, overrides: dict | pathlib.Path | None = None) dict[source]#

Return the inputs for the given workflow class and core-hole treatment.

Parameters:
  • cls – the workflow class.

  • treatment – optional specific treatment, if not specified, the default will be used

  • overrides – dictionary of inputs that should override those specified by the treatment. The mapping should maintain the exact same nesting structure as the input port namespace of the corresponding workflow class.

Returns:

mapping of inputs to be used for the workflow class.

classmethod _load_treatment_file() dict[source]#

Return the contents of the core-hole treatment file.

classmethod get_treatment_filepath()[source]#

Return pathlib.Path to the .yaml file that defines the core-hole treatments for the SCF step.

classmethod get_builder_from_protocol(code, structure, pseudos, core_hole_treatments=None, protocol=None, overrides=None, elements_list=None, atoms_list=None, options=None, structure_preparation_settings=None, correction_energies=None, **kwargs)[source]#

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

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

  • structure – the StructureData instance to use.

  • pseudos – the core-hole pseudopotential pairs (ground-state and excited-state) for the elements to be calculated. These must use the mapping of {“element” : {“core_hole” : <upf>, “gipaw” : <upf>}}

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

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

  • 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]#

Init required context variables.

should_run_relax()[source]#

If the ‘relax’ input namespace was specified, we relax the input structure.

run_relax()[source]#

Run the PwRelaxWorkChain to run a relax PwCalculation.

inspect_relax()[source]#

Verify that the PwRelaxWorkChain finished successfully.

prepare_structures()[source]#

Get a marked structure for each site.

Analyses the given structure using get_xspectra_structures() to obtain both the conventional standard form of the crystal structure and the list of symmetrically non-equivalent sites. This list is then used to produce a supercell of the standardized structure for each selected site with the site marked using a unique label.

If provided, this step will use inputs from inputs.structure_preparation_settings and apply them to the CalcFunction call. The accepted inputs (format, default) are: - supercell_min_parameter (float, 8.0) - standardize_structure (bool, True) - is_molecule_input (bool, False)

Input settings for the spglib analysis within get_xspectra_structures can be provided via inputs.spglib_settings in the form of a Dict node and must be formatted as {<variable_name> : <parameter>} for each variable in the get_symmetry_dataset() method.

should_run_gs_scf()[source]#

If the ‘calc_binding_energy’ input namespace is True, we run a scf calculation for the supercell.

run_gs_scf()[source]#

Call PwBaseWorkChain to compute total energy for the supercell.

inspect_scf()[source]#

Verify that the PwBaseWorkChain finished successfully.

run_all_scf()[source]#

Call all PwBaseWorkChain’s required to compute total energies for each absorbing atom site.

inspect_all_scf()[source]#

Check that all the PwBaseWorkChain sub-processes finished sucessfully.

results()[source]#

Compile all output spectra, organise and post-process all computed spectra, and send to outputs.

on_terminated()[source]#

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