|q⟩ Bad Qubits

beginner · Programming · The Qubit State Vector & Dirac Notation

Dirac Notation Cheatsheet

Paul Dirac introduced a compact shorthand for quantum states and their relationships. Once you internalize it, manipulating quantum mechanics becomes as fluent as algebra. This lesson collects the four core constructs in one place.

Kets — column vectors representing states

A ket ψ|\psi\rangle represents a quantum state as a column vector. The two computational basis kets for a single qubit are

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

A general single-qubit state is a superposition

ψ=α0+β1=(αβ),|\psi\rangle = \alpha\,|0\rangle + \beta\,|1\rangle = \begin{pmatrix} \alpha \\ \beta \end{pmatrix},

where α,βC\alpha, \beta \in \mathbb{C} and the normalization condition α2+β2=1|\alpha|^2 + |\beta|^2 = 1 ensures that the Born-rule probabilities sum to one.

Bras — row vectors and dual space

Every ket ψ|\psi\rangle has a bra partner ψ\langle\psi|, which is its conjugate transpose (a row vector):

ψ=(α,  β).\langle\psi| = \big(\alpha^*,\; \beta^*\big).

The name "bra" and "ket" together form a "bracket" — a pun that hints at the inner product below.

Inner product — overlap and probability

The inner product ϕψ\langle\phi|\psi\rangle multiplies the bra of ϕ|\phi\rangle by the ket of ψ|\psi\rangle:

ϕψ=ϕ0ψ0+ϕ1ψ1.\langle\phi|\psi\rangle = \phi_0^*\,\psi_0 + \phi_1^*\,\psi_1.

Two key consequences follow immediately. First, basis states are orthonormal:

00=1,11=1,01=0.\langle 0|0\rangle = 1, \quad \langle 1|1\rangle = 1, \quad \langle 0|1\rangle = 0.

Second, the Born rule is just an inner product squared: the probability of measuring outcome b|b\rangle in state ψ|\psi\rangle is bψ2|\langle b|\psi\rangle|^2.

Outer product — operators from state pairs

The outer product ψϕ|\psi\rangle\langle\phi| multiplies the ket of ψ|\psi\rangle by the bra of ϕ|\phi\rangle and produces a matrix (an operator), not a scalar. For example,

00=(10)(10)=(1000).|0\rangle\langle 0| = \begin{pmatrix} 1 \\ 0 \end{pmatrix}\begin{pmatrix} 1 & 0 \end{pmatrix} = \begin{pmatrix} 1 & 0 \\ 0 & 0 \end{pmatrix}.

The projector 00|0\rangle\langle 0| projects any state onto 0|0\rangle, extracting the α\alpha component. More generally, any linear operator on an nn-dimensional space can be written as a linear combination of at most n2n^2 such rank-1 terms, because the space of n×nn\times n matrices has dimension n2n^2. A special case is the spectral decomposition: a normal operator (e.g.\ a Hermitian observable) can be diagonalized as A=iλieieiA = \sum_i \lambda_i |e_i\rangle\langle e_i| using only nn projectors weighted by eigenvalues λi\lambda_i.

Quick reference

| Symbol | Name | Object type | What it does | |--------|------|------------|--------------| | ψ|\psi\rangle | ket | column vector | represents a quantum state | | ψ\langle\psi| | bra | row vector | dual of a ket (conjugate transpose) | | ϕψ\langle\phi|\psi\rangle | inner product | scalar (complex number) | overlap; gives probabilities via Born rule | | ψϕ|\psi\rangle\langle\phi| | outer product | matrix (operator) | maps states to states |

These four pieces underpin everything from gate definitions to measurement theory to algorithm analysis. Keep this cheatsheet handy as a reference while you work through the rest of the module.

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