kups.application.potential.classical.cosine_angle
¶
State-binding constructors for cosine angle potentials.
These adapters take a :class:~kups.core.lens.Lens into a concrete simulation
state and wire its particles, systems, angle indices, and parameters into the
state-agnostic factories in
kups.potential.classical.cosine_angle.
Parameters may live on the state (state.cosine_angle_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
cosine_angle_cache attribute.
IsCachedCosineAngleGraphState
¶
Bases: IsCosineAngleGraphState, Protocol
:class:IsCosineAngleGraphState carrying an incremental-update cache (params passed in).
Source code in src/kups/application/potential/classical/cosine_angle.py
IsCosineAngleGraphState
¶
Bases: IsState[IsBondedParticles, HasCell[AnyPeriodicity]], Protocol
Particles, systems, and angle indices for a cosine angle graph (no parameters).
Source code in src/kups/application/potential/classical/cosine_angle.py
IsCosineAngleState
¶
Bases: IsCosineAngleGraphState, Protocol
:class:IsCosineAngleGraphState that also carries parameters on the state.
Source code in src/kups/application/potential/classical/cosine_angle.py
make_cosine_angle_from_state(state, probe=None, *, parameters=None, gradient=None)
¶
make_cosine_angle_from_state(
state: Lens[
State,
IsCosineAngleState[
MaybeCached[CosineAngleParameters, Any]
],
],
probe: None = None,
*,
parameters: None = None,
gradient: None = None,
) -> Potential[State, EmptyType, EmptyType, Patch[Any]]
make_cosine_angle_from_state(
state: Lens[
State,
IsCosineAngleState[
MaybeCached[CosineAngleParameters, Any]
],
],
probe: None = None,
*,
parameters: None = None,
gradient: Lens[Geometry, PositionsAndCell],
) -> Potential[
State, PositionsAndCell, EmptyType, Patch[Any]
]
make_cosine_angle_from_state(
state: Lens[
State,
IsCosineAngleState[
HasCache[
CosineAngleParameters,
PotentialOut[EmptyType, EmptyType],
]
],
],
probe: Probe[
State,
P,
IsGraphProbe[IsBondedParticles, Literal[3]],
],
*,
parameters: None = None,
gradient: None = None,
) -> Potential[State, EmptyType, EmptyType, P]
make_cosine_angle_from_state(
state: Lens[
State,
IsCosineAngleState[
HasCache[
CosineAngleParameters,
PotentialOut[PositionsAndCell, EmptyType],
]
],
],
probe: Probe[
State,
P,
IsGraphProbe[IsBondedParticles, Literal[3]],
],
*,
parameters: None = None,
gradient: Lens[Geometry, PositionsAndCell],
) -> Potential[State, PositionsAndCell, EmptyType, P]
make_cosine_angle_from_state(
state: Lens[State, IsCosineAngleGraphState],
probe: None = None,
*,
parameters: CosineAngleParameters,
gradient: None = None,
) -> Potential[State, EmptyType, EmptyType, Patch[Any]]
make_cosine_angle_from_state(
state: Lens[State, IsCosineAngleGraphState],
probe: None = None,
*,
parameters: CosineAngleParameters,
gradient: Lens[Geometry, PositionsAndCell],
) -> Potential[
State, PositionsAndCell, EmptyType, Patch[Any]
]
make_cosine_angle_from_state(
state: Lens[
State,
IsCachedCosineAngleGraphState[
PotentialOut[EmptyType, EmptyType]
],
],
probe: Probe[
State,
P,
IsGraphProbe[IsBondedParticles, Literal[3]],
],
*,
parameters: CosineAngleParameters,
gradient: None = None,
) -> Potential[State, EmptyType, EmptyType, P]
make_cosine_angle_from_state(
state: Lens[
State,
IsCachedCosineAngleGraphState[
PotentialOut[PositionsAndCell, EmptyType]
],
],
probe: Probe[
State,
P,
IsGraphProbe[IsBondedParticles, Literal[3]],
],
*,
parameters: CosineAngleParameters,
gradient: Lens[Geometry, PositionsAndCell],
) -> Potential[State, PositionsAndCell, EmptyType, P]
Create a cosine angle 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 angle
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
|
CosineAngleParameters | None
|
Constant cosine angle parameters. When given they are bound
with a constant lens and the state need not carry
|
None
|
gradient
|
Lens[Geometry, PositionsAndCell] | None
|
Relaxation filter selecting the optimizer DOFs as a
|
None
|
Returns:
| Type | Description |
|---|---|
Any
|
Configured cosine angle Potential. |