RENSToyBackend

class jaxrens.backends.toy.RENSToyBackend(eps_rep=10.0, h_rep=8.0, eps_attr=1.0, mu=1.0, sigma=0.2, r_cut=3.0, n_images=8)[source]

Bases: object

Two particles in a periodic 1-D box — the toy model from the RENS paper.

Reproduces the model of Unglert, Pártay and Madsen, Replica Exchange Nested Sampling, J. Chem. Theory Comput. 21, 7304 (2025), eqs 14-17. A pair interaction built from a repulsive core and an attractive well:

E_rep(d)  =  eps_rep * exp(-h_rep * d**2)
E_attr(d) = -eps_attr * exp(-0.5 * ((d - mu) / sigma)**2)
E_toy(d)  =  E_rep(d) + E_attr(d)

summed over pairs and their periodic images within a cutoff r_cut:

U(x_1, x_2; a) = 1/2 * sum_{i != j} sum_images E_toy(|x_i - x_j + n a|)

Despite its simplicity the resulting enthalpy surface is genuinely multi-modal in (a, d), which is what makes it a useful demonstration of replica exchange: independent NS runs at different pressures get stuck in different basins, and the swaps are what rescue them.

Embedding. jaxrens carries 3-D positions and a 3x3 cell, so the 1-D system lives on the x-axis with a cell of diag(a, 1, 1). Then V = det(cell) = a exactly, and the NPT enthalpy the ensemble wrapper already computes, H = U + P * V, is eq 18 of the paper with no special-casing. The y and z coordinates do not enter the energy; drive the system with the lattice_1d and distance_1d moves, which keep the cell diagonal and the particles on the axis.

Image sum. n_images periodic images are summed on each side. The count is static (it fixes the compiled shape) and the r_cut mask does the physics, so it only needs to be large enough that n_images * a_min >= r_cut for the smallest box the prior allows.

Self-images (i == j, n != 0) are included – a particle interacts with its own periodic images, and at box lengths near mu that term dominates. Only the i == j, n == 0 self-term is dropped.

Parameters:
pair_energy(d)[source]

E_toy for a separation d (eq 16). Public: the docs plot it.

Parameters:

d (Array)

Return type:

Array