aiida_vasp.assistant.parameters#

Parameter related utils

Contains utils and definitions that are used together with the parameters.

Module Contents#

Classes#

ChargeEnum

Encode values for the initial charge density.

IntSmearingEnum

Encode values for the smearing used during integration in reciprocal space.

OrbitEnum

Encode values for the projector information.

RelaxAlgoEnum

Encode values for algorithm descriptively.

RelaxModeEnum

Encode values for degrees of freedom mode of relaxation descriptively.

ParametersMassage

A class that contains all relevant massaging of the input parameters for VASP.

ParameterSetFunctions

Container for the set functions that converts an AiiDA parameters to a default override specific one.

Functions#

check_inputs

Check that the inputs are of some correct type and returned as AttributeDict.

inherit_and_merge_parameters

Goes trough the inputs namespaces and the namespaces in the inputs.parameters and merge them.

Data#

API#

aiida_vasp.assistant.parameters._BASE_NAMESPACES: list[str] = ['electronic', 'smearing', 'charge', 'dynamics', 'bands', 'relax', 'converge']#
aiida_vasp.assistant.parameters._DEFAULT_OVERRIDE_NAMESPACE: str = 'incar'#
class aiida_vasp.assistant.parameters.ChargeEnum[source]#

Bases: enum.IntEnum

Encode values for the initial charge density.

See: https://www.vasp.at/wiki/index.php/ICHARG

Initialization

Initialize self. See help(type(self)) for accurate signature.

WAVE = 0#
CHARGE = 1#
ATOMIC = 2#
POTENTIAL = 4#
CONSTANT_CHARGE = 11#
CONSTANT_ATOMIC = 12#
class aiida_vasp.assistant.parameters.IntSmearingEnum[source]#

Bases: enum.IntEnum

Encode values for the smearing used during integration in reciprocal space.

See: https://www.vasp.at/wiki/index.php/ISMEAR.

Initialization

Initialize self. See help(type(self)) for accurate signature.

MP = 1#
GAUSSIAN = 0#
FERMI = None#
PARTIAL = None#
TETRA = None#
class aiida_vasp.assistant.parameters.OrbitEnum[source]#

Bases: enum.IntEnum

Encode values for the projector information.

See: https://www.vasp.at/wiki/index.php/LORBIT

Initialization

Initialize self. See help(type(self)) for accurate signature.

ATOM = 0#
ATOM_LM = 1#
ATOM_LM_PHASE = 2#
NO_RWIGS_ATOM = 10#
NO_RWIGS_ATOM_LM = 11#
NO_RWIGS_ATOM_LM_PHASE = 12#
NO_RWIGS_ATOM_LM_PHASE_AUTO = 14#
ATOM_LM_WAVE = 5#
classmethod get_lorbit_from_combination(**kwargs) aiida_vasp.assistant.parameters.OrbitEnum[source]#

Get the correct mode of the projectors/decomposition.

class aiida_vasp.assistant.parameters.RelaxAlgoEnum[source]#

Bases: enum.IntEnum

Encode values for algorithm descriptively.

See: https://www.vasp.at/wiki/index.php/IBRION

Initialization

Initialize self. See help(type(self)) for accurate signature.

NO_UPDATE = None#
IONIC_RELAXATION_RMM_DIIS = 1#
IONIC_RELAXATION_CG = 2#
class aiida_vasp.assistant.parameters.RelaxModeEnum[source]#

Bases: enum.IntEnum

Encode values for degrees of freedom mode of relaxation descriptively.

See: https://cms.mpi.univie.ac.at/wiki/index.php/ISIF

Initialization

Initialize self. See help(type(self)) for accurate signature.

POS_ONLY = 2#
POS_SHAPE_VOL = 3#
POS_SHAPE = 4#
SHAPE_ONLY = 5#
SHAPE_VOL = 6#
VOL_ONLY = 7#
classmethod get_isif_from_dof(**kwargs) aiida_vasp.assistant.parameters.RelaxModeEnum[source]#

Get the correct mode of relaxation for the given degrees of freedom.

class aiida_vasp.assistant.parameters.ParametersMassage(parameters: Any, unsupported_parameters: Any = None, settings: Any = None, skip_parameters_validation: bool = False)[source]#

A class that contains all relevant massaging of the input parameters for VASP.

The idea is that this class accepts the set input parameters from AiiDA (non code specifics), checks if any code specific parameters supplied are valid VASP input parameters (only rudimentary at this point, should also cross check and check types) and convert the AiiDA input parameters to VASP specific parameters. A set function needs to be developed for each VASP INCAR parameter that we want to set based on supplied AiiDA/AiiDA-VASP specific parameters. These set functions takes these parameters and converts it to VASP INCAR compatible tags. The parameter property should return ready to go parameters containing the default override namespace, the namespaces set in the _set_extra_parameters function and any additional namespaces that might have been set using the additional_override_namespaces setting entry in settings that can be supplied to the VaspWorkChain.

The default override namespace (see _DEFAULT_OVERRIDE_NAMESPACE) should always be present when using this VASP plugin. If using additional plugins, one can for instance supply additional namespace override that can be used, depending on what is needed in those plugins and how you construct your workchains.

Initialization

_valid_parameters_and_mtime: tuple[list[str], int] = None#
_check_valid_namespaces() None[source]#

Check that we do not have namespaces on the input parameters that is unsupported.

_load_valid_params() None[source]#

Import a list of valid parameters for VASP. This is generated from the manual.

_fetch_additional_override_namespaces() list[str][source]#

Check the settings for any additional supplied override namespace and return it.

_set_vasp_parameters() None[source]#

Iterate over the valid parameters and call the set function associated with that parameter.

_set_override_vasp_parameters() None[source]#

Set the any supplied override parameters.

_set_extra_vasp_parameters() None[source]#

Find if there are any extra parameters that are not part of the INCAR that needs to be set.

One example is the dynamic namespace which handles for instance flags for selective dynamics. These flags are more connected to a calculation than a StructureData and thus it was necessary to make sure it was valid input to the VASP workchain.

_set_additional_override_parameters() None[source]#

Set any customized parameter namespace, including its content on the massaged container.

_valid_vasp_parameter(key: str) bool[source]#

Make sure a key are recognized as a valid VASP input parameter.

_validate_vasp_parameters() None[source]#

Make sure all the massaged values are recognized as valid VASP input parameters.

_set(key: str) None[source]#

Call the necessary function to set each parameter.

property parameters: aiida.common.extendeddicts.AttributeDict#

Return the massaged parameter set ready to go in VASP format.

class aiida_vasp.assistant.parameters.ParameterSetFunctions(parameters: aiida.common.extendeddicts.AttributeDict, incar: aiida.common.extendeddicts.AttributeDict)[source]#

Container for the set functions that converts an AiiDA parameters to a default override specific one.

Initialization

set_encut() None[source]#

Set which plane wave cutoff to use.

See https://www.vasp.at/wiki/index.php/ENCUT

set_ibrion() None[source]#

Set which algorithm to use for ionic movements.

See: https://www.vasp.at/wiki/index.php/IBRION

set_ediffg() None[source]#

Set the cutoff to use for relaxation.

See: https://www.vasp.at/wiki/index.php/EDIFFG

set_nsw() None[source]#

Set the number of ionic steps to perform.

See: https://www.vasp.at/wiki/index.php/NSW

set_isif() None[source]#

Set relaxation mode according to the chosen degrees of freedom.

See: https://www.vasp.at/wiki/index.php/ISIF

set_ismear() None[source]#

Make sure we do not supply invalid integration methods when running explicit k-point grids.

See: https://www.vasp.at/wiki/index.php/ISMEAR

set_icharg() None[source]#

Set the flag to start from input charge density and keep it constant.

See: https://www.vasp.at/wiki/index.php/ICHARG

set_lorbit() None[source]#

Set the flag that controls the projectors/decomposition onto orbitals.

See: https://www.vasp.at/wiki/index.php/LORBIT

_set_wigner_seitz_radius() None[source]#

Set the Wigner Seitz radius that is used to project/decompose.

See: https://www.vasp.at/wiki/index.php/RWIGS

_relax() bool[source]#

Check if we have enabled relaxation.

_set_simple(target: str, value: Any) None[source]#

Set basic parameter.

aiida_vasp.assistant.parameters.check_inputs(supplied_inputs: None | aiida.common.extendeddicts.AttributeDict | aiida.orm.Dict | dict) aiida.common.extendeddicts.AttributeDict[source]#

Check that the inputs are of some correct type and returned as AttributeDict.

aiida_vasp.assistant.parameters.inherit_and_merge_parameters(inputs: dict[str, Any]) aiida.common.extendeddicts.AttributeDict[source]#

Goes trough the inputs namespaces and the namespaces in the inputs.parameters and merge them.

Note that parameters specified in the inputs.parameters will override what is supplied as workchain input, in case there is overlap.