pymatgen.optimization.neighbors module


For each point in center_coords, get all the neighboring points in all_coords that are within the cutoff radius r. All the coordinates should be in cartesian.

  • all_coords – (np.ndarray[double, dim=2]) all available points. When periodic boundary is considered, this is all the points in the lattice.

  • center_coords – (np.ndarray[double, dim=2]) all centering points

  • r – (float) cutoff radius

  • pbc – (list of bool) whether to set periodic boundaries

  • lattice – (np.ndarray[double, dim=2]) 3x3 lattice matrix

  • numerical_tol – (float) numerical tolerance


index1 (n, ), index2 (n, ), offset_vectors (n, 3), distances (n, ). index1 of center_coords, and index2 of all_coords that form the neighbor pair

offset_vectors are the periodic image offsets for the all_coords.