deepmd.dpmodel.utils.dist_check#
Minimum pairwise distance check for frame validity filtering.
Attributes#
Functions#
| Compute the minimum pairwise atomic distance for a single frame. |
Module Contents#
- deepmd.dpmodel.utils.dist_check.compute_min_pair_dist_single(coord: numpy.ndarray, box: numpy.ndarray | None, atype: numpy.ndarray, stop_below: float | None = None) float[source]#
Compute the minimum pairwise atomic distance for a single frame.
- Parameters:
- coord
np.ndarray Atomic coordinates, flattened with shape (natoms * 3,) or reshaped as (natoms, 3).
- box
np.ndarrayorNone Box vectors with shape (9,) for PBC, or None for non-PBC.
- atype
np.ndarray Atom types with shape (natoms,). Virtual atoms (type < 0) are excluded from the distance check.
- stop_below
floatorNone Optional early-stop threshold. If a block has any pair closer than this value, the block minimum is returned immediately.
- coord
- Returns:
floatMinimum pairwise distance. Returns inf if fewer than 2 real atoms exist.