Alice 0.1.4
Alice 0.1.4 — Thermal Density Matrix
Release Date: May 31, 2026
Version 0.1.4 introduces thermal density matrix support via a Taylor-series MPO
expansion. The new NormalMPO class and thermal_mpo function allow computing
finite-temperature expectation values directly within the existing observe workflow.
No breaking changes.
🌡️ Thermal Density Matrix
NormalMPO
- New
NormalMPOclass inalice.network.thermal: anMPOsubclass that represents an
operator asscale × mpo_unit, where the internal MPO satisfiesnorm() ≈ 1and the
true physical magnitude is carried in a separate_scaleattribute. - Arithmetic operations preserve the unit-norm convention analytically:
__matmul__(@) — MPO–MPO product via site-by-site tensor contraction and
left/right bond fusion usingmerge_axes; scale updated as the product of the two
_scalevalues.__add__(+) — MPO–MPO sum; relative weightother._scale / self._scaleis
distributed uniformly across sites asweight^(1/L)per site viaoplus, following
the same bond-axis convention asbuild_hamiltonian.__mul__/__rmul__(*) — scalar multiplication; only_scaleis
updated, site tensors are not touched.
compact(trunc=None)performs two-sweep SVD compression and folds the extracted norm
into_scale; bond arrow directions are restored bycapcupafter the sweeps so that
subsequenttrace()andobserve()calls work correctly.- Class method
NormalMPO.from_mpo(mpo)constructs aNormalMPOfrom any plainMPO:
clones the tensors, canonicalizes to site 0, and uses the Frobenius norm as_scale. scaleproperty (read-only) exposes_scale.- Exported from
alice.networkand thealicetop-level namespace.
thermal_mpo
-
New function
thermal_mpo(H, beta, order, spc, trunc, coeff_thresh)in
alice.network.thermal: approximatesρ(β) = exp(−βH)via the truncated Taylor
series$$\rho(\beta) \approx \sum_{n=0}^{N} \frac{(-\beta)^n}{n!} H^n$$ where
H^0 = Iis an L-site identity MPO built fromspc. -
Bond dimensions are controlled by calling
compact()after every addition and every
power step; early exit when the Taylor coefficient|β^n / n!|drops below
coeff_thresh(default1e-15). -
The returned
NormalMPOcarries_scale ≈ Z = Tr[ρ](up to the MPO norm), so a
single trace suffices to extract the partition function. -
Exported from
alice.networkand thealicetop-level namespace.
observe updated for NormalMPO
alice.network.observe.observenow accepts aNormalMPOas the state argument in
addition to the existingMPSandMPOtypes.- When a
NormalMPOis passed,observeforms the MPO productρ @ O, compresses it
withcompact(), and returnsTr[ρ O] / Tr[ρ]— the normalized thermal expectation
value.
📖 Documentation
New API Pages
NormalMPO: class reference with parameter table, arithmetic-operation descriptions,
and notes on the unit-norm convention.thermal_mpo: function reference with parameter table, Taylor-series formula, and
notes on early stopping and bond growth.
Updated Pages
alice.networkindex page:NormalMPOandthermal_mpoadded to the module summary
and navigation entry.observereference:NormalMPOadded to the accepted state types.- Navigation (
mkdocs.yml):normal-mpo.mdandthermal-mpo.mdadded under the
Network section.
📊 Statistics
- ~740 tests across 23 test modules (up from ~700 / 22 modules in v0.1.3)
- 13 commits since v0.1.3
- 9 files changed, 1,192 insertions, 10 deletions
- 22 source modules in three subpackages:
alice.network,alice.physics,
alice.algorithm.dmrg
✅ Compatibility
Breaking Changes: None — fully backward compatible with v0.1.3. All import paths,
function signatures, TOML configuration keys, and geometry APIs are unchanged.
Requirements:
- Python ≥ 3.11
- PyTorch ≥ 2.5
- Nicole ≥ 0.3.7
📝 Notes
NormalMPO addresses a numerical stability problem intrinsic to MPO arithmetic: repeated
matrix products cause the Frobenius norm to grow or shrink exponentially with chain length
and expansion order. Keeping the internal tensors at unit norm and tracking the physical
magnitude in a scalar decouples the truncation from the scale, so compact() can safely
apply an SVD threshold relative to the largest singular value without being misled by an
overall factor that differs by many orders of magnitude.
thermal_mpo uses this representation throughout the Taylor accumulation loop: both
H_pow (the running power H^n) and rho (the partial sum) are kept as NormalMPO
instances and compressed after every update. The early-stopping condition on the Taylor
coefficient provides an automatic check that the series has converged to double-precision
accuracy, independent of the value of order.