build_kernel

jaxrens.sampling.moves.swap.build_kernel(backend, n_species, species=None)[source]

Build a species-swap kernel.

Parameters:
  • backend (Any) – EnergyBackend instance.

  • n_species (int) – Total number of distinct type codes in the system.

  • species (Sequence[int] | None) – Type codes this move may exchange. None (the default) allows every species. At least two distinct codes are required — a one-species scope could never produce a swap.

Returns:

(rng_key, state, Emax) -> (new_state, MoveInfo)

Return type:

step function

Raises:

ValueError – If n_species < 2, or if species names fewer than two distinct codes or a code outside [0, n_species).

Warning

Unvalidated (since 0.2.2) — this code path has never been exercised in a production simulation. It may be unit-tested; what is missing is a real run whose output was checked.

Concern: no production NS run has used this move.

Cleared by: Production runs delivering correct physics for a binary system.