heat_capacity

jaxrens.postprocess.thermodynamics.heat_capacity(beta, dead_energies, live_energies, n_live, n_cull=1)[source]

Heat capacity C_v(beta) = beta² · Var(E) at inverse temperature beta.

Uses the deviation form Σ w_i (E_i - <E>)² instead of the algebraic identity <E²> - <E>²: the latter exhibits catastrophic cancellation at low T (distribution collapses onto a single walker, <E²> and <E>² both approach E_min², and their difference is dominated by float noise). Even in fp64 the deviation form is the safer default; in fp32 the algebraic form gives visible negative-Cv spikes.

Parameters:
  • beta – Inverse temperature.

  • dead_energies – Dead point energies, shape (*batch, n_dead).

  • live_energies – Live walker energies, shape (*batch, n_live) or (n_live,).

  • n_live – Number of live walkers.

  • n_cull (int) – Number culled per iteration.

Returns:

C_v with shape batch — scalar for 1-D input.

Return type:

ndarray