Skip to content
Dirac notation

Dirac notation

February 2, 2025

Dirac notation is a compact language for quantum states and operators.

Kets, bras, and inner products

A state vector is written as a ket:

ψ. \lvert \psi \rangle.

If you choose a basis {0,1}\{\lvert 0 \rangle, \lvert 1 \rangle\}, you can expand a qubit state as

ψ=α0+β1, \lvert \psi \rangle = \alpha \lvert 0 \rangle + \beta \lvert 1 \rangle,

where α,βC\alpha,\beta \in \mathbb{C} are complex amplitudes.

The conjugate-transpose (Hermitian adjoint) of a ket is a bra:

ψ. \langle \psi \rvert.

In matrix terms:

  • ψ\lvert \psi \rangle behaves like a column vector
  • ψ\langle \psi \rvert behaves like a row vector

Multiplying a bra by a ket gives an inner product:

ϕψ. \langle \phi \vert \psi \rangle.

You will often see ϕψ\langle \phi \vert \psi \rangle written with the middle bars “merged” into a single bar; this is where the word bra-ket comes from.

Inner products in quantum mechanics use complex conjugation. For example, ψψ\langle \psi \vert \psi \rangle is always a non‑negative real number.

Operators acting on states

Linear maps (matrices) are written as operators, such as AA. Applying an operator to a ket is written as

Aψ. A\lvert \psi \rangle.

This is simply “matrix times vector,” producing a new ket.

It is also common to take an inner product after applying an operator:

ϕAψ. \langle \phi \vert A \vert \psi \rangle.

Read this as: start with ψ\lvert \psi \rangle, apply AA, then take the inner product with ϕ\lvert \phi \rangle.

Expectation values (a common pattern)

When AA is an observable (Hermitian operator), the expected value in state ψ\lvert \psi \rangle is

A=ψAψ. \langle A \rangle = \langle \psi \vert A \vert \psi \rangle.

This expression shows up everywhere in quantum computing: energies, measurement statistics, and algorithm analysis.

Basis states, wavefunctions, and “resolution of the identity”

One common source of confusion is that the same \langle \cdot \vert \cdot \rangle notation is used both for:

  • the inner product between two abstract states, and
  • the components of a state in a particular basis.

Discrete basis (finite or countable)

If {i}\{\lvert i \rangle\} is an orthonormal basis, then the coefficients

ψiiψ \psi_i \equiv \langle i \vert \psi \rangle

are just the components of ψ\lvert \psi \rangle in that basis, and you can reconstruct the state as

ψ=iiiψ. \lvert \psi \rangle = \sum_i \lvert i \rangle \langle i \vert \psi \rangle.

This motivates the identity operator:

I=iii. I = \sum_i \lvert i \rangle \langle i \rvert.

Continuous basis (position as an example)

For position, the basis is labeled by a continuous variable xx (or r\mathbf{r} in 3D). The wavefunction is defined by

ψ(x)xψ, \psi(x) \equiv \langle x \vert \psi \rangle,

and its complex conjugate is

ψ(x)=ψx. \psi^*(x) = \langle \psi \vert x \rangle.

The “sum over basis states” becomes an integral:

ψ=dxxxψ=dxψ(x)x. \lvert \psi \rangle = \int dx\, \lvert x \rangle \langle x \vert \psi \rangle = \int dx\, \psi(x)\lvert x \rangle.

Accordingly, the identity operator is written as

I=dxxx. I = \int dx\, \lvert x \rangle \langle x \rvert.

This is called a resolution of the identity. It means: if you insert this operator anywhere, it does nothing—but it lets you rewrite abstract expressions in a concrete basis.

The objects x\lvert x \rangle are “generalized basis vectors.” The integral formulas are shorthand that work well in physics, but they require some mathematical care (distributions) in a rigorous treatment.

Why operators are not “just chilling” in ψAψ\langle \psi \vert A \vert \psi \rangle

The operator AA acts on the ket ψ\lvert \psi \rangle first, producing a new state AψA\lvert \psi \rangle. Then the bra ψ\langle \psi \rvert takes an inner product with that new state.

If you insert a resolution of the identity in the position basis, you get a more familiar-looking integral:

ψAψ=dxψxxAψ. \langle \psi \vert A \vert \psi \rangle = \int dx\, \langle \psi \vert x \rangle \langle x \vert A \vert \psi \rangle.

When AA is diagonal in the x\lvert x \rangle basis (for example, the position operator x^\hat{x}), this reduces to the classical-looking form:

A=dxψ(x)A(x)ψ(x). \langle A \rangle = \int dx\, \psi^*(x)\, A(x)\, \psi(x).

So the operator is absolutely doing work—it is what connects the abstract state to the measurable quantity you care about.

Tensor products

Multi-qubit kets use the tensor product symbol (often omitted in writing):

01=01. \lvert 0 \rangle \otimes \lvert 1 \rangle = \lvert 01 \rangle.

Operators on separate qubits combine as Kronecker products ABA \otimes B.

For a practical guide (including partial trace and reduced density matrices), see Tensor products and partial trace.
If phases still feel “mysterious”, learn the core trick used by many algorithms: Phase kickback.

Projectors and measurement

A projective measurement can be described using projectors onto orthogonal subspaces. For example, the projector onto 0\lvert 0 \rangle on a single qubit is P0=00P_0 = \lvert 0 \rangle \langle 0 \rvert.

When you read circuit diagrams, translate each time slice into the corresponding unitary acting on the tensor-product Hilbert space.

Next

Matrices as gates