soft_sphere_pair_force¶
- torch_sim.models.soft_sphere.soft_sphere_pair_force(dr, sigma=DEFAULT_SIGMA, epsilon=DEFAULT_EPSILON, alpha=DEFAULT_ALPHA)[source]¶
Computes the pairwise repulsive forces between soft spheres with finite range.
This function implements a soft-core repulsive interaction that smoothly goes to zero at the cutoff distance sigma. The force magnitude is controlled by epsilon and its stiffness by alpha.
- Parameters:
dr (Tensor) – A tensor of shape [n, m] containing pairwise distances between particles, where n and m represent different particle indices.
sigma (Tensor) – Particle diameter defining the interaction cutoff distance. Can be either a float scalar or a tensor of shape [n, m] for particle-specific diameters.
epsilon (Tensor) – Energy scale of the interaction. Can be either a float scalar or a tensor of shape [n, m] for particle-specific interaction strengths.
alpha (Tensor) – Exponent controlling the stiffness of the repulsion. Higher values create a harder repulsion. Can be either a float scalar or a tensor of shape [n, m].
- Returns:
- Forces between particle pairs with shape [n, m]. Forces are zero
for distances greater than sigma.
- Return type: