What is a qubit?

Difficulty: Beginner

This lesson serves as an introduction to qubits. We start with the classical bit, which we are more familiar with in our everyday life. We then introduce the random bit, followed by a quantum bit, the qubit. One must not mistaken the two with each other, as they are not the same as you will see in this lesson. Finally, we will show how the qbead is meant to represent a qubit.

Objectives

  1. Learn what bits and random bits are.
  2. Learn what the quantum bit, a qubit is.
  3. See how the qbead is meant to represent a qubit.
  4. Have fun!

Topics Covered

    theory
    basics
    quantum mechanics
    classical physics

What is a bit?

A bit is the smallest piece of information possible. It can be one of two values: 0 or 1. That's it -- just two choices, like a light switch that is either off or on, or a coin showing heads or tails. Every piece of data in a computer -- every photo, song, and video game -- is built out of long strings of bits.

What is a random bit?

Sometimes we don't know for sure what a bit is. Imagine flipping a coin that hasn't landed yet -- you know it will be heads or tails, but you don't know which one. This is a random bit.

Even though we don't know the answer for certain, we can still say something useful about a random bit: we can describe how likely each outcome is. For a fair coin, there is a 50% chance of heads and a 50% chance of tails. But a weighted coin might have a 70% chance of heads and a 30% chance of tails. These probabilities tell us everything there is to know about our random bit.

Random bits are surprisingly useful. For example, computers use large batches of random bits to search for big prime numbers, which are the basis of internet security.

Mathematicians like to write these two probabilities as a column, which they call a probability vector:

For a fair coin, that would be . The two probability entries always add up to 1, because the bit has to end up as something (in this case either 0 or 1).

A bit of a known value is just a special case of a random bit where one of the probabilities is 100% and the other one is 0%.

What is a quantum bit (qubit)?

Over the last 150 years, physicists have discovered something surprising: nature does not follow the rules of ordinary probability at its smallest scales. Instead, it follows a different, deeper set of rules -- quantum mechanics.

A qubit is like a random bit, but one that obeys these quantum rules instead of regular probability rules. What makes it different?

In regular probability, each outcome gets a probability -- a number between 0 and 1. In quantum mechanics, each outcome gets a probability amplitude -- a number that can be positive or negative (and even complex). To get the actual probability from an amplitude, you take its square.

We write a qubit state using a special notation called a ket:

Here and are the two possible outcomes (the basis states), and and are the probability amplitudes. The probability of measuring 0 is , and the probability of measuring 1 is .

Graphical representation of bit, random bit, and qubit

From the left, a graphical representation of a bit, a random bit, and a qubit.
From the left, a graphical representation of a bit, a random bit, and a qubit.

A regular bit is just one of two points: 0 or 1. A random bit lives somewhere on a line segment between them (described by a single probability). But a qubit lives on the surface of a sphere -- the Bloch sphere. The extra freedom of the sphere (compared to a line) is what makes qubits more powerful.

The 0 state

The "zero" state sits at the north pole of the Bloch sphere.

When measured, this qubit gives 0 with 100% certainty.

The 1 state

The "one" state sits at the south pole.

When measured, this qubit gives 1 with 100% certainty.

The "+" superposition state

This qubit is in an equal superposition -- 50% chance of 0 and 50% chance of 1. It sits on the equator.

Both amplitudes are positive.

The "-" state -- same probabilities, different phase

Similar to the previous "+" superposition state, this qubit also gives 50/50 measurement results. But now it points in the opposite direction on the equator of the Bloch sphere.

The second amplitude is now negative. This is a different phase.

A bit more mathematical rigor

Let us restate what we covered above more precisely:

  • A bit's value is an element of the set .
  • A random bit is completely described by a stochastic vector -- a vector of non-negative entries that sum to 1 (normalized under the 1-norm):
  • A qubit is completely described by a state vector -- a vector of complex entries whose squared magnitudes sum to 1 (normalized under the 2-norm):

Operations

The most general operation on a random bit is a stochastic matrix -- the most general linear map that preserves the 1-norm. For a qubit, the corresponding operations are unitary matrices -- the most general linear maps that preserve the 2-norm. It turns out that unitary transformations are richer and more powerful for encoding computation than stochastic ones.

Measurement

For a random bit, the entries of the stochastic vector directly give the probabilities of observing 0 or 1. For a qubit, you must take the squared magnitude of each entry:

This squaring rule (known as the Born rule) is what allows amplitudes to be negative or complex while still producing valid probabilities.