Function deepmd::applyPairExcludeNlistVec

Function deepmd::applyPairExcludeNlistVec#

Function Documentation#

inline void deepmd::applyPairExcludeNlistVec(std::vector<std::int64_t> &nlist, const std::vector<int> &atype, const std::vector<int> &type_mask_table, const int ntypes, const int nloc, const int max_size)#

Dense-nlist pair-type exclusion on a plain flat int64 neighbour list: erase excluded-type neighbours to -1 in place.

Torch-free twin of applyPairExclusionNlist (commonPT.h, which works on torch::Tensor); used by the TF-C-API DeepPotJAX ingestion seam, which cannot depend on libtorch. Same keep-table convention as buildPairExcludeTable / applyPairExclusionNlist: keep index center_type * (ntypes+1) + neighbour_type. An empty type_mask_table is identity (no-op), mirroring the pair_excl is None early-exit.

Exclusion is a BUILD-time transform (decision #18/A4): the exported call_lower_* consumes a pre-excluded nlist and never re-applies it, so this is the single application site for the JAX/tf2 SavedModel LAMMPS path.

Parameters:
  • nlist – Flat nloc * max_size neighbour list (extended-space indices; -1 == empty slot), modified in place.

  • atype – Extended atom types; atype[i] >= 0 for real atoms. Indexed by the centre id ii < nloc and by each neighbour id in nlist.

  • type_mask_table – Flat (ntypes+1)^2 keep table from buildPairExcludeTable. Empty => identity.

  • ntypes – Number of real atom types.

  • nloc – Number of local (centre) atoms.

  • max_size – Neighbours per centre (row stride of nlist).