Skip to content

Examples

This section explores how to use the density matrix in the canonical ensemble

\[ \hat\rho=\frac{e^{-\beta \hat H}}{\mathrm{Tr}\,e^{-\beta \hat H}},\qquad \beta=\frac{1}{k_B T}, \]

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

\[ \hat H = -\mu_B \sigma_z B = -\mu_B B \hat\sigma_z \]

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

\[ e^{-\beta \hat H} = \begin{pmatrix} e^{\beta\mu_B B} & 0 \\[2pt] 0 & e^{-\beta\mu_B B} \end{pmatrix}. \]

Divide by the trace to normalize and we get

\[ \hat\rho = \frac{1}{e^{\beta\mu_B B}+e^{-\beta\mu_B B}} \begin{pmatrix} e^{\beta\mu_B B} & 0 \\[2pt] 0 & e^{-\beta\mu_B B} \end{pmatrix}. \]

This says: "probability of up" and "probability of down" are proportional to their Boltzmann factors.

Average Spin

The average value of \(\sigma_z\) is

\[ \langle\sigma_z\rangle = \frac{e^{\beta\mu_B B}-e^{-\beta\mu_B B}} {e^{\beta\mu_B B}+e^{-\beta\mu_B B}} = \tanh(\beta \mu_B B). \]

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

\[ \hat H = -\frac{\hbar^2}{2m}\nabla^2. \]

Energy Eigenstates

With periodic boundary conditions, the eigenfunctions are plane waves:

\[ \phi_{\mathbf{k}}(\mathbf{r})=\frac{1}{L^{3/2}} e^{i \mathbf{k}\cdot\mathbf{r}}. \]

The allowed wave-vectors are

\[ \mathbf{k} = \frac{2\pi}{L}\mathbf{n} ,\qquad \mathbf{n} = (n_x,n_y,n_z),\ n_i\in \mathbb{Z}, \]

and the energies are

\[ E_{\mathbf{k}} = \frac{\hbar^2 k^2}{2m}. \]

Density Matrix in Coordinate Space

We want \(\rho(\mathbf{r},\mathbf{r}') = \langle \mathbf{r}|\hat\rho|\mathbf{r}'\rangle\).

Using the eigenstates:

\[ \langle \mathbf{r}|e^{-\beta\hat H}|\mathbf{r}'\rangle = \sum_{\mathbf{k}} e^{-\beta E_{\mathbf{k}}} \phi_{\mathbf{k}}(\mathbf{r})\phi_{\mathbf{k}}^*(\mathbf{r}'). \]

Plug in the plane waves; we get a sum like

\[ \frac{1}{L^3}\sum_{\mathbf{k}} e^{-\beta\hbar^2 k^2/2m} e^{i\mathbf{k}\cdot(\mathbf{r}-\mathbf{r}')}. \]

For a large box, we replace the sum over \(\mathbf{k}\) by an integral. That integral is a standard Gaussian integral and gives

\[ \langle \mathbf{r}|e^{-\beta\hat H}|\mathbf{r}'\rangle = \left(\frac{m}{2\pi\beta\hbar^2}\right)^{3/2} \exp\!\left[-\frac{m(\mathbf{r}-\mathbf{r}')^2}{2\beta\hbar^2}\right]. \]

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

\[ \rho(\mathbf{r},\mathbf{r}') = \frac{1}{V} \exp\!\left[-\frac{m(\mathbf{r}-\mathbf{r}')^2}{2\beta\hbar^2}\right]. \]

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

\[ \lambda_{\text{th}}\sim\frac{h}{\sqrt{2\pi m k_B T}} \]

(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

\[ \langle H\rangle = \frac{3}{2}k_B T \]

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

\[ \hat H = -\frac{\hbar^2}{2m}\frac{d^2}{dq^2} +\frac{1}{2} m\omega^2 q^2. \]

Energy Eigenvalues and Eigenfunctions

Energies:

\[ E_n = \left(n+\tfrac{1}{2}\right)\hbar\omega,\qquad n=0,1,2,\dots \]

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:

\[ \langle q|e^{-\beta\hat H}|q'\rangle = \sum_{n=0}^\infty e^{-\beta E_n}\phi_n(q)\phi_n(q'). \]

There is a known closed-form formula (essentially Mehler's formula for Hermite polynomials). The final result is

\[ \langle q|e^{-\beta\hat H}|q'\rangle = \left[\frac{m\omega}{2\pi\hbar\sinh(\beta\hbar\omega)}\right]^{1/2} \exp\{\text{quadratic form in } q,q'\}, \]

which is again a Gaussian in \(q,q'\).

Partition Function

To get \(Z = \mathrm{Tr}\,e^{-\beta\hat H}\), integrate the diagonal:

\[ Z = \int_{-\infty}^{\infty}\langle q|e^{-\beta\hat H}|q\rangle\,dq = \frac{1}{2\sinh(\frac{1}{2}\beta\hbar\omega)}. \]

This is the standard partition function of a quantum harmonic oscillator.

Probability Distribution for Position

The diagonal of the density matrix is

\[ \rho(q,q)=\langle q|\hat\rho|q\rangle = \frac{\langle q|e^{-\beta\hat H}|q\rangle}{Z}, \]

which gives

\[ \rho(q,q) = \left[\frac{m\omega}{\pi\hbar}\tanh\!\left(\frac{1}{2}\beta\hbar\omega\right)\right]^{1/2} \exp\!\left[-\frac{m\omega q^2}{\hbar}\tanh\!\left(\frac{1}{2}\beta\hbar\omega\right)\right]. \]

So the position distribution is Gaussian in \(q\), centered at 0.

Its width (root-mean-square position) is

\[ q_{\text{r.m.s.}}= \left[\frac{\hbar}{2m\omega}\coth\!\left(\frac{1}{2}\beta\hbar\omega\right)\right]^{1/2}. \]

Limits

High temperature (\(\beta\hbar\omega\ll1\)):

\(\tanh(\beta\hbar\omega/2)\approx \beta\hbar\omega/2\). Then

\[ \rho(q,q) \approx \left(\frac{m\omega^2}{2\pi k_BT}\right)^{1/2} \exp\left[-\frac{m\omega^2 q^2}{2k_BT}\right], \]

which is exactly the classical Boltzmann distribution in a quadratic potential.

Low temperature (\(\beta\hbar\omega\gg1\)):

\(\tanh(\beta\hbar\omega/2)\to1\). Then

\[ \rho(q,q) \to |\phi_0(q)|^2, \]

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

\[ \langle H\rangle = -\frac{\partial}{\partial\beta}\ln Z = \frac{1}{2}\hbar\omega\coth\!\left(\frac{1}{2}\beta\hbar\omega\right). \]

The position distribution can be rewritten in terms of \(\langle H\rangle\):

\[ \rho(q,q)=\left(\frac{m\omega^2}{2\pi\langle H\rangle}\right)^{1/2} \exp\left[-\frac{m\omega^2 q^2}{2\langle H\rangle}\right], \]

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.