07 — Why Quantum Gates Must Be Reversible
One test decides everything: do the outputs overlap?
The Hierarchy

A gate maps \(|0\rangle\) to some output and \(|1\rangle\) to some output. Whether it's a valid quantum gate comes down to one number: the inner product of those outputs.

The Chain: Cause → Effect
  1. Cause: \(\langle\text{out}_0|\text{out}_1\rangle \neq 0\) — outputs overlap
  2. Mechanism: overlapping outputs cause amplitudes to pile up on superpositions
  3. Effect: Norm² > 1 — probabilities exceed 100%

The braket is the test. The norm blowup is just the symptom.

Why One Number Decides Everything

Apply any gate to \(|+\rangle = \frac{1}{\sqrt{2}}|0\rangle + \frac{1}{\sqrt{2}}|1\rangle\). The output is:

$$|\psi'\rangle = \tfrac{1}{\sqrt{2}}|\text{out}_0\rangle + \tfrac{1}{\sqrt{2}}|\text{out}_1\rangle$$

Compute the norm² by expanding \(\langle\psi'|\psi'\rangle\):

$$\langle\psi'|\psi'\rangle = \tfrac{1}{2}\langle\text{out}_0|\text{out}_0\rangle + \tfrac{1}{2}\langle\text{out}_0|\text{out}_1\rangle + \tfrac{1}{2}\langle\text{out}_1|\text{out}_0\rangle + \tfrac{1}{2}\langle\text{out}_1|\text{out}_1\rangle$$

Each output is individually normalized (\(\langle\text{out}|\text{out}\rangle = 1\)), so the first and last terms give \(\frac{1}{2} + \frac{1}{2} = 1\). What's left:

$$= 1 + \tfrac{1}{2}\big(\langle\text{out}_0|\text{out}_1\rangle + \langle\text{out}_1|\text{out}_0\rangle\big) = 1 + \text{Re}\big(\langle\text{out}_0|\text{out}_1\rangle\big)$$

(Since \(\langle\text{out}_1|\text{out}_0\rangle = \langle\text{out}_0|\text{out}_1\rangle^*\), their sum is twice the real part.)

The Formula

$$\text{Norm}^2 = 1 + \text{Re}\big(\langle\text{out}_0|\text{out}_1\rangle\big)$$

  • \(\langle\text{out}_0|\text{out}_1\rangle = 0\) → Norm² = 1 → valid
  • \(\langle\text{out}_0|\text{out}_1\rangle = 1\) → Norm² = 2 → 200% probability
  • \(\langle\text{out}_0|\text{out}_1\rangle = \frac{1}{\sqrt{2}}\) → Norm² ≈ 1.71 → 171% probability

The braket is the leak. It directly predicts how much the norm overshoots.

Broken Gates — braket ≠ 0, norm destroyed
SET Gate
|0⟩ → |1⟩
|1⟩ → |1⟩
Cause: the braket
⟨out₀|out₁⟩ = ⟨1|1⟩ = 1
Identical outputs — maximum overlap.
Effect: norm on |+⟩
→ 1/√2 |1⟩ + 1/√2 |1⟩ = √2 |1⟩
Norm² = 1 + 1 = 2.0
200% — INVALID
ZERO Gate
|0⟩ → |0⟩
|1⟩ → |0⟩
Cause: the braket
⟨out₀|out₁⟩ = ⟨0|0⟩ = 1
Identical outputs again.
Effect: norm on |+⟩
→ 1/√2 |0⟩ + 1/√2 |0⟩ = √2 |0⟩
Norm² = 1 + 1 = 2.0
200% — INVALID
Sneaky Gate
|0⟩ → |0⟩
|1⟩ → |+⟩
Cause: the braket
⟨out₀|out₁⟩ = ⟨0|+⟩
= ⟨0| · (1/√2|0⟩ + 1/√2|1⟩)
= 1/√2 · ⟨0|0⟩ + 1/√2 · ⟨0|1⟩
= 1/√2 · 1 + 1/√2 · 0 = 1/√2 ≈ 0.71
Partial overlap — not identical, but not orthogonal either.
Effect: norm on |+⟩
→ 1/√2 |0⟩ + 1/√2 (1/√2|0⟩ + 1/√2|1⟩)
= (1/√2 + ½)|0⟩ + ½|1⟩
Norm² = 1 + 0.71 = 1.71
171% — INVALID
Working Gates — braket = 0, norm preserved
X Gate (bit flip)
|0⟩ → |1⟩
|1⟩ → |0⟩
Cause: the braket
⟨out₀|out₁⟩ = ⟨1|0⟩ = 0
Opposite basis states — zero overlap.
Effect: norm on |+⟩
→ 1/√2 |1⟩ + 1/√2 |0⟩ = |+⟩
Norm² = 1 + 0 = 1.0
100% ✓
Z Gate (phase flip)
|0⟩ → |0⟩
|1⟩ → −|1⟩
Cause: the braket
⟨out₀|out₁⟩ = ⟨0|(−|1⟩)⟩
= −⟨0|1⟩ = −0 = 0
Phase flip doesn't change overlap — still orthogonal.
Effect: norm on |+⟩
→ 1/√2 |0⟩ − 1/√2 |1⟩ = |−⟩
Norm² = 1 + 0 = 1.0
100% ✓
H Gate (Hadamard)
|0⟩ → |+⟩ = 1/√2(|0⟩+|1⟩)
|1⟩ → |−⟩ = 1/√2(|0⟩−|1⟩)
Cause: the braket
⟨out₀|out₁⟩ = ⟨+|−⟩
= ½⟨0|0⟩ − ½⟨0|1⟩ + ½⟨1|0⟩ − ½⟨1|1⟩
= ½(1) − ½(0) + ½(0) − ½(1) = 0
Outputs are superpositions, but perfectly orthogonal ones.
Effect: norm on |+⟩
→ ½(|0⟩+|1⟩) + ½(|0⟩−|1⟩) = |0⟩
Norm² = 1 + 0 = 1.0
100% ✓
The Formal Name
Unitary = Orthonormal Outputs

A quantum gate is valid if and only if it maps basis states to orthonormal outputs. "Orthonormal" packs both requirements into one word:

  • Orthogonal — \(\langle\text{out}_0|\text{out}_1\rangle = 0\) — no overlap, no amplitude pileup
  • Normalized — \(\langle\text{out}_i|\text{out}_i\rangle = 1\) — each output is a valid state on its own

A matrix whose columns are orthonormal vectors is called a unitary matrix. That's why quantum gates = unitary matrices.

Next: The Dagger & U†U = I

Summary Table
Gate \(|0\rangle \to\) \(|1\rangle \to\) \(\langle\text{out}_0|\text{out}_1\rangle\)
(cause)
Norm² = 1 + braket
(effect)
Valid?
SET \(|1\rangle\) \(|1\rangle\) 1 2.0 NO
ZERO \(|0\rangle\) \(|0\rangle\) 1 2.0 NO
SNEAKY \(|0\rangle\) \(|+\rangle\) 0.71 1.71 NO
X \(|1\rangle\) \(|0\rangle\) 0 1.0 YES
Z \(|0\rangle\) \(-|1\rangle\) 0 1.0 YES
H \(|+\rangle\) \(|-\rangle\) 0 1.0 YES
Interactive — Watch Amplitudes Pile Up

Choose a gate and see what happens to \(|+\rangle = \frac{1}{\sqrt{2}}|0\rangle + \frac{1}{\sqrt{2}}|1\rangle\)

Before (input \(|+\rangle\))
After (output)