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. Pair-only masks express that restriction in
their CandidateBatch[Literal[2]] type annotation.
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 key/query 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 key/query inclusion segments differ.
Source code in src/kups/core/neighborlist/masks.py
QueriedKeysDedupMask
¶
Deduplicate self-graph update candidates.
Pair selectors emit candidates in keys space. When ctx.queried_keys
is set, the query side was restricted to those affected keys rows.
We keep edges whose key endpoint is unaffected, plus one orientation for
edges where both endpoints are affected. MirrorPairEdges restores the
reverse orientation after compaction.
Returns all-True for full self-graphs and bipartite queries.
Source code in src/kups/core/neighborlist/masks.py
TouchesQueriedKeysMask
¶
Keep fixed-topology rows touched by ctx.queried_keys.
When no affected-index subset is active, every row is kept. This lets fixed topology use the same pipeline for full and patch-shaped calls.