morse_pair_force¶
- torch_sim.models.morse.morse_pair_force(dr, sigma=DEFAULT_SIGMA, epsilon=DEFAULT_EPSILON, alpha=DEFAULT_ALPHA)[source]¶
Calculate pairwise Morse forces between particles.
Implements the force derived from the Morse potential. The force changes from repulsive to attractive at r=sigma.
The functional form is: F(r) = 2*alpha*epsilon * exp(-alpha*(r-sigma)) * (1 - exp(-alpha*(r-sigma)))
This is the negative gradient of the Morse potential energy.
- Parameters:
dr (Tensor) – Pairwise distances between particles. Shape: [n, m].
sigma (Tensor) – Distance at which force changes from repulsive to attractive. Either a scalar float or tensor of shape [n, m].
epsilon (Tensor) – Energy scale of the interaction. Either a scalar float or tensor of shape [n, m].
alpha (Tensor) – Controls the force range and stiffness. Either a scalar float or tensor of shape [n, m].
- Returns:
- Pairwise Morse forces between particles. Shape: [n, m].
Positive values indicate repulsion, negative values indicate attraction.
- Return type: