get_swap_pairs

jaxrens.sampling.moves.replica_exchange.get_swap_pairs(n_runs, phase)[source]

Get non-overlapping swap pairs for replica exchange.

Phase 0 (even): [(0,1), (2,3), (4,5), …] Phase 1 (odd): [(1,2), (3,4), (5,6), …]

Parameters:
  • n_runs (int) – Number of parallel runs.

  • phase (int) – 0 for even pairs, 1 for odd pairs.

Returns:

Array of shape (n_pairs, 2) with run indices.

Return type:

Int[jaxlib._jax.Array, ’n_pairs 2’]