kups.application.potential.classical.ewald
¶
State-binding constructors for Ewald 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.ewald.
Parameters may live on the state (state.ewald_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
ewald_cache attribute.
IsCachedEwaldGraphState
¶
Bases: IsEwaldGraphState, Protocol
:class:IsEwaldGraphState carrying an incremental-update cache (params passed in).
Source code in src/kups/application/potential/classical/ewald.py
IsEwaldGraphState
¶
Bases: IsState[IsEwaldPointData, HasCell[Periodic3D]], IsNeighborListState[IsUniversalNeighborlistParams], Protocol
Particles, systems, and neighbor list for an Ewald graph (no parameters).
Source code in src/kups/application/potential/classical/ewald.py
IsEwaldState
¶
Bases: IsEwaldGraphState, Protocol
:class:IsEwaldGraphState that also carries Ewald parameters on the state.
Source code in src/kups/application/potential/classical/ewald.py
make_ewald_from_state(state, probe=None, *, parameters=None, gradient=None, include_exclusion_mask=False, neighborlist_factory=AdaptiveNeighborList.from_state)
¶
make_ewald_from_state(
state: Lens[
State,
IsEwaldState[MaybeCached[EwaldParameters, Any]],
],
probe: None = None,
*,
parameters: None = None,
gradient: None = None,
include_exclusion_mask: bool = False,
neighborlist_factory: NeighborListFactory[
IsEwaldState[MaybeCached[EwaldParameters, Any]]
] = ...,
) -> EwaldPotential[
State, EmptyType, EmptyType, Patch[Any]
]
make_ewald_from_state(
state: Lens[
State,
IsEwaldState[MaybeCached[EwaldParameters, Any]],
],
probe: None = None,
*,
parameters: None = None,
gradient: Lens[Geometry, PositionsAndCell],
include_exclusion_mask: bool = False,
neighborlist_factory: NeighborListFactory[
IsEwaldState[MaybeCached[EwaldParameters, Any]]
] = ...,
) -> EwaldPotential[
State, PositionsAndCell, EmptyType, Patch[Any]
]
make_ewald_from_state(
state: Lens[
State,
IsEwaldState[
HasCache[
EwaldParameters,
EwaldCache[EmptyType, EmptyType],
]
],
],
probe: Probe[
State, P, IsGraphProbe[IsEwaldPointData, Literal[2]]
],
*,
parameters: None = None,
gradient: None = None,
include_exclusion_mask: bool = False,
neighborlist_factory: NeighborListFactory[
IsEwaldState[
HasCache[
EwaldParameters,
EwaldCache[EmptyType, EmptyType],
]
]
] = ...,
) -> EwaldPotential[State, EmptyType, EmptyType, P]
make_ewald_from_state(
state: Lens[
State,
IsEwaldState[
HasCache[
EwaldParameters,
EwaldCache[PositionsAndCell, EmptyType],
]
],
],
probe: Probe[
State, P, IsGraphProbe[IsEwaldPointData, Literal[2]]
],
*,
parameters: None = None,
gradient: Lens[Geometry, PositionsAndCell],
include_exclusion_mask: bool = False,
neighborlist_factory: NeighborListFactory[
IsEwaldState[
HasCache[
EwaldParameters,
EwaldCache[PositionsAndCell, EmptyType],
]
]
] = ...,
) -> EwaldPotential[State, PositionsAndCell, EmptyType, P]
make_ewald_from_state(
state: Lens[State, IsEwaldGraphState],
probe: None = None,
*,
parameters: EwaldParameters,
gradient: None = None,
include_exclusion_mask: bool = False,
neighborlist_factory: NeighborListFactory[
IsEwaldGraphState
] = ...,
) -> EwaldPotential[
State, EmptyType, EmptyType, Patch[Any]
]
make_ewald_from_state(
state: Lens[State, IsEwaldGraphState],
probe: None = None,
*,
parameters: EwaldParameters,
gradient: Lens[Geometry, PositionsAndCell],
include_exclusion_mask: bool = False,
neighborlist_factory: NeighborListFactory[
IsEwaldGraphState
] = ...,
) -> EwaldPotential[
State, PositionsAndCell, EmptyType, Patch[Any]
]
make_ewald_from_state(
state: Lens[
State,
IsCachedEwaldGraphState[
EwaldCache[EmptyType, EmptyType]
],
],
probe: Probe[
State, P, IsGraphProbe[IsEwaldPointData, Literal[2]]
],
*,
parameters: EwaldParameters,
gradient: None = None,
include_exclusion_mask: bool = False,
neighborlist_factory: NeighborListFactory[
IsCachedEwaldGraphState[
EwaldCache[EmptyType, EmptyType]
]
] = ...,
) -> EwaldPotential[State, EmptyType, EmptyType, P]
make_ewald_from_state(
state: Lens[
State,
IsCachedEwaldGraphState[
EwaldCache[PositionsAndCell, EmptyType]
],
],
probe: Probe[
State, P, IsGraphProbe[IsEwaldPointData, Literal[2]]
],
*,
parameters: EwaldParameters,
gradient: Lens[Geometry, PositionsAndCell],
include_exclusion_mask: bool = False,
neighborlist_factory: NeighborListFactory[
IsCachedEwaldGraphState[
EwaldCache[PositionsAndCell, EmptyType]
]
] = ...,
) -> EwaldPotential[State, PositionsAndCell, EmptyType, P]
Create an Ewald potential from a typed state, optionally with incremental updates.
When probe is None, builds a static potential by extracting
components directly from the state. When a probe is provided, the
potential supports incremental (cached) evaluation via the probe's
patch mechanism.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
state
|
Any
|
Lens focusing on the Ewald state (particles, systems,
neighborlist, plus |
required |
probe
|
Any
|
Probe for incremental updates. |
None
|
parameters
|
EwaldParameters | None
|
Constant Ewald parameters. When given they are bound with a
constant lens and the state need not carry |
None
|
gradient
|
Lens[Geometry, Any] | None
|
Relaxation filter |
None
|
include_exclusion_mask
|
bool
|
Whether to include the exclusion correction term in the returned potential. |
False
|
Returns:
| Type | Description |
|---|---|
Any
|
An |
Any
|
self-energy, and (optionally) exclusion-correction terms. |