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
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 |
required |
spc
|
Index
|
Physical space index used to build the identity MPO (\(H^0 = I\)). |
required |
trunc
|
Optional[dict]
|
Truncation options forwarded to each |
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 |
1e-15
|
Returns:
| Type | Description |
|---|---|
NormalMPO
|
Approximation of \(e^{-\beta H}\) with physical scale stored
in |
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
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=20–25 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
_scaleseparately from unit-normed tensors. - observe — compute
Tr[ρ O] / Tr[ρ]from the returnedNormalMPO. - build_hamiltonian — construct the input Hamiltonian MPO.