run¶
Top-level XTRG entry point.
run
¶
Run XTRG starting from a given thermal density matrix state.
Repeatedly squares state.rho using variational MPO-MPO compression to
reach β_max = 2^n_steps × τ₀, starting at state.step and continuing to
opts.n_steps. Building ρ(τ₀) (e.g. via thermal_mpo) and wrapping it
in an Artifact at step=0 is the caller's responsibility. Resuming an
interrupted run, or continuing a finished one under new options, is
calling run() again with the Artifact loaded from xtrg.ckpt or
from any archived artifacts/step_XX.ckpt; the matching β/log Z history
is recovered automatically from thermal.ckpt in opts.checkpoint_dir.
When that history reaches past state.step — the case when restarting
from an earlier archived step to re-cool a segment at, say, a larger
max_bond — the later entries are truncated (with a warning), then
recomputed by this run and overwritten on disk, together with their
step_XX.ckpt archives.
Thermodynamic observables (f, u, c_V, S) are computed from log Z at each step using log-β finite differences for uniform accuracy across the exponential temperature grid.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
state
|
Artifact
|
Starting density matrix, paired with its |
required |
opts
|
Optional[Options]
|
XTRG run options. Defaults to |
None
|
Returns:
| Type | Description |
|---|---|
Summary
|
Thermodynamic history (β grid, log Z, derived observables). Written
to |
Artifact
|
Final density matrix |
Raises:
| Type | Description |
|---|---|
ValueError
|
If |
NotImplementedError
|
If |
FileNotFoundError
|
If |