mlcolvar.core.transform.descriptors.EigsAdjMat

class mlcolvar.core.transform.descriptors.EigsAdjMat(mode: str, cutoff: float, n_atoms: int, PBC: bool, cell: float | list, scaled_coords: bool = False, switching_function=None)[source]

Bases: Transform

Eigenvalues of the adjacency matrix for a set of atoms from their positions

__init__(mode: str, cutoff: float, n_atoms: int, PBC: bool, cell: float | list, scaled_coords: bool = False, switching_function=None) Tensor[source]

Initialize an eigenvalues of an adjacency matrix object.

Parameters:
  • mode (str) – Mode for cutoff application, either: - ‘continuous’: applies a switching function to the distances which can be specified with switching_function keyword, has stable derivatives - ‘discontinuous’: set at zero everything above the cutoff and one below, derivatives may be be incorrect

  • cutoff (float) – Cutoff for the adjacency criterion

  • 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

  • switching_function (_type_, optional) – Switching function to be applied for the cutoff, can be either initialized as a switching_functions/SwitchingFunctions class or a simple function, by default None

Returns:

Adjacency matrix of all the n_atoms according to cutoff

Return type:

torch.Tensor

Methods

__init__(mode, cutoff, n_atoms, PBC, cell[, ...])

Initialize an eigenvalues of an adjacency matrix object.

compute_adjacency_matrix(pos)

forward(x)

Define the computation performed at every call.

get_eigenvalues(x)

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 Module instance 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