potentials
#
Evaluate the potential energy of parameterized topologies.
Modules:
Functions:
-
broadcast_exceptions
–Returns the indices of the parameters that should be used to model interactions
-
broadcast_idxs
–Broadcasts the particle indices of each topology for a given potential
-
broadcast_parameters
–Returns parameters for the full system by broadcasting and stacking the
-
compute_energy
–Computes the potential energy [kcal / mol] of a system / topology in a given
-
compute_energy_potential
–Computes the potential energy [kcal / mol] due to a SMIRNOFF potential
-
potential_energy_fn
–A decorator used to flag a function as being able to compute the potential for a
broadcast_exceptions
#
broadcast_exceptions(
system: TensorSystem,
potential: TensorPotential,
idxs_a: Tensor,
idxs_b: Tensor,
) -> tuple[Tensor, Tensor]
Returns the indices of the parameters that should be used to model interactions between pairs of particles
Parameters:
-
system
(TensorSystem
) –The system.
-
potential
(TensorPotential
) –The potential whose parameters should be broadcast.
-
idxs_a
(Tensor
) –The indices of the first particle in each interaction with
shape=(n_interactions,)
. -
idxs_b
(Tensor
) –The indices of the second particle in each interaction with
shape=(n_interactions,)
.
Returns:
-
tuple[Tensor, Tensor]
–The indices of the interactions that require an exception, and the parameters to use for those interactions.
Source code in smee/potentials/_potentials.py
broadcast_idxs
#
broadcast_idxs(
system: TensorSystem, potential: TensorPotential
) -> Tensor
Broadcasts the particle indices of each topology for a given potential to the full system.
Parameters:
-
system
(TensorSystem
) –The system.
-
potential
(TensorPotential
) –The potential.
Returns:
-
Tensor
–The indices with shape
(n_interactions, n_interacting_particles)
wheren_interacting_particles
is 2 for bonds, 3 for angles, etc.
Source code in smee/potentials/_potentials.py
broadcast_parameters
#
broadcast_parameters(
system: TensorSystem, potential: TensorPotential
) -> Tensor
Returns parameters for the full system by broadcasting and stacking the parameters of each topology.
Parameters:
-
system
(TensorSystem
) –The system.
-
potential
(TensorPotential
) –The potential whose parameters should be broadcast.
Returns:
-
Tensor
–The parameters for the full system with
shape=(n_parameters, n_parameter_cols)
.
Source code in smee/potentials/_potentials.py
compute_energy
#
compute_energy(
system: TensorSystem | TensorTopology,
force_field: TensorForceField,
conformer: Tensor,
box_vectors: Tensor | None = None,
) -> Tensor
Computes the potential energy [kcal / mol] of a system / topology in a given conformation(s).
Parameters:
-
system
(TensorSystem | TensorTopology
) –The system or topology to compute the potential energy of.
-
force_field
(TensorForceField
) –The force field that defines the potential energy function.
-
conformer
(Tensor
) –The conformer(s) to evaluate the potential at with
shape=(n_particles, 3)
orshape=(n_confs, n_particles, 3)
. -
box_vectors
(Tensor | None
, default:None
) –The box vectors of the system with
shape=(3, 3)
if the system is periodic, orNone
if the system is non-periodic.
Returns:
-
Tensor
–The potential energy of the conformer(s) [kcal / mol].
Source code in smee/potentials/_potentials.py
compute_energy_potential
#
compute_energy_potential(
system: TensorSystem | TensorTopology,
potential: TensorPotential,
conformer: Tensor,
box_vectors: Tensor | None = None,
pairwise: Optional[PairwiseDistances] = None,
) -> Tensor
Computes the potential energy [kcal / mol] due to a SMIRNOFF potential handler for a given conformer(s).
Parameters:
-
system
(TensorSystem | TensorTopology
) –The system or topology to compute the potential energy of.
-
potential
(TensorPotential
) –The potential describing the energy function to compute.
-
conformer
(Tensor
) –The conformer(s) to evaluate the potential at with
shape=(n_particles, 3)
orshape=(n_confs, n_particles, 3)
. -
box_vectors
(Tensor | None
, default:None
) –The box vectors of the system with
shape=(3, 3)
or shape=(n_confs, 3, 3)if the system is periodic, or
None`` if the system is non-periodic. -
pairwise
(Optional[PairwiseDistances]
, default:None
) –Pre-computed pairwise distances between particles in the system.
Returns:
-
Tensor
–The potential energy of the conformer(s) [kcal / mol].
Source code in smee/potentials/_potentials.py
potential_energy_fn
#
A decorator used to flag a function as being able to compute the potential for a specific handler and its associated energy expression.