Skip to content

The qubit

A classical bit is in one of two states, 0 or 1. To describe it you write down one binary digit and you are done.

A qubit also has two special states, written ∣0⟩\ket{0} and ∣1⟩\ket{1}. The odd brackets are called kets, and for now you can read ∣0⟩\ket{0} as “the state zero”. The difference is that a qubit has many more states than these two. This lesson is about what those states are and how to write them down.

The general state of a qubit is

∣ψ⟩=α∣0⟩+β∣1⟩.\ket{\psi} = \alpha\ket{0} + \beta\ket{1}.

Here α\alpha and β\beta are complex numbers called amplitudes. That is the whole description: to specify a qubit’s state, give two numbers, one attached to ∣0⟩\ket{0} and one attached to ∣1⟩\ket{1}.

A state like this is called a superposition of ∣0⟩\ket{0} and ∣1⟩\ket{1}. The word sounds mysterious, but it means nothing more than “a weighted sum”.

Because a state is a pair of numbers, we can also write it as a column vector. The two special states are

∣0⟩=(10),∣1⟩=(01),\ket{0} = \begin{pmatrix}1\\0\end{pmatrix}, \qquad \ket{1} = \begin{pmatrix}0\\1\end{pmatrix},

and so the general state is

α∣0⟩+β∣1⟩=(αβ).\alpha\ket{0} + \beta\ket{1} = \begin{pmatrix}\alpha\\ \beta\end{pmatrix}.

Kets and column vectors are two notations for the same thing. Kets are easier to read once there are several qubits, which is why physicists prefer them.

There is one rule. The amplitudes must satisfy

∣α∣2+∣β∣2=1.|\alpha|^2 + |\beta|^2 = 1.

This is called normalisation. In the next lesson you will see where it comes from: ∣α∣2|\alpha|^2 and ∣β∣2|\beta|^2 turn out to be probabilities, and probabilities have to add up to one.

Two states come up so often that they have their own names:

∣+⟩=12(∣0⟩+∣1⟩),∣−⟩=12(∣0⟩−∣1⟩).\ket{+} = \frac{1}{\sqrt2}\bigl(\ket{0} + \ket{1}\bigr), \qquad \ket{-} = \frac{1}{\sqrt2}\bigl(\ket{0} - \ket{1}\bigr).

Check the rule for ∣−⟩\ket{-}: the amplitudes are 12\tfrac{1}{\sqrt2} and −12-\tfrac{1}{\sqrt2}, and 12+12=1\tfrac12 + \tfrac12 = 1. Notice that an amplitude can be negative. That minus sign is the only difference between ∣+⟩\ket{+} and ∣−⟩\ket{-}, and it will matter a great deal.

Check

Which of these is a valid qubit state?

You will often read that a qubit in superposition is “0 and 1 at the same time”. This is a poor description, and it leads people to wrong conclusions about what quantum computers can do.

A more careful statement: the state α∣0⟩+β∣1⟩\alpha\ket{0} + \beta\ket{1} is a single, definite state. It is exactly as definite as ∣0⟩\ket{0}. What is different is that it is described by two amplitudes instead of one bit, and amplitudes behave in a way that probabilities do not: they can be negative or complex, so they can cancel each other out. Almost everything interesting in quantum computing comes from arranging for that cancellation to happen.

We change a qubit’s state by applying gates. You will meet them properly in two lessons’ time, but you can start using them now. A circuit is read left to right: the wire is the qubit, and each box on it is a gate.

The puzzles on this site check your answer as you build it, so experiment freely. Try both gates and watch what happens to the state.

PuzzleFlip the qubit

The qubit starts in ∣0⟩\ket{0}. Put it in the state ∣1⟩\ket{1}.

This puzzle needs JavaScript.

If you tried the HH gate, you saw it produce 12∣0⟩+12∣1⟩\tfrac{1}{\sqrt2}\ket{0} + \tfrac{1}{\sqrt2}\ket{1}, which is the state ∣+⟩\ket{+} from above.

Try this on paper before opening the solution. Working things out yourself is where most of the learning happens.

Exercise. The vector 3∣0⟩+4i∣1⟩3\ket{0} + 4i\ket{1} is not normalised. What number should you divide it by to make it a valid state?

Solution

The squared magnitudes are ∣3∣2=9|3|^2 = 9 and ∣4i∣2=16|4i|^2 = 16, which sum to 25. Dividing both amplitudes by 25=5\sqrt{25} = 5 gives 35∣0⟩+4i5∣1⟩\tfrac35\ket{0} + \tfrac{4i}{5}\ket{1}, and 925+1625=1\tfrac{9}{25} + \tfrac{16}{25} = 1.

These prompts are how the site helps you keep what you have just read. Answer each one from memory, then say honestly whether you had it. The cards you answer are scheduled for review days and then weeks later.

RecallAnswer from memory, then check
LessonFinish this lesson