TemperatureCallback

class jaxrens.cli.monitor.TemperatureCallback(n_live, n_cull=1, lag=100, interval=100, kB=8.6173324e-5)[source]

Bases: object

Finite-difference temperature estimator (Baldock et al., PRE 96, 043311, 2017).

Maintains a per-replica FIFO of the last lag info["emax"] values and reports T = 1 / (k_B * beta) with beta = (L - 1) * log_alpha / (E_last - E_first) and log_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 (avoids ZeroDivisionError); downstream aggregation uses np.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 interval iterations.

  • kB (float) – Boltzmann constant in the backend’s energy units. Default 8.6173324e-5 eV/K (ASE convention). Set 1.0 for reduced-unit backends (LJ, harmonic).