Metadynamics Potential Configs¶
- class mlip.simulation.metadynamics.potential_terms.DistanceCVConfig(*, atom_indices_1: Sequence[int], atom_indices_2: Sequence[int], type: Literal['distance'] = 'distance')¶
Config for a distance collective variable (CV) between two groups of atoms.
Distance is computed between the centroid of each group of atoms, where each group contains one or more atoms.
Can be passed to the
MetadynamicsConfig.bias_cvslist to add a distance CV to the bias term of the metadynamics potential.- Parameters:
atom_indices_1 – Indices specifying the first group of atoms. For a single atom, pass a one-element sequence, e.g.
[10].atom_indices_2 – Indices specifying the second group of atoms. For a single atom, pass a one-element sequence, e.g.
[10].type – Discriminator field; always
"distance".
- class mlip.simulation.metadynamics.potential_terms.AngleCVConfig(*, atom_indices: tuple[int, int, int], type: Literal['angle'] = 'angle')¶
Config for a bond-angle collective variable (CV).
Bond-angle is computed for the triplet p–q–r, where q is the vertex atom.
Can be passed to the
MetadynamicsConfig.bias_cvslist to add a bond-angle CV to the bias term of the metadynamics potential.- atom_indices¶
Triplet of atom indices
(p, q, r), where q is the vertex atom.- Type:
tuple[int, int, int]
- type¶
Discriminator field; always
"angle".- Type:
Literal[‘angle’]
- class mlip.simulation.metadynamics.potential_terms.DihedralCVConfig(*, atom_indices: tuple[int, int, int, int], type: Literal['dihedral'] = 'dihedral')¶
Config for a dihedral-angle collective variable (CV).
Dihedral is computed for the quadruplet i–j–k–l, with range (-π, π).
Can be passed to the
MetadynamicsConfig.bias_cvslist to add a dihedral-angle CV to the bias term of the metadynamics potential.- atom_indices¶
Quadruplet of atom indices
(i, j, k, l).- Type:
tuple[int, int, int, int]
- type¶
Discriminator field; always
"dihedral".- Type:
Literal[‘dihedral’]
- class mlip.simulation.metadynamics.potential_terms.CoordinationNumberCVConfig(*, central_idx: int, element: str, r0: float = 3.15, nn: int = 12, mm: int = 24, d_max: float = 5.0, neighbor_indices: Array | None = None, type: Literal['coordnum'] = 'coordnum')¶
Config for a coordination number collective variable (CV).
Computes the sum of switching-function values over a set of neighbor atoms, yielding a differentiable approximation to integer coordination number. The switching function is evaluated using Horner’s method:
s(r) = (1 + (r/r0) + ... + (r/r0)^(nn-1)) / (1 + (r/r0) + ... + (r/r0)^(mm-1))
which approximates
(1 - (r/r0)^nn) / (1 - (r/r0)^mm)forr != r0.Can be passed to the
MetadynamicsConfig.bias_cvslist to add a coordination number CV to the bias term of the metadynamics potential.- central_idx¶
Index of the central atom.
- Type:
int
- element¶
Element symbol of the neighbor element type to count (e.g.
"N").- Type:
str
- r0¶
Reference distance (Å) at which the switching function equals 0.5. Default 3.15.
- Type:
float
- nn¶
Numerator exponent of the switching function. Default 12.
- Type:
int
- mm¶
Denominator exponent; must satisfy
mm > nn. Default 24.- Type:
int
- d_max¶
Hard distance cutoff (Å). Default 5.0.
- Type:
float
- neighbor_indices¶
Atom indices of the neighbor element type, populated by calling
resolve. Do not set manually.- Type:
jax.Array | None
- type¶
Discriminator field; always
"coordnum".- Type:
Literal[‘coordnum’]
- class mlip.simulation.metadynamics.potential_terms.DistanceWallConfig(*, atom_indices_1: Sequence[int], atom_indices_2: Sequence[int], kappa: float, lower: float | None = None, upper: float | None = None, exp: int = 2, type: Literal['distance'] = 'distance')¶
Config for a distance wall potential between two (groups of) atoms.
Distance is computed between the centroid of each group of atoms, where each group contains one or more atoms.
Can be used to configure a lower wall, an upper wall, or both.
Can be passed to the
MetadynamicsConfig.wallslist to add pairwise distance wall term(s) to the metadynamics potential.- atom_indices_1¶
Indices specifying the first group of atoms. For a single atom, pass a one-element sequence, e.g.
[10].- Type:
collections.abc.Sequence[int]
- atom_indices_2¶
Indices specifying the second group of atoms. For a single atom, pass a one-element sequence, e.g.
[10].- Type:
collections.abc.Sequence[int]
- kappa¶
Wall force constant in eV / Å^exp.
- Type:
float
- lower¶
Lower wall threshold in Å. Penalty when distance < lower. If None, no lower wall is added.
- Type:
float | None
- upper¶
Upper wall threshold in Å. Penalty when distance > upper. If None, no upper wall is added.
- Type:
float | None
- exp¶
Wall exponent. Default = 2 (harmonic wall).
- Type:
int
- type¶
Discriminator field; always
"distance".- Type:
Literal[‘distance’]
- class mlip.simulation.metadynamics.potential_terms.AngleWallConfig(*, atom_indices: tuple[int, int, int], kappa: float, lower_rad: float | None = None, upper_rad: float | None = None, exp: int = 2, type: Literal['angle'] = 'angle')¶
Config for a bond-angle wall potential.
Bond-angle is computed for the triplet p–q–r, where q is the vertex atom.
Can be used to configure a lower wall, an upper wall, or both.
Can be passed to the
MetadynamicsConfig.wallslist to add bond-angle wall term(s) to the metadynamics potential.- atom_indices¶
Triplet of atom indices
(p, q, r)where q is the vertex.- Type:
tuple[int, int, int]
- kappa¶
Wall force constant in eV / rad^exp.
- Type:
float
- lower_rad¶
Lower wall threshold in radians. Penalty when angle < lower. If None, no lower wall is added.
- Type:
float | None
- upper_rad¶
Upper wall threshold in radians. Penalty when angle > upper. If None, no upper wall is added.
- Type:
float | None
- exp¶
Wall exponent. Default = 2 (harmonic wall).
- Type:
int
- type¶
Discriminator field; always
"angle".- Type:
Literal[‘angle’]
- class mlip.simulation.metadynamics.potential_terms.PositionalRestraintConfig(*, kappa: float, atom_indices: list[int] | None = None, start_atom_index: int | None = None, initial_positions: Array | None = None, type: Literal['positional'] = 'positional')¶
Config for a harmonic positional restraint potential on a set of atoms.
Adds a potential to keep a set of atoms close to their initial positions.
Can be passed to the
MetadynamicsConfig.restraintslist to add a harmonic positional restraint potential term to the metadynamics potential.- kappa¶
Restraint force constant in eV / Ų.
- Type:
float
- atom_indices¶
Indices of atoms to restrain. Mutually exclusive with
start_atom_index; one of the two must be provided.- Type:
list[int] | None
- start_atom_index¶
If
atom_indicesisNone, a BFS is performed from this atom to identify the restrained fragment.- Type:
int | None
- initial_positions¶
Reference positions populated by calling
resolve. Do not set manually.- Type:
jax.Array | None
- type¶
Discriminator field; always
"positional".- Type:
Literal[‘positional’]