|q⟩ Bad Qubits

beginner · Physics · Math Foundations: Linear Algebra

The Inner Product

What is an inner product?

The inner product (also called the Hermitian inner product or dot product over the complex numbers) is a way to assign a single complex number to any ordered pair of vectors. For two column vectors u\mathbf{u} and v\mathbf{v} in Cn\mathbb{C}^n it is defined as

u,v=k=1nukvk,\langle \mathbf{u}, \mathbf{v} \rangle = \sum_{k=1}^{n} \overline{u_k}\, v_k,

where uk\overline{u_k} denotes the complex conjugate of uku_k. The first argument is conjugated; the second is not. This asymmetry is deliberate — it is what makes the inner product conjugate-linear in the first argument and linear in the second.

Why physicists use bra-ket notation

Dirac introduced a compact shorthand. A state vector v\mathbf{v} is written as a ket v|v\rangle; its conjugate transpose is the bra v\langle v|. The inner product of u\mathbf{u} with v\mathbf{v} then becomes the bra-ket

uv=uv,\langle u | v \rangle = \mathbf{u}^\dagger \mathbf{v},

where \dagger means conjugate transpose. This notation will appear in every quantum-mechanics context from here on.

Key properties

Four properties follow directly from the definition:

  1. Conjugate symmetry: uv=vu\langle u | v \rangle = \overline{\langle v | u \rangle}.
  2. Linearity in the right argument: uαv+βw=αuv+βuw\langle u | \alpha v + \beta w \rangle = \alpha \langle u | v \rangle + \beta \langle u | w \rangle.
  3. Positive definiteness: vv0\langle v | v \rangle \geq 0, with equality only when v=0|v\rangle = 0.
  4. The norm is real and non-negative: v=vvR0\|v\| = \sqrt{\langle v | v \rangle} \in \mathbb{R}_{\geq 0}.

Property 3 is worth pausing on. Because each term in the sum is vkvk=vk20\overline{v_k} v_k = |v_k|^2 \geq 0, the total vv\langle v | v \rangle is a sum of real non-negative numbers. Without the conjugation on the first argument this would fail for complex vectors.

A worked example

Let u=(1+i,  2)\mathbf{u} = (1+i,\; 2) and v=(3,  1i)\mathbf{v} = (3,\; 1-i) in C2\mathbb{C}^2. Applying the definition:

uv=(1+i)3  +  2(1i).\langle u | v \rangle = \overline{(1+i)} \cdot 3 \;+\; \overline{2} \cdot (1-i).

Conjugating: 1+i=1i\overline{1+i} = 1-i and 2=2\overline{2} = 2. Multiplying out:

(1i)3=33i,2(1i)=22i.(1-i)\cdot 3 = 3 - 3i, \qquad 2 \cdot (1-i) = 2 - 2i.

Adding the two terms gives uv=55i\langle u | v \rangle = 5 - 5i.

The modulus of this result is

uv=52+(5)2=50=527.071.|\langle u | v \rangle| = \sqrt{5^2 + (-5)^2} = \sqrt{50} = 5\sqrt{2} \approx 7.071.

The Cauchy-Schwarz inequality guarantees that uvuv|\langle u | v \rangle| \leq \|u\|\,\|v\|, a bound that will reappear when we discuss measurement probabilities and state overlap.

Connection to quantum mechanics

In quantum mechanics a physical state is represented by a normalised ket ψ|\psi\rangle with ψψ=1\langle \psi | \psi \rangle = 1. If the system is in state ψ|\psi\rangle and we ask how much it "overlaps" with another state ϕ|\phi\rangle, the answer is the inner product ϕψ\langle \phi | \psi \rangle. The Born rule then says that the probability of finding the system in state ϕ|\phi\rangle is ϕψ2|\langle \phi | \psi \rangle|^2. The modulus-squared of an inner product is therefore the fundamental quantity connecting amplitudes to experimental outcomes.

Try it

This is a numerical exercise — your code should return a number, not a circuit. Using the vectors u=(1+i,  2)\mathbf{u} = (1+i,\; 2) and v=(3,  1i)\mathbf{v} = (3,\; 1-i), compute the modulus uv|\langle u | v \rangle|.

Run your code to see the quantum state.

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