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, composition=None, 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,
composition: RigidBodyComposition[
State, IsChargedTemplate
]
| None = None,
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,
composition: RigidBodyComposition[
State, IsChargedTemplate
]
| None = None,
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, IsParticleProbe[IsEwaldPointData]
],
*,
parameters: None = None,
gradient: None = None,
include_exclusion_mask: bool = False,
composition: RigidBodyComposition[
State, IsChargedTemplate
]
| None = None,
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, IsParticleProbe[IsEwaldPointData]
],
*,
parameters: None = None,
gradient: Lens[Geometry, PositionsAndCell],
include_exclusion_mask: bool = False,
composition: RigidBodyComposition[
State, IsChargedTemplate
]
| None = None,
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,
composition: RigidBodyComposition[
State, IsChargedTemplate
]
| None = None,
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,
composition: RigidBodyComposition[
State, IsChargedTemplate
]
| None = None,
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, IsParticleProbe[IsEwaldPointData]
],
*,
parameters: EwaldParameters,
gradient: None = None,
include_exclusion_mask: bool = False,
composition: RigidBodyComposition[
State, IsChargedTemplate
]
| None = None,
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, IsParticleProbe[IsEwaldPointData]
],
*,
parameters: EwaldParameters,
gradient: Lens[Geometry, PositionsAndCell],
include_exclusion_mask: bool = False,
composition: RigidBodyComposition[
State, IsChargedTemplate
]
| None = None,
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
|
composition
|
RigidBodyComposition[Any, IsChargedTemplate] | None
|
Optional rigid-body templates and counts for energy-only self and exclusion terms. |
None
|
Returns:
| Type | Description |
|---|---|
Any
|
An |
Any
|
self-energy, and (optionally) exclusion-correction terms. |
Source code in src/kups/application/potential/classical/ewald.py
201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 | |