deepmd.dpmodel.utils.dist_check
===============================

.. py:module:: deepmd.dpmodel.utils.dist_check

.. autoapi-nested-parse::

   Minimum pairwise distance check for frame validity filtering.

   ..
       !! processed by numpydoc !!


Attributes
----------

.. autoapisummary::

   deepmd.dpmodel.utils.dist_check._MIN_PAIR_DIST_BLOCK_PAIRS


Functions
---------

.. autoapisummary::

   deepmd.dpmodel.utils.dist_check.compute_min_pair_dist_single


Module Contents
---------------

.. py:data:: _MIN_PAIR_DIST_BLOCK_PAIRS
   :value: 262144


.. py:function:: compute_min_pair_dist_single(coord: numpy.ndarray, box: numpy.ndarray | None, atype: numpy.ndarray, stop_below: float | None = None) -> float

   
   Compute the minimum pairwise atomic distance for a single frame.


   :Parameters:

       **coord** : :obj:`np.ndarray <numpy.ndarray>`
           Atomic coordinates, flattened with shape (natoms * 3,)
           or reshaped as (natoms, 3).

       **box** : :obj:`np.ndarray <numpy.ndarray>` or :data:`python:None`
           Box vectors with shape (9,) for PBC, or None for non-PBC.

       **atype** : :obj:`np.ndarray <numpy.ndarray>`
           Atom types with shape (natoms,). Virtual atoms (type < 0)
           are excluded from the distance check.

       **stop_below** : :class:`python:float` or :data:`python:None`
           Optional early-stop threshold. If a block has any pair closer
           than this value, the block minimum is returned immediately.



   :Returns:

       :class:`python:float`
           Minimum pairwise distance. Returns inf if fewer than 2
           real atoms exist.











   ..
       !! processed by numpydoc !!

