Skip to content

Python Neighbor Lists

neighbor_list

Neighbor-list helpers exposed by the Python package.

NeighborList(i: list[int], j: list[int], S: list[float]) dataclass

Neighbor-list arrays returned by :func:neighbor_list.

Attributes:

  • i (list[int]) –

    Source atom indices.

  • j (list[int]) –

    Neighbor atom indices paired with i.

  • S (list[float]) –

    Periodic-image shift vectors for each edge.

neighbor_list(atoms: Atoms, cutoff: float, symmetrize: bool = True, sort: bool = False) -> NeighborList

Compute a neighbor list for an ASE structure.

Parameters:

  • atoms (Atoms) –

    Input structure.

  • cutoff (float) –

    Pair cutoff distance in angstrom.

  • symmetrize (bool, default: True ) –

    If True, return both i -> j and j -> i entries for each pair.

  • sort (bool, default: False ) –

    If True, sort the output lexicographically by (i, j).

Returns:

  • NeighborList

    Neighbor indices and periodic-image shifts for all pairs within the cutoff.