kups.core.neighborlist.parameters
¶
Capacity-hint parameters shared by neighbor list implementations.
UniversalNeighborlistParameters
is the concrete dataclass every application state holds and threads into
from_state for the neighbor list classes. The
estimate
classmethod derives conservative power-of-two capacities from system geometry
so callers don't have to guess.
UniversalNeighborlistParameters
¶
Concrete parameter dataclass satisfying IsUniversalNeighborlistParams.
Holds the capacity hints needed by every neighbor list implementation.
Use the estimate() classmethod to compute reasonable initial values
from system geometry rather than guessing manually.
Attributes:
| Name | Type | Description |
|---|---|---|
avg_edges |
int
|
Average number of edges per particle (for edge capacity). |
avg_candidates |
int
|
Average number of candidate pairs per particle. |
avg_image_candidates |
int
|
Average number of image candidate pairs per particle. |
cells |
int
|
Maximum number of spatial hash cells across all systems. |
Source code in src/kups/core/neighborlist/parameters.py
estimate(particles_per_system, systems, cutoffs, *, base=2, multiplier=1.0)
classmethod
¶
Estimate parameters for all neighbor list types from system geometry.
Computes conservative initial capacities based on particle density
and cutoff radii. The estimates are rounded up to the next power of
base to amortize future resizing.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
particles_per_system
|
Table[SystemId, Array]
|
Number of particles per system. |
required |
systems
|
Table[SystemId, NeighborListSystems]
|
System data with cell information. |
required |
cutoffs
|
Table[SystemId, Array]
|
Cutoff distance per system. |
required |
base
|
float
|
Base for power-of rounding (default 2). |
2
|
multiplier
|
float
|
Safety factor applied to the estimate (default 1.0). |
1.0
|
Returns:
| Type | Description |
|---|---|
UniversalNeighborlistParameters
|
A |