jaxrens.constraints.base¶
Composable configuration constraints for nested sampling.
A constraint is a hard predicate on a walker configuration — a function
(positions, types, cell) -> bool that is jit/vmap/pmap safe and returns a
scalar boolean (True == the configuration is allowed). Constraints
restrict the support of the prior the chain explores; a proposal that would
move a walker into a forbidden region is rejected exactly like one that
violates the likelihood threshold.
Each constraint type is described by a ConstraintDescriptor, which
carries:
depends_on— the set of state aspects the predicate reads ("positions","cell","types"). A move is gated by a constraint only when the move mutates an aspect the constraint depends on; this pairing is computed once, statically, when the sampler is assembled (seemake_move_gate()andbuild_mwg). A move that cannot affect a constraint’s inputs provably preserves it, so the check is skipped entirely — not merely short-circuited at runtime.reject_reason— theMoveInfo.reject_reasonbucket to report when this constraint is the cause of a rejection (default4= configuration constraint; cell-geometry uses2to stay backward-compatible with the existing reject breakdown).
Constraints whose enforcement is claimed by a move kernel (e.g. cell geometry, which the cell-move kernels check internally so they can gate their own neighbor-bucket bookkeeping) are simply not registered as gate descriptors — that keeps them evaluated exactly once rather than twice.
Functions
Build the constraint gate for a single move type. |
Classes
frozenset() -> empty frozenset object frozenset(iterable) -> frozenset object |
|
A hard predicate on a single walker configuration. |
|
Declarative description of one constraint type for the sampler. |