
# Special Operators: Hermitian, Unitary, Projection, Positive

> Four families of operators carry all of quantum mechanics. **Hermitian** operators are
> observables (and Hamiltonians). **Unitary** operators are the reversible evolutions and quantum
> gates. **Projection** operators are measurements. **Positive** operators are density matrices and
> POVM elements. Each is a special case of "normal," so the spectral theorem from
> [0.1.5](05-eigen-spectral-theorem.md) describes them all — we just read off which eigenvalues each
> allows.

## Learning Objectives

After this lesson you will be able to:

1. Characterize **Hermitian** operators (real spectrum) and connect them to observables.
2. Prove that **unitary** operators preserve inner products and have unit-modulus eigenvalues.
3. Manipulate **orthogonal projection** operators and use them for measurement.
4. Define **positive (semidefinite)** operators and recognize density matrices.
5. Build **functions of operators**, especially $e^{-iHt}$, linking Hermitian generators to unitary gates.

---

## Intuition

Diagonalize a normal operator (spectral theorem): it's "multiply each eigen-direction by its
eigenvalue $\lambda_k$." The *type* of operator is then dictated entirely by **where the eigenvalues
live**:

| Operator | Constraint | Eigenvalues live on… | Role in QM |
|---|---|---|---|
| Hermitian | $A^\dagger = A$ | the real line $\mathbb{R}$ | observables, Hamiltonians |
| Unitary | $U^\dagger U = I$ | the unit circle $\{e^{i\theta}\}$ | gates, time evolution |
| Projection | $P^2 = P = P^\dagger$ | $\{0,1\}$ | measurement onto a subspace |
| Positive | $A^\dagger=A,\ \langle\psi|A|\psi\rangle\ge0$ | $[0,\infty)$ | density matrices, POVM elements |

Everything below is making this table precise.

---

## Theory

### Hermitian operators

$A$ is **Hermitian (self-adjoint)** if $A^\dagger = A$. By the spectral theorem (Hermitian ⇒ normal)
it has an orthonormal eigenbasis, and (proved in [0.1.5 E3](05-eigen-spectral-theorem.md)) **its
eigenvalues are real**. Conversely, a normal operator with real spectrum is Hermitian. So:

$$
A = A^\dagger \iff A = \sum_k \lambda_k|v_k\rangle\langle v_k| \text{ with } \lambda_k\in\mathbb{R}.
$$

This is the **measurement postulate's** backbone (Term 1.3): an observable is a Hermitian operator,
its eigenvalues are the possible measured values, and its eigenvectors are the states of definite
value. The expectation value $\langle A\rangle = \langle\psi|A|\psi\rangle = \sum_k \lambda_k
|\langle v_k|\psi\rangle|^2$ is a real, probability-weighted average of eigenvalues.

### Unitary operators

$U$ is **unitary** if $U^\dagger U = U U^\dagger = I$, i.e. $U^{-1} = U^\dagger$.

> **Theorem.** The following are equivalent: (i) $U$ is unitary; (ii) $U$ preserves inner products,
> $\langle U\phi|U\psi\rangle = \langle\phi|\psi\rangle$; (iii) $U$ maps an ONB to an ONB; (iv) $U$ is
> normal with all eigenvalues of modulus $1$.

**Proof of (i)⇔(ii).** $\langle U\phi|U\psi\rangle = \langle\phi|U^\dagger U|\psi\rangle$, which equals
$\langle\phi|\psi\rangle$ for all $\phi,\psi$ iff $U^\dagger U = I$. **(iv):** $U$ normal gives an
orthonormal eigenbasis with $U|v_k\rangle = \mu_k|v_k\rangle$; then $\langle v_k|U^\dagger U|v_k\rangle =
|\mu_k|^2 = 1$, so $\mu_k = e^{i\theta_k}$. ∎

Preserving inner products means **preserving probabilities and normalization** — which is precisely
why closed-system quantum evolution and every quantum gate must be unitary. Spectral form:

$$
U = \sum_k e^{i\theta_k}\,|v_k\rangle\langle v_k|, \qquad \theta_k\in\mathbb{R}.
$$

### Projection operators

$P$ is an **orthogonal projector** if $P^2 = P$ (idempotent) and $P^\dagger = P$ (Hermitian). Its
eigenvalues are $0$ or $1$ ([0.1.5 E2](05-eigen-spectral-theorem.md)); it projects onto the subspace
$\mathcal{S} = \operatorname{range}(P)$ along $\mathcal{S}^\perp$. For an orthonormal set
$\{|u_j\rangle\}$ spanning $\mathcal{S}$,

$$
P = \sum_j |u_j\rangle\langle u_j|, \qquad I - P = \text{projector onto } \mathcal{S}^\perp .
$$

A rank-1 projector $|\psi\rangle\langle\psi|$ (with $\|\psi\|=1$) projects onto the line through
$|\psi\rangle$. Projectors implement **projective measurement** (Term 1.3): the spectral projectors
$\{P_k\}$ of an observable give outcome $k$ with probability $\langle\psi|P_k|\psi\rangle$.

### Positive (semidefinite) operators

$A$ is **positive semidefinite** ($A \succeq 0$) if it is Hermitian and $\langle\psi|A|\psi\rangle\ge 0$
for all $|\psi\rangle$; equivalently, all eigenvalues are $\ge 0$. It is **positive definite**
($A\succ 0$) if strictly $>0$. Facts: any $A = B^\dagger B$ is positive; a positive operator has a
unique positive **square root** $\sqrt{A}$ (take $\sqrt{\lambda_k}$ in the spectral form). A **density
matrix** $\rho$ is exactly a positive operator with $\operatorname{Tr}(\rho)=1$ (Term 1.5), and POVM
elements are positive operators summing to $I$ (Term 1.3).

### Functions of operators and the exponential map

For normal $A = \sum_k\lambda_k P_k$ and any $f:\mathbb{C}\to\mathbb{C}$, define $f(A) = \sum_k
f(\lambda_k)P_k$ (consistent with power series where they converge). The case that powers the whole
field:

> **Hermitian generates unitary.** If $H = H^\dagger$ (Hermitian), then for real $t$,
> $$ U(t) = e^{-iHt} = \sum_k e^{-i\lambda_k t}\,|v_k\rangle\langle v_k| $$
> is **unitary**, because each eigenvalue $e^{-i\lambda_k t}$ has modulus $1$.

**Proof of unitarity.** $U^\dagger = \sum_k e^{+i\lambda_k t}|v_k\rangle\langle v_k|$ (real $\lambda_k$),
and $U^\dagger U = \sum_k e^{-i\lambda_k t}e^{+i\lambda_k t}|v_k\rangle\langle v_k| = \sum_k P_k = I$. ∎

This is the bridge from physics (Hamiltonians) to computation (gates): every gate $U = e^{-iHt}$ for
some Hermitian $H$ and "time" $t$. We use it constantly from Term 1.6 onward, and computationally it's
`scipy.linalg.expm(-1j*H*t)` (Appendix B). Conversely, by **Stone's theorem / the matrix log**, every
unitary is $e^{-iH}$ for some Hermitian $H$.

> **Caution.** $e^{A}e^{B} = e^{A+B}$ **only if** $[A,B]=0$. In general use Baker–Campbell–Hausdorff
> ([Appendix E](../../appendix/E-math-identities.md)); the failure of this identity is exactly why
> Trotterization is needed for Hamiltonian simulation (Term 3.4).

### Polar and singular-value decompositions (brief)

Every operator factors as $A = U|A|$ with $|A| = \sqrt{A^\dagger A}\succeq 0$ and $U$ unitary (**polar
decomposition**), and as $A = U\Sigma V^\dagger$ with $\Sigma\succeq0$ diagonal (**SVD**). We will need
the SVD for the **Schmidt decomposition** of entangled states (Term 1.4) and operator norms; flagged
here, developed when needed.

---

## Worked Examples

### Example 1 — $Z$ is Hermitian and unitary; build $R_z(\theta) = e^{-i\theta Z/2}$

$Z = \operatorname{diag}(1,-1)$ has real eigenvalues $\pm1$ (Hermitian) and $Z^\dagger Z = I$ (unitary)
— an involution, as in [0.1.4](04-linear-operators-matrices.md). Using the spectral form $Z =
(+1)|0\rangle\langle0| + (-1)|1\rangle\langle1|$:

$$
e^{-i\theta Z/2} = e^{-i\theta/2}|0\rangle\langle0| + e^{+i\theta/2}|1\rangle\langle1|
= \begin{pmatrix} e^{-i\theta/2} & 0 \\ 0 & e^{i\theta/2}\end{pmatrix} = R_z(\theta),
$$

the $z$-rotation gate ([Appendix E](../../appendix/E-math-identities.md)). The Hermitian $Z$
*generates* the unitary $R_z$ — a concrete instance of the bridge.

### Example 2 — A rank-1 projector and an expectation value

For $|\psi\rangle = \tfrac1{\sqrt2}(|0\rangle+|1\rangle) = |+\rangle$, the projector onto $|0\rangle$ is
$P_0 = |0\rangle\langle0| = \operatorname{diag}(1,0)$. Probability of outcome "0" measuring in the
computational basis:

$$
\langle\psi|P_0|\psi\rangle = \tfrac12\langle 0+1|\,|0\rangle\langle0|\,|0+1\rangle = \tfrac12\cdot 1 = \tfrac12 .
$$

And $\langle Z\rangle = \langle+|Z|+\rangle = \tfrac12(1 - 1) = 0$: the $\pm1$ outcomes are equally
likely, averaging to $0$. Consistent with the Bloch picture of $|+\rangle$ lying on the equator
(Term 1.2).

---

## Hands-on (Python)

```python
import numpy as np
from scipy.linalg import expm

def dag(A): return A.conj().T

Z = np.array([[1, 0], [0, -1]], dtype=complex)

def is_hermitian(A): return np.allclose(A, dag(A))
def is_unitary(A):   return np.allclose(dag(A) @ A, np.eye(A.shape[0]))
def is_projector(A): return is_hermitian(A) and np.allclose(A @ A, A)
def is_positive(A, tol=1e-12):
    w = np.linalg.eigvalsh((A + dag(A)) / 2)   # symmetrize for numerical safety
    return np.all(w >= -tol)

print(is_hermitian(Z), is_unitary(Z))          # True True (involution)

# Hermitian generates unitary: R_z(θ) = exp(-i θ Z / 2)
theta = 0.9
Rz = expm(-1j * theta * Z / 2)
print(is_unitary(Rz))                           # True
print(np.round(Rz, 3))                          # diag(e^{-iθ/2}, e^{+iθ/2})
```

```python
# Projector onto |0> and a Born probability for |+>:
ket0 = np.array([1, 0], dtype=complex)
plus = np.array([1, 1], dtype=complex) / np.sqrt(2)
P0 = np.outer(ket0, ket0.conj())
print(is_projector(P0))                          # True
print(np.real(plus.conj() @ P0 @ plus))          # 0.5  = Born prob of outcome "0"

# A density matrix is positive with trace 1:
rho = 0.5 * np.eye(2)                             # maximally mixed qubit
print(is_positive(rho), np.isclose(np.trace(rho), 1))   # True True

# Square root of a positive operator:
A = np.array([[2, 0], [0, 9]], dtype=complex)
sqrtA = expm(0.5 * np.log(2) * np.array([[1,0],[0,0]])  # illustrative; in practice:
             )  # prefer scipy.linalg.sqrtm
from scipy.linalg import sqrtm
print(np.round(sqrtm(A).real, 3))                # diag(√2, 3)
```

---

## Exercises

**E1 (easy).** Show that $Y = \begin{psmallmatrix}0&-i\\ i&0\end{psmallmatrix}$ is Hermitian and unitary,
and find its eigenvalues.

<details><summary>Solution</summary>

$Y^\dagger = \overline{Y}^T = \begin{psmallmatrix}0&-i\\ i&0\end{psmallmatrix} = Y$ (Hermitian).
$Y^2 = I$ so $Y^\dagger Y = I$ (unitary). $\det(Y-\lambda I) = \lambda^2 - 1 = 0 \Rightarrow \lambda = \pm1$.
</details>

**E2 (easy).** Prove that the product of two unitaries is unitary.

<details><summary>Solution</summary>

$(UV)^\dagger(UV) = V^\dagger U^\dagger U V = V^\dagger I V = V^\dagger V = I$. ∎ (Hence circuits, which
compose gates, are unitary.)
</details>

**E3 (medium).** Let $H$ be Hermitian. Prove $U = e^{iH}$ is unitary directly from $U^\dagger =
e^{-iH^\dagger} = e^{-iH}$, and explain where Hermiticity is used.

<details><summary>Solution</summary>

Since $H = H^\dagger$, $U^\dagger = (e^{iH})^\dagger = e^{(iH)^\dagger} = e^{-iH^\dagger} = e^{-iH}$.
Because $iH$ and $-iH$ commute, $U^\dagger U = e^{-iH}e^{iH} = e^{0} = I$. Hermiticity is what makes the
exponent of $U^\dagger$ the negative of that of $U$ (so they cancel); for non-Hermitian $H$ this fails. ∎
</details>

**E4 (medium).** Show that if $P$ is a projector then $I-P$ is a projector, and $P(I-P) = 0$. Interpret
for measurement.

<details><summary>Solution</summary>

$(I-P)^\dagger = I - P$ and $(I-P)^2 = I - 2P + P^2 = I - 2P + P = I - P$, a projector. $P(I-P) = P - P^2
= P - P = 0$. Interpretation: $\{P, I-P\}$ are complementary outcomes of a yes/no measurement; their
probabilities $\langle\psi|P|\psi\rangle + \langle\psi|(I-P)|\psi\rangle = 1$, and a definite outcome
lands entirely in one subspace.
</details>

**E5 (hard).** Prove that any positive operator $A\succeq 0$ has a **unique** positive square root,
and that $A = B^\dagger B$ for some $B$.

<details><summary>Solution</summary>

Spectrally $A = \sum_k\lambda_k|v_k\rangle\langle v_k|$ with $\lambda_k\ge0$. Define $\sqrt A =
\sum_k\sqrt{\lambda_k}|v_k\rangle\langle v_k|\succeq0$; then $(\sqrt A)^2 = A$. Uniqueness among positive
roots: any positive $R$ with $R^2 = A$ commutes with $A$ (since $RA = R^3 = AR$), hence shares $A$'s
eigenbasis, and on each eigenvector must multiply by the nonnegative root $\sqrt{\lambda_k}$ — so
$R = \sqrt A$. Finally $A = (\sqrt A)^\dagger(\sqrt A) = B^\dagger B$ with $B = \sqrt A$. ∎
</details>

---

## Checkpoint

1. Where do the eigenvalues of Hermitian, unitary, projection, and positive operators live?
2. Prove unitaries preserve inner products and state why that matters physically.
3. Give the spectral form of an orthogonal projector and its eigenvalues.
4. State the Hermitian-generates-unitary theorem and why it bridges physics and computation.
5. When does $e^A e^B = e^{A+B}$, and what's the consequence when it fails?

<details><summary>Answers</summary>

1. Hermitian → $\mathbb{R}$; unitary → unit circle $e^{i\theta}$; projector → $\{0,1\}$; positive →
   $[0,\infty)$.
2. $\langle U\phi|U\psi\rangle = \langle\phi|U^\dagger U|\psi\rangle = \langle\phi|\psi\rangle$ iff
   $U^\dagger U=I$; preserving overlaps preserves probabilities/normalization, required of valid
   evolutions and gates.
3. $P = \sum_j|u_j\rangle\langle u_j|$ over an ONB of the target subspace; eigenvalues $0$ and $1$.
4. For Hermitian $H$, $e^{-iHt}$ is unitary; thus every observable/energy generates a valid gate, and
   every gate is $e^{-iH}$ for some Hermitian $H$.
5. Only when $[A,B]=0$; otherwise BCH adds commutator corrections, and Hamiltonian simulation must
   Trotterize (Term 3.4).

</details>

---

## Further Reading

- **[NC]** Nielsen & Chuang, §2.1.6–2.1.8 — Hermitian/unitary/positive operators, functions of operators,
  polar/singular decompositions.
- **[Axl]** Axler, *Linear Algebra Done Right*, Ch. 7 — self-adjoint, normal, positive operators, isometries.
- **[Pre]** Preskill, *Ph219*, Ch. 2–3 — operators and their physical roles.

---

← Prev: [Eigenvalues & the Spectral Theorem](05-eigen-spectral-theorem.md) · Up: [Term 0](../README.md) · Next: [Tensor Products](07-tensor-products.md) →
