Skip to content
Quantum ComputingAN INTERACTIVE OPEN TEXTBOOK
charithj.com.au

Dirac notation — kets and bras

A compact language for state vectors, inner products and projections.

15 min readDr. Charith Jayasekara↓ Chapter PDF
By the end, you’ll be able to
  • Translate between column vectors and ket notation.
  • Compute a bra-ket inner product with complex conjugation.

∣ψ⟩\lvert\psi\rangle means a state vector. For one qubit,

∣ψ⟩=α∣0⟩+β∣1⟩=(αβ).\lvert\psi\rangle=\alpha\lvert0\rangle+\beta\lvert1\rangle =\begin{pmatrix}\alpha\\\beta\end{pmatrix}.

Its corresponding bra is the conjugate-transposed row:

⟨ψ∣=(α∗,β∗).\langle\psi\rvert=(\alpha^*,\beta^*).

Complex conjugation matters. If β=i/2\beta=i/\sqrt2, its conjugate is −i/2-i/\sqrt2.

The expression ⟨ϕ∣ψ⟩\langle\phi\vert\psi\rangle is a complex number. It describes overlap between vectors. The basis states are orthonormal: ⟨0∣0⟩=1\langle0\vert0\rangle=1 and ⟨0∣1⟩=0\langle0\vert1\rangle=0.

For ∣ψ⟩=(∣0⟩+i∣1⟩)/2\lvert\psi\rangle=(\lvert0\rangle+i\lvert1\rangle)/\sqrt2,

⟨ψ∣ψ⟩=12+(−i)i2=1.\langle\psi\vert\psi\rangle=\frac12+\frac{(-i)i}{2}=1.

The probability of a Z-basis outcome 1 is ∣⟨1∣ψ⟩∣2=1/2|\langle1\vert\psi\rangle|^2=1/2.

∣0⟩⟨0∣\lvert0\rangle\langle0\rvert is a matrix, not a scalar:

∣0⟩⟨0∣=(1000).\lvert0\rangle\langle0\rvert=\begin{pmatrix}1&0\\0&0\end{pmatrix}.

It projects onto the ∣0⟩\lvert0\rangle direction. The distinction is visual: a bra followed by a ket gives an inner product; a ket followed by a bra gives an operator.

Check yourself: calculate ⟨+∣−⟩\langle+\vert-\rangle. The two terms cancel, giving zero, even though their Z-basis probabilities are identical.

WORKED DIAGRAM · F05Inner product or outer product?
Inner product or outer product?The order of the bra and ket changes the mathematical object. In the upper lane a row multiplies a column; in the lower lane a column multiplies a row.Inner⟨ψ| : 1 × 2|ψ⟩ : 2 × 1Scalar ⟨ψ|ψ⟩ = 1Outer|0⟩ : 2 × 1⟨0| : 1 × 22 × 2 projector
The order of the bra and ket changes the mathematical object. In the upper lane a row multiplies a column; in the lower lane a column multiplies a row.

Dirac notation is useful because it makes the shape of a calculation visible. A ket is a column, a bra is a row, and a bra followed by a ket gives a scalar. Reversing their order gives a matrix. Those are different objects even when they use the same symbols. Before evaluating an expression, identify its expected shape; many apparent quantum mysteries are ordinary matrix-shape errors.

The conjugation in a bra is equally important. Transposing a complex column without conjugating it generally gives the wrong inner product. For real examples the error can go unnoticed, so this lesson uses an imaginary component deliberately. A norm must be real and nonnegative, and a correctly normalised state must have inner product one with itself.

Let the state have amplitudes one over the square root of two and i over the square root of two. Its bra has entries one over the square root of two and negative i over the square root of two. Their product is

⟨ψ∣ψ⟩=12+(−i)i2=1.\langle\psi|\psi\rangle =\frac12+\frac{(-i)i}{2}=1.

Using an unconjugated row would instead give one half plus i squared over two, which is zero. That false answer would say a nonzero normalised vector has zero length. Checking the conjugation resolves the problem before any physical interpretation is needed.

The overlap with zero is the first amplitude, and the overlap with one is the second amplitude. Squaring the magnitude of either overlap gives one half. The overlap itself remains complex: it is an amplitude, not a probability. This distinction appears repeatedly in formulas such as the Born rule, where the vertical bars around an overlap mean squared magnitude rather than another ket delimiter.

The outer product of the zero ket and zero bra is a matrix with one in its top-left entry and zero elsewhere. Acting on a general state, it keeps the zero component and removes the one component. It is a projector. Its output need not be normalised, because the squared norm of that output is the probability of the associated measurement outcome.

For the state above, the full outer product is

∣ψ⟩⟨ψ∣=12(1−ii1).|\psi\rangle\langle\psi| =\frac12\begin{pmatrix}1&-i\\i&1\end{pmatrix}.

The diagonal entries are Z-basis probabilities. The off-diagonal entries carry coherence information. You do not need density-matrix machinery yet, but this example shows why a two-number probability list does not contain the entire state. Removing the off-diagonal entries would describe a different preparation, even though a Z histogram would be unchanged.

An identity can also be written as a sum of basis projectors. For one qubit, the zero projector plus the one projector gives the identity matrix. Applying that sum to a ket reconstructs the ket from its components. This is the meaning of expanding a state in a basis: each basis vector is weighted by its overlap with the state.

The plus bra is the row with two positive entries divided by the square root of two. Its overlap with our example state is one half plus i over two. The squared magnitude is one half. The minus overlap is one half minus i over two and has the same squared magnitude. Thus this state produces equal probabilities in both Z and X measurements, despite being a definite pure state. In the Y basis it is one of the basis states itself.

The explorer opens at the corresponding angles: polar 90 degrees, relative phase 90 degrees. Predict the complex table entries, then reveal them. Apply H and calculate the two output components as sums and differences. The table lets you compare that matrix calculation with the overlaps for an X-basis readout. It exposes model amplitudes for learning; a physical measurement would return only a basis label.

L01 · INTERACTIVE LABRuns on your device

Qubit explorer

Prepare a pure qubit, apply gates, then compare amplitudes, phases and Z-basis probabilities. Reset restores the initial preparation shown by the lesson’s controls.

Experiment controls

Predict the amplitudes and Z-basis probabilities for the preparation and gates you have chosen. If starting from |0⟩, what will H do?

Record a prediction to enable the results.

Results are hidden.

Prepare your experiment using the controls. Record a prediction, then reveal the statevector or run the experiment.

Changing the preparation or circuit starts a new prediction.

MODEL · Ideal pure-state vector, complex double precisionORDER · q0 is the leftmost bit
Take it further

Prepare θ = 120°, φ = 90°. Predict both complex amplitudes. Then change φ without changing θ.

Calculate the inner product of plus and minus. Then apply the zero projector to plus. State the probability represented by the output norm and the normalised state after that outcome is selected. Explain why the projected column is not itself a complete post-measurement state until it is normalised.

Check your reasoning

The plus-minus inner product is one half minus one half, so the states are orthogonal. The zero projector acting on plus gives the zero ket divided by the square root of two. Its squared norm is one half, the probability of obtaining zero. Conditional on that result, divide by its norm to obtain the zero ket. The probability and the conditional state play different roles and should both be retained in a measurement calculation.

When reading a longer equation, annotate each intermediate shape in the margin. A projector times a ket gives a ket; a bra times that result gives a scalar. An operator expectation therefore has a scalar result even though a matrix appears in the middle. This habit scales to multiple qubits and makes later Hamiltonian and variational calculations easier to follow without memorising every formula.

PAUSE & THINK

For |ψ⟩ = (1, i)ᵀ/√2, which bra is correct?

Choose your answer

Reference: IBM Quantum — Quantum information.

ONE IDEA FURTHER

Ready for the next step?

Your progress stays in this browser.