|q⟩ Bad Qubits

intermediate · Physics · Hilbert Spaces & Dirac Formalism

Inner Product Spaces

A bare complex vector space tells you how to add vectors and scale them, but it gives you no notion of length or angle. To measure overlap between quantum states — and ultimately to compute probabilities — we equip the space with an inner product.

The inner-product axioms

An inner product on a complex vector space VV is a map that takes two vectors ∣u⟩,∣v⟩|u\rangle, |v\rangle to a complex number ⟨u∣v⟩\langle u | v \rangle, subject to three axioms. We use the physics convention, which is conjugate-linear in the first slot and linear in the second.

1. Conjugate symmetry.

⟨u∣v⟩=⟨v∣u⟩‾.\langle u | v \rangle = \overline{\langle v | u \rangle}.

Swapping the arguments conjugates the result. A consequence is that ⟨v∣v⟩\langle v | v \rangle equals its own conjugate, so it is always real.

2. Linearity in the second argument.

⟨u ∣ αv+βw⟩=α⟨u∣v⟩+β⟨u∣w⟩,α,β∈C.\langle u \,|\, \alpha v + \beta w \rangle = \alpha \langle u | v \rangle + \beta \langle u | w \rangle, \qquad \alpha, \beta \in \mathbb{C}.

Combined with conjugate symmetry, this forces conjugate-linearity in the first argument: ⟨αu+βw ∣ v⟩=α‾⟨u∣v⟩+β‾⟨w∣v⟩\langle \alpha u + \beta w \,|\, v \rangle = \overline{\alpha}\langle u | v \rangle + \overline{\beta}\langle w | v \rangle.

3. Positive-definiteness.

⟨v∣v⟩≥0,with ⟨v∣v⟩=0  ⟺  ∣v⟩=∣0⟩.\langle v | v \rangle \ge 0, \qquad \text{with } \langle v | v \rangle = 0 \iff |v\rangle = |0\rangle.

This is the axiom that makes "length" meaningful, and it is the reason the first slot is conjugated: in Cn\mathbb{C}^n we get ⟨v∣v⟩=∑kvk‾vk=∑k∣vk∣2≥0\langle v | v \rangle = \sum_k \overline{v_k} v_k = \sum_k |v_k|^2 \ge 0.

The induced norm

From the inner product we define the norm (length) of a vector by

∥v∥=⟨v∣v⟩.\| v \| = \sqrt{\langle v | v \rangle}.

Positive-definiteness guarantees the quantity under the root is real and non-negative, so the norm is a well-defined real number. A vector with ∥v∥=1\|v\| = 1 is normalized — exactly the condition we impose on physical quantum states so that the Born-rule probabilities sum to 1.

The Cauchy–Schwarz inequality

Every inner product satisfies the fundamental bound

∣⟨u∣v⟩∣≤∥u∥ ∥v∥,|\langle u | v \rangle| \le \|u\|\,\|v\|,

with equality if and only if ∣u⟩|u\rangle and ∣v⟩|v\rangle are linearly dependent (parallel). This single inequality underlies the triangle inequality ∥u+v∥≤∥u∥+∥v∥\|u + v\| \le \|u\| + \|v\|, the definition of the angle between vectors, and the bound ∣⟨ϕ∣ψ⟩∣2≤1|\langle \phi | \psi \rangle|^2 \le 1 for normalized states that caps transition probabilities at 1.

A worked example

Let ∣v⟩=(2+i,  1−2i)|v\rangle = (2 + i,\; 1 - 2i) in C2\mathbb{C}^2. Its squared norm is

⟨v∣v⟩=(2+i)‾(2+i)+(1−2i)‾(1−2i)=∣2+i∣2+∣1−2i∣2.\langle v | v \rangle = \overline{(2+i)}(2+i) + \overline{(1-2i)}(1-2i) = |2+i|^2 + |1-2i|^2.

Computing each modulus-squared: ∣2+i∣2=22+12=5|2+i|^2 = 2^2 + 1^2 = 5 and ∣1−2i∣2=12+(−2)2=5|1-2i|^2 = 1^2 + (-2)^2 = 5. Therefore

⟨v∣v⟩=5+5=10,∥v∥=10.\langle v | v \rangle = 5 + 5 = 10, \qquad \|v\| = \sqrt{10}.

Note the result is real and positive, as positive-definiteness demands.

Try it

This is a numerical exercise — your code should return a number, not a circuit. For ∣v⟩=(2+i,  1−2i)|v\rangle = (2+i,\; 1-2i), compute the squared norm ⟨v∣v⟩\langle v | v \rangle.

Run your code to see the quantum state.

Sign in on the full site to ask questions and join the discussion.