Canonical ensemble (source code)

= Canonical ensemble
{title2=$p_s=Z^{-1}e^{-\beta E_s}$}
{wiki}

The <canonical ensemble> is the <probability distribution> for a system in <thermal equilibrium> with a <heat bath> at fixed <temperature> $T$, with fixed particle number and external parameters. It allows <energy> exchange, so individual <energy> measurements fluctuate. With <Boltzmann constant> $k_B$ and <inverse temperature> $\beta=1/(k_BT)$,
$$
p_s=\frac{e^{-\beta E_s}}{Z},\qquad Z=\sum_s e^{-\beta E_s}.
$$
The <heat bath> is idealized as large enough that exchanges barely change its <temperature>; coupling must permit equilibration while contributing negligible interaction <energy>. A finite <heat bath> approximates this description only when its <temperature> change is negligible over the relevant exchanges. Strong coupling or a small <heat bath> can require a different description.

For one <two-level system> at positive <temperature>, the <Boltzmann weights> are $1,e^{-\beta\Delta}$, hence
$$
Z_1=1+e^{-\beta\Delta},\qquad p=\frac{e^{-\beta\Delta}}{Z_1}=\frac1{1+e^{\beta\Delta}}.
$$
At $\beta\Delta=\ln3$, $Z_1=4/3$ and $p=1/4$. This is a probabilistic thermal <mixed state>. For quantum levels, its <density matrix> is $\rho=(1-p)|0\rangle\langle0|+p|1\rangle\langle1|$. The <pure state> $\sqrt{1-p}|0\rangle+\sqrt p|1\rangle$ has the same <energy measurement> <probabilities>, but also has <quantum coherence> between the <energy eigenstates>. Matching those <probabilities> does not make the states equivalent.