Skip to the content
Kets & Gates homeOpen the app

Math toolkit

Inner products and bases

⟨φ|ψ⟩, orthogonality, and |⟨φ|ψ⟩|² as a probability

about 5 min

Practise this in the app

In the app every question checks your answer and explains a wrong one.

Bras and inner products

The bra ⟨φ∣\bra{\varphi} is the conjugate transpose of the ket ∣φ⟩\ket{\varphi}: a row vector with every entry conjugated. The inner product ⟨φ|ψ⟩\braket{\varphi}{\psi} is that row times the column ∣ψ⟩\ket{\psi}:

∣φ⟩=[ab],∣ψ⟩=[cd]⟨φ|ψ⟩=[a∗b∗][cd]=a∗c+b∗d\begin{gathered}\ket{\varphi} = \begin{bmatrix}a\\b\end{bmatrix},\quad \ket{\psi} = \begin{bmatrix}c\\d\end{bmatrix} \\[6pt] \braket{\varphi}{\psi} = \begin{bmatrix}a^* & b^*\end{bmatrix}\begin{bmatrix}c\\d\end{bmatrix} = a^* c + b^* d\end{gathered}

Two states are orthogonal when ⟨φ|ψ⟩=0\braket{\varphi}{\psi} = 0. A basis for one qubit is any pair of orthonormal states, such as {∣0⟩,∣1⟩}\{\ket{0},\ket{1}\} or {∣+⟩,∣−⟩}\{\ket{+},\ket{-}\}, where ∣±⟩=12(∣0⟩±∣1⟩)\ket\pm = \tfrac{1}{\sqrt2}(\ket0 \pm \ket1). Measuring ∣ψ⟩\ket{\psi} in a basis {∣e1⟩,∣e2⟩}\{\ket{e_1},\ket{e_2}\} gives outcome eke_k with probability ∣⟨ek|ψ⟩∣2\abs{\braket{e_k}{\psi}}^2.

Worked example

Measuring |0⟩ in the ± basis

  1. Write the bras: ⟨+∣=12[11]\bra{+} = \tfrac{1}{\sqrt2}\begin{bmatrix}1 & 1\end{bmatrix} and ⟨−∣=12[1−1]\bra{-} = \tfrac{1}{\sqrt2}\begin{bmatrix}1 & -1\end{bmatrix}.

  2. Inner products with ∣0⟩=[10]\ket{0} = \begin{bmatrix}1\\0\end{bmatrix}: ⟨+|0⟩=12\braket{+}{0} = \tfrac{1}{\sqrt2} and ⟨−|0⟩=12\braket{-}{0} = \tfrac{1}{\sqrt2}.

  3. Your turn

    So what is the probability of the outcome ++?

    Show the answer

    Answer: 12\frac{1}{2}

    ∣1/2∣2=1/2|1/\sqrt2|^2 = 1/2.

  4. Both outcomes are equally likely. ∣0⟩\ket{0} is "maximally uncertain" in the ± basis, just as ∣+⟩\ket{+} is in the 0/1 basis.

Check yourself

Compute ⟨φ|ψ⟩\braket{\varphi}{\psi} for ∣φ⟩=12(∣0⟩+i∣1⟩)\ket{\varphi} = \tfrac{1}{\sqrt2}(\ket0 + i\ket1) and ∣ψ⟩=12(∣0⟩+i∣1⟩)\ket{\psi} = \tfrac{1}{\sqrt2}(\ket0 + i\ket1).

Hints
  1. What does the bra ⟨φ∣\bra\varphi look like as a row?
  2. Conjugate the entries of ∣φ⟩\ket\varphi first: the bra has −i-i in its second slot.
  3. Compute 12(1⋅1+(−i)(i))\tfrac12\big(1\cdot 1 + (-i)(i)\big).
Show the answer

Answer: 11

12(1⋅1+(−i)(i))=12(1+1)=1\tfrac12(1\cdot1 + (-i)(i)) = \tfrac12(1 + 1) = 1. Every normalized state has ⟨ψ|ψ⟩=1\braket{\psi}{\psi} = 1. Forgetting the conjugate would give 12(1−1)=0\tfrac12(1 - 1) = 0, which is wrong.

Common slips

  • 00: That skips the conjugate: 12(1⋅1+i⋅i)=0\tfrac12(1\cdot1 + i\cdot i) = 0. The bra ⟨φ∣\bra\varphi has every entry conjugated, so its second entry is −i-i.

Change of basis. Because {∣+⟩,∣−⟩}\{\ket+, \ket-\} is a basis, every state can be written as a∣+⟩+b∣−⟩{a\ket+ + b\ket-}, and the coefficients are inner products: a=⟨+|ψ⟩a = \braket{+}{\psi}, b=⟨−|ψ⟩b = \braket{-}{\psi}. The worked example above found ⟨+|0⟩=⟨−|0⟩=12\braket{+}{0} = \braket{-}{0} = \tfrac{1}{\sqrt2}, so ∣0⟩=12∣+⟩+12∣−⟩\ket0 = \tfrac{1}{\sqrt2}\ket+ + \tfrac{1}{\sqrt2}\ket-.

Check yourself

Write ∣1⟩\ket1 in the ± basis: ∣1⟩=a∣+⟩+b∣−⟩{\ket1 = a\ket+ + b\ket-}. Enter aa and bb.

Hints
  1. Each coefficient is an inner product: a=⟨+|1⟩a = \braket{+}{1} and b=⟨−|1⟩b = \braket{-}{1}.
  2. Use the bras ⟨+∣=12[11]\bra{+} = \tfrac{1}{\sqrt2}\begin{bmatrix}1 & 1\end{bmatrix} and ⟨−∣=12[1−1]\bra{-} = \tfrac{1}{\sqrt2}\begin{bmatrix}1 & -1\end{bmatrix} on [01]\begin{bmatrix}0\\1\end{bmatrix}.
Show the answer

Answer: a=12,b=−12a = \frac{1}{\sqrt{2}},\quad b = -\frac{1}{\sqrt{2}}

a=⟨+|1⟩=12a = \braket{+}{1} = \tfrac{1}{\sqrt2} and b=⟨−|1⟩=−12b = \braket{-}{1} = -\tfrac{1}{\sqrt2}. Check: 12(∣+⟩−∣−⟩)=12((∣0⟩+∣1⟩)−(∣0⟩−∣1⟩))=∣1⟩\tfrac{1}{\sqrt2}(\ket+ - \ket-) = \tfrac12\big((\ket0+\ket1) - (\ket0-\ket1)\big) = \ket1.

Go further

Free resources for when you want more than this refresher covers.

Lessons that use it

Practise this in the appAll refreshers