kups.application.potential.classical.lennard_jones
¶
State-binding constructors for Lennard-Jones potentials.
These adapters take a :class:~kups.core.lens.Lens into a concrete simulation
state and wire its particles, systems, neighbor list, and parameters into the
state-agnostic factories in
kups.potential.classical.lennard_jones.
Parameters may live on the state (state.lj_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 lj_cache attribute.
IsCachedLJGraphState
¶
Bases: IsLJGraphState, Protocol
:class:IsLJGraphState carrying an incremental-update cache (params passed in).
Source code in src/kups/application/potential/classical/lennard_jones.py
IsLJGraphState
¶
Bases: HasLJParticlesAndSystems, IsNeighborListState[IsUniversalNeighborlistParams], Protocol
Particles, systems, and neighbor list for an LJ graph (no parameters).
Source code in src/kups/application/potential/classical/lennard_jones.py
IsLJState
¶
Bases: IsLJGraphState, Protocol
:class:IsLJGraphState that also carries LJ parameters on the state.
Source code in src/kups/application/potential/classical/lennard_jones.py
global_lennard_jones_tail_correction_pressure_from_state(key, state, *, parameters=None)
¶
Create long-range pressure correction from a typed state.
When parameters is given it is bound with a constant lens and the state
need not carry lj_parameters.
Source code in src/kups/application/potential/classical/lennard_jones.py
make_lennard_jones_from_state(state, probe=None, *, parameters=None, gradient=None, neighborlist_factory=AdaptiveNeighborList.from_state)
¶
make_lennard_jones_from_state(
state: Lens[
State,
IsLJState[MaybeCached[LennardJonesParameters, Any]],
],
probe: None = None,
*,
parameters: None = None,
gradient: None = None,
neighborlist_factory: NeighborListFactory[Any] = ...,
) -> Potential[State, EmptyType, EmptyType, Patch[Any]]
make_lennard_jones_from_state(
state: Lens[
State,
IsLJState[MaybeCached[LennardJonesParameters, Any]],
],
probe: None = None,
*,
parameters: None = None,
gradient: Lens[Geometry, PositionsAndCell],
neighborlist_factory: NeighborListFactory[Any] = ...,
) -> Potential[
State, PositionsAndCell, EmptyType, Patch[Any]
]
make_lennard_jones_from_state(
state: Lens[
State,
IsLJState[
HasCache[
LennardJonesParameters,
PotentialOut[EmptyType, EmptyType],
]
],
],
probe: Probe[
State,
P,
IsGraphProbe[IsLJGraphParticles, Literal[2]],
],
*,
parameters: None = None,
gradient: None = None,
neighborlist_factory: NeighborListFactory[Any] = ...,
) -> Potential[State, EmptyType, EmptyType, P]
make_lennard_jones_from_state(
state: Lens[
State,
IsLJState[
HasCache[
LennardJonesParameters,
PotentialOut[PositionsAndCell, EmptyType],
]
],
],
probe: Probe[
State,
P,
IsGraphProbe[IsLJGraphParticles, Literal[2]],
],
*,
parameters: None = None,
gradient: Lens[Geometry, PositionsAndCell],
neighborlist_factory: NeighborListFactory[Any] = ...,
) -> Potential[State, PositionsAndCell, EmptyType, P]
make_lennard_jones_from_state(
state: Lens[State, IsLJGraphState],
probe: None = None,
*,
parameters: LennardJonesParameters,
gradient: None = None,
neighborlist_factory: NeighborListFactory[Any] = ...,
) -> Potential[State, EmptyType, EmptyType, Patch[Any]]
make_lennard_jones_from_state(
state: Lens[State, IsLJGraphState],
probe: None = None,
*,
parameters: LennardJonesParameters,
gradient: Lens[Geometry, PositionsAndCell],
neighborlist_factory: NeighborListFactory[Any] = ...,
) -> Potential[
State, PositionsAndCell, EmptyType, Patch[Any]
]
make_lennard_jones_from_state(
state: Lens[
State,
IsCachedLJGraphState[
PotentialOut[EmptyType, EmptyType]
],
],
probe: Probe[
State,
P,
IsGraphProbe[IsLJGraphParticles, Literal[2]],
],
*,
parameters: LennardJonesParameters,
gradient: None = None,
neighborlist_factory: NeighborListFactory[Any] = ...,
) -> Potential[State, EmptyType, EmptyType, P]
make_lennard_jones_from_state(
state: Lens[
State,
IsCachedLJGraphState[
PotentialOut[PositionsAndCell, EmptyType]
],
],
probe: Probe[
State,
P,
IsGraphProbe[IsLJGraphParticles, Literal[2]],
],
*,
parameters: LennardJonesParameters,
gradient: Lens[Geometry, PositionsAndCell],
neighborlist_factory: NeighborListFactory[Any] = ...,
) -> Potential[State, PositionsAndCell, EmptyType, P]
Create a LJ potential from a typed state, optionally with incremental updates.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
state
|
Any
|
Lens into the sub-state providing particles, systems, and neighbor
list (plus |
required |
probe
|
Any
|
Detects which particles changed since the last step.
|
None
|
parameters
|
LennardJonesParameters | None
|
Constant LJ 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 Lennard-Jones potential. |
Source code in src/kups/application/potential/classical/lennard_jones.py
make_lennard_jones_tail_correction_from_state(state, *, parameters=None, gradient=None)
¶
make_lennard_jones_tail_correction_from_state(
state: Lens[InState, State],
*,
parameters: None = None,
gradient: None = None,
) -> Potential[InState, EmptyType, EmptyType, Patch[Any]]
make_lennard_jones_tail_correction_from_state(
state: Lens[InState, State],
*,
parameters: None = None,
gradient: Lens[Geometry, PositionsAndCell],
) -> Potential[
InState, PositionsAndCell, EmptyType, Patch[Any]
]
Create a global tail-corrected LJ potential from a typed state.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
state
|
Any
|
Lens into the sub-state providing particles and systems (plus
|
required |
parameters
|
GlobalTailCorrectedLennardJonesParameters | None
|
Constant tail-correction parameters, bound with a constant
lens when given (state need not carry |
None
|
gradient
|
Lens[Geometry, PositionsAndCell] | None
|
Relaxation filter |
None
|
Returns:
| Type | Description |
|---|---|
Any
|
Configured tail-corrected Lennard-Jones potential. |