jaxrens.sampling.moves.replica_exchange¶
Replica exchange moves across parallel NS runs.
Unlike standard moves that operate on a single walker, replica exchange swaps walkers between different parallel runs (across the P dimension). This improves mixing when runs have different energy constraints.
- Structure:
One driver,
replica_exchange_step(), runs the swap schedule (even/odd neighbour pairs, one random walker per run, per-pair statistics) for every flavor. The flavor-specific part is aSwapKernel, whose only job isSwapKernel.propose(): given one walker from each run of a pair, build the walker that would enter each run, with its energy expressed in that run’s ensemble. Acceptance is then the same for every flavor: each incoming walker must lie below the receiving run’s Emax.- Kernels:
EnsembleSwapcovers pressure RE and semi-grand (μ) RE. The walkers trade runs unchanged and their stored energies are re-based to the receiving run’s pressure and chemical potentials (zero backend calls).XRENSSwapmorphs the incoming walker’s types to the receiving run’s target composition and re-evaluates its energy (two backend calls).
Use make_swap_kernel() to build the kernel for an InterREConfig.
Functions
Get non-overlapping swap pairs for replica exchange. |
|
Build the swap kernel for an |
|
Run inter-replica swaps across R parallel runs. |
Classes
Pressure / semi-grand RE: walkers trade runs, energies are re-based. |
|
One flavor of inter-RE swap. |
|
The part of a walker that moves between runs in a swap. |
|
Composition-swap RE: morph types to the receiving run, re-evaluate. |