SwapWalker¶
- class jaxrens.sampling.moves.replica_exchange.SwapWalker(positions, types, energy, cell=None, extras=None)[source]¶
Bases:
NamedTupleThe part of a walker that moves between runs in a swap.
A JAX pytree. The same type describes a single walker (as seen by
SwapKernel.propose()) and the whole(R, K, ...)population (as seen byreplica_exchange_step()).cellisNonefor non-periodic systems.- Variables:
positions (jaxtyping.Float[jaxlib._jax.Array, '*B N 3']) – Cartesian coordinates, shape
(*B, N, 3).types (jaxtyping.Int[jaxlib._jax.Array, '*B N']) – Integer species labels, shape
(*B, N).energy (jaxtyping.Float[jaxlib._jax.Array, '*B']) – Stored energy in the frame of the run the walker is in (
U + P·V − μ·N, theEnsembleTermconvention), shape(*B,).cell (jaxtyping.Float[jaxlib._jax.Array, '*B 3 3'] | None) – Unit cell, shape
(*B, 3, 3), orNone.extras (dict[str, jax.jaxlib._jax.Array] | None) – Other per-walker state that belongs to the configuration and moves with it (e.g. GMC’s
direction, the neighbour-count bookkeeping; seeRUN_BOUND_FIELDSfor what stays with the run). Kernels pass it through unchanged;Nonewhen there is none.
- Parameters:
- positions: Float[jaxlib._jax.Array, '*B N 3']¶
Alias for field number 0
- types: Int[jaxlib._jax.Array, '*B N']¶
Alias for field number 1
- energy: Float[jaxlib._jax.Array, '*B']¶
Alias for field number 2