kups.potential.classical.morse
¶
Morse bond stretching potential.
Reference: Rappé et al. (1992) "UFF, a Full Periodic Table Force Field" J. Am. Chem. Soc. 114, 10024-10035. DOI: 10.1021/ja00051a040
Functional form:
More accurate than harmonic for large displacements with proper dissociation behavior. Near equilibrium, Morse approximates harmonic with force constant \(k = 2 D \alpha^2\).
IsBondedParticles
¶
Bases: HasPositionsAndLabels, HasSystemIndex, Protocol
Particle data with positions, labels, and system index.
Source code in src/kups/potential/classical/morse.py
IsMorseBondState
¶
Bases: Protocol
Protocol for states providing all inputs for the Morse bond potential.
Source code in src/kups/potential/classical/morse.py
MorseBondParameters
¶
Morse bond potential parameters.
Attributes:
| Name | Type | Description |
|---|---|---|
labels |
tuple[Label, ...]
|
Species labels, shape |
r0 |
Array
|
Equilibrium bond lengths [Å], shape |
D |
Array
|
Bond dissociation energy (well depth), shape |
alpha |
Array
|
Width parameter [Å⁻¹], shape |
Source code in src/kups/potential/classical/morse.py
from_harmonic(labels, r0, k, D)
classmethod
¶
Create Morse parameters from harmonic force constant.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
labels
|
tuple[str, ...]
|
Species labels, shape |
required |
r0
|
Array
|
Equilibrium bond lengths [Å], shape |
required |
k
|
Array
|
Harmonic force constants [energy/Ų], shape |
required |
D
|
Array
|
Bond dissociation energies, shape |
required |
Returns:
| Type | Description |
|---|---|
MorseBondParameters
|
MorseBondParameters with computed alpha values |
Source code in src/kups/potential/classical/morse.py
from_uff(labels, bond_radius, electronegativity, effective_charge, dissociation_energy)
classmethod
¶
Create Morse parameters using UFF bond length/force constant formulas.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
labels
|
tuple[str, ...]
|
Species labels, shape |
required |
bond_radius
|
Array
|
Valence bond radii [Å], shape |
required |
electronegativity
|
Array
|
GMP electronegativity, shape |
required |
effective_charge
|
Array
|
Effective atomic charge Z*, shape |
required |
dissociation_energy
|
Array
|
Bond dissociation energy D, shape |
required |
Returns:
| Type | Description |
|---|---|
MorseBondParameters
|
MorseBondParameters with full interaction matrices |
Source code in src/kups/potential/classical/morse.py
make_morse_bond_from_state(state, probe=None, *, compute_position_and_unitcell_gradients=False)
¶
make_morse_bond_from_state(
state: Lens[
State,
IsMorseBondState[
MaybeCached[MorseBondParameters, Any]
],
],
probe: None = None,
*,
compute_position_and_unitcell_gradients: Literal[
False
] = ...,
) -> Potential[State, EmptyType, EmptyType, Patch]
make_morse_bond_from_state(
state: Lens[
State,
IsMorseBondState[
MaybeCached[MorseBondParameters, Any]
],
],
probe: None = None,
*,
compute_position_and_unitcell_gradients: Literal[True],
) -> Potential[
State, PositionAndUnitCell, EmptyType, Patch
]
make_morse_bond_from_state(
state: Lens[
State,
IsMorseBondState[
HasCache[
MorseBondParameters,
PotentialOut[EmptyType, EmptyType],
]
],
],
probe: Probe[
State,
P,
IsEdgeSetGraphProbe[IsBondedParticles, Literal[2]],
],
*,
compute_position_and_unitcell_gradients: Literal[
False
] = ...,
) -> Potential[State, EmptyType, EmptyType, P]
make_morse_bond_from_state(
state: Lens[
State,
IsMorseBondState[
HasCache[
MorseBondParameters,
PotentialOut[
PositionAndUnitCell, EmptyType
],
]
],
],
probe: Probe[
State,
P,
IsEdgeSetGraphProbe[IsBondedParticles, Literal[2]],
],
*,
compute_position_and_unitcell_gradients: Literal[True],
) -> Potential[State, PositionAndUnitCell, EmptyType, P]
Create a Morse bond potential from a typed state, optionally with incremental updates.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
state
|
Any
|
Lens into the sub-state providing particles, unit cell, edges, and Morse bond parameters. |
required |
probe
|
Any
|
Detects which particles and edges changed since the last step.
If |
None
|
compute_position_and_unitcell_gradients
|
bool
|
When |
False
|
Returns:
| Type | Description |
|---|---|
Any
|
Configured Morse bond Potential. |
Source code in src/kups/potential/classical/morse.py
make_morse_bond_potential(particles_view, edges_view, systems_view, parameter_view, probe, gradient_lens, hessian_lens, hessian_idx_view, patch_idx_view=None, out_cache_lens=None)
¶
Create Morse bond potential for explicitly defined bonds.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
particles_view
|
View[State, Table[ParticleId, IsBondedParticles]]
|
Extracts particle data (positions, species) with system index |
required |
edges_view
|
View[State, Edges[Literal[2]]]
|
Extracts bond connectivity |
required |
systems_view
|
View[State, Table[SystemId, HasUnitCell]]
|
Extracts indexed system data (unit cell) |
required |
parameter_view
|
View[State, MorseBondParameters]
|
Extracts MorseBondParameters |
required |
probe
|
Probe[State, P, IsEdgeSetGraphProbe[IsBondedParticles, Literal[2]]] | None
|
Grouped probe for incremental updates (particles, edges, capacity) |
required |
gradient_lens
|
Lens[MorseBondInput, Gradients]
|
Specifies gradients to compute |
required |
hessian_lens
|
Lens[Gradients, Hessians]
|
Specifies Hessians to compute |
required |
hessian_idx_view
|
View[State, Hessians]
|
Hessian index structure |
required |
patch_idx_view
|
View[State, PotentialOut[Gradients, Hessians]] | None
|
Cached output index structure |
None
|
out_cache_lens
|
Lens[State, PotentialOut[Gradients, Hessians]] | None
|
Cache location lens |
None
|
Returns:
| Type | Description |
|---|---|
Potential[State, Gradients, Hessians, P]
|
Morse bond Potential |
Source code in src/kups/potential/classical/morse.py
morse_bond_energy(inp)
¶
Compute Morse bond energy for all bonds.
Calculates energy as \(D [1 - e^{-\alpha(r - r_0)}]^2\) for each bond.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
inp
|
MorseBondInput
|
Graph potential input with Morse bond parameters |
required |
Returns:
| Type | Description |
|---|---|
WithPatch[Table[SystemId, Energy], IdPatch]
|
Total bond energy per system |