mlcolvar.core.transform.descriptors.PairwiseDistances¶
- class mlcolvar.core.transform.descriptors.PairwiseDistances(n_atoms: int, PBC: bool, cell: float | list, scaled_coords: bool = False, slicing_pairs: list = None)[source]¶
Bases:
TransformNon duplicated pairwise distances for a set of atoms from their positions. Can compute either all the distances or a subset.
- __init__(n_atoms: int, PBC: bool, cell: float | list, scaled_coords: bool = False, slicing_pairs: list = None) Tensor[source]¶
Initialize a pairwise distances object. Can compute either all the distances or a subset based on the slicing_pairs key.
- Parameters:
n_atoms (int) – Number of atoms in the system
PBC (bool) – Switch for Periodic Boundary Conditions use
cell (Union[float, list]) – Dimensions of the real cell, orthorombic-like cells only
scaled_coords (bool) – Switch for coordinates scaled on cell’s vectors use, by default False
slicing_pairs (list) – indices of the subset of distances to be returned, by default None
- Returns:
Non duplicated pairwise distances
- Return type:
torch.Tensor
Methods
__init__(n_atoms, PBC, cell[, ...])Initialize a pairwise distances object.
compute_pairwise_distances(pos)forward(x)Define the computation performed at every call.
- forward(x: Tensor)[source]¶
Define the computation performed at every call.
Should be overridden by all subclasses.
Note
Although the recipe for forward pass needs to be defined within this function, one should call the
Moduleinstance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.
- setup_from_datamodule(datamodule)¶
Initialize parameters based on pytorch lighting datamodule.
Attributes
T_destination
call_super_init
dump_patches
training