---
title: Quantum Gibbs Sampler
url: https://www.emergentmind.com/topics/quantum-gibbs-sampler
type: topic
---

# Quantum Gibbs Sampler

A quantum Gibbs sampler is a quantum algorithm or open-system dynamics for preparing the Gibbs state of a Hamiltonian \(H\) at inverse temperature \(\beta\), typically written as \(\rho_\beta=e^{-\beta H}/Z\) with \(Z=\mathrm{Tr}[e^{-\beta H}]\). For a many-body Hamiltonian \(H=\sum_i h_i\) on Hilbert-space dimension \(D\), the operational task is to output a state \(\rho\) such that \(\|\rho-\rho_\beta\|_1\le \epsilon\) while controlling implementation cost, locality, and mixing time [2304.04526]. In the dissipative formulation, a quantum Gibbs sampler is a local, primitive, reversible Lindblad generator whose unique steady state is the Gibbs state; in more recent noncommutative formulations, the sampler is engineered to satisfy exact Kubo–Martin–Schwinger detailed balance for arbitrary Hamiltonians [1409.3435] [2311.09207].

## 1. Formal setting and target objects

The central object is the thermal state
\[
\rho_\beta=\frac{e^{-\beta H}}{\mathrm{Tr}[e^{-\beta H}]},
\]
which describes equilibrium at temperature \(T=\beta^{-1}\). In algorithmic settings, one asks either for a mixed-state preparation procedure, for a sampler that outputs measurement results distributed according to \(\rho_\beta\), or for a purified preparation of the thermofield-double state
\[
|\psi_\beta\rangle=\frac{1}{\sqrt{Z}}\sum_j e^{-\beta E_j/2}|\psi_j\rangle\otimes|\psi_j\rangle,
\]
whose partial trace returns \(\rho_\beta\) [1603.02940] [2604.22996].

Two notions of “sampler” coexist. In the semigroup viewpoint, one studies \(e^{t\mathcal L}\) for a Lindbladian \(\mathcal L\) with \(\mathcal L(\rho_\beta)=0\), and convergence is governed by spectral gap, log-Sobolev behavior, or related mixing parameters. In the circuit viewpoint, one prepares \(\rho_\beta\) or a purification directly using Hamiltonian simulation, phase estimation, linear combinations of unitaries, adiabatic continuation, or measurement-based updates. This suggests that “quantum Gibbs sampler” is not a single algorithmic template but a family of constructions sharing a common equilibrium target.

The distinction between state preparation and sample generation is not merely terminological. Some works target the density operator itself, some target computational-basis samples from a Gibbs state, and some exploit the sampler to estimate thermodynamic quantities such as \(Z\) or the free energy. That breadth is already visible in early phase-estimation-based algorithms, dissipative Lindbladians, and recent continuous-variable constructions [1603.02940] [2604.15263].

## 2. Detailed balance, Lindbladians, and equilibrium structure

For open-system samplers, the basic object is a Gorini–Kossakowski–Sudarshan–Lindblad generator. In the Heisenberg picture, a general KMS-detailed-balanced form can be written as
\[
L(X)=i[G,X]+\sum_{a=1}^r\left(L_a^\dagger X L_a-\tfrac12\{L_a^\dagger L_a,X\}\right),
\]
with the KMS condition \(\Delta_{\rho_\beta}^{-1/2}L_a=L_a^\dagger\), equivalently
\[
e^{-\beta H/2}L_a e^{+\beta H/2}=e^{-\beta\omega/2}L_a^\dagger
\quad\text{whenever }[H,L_a]=\omega L_a.
\]
A structural characterization states that \(L\) satisfies \(\rho_\beta\)-KMS detailed balance iff it admits such a representation with a coherent term \(G\) that commutes with \(\rho_\beta\) [2404.05998].

This framework generalizes the older commuting-Hamiltonian theory. For commuting local Hamiltonians, the Davies generator and the heat-bath generator are both local, primitive, reversible, frustration-free Gibbs samplers. Their convergence is governed by the spectral gap
\[
\lambda(\mathcal L)=\inf_f\frac{-\langle f,\mathcal L(f)\rangle_\rho}{\mathrm{Var}_\rho(f)},
\]
and a central equivalence states that the gap is independent of system size iff the Gibbs state satisfies a strong clustering property. In one dimension at any temperature, and in any dimension at high enough temperature, the samplers are gapped, so the Gibbs state can be prepared in polynomial time on a quantum computer [1409.3435].

For arbitrary noncommutative Hamiltonians, Chen, Kastoryano, and Gilyén construct an exact detailed-balanced Lindbladian
\[
\mathcal L_\beta[\rho]
=
-i[B,\rho]
+
\sum_{a\in A}\int_{-\infty}^{\infty}
\gamma(\omega)\Bigl(
\hat A^a(\omega)\rho \hat A^a(\omega)^\dagger
-\tfrac12\{\hat A^a(\omega)^\dagger \hat A^a(\omega),\rho\}
\Bigr)\,d\omega,
\]
where \(\hat A^a(\omega)\) are frequency-filtered Heisenberg evolutions of local scrambling operators and \(B\) is a coherent correction chosen so that exact quantum detailed balance holds. For lattice Hamiltonians, Lieb–Robinson bounds imply that the dressed jump operators are quasi-local with radius \(\sim\beta\), so the algorithm inherits a local-update interpretation even for noncommuting systems [2311.09207].

A later extension replaces the continuous family of jumps by a finite set of jump operators, possibly as few as one. The jump operators are built from user-chosen Hermitian couplings \(A^a\), weighting functions \(q^a(\omega)\) supported on a finite interval, and inverse Fourier transforms \(f^a(t)\) with super-polynomial decay when \(q^a\) is chosen from a compact-support Gevrey class. The resulting time-domain integrals can be truncated at \(T=\Theta(\beta \log^{1+o(1)}(t_{\mathrm{mix}}/\epsilon))\) and discretized efficiently [2404.05998].

## 3. Major algorithmic paradigms

One major family uses coherent block-encodings and purification. Chowdhury and Somma prepare the maximally entangled thermofield seed state, apply an approximation of \(e^{-\beta H/2}\) using the Hubbard–Stratonovich transform and Hamiltonian simulation of \(\sqrt H\), and then use amplitude amplification. For local or sparse Hamiltonians this yields gate complexity
\[
\widetilde O\!\left(\sqrt{N/Z}\,\beta\,\mathrm{polylog}(N\beta/\epsilon)\right),
\]
with polylogarithmic dependence on \(1/\epsilon\) rather than polynomial dependence, and with a quadratic improvement in the dependence on \(\beta\) over earlier approaches [1603.02940].

A distinct line aims at exact or near-exact sampling rather than approximate equilibration. Quantum “Coupling from the Past” adapts the Propp–Wilson perfect-sampling paradigm to energy eigenstates. It assumes an eigenbasis-preserving primitive quantum channel whose transition probabilities depend only on energies and uses phase estimation plus a classical coalescence structure to output perfect Gibbs samples without prior knowledge of the mixing time. The expected runtime depends strongly on degeneracy: for highly degenerate spectra it is polylogarithmic in the dimension and linear in the mixing time, while for non-degenerate spectra it is linear in the mixing time and quadratic in the dimension up to a logarithmic factor [1703.05800].

Metropolis-style constructions remain an active theme, but the technical route has shifted. A recent weak-measurement scheme replaces Marriott–Watrous rewinding by a weak accept/reject measurement and uses boosted quantum phase estimation based on medians of repeated QPE runs. One iteration defines a channel \(E[\tau]\) with expansion
\[
E(\rho)=\rho+\tau^2 L(\rho)+\tau^4 J[\tau](\rho),
\]
where \(L\) generates a continuous-time semigroup with a unique full-rank fixed point. If that semigroup mixes in time \(t_{\mathrm{mix}}(L,\epsilon)\), then \(K=t_{\mathrm{mix}}(L,\epsilon)/\tau^2\) discrete iterations suffice to reach \(\rho_\beta\) up to controlled error. The construction was motivated in part by the observation that the earlier analysis of the Temme–Osborne–Vollbrecht–Poulin–Verstraete algorithm relied on a boosted and shift-invariant version of QPE that may not exist [2406.16023].

The dissipative quantum Gibbs sampler of Zhang, Bosse, and Cubitt takes a different route. Its local step is the two-outcome instrument
\[
E_0(\rho)=K\rho K,\qquad
E_1(\rho)=\bigl(1-\mathrm{Tr}[K\rho K]\bigr)\rho_0,
\]
with \(\rho_0=I/D\) and a Hermitian step operator \(K\) that factorizes into sequential weak measurements of the local Hamiltonian terms. The crucial point is that the Gibbs state is not obtained as the fixed point of a Markov process. Instead, the output is taken at a random stopping time \(\tau\), and for a suitable stopping rule the expected output satisfies
\[
\mathbb E[\rho_\tau]=\frac{\cosh(\lambda K)}{\mathrm{Tr}[\cosh(\lambda K)]},
\]
which approximates the Gibbs state. The paper states explicitly that, in contrast to the classical case, the quantum Gibbs state is not generated by converging to the fixed point of a Markov process, but by the states generated at the stopping time of a conditionally stopped process [2304.04526].

## 4. Structure-exploiting constructions

Several samplers derive their efficiency from Hamiltonian structure rather than from a generic noncommutative template. For commuting local Hamiltonians, a recent reduction maps Gibbs-state preparation to classical Gibbs sampling. If \(H\) is a 2-local qudit commuting Hamiltonian, it can be mapped in \(O(n)\) time to a 2-local classical Hamiltonian \(H^{(c)}\) on the same graph. If \(H\) is a 4-local qubit commuting Hamiltonian on a 2D lattice with no classical qubits, puncturing and a structure-lemma decomposition reduce the problem to a constant-local classical Hamiltonian on a planar graph. The corresponding quantum algorithm samples from \(H^{(c)}\), prepares the associated eigenstate of \(H\), and applies sequential randomized corrections; for the defected Toric code at any non-zero temperature, the total runtime is \(O(n^2)\) [2410.04909].

For smooth periodic potentials on the torus \(T^d\), a different paradigm leverages Fourier analyticity. The potential \(E(x)\) is assumed \(C^\infty\) and analytically continuable to a complex strip, so its Fourier coefficients decay exponentially. Using zeroeth-order quantum queries, quantum Fourier transforms, and a quantum algorithm for linear ordinary differential equations, one solves a discretized Fokker–Planck equation whose stationary solution is the Gibbs density. The total gate cost is
\[
\widetilde O\!\bigl(\mathrm{poly}(d,\beta,1/\alpha)\cdot \log(1/\epsilon)\bigr),
\]
so the precision dependence is logarithmic, although the underlying Langevin mixing time can still be exponentially long in \(\beta\) for non-convex \(E\) [2210.08104].

Another alternative is quasi-probabilistic cluster expansion. Here the full Gibbs state is expanded into tensor products of local “Gibbs-cumulant” type states \(\Delta_m\), which need not be positive semidefinite. Writing
\[
\Delta_m=\|\Delta_m\|_1(\sigma_m^+-\sigma_m^-),
\]
one samples cluster partitions according to positive weights, prepares the corresponding local mixed-state factors, and reweights measurements by an overall sign and a negativity factor \(\lambda\). The method was demonstrated on 4-spin and 8-spin XY chains, including dynamical \(ZZ\) correlations and specific heat [2310.20129].

Adiabatic parent-Hamiltonian methods provide yet another viewpoint. Starting from a classical reversible Markov chain with detailed balance relative to a classical Gibbs distribution, one defines
\[
H_q(\beta)=n\Bigl[I-e^{-\beta H_c/2}Me^{+\beta H_c/2}\Bigr],
\]
whose unique ground state encodes the Gibbs amplitudes. Speedups arise when the adiabatic path is detoured to avoid unfavorable critical points: in the 1D ferromagnetic Ising chain, detoured paths yield \(t_a\sim n\) rather than \(n^2\); for weighted independent sets on certain graphs, one-parameter paths can scale as \(n^4\) while detoured paths yield \(t_a\sim n\). The weighted independent-set construction is naturally implementable on Rydberg atom arrays [2005.14059].

## 5. Complexity, mixing times, and lower bounds

Complexity analyses differ sharply by model class. For the dissipative stopped-process sampler, the expected output error obeys
\[
\|\mathbb E[\rho_\tau]-\rho_G\|_1
=
O(\beta \epsilon \kappa m^2)+O(e^{-\beta\kappa/\epsilon}),
\]
while the stopping time satisfies an upper bound that leads, after parameter choice, to
\[
\mathbb E[\tau]=\exp[O((\beta\kappa)^2 m^2/\epsilon)]
\]
times local-measurement cost \(O(m)\). The same work proves a fault-resilience statement: if each application of \(E_0\) is implemented noisily with per-step error \(\delta<\epsilon/(\beta\kappa)\), then the final sampling error is \(O(\delta)\) and does not grow with \(\mathbb E[\tau]\) [2304.04526].

For exact KMS-balanced noncommutative samplers, the implementation cost is organized around mixing time. The Chen–Kastoryano–Gilyén construction requires total Hamiltonian-simulation time
\[
O\bigl(t_{\mathrm{mix}}(\mathcal L_\beta)\,\beta\,\mathrm{polylog}(n,\beta,1/\epsilon)\bigr),
\]
and a finite-jump-set variant yields total Hamiltonian-simulation time
\[
\widetilde O\!\bigl(t_{\mathrm{mix}}(\beta+1)|A|^2\log^{1+s}(1/\epsilon)\,\mathrm{polylog}(\cdots)\bigr),
\]
with energy resolution depending only logarithmically on precision and mixing time [2311.09207] [2404.05998].

Mixing-time upper bounds are only one side of the story. A generic bottleneck lemma for quantum Gibbs samplers proves exponential lower bounds whenever orthogonal high-mass sectors are separated by a low-mass bottleneck and the sampler has bounded Bohr-spectrum range or bounded locality range. For classical Hamiltonians with \(T_{\mathrm{mix}}=\exp[\Omega(n^\alpha)]\), the corresponding quantum Gibbs samplers also satisfy \(T_{\mathrm{mix}}=\exp[\Omega(n^\alpha)]\). The paper gives explicit families: random \(K\)-SAT at low temperature with \(\alpha=1\), \(p\)-spin glasses with \(\alpha=1\), good \(n\)-qubit stabilizer codes with \(T_{\mathrm{mix}}=\exp[\Omega(n)]\), and the ferromagnetic 2D transverse-field Ising model with \(T_{\mathrm{mix}}=\exp[n^{1/2-o(1)}]\) for strictly local Lindblad operators [2411.04300].

Recent work also studies acceleration relative to the Lindbladian gap \(\Delta\). For KMS-symmetric samplers with an explicit parent-Hamiltonian factorization \( \widehat H\approx B^\dagger B\), purified Gibbs-state preparation can be reduced to a singular-value filtering problem. The resulting walk-free QSVT algorithm uses
\[
\widetilde O\!\Bigl(\sqrt{\frac{J}{\Delta}}\log\frac1\epsilon\Bigr)
\]
queries, giving a quadratic improvement in spectral-gap dependence over \(O(1/\Delta)\)-type behavior for a broad class of samplers [2604.22996].

By contrast, there are settings where rigorous positive-gap guarantees are available. For truncated Coulomb gases and molecular systems in \(d\in\{2,3\}\), a quantum Markov semigroup tailored to the finite-rank truncation has a strictly positive spectral gap for every truncation, implying exponential convergence to the target Gibbs state. The paper presents this as the first rigorous mixing-time guarantee for Gibbs sampling in a Coulomb interacting continuous-variable quantum system [2604.15263].

## 6. Estimation tasks, hardware realizations, and computational complexity of sampling

Quantum Gibbs samplers are used not only for state preparation but also for thermodynamic estimation. In the dissipative stopped-process sampler, the stopping statistics of \(M\) independent runs produce an unbiased estimator
\[
\hat Z
=
D\,e^{\beta\kappa(2m-1)}\frac{R_{\mathrm{plus}}}{R_{\mathrm{resets}}},
\]
with multiplicative \(O(\beta\epsilon\kappa m^2)\) error and variance \(O(Z^2/M)\). For Coulomb gases and molecules, Gibbs sampling is embedded into a thermodynamic-integration procedure for estimating the free energy \(F_\beta(H_n)\) with an end-to-end quantum algorithm whose complexity depends polynomially on \(n\), \(1/\epsilon\), and the inverse sampler gap [2304.04526] [2604.15263].

Experimental realizations emphasize a different regime. Studies of D-Wave quantum annealers report that programmable annealers behave as samplers generating independent configurations from low-temperature noisy Gibbs distributions. On up to 16 qubits with native Chimera connectivity and \(J,h\in\{-1,0,1\}\), a “sweet-spot”
\[
0.2\lesssim \alpha_{\mathrm{in}}\lesssim 0.4
\]
minimizes both control-noise and residual-transverse-field distortion; across 13 models, the total-variation distance between the empirical distribution and the best-fit Gibbs law drops below \(5\%\) on every instance and often reaches \(2\)–\(3\%\) [2012.08827] [2109.01690].

The computational-complexity side has developed in parallel. For carefully chosen commuting parent Hamiltonians of shallow circuits, thermalization under Davies-type Lindbladians mixes rapidly at constant temperature, yet sampling from the measurement distribution of the Gibbs state is classically hard under standard complexity assumptions. One construction proves quantum computational advantage for commuting local Hamiltonians at constant temperature, with mixing time \(\widetilde O(4^\ell e^\beta)\) and quantum runtime \(n^{1+o(1)}\) when \(\ell=O(1)\) [2404.14639]. A subsequent strengthening shows that hardness persists even for 5-local Hamiltonians on a 3D cubic lattice and for 6-local Hamiltonians with constant additive sampling error, while polynomial-time quantum preparation remains possible; the hardness is also robust to imperfect measurements [2408.01516].

A recurrent misunderstanding is that finite temperature automatically renders sampling classically benign. The constant-temperature hardness results show otherwise for specific families, while the slow-mixing results show that locality and detailed balance alone do not guarantee efficient equilibration. Conversely, the commuting-Hamiltonian reductions, continuous-potential algorithms, and hardware studies show that substantial positive results do exist, but only under structural assumptions that must be stated explicitly.

Source: https://www.emergentmind.com/topics/quantum-gibbs-sampler