Alice 0.2.1
Alice 0.2.1 — XTRG: Density-Matrix Artifacts
Release Date: August 7, 2026
Version 0.2.1 splits XTRG's density matrix out of Summary into a new Artifact
dataclass, and reworks checkpointing around that split: thermal.ckpt tracks the
thermodynamic history alone, progress.ckpt protects the latest density matrix against a
mid-run crash, and an optional artifacts/ archive keeps a caller-chosen range of
per-step density matrices on disk for computing additional observables later without
rerunning the cooling schedule. xtrg.run() now returns (Summary, Artifact). Breaking
change to xtrg.run()'s return signature and Summary's fields.
💾 Artifact and Checkpointing
Artifact
- New
Artifact(AlgorithmSummary)dataclass: a single density-matrix snapshot holding
rho(NormalMPO),beta, andstep. Step0is after Taylor init (ρ(τ₀)); step
kis after thek-th squaring. - Own
serialize()/deserialize()(version 1,torch.save-compatible), matching the
pattern used bySummaryanddmrg.Summary. - Exported from
alice.algorithm.xtrgalongsideOptions,Summary, andrun.
Summary Is Now Density-Matrix Free
Summarydrops itsrhoandrho_log_scalefields entirely, keeping only the
thermodynamic history (betas,log_z,free_energies,energies,
specific_heats,entropies,discarded_weights).serialize()/deserialize()bump to version 2 and reject version-1 (rho-carrying)
payloads with aValueError, so a stale checkpoint from v0.2.0 fails loudly rather
than silently losing the density matrix.
Checkpoint Files
thermal.ckptreplacesxtrg.ckpt: written after every squaring step and once more
at the end, holding the latest rho-freeSummary.progress.ckptis new: holds the latestArtifactwhile a run is in flight, and is
deleted (along with its lock file) oncerun()finishes successfully, so a completed
run leaves no stale mid-run state behind. A crash leaves it on disk for inspection or
manual recovery.checkpoint_dirnow defaults to the current working directory (resolved whenrun()
is called) rather than disabling checkpointing when unset, matching the convention
already used by.logging.
Artifact Archive
- New
Options.save_artifacts(defaultTrue) andOptions.save_artifacts_since
(default0, must be non-negative) control anartifacts/subdirectory under
checkpoint_dir, where every step fromsave_artifacts_sinceonward is written to
its own zero-paddedstep_XX.ckptfile viaArtifact. - This lets a caller keep exactly the temperature range they expect to need for later
analysis, without paying to permanently archive every step by default.
📚 Examples
xtrg_spinlessandxtrg_spinfulnow return(Summary, Artifact)and accept
save_artifacts/save_artifacts_sincekeyword arguments, threaded through to
Options.- New
--no-save-artifactsand--save-artifacts-since KCLI flags;
--checkpoint-dirhelp text updated to describe the newthermal.ckpt/
progress.ckpt/artifacts/layout.
📖 Documentation
- New
docs/algorithms/xtrg/artifact.mddocumentingArtifact, the on-disk checkpoint
directory layout, and a load-from-disk example; added to theAlgorithmsnavigation
betweenSummaryandLaunch. index.md,options.md,summary.md, andrun.mdcross-links updated for the
Summary/Artifactsplit and the(Summary, Artifact)return tuple.- Free-fermion and Hubbard worked examples updated to unpack both the summary and the
artifact fromxtrg.run(...).
📊 Statistics
- 930 tests across 29 test modules (up from 916 / 29 modules in v0.2.0).
- 19 commits since v0.2.0.
- 14 files changed, 545 insertions, 142 deletions.
- 26 source modules in four subpackages:
alice.network,alice.physics,
alice.algorithm.dmrg,alice.algorithm.xtrg(unchanged from v0.2.0 — this release
restructuresxtrg.pyrather than adding new modules).
✅ Compatibility
Breaking Changes:
xtrg.run()now returns(Summary, Artifact)instead of a singleSummary; call
sites that previously wrotesummary = xtrg.run(...)must switch to
summary, artifact = xtrg.run(...).Summaryno longer hasrhoorrho_log_scalefields; the density matrix is now
reached via the separately returnedArtifact.rho, or viaArtifact.load(...)from
an archivedartifacts/step_XX.ckptfile.- Checkpoint file names changed:
xtrg.ckptis replaced bythermal.ckpt(rho-free
Summary) and the newprogress.ckpt(latestArtifact); a v0.2.0xtrg.ckptfile
is not loadable bySummary.load()in this version (see version-1 rejection above).
Requirements:
- Python ≥ 3.11
- PyTorch ≥ 2.5
- Nicole ≥ 0.3.7
📝 Notes
The motivation for this split is that a caller generally needs many
intermediate-temperature density matrices — not just the final one — to compute
additional observables later without rerunning the whole cooling schedule. Archiving
rho at every step unconditionally would be wasteful, since most steps are never
revisited; separating Artifact out of Summary is what makes the choice of which
steps to keep possible in the first place. thermal.ckpt stays cheap and is always
written in full, since it never carries rho, while permanent archiving of rho is
opted into per step through save_artifacts_since. progress.ckpt sits outside that
policy entirely: it tracks only the single most recent Artifact, so a crash mid-run
does not lose the current density matrix regardless of which steps the caller chose to
archive.