aiida_mlip.calculations package

Submodules

aiida_mlip.calculations.base module

Base class for features common to most calculations.

class aiida_mlip.calculations.base.BaseJanus(*args: Any, **kwargs: Any)[source]

Bases: CalcJob

Calcjob implementation to run single point calculations using mlips.

Attributes:
DEFAULT_OUTPUT_FILEstr

Default stdout file name.

DEFAULT_INPUT_FILEstr

Default input file name.

LOG_FILEstr

Default log file name.

Methods

define(spec: CalcJobProcessSpec) -> None:

Define the process specification, its inputs, outputs and exit codes.

validate_inputs(value: dict, port_namespace: PortNamespace) -> Optional[str]:

Check if the inputs are valid.

prepare_for_submission(folder: Folder) -> CalcInfo:

Create the input files for the CalcJob.

DEFAULT_INPUT_FILE = 'aiida.xyz'
DEFAULT_OUTPUT_FILE = 'aiida-stdout.txt'
LOG_FILE = 'aiida.log'
__abstractmethods__ = frozenset({})
__annotations__ = {'CACHE_VERSION': 'int | None', 'CLASS_NAME': 'str', 'KEY_CACHE_VERSION': 'str', 'SINGLE_OUTPUT_LINKNAME': 'str', 'STATES': 'Optional[Sequence[Type[State]]]', '_STATES_MAP': 'Optional[Dict[Hashable, Type[State]]]', '__called': 'bool', '_auto_persist': 'Optional[Set[str]]', '_cleanups': 'Optional[List[Callable[[], None]]]', '_creation_time': 'Optional[float]', '_event_callbacks': 'Dict[Hashable, List[EVENT_CALLBACK_TYPE]]', '_interrupt_action': 'Optional[futures.CancellableAction]', '_killing': 'Optional[futures.CancellableAction]', '_node': 'Optional[orm.ProcessNode]', '_outputs': 'Dict[str, Any]', '_parsed_inputs': 'Optional[utils.AttributesFrozendict]', '_paused': 'Optional[persistence.SavableFuture]', '_pausing': 'Optional[futures.CancellableAction]', '_pre_paused_status': 'Optional[str]', '_state': 'Optional[State]', '_status': 'Optional[str]', '_uuid': 'Optional[uuid.UUID]', 'link_label_retrieved': 'str'}
__module__ = 'aiida_mlip.calculations.base'
_abc_impl = <_abc._abc_data object>
_add_arch_to_cmdline(cmd_line: dict) dict[source]

Find architecture in inputs or config file and add to command line if needed.

Parameters:
cmd_linedict

Dictionary containing the cmd line keys.

Returns:
dict

Dictionary containing the cmd line keys updated with the architecture.

_add_model_to_cmdline(cmd_line: dict, folder: Folder) dict[source]

Find model in inputs or config file and add to command line if needed.

Parameters:
cmd_linedict

Dictionary containing the cmd line keys.

folder~aiida.common.folders.Folder

Folder where the calculation is run.

Returns:
dict

Dictionary containing the cmd line keys updated with the model.

_spec = <aiida.engine.processes.process_spec.CalcJobProcessSpec object>
classmethod define(spec: CalcJobProcessSpec) None[source]

Define the process specification, its inputs, outputs and exit codes.

Parameters:
specaiida.engine.CalcJobProcessSpec

The calculation job process spec to define.

prepare_for_submission(folder: Folder) CalcInfo[source]

Create the input files for the Calcjob.

Parameters:
folderaiida.common.folders.Folder

Folder where the calculation is run.

Returns:
aiida.common.datastructures.CalcInfo

An instance of aiida.common.datastructures.CalcInfo.

aiida_mlip.calculations.base.validate_inputs(inputs: dict, port_namespace: PortNamespace)[source]

Check if the inputs are valid.

Parameters:
inputsdict

The inputs dictionary.

port_namespaceaiida.engine.processes.ports.PortNamespace

An instance of aiida’s PortNamespace.

Raises:
ValueError

Error message if validation fails, None otherwise.

aiida_mlip.calculations.descriptors module

Class to run descriptors calculations.

class aiida_mlip.calculations.descriptors.Descriptors(*args: Any, **kwargs: Any)[source]

Bases: Singlepoint

Calcjob implementation to calculate MLIP descriptors.

Methods

define(spec: CalcJobProcessSpec) -> None:

Define the process specification, its inputs, outputs and exit codes.

prepare_for_submission(folder: Folder) -> CalcInfo:

Create the input files for the CalcJob.

__abstractmethods__ = frozenset({})
__annotations__ = {'CACHE_VERSION': 'int | None', 'CLASS_NAME': 'str', 'KEY_CACHE_VERSION': 'str', 'SINGLE_OUTPUT_LINKNAME': 'str', 'STATES': 'Optional[Sequence[Type[State]]]', '_STATES_MAP': 'Optional[Dict[Hashable, Type[State]]]', '__called': 'bool', '_auto_persist': 'Optional[Set[str]]', '_cleanups': 'Optional[List[Callable[[], None]]]', '_creation_time': 'Optional[float]', '_event_callbacks': 'Dict[Hashable, List[EVENT_CALLBACK_TYPE]]', '_interrupt_action': 'Optional[futures.CancellableAction]', '_killing': 'Optional[futures.CancellableAction]', '_node': 'Optional[orm.ProcessNode]', '_outputs': 'Dict[str, Any]', '_parsed_inputs': 'Optional[utils.AttributesFrozendict]', '_paused': 'Optional[persistence.SavableFuture]', '_pausing': 'Optional[futures.CancellableAction]', '_pre_paused_status': 'Optional[str]', '_state': 'Optional[State]', '_status': 'Optional[str]', '_uuid': 'Optional[uuid.UUID]', 'link_label_retrieved': 'str'}
__module__ = 'aiida_mlip.calculations.descriptors'
_abc_impl = <_abc._abc_data object>
_spec = <aiida.engine.processes.process_spec.CalcJobProcessSpec object>
classmethod define(spec: CalcJobProcessSpec) None[source]

Define the process specification, its inputs, outputs and exit codes.

Parameters:
specaiida.engine.CalcJobProcessSpec

The calculation job process spec to define.

prepare_for_submission(folder: Folder) CalcInfo[source]

Create the input files for the Calcjob.

Parameters:
folderaiida.common.folders.Folder

Folder where the calculation is run.

Returns:
aiida.common.datastructures.CalcInfo

An instance of aiida.common.datastructures.CalcInfo.

aiida_mlip.calculations.geomopt module

Class to run geom opt calculations.

class aiida_mlip.calculations.geomopt.GeomOpt(*args: Any, **kwargs: Any)[source]

Bases: Singlepoint

Calcjob implementation to run geometry optimisation calculations using mlips.

Methods

define(spec: CalcJobProcessSpec) -> None:

Define the process specification, its inputs, outputs and exit codes.

prepare_for_submission(folder: Folder) -> CalcInfo:

Create the input files for the CalcJob.

DEFAULT_TRAJ_FILE = 'aiida-traj.xyz'
__abstractmethods__ = frozenset({})
__annotations__ = {'CACHE_VERSION': 'int | None', 'CLASS_NAME': 'str', 'KEY_CACHE_VERSION': 'str', 'SINGLE_OUTPUT_LINKNAME': 'str', 'STATES': 'Optional[Sequence[Type[State]]]', '_STATES_MAP': 'Optional[Dict[Hashable, Type[State]]]', '__called': 'bool', '_auto_persist': 'Optional[Set[str]]', '_cleanups': 'Optional[List[Callable[[], None]]]', '_creation_time': 'Optional[float]', '_event_callbacks': 'Dict[Hashable, List[EVENT_CALLBACK_TYPE]]', '_interrupt_action': 'Optional[futures.CancellableAction]', '_killing': 'Optional[futures.CancellableAction]', '_node': 'Optional[orm.ProcessNode]', '_outputs': 'Dict[str, Any]', '_parsed_inputs': 'Optional[utils.AttributesFrozendict]', '_paused': 'Optional[persistence.SavableFuture]', '_pausing': 'Optional[futures.CancellableAction]', '_pre_paused_status': 'Optional[str]', '_state': 'Optional[State]', '_status': 'Optional[str]', '_uuid': 'Optional[uuid.UUID]', 'link_label_retrieved': 'str'}
__module__ = 'aiida_mlip.calculations.geomopt'
_abc_impl = <_abc._abc_data object>
_spec = <aiida.engine.processes.process_spec.CalcJobProcessSpec object>
classmethod define(spec: CalcJobProcessSpec) None[source]

Define the process specification, its inputs, outputs and exit codes.

Parameters:
specaiida.engine.CalcJobProcessSpec

The calculation job process spec to define.

prepare_for_submission(folder: Folder) CalcInfo[source]

Create the input files for the Calcjob.

Parameters:
folderaiida.common.folders.Folder

Folder where the calculation is run.

Returns:
aiida.common.datastructures.CalcInfo

An instance of aiida.common.datastructures.CalcInfo.

aiida_mlip.calculations.md module

Class to run md calculations.

class aiida_mlip.calculations.md.MD(*args: Any, **kwargs: Any)[source]

Bases: BaseJanus

Calcjob implementation to run geometry MD calculations using mlips.

Methods

define(spec: CalcJobProcessSpec) -> None:

Define the process specification, its inputs, outputs and exit codes.

prepare_for_submission(folder: Folder) -> CalcInfo:

Create the input files for the CalcJob.

DEFAULT_STATS_FILE = 'aiida-stats.dat'
DEFAULT_SUMMARY_FILE = 'md_summary.yml'
DEFAULT_TRAJ_FILE = 'aiida-traj.xyz'
__abstractmethods__ = frozenset({})
__annotations__ = {'CACHE_VERSION': 'int | None', 'CLASS_NAME': 'str', 'KEY_CACHE_VERSION': 'str', 'SINGLE_OUTPUT_LINKNAME': 'str', 'STATES': 'Optional[Sequence[Type[State]]]', '_STATES_MAP': 'Optional[Dict[Hashable, Type[State]]]', '__called': 'bool', '_auto_persist': 'Optional[Set[str]]', '_cleanups': 'Optional[List[Callable[[], None]]]', '_creation_time': 'Optional[float]', '_event_callbacks': 'Dict[Hashable, List[EVENT_CALLBACK_TYPE]]', '_interrupt_action': 'Optional[futures.CancellableAction]', '_killing': 'Optional[futures.CancellableAction]', '_node': 'Optional[orm.ProcessNode]', '_outputs': 'Dict[str, Any]', '_parsed_inputs': 'Optional[utils.AttributesFrozendict]', '_paused': 'Optional[persistence.SavableFuture]', '_pausing': 'Optional[futures.CancellableAction]', '_pre_paused_status': 'Optional[str]', '_state': 'Optional[State]', '_status': 'Optional[str]', '_uuid': 'Optional[uuid.UUID]', 'link_label_retrieved': 'str'}
__module__ = 'aiida_mlip.calculations.md'
_abc_impl = <_abc._abc_data object>
_spec = <aiida.engine.processes.process_spec.CalcJobProcessSpec object>
classmethod define(spec: CalcJobProcessSpec) None[source]

Define the process specification, its inputs, outputs and exit codes.

Parameters:
specaiida.engine.CalcJobProcessSpec

The calculation job process spec to define.

prepare_for_submission(folder: Folder) CalcInfo[source]

Create the input files for the Calcjob.

Parameters:
folderaiida.common.folders.Folder

Folder where the calculation is run.

Returns:
aiida.common.datastructures.CalcInfo

An instance of aiida.common.datastructures.CalcInfo.

aiida_mlip.calculations.singlepoint module

Class to run single point calculations.

class aiida_mlip.calculations.singlepoint.Singlepoint(*args: Any, **kwargs: Any)[source]

Bases: BaseJanus

Calcjob implementation to run single point calculations using mlips.

Attributes:
XYZ_OUTPUTstr

Default xyz output file name.

Methods

define(spec: CalcJobProcessSpec) -> None:

Define the process specification, its inputs, outputs and exit codes.

validate_inputs(value: dict, port_namespace: PortNamespace) -> Optional[str]:

Check if the inputs are valid.

prepare_for_submission(folder: Folder) -> CalcInfo:

Create the input files for the CalcJob.

XYZ_OUTPUT = 'aiida-results.xyz'
__abstractmethods__ = frozenset({})
__annotations__ = {'CACHE_VERSION': 'int | None', 'CLASS_NAME': 'str', 'KEY_CACHE_VERSION': 'str', 'SINGLE_OUTPUT_LINKNAME': 'str', 'STATES': 'Optional[Sequence[Type[State]]]', '_STATES_MAP': 'Optional[Dict[Hashable, Type[State]]]', '__called': 'bool', '_auto_persist': 'Optional[Set[str]]', '_cleanups': 'Optional[List[Callable[[], None]]]', '_creation_time': 'Optional[float]', '_event_callbacks': 'Dict[Hashable, List[EVENT_CALLBACK_TYPE]]', '_interrupt_action': 'Optional[futures.CancellableAction]', '_killing': 'Optional[futures.CancellableAction]', '_node': 'Optional[orm.ProcessNode]', '_outputs': 'Dict[str, Any]', '_parsed_inputs': 'Optional[utils.AttributesFrozendict]', '_paused': 'Optional[persistence.SavableFuture]', '_pausing': 'Optional[futures.CancellableAction]', '_pre_paused_status': 'Optional[str]', '_state': 'Optional[State]', '_status': 'Optional[str]', '_uuid': 'Optional[uuid.UUID]', 'link_label_retrieved': 'str'}
__module__ = 'aiida_mlip.calculations.singlepoint'
_abc_impl = <_abc._abc_data object>
_spec = <aiida.engine.processes.process_spec.CalcJobProcessSpec object>
classmethod define(spec: CalcJobProcessSpec) None[source]

Define the process specification, its inputs, outputs and exit codes.

Parameters:
specaiida.engine.CalcJobProcessSpec

The calculation job process spec to define.

prepare_for_submission(folder: Folder) CalcInfo[source]

Create the input files for the Calcjob.

Parameters:
folderaiida.common.folders.Folder

Folder where the calculation is run.

Returns:
aiida.common.datastructures.CalcInfo

An instance of aiida.common.datastructures.CalcInfo.

aiida_mlip.calculations.train module

Class for training machine learning models.

class aiida_mlip.calculations.train.Train(*args: Any, **kwargs: Any)[source]

Bases: CalcJob

Calcjob implementation to train mlips.

Attributes:
DEFAULT_OUTPUT_FILEstr

Default stdout file name.

Methods

define(spec: CalcJobProcessSpec) -> None:

Define the process specification, its inputs, outputs and exit codes.

validate_inputs(value: dict, port_namespace: PortNamespace) -> Optional[str]:

Check if the inputs are valid.

prepare_for_submission(folder: Folder) -> CalcInfo:

Create the input files for the CalcJob.

DEFAULT_OUTPUT_FILE = 'aiida-stdout.txt'
__abstractmethods__ = frozenset({})
__annotations__ = {'CACHE_VERSION': 'int | None', 'CLASS_NAME': 'str', 'KEY_CACHE_VERSION': 'str', 'SINGLE_OUTPUT_LINKNAME': 'str', 'STATES': 'Optional[Sequence[Type[State]]]', '_STATES_MAP': 'Optional[Dict[Hashable, Type[State]]]', '__called': 'bool', '_auto_persist': 'Optional[Set[str]]', '_cleanups': 'Optional[List[Callable[[], None]]]', '_creation_time': 'Optional[float]', '_event_callbacks': 'Dict[Hashable, List[EVENT_CALLBACK_TYPE]]', '_interrupt_action': 'Optional[futures.CancellableAction]', '_killing': 'Optional[futures.CancellableAction]', '_node': 'Optional[orm.ProcessNode]', '_outputs': 'Dict[str, Any]', '_parsed_inputs': 'Optional[utils.AttributesFrozendict]', '_paused': 'Optional[persistence.SavableFuture]', '_pausing': 'Optional[futures.CancellableAction]', '_pre_paused_status': 'Optional[str]', '_state': 'Optional[State]', '_status': 'Optional[str]', '_uuid': 'Optional[uuid.UUID]', 'link_label_retrieved': 'str'}
__module__ = 'aiida_mlip.calculations.train'
_abc_impl = <_abc._abc_data object>
_spec = <aiida.engine.processes.process_spec.CalcJobProcessSpec object>
classmethod define(spec: CalcJobProcessSpec) None[source]

Define the process specification, its inputs, outputs and exit codes.

Parameters:
specaiida.engine.CalcJobProcessSpec

The calculation job process spec to define.

prepare_for_submission(folder: Folder) CalcInfo[source]

Create the input files for the Calcjob.

Parameters:
folderaiida.common.folders.Folder

Folder where the calculation is run.

Returns:
aiida.common.datastructures.CalcInfo

An instance of aiida.common.datastructures.CalcInfo.

aiida_mlip.calculations.train.validate_inputs(inputs: dict, port_namespace: PortNamespace)[source]

Check if the inputs are valid.

Parameters:
inputsdict

The inputs dictionary.

port_namespaceaiida.engine.processes.ports.PortNamespace

An instance of aiida’s PortNameSpace.

Raises:
InputValidationError

Error message if validation fails, None otherwise.

Module contents

Calculations using MLIPs.