analyze_file

jaxrens.cli.analyze.analyze_file(input_path, *, observable='heat_capacity', t_min, t_max, n_t=200, k_b=1.0, fmt='csv', output_path=None, plot=False, plot_path=None)[source]

Load a run’s checkpoint and write one thermodynamic observable vs T.

Parameters:
  • input_path (Path) – Path to <prefix>.checkpoint.h5 or <prefix>.final.checkpoint.h5. The sibling <prefix>.energies file in the same directory supplies the dead-point energies (see Monitor.from_directory).

  • observable (str) – One of "heat_capacity", "partition_function", "free_energy".

  • t_min (float) – Temperature sweep bounds, in whatever units k_b is calibrated for (reduced units by default, k_b=1.0). No default range is guessed — the right scale depends on the backend’s energy units, so silently picking one would be more likely to mislead than to help.

  • t_max (float) – Temperature sweep bounds, in whatever units k_b is calibrated for (reduced units by default, k_b=1.0). No default range is guessed — the right scale depends on the backend’s energy units, so silently picking one would be more likely to mislead than to help.

  • n_t (int) – Number of temperature points.

  • k_b (float) – Boltzmann constant in the run’s energy units per unit of T, e.g. 8.617e-5 (eV/K) if energies are in eV and T should read in Kelvin. Default 1.0 (reduced units).

  • fmt (str) – "csv" (default, fixed-width aligned columns; scalar observables only) or "json" (nests any shape, self-describing).

  • output_path (Path | None) – Destination data file. Defaults to a sibling <prefix>.<observable>.{csv,json}.

  • plot (bool) – Also render a PNG of the same data.

  • plot_path (Path | None) – Destination PNG when plot is set. Defaults to a sibling <prefix>.<observable>.png.

Returns:

(data_path, png_path) — png_path is None unless plot is set.

Return type:

tuple[Path, Path | None]