XTRG¶
Alice's XTRG algorithm computes finite-temperature thermodynamic properties of
a Hamiltonian MPO via exponential cooling. The thermal density matrix is
repeatedly squared — ρ(β_{n+1}) ≈ compress(ρ_n ⊗ ρ_n) — using a
sweep-based variational MPO-MPO compression kernel.
API¶
| Symbol | Description |
|---|---|
| Options | Run options: scheme, τ₀, cooling steps, bond dimension, caching, artifacts |
| Summary | Thermodynamic history: log Z, free energy, internal energy, specific heat, entropy |
| Artifact | Density-matrix snapshot ρ(β) at one cooling step |
| run | Top-level entry point |
Usage Pattern¶
from alice.network import build_interaction, build_hamiltonian
from alice.network.thermal import thermal_mpo
from alice.algorithm import xtrg
interactions, spc, geo = build_interaction(cfg)
H = build_hamiltonian(interactions, geo.L, spc)
opts = xtrg.Options(scheme='2s', n_steps=20, max_bond=64)
rho0 = thermal_mpo(H, opts.tau_0, opts.taylor_order, spc)
summary, artifact = xtrg.run(xtrg.Artifact(rho=rho0, beta=opts.tau_0, step=0), opts)
for beta, f in zip(summary.betas, summary.free_energies):
print(f"β = {beta:.4f}, f = {f:.6f}")
run() takes the starting density matrix as an Artifact (rho, beta, step). Resuming an
interrupted run is just calling run() again with the Artifact loaded from xtrg.ckpt:
resumed = xtrg.Artifact.load(ckpt_dir / 'xtrg.ckpt')
summary, artifact = xtrg.run(resumed, opts) # thermal.ckpt auto-loaded from opts.checkpoint_dir
Continuing a finished run¶
A run that already finished continues the same way, starting from any archived
artifacts/step_XX.ckpt and new options — here cooling from β = 2²⁰τ₀ to
2²⁵τ₀ at a larger bond dimension:
state = xtrg.Artifact.load(ckpt_dir / 'artifacts' / 'step_20.ckpt')
opts = xtrg.Options(tau_0=2 ** -12, n_steps=25, max_bond=512,
checkpoint_dir=str(ckpt_dir))
summary, artifact = xtrg.run(state, opts)
n_steps is the absolute step index to stop at (steps counted from τ₀), not a
number of additional steps, and tau_0 must match the τ₀ the recovered history
was built on.
Starting from a step before the end of that history is allowed, and is how a
segment is re-cooled under different options: loading step_15.ckpt with
n_steps=20 truncates the history back to step 15 (with a warning), then
recomputes steps 16 … 20, overwriting both thermal.ckpt and the corresponding
step_XX.ckpt archives.
Update Schemes¶
| Name | Alias | Description |
|---|---|---|
'1s' |
'1-site', 'one-site' |
1-site direct contraction; preserves bond dimension |
'2s' |
'2-site', 'two-site' |
2-site SVD with truncation; drives bond growth |
'1sp' |
'1-site-plus', 'one-site-plus' |
CBE: 1-site cost with 2-site-like bond flexibility |
Temperature Grid¶
XTRG samples an exponentially spaced β grid starting from τ₀:
Thermodynamic observables (u, c_V, S) are derived from log Z using log-β finite differences, which give uniform O((ln 2)²) discretization error across the grid.
See Also¶
- xtrg.run — full parameter reference.
- NormalMPO — the density matrix representation.
- thermal_mpo — used to build the initial
Artifact.