eon.geometry.neighbors

Neighbor lists.

A periodic cutoff list is :func:linkcell.pairs_within: one row per atom-image, the caller’s shift S, and a squared distance strictly below the cutoff squared. :func:neighbor_list unique-indexes those rows. An open axis stays on :class:vesin.NeighborList, which accepts per-axis periodicity. knearest is the k-nearest list, not a cutoff list. The brute flag is retained for API compatibility and does not select another algorithm.

Module Contents

Functions

neighbor_list

Return neighbors within cutoff for each atom (PBC, full undirected list).

brute_neighbor_list

Alias of :func:neighbor_list (historical name).

neighbor_list_vectors

Neighbor list with minimum-image vectors from center → neighbor.

neighbor_list_pairs

Cutoff pair list with cell shifts (ASE/tonari ijS).

neighbor_list_linkcell

Unique-index adjacency from :func:linkcell.pairs_within.

coordination_numbers

least_coordinated

Indices of free atoms with the lowest coordination number.

Data

API

eon.geometry.neighbors.PeriodicSpec

None

eon.geometry.neighbors.StructureLike

None

eon.geometry.neighbors.neighbor_list(p: eon.geometry.neighbors.StructureLike, cutoff: float, brute: bool = False, periodic: eon.geometry.neighbors.PeriodicSpec | None = None) → List[List[int]][source]

Return neighbors within cutoff for each atom (PBC, full undirected list).

Parameters

p Structure with .r (N,3) and .box (3,3). Optional .periodic (bool or length-3 bools) is used when periodic is omitted. cutoff Pair cutoff distance. brute Ignored; kept so callers using config.comp_brute_neighbors need no change. periodic A single bool applies to all axes; a length-3 sequence is per-axis. Default is p.periodic or all-periodic. Fully periodic cells use :func:linkcell.pairs_within. An open axis uses vesin.

eon.geometry.neighbors.brute_neighbor_list(p: eon.geometry.neighbors.StructureLike, cutoff: float) → List[List[int]][source]

Alias of :func:neighbor_list (historical name).

eon.geometry.neighbors.neighbor_list_vectors(p: eon.geometry.neighbors.StructureLike, cutoff: float, brute: bool = False) → List[List[numpy.ndarray]][source]

Neighbor list with minimum-image vectors from center → neighbor.

Unique-index adjacency is the historical eOn contract. Vectors are one MIC wrap of r[j] - r[center] per neighbour index, computed in one :func:eon.geometry.pbc call (minimage wrap_many when installed). Multi-image pair lists belong on

Func:

neighbor_list_pairs.

eon.geometry.neighbors.neighbor_list_pairs(p: eon.geometry.neighbors.StructureLike, cutoff: float, periodic: eon.geometry.neighbors.PeriodicSpec | None = None)[source]

Cutoff pair list with cell shifts (ASE/tonari ijS).

Returns (i, j, S) with one row per atom-image pair, ordered by (i, j, S). Unlike :func:neighbor_list, this does not unique-index or apply a minimum-image reduction. Displacement is r[j] - r[i] + S @ box. A fully periodic cell uses

Func:

linkcell.pairs_within. An open axis uses vesin. A squared distance on a linkcell row is strictly below the cutoff squared.

eon.geometry.neighbors.neighbor_list_linkcell(p: eon.geometry.neighbors.StructureLike, cutoff: float) → List[List[int]][source]

Unique-index adjacency from :func:linkcell.pairs_within.

The cell is periodic. knearest is a different query and is not called. An empty list is returned when linkcell has no pairs_within.

eon.geometry.neighbors.coordination_numbers(p: eon.geometry.neighbors.StructureLike, cutoff: float, brute: bool = False) → List[int][source]
eon.geometry.neighbors.least_coordinated(p: eon.geometry.neighbors.StructureLike, cutoff: float, brute: bool = False) → List[int][source]

Indices of free atoms with the lowest coordination number.