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:
objectTwo 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). ThenV = det(cell) = aexactly, and the NPT enthalpy the ensemble wrapper already computes,H = U + P * V, is eq 18 of the paper with no special-casing. Theyandzcoordinates do not enter the energy; drive the system with thelattice_1danddistance_1dmoves, which keep the cell diagonal and the particles on the axis.Image sum.
n_imagesperiodic images are summed on each side. The count is static (it fixes the compiled shape) and ther_cutmask does the physics, so it only needs to be large enough thatn_images * a_min >= r_cutfor 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 nearmuthat term dominates. Only thei == j,n == 0self-term is dropped.- Parameters: