aiida_quantumespresso.workflows.xspectra.crystal#

Workchain to compute all X-ray absorption spectra for a given structure.

Uses QuantumESPRESSO pw.x and xspectra.x.

Module Contents#

Classes#

XspectraCrystalWorkChain

Workchain to compute all X-ray absorption spectra for a given structure using Quantum ESPRESSO.

Attributes#

PwCalculation

PwBaseWorkChain

PwRelaxWorkChain

XspectraBaseWorkChain

XspectraCoreWorkChain

XyData

aiida_quantumespresso.workflows.xspectra.crystal.PwCalculation[source]#
aiida_quantumespresso.workflows.xspectra.crystal.PwBaseWorkChain[source]#
aiida_quantumespresso.workflows.xspectra.crystal.PwRelaxWorkChain[source]#
aiida_quantumespresso.workflows.xspectra.crystal.XspectraBaseWorkChain[source]#
aiida_quantumespresso.workflows.xspectra.crystal.XspectraCoreWorkChain[source]#
aiida_quantumespresso.workflows.xspectra.crystal.XyData[source]#
class aiida_quantumespresso.workflows.xspectra.crystal.XspectraCrystalWorkChain(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 all X-ray absorption spectra for a given structure using Quantum ESPRESSO.

The WorkChain follows the process required to compute all the K-edge XAS spectra for each element in a given structure. The WorkChain itself firstly calls the PwRelaxWorkChain to relax the input structure, then determines the input settings for each XAS calculation automatically using get_xspectra_structures():

  • Firstly the input structure is converted to its conventional standard cell using spglib and detects the space group number for the conventional cell.

  • Symmetry analysis of the standardized structure using spglib is then used to determine the number of non-equivalent atomic sites in the structure for each element considered for analysis.

Using the symmetry data returned from get_xspectra_structures, input structures for the XspectraCoreWorkChain are generated from the standardized structure by converting each to a supercell with cell dimensions of at least 8.0 angstroms in each periodic dimension - required 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. The WorkChain then uses the space group number to set the list of polarisation vectors for the XspectraCoreWorkChain to compute for all subsequent calculations.

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, xs_code, structure, pseudos, upf2plotcore_code=None, core_wfc_data=None, core_hole_treatments=None, protocol=None, overrides=None, elements_list=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.

  • xs_code – the Code instance configured for the quantumespresso.xspectra plugin.

  • upf2plotcore_code – the AiiDA-Shell Code instance configured for the upf2plotcore shell script.

  • 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 XspectraWorkChain 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.

static validate_inputs(inputs, _)[source]#

Validate the inputs before launching the WorkChain.

setup()[source]#

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

get_xspectra_structures()[source]#

Perform symmetry analysis of the relaxed structure and get all marked structures for XSpectra.

should_run_upf2plotcore()[source]#

If core wavefunction data files are specified, we skip the upf2plotcore step.

run_upf2plotcore()[source]#

Run the upf2plotcore.sh utility script for each element and return the core-wavefunction data.

inspect_upf2plotcore()[source]#

Check that the outputs from the upf2plotcore step have yielded meaningful results.

This will simply check that the core wavefunction data returned contains at least one core state and return an error if this is not the case.

run_all_xspectra_core()[source]#

Call all XspectraCoreWorkChains required to compute all requested spectra.

inspect_all_xspectra_core()[source]#

Check that all the XspectraCoreWorkChain 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.