Summary¶
XTRG 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(),
log_z: list[float] = list(),
free_energies: list[float] = list(),
energies: list[float] = list(),
specific_heats: list[float] = list(),
entropies: list[float] = list(),
discarded_weights: list[float] = list(),
finished: bool = True,
n_steps: int = 0,
)
Bases: AlgorithmSummary
XTRG 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]
|
List of β values at each cooling step: [τ₀, 2τ₀, …, 2^n_steps τ₀]. |
list()
|
log_z
|
list[float]
|
|
list()
|
free_energies
|
list[float]
|
Free energy per site: f(β_n) = −log Z(β_n) / (β_n L). |
list()
|
energies
|
list[float]
|
Internal energy per site: u(β_n) estimated via log-β finite differences (uniform accuracy on the exponential grid). |
list()
|
specific_heats
|
list[float]
|
Specific heat per site: c_V(β_n) estimated via log-β finite differences. |
list()
|
entropies
|
list[float]
|
Entropy per site: S(β_n) = β_n (u(β_n) − f(β_n)). |
list()
|
discarded_weights
|
list[float]
|
Per-step discarded weight from the variational compression (2-site
only; |
list()
|
finished
|
bool
|
|
True
|
n_steps
|
int
|
Number of cooling (squaring) steps reflected in this summary. |
0
|
Methods:¶
serialize
¶
Serialize the summary to a plain dict compatible with torch.save.
Returns:
| Type | Description |
|---|---|
dict
|
Serialized summary (version 2; no density matrix). |
deserialize
classmethod
¶
Reconstruct a Summary from a dict produced by serialize.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
dict
|
Dict previously returned by |
required |
device
|
str
|
Unused for version-2 summaries (no tensors). Accepted for API
compatibility with |
'cpu'
|
Returns:
| Type | Description |
|---|---|
Summary
|
Reconstructed thermodynamic summary. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If |
Serialization¶
Summary supports save/load via torch.save / torch.load:
# Save after a run.
summary.save("thermal_result.ckpt")
# Load later.
from alice.algorithm.xtrg import Summary
summary = Summary.load("thermal_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 2 (no density matrix in the payload).
thermal.ckpt is also where a resumed or continued run recovers its β/log Z
history from. A continued run appends to that history, so a single summary may
merge segments computed under different options (a larger max_bond, say). The
merged history records no marker of where the options changed, and the u /
c_V finite differences spanning the junction mix both accuracies — copy the
checkpoint directory beforehand to keep the original series for comparison.