Examples
This section explores how to use the density matrix in the canonical ensemble
for three simple quantum systems: a spin-½ in a magnetic field, a free particle in a box, and a harmonic oscillator.
For each system, we:
- write the Hamiltonian \(\hat H\),
- find its eigenvalues and eigenstates,
- build \(e^{-\beta \hat H}\) and \(\hat\rho\),
- read physical quantities (expectation values, probability distributions) from \(\hat\rho\).
1. Electron in a Magnetic Field (Spin-½)
System
An electron has spin up \(|\uparrow\rangle\) or spin down \(|\downarrow\rangle\) along \(z\). A magnetic field is applied along \(z\): \(\mathbf{B} = B \hat{z}\).
The Hamiltonian is
so the energies are:
- \(E_\uparrow = -\mu_B B\),
- \(E_\downarrow = +\mu_B B\).
Spin parallel to \(B\) is lower in energy.
Density Matrix
In the basis where \(\sigma_z\) is diagonal, the Boltzmann factors are:
- for up: \(e^{-\beta E_\uparrow} = e^{\beta\mu_B B}\),
- for down: \(e^{-\beta E_\downarrow} = e^{-\beta\mu_B B}\).
So
Divide by the trace to normalize and we get
This says: "probability of up" and "probability of down" are proportional to their Boltzmann factors.
Average Spin
The average value of \(\sigma_z\) is
So:
- at high T (\(\beta \to 0\)), \(\tanh \to 0\): spins are random, no magnetization;
- at low T (\(\beta \to \infty\)), \(\tanh \to 1\): almost all spins point along the field.
2. Free Particle in a Box
Now we move from a 2-level system to a particle moving in space.
System
A particle of mass \(m\) is confined in a cube of side \(L\) with periodic boundary conditions (so the math is nicer).
The Hamiltonian is
Energy Eigenstates
With periodic boundary conditions, the eigenfunctions are plane waves:
The allowed wave-vectors are
and the energies are
Density Matrix in Coordinate Space
We want \(\rho(\mathbf{r},\mathbf{r}') = \langle \mathbf{r}|\hat\rho|\mathbf{r}'\rangle\).
Using the eigenstates:
Plug in the plane waves; we get a sum like
For a large box, we replace the sum over \(\mathbf{k}\) by an integral. That integral is a standard Gaussian integral and gives
Then we normalize to get \(\hat\rho\). Since the trace is just \(V\left(\frac{m}{2\pi\beta\hbar^2}\right)^{3/2}\), we end up with
Physical Meaning
The diagonal element, \(\rho(\mathbf{r},\mathbf{r})=1/V\), means the particle is equally likely to be anywhere in the box (makes sense for a free particle in equilibrium).
The off-diagonal part (when \(\mathbf{r}\neq \mathbf{r}'\)) tells us about quantum "coherence" between different positions. It decays as a Gaussian in \(|\mathbf{r}-\mathbf{r}'|\) with a characteristic length
(the thermal de Broglie wavelength).
So:
- at high T, \(\lambda_{\text{th}}\) is small → coherence is only over tiny distances → classical behavior.
- at low T, \(\lambda_{\text{th}}\) is large → strong quantum delocalization.
We can also compute \(\langle H\rangle\) from \(\hat\rho\) and get
as expected for a free particle in 3D (equipartition).
3. Linear Harmonic Oscillator
Now we consider a bound particle in a quadratic potential.
System
The Hamiltonian is
Energy Eigenvalues and Eigenfunctions
Energies:
Eigenfunctions (in position \(q\)) are expressed in terms of Hermite polynomials \(H_n(\xi)\). We have a complete orthonormal set \(\phi_n(q)\).
Matrix Elements of \(e^{-\beta\hat H}\)
Using spectral expansion:
There is a known closed-form formula (essentially Mehler's formula for Hermite polynomials). The final result is
which is again a Gaussian in \(q,q'\).
Partition Function
To get \(Z = \mathrm{Tr}\,e^{-\beta\hat H}\), integrate the diagonal:
This is the standard partition function of a quantum harmonic oscillator.
Probability Distribution for Position
The diagonal of the density matrix is
which gives
So the position distribution is Gaussian in \(q\), centered at 0.
Its width (root-mean-square position) is
Limits
High temperature (\(\beta\hbar\omega\ll1\)):
\(\tanh(\beta\hbar\omega/2)\approx \beta\hbar\omega/2\). Then
which is exactly the classical Boltzmann distribution in a quadratic potential.
Low temperature (\(\beta\hbar\omega\gg1\)):
\(\tanh(\beta\hbar\omega/2)\to1\). Then
the ground-state probability density — purely quantum.
So the distribution smoothly interpolates between quantum ground state and classical thermal distribution.
Relation to Average Energy
We can also compute
The position distribution can be rewritten in terms of \(\langle H\rangle\):
so \(q_{\text{r.m.s.}} = \sqrt{\langle H\rangle/(m\omega^2)}\).
From this we can see that the mean potential energy \(\tfrac{1}{2} m\omega^2\langle q^2\rangle\) equals \(\tfrac{1}{2}\langle H\rangle\), so kinetic and potential each carry half of the total energy.
Big Picture
In all three examples, the density matrix in position (or spin) space ends up being a Gaussian in the relevant variables.
At high temperature, the results reduce to familiar classical distributions and equipartition (\(\tfrac{1}{2} k_BT\) per quadratic degree of freedom).
At low temperature, the distributions approach the quantum ground state behavior.