|q⟩ Bad Qubits

beginner · Programming · The Qubit State Vector & Dirac Notation

Orthonormal Bases

A basis for a vector space is a set of vectors from which every other vector in that space can be built as a linear combination. The computational basis {0,1}\{|0\rangle, |1\rangle\} is the default basis for a single qubit — but it carries an additional structure that makes quantum mechanics work out cleanly: it is orthonormal.

What orthonormality means

A set of vectors is orthonormal when two conditions hold simultaneously:

  1. Normalization — every vector has unit length. For a ket, this means ψψ=1\langle\psi|\psi\rangle = 1.
  2. Orthogonality — distinct vectors in the set are perpendicular. For two different kets φ|\varphi\rangle and ψ|\psi\rangle, this means φψ=0\langle\varphi|\psi\rangle = 0.

Written compactly using the Kronecker delta δij\delta_{ij} (which equals 1 when i=ji = j and 0 otherwise), the orthonormality condition for any basis {ei}\{|e_i\rangle\} is

eiej=δij.\langle e_i | e_j \rangle = \delta_{ij}.

Verifying {0,1}\{|0\rangle, |1\rangle\}

The column-vector representations are

0=(10),1=(01).|0\rangle = \begin{pmatrix} 1 \\ 0 \end{pmatrix}, \qquad |1\rangle = \begin{pmatrix} 0 \\ 1 \end{pmatrix}.

For real column vectors the inner product is just the dot product, so the four cases are:

00=11+00=1,11=00+11=1,\langle 0|0\rangle = 1{\cdot}1 + 0{\cdot}0 = 1, \qquad \langle 1|1\rangle = 0{\cdot}0 + 1{\cdot}1 = 1, 01=10+01=0,10=01+10=0.\langle 0|1\rangle = 1{\cdot}0 + 0{\cdot}1 = 0, \qquad \langle 1|0\rangle = 0{\cdot}1 + 1{\cdot}0 = 0.

All four results match the Kronecker-delta table: the diagonal entries are 1 and the off-diagonal entries are 0. The computational basis is therefore orthonormal.

Why it matters

Orthonormality is not a cosmetic detail — it is what lets the Born rule work. Because 01=0\langle 0|1\rangle = 0, the two measurement outcomes are mutually exclusive: a measurement collapses the state to exactly one of them. Because 00=11=1\langle 0|0\rangle = \langle 1|1\rangle = 1, the probabilities 0ψ2+1ψ2=1|\langle 0|\psi\rangle|^2 + |\langle 1|\psi\rangle|^2 = 1 always sum to one for any normalized ψ|\psi\rangle. An orthonormal basis turns the abstract formalism into a consistent probability theory.

Try it

Compute all four inner products 00\langle 0|0\rangle, 01\langle 0|1\rangle, 10\langle 1|0\rangle, 11\langle 1|1\rangle and return their sum. The orthonormality conditions determine exactly what number you should get.

Run your code to see the quantum state.

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