kups.application.potential.classical.dihedral
¶
State-binding constructors for dihedral/torsion potentials.
These adapters take a :class:~kups.core.lens.Lens into a concrete simulation
state and wire its particles, systems, dihedral indices, and parameters into the
state-agnostic factories in kups.potential.classical.dihedral.
Parameters may live on the state (state.dihedral_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
dihedral_cache attribute.
IsCachedDihedralGraphState
¶
Bases: IsDihedralGraphState, Protocol
:class:IsDihedralGraphState carrying an incremental-update cache (params passed in).
Source code in src/kups/application/potential/classical/dihedral.py
IsDihedralGraphState
¶
Bases: IsState[IsBondedParticles, HasCell[AnyPeriodicity]], Protocol
Particles, systems, and dihedral indices (no parameters).
Source code in src/kups/application/potential/classical/dihedral.py
IsDihedralState
¶
Bases: IsDihedralGraphState, Protocol
:class:IsDihedralGraphState that also carries dihedral parameters.
Source code in src/kups/application/potential/classical/dihedral.py
make_dihedral_from_state(state, probe=None, *, parameters=None, gradient=None)
¶
make_dihedral_from_state(
state: Lens[
State,
IsDihedralState[
MaybeCached[DihedralParameters, Any]
],
],
probe: None = None,
*,
parameters: None = None,
gradient: None = None,
) -> Potential[State, EmptyType, EmptyType, Patch[Any]]
make_dihedral_from_state(
state: Lens[
State,
IsDihedralState[
MaybeCached[DihedralParameters, Any]
],
],
probe: None = None,
*,
parameters: None = None,
gradient: Lens[Geometry, PositionsAndCell],
) -> Potential[
State, PositionsAndCell, EmptyType, Patch[Any]
]
make_dihedral_from_state(
state: Lens[
State,
IsDihedralState[
HasCache[
DihedralParameters,
PotentialOut[EmptyType, EmptyType],
]
],
],
probe: Probe[
State,
P,
IsGraphProbe[IsBondedParticles, Literal[4]],
],
*,
parameters: None = None,
gradient: None = None,
) -> Potential[State, EmptyType, EmptyType, P]
make_dihedral_from_state(
state: Lens[
State,
IsDihedralState[
HasCache[
DihedralParameters,
PotentialOut[PositionsAndCell, EmptyType],
]
],
],
probe: Probe[
State,
P,
IsGraphProbe[IsBondedParticles, Literal[4]],
],
*,
parameters: None = None,
gradient: Lens[Geometry, PositionsAndCell],
) -> Potential[State, PositionsAndCell, EmptyType, P]
make_dihedral_from_state(
state: Lens[State, IsDihedralGraphState],
probe: None = None,
*,
parameters: DihedralParameters,
gradient: None = None,
) -> Potential[State, EmptyType, EmptyType, Patch[Any]]
make_dihedral_from_state(
state: Lens[State, IsDihedralGraphState],
probe: None = None,
*,
parameters: DihedralParameters,
gradient: Lens[Geometry, PositionsAndCell],
) -> Potential[
State, PositionsAndCell, EmptyType, Patch[Any]
]
make_dihedral_from_state(
state: Lens[
State,
IsCachedDihedralGraphState[
PotentialOut[EmptyType, EmptyType]
],
],
probe: Probe[
State,
P,
IsGraphProbe[IsBondedParticles, Literal[4]],
],
*,
parameters: DihedralParameters,
gradient: None = None,
) -> Potential[State, EmptyType, EmptyType, P]
make_dihedral_from_state(
state: Lens[
State,
IsCachedDihedralGraphState[
PotentialOut[PositionsAndCell, EmptyType]
],
],
probe: Probe[
State,
P,
IsGraphProbe[IsBondedParticles, Literal[4]],
],
*,
parameters: DihedralParameters,
gradient: Lens[Geometry, PositionsAndCell],
) -> Potential[State, PositionsAndCell, EmptyType, P]
Create a dihedral 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 dihedral
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
|
DihedralParameters | None
|
Constant dihedral 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 dihedral Potential. |