cell_list
Periodic cell-list pair construction.
import mlx_atomistic.cell_list
Classes
Section titled “Classes”PairListStats
Section titled “PairListStats”class PairListStats def __init__(pair_count: int, n_cells: tuple[int, int, int], cell_count: int, occupied_cell_count: int, search_radius: float, estimated_pair_bytes: int, estimated_cell_list_bytes: int, backend: str = 'periodic_cell_list', representation_kind: str = 'pairs', candidate_count: int | None = None, estimated_candidate_bytes: int = 0, compaction_backend: str | None = None, fallback_reason: str | None = None)Diagnostics for a constructed periodic pair list.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
pair_count | int | ||
n_cells | tuple[int, int, int] | ||
cell_count | int | ||
occupied_cell_count | int | ||
search_radius | float | ||
estimated_pair_bytes | int | ||
estimated_cell_list_bytes | int | ||
backend | str | 'periodic_cell_list' | |
representation_kind | str | 'pairs' | |
candidate_count | int | None | None | |
estimated_candidate_bytes | int | 0 | |
compaction_backend | str | None | None | |
fallback_reason | str | None | None |
PeriodicCellList
Section titled “PeriodicCellList”class PeriodicCellList def __init__(bins: dict[tuple[int, int, int], np.ndarray], n_cells: tuple[int, int, int], cell_lengths: np.ndarray, search_radius: float, n_particles: int, estimated_bytes: int)Binned particles for orthorhombic periodic pair construction.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
bins | dict[tuple[int, int, int], np.ndarray] | ||
n_cells | tuple[int, int, int] | ||
cell_lengths | np.ndarray | ||
search_radius | float | ||
n_particles | int | ||
estimated_bytes | int |
Properties
cell_countint— Total grid cell count.occupied_cell_countint— Number of cells containing at least one particle.
Functions
Section titled “Functions”build_periodic_cell_list
Section titled “build_periodic_cell_list”def build_periodic_cell_list(positions, cell: Cell, *, search_radius: float) -> PeriodicCellListBin wrapped positions into a periodic orthorhombic grid.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
positions | |||
cell | Cell | ||
search_radius | float |
Returns
PeriodicCellList
build_periodic_pair_list
Section titled “build_periodic_pair_list”def build_periodic_pair_list(positions, cell: Cell, *, search_radius: float, sort_pairs: bool = True, max_workers: int | None = None) -> tuple[np.ndarray, PairListStats]Build deterministic unique i < j pairs within search_radius.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
positions | |||
cell | Cell | ||
search_radius | float | ||
sort_pairs | bool | True | |
max_workers | int | None | None |
Returns
tuple[np.ndarray, PairListStats]
estimate_pair_list_bytes
Section titled “estimate_pair_list_bytes”def estimate_pair_list_bytes(pair_count: int) -> intReturn storage bytes for an int32 (pair_count, 2) pair array.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
pair_count | int |
Returns
int