kups.potential.classical.internal
¶
Internal energy corrections for rigid molecular motifs.
This module provides potential energy corrections accounting for intramolecular energies of rigid molecules. Useful when only intermolecular interactions should be computed (e.g., rigid body Monte Carlo with pre-optimized geometries).
InternalEnergies
¶
Bases: Potential[State, EmptyType, EmptyType, StatePatch]
Potential providing fixed internal energies for molecular motifs.
Computes total energy by summing precomputed motif energies for all molecules in each system. Used to add/subtract intramolecular contributions in rigid body simulations where internal geometries are fixed.
Class Type Parameters:
| Name | Bound or Constraints | Description | Default |
|---|---|---|---|
State
|
Simulation state type |
required | |
StatePatch
|
Patch[Any]
|
Patch type for state updates |
required |
Attributes:
| Name | Type | Description |
|---|---|---|
motifs |
View[State, Table[ParticleId, MotifData]]
|
Lens to indexed motif data |
motif_potential_out |
View[State, Energy]
|
Lens to precomputed motif energies |
Note
Currently does not support gradients or Hessians (rigid molecules).
Source code in src/kups/potential/classical/internal.py
__call__(state, patch=None, *, include_compensate=False)
¶
Sum the precomputed motif energies per system.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
state
|
State
|
Current simulation state |
required |
patch
|
StatePatch | None
|
Optional state patch applied before summing |
None
|
include_compensate
|
bool
|
Return the accumulator instead of its value. The energies are read from a table rather than accumulated, so the compensation is zero. |
False
|
Returns:
| Type | Description |
|---|---|
PotentialResult[State, EmptyType, EmptyType] | CompensatedPotentialResult[State, EmptyType, EmptyType]
|
Potential output with an identity patch |