initial_walk¶
- jaxrens.init.burn_in.initial_walk(key, ns_state, step_fn, *, n_walks, walklength, adjust_interval, emax_offset_per_atom, n_atoms, batcher=None, batched=None, walker_batch_size=None, per_move_fns=None, adaptation_policies=None, move_names=None, adjust_n_samples=50, adjust_max_rounds=15, max_neighbors_list=(30, 35, 40, 45, 50), max_neighbors_offset=5, max_neighbors_shrink_dwell=0)[source]¶
Run fixed-Emax MCMC to decorrelate walkers from their initialization.
Emax = max(live_energies) + emax_offset_per_atom * n_atoms, held constant across all n_walks * walklength steps.
Parallelism:
walker_batch_size=None: vmap over all walkers simultaneously (fastest). walker_batch_size=N: chunk via lax.map(batch_size=N). Any positive int; non-divisors are handled internally by padding.
- Parameters:
key (Array) – JAX PRNG key.
ns_state (NSState) – NSState after init_ns / init_ns_parallel / init_ns_multi_gpu. Population shape
(*shape_prefix, n_walkers, ...)per the descriptor (()for SingleRun,(R,)for VmapRuns,(G, P)for PmapVmapRuns).step_fn (Callable) – MWG step function from build_mwg(). Signature: (rng_key, mcstate, emax, move_key) -> (mcstate, MoveInfo).
n_walks (int) – Number of outer walk iterations. n_walks=0 is a no-op.
walklength (int) – MCMC steps per walk per walker.
adjust_interval (int) – Run step-size adaptation every this many walks (>0).
emax_offset_per_atom (float) – Added to max(live_energies)/max across runs to set Emax. Units: energy per atom.
n_atoms (int) – Number of atoms per walker (Python int).
batcher (SingleRun | VmapRuns | PmapVmapRuns | ShardedSingleRun | None) –
BatchDescriptorselecting the run-axis dispatch. Defaults toSingleRun()for back-compat. Mutually exclusive with the deprecatedbatchedboolean.batched (bool | None) – Deprecated. When set, synthesises a
VmapRunsfrom the input shape and emits aDeprecationWarning. Passbatcherinstead.walker_batch_size (int | None) – Chunk size for walker vmap. None = full vmap. Any positive int; non-divisors are handled internally by padding.
per_move_fns (list[Callable] | None) – Per-move step functions (third return of build_mwg). Required for step-size adaptation; None disables it.
adaptation_policies (tuple | None) – Tuple of ResolvedAdaptationPolicy, one per move. Required when per_move_fns is not None.
adjust_n_samples (int) – Number of trial walkers per adaptation round.
adjust_max_rounds (int) – Max bisection rounds per adaptation call.
max_neighbors_list (tuple[int, ...]) – Bucket ladder for neighbor-overflow retries. On overflow after a walk the next entry in this ladder is selected via
_pick_next_bucketand the walk is retried. Mirrors the NS-loop parameter of the same name.max_neighbors_offset (int) – Headroom added to the observed peak when picking the next bucket. Mirrors the NS-loop parameter.
max_neighbors_shrink_dwell (int) – Hysteresis dwell window for downsizing the bucket — see
BucketManager.0(default) disables shrinking, preserving the existing growth-only behaviour. Mirrors the NS-loop parameter.
- Returns:
New NSState with live walkers advanced. Same pytree shape as input. Dead-point arrays, log_evidence, iteration, n_dead are unchanged.
- Return type: