← Atlas

Operators · Thermal 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.

Exact & formalUpdated

View frozen graph

ancillasystemStep 1 of 2 · RY(θ) · on ancillaRY(θ)Step 2 of 2 · CX · on ancilla, systemCX

2 steps across 2 wires. Hover a step, or press play to go through them in order.

Expected outcomes

  • p0 (system in |0⟩)73%
  • p1 (system in |1⟩)27%
  • Steps2
  • Wires2
  • Qubits1 system + 1 ancilla
  • Depth2 gates (RY, CNOT)
  • Free parameterθ(β, Δ)
  • Papers1
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

References

Exact & formal
  • Direct mathematics
  • Verified by construction
  • Peer-reviewed paper
Method
For H = -(Delta/2) Z the exact Boltzmann populations p0 = 1/(1+e^{-beta*Delta}), p1 = e^{-beta*Delta}/(1+e^{-beta*Delta}) were derived analytically and compared against the reduced density matrix of the system qubit obtained by tracing out the ancilla after the RY(theta)-CNOT purification circuit, for theta = 2*arctan(exp(-beta*Delta/2)).
Result
Pass · the reduced single-qubit state is diagonal with populations matching the Boltzmann distribution exactly for the stated theta.
Caveat
This construction only produces the thermal state of a single non-interacting qubit (diagonal Hamiltonian); it is not a general-purpose Gibbs sampler for interacting many-body Hamiltonians, which require more elaborate protocols (e.g. quantum Metropolis or QITE).
Sampling from the thermal quantum Gibbs state and evaluating partition functions with a quantum computer ↗
Kind
curated reference
Reviewed by
Leona Quantum curation pass
License
CC BY 4.0-compatible reference metadata
thermal stategibbs statepurificationmixed state

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