kups.application.potential.classical.morse
¶
State-binding constructors for Morse bond potentials.
These adapters take a :class:~kups.core.lens.Lens into a concrete simulation
state and wire its particles, systems, bond indices, and parameters into the
state-agnostic factories in
kups.potential.classical.morse.
Parameters may live on the state (state.morse_bond_parameters) or be passed
directly via parameters=; in the latter case they are bound with a constant
lens and the state need not carry a parameter field. For incremental (probe)
updates with constant parameters, the cache is read from a conventional
morse_bond_cache attribute.
IsCachedMorseBondGraphState
¶
Bases: IsMorseBondGraphState, Protocol
:class:IsMorseBondGraphState carrying an incremental-update cache (params passed in).
Source code in src/kups/application/potential/classical/morse.py
IsMorseBondGraphState
¶
Bases: IsState[IsBondedParticles, HasCell[AnyPeriodicity]], Protocol
Particles, systems, and bond indices for a Morse bond (no parameters).
Source code in src/kups/application/potential/classical/morse.py
IsMorseBondState
¶
Bases: IsMorseBondGraphState, Protocol
:class:IsMorseBondGraphState that also carries Morse bond parameters.
Source code in src/kups/application/potential/classical/morse.py
make_morse_bond_from_state(state, probe=None, *, parameters=None, gradient=None)
¶
make_morse_bond_from_state(
state: Lens[
State,
IsMorseBondState[
MaybeCached[MorseBondParameters, Any]
],
],
probe: None = None,
*,
parameters: None = None,
gradient: None = None,
) -> Potential[State, EmptyType, EmptyType, Patch[Any]]
make_morse_bond_from_state(
state: Lens[
State,
IsMorseBondState[
MaybeCached[MorseBondParameters, Any]
],
],
probe: None = None,
*,
parameters: None = None,
gradient: Lens[Geometry, PositionsAndCell],
) -> Potential[
State, PositionsAndCell, EmptyType, Patch[Any]
]
make_morse_bond_from_state(
state: Lens[
State,
IsMorseBondState[
HasCache[
MorseBondParameters,
PotentialOut[EmptyType, EmptyType],
]
],
],
probe: Probe[
State,
P,
IsGraphProbe[IsBondedParticles, Literal[2]],
],
*,
parameters: None = None,
gradient: None = None,
) -> Potential[State, EmptyType, EmptyType, P]
make_morse_bond_from_state(
state: Lens[
State,
IsMorseBondState[
HasCache[
MorseBondParameters,
PotentialOut[PositionsAndCell, EmptyType],
]
],
],
probe: Probe[
State,
P,
IsGraphProbe[IsBondedParticles, Literal[2]],
],
*,
parameters: None = None,
gradient: Lens[Geometry, PositionsAndCell],
) -> Potential[State, PositionsAndCell, EmptyType, P]
make_morse_bond_from_state(
state: Lens[State, IsMorseBondGraphState],
probe: None = None,
*,
parameters: MorseBondParameters,
gradient: None = None,
) -> Potential[State, EmptyType, EmptyType, Patch[Any]]
make_morse_bond_from_state(
state: Lens[State, IsMorseBondGraphState],
probe: None = None,
*,
parameters: MorseBondParameters,
gradient: Lens[Geometry, PositionsAndCell],
) -> Potential[
State, PositionsAndCell, EmptyType, Patch[Any]
]
make_morse_bond_from_state(
state: Lens[
State,
IsCachedMorseBondGraphState[
PotentialOut[EmptyType, EmptyType]
],
],
probe: Probe[
State,
P,
IsGraphProbe[IsBondedParticles, Literal[2]],
],
*,
parameters: MorseBondParameters,
gradient: None = None,
) -> Potential[State, EmptyType, EmptyType, P]
make_morse_bond_from_state(
state: Lens[
State,
IsCachedMorseBondGraphState[
PotentialOut[PositionsAndCell, EmptyType]
],
],
probe: Probe[
State,
P,
IsGraphProbe[IsBondedParticles, Literal[2]],
],
*,
parameters: MorseBondParameters,
gradient: Lens[Geometry, PositionsAndCell],
) -> Potential[State, PositionsAndCell, 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, cell, and bond
indices (plus |
required |
probe
|
Any
|
If provided, detects particle changes and supplies the before/after fixed-edge neighbor lists for incremental updates. Those neighbor lists carry any required update capacity. |
None
|
parameters
|
MorseBondParameters | None
|
Constant Morse bond parameters. When given they are 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 Morse bond Potential. |