---
title: Hilbert space, observables and Hermitian operators
heading: Wave functions as vectors, and measurements as matrices
eyebrow: B10 · Lesson 15 · Hilbert space, observables and Hermitian operators
xp: 45
---

::: hook
So far each problem has been a differential equation. Underneath them is linear algebra, the same linear algebra as A7 and the inner-product spaces of A14. A wave function is a vector, in an infinite-dimensional space of square-integrable functions called **Hilbert space**. Every measurable quantity is a **Hermitian operator** on that space, a generalized symmetric matrix, and its possible results are its eigenvalues. Once you see it this way, a qubit, an electron's spin and a pair of coupled quantum wells are all just 2×2 matrices, and their behavior follows from the eigenvalues and eigenvectors.
:::

::: play
- Two quantum wells, each with one level, are coupled through a thin barrier. The Hamiltonian is the matrix $\begin{pmatrix}+\delta/2 & -t\\ -t & -\delta/2\end{pmatrix}$, where δ is the detuning between the wells (set by a bias voltage) and t the tunnel coupling.
- The curves are its two eigenvalues against δ. With no coupling, they cross. With coupling, they **avoid** each other: the gap never closes below 2t.
- At δ = 0 the eigenvectors are the symmetric and antisymmetric mixtures of the two wells; far from it each eigenvector lives mostly in one well. The readout shows how much of the lower state is in the left well.
:::
:::

```sim plot
view: graph
x: d = -0.3..0.3 eV
y: E = -0.25..0.25 eV
slider: t = 0..0.08 step 0.002 = 0.03 eV
slider: D = -0.3..0.3 step 0.01 = 0.1 eV
plot: sqrt(d^2/4 + t^2) | label: upper eigenvalue
plot: -sqrt(d^2/4 + t^2) | label: lower eigenvalue
plot: d/2 | dashed | label: uncoupled levels
plot: -d/2 | dashed
marker: d = D | label: this detuning
readout: gap here, eV = 2*sqrt(D^2/4 + t^2)
readout: lower state's share in the left well = 0.5*(1 - (D/2)/sqrt(D^2/4 + t^2 + 0.000000001))
```

::: predict
## Two identical wells (δ = 0) each have a level at 100 meV, coupled with t = 5 meV. What are the energies of the coupled pair?

- [ ] Both 100 meV
- [x] 95 and 105 meV
- [ ] 90 and 110 meV
- [ ] 100 and 105 meV

::: reveal
The matrix $\begin{pmatrix}E_0 & -t\\ -t & E_0\end{pmatrix}$ has eigenvalues $E_0 \mp t$: 95 meV for the symmetric combination (the "bonding" state) and 105 meV for the antisymmetric one. That's how a molecule's bond forms, how levels in a superlattice spread into a miniband, and, with N wells instead of two, how bands form in a crystal (lesson 31).
:::
:::

::: nameit
## Hilbert space

Wave functions with $\int\lvert f\rvert^2dx < \infty$ form a vector space with the **inner product** $\langle f|g\rangle = \int f^*g\,dx$. Two facts carry over from A14's inner-product spaces: $\langle g|f\rangle = \langle f|g\rangle^*$, and the Schwarz inequality $\lvert\langle f|g\rangle\rvert^2 \le \langle f|f\rangle\langle g|g\rangle$. A state is a unit vector; its overall phase doesn't matter.

## Observables

An observable Q is represented by an operator $\hat Q$, with $\langle Q\rangle = \langle\Psi|\hat Q\Psi\rangle$. Expectation values of a measurable quantity must be real for every state, which requires

$$\langle f|\hat Qg\rangle = \langle\hat Qf|g\rangle \quad\text{for all } f, g$$

That's a **Hermitian** operator. x is Hermitian; so is $\hat p = -i\hbar\frac{d}{dx}$ (integrate by parts: the minus sign from moving the derivative cancels the one from conjugating i); d/dx alone isn't.

## Hermitian operators in a basis

Pick an orthonormal basis $|e_n\rangle$. Then a state is a column of components $c_n = \langle e_n|\Psi\rangle$ and an operator a matrix $Q_{mn} = \langle e_m|\hat Qe_n\rangle$. Hermitian means $Q_{mn} = Q_{nm}^*$: the matrix equals its conjugate transpose. In two dimensions,

$$\hat Q = \begin{pmatrix}a & b\\ b^* & d\end{pmatrix}, \qquad \lambda_\pm = \frac{a + d}{2} \pm\sqrt{\left(\frac{a - d}{2}\right)^2 + \lvert b\rvert^2}$$

## Why Hermitian matters

- Its eigenvalues are real: they're the possible measurement results.
- Eigenvectors with different eigenvalues are orthogonal.
- Its eigenvectors form a complete basis (in finite dimensions this is the spectral theorem; in Hilbert space it's assumed for every observable).

## Coupled two-level systems

A coupling between two states always pushes their eigenvalues apart, by at least 2|b|: the **avoided crossing**. It appears in coupled wells, in molecules, in coupled resonators (two LC tanks coupled by a capacitor split into two modes) and in qubits.
:::

::: example
## A state is $0.6|1\rangle + 0.8|2\rangle$, and $\hat Q = \begin{pmatrix}1 & 0.5\\ 0.5 & 3\end{pmatrix}$ in that basis. Find ⟨Q⟩ and the possible results of measuring Q.

::: solution
1. **Expectation value.**
   $$\begin{aligned} \langle Q\rangle &= 1(0.36) + 3(0.64) \\ &\quad + 2(0.5)(0.6)(0.8) \\ &= 2.76 \end{aligned}$$
2. **Possible results.** They're the eigenvalues, $2 \pm\sqrt{1 + 0.25}$: 0.882 and 3.118.
3. **Check.** ⟨Q⟩ sits between them, as an average of the two must.

**Answer:** ⟨Q⟩ = 2.76, and a measurement gives either 0.882 or 3.118.
:::
:::

::: example
## A particle in a unit infinite well is in the state $\sqrt3\,x$. What's the probability that measuring the energy gives $E_1$?

::: solution
1. **Overlap with the ground state.**
   $$\begin{aligned} c_1 &= \langle\psi_1|\Psi\rangle \\ &= \int_0^1\sqrt2\sin(\pi x)\sqrt3\,x\,dx \\ &= \frac{\sqrt6}{\pi} \end{aligned}$$
2. **Probability.**
   $$\begin{aligned} \lvert c_1\rvert^2 &= \frac{6}{\pi^2} \\ &= 0.608 \end{aligned}$$
3. **A caution.** This state doesn't vanish at x = 1, so it isn't a smooth state of the well, and its ⟨H⟩ is infinite: the $\lvert c_n\rvert^2 = \frac{6}{n^2\pi^2}$ fall too slowly for $\sum\lvert c_n\rvert^2n^2$ to converge.

**Answer:** the probability of $E_1$ is 0.608.
:::
:::

::: example
## Two quantum wells are detuned: one level sits 10 meV above the other, and they couple with t = 5 meV. What are the new levels, and how much of the lower state sits in the lower well?

::: solution
1. **The Hamiltonian.**
   $$H = \begin{pmatrix} \varepsilon_1 & -t \\ -t & \varepsilon_2 \end{pmatrix}$$
2. **New levels.** Its eigenvalues are centered on the average and split by
   $$\begin{aligned} \sqrt{\delta^2 + 4t^2} &= \sqrt{100 + 100} \\ &= 14.1\ \text{meV} \end{aligned}$$
3. **Share in the lower well.** The lower state puts this fraction of its probability there:
   $$\begin{aligned} &\frac12\left(1 + \frac{\delta}{\sqrt{\delta^2 + 4t^2}}\right) \\ &= 0.854 \end{aligned}$$
4. **The limits.** With no detuning the two wells would share it equally; with detuning much larger than t each state lives almost entirely in one well.
5. **Sweeping the detuning.** Sweeping δ through zero gives the avoided crossing that lesson 42 uses for Landau–Zener transitions.

**Answer:** the new levels sit 14.1 meV apart, centered on the average, and the lower state has 0.854 of its probability in the lower well.
:::
:::

::: check
given: a = 1 | 2; d = 3 | 5; b = 0.5 | 1.5
answer: (a + d)/2 + sqrt(((a - d)/2)^2 + b^2)
tolerance: 0.1%

## What's the larger eigenvalue of $\begin{pmatrix}\given{a} & \given{b}\\ \given{b} & \given{d}\end{pmatrix}$?

::: right
Right. $\frac{a + d}{2} + \sqrt{\left(\frac{a - d}{2}\right)^2 + b^2}$ = {answer}.
:::

::: misses
- [d] That ignores the coupling, which pushes the levels apart.
- [d + b] Not a simple sum: add in quadrature.
- [any] Not yet. Solve $\det(\hat Q - \lambda I) = 0$.
:::
:::

::: check
given: p = 0.36 | 0.5 | 0.8; a = 1 | 2; d = 4 | 6; b = 0.5 | 1
answer: a*p + d*(1 - p) + 2*b*sqrt(p*(1 - p))
tolerance: 0.1%

## A state has components $\sqrt{\given{p}}$ and $\sqrt{1 - \given{p}}$ (both real, positive). What's ⟨Q⟩ for $\hat Q = \begin{pmatrix}\given{a} & \given{b}\\ \given{b} & \given{d}\end{pmatrix}$?

::: right
Right. $a\lvert c_1\rvert^2 + d\lvert c_2\rvert^2 + 2b\,c_1c_2$ = {answer}.
:::

::: misses
- [a*p + d*(1 - p)] Include the off-diagonal terms, $2b\,c_1c_2$.
- [any] Not yet. $\langle Q\rangle = c^\dagger Qc$.
:::
:::

::: check
given: E = 50 | 100 | 150; t = 2 | 5 | 12
answer: E - t
unit: meV
tolerance: 0.1%

## Two identical wells with levels at {E} meV are coupled with t = {t} meV. What's the lower (symmetric) state's energy?

::: right
Right. $E_0 - t$ = {answer} meV.
:::

::: misses
- [E - 2*t] The splitting is 2t in total, t each way.
- [E] Coupling shifts the levels apart.
- [any] Not yet. The eigenvalues of $\begin{pmatrix}E_0 & -t\\ -t & E_0\end{pmatrix}$.
:::
:::

::: check
given: d = 20 | 50 | 100; t = 5 | 15
answer: 2*sqrt(d^2/4 + t^2)
unit: meV
tolerance: 0.1%

## Two coupled wells are detuned by δ = {d} meV, with coupling t = {t} meV. What's the gap between the two eigenstates?

::: right
Right. $2\sqrt{(\delta/2)^2 + t^2}$ = {answer} meV.
:::

::: misses
- [d] That's the uncoupled gap; coupling widens it.
- [d + 2*t] The two effects add in quadrature.
- [any] Not yet. $\lambda_+ - \lambda_-$.
:::
:::

::: check
given: n = 1 | 2 | 3
answer: 6/(n^2*pi^2)
tolerance: 0.1%

## A unit-well particle is in the state $\sqrt3\,x$. What's the probability of measuring $E_{\given{n}}$?

::: right
Right. $\lvert c_n\rvert^2 = \frac{6}{n^2\pi^2}$ = {answer}.
:::

::: misses
- [sqrt(6)/(n*pi)] That's the amplitude $\lvert c_n\rvert$; square it.
- [any] Not yet. $c_n = \int_0^1\sqrt2\sin(n\pi x)\sqrt3\,x\,dx$.
:::
:::

::: check
kind: choice

## Which operator is Hermitian?

- [ ] $\frac{d}{dx}$
- [ ] $\hat x\hat p$
- [x] $\hat x\hat p + \hat p\hat x$
- [ ] $i\hat x$

::: misses
- [1] Integrating by parts gives $\langle f|g'\rangle = -\langle f'|g\rangle$: anti-Hermitian.
- [2] Its adjoint is $\hat p\hat x$, which differs because x and p don't commute.
- [4] Its adjoint is $-i\hat x$: it gives imaginary expectation values.
:::
:::

::: check
kind: parts
given: d = 5 | 10 | 40; t = 2 | 5

## Two coupled levels are detuned by {d} meV and coupled by t = {t} meV.

::: part
answer: sqrt(d^2 + 4*t^2)
unit: meV
tolerance: 0.5%

### How far apart are the new levels?

::: misses
- [d + 2*t] The splitting adds in quadrature: $\sqrt{\delta^2 + 4t^2}$.
- [any] Diagonalize the 2 × 2 matrix.
:::
:::

::: part
answer: (1 + d/sqrt(d^2 + 4*t^2))/2
tolerance: 0.5%

### What fraction of the lower state sits in the lower well?

::: misses
- [any] $\frac12\left(1 + \frac{\delta}{\sqrt{\delta^2 + 4t^2}}\right)$.
:::
:::
:::

::: check
kind: derivation
vars: d = 0..50, t = 0.5..20

## A two-level Hamiltonian with detuning δ (write d) and coupling t.

::: step
answer: sqrt(d^2 + 4*t^2)

### What is the splitting of its eigenvalues?
:::

::: step
answer: (1 + d/sqrt(d^2 + 4*t^2))/2

### What weight does the lower eigenstate put on the lower level?
:::

::: right
Right. At zero detuning the splitting is 2t and the weight is ½: the states are fully mixed.
:::
:::

::: explain
## Why must observables be represented by Hermitian operators?

::: model
Every measurement result is a real number, so the expectation value of an observable must be real in every state. For an operator $\hat Q$, the conjugate of $\langle\Psi|\hat Q\Psi\rangle$ is $\langle\hat Q\Psi|\Psi\rangle$, so a real expectation value for every Ψ means $\hat Q$ can be moved from one side of the inner product to the other: that's the definition of Hermitian. Hermitian operators also have real eigenvalues and orthogonal eigenvectors that form a basis, which is exactly what's needed to say that a measurement gives one of the eigenvalues, with a probability read off from the state's component along each eigenvector.
:::
:::

::: practice

::: check
given: a = 0 | 1.5; d = 2 | 4; b = 0.3 | 1.2
answer: (a + d)/2 - sqrt(((a - d)/2)^2 + b^2)
tolerance: 0.1%

## Smaller eigenvalue of $\begin{pmatrix}\given{a} & \given{b}\\ \given{b} & \given{d}\end{pmatrix}$?

::: misses
- [any] $\frac{a + d}{2} - \sqrt{(\frac{a - d}{2})^2 + b^2}$.
:::
:::

::: check
given: d = 10 | 80; t = 3 | 20
answer: 2*sqrt(d^2/4 + t^2)
unit: meV
tolerance: 0.1%

## Gap of coupled wells, δ = {d} meV, t = {t} meV?

::: misses
- [any] $\sqrt{\delta^2 + 4t^2}$.
:::
:::

::: check
given: n = 1..8 int
answer: 6/(n^2*pi^2)
tolerance: 0.1%

## Probability of $E_{\given{n}}$ for $\sqrt3\,x$ in a unit well?

::: misses
- [any] $\frac{6}{n^2\pi^2}$.
:::
:::
:::
