xnn.common.data.grid_pairs.grid_pairs_staged#

xnn.common.data.grid_pairs.grid_pairs_staged(pos, cutoff, lengths, shape, span, cap, out=None, half=False)[source]#

The pairs i < k within cutoff from one search on the CPU (xnn.common.cpu_kernels): each atom’s partners in cap slots of its own, with the index of their image among the 27 shifts of -1, 0, 1 per axis ((s_x + 1) 9 + (s_y + 1) 3 + s_z + 1, the displacement pos[k] - pos[i] + shift * lengths). half: each pair once in the row of one of its atoms, k lower than i too (half the candidates).

Returns:

The counts (N,) (int32), the partners (N (cap + 1),) (int32) and their image indices (int8), atom i’s from i (cap + 1) (in the buffers out where given, at least that long), or None when an atom has more than cap partners or the positions spread over 1.5 edges on an axis (a pair’s shift may then be beyond -1, 0, 1).

Return type:

tuple or None

Parameters: