jaxrens.state.mc_state

Dynamic MCState factory for Monte Carlo moves.

MCState is built at runtime by the MWG factory based on the active move set. Core fields (positions, types, energy, cell, step_size, step_sizes, n_accepted, n_proposed) are always present. Move-specific fields (e.g. direction for Galilean) are added only when the corresponding move is in the MWG descriptor list.

The factory uses dataclasses.make_dataclass() and registers each unique class as a JAX pytree. Classes are cached by field names to avoid duplicate registration.

Module Attributes

RUN_BOUND_FIELDS

Fields describing the run a walker slot belongs to, not the configuration in it.

Functions

make_mc_state_class

Create an MCState dataclass with core + move-specific fields.

walker_bound_fields

Names of the non-static fields of state that travel with the walker.