SwapWalker

class jaxrens.sampling.moves.replica_exchange.SwapWalker(positions, types, energy, cell=None, extras=None)[source]

Bases: NamedTuple

The 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 by replica_exchange_step()). cell is None for 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, the EnsembleTerm convention), shape (*B,).

  • cell (jaxtyping.Float[jaxlib._jax.Array, '*B 3 3'] | None) – Unit cell, shape (*B, 3, 3), or None.

  • 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; see RUN_BOUND_FIELDS for what stays with the run). Kernels pass it through unchanged; None when there is none.

Parameters:
  • positions (Float[jaxlib._jax.Array, '*B N 3'])

  • types (Int[jaxlib._jax.Array, '*B N'])

  • energy (Float[jaxlib._jax.Array, '*B'])

  • cell (Float[jaxlib._jax.Array, '*B 3 3'] | None)

  • extras (dict[str, Array] | None)

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

cell: Float[jaxlib._jax.Array, '*B 3 3'] | None

Alias for field number 3

extras: dict[str, Array] | None

Alias for field number 4