Sign in
← Atlas
Exact & formalOperatorsThermal state preparation

Single-qubit thermal (Gibbs) state

The thermal (Gibbs) state of a single qubit in a longitudinal field, prepared exactly via a one-ancilla purification circuit.

thermal stategibbs statepurificationmixed state

Atlas stars stay in the public catalog. Saving this entry to your workspace starts an unstarred private copy.

A Gibbs state ρ = e^{-βH}/Z is mixed, not pure, so it cannot be written as a single circuit output ket; instead it is prepared as the reduced state of a larger pure state (a purification) after tracing out an ancilla — the simplest nontrivial example is a single qubit coupled to one ancilla.

Circuit & simulation
p0 (system in |0⟩)73%
p1 (system in |1⟩)27%
What this takes and returns
TakesNothingWhat joins here

Nothing goes in, and that is what this entry is: a pipeline starts here. There is no upstream to choose — what you pick is what comes after.

Nothing in the Atlas meets this end.

Returns2 qubitsWhat joins here

Returns a 2-qubit register a next stage can take. This is the end that joins.

12 entries meet this end. Named below.

Prepares a state. Nothing goes in, and what comes out is a register another stage can take. See all 12 →

Where the map uses this

This record is an instance of an object the map names, so these are the processes that consume or produce one. None of them is about this record in particular.

State you can prepare 5 of 33 processes

How it works

For a single-qubit Hamiltonian H=Δ2ZH = -\frac{\Delta}{2}Z with eigenvalues E0=Δ/2E_0=-\Delta/2 (for 0|0\rangle) and E1=+Δ/2E_1=+\Delta/2 (for 1|1\rangle), the Gibbs state at inverse temperature β=1/kBT\beta = 1/k_BT is

ρ(β)=eβHZ=p000+p111,p0=11+eβΔ,p1=eβΔ1+eβΔ.\rho(\beta) = \frac{e^{-\beta H}}{Z} = p_0 |0\rangle\langle0| + p_1 |1\rangle\langle1|, \qquad p_0 = \frac{1}{1+e^{-\beta\Delta}},\quad p_1 = \frac{e^{-\beta\Delta}}{1+e^{-\beta\Delta}}.

Purification construction. Introduce an ancilla and prepare ϕAS=cos(θ/2)0A0S+sin(θ/2)1A1S|\phi\rangle_{AS} = \cos(\theta/2)|0\rangle_A|0\rangle_S + \sin(\theta/2)|1\rangle_A|1\rangle_S by applying Ry(θ)R_y(\theta) to the ancilla and then CNOTAS\mathrm{CNOT}_{A\to S}. Tracing out the ancilla gives the system the reduced density matrix diag(cos2(θ/2),sin2(θ/2))\mathrm{diag}(\cos^2(\theta/2), \sin^2(\theta/2)). Choosing

θ=2arctan ⁣(eβΔ/2)\theta = 2\arctan\!\big(e^{-\beta\Delta/2}\big)

makes cos2(θ/2)=p0\cos^2(\theta/2) = p_0 and sin2(θ/2)=p1\sin^2(\theta/2) = p_1 exactly — this is a standard identity since tan(θ/2)=eβΔ/2\tan(\theta/2) = e^{-\beta\Delta/2} implies cos2(θ/2)=1/(1+tan2(θ/2))=1/(1+eβΔ)=p0\cos^2(\theta/2) = 1/(1+\tan^2(\theta/2)) = 1/(1+e^{-\beta\Delta}) = p_0.

Limits. As β0\beta \to 0 (infinite temperature), θπ/2\theta \to \pi/2 and ρI/2\rho \to I/2, the maximally mixed state. As β\beta \to \infty (zero temperature), θ0\theta \to 0 and ρ00\rho \to |0\rangle\langle0|, the ground state — recovering ordinary ground-state preparation as the T=0T=0 limit of Gibbs-state preparation.

Beyond one qubit. For interacting many-body Hamiltonians this single-ancilla trick does not generalize directly (the purification's Schmidt rank must match the Hilbert space dimension in general), and practical quantum Gibbs-sampling proposals instead use quantum Metropolis sampling, quantum imaginary-time evolution (QITE), or variational thermofield-double constructions — each with its own resource and convergence tradeoffs.

Implementation
Native
thermal_gibbs_state.py
import numpy as np
from qiskit import QuantumCircuit
from qiskit.quantum_info import DensityMatrix, partial_trace

def thermal_qubit(beta: float, delta: float) -> QuantumCircuit:
    theta = 2 * np.arctan(np.exp(-beta * delta / 2))
    qc = QuantumCircuit(2)  # qubit 0 = ancilla, qubit 1 = system
    qc.ry(theta, 0)
    qc.cx(0, 1)
    return qc

beta, delta = 1.0, 1.0
qc = thermal_qubit(beta, delta)
full = DensityMatrix.from_instruction(qc)
system_rho = partial_trace(full, [0])  # trace out the ancilla
print(np.real(system_rho.data))
# [[0.7311, 0], [0, 0.2689]]  ==  Boltzmann populations for beta*delta = 1


FINAL_CIRCUIT = qc
Quantum vs classical

Classical baseline

Use a classical state-vector or matrix simulation at the same width, precision, and measurement objective.

Quantum claim

The quantum record demonstrates a state or operator behavior; it does not make classical simulation or communication costs disappear.

How to compare

Compare fidelity, samples, gate depth, noise, memory, and the cost of preparing and reading the state.

Declared gaps

Nobody has reviewed this record for gaps yet.

Literature & references
Sampling from the thermal quantum Gibbs state and evaluating partition functions with a quantum computer2009 · David Poulin, Pawel Wocjan

Surveys quantum algorithms for Gibbs-state sampling, of which the single-qubit ancilla purification is the minimal instance.

arxiv.org/abs/0905.2199