# 1.11 Qubits

In the first
section of this chapter, we looked at data. Starting with the bits **0** and **1**, we built integers, and I indicated that we could
also represent floating-point numbers. Let’s switch from the arithmetic and algebra of numbers
to geometry.

A single point is 0-dimensional. Two points are just two 0-dimensional objects. Let’s label
these points 0 and 1. When we draw an infinite line through the two points and consider all the
points on the line, we get a 1-dimensional object. We can represent each such point as
(*x*), or just *x*, where *x* is a real number. If we have another line drawn
vertically and perpendicular to the first, we get a plane. A plane is 2-dimensional, and we can
represent every point in it with coordinates (*x*, *y*). The point (0, 0) is the
*origin*.

This is the Cartesian geometry you learned in school. As we move from zero dimensions to two
in Figure 1.7, we can represent more information. In an imprecise sense, we have more room in
which to work. We can even link together the geometry of the plane with *complex numbers*,
which extend the real numbers. We see those in section 5.5.

Now I want you to think about taking the standard 2-dimensional plane and wrapping it completely around a sphere. If that request strikes you as bizarre, consider this: start with a sphere and balance the plane on top. Make the origin of the plane sit right on the north pole of the sphere. Now start uniformly bending the plane down over the sphere, compressing it together as you move out from the origin.

Carry this to its completion, and the “infinity” ∞ of the plane sits at the south pole. In mathematical terms, this is a stereographic projection of the plane onto the sphere.

That was mind-warping as well as plane-warping! The sphere sits in three dimensions, but we can think about its surface as two-dimensional.

Exercise 1.12

We use longitude and latitude measured in degrees to locate any location
on our planet. Those are the two coordinates for the “dimensions” of the surface of the
Earth. Look at an image of the planet with longitude lines drawn and see how they get closer
as you approach the poles. This is very different from the usual *xy*-plane, where the
lines stay equally spaced.

With that geometric discussion as the warm-up, I am now ready to introduce the *qubit*,
which is short for “quantum bit.” While a bit can only be **0** or
**1**, a qubit can exist in more states. Qubits are surprising,
fascinating, and powerful. They follow strange rules which may not initially seem natural to
you. According to physics, these rules may be how nature itself works at the level of electrons
and photons.

A qubit starts in an initial state. We use the notation |0⟩ and |1⟩ when we are talking
about a qubit instead of the **0** and **1** for a
bit. For a bit, the only non-trivial operation you can perform is switching **0** to **1** and vice versa. We can move a qubit’s state to any
point on the sphere shown in the center of Figure 1.9. We can represent more information and
have more room in which to work.

This sphere is called the *Bloch sphere*, named after physicist Felix
Bloch.

Things get even better when we have multiple qubits. One qubit holds two pieces of
information, and two qubits hold four. That’s not surprising, but if we add a third qubit, we
can represent eight pieces of information. Every time we add a qubit, we double its capacity.
For 10 qubits, that’s 1,024. For 100 qubits, we can represent
1,267,650,600,228,229,401,496,703,205,376 pieces of information. This illustrates exponential
behavior since we are looking at 2^{the number of qubits}.

You’re going to see how to use bits, numbers, qubits, strings, and many other useful objects and structures as we progress through this book. Before we leave this section, let me point out several weird yet intriguing qubit features.

- While we can perform operations and change the state of a qubit, the moment we look at
the qubit, the state
*collapses*to**0**or**1**. We call the operation that moves the qubit state to one of the two bit states “measurement.” - Just as we saw that bits have meaning when they are parts of numbers and strings,
presumably the measured qubit values
**0**and**1**have meaning as data. - Probability is involved in determining whether we get
**0**or**1**at the end. - We use qubits in algorithms to take advantage of their exponential scaling and other underlying mathematics. With these, we hope eventually to solve some significant but currently intractable problems. These are problems for which classical systems alone will never have enough processing power, memory, or accuracy.

Scientists and developers are now creating quantum algorithms for use cases in financial services and artificial intelligence (AI). They are also looking at precisely simulating physical systems involving chemistry. These may have future applications in materials science, agriculture, energy, and healthcare.