ns_step

jaxrens.sampling.nested_sampling.ns_step(ns_state, step_fn, n_mcmc_steps=20, n_extra=0, n_cull=1, move_key=None)[source]

One NS iteration: replace the n_cull worst walkers, plus extra walks.

Fully JIT-compatible. MCState.energy is the full ensemble potential (computed by the backend, possibly including an EnsembleTerm). No enthalpy computation needed here — ns_step is ensemble-agnostic.

The n_cull highest-potential walkers become dead points; each is replaced by a clone of a distinct random survivor. When n_extra > 0, additional randomly chosen survivors are MCMC-walked alongside the clones via vmap.

Parameters:
  • ns_state (NSState) – Current NSState with batched MCState population.

  • step_fn (Callable) – MCMC step function from build_mwg().

  • n_mcmc_steps (int) – Number of MCMC steps per walker (static).

  • n_extra (int) – Number of additional walkers to walk (static).

  • n_cull (int) – Number of walkers culled per iteration (static).

  • move_key (Array | None) – Key for the per-step move-type schedule shared by all walked chains (see _move_schedule()). None splits it off this run’s key; batchers that vmap over runs pass one key from OUTSIDE that vmap so the schedule is unbatched there too.

Returns:

(updated_ns_state, info_dict).

Return type:

tuple[NSState, dict]