jaxrens.state.walker

WalkerState: JAX-registered dataclass for a single walker in configuration space.

Follows JAX-MD’s dataclass pattern: pytree-registered with .set() for functional updates and static_field() for compile-time constants.

A single WalkerState represents one walker. In the NS loop, walkers are batched as arrays with shape (G, P, K, …) where G=n_gpu_parallel, P=n_runs_per_gpu, K=n_walkers. The pytree registration ensures vmap/pmap work transparently.

Functions

flatten_dataclass

Flatten any static_field-aware dataclass into (leaves, aux).

make_unflatten

Build an unflatten function reconstructing cls from (aux, leaves).

register_dataclass_pytree

Register cls as a JAX pytree via the generic flatten/unflatten.

static_field

Mark a dataclass field as static (compile-time constant).

Classes

WalkerState

State of a single walker in configuration space.