lennard_jones_pair_force

torch_sim.models.lennard_jones.lennard_jones_pair_force(dr, sigma=DEFAULT_SIGMA, epsilon=DEFAULT_EPSILON)[source]

Calculate pairwise Lennard-Jones forces between particles.

Implements the force derived from the 12-6 Lennard-Jones potential. The force is repulsive at short range and attractive at long range, with a zero-crossing at r=sigma.

The functional form is: F(r) = 24*epsilon/r * [(2*sigma^12/r^12) - (sigma^6/r^6)]

This is the negative gradient of the Lennard-Jones 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] for particle-specific interaction distances.

  • epsilon (Tensor) – Energy scale of the interaction. Either a scalar float or tensor of shape [n, m] for pair-specific interaction strengths.

Returns:

Pairwise Lennard-Jones forces between particles. Shape: [n, m].

Each element [i,j] represents the force magnitude between particles i and j. Positive values indicate repulsion, negative values indicate attraction.

Return type:

Tensor