Monitor¶
- class jaxrens.postprocess.monitor.Monitor(*, dead_energies, dead_volumes, live_energies, live_volumes, log_evidence, iteration, n_live, n_cull=1, symbol_map=None, energy_trace=None, iteration_trace=None, adaptation_trace=None, re_trace=None, max_neighbors_trace=None, label='', path=None)[source]¶
Bases:
objectLoad and analyze a single jaxrens NS run.
Reads the checkpoint HDF5 (preferred) plus the .energies file for the iteration trace. All scientific computations delegate to postprocess.thermodynamics.
In NPT the stored energies are already enthalpies
H = U + P V(EnsembleTermaddsP Vduring sampling), so the observables use them as they are. The cell volumes are kept as data only: they setis_nptand feed<V>(T)viaexpectation(volume_trace, T).- Variables:
dead_energies – Dead-point energies, shape (n_dead,); enthalpies in NPT.
dead_volumes – Dead-point cell volumes for NPT runs, shape (n_dead,), or None.
live_energies – Live-walker energies at run end, shape (n_live_actual,).
live_volumes – Live-walker cell volumes for NPT, shape (n_live_actual,), or None.
log_evidence – Scalar log Z stored in the checkpoint.
iteration – Iteration number at checkpoint.
n_live – Number of live walkers used in the run.
n_cull – Number of walkers culled per iteration.
symbol_map – Mapping from integer type codes to element symbols, or None.
energy_trace – Per-iteration culled energy from .energies file, or None.
iteration_trace – Iteration indices matching energy_trace, or None.
adaptation_trace – Per-move step sizes and acceptance rates, or None.
re_trace – Per-fire inter-replica swap counts and acceptance rates, or None.
max_neighbors_trace – Per-iteration neighbor-bucket diagnostics (per-walker max_neighbor_count + bucket size + overflow), or None. Loaded from
<prefix>.max_neighbors.h5when the run opted in viaoutput.save_max_neighbors.label – Human-readable label for plots.
path – Source directory, or None.
volume_trace – Cell volume of each dead point from the .energies log, shape (n_dead,). Set by
from_directory(and byMonitorCollection.from_multi_run_directory) only.
- Parameters:
- classmethod from_directory(path, label=None, *, prefix='ns', prefer_final=True)[source]¶
Load a run from a directory.
Picks
<prefix>.final.checkpoint.h5if it exists andprefer_final=True, otherwise falls back to<prefix>.checkpoint.h5. RaisesFileNotFoundErrorif neither exists.- Parameters:
- Returns:
Populated Monitor.
- Return type:
- expectation(observable, T, k_B=1.0)[source]¶
Compute thermal expectation <O>(T) for a per-dead-point observable.
- Parameters:
- Return type: