kups.application.potential.mliap.tojax
¶
State-binding constructors for jaxified MLIAP potentials.
These adapters take a :class:~kups.core.lens.Lens into a concrete simulation
state and wire its particles, systems, neighbor list, and jaxified model into the
state-agnostic factories in kups.potential.mliap.tojax.
The jaxified model may live on the state (state.jaxified_model) or be passed
directly via parameters=; in the latter case it is bound with a constant lens
and the state need not carry a model field.
IsTojaxedGraphState
¶
Bases: IsState[IsTojaxedParticles, HasCell[AnyPeriodicity]], IsNeighborListState[IsUniversalNeighborlistParams], Protocol
Particles, systems, and neighbor list for a jaxified graph (no model).
Source code in src/kups/application/potential/mliap/tojax.py
IsTojaxedState
¶
Bases: IsTojaxedGraphState, Protocol
:class:IsTojaxedGraphState that also carries the jaxified model.
Source code in src/kups/application/potential/mliap/tojax.py
make_tojaxed_from_state(state, *, parameters=None, gradient=None, neighborlist_factory=AdaptiveNeighborList.from_state)
¶
make_tojaxed_from_state(
state: Lens[State, IsTojaxedState],
*,
parameters: None = None,
gradient: None = None,
neighborlist_factory: NeighborListFactory[
IsTojaxedState
] = ...,
) -> Potential[State, EmptyType, EmptyType, Patch[Any]]
make_tojaxed_from_state(
state: Lens[State, IsTojaxedState],
*,
parameters: None = None,
gradient: Lens[Geometry, PositionsAndCell],
neighborlist_factory: NeighborListFactory[
IsTojaxedState
] = ...,
) -> Potential[
State, PositionsAndCell, EmptyType, Patch[Any]
]
Create a jaxified potential from a typed state.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
state
|
Any
|
Lens into the sub-state providing particles, cell, and neighbor
list (plus |
required |
parameters
|
TojaxedMliap | None
|
Constant jaxified model. When given it is bound with a
constant lens and the state need not carry |
None
|
gradient
|
Lens[Geometry, PositionsAndCell] | None
|
Relaxation filter |
None
|
Returns:
| Type | Description |
|---|---|
Any
|
Configured jaxified Potential. |