kups.core.neighborlist.masks
¶
Mask classes for the neighbor list pipeline.
Each Mask is a pure function of
(batch, ctx) returning a fresh boolean array for its own criterion; the
Pipeline conjuncts all returned
masks via &. Masks cannot change batch.edges or
batch.is_minimum_image.
DistanceCutoffMask
¶
Drops candidates whose squared real-space distance exceeds cutoff².
Source code in src/kups/core/neighborlist/masks.py
ExclusionMask
¶
Drops minimum-image pairs that share an exclusion segment.
Non-minimum-image periodic copies of excluded pairs survive (allowed when
batch.is_minimum_image is False for that copy).
Source code in src/kups/core/neighborlist/masks.py
InBoundsMask
¶
Drops candidates whose lh/rh indices fall outside the valid inclusion-segment range.
Implements the per-side inclusion.indices < num_labels check used to
guard scatter/gather lookups when the candidate buffer is padded.
Source code in src/kups/core/neighborlist/masks.py
InclusionMatchMask
¶
Drops candidates whose lh/rh inclusion segments differ.
Source code in src/kups/core/neighborlist/masks.py
RemapDedupMask
¶
Deduplicate the rh→lh remapped subset.
When ctx.rh_index_remap is set, rh is a subset of lh and each
rh-position maps to an lh-position via rh_index_remap. We then keep
only one direction per pair: edges where lh_idx is not in the
remap (i.e., the pair is lh-only) or where lh_idx >= remapped_rh.
Returns all-True when no remap is in effect.