eon.geometry.pbc

Periodic boundary conditions and distance helpers.

Module Contents

Functions

pbc

Minimum-image convention for displacement(s).

pbc_eon_legacy

eOn numpy wrap. Kept so tests can compare it to minimage.

per_atom_norm

Per-row Euclidean norm after PBC (shape (N,)).

per_atom_norm_gen

Yield per-row norms after PBC (legacy generator API).

Data

API

eon.geometry.pbc.PeriodicSpec

None

eon.geometry.pbc.pbc(r, box, ibox: numpy.ndarray | None = None, periodic: eon.geometry.pbc.PeriodicSpec | None = None) → numpy.ndarray[source]

Minimum-image convention for displacement(s).

The kernel is :mod:minimage (same wrap linkcell uses). Packed (N, 3) rows go through Cell.wrap_many when that method exists. The numpy path remains as :func:pbc_eon_legacy for the eOn/GROMACS/LAMMPS agreement tests.

Parameters

r : (3,) or (N, 3) Displacement vector(s). box : (3, 3) Cell matrix (rows = lattice vectors). ibox : (3, 3), optional Inverse of box; computed if omitted. periodic : bool or (3,) bool, optional Axes to wrap. True / omitted wraps all three. False wraps none. A length-3 mask wraps only the True axes. Partial masks skip minimage and use the numpy wrap so a free axis is left alone.

eon.geometry.pbc.pbc_eon_legacy(r, box, ibox: numpy.ndarray | None = None, periodic: eon.geometry.pbc.PeriodicSpec | None = None) → numpy.ndarray[source]

eOn numpy wrap. Kept so tests can compare it to minimage.

eon.geometry.pbc.per_atom_norm(v, box, ibox: numpy.ndarray | None = None, periodic: eon.geometry.pbc.PeriodicSpec | None = None) → numpy.ndarray[source]

Per-row Euclidean norm after PBC (shape (N,)).

eon.geometry.pbc.per_atom_norm_gen(v, box, ibox: numpy.ndarray | None = None, periodic: eon.geometry.pbc.PeriodicSpec | None = None)[source]

Yield per-row norms after PBC (legacy generator API).