run_ns_parallel

jaxrens.sampling.nested_sampling.run_ns_parallel(positions, types, energies, cells, init_fn, step_fn, rng_keys, n_walkers=None, max_iterations=10000, n_mcmc_steps=20, n_extra=0, n_cull=1, convergence_threshold=0.1, initial_step_size=0.1, target_acceptance=0.5, termination_criteria=None, ensemble_params_per_run=None, per_move_fns=None, move_descriptors=None, adjust_interval=0, adjust_n_samples=50, adjust_max_rounds=15, adjust_factor=1.5, trial_batch_size=None, restart_states=None, inter_re_config=None, backend=None, callbacks=None, max_neighbors_list=(30, 35, 40, 45, 50), max_neighbors_offset=5, max_neighbors_shrink_dwell=0, initial_max_neighbor_counts=None)[source]

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

Thin wrapper: validates args, initialises batched NSState, constructs VmapRuns descriptor + adapt_step, delegates to _run_loop, and packages the result dict.

Parameters:
  • positions (Array) – (n_runs, n_walkers, n_atoms, 3)

  • types (Array) – (n_atoms,) shared, or (n_runs, n_walkers, n_atoms)

  • energies (Array) – (n_runs, n_walkers)

  • cells (Array | None) – (n_runs, n_walkers, 3, 3) or None

  • init_fn (Callable) – MCState constructor from build_mwg().

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

  • rng_keys (Array) – (n_runs,) per-run PRNG keys.

  • n_walkers (int | None) – Inferred from positions if None.

  • max_iterations (int) – Max NS iterations per run.

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

  • n_extra (int) – Extra walkers to walk per iteration (static).

  • n_cull (int) – Walkers culled per iteration (static).

  • convergence_threshold (float) – For PriorMassTermination.

  • initial_step_size (float) – Starting step size.

  • target_acceptance (float) – Target acceptance rate (unused directly; kept for interface parity with run_ns).

  • termination_criteria (list[TerminationCriterion] | None) – Optional. If None, uses defaults.

  • ensemble_params_per_run (list[dict] | None) – Per-run ensemble params (e.g. different pressures).

  • per_move_fns (list[Callable] | None) – Per-move step functions for bisection adaptation.

  • move_descriptors (list | None) – MoveKernel descriptors carrying rate bounds + max ss.

  • adjust_interval (int) – Adapt every N iterations. 0 = no adaptation.

  • adjust_n_samples (int) – Walkers to sample per bisection trial round (static).

  • adjust_max_rounds (int) – Max bisection rounds per adjust call (static).

  • adjust_factor (float) – Multiplicative bisection factor (static).

  • restart_states (list | None) – Optional list of RestartBundle objects, one per run. When provided, run i resumes from the checkpoint at restart_states[i] — dead-point history, iteration counter, and log-evidence are seeded from the bundle. Pass None entries for any run that should start fresh. len(restart_states) must equal n_runs.

  • trial_batch_size (int | None)

  • callbacks (list[Any] | None)

  • max_neighbors_list (tuple[int, ...] | list[int])

  • max_neighbors_offset (int)

  • max_neighbors_shrink_dwell (int)

  • initial_max_neighbor_counts (Array | None)

Returns:

Dict with (n_runs, …) shaped arrays on all fields.

Return type:

dict