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 and . The odd brackets are called kets, and for now you can read 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.
A state is two numbers
Section titled “A state is two numbers”The general state of a qubit is
Here and are complex numbers called amplitudes. That is the whole description: to specify a qubit’s state, give two numbers, one attached to and one attached to .
A state like this is called a superposition of and . 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
and so the general state is
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.
Not every pair of numbers is allowed
Section titled “Not every pair of numbers is allowed”There is one rule. The amplitudes must satisfy
This is called normalisation. In the next lesson you will see where it comes from: and 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:
Check the rule for : the amplitudes are and , and . Notice that an amplitude can be negative. That minus sign is the only difference between and , and it will matter a great deal.
Which of these is a valid qubit state?
. The minus sign does not matter for normalisation, because the amplitudes are squared.
What a superposition is not
Section titled “What a superposition is not”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 is a single, definite state. It is exactly as definite as . 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.
Your first circuit
Section titled “Your first circuit”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.
The qubit starts in . Put it in the state .
This puzzle needs JavaScript.
If you tried the gate, you saw it produce , which is the state from above.
An exercise
Section titled “An exercise”Try this on paper before opening the solution. Working things out yourself is where most of the learning happens.
Exercise. The vector is not normalised. What number should you divide it by to make it a valid state?
Solution
The squared magnitudes are and , which sum to 25. Dividing both amplitudes by gives , and .
Remember it
Section titled “Remember it”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.
A qubit's state is written . What are and ?
Complex numbers called amplitudes, one for each basis state.
What condition must the amplitudes in satisfy?
Normalisation: .
Write and as column vectors.
and .
How are the states and defined?
and .
Is an amplitude a probability?
No. An amplitude is a complex number and can be negative. The probability is its squared magnitude.