Skip to content

thermal_mpo

Approximate the thermal density matrix \(\rho(\beta) = e^{-\beta H}\) as a NormalMPO via a truncated Taylor series.

thermal_mpo

thermal_mpo(
    H: MPO,
    beta: float,
    order: int,
    spc: Index,
    trunc: Optional[dict] = None,
    coeff_thresh: float = 1e-15,
) -> NormalMPO

Approximate the thermal density matrix via a Taylor expansion.

Computes

\[\rho(\beta) = e^{-\beta H} \approx \sum_{n=0}^{N} \frac{(-\beta)^n}{n!} H^n\]

where \(H^0 = I\) (identity). The computation is performed in MPO arithmetic, keeping the underlying MPO normalized at each step (via explicit compact() calls) to prevent numerical blow-up.

Parameters:

Name Type Description Default
H MPO

Hamiltonian as an MPO (will not be modified).

required
beta float

Inverse temperature \(\beta \geq 0\).

required
order int

Maximum truncation order \(N\) of the Taylor series. The loop terminates early once the actual contribution of the \(n\)-th term — measured as \(|\beta^n / n!| \times \|H^n\|_F\) — drops below coeff_thresh.

required
spc Index

Physical space index used to build the identity MPO (\(H^0 = I\)).

required
trunc Optional[dict]

Truncation options forwarded to each compact() call during the Taylor series accumulation. Defaults to {'thresh': 1e-14}.

None
coeff_thresh float

Early-stopping threshold on the actual contribution magnitude of the \(n\)-th Taylor term, \(|\beta^n / n!| \times \|H^n\|_F\). Once this falls below coeff_thresh the remaining contributions are negligible and the loop exits. Defaults to 1e-15. Note that checking the bare coefficient \(|\beta^n / n!|\) alone is insufficient for Hamiltonians with large operator norm, because \(\|H^n\|_F\) can be much larger than 1.

1e-15

Returns:

Type Description
NormalMPO

Approximation of \(e^{-\beta H}\) with physical scale stored in _scale (which equals \(Z = \operatorname{Tr}[\rho]\) up to the MPO norm).

Notes

compact() is called after every addition and every power step to keep bond dimensions under control. Bond arrow directions are restored by capcup inside compact(), so the result is always in a well-defined state for subsequent trace() or observe() calls.

Notes

Algorithm. The Taylor expansion

\[\rho(\beta) = \sum_{n=0}^{N} \frac{(-\beta)^n}{n!} H^n\]

is accumulated iteratively. At each step the running sum rho and the current power H^n are compacted — bond dimension is truncated and the norm is folded into _scale — preventing exponential growth of virtual bonds.

Convergence. The expansion converges when \(|\beta \lambda_{\max}| \ll N\), where \(\lambda_{\max}\) is the spectral radius of \(H\). In practice order=2025 is sufficient for \(\beta \|H\| \lesssim 4\).

Partition function. After the call, rho.trace() returns \(Z(\beta) = \operatorname{Tr}[e^{-\beta H}]\).

Thermal expectation values. Pass rho to observe(rho, O) to compute \(\langle O \rangle_\beta = \operatorname{Tr}[\rho O] / \operatorname{Tr}[\rho]\).

See Also

  • NormalMPO — the return type; tracks _scale separately from unit-normed tensors.
  • observe — compute Tr[ρ O] / Tr[ρ] from the returned NormalMPO.
  • build_hamiltonian — construct the input Hamiltonian MPO.