Potentials¶
Built-in interatomic potential calculators.
SoftSphere ¶
Bases: Calculator
Soft sphere potential calculator for purely repulsive interactions.
Implements a soft repulsive potential used for structure generation and packing optimization. The potential is zero when r >= sigma and purely repulsive for r < sigma.
Attributes:
Name | Type | Description |
---|---|---|
implemented_properties |
list of str
|
Calculable properties: energy, energies, forces, free_energy, stress, stresses |
default_parameters |
dict
|
Default values: sigma=1.0, epsilon=1.0, alpha=2, skin=0.2 |
Notes
The pairwise energy is \(u_{ij} = \frac{\epsilon}{\alpha}\) times \(\left(1 - \frac{r_{ij}}{\sigma}\right)^{\alpha}\) for \(r_{ij} < \sigma\). Energy partitioning uses symmetric approach with bothways=True neighbor list. Implementation based on JAX-MD (https://github.com/google/jax-md).
Initialize the SoftSphere calculator with the given parameters.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
**kwargs
|
dict
|
Calculator parameters. Supported parameters:
|
{}
|
Functions¶
calculate ¶
calculate(atoms: Optional[Atoms] = None, properties: Optional[list[str]] = None, system_changes: list[str] = all_changes) -> None
Calculate energy, forces and stress using soft sphere potential.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
atoms
|
Atoms
|
ASE Atoms object containing atomic positions and cell |
None
|
properties
|
list of str
|
Properties to calculate. If None, calculates all implemented properties |
None
|
system_changes
|
list of str
|
List of changes since last calculation |
all_changes
|
MultiLennardJones ¶
Bases: Calculator
Multi-species Lennard-Jones potential calculator.
Implements the classic 12-6 Lennard-Jones potential with support for multiple chemical species, mixing rules, and custom cross-interactions.
Attributes:
Name | Type | Description |
---|---|---|
implemented_properties |
list of str
|
Calculable properties: energy, energies, forces, free_energy, stress, stresses |
default_parameters |
dict
|
Default values: epsilon=1.0, sigma=1.0, rc=None, ro=None, smooth=False, mixing_rule='lorentz_berthelot', cross_interactions=None |
Notes
The 12-6 Lennard-Jones potential between atoms i and j. Energy: \(u_{ij}(r) = 4\epsilon_{ij}[(\sigma_{ij}/r)^{12} - (\sigma_{ij}/r)^6]\). See https://en.wikipedia.org/wiki/Lennard-Jones_potential for details.
Initialize Multi-Lennard-Jones calculator.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
**kwargs
|
dict
|
Calculator parameters. Supported parameters:
|
{}
|
Functions¶
calculate ¶
Calculate energy, forces and stress using Lennard-Jones potential.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
atoms
|
Atoms
|
ASE Atoms object containing atomic positions and cell |
None
|
properties
|
list of str
|
Properties to calculate. If None, calculates all implemented properties |
None
|
system_changes
|
list of str
|
List of changes since last calculation |
all_changes
|
cutoff_function ¶
Smooth cutoff function for Lennard-Jones potential.
Goes from 1 to 0 between ro and rc, ensuring that u(r) = lj(r) * cutoff_function(r) is continuously differentiable (C^1). Defined as 1 below ro, 0 above rc.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
r
|
float or ndarray
|
Squared distance r_ij^2 |
required |
rc
|
float
|
Squared cutoff distance |
required |
ro
|
float
|
Squared onset distance for cutoff |
required |
Returns:
Type | Description |
---|---|
float or ndarray
|
Cutoff function value(s) |
Notes
All distances (r, rc, ro) are expected to be squared. Taken from https://github.com/google/jax-md.
d_cutoff_function ¶
Derivative of smooth cutoff function with respect to r.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
r
|
float or ndarray
|
Squared distance r_ij^2 |
required |
rc
|
float
|
Squared cutoff distance |
required |
ro
|
float
|
Squared onset distance for cutoff |
required |
Returns:
Type | Description |
---|---|
float or ndarray
|
Derivative of cutoff function |
Notes
Since r = r_ij^2, for the derivative with respect to r_ij, multiply by 2*r_ij. The factor of 2 appears naturally, and r_ij cancels when converting from scalar distance to distance vector (d r_ij / d d_ij).