ZBL short-range potential

class metatrain.utils.additive.zbl.ZBL(hypers: Dict, dataset_info: DatasetInfo)[source]

Bases: Module

A simple model for short-range repulsive interactions.

The implementation here is equivalent to its LAMMPS counterpart, where we set the inner cutoff to 0 and the outer cutoff to the sum of the covalent radii of the two atoms as tabulated in ASE. Covalent radii that are not available in ASE are set to 0.2 Å (and a warning is issued).

Parameters:
  • hypers (Dict) – A dictionary of model hyperparameters. This parameter is ignored and is only present to be consistent with the general model API.

  • dataset_info (DatasetInfo) – An object containing information about the dataset, including target quantities and atomic types.

Initialize internal Module state, shared by both nn.Module and ScriptModule.

restart(dataset_info: DatasetInfo) ZBL[source]

Restart the model with a new dataset info.

Parameters:

dataset_info (DatasetInfo) – New dataset information to be used.

Returns:

The restarted model.

Return type:

ZBL

supported_outputs() Dict[str, ModelOutput][source]
Return type:

Dict[str, ModelOutput]

forward(systems: List[System], outputs: Dict[str, ModelOutput], selected_atoms: Labels | None = None) Dict[str, TensorMap][source]

Compute the energies of a system solely based on a ZBL repulsive potential.

Parameters:
  • systems (List[System]) – List of systems to calculate the ZBL energy.

  • outputs (Dict[str, ModelOutput]) – Dictionary containing the model outputs.

  • selected_atoms (Labels | None) – Optional selection of atoms for which to compute the predictions.

Returns:

A dictionary with the computed predictions for each system.

Raises:

ValueError – If the outputs contain unsupported keys.

Return type:

Dict[str, TensorMap]

get_pairwise_zbl(zi: Tensor, zj: Tensor, rij: Tensor) Tensor[source]

Ziegler-Biersack-Littmark (ZBL) potential.

Inputs are the atomic numbers (zi, zj) of the two atoms of interest and their distance rij.

Parameters:
  • zi (Tensor) – Atomic number of atom i.

  • zj (Tensor) – Atomic number of atom j.

  • rij (Tensor) – Distance between atom i and atom j.

Returns:

The ZBL potential energy between atom i and atom j.

Return type:

Tensor

requested_neighbor_lists() List[NeighborListOptions][source]
Return type:

List[NeighborListOptions]

static is_valid_target(target_name: str, target_info: TargetInfo) bool[source]

Finds if a TargetInfo object is compatible with the ZBL model.

Parameters:
  • target_name (str) – The name of the target to be checked.

  • target_info (TargetInfo) – The TargetInfo object to be checked.

Returns:

True if the target is compatible with the ZBL model, False otherwise.

Return type:

bool