xnn.common.data.neighborlist.cell_grid#

xnn.common.data.neighborlist.cell_grid(pos, cutoff, cell=None, pbc=None)[source]#

The grid unique_pairs() searches: an orthorhombic cell, periodic on every axis, with room for at least three cells of cutoff per axis, and positions on a CUDA device with Triton, or on the CPU with at least GRID_CPU_ATOMS atoms where the CPU kernels compile (xnn.common.cpu_kernels; vesin’s search is single-threaded).

Parameters:
  • pos (Tensor) – Cartesian positions of shape (N, 3).

  • cutoff (float) – Neighbor cutoff radius.

  • cell (Tensor, optional) – Lattice vectors as rows, of shape (3, 3).

  • pbc (Tensor, optional) – Boolean periodicity flags of shape (3,).

Returns:

The cell’s edges (3,) and the cells per axis (and, on a CPU, no capacity and the cells per cutoff), or None where the pairs come from vesin.

Return type:

tuple or None