kups.potential.classical.lennard_jones
¶
Lennard-Jones potential implementations with tail corrections.
This module provides the Lennard-Jones 12-6 potential for van der Waals interactions:
Includes variants with smooth tail corrections and analytical long-range corrections for periodic systems. Supports Lorentz-Berthelot mixing rules for multi-component systems.
GlobalTailCorrectedLennardJonesParameters
¶
Bases: LennardJonesParameters
Lennard-Jones parameters with analytical long-range correction.
Attributes:
| Name | Type | Description |
|---|---|---|
tail_corrected |
Array
|
Enable correction per species pair, shape |
Source code in src/kups/potential/classical/lennard_jones.py
from_dict(cutoff, parameters, mixing_rule, tail_correction=True)
classmethod
¶
Create tail-corrected parameters from a dict of per-species values.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cutoff
|
float | Array
|
Cutoff radius [Angstrom]. |
required |
parameters
|
dict[str, tuple[float | None, float | None]]
|
Map from species label to |
required |
mixing_rule
|
MixingRule
|
Combining rule for cross-species interactions. |
required |
tail_correction
|
bool
|
Whether to enable tail corrections for all non-zero epsilon pairs. |
True
|
Source code in src/kups/potential/classical/lennard_jones.py
HasLJParticlesAndSystems
¶
Bases: Protocol
Protocol for states with indexed particles and systems.
Source code in src/kups/potential/classical/lennard_jones.py
IsLJState
¶
Bases: HasLJParticlesAndSystems, Protocol
State with particles, systems, neighbor list, and LJ parameters.
Source code in src/kups/potential/classical/lennard_jones.py
LennardJonesParameters
¶
Lennard-Jones potential parameters.
Attributes:
| Name | Type | Description |
|---|---|---|
labels |
tuple[Label, ...]
|
Species labels as |
sigma |
Array
|
Length scale parameters [Ã…], shape |
epsilon |
Array
|
Energy well depths [energy units], shape |
cutoff |
Table[SystemId, Array]
|
Cutoff radius [Ã…], shape |
Source code in src/kups/potential/classical/lennard_jones.py
from_dict(cutoff, parameters, mixing_rule)
classmethod
¶
Create parameters from a dict of per-species values.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cutoff
|
float | Array
|
Cutoff radius [Angstrom]. |
required |
parameters
|
dict[str, tuple[float | None, float | None]]
|
Map from species label to |
required |
mixing_rule
|
MixingRule
|
Combining rule for cross-species interactions. |
required |
Source code in src/kups/potential/classical/lennard_jones.py
from_lorentz_berthelot_mixing(labels, sigma, epsilon, cutoff)
classmethod
¶
Create parameters using Lorentz-Berthelot mixing rules.
- σᵢⱼ = (σᵢ + σⱼ) / 2 (arithmetic mean)
- εᵢⱼ = √(εᵢ × εⱼ) (geometric mean)
Source code in src/kups/potential/classical/lennard_jones.py
PairTailCorrectedLennardJonesParameters
¶
Bases: LennardJonesParameters
Lennard-Jones parameters with smooth pairwise tail correction.
Attributes:
| Name | Type | Description |
|---|---|---|
truncation_radius |
Table[SystemId, Array]
|
Radius where smoothing begins [Ã…], shape |
Source code in src/kups/potential/classical/lennard_jones.py
global_lennard_jones_tail_correction_energy(inp)
¶
Compute analytical long-range tail correction energy.
Source code in src/kups/potential/classical/lennard_jones.py
global_lennard_jones_tail_correction_pressure(inp)
¶
Compute analytical long-range tail correction for pressure.
Source code in src/kups/potential/classical/lennard_jones.py
global_lennard_jones_tail_correction_pressure_from_state(key, state)
¶
Create long-range pressure correction from a typed state.
Source code in src/kups/potential/classical/lennard_jones.py
lennard_jones_edge_energy(inp)
¶
Compute Lennard-Jones energy per edge.
Source code in src/kups/potential/classical/lennard_jones.py
lennard_jones_energy(inp)
¶
Compute total Lennard-Jones energy per system.
Source code in src/kups/potential/classical/lennard_jones.py
make_global_lennard_jones_tail_correction_potential(particles_view, systems_view, parameter_view, gradient_lens, hessian_lens, hessian_idx_view, patch_idx_view=None, out_cache_lens=None)
¶
Create analytical long-range tail correction for Lennard-Jones potential.
Source code in src/kups/potential/classical/lennard_jones.py
make_global_lennard_jones_tail_correction_pressure(particles_view, systems_view, parameter_view)
¶
Create long-range pressure correction for Lennard-Jones systems.
Source code in src/kups/potential/classical/lennard_jones.py
make_lennard_jones_from_state(state, probe=None, *, compute_position_and_unitcell_gradients=False)
¶
make_lennard_jones_from_state(
state: Lens[
State,
IsLJState[MaybeCached[LennardJonesParameters, Any]],
],
probe: None = None,
*,
compute_position_and_unitcell_gradients: Literal[
False
] = ...,
) -> Potential[State, EmptyType, EmptyType, Patch]
make_lennard_jones_from_state(
state: Lens[
State,
IsLJState[MaybeCached[LennardJonesParameters, Any]],
],
probe: None = None,
*,
compute_position_and_unitcell_gradients: Literal[True],
) -> Potential[
State, PositionAndUnitCell, EmptyType, Patch
]
make_lennard_jones_from_state(
state: Lens[
State,
IsLJState[
HasCache[
LennardJonesParameters,
PotentialOut[EmptyType, EmptyType],
]
],
],
probe: Probe[State, P, IsRadiusGraphProbe],
*,
compute_position_and_unitcell_gradients: Literal[
False
] = ...,
) -> Potential[State, EmptyType, EmptyType, P]
make_lennard_jones_from_state(
state: Lens[
State,
IsLJState[
HasCache[
LennardJonesParameters,
PotentialOut[
PositionAndUnitCell, EmptyType
],
]
],
],
probe: Probe[State, P, IsRadiusGraphProbe],
*,
compute_position_and_unitcell_gradients: Literal[True],
) -> Potential[State, PositionAndUnitCell, EmptyType, P]
Create a LJ potential from a typed state, optionally with incremental updates.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
state
|
Any
|
Lens into the sub-state providing particles, systems, neighbor list, and LJ parameters. |
required |
probe
|
Any
|
Detects which particles changed since the last step.
|
None
|
compute_position_and_unitcell_gradients
|
bool
|
When |
False
|
Returns:
| Type | Description |
|---|---|
Any
|
Configured Lennard-Jones potential. |
Source code in src/kups/potential/classical/lennard_jones.py
make_lennard_jones_potential(particles_view, systems_view, neighborlist_view, parameter_view, probe, gradient_lens, hessian_lens, hessian_idx_view, patch_idx_view=None, out_cache_lens=None)
¶
Create a standard Lennard-Jones potential with sharp cutoff.
Source code in src/kups/potential/classical/lennard_jones.py
make_lennard_jones_tail_correction_from_state(state, *, compute_position_and_unitcell_gradients=False)
¶
Create a global tail-corrected LJ potential from a typed state.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
state
|
Any
|
Lens into the sub-state providing particles, systems, and LJ tail correction parameters. |
required |
compute_position_and_unitcell_gradients
|
bool
|
When |
False
|
Returns:
| Type | Description |
|---|---|
Any
|
Configured tail-corrected Lennard-Jones potential. |
Source code in src/kups/potential/classical/lennard_jones.py
make_pair_tail_corrected_lennard_jones_potential(particles_view, systems_view, neighborlist_view, parameter_view, probe, gradient_lens, hessian_lens, hessian_idx_view, patch_idx_view=None, out_cache_lens=None)
¶
Create a Lennard-Jones potential with smooth pairwise tail correction.
Source code in src/kups/potential/classical/lennard_jones.py
pair_tail_corrected_lennard_jones_energy(inp)
¶
Compute Lennard-Jones energy with smooth pairwise tail correction.