jaxrens.sampling.nested_sampling

Core nested sampling loop.

Two-loop architecture: - Outer loop (Python): adaptation, overflow retry, termination, callbacks, logging - Inner step (JIT): ns_step — one iteration (n_cull dead points) via lax.scan over MCMC

Functions: - init_ns(): Initialize NSState from walker data + MWG init_fn - ns_step(): One NS iteration — cull n_cull walkers, refill, walk (fully JIT-compatible) - run_ns(): Full NS run (outer Python loop calling ns_step) - init_ns_parallel() / run_ns_parallel(): Multi-run vmap support

Functions

init_ns

Initialize NSState from walker data.

init_ns_multi_gpu

Initialize a (G, P, ...)-shaped NSState for shard_map(vmap) execution.

init_ns_parallel

Create batched NSState for n_runs parallel NS runs.

init_ns_sharded

Build an NSState for one population sharded across n_gpu GPUs.

ns_step

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

ns_step_sharded

One NS iteration with the population sharded across n_gpu GPUs.

run_ns

Run a full nested sampling calculation.

run_ns_multi_gpu

Run NS with shard_map(vmap(ns_step)) dispatch across G GPUs × P runs each.

run_ns_parallel

Run multiple NS calculations in parallel via vmap(ns_step).

run_ns_sharded

Run a single NS run with the walker population sharded across n_gpu GPUs.