torch_sim.models.soft_sphereΒΆ

Soft sphere model for computing energies, forces and stresses.

This module provides implementations of soft sphere potentials for molecular dynamics simulations. Soft sphere potentials are repulsive interatomic potentials that model the core repulsion between atoms, avoiding the infinite repulsion of hard sphere models while maintaining computational efficiency.

The soft sphere potential has the form:

V(r) = epsilon * (sigma/r)^alpha

Where:

  • r is the distance between particles

  • sigma is the effective diameter of the particles

  • epsilon controls the energy scale

  • alpha determines the steepness of the repulsion (typically alpha >= 2)

Soft sphere models are particularly useful for:

  • Granular matter simulations

  • Modeling excluded volume effects

  • Initial equilibration of dense systems

  • Coarse-grained molecular dynamics

Example:

# Create a soft sphere model with default parameters
model = SoftSphereModel()

# Calculate properties for a simulation state
results = model(sim_state)
energy = results["energy"]
forces = results["forces"]

# For multiple species with different interaction parameters
multi_model = SoftSphereMultiModel(
    species=particle_types,
    sigma_matrix=size_matrix,
    epsilon_matrix=strength_matrix,
)
results = multi_model(sim_state)

Classes

SoftSphereModel

Calculator for soft sphere potential energies and forces.

SoftSphereMultiModel

Calculator for systems with multiple particle types.