kups.potential.common.direct
¶
Direct potential for models providing precomputed gradients.
Wraps model functions that directly produce energy and gradients (e.g., PyTorch force fields) into the kUPS Potential protocol. Unlike PotentialFromEnergy which uses autodiff, this passes through whatever gradients/Hessians the model provides.
DirectPotential
¶
Bases: Potential[State, Gradients, Hessians, StatePatch]
Potential wrapping models that directly produce gradients.
For models providing precomputed gradients (e.g., PyTorch force fields). Passes through whatever gradients and Hessians the model provides (typically Hessians=EmptyType).
Source code in src/kups/potential/common/direct.py
DirectPotentialFunction
¶
Bases: Protocol
Protocol for functions returning PotentialOut directly.