TemperatureCallback¶
- class jaxrens.cli.monitor.TemperatureCallback(n_live, n_cull=1, lag=100, interval=100, kB=8.6173324e-5)[source]¶
Bases:
objectFinite-difference temperature estimator (Baldock et al., PRE 96, 043311, 2017).
Maintains a per-replica FIFO of the last
laginfo["emax"]values and reportsT = 1 / (k_B * beta)withbeta = (L - 1) * log_alpha / (E_last - E_first)andlog_alpha = log((n_live + 1 - n_cull) / (n_live + 1)).Diagnostic only — never feeds back into the run. Works for SingleRun, VmapRuns, and PmapVmapRuns shape conventions via
info["_batcher"].Returns NaN when the deque is shorter than 2 samples or when
E_last == E_first(avoidsZeroDivisionError); downstream aggregation usesnp.nan{min,max,median}.- Parameters:
n_live (int) – Number of live walkers (from
NSConfig.n_live).n_cull (int) – Number of culled walkers per iteration (from
NSConfig.n_cull).lag (int) – Length of the Emax FIFO (window size for the finite difference).
interval (int) – Emit a log line every
intervaliterations.kB (float) – Boltzmann constant in the backend’s energy units. Default
8.6173324e-5eV/K (ASE convention). Set1.0for reduced-unit backends (LJ, harmonic).