kups.potential.classical.inversion
¶
UFF-style inversion (out-of-plane/improper) potential.
Reference: Rappe et al. (1992) "UFF, a Full Periodic Table Force Field" J. Am. Chem. Soc. 114, 10024-10035. DOI: 10.1021/ja00051a040
Functional form (Eq. 18):
The inversion center is atom I (index 0) with three neighbors J, K, L. The angle \(\omega\) is between the I-J bond and the I-K-L plane.
For sp2 centers (\(\omega_0 = 0\)): \(C_0=1\), \(C_1=-1\), \(C_2=0\), giving:
where K is the force constant (6 kcal/mol for sp2 carbon, 50 for carbonyl).
For non-sp2 centers (e.g., Group 5 atoms like PH3), coefficients are fit such that \(E(\omega_0)=0\) (minimum at equilibrium) and \(E(0)=E_{barrier}\):
- \(C_2 = \frac{1}{4 \sin^2(\omega_0)}\)
- \(C_1 = -4 C_2 \cos(\omega_0)\)
- \(C_0 = C_2 (2 \cos^2(\omega_0) + 1)\)
- K is scaled internally so that E(0) equals the barrier parameter
Note: The UFF paper specifies that when all 3 inversions per center are used (IJ/IKL, IK/IJL, IL/IJK), each barrier should be divided by 3.
InversionParameters
¶
UFF-style inversion potential parameters.
Attributes:
| Name | Type | Description |
|---|---|---|
labels |
tuple[Label, ...]
|
Species labels, shape |
omega0 |
Array
|
Equilibrium out-of-plane angles [radians],
shape |
k |
Array
|
Force constant or barrier [energy],
shape |
Source code in src/kups/potential/classical/inversion.py
from_uff(labels, inversion_barrier, omega0=None)
classmethod
¶
Create inversion parameters using UFF formulas.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
labels
|
tuple[str, ...]
|
Species labels, shape |
required |
inversion_barrier
|
Array
|
Barrier/force constant for each type, shape |
required |
omega0
|
Array | None
|
Equilibrium angle [radians], shape |
None
|
Returns:
| Type | Description |
|---|---|
InversionParameters
|
InversionParameters with full interaction matrices |
Source code in src/kups/potential/classical/inversion.py
IsBondedParticles
¶
Bases: HasPositionsAndLabels, HasSystemIndex, Protocol
Particle data with positions, labels, and system index.
Source code in src/kups/potential/classical/inversion.py
IsInversionState
¶
Bases: Protocol
Protocol for states providing all inputs for the inversion potential.
Source code in src/kups/potential/classical/inversion.py
inversion_energy(inp)
¶
Compute UFF-style inversion energy for all inversion centers.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
inp
|
InversionInput
|
Graph potential input with inversion parameters |
required |
Returns:
| Type | Description |
|---|---|
WithPatch[Table[SystemId, Energy], IdPatch]
|
Total inversion energy per system |
Source code in src/kups/potential/classical/inversion.py
make_inversion_from_state(state, probe=None, *, compute_position_and_unitcell_gradients=False)
¶
make_inversion_from_state(
state: Lens[
State,
IsInversionState[
MaybeCached[InversionParameters, Any]
],
],
probe: None = None,
*,
compute_position_and_unitcell_gradients: Literal[
False
] = ...,
) -> Potential[State, EmptyType, EmptyType, Patch]
make_inversion_from_state(
state: Lens[
State,
IsInversionState[
MaybeCached[InversionParameters, Any]
],
],
probe: None = None,
*,
compute_position_and_unitcell_gradients: Literal[True],
) -> Potential[
State, PositionAndUnitCell, EmptyType, Patch
]
make_inversion_from_state(
state: Lens[
State,
IsInversionState[
HasCache[
InversionParameters,
PotentialOut[EmptyType, EmptyType],
]
],
],
probe: Probe[
State,
P,
IsEdgeSetGraphProbe[IsBondedParticles, Literal[4]],
],
*,
compute_position_and_unitcell_gradients: Literal[
False
] = ...,
) -> Potential[State, EmptyType, EmptyType, P]
make_inversion_from_state(
state: Lens[
State,
IsInversionState[
HasCache[
InversionParameters,
PotentialOut[
PositionAndUnitCell, EmptyType
],
]
],
],
probe: Probe[
State,
P,
IsEdgeSetGraphProbe[IsBondedParticles, Literal[4]],
],
*,
compute_position_and_unitcell_gradients: Literal[True],
) -> Potential[State, PositionAndUnitCell, EmptyType, P]
Create an inversion potential, optionally with incremental updates.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
state
|
Any
|
Lens into the sub-state providing particles, unit cell, edges, and inversion parameters. |
required |
probe
|
Any
|
Detects which particles and edges changed since the last step. None for no incremental updates. |
None
|
compute_position_and_unitcell_gradients
|
bool
|
When True, computes gradients w.r.t. particle positions and lattice vectors. |
False
|
Returns:
| Type | Description |
|---|---|
Any
|
Configured inversion Potential. |
Source code in src/kups/potential/classical/inversion.py
make_inversion_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 UFF-style inversion potential for sp2/sp3 centers.
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[4]]]
|
Extracts inversion connectivity (4-tuples: center + 3 neighbors) |
required |
systems_view
|
View[State, Table[SystemId, HasUnitCell]]
|
Extracts indexed system data (unit cell) |
required |
parameter_view
|
View[State, InversionParameters]
|
Extracts InversionParameters |
required |
probe
|
Probe[State, Ptch, IsEdgeSetGraphProbe[IsBondedParticles, Literal[4]]] | None
|
Grouped probe for incremental updates (particles, edges, capacity) |
required |
gradient_lens
|
Lens[InversionInput, 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, Ptch]
|
Inversion Potential |