Skip to content

Summary

TgTRG thermodynamic summary: β grid, log Z, and derived observables at each cooling step. Density matrices are returned separately as Artifact.

Summary dataclass

Summary(
    betas: List[float] = list(),
    taus: List[float] = list(),
    log_z: List[float] = list(),
    free_energies: List[float] = list(),
    energies: List[float] = list(),
    specific_heats: List[float] = list(),
    entropies: List[float] = list(),
    exact_energies: List[float] = list(),
    discarded_weights: List[float] = list(),
    krylov_errors: List[float] = list(),
    max_bonds: List[int] = list(),
    finished: bool = True,
    n_steps: int = 0,
)

Bases: AlgorithmSummary

TgTRG thermodynamic summary (no density matrix).

Density matrices are returned separately as Artifact (and optionally archived under artifacts/ when Options.save_artifacts is enabled).

Parameters:

Name Type Description Default
betas List[float]

Inverse temperature at each cooling step, starting from the Taylor state's own β.

list()
taus List[float]

Increment each entry was reached with, aligned with betas. The first entry is 0.0: the Taylor state was not reached by a step. Recorded because the finite differences need the spacing, and because it tells the phases of a stacked schedule apart after the fact.

list()
log_z List[float]

log Z(β) at each step, from NormalMPO.log_trace() (never log(trace())), so it stays finite when Z(β) itself is far outside float64 range.

list()
free_energies List[float]

Free energy per site, f(β) = -log Z(β) / (β L).

list()
energies List[float]

Internal energy per site, u(β), by finite differences of log Z on the β grid.

list()
specific_heats List[float]

Specific heat per site, c_V(β) = -β² du/dβ, by finite differences of energies.

list()
entropies List[float]

Entropy per site, S(β) = β (u(β) - f(β)).

list()
exact_energies List[float]

Internal energy per site measured directly as Tr[ρH] / (Tr[ρ] L), recorded only when Options.obs_exact is enabled, and empty otherwise. Free of the grid's discretization error, so comparing it against energies measures that error.

list()
discarded_weights List[float]

Per-step discarded weight at the mid-chain bond ('2s'; 0.0 entries for '1s', which never truncates). One entry per step, so one fewer than betas.

list()
krylov_errors List[float]

Per-step largest Krylov error estimate over all local propagators. One entry per step.

list()
max_bonds List[int]

Largest bond dimension of ρ at each step, aligned with betas.

list()
finished bool

True only for the summary returned by a completed run() call. False for mid-run thermal.ckpt snapshots.

True
n_steps int

Number of cooling steps reflected in this summary.

0

Methods:

serialize

serialize() -> dict

Serialize the summary to a plain dict compatible with torch.save.

Returns:

Type Description
dict

Serialized summary (version 1; no density matrix).

deserialize classmethod

deserialize(data: dict, device: str = 'cpu') -> Summary

Reconstruct a Summary from a dict produced by serialize.

Parameters:

Name Type Description Default
data dict

Dict previously returned by serialize.

required
device str

Unused; the summary holds no tensors. Accepted for API compatibility with AlgorithmSummary.load.

'cpu'

Returns:

Type Description
Summary

Reconstructed thermodynamic summary.

Raises:

Type Description
ValueError

If data['version'] is not 1.

Serialization

Summary supports save/load via torch.save / torch.load:

# Save after a run.
summary.save("cooling_result.ckpt")

# Load later.
from alice.algorithm.tgtrg import Summary
summary = Summary.load("cooling_result.ckpt")

During run(), the latest summary is written to thermal.ckpt under Options.checkpoint_dir (or the current working directory when that option is unset). Serialization version is 1 (no density matrix in the payload).

thermal.ckpt is also where a resumed or continued run recovers its β/log Z history from, and finished is False on the mid-run snapshots. A continued run appends to that history, so a single summary may merge segments computed under different options — the two phases of a stacked exponential-then-linear schedule, or a second pass at a larger max_bond. taus is the one column that records where the step size changed; the u and c_V finite differences spanning a junction mix both spacings, and are correspondingly worse there.

Which columns to trust

Column Source Accuracy
log_z NormalMPO.log_trace() roundoff, when the rank suffices
free_energies log_z directly same as log_z
energies first differences of log_z limited by grid spacing
specific_heats second differences limited by grid spacing, worst of the three
entropies β (u - f) inherits the energies error
exact_energies Tr[ρH] / (Tr[ρ] L) roundoff; empty unless Options.obs_exact

Comparing energies against exact_energies on the same run measures the grid's discretization error directly.

See Also

  • Artifact — density-matrix snapshot at one cooling step.
  • Lessons — what limits each column, and what a converged Krylov error does not promise.
  • Options — configuration for the run that produced this summary.
  • run — returns (Summary, Artifact).