|q⟩ Bad Qubits

beginner · Physics · Math Foundations: Linear Algebra

Orthogonality

Two vectors are orthogonal when they point in completely independent directions — knowing the component of a vector along one direction tells you nothing about its component along the other. This idea, simple in geometry, is fundamental in quantum mechanics: quantum states that are orthogonal are perfectly distinguishable by an ideal measurement.

The inner product

Given two column vectors in Rn\mathbb{R}^n,

u=(u1u2un),v=(v1v2vn),\mathbf{u} = \begin{pmatrix} u_1 \\ u_2 \\ \vdots \\ u_n \end{pmatrix}, \qquad \mathbf{v} = \begin{pmatrix} v_1 \\ v_2 \\ \vdots \\ v_n \end{pmatrix},

their inner product (real dot product) is

uv=k=1nukvk.\mathbf{u} \cdot \mathbf{v} = \sum_{k=1}^{n} u_k v_k.

The test for orthogonality is then simply:

uv    uv=0.\mathbf{u} \perp \mathbf{v} \iff \mathbf{u} \cdot \mathbf{v} = 0.

Geometric meaning

The inner product is related to the angle θ\theta between the vectors by uv=uvcosθ\mathbf{u} \cdot \mathbf{v} = |\mathbf{u}||\mathbf{v}|\cos\theta. Setting this to zero gives cosθ=0\cos\theta = 0, so θ=90°\theta = 90°. Orthogonal vectors are perpendicular.

A concrete example

Take u=(3,4)\mathbf{u} = (3, 4) and v=(4,3)\mathbf{v} = (4, -3).

uv=34+4(3)=1212=0.\mathbf{u} \cdot \mathbf{v} = 3 \cdot 4 + 4 \cdot (-3) = 12 - 12 = 0.

Because the inner product is zero, u\mathbf{u} and v\mathbf{v} are orthogonal. You can also verify this geometrically: u\mathbf{u} lies in the first quadrant pointing roughly "up-right", while v\mathbf{v} points roughly "right-down", and they meet at a right angle.

Why it matters in quantum mechanics

In Dirac notation a quantum state is written as a ket ψ|{\psi}\rangle. Two states ψ|{\psi}\rangle and ϕ|{\phi}\rangle are orthogonal when ϕψ=0\langle\phi|\psi\rangle = 0, where ϕ\langle\phi| is the corresponding bra (the conjugate transpose). The standard basis states 0|{0}\rangle and 1|{1}\rangle satisfy 01=0\langle 0 | 1 \rangle = 0: measuring a qubit prepared in 0|{0}\rangle will never return the outcome associated with 1|{1}\rangle, and vice versa. That perfect distinguishability rests entirely on orthogonality.

Try it

This is a numerical exercise — your code should return a number. Given the vectors u=(3,4)\mathbf{u} = (3, 4) and v=(4,3)\mathbf{v} = (4, -3), compute their dot product and return 1 if they are orthogonal, or 0 if they are not.

Run your code to see the quantum state.

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