aiida_quantumespresso.workflows.pw.relax#

Workchain to relax a structure using Quantum ESPRESSO pw.x.

Module Contents#

Classes#

PwRelaxWorkChain

Workchain to relax a structure using Quantum ESPRESSO pw.x.

Functions#

validate_inputs(inputs, _)

Validate the top level namespace.

Attributes#

PwCalculation

PwBaseWorkChain

aiida_quantumespresso.workflows.pw.relax.PwCalculation[source]#
aiida_quantumespresso.workflows.pw.relax.PwBaseWorkChain[source]#
aiida_quantumespresso.workflows.pw.relax.validate_inputs(inputs, _)[source]#

Validate the top level namespace.

class aiida_quantumespresso.workflows.pw.relax.PwRelaxWorkChain(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 relax a structure using Quantum ESPRESSO pw.x.

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(code, structure, protocol=None, overrides=None, relax_type=RelaxType.POSITIONS_CELL, options=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.

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

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

  • relax_type – the relax type to use: should be a value of the enum common.types.RelaxType.

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

Input validation and context setup.

should_run_relax()[source]#

Return whether a relaxation workchain should be run.

This is the case as long as the volume change between two consecutive relaxation runs is larger than the volume convergence threshold value and the maximum number of meta convergence iterations is not exceeded.

should_run_final_scf()[source]#

Return whether after successful relaxation a final scf calculation should be run.

If the maximum number of meta convergence iterations has been exceeded and convergence has not been reached, the structure cannot be considered to be relaxed and the final scf should not be run.

run_relax()[source]#

Run the PwBaseWorkChain to run a relax PwCalculation.

inspect_relax()[source]#

Inspect the results of the last PwBaseWorkChain.

Compare the cell volume of the relaxed structure of the last completed workchain with the previous. If the difference ratio is less than the volume convergence threshold we consider the cell relaxation converged.

run_final_scf()[source]#

Run the PwBaseWorkChain to run a final scf PwCalculation for the relaxed structure.

inspect_final_scf()[source]#

Inspect the result of the final scf PwBaseWorkChain.

results()[source]#

Attach the output parameters and structure of the last workchain to the outputs.

on_terminated()[source]#

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

static _fix_atomic_positions(structure, settings)[source]#

Fix the atomic positions, by setting the FIXED_COORDS key in the settings input node.