xnn.common.data.neighborlist.unique_pairs#
- xnn.common.data.neighborlist.unique_pairs(pos, cutoff, cell=None, pbc=None, half=None)[source]#
Every pair within
cutoffonce, as(i, k, shift)withi < k, sorted byi.The same pairs as the edges
src < dstofbuild_neighbor_list(), with the displacementpos[k] - pos[i] + shift @ cell. vesin’s half list gives them directly, without the second direction of every pair; without vesin they are filtered from the full list. An atom’s own periodic images are not pairs. In an orthorhombic cell on the GPU (cell_grid()) a grid search finds them instead, sorted byi, with one host read.- 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,).half (tuple, optional) – The
half_list()of these positions, when already found.
- Returns:
iandkof shape(M,)and the integer image shifts(M, 3).- Return type:
tuple of Tensor