↓Skip to main content
  1. Data Science Blog/

How Many Numbers Does a Qubit Need?

·3080 words·15 mins· loading · ·
Mathematics Research & Academia Quantum Computing Quantum Mechanics Mathematics Linear Algebra Machine Learning

How Many Numbers Does a Qubit Need?

How Many Numbers Does a Qubit Need?
#

You already know how to place a point. On a plane you need two numbers. In a room you need three. This article uses that skill for a qubit.

A qubit is the smallest piece of quantum information. One pure qubit ends as a point on a sphere. The sphere is an ordinary ball’s surface, so the point has three coordinates \(x\), \(y\), and \(z\). Those three numbers lie on the sphere, so only two of them are free.

The path there starts with an arrow.

1. A vector is an arrow
#

Mark a point on a page. Call it the origin. Draw an arrow that starts there.

The arrow has a length. The arrow has a direction. That arrow is a vector.

The tip of the arrow is a point. With every arrow starting at the same origin, one arrow and one point are the same fact. The arrow says how to get there. The point says where you arrived.

2. Numbers appear when you choose axes
#

Draw a horizontal line and a vertical line through the origin. They meet at a right angle. These lines are the axes.

A right angle matters. A step along the horizontal axis does not move you up or down. A step along the vertical axis does not move you left or right. Axes that meet at a right angle are orthogonal. Orthogonal means each axis is its own direction. They are perpendicular to each other.

A basis vector is the arrow of length 1 along one axis. The plane has two basis vectors. Any other arrow is a mix of those two unit steps:

\[ \vec{v} = x\,\mathbf{e}_x + y\,\mathbf{e}_y \]

\(x\) is how many steps to the right. \(y\) is how many steps up. The list \((x, y)\) is the coordinate list of the vector. Two orthogonal axes, two basis vectors, two real numbers.

Stand a third axis straight out of the page, at right angles to the first two. A vector now needs three real numbers, \((x, y, z)\), and the space has three basis vectors.

The rule of this geometry is one number per orthogonal axis.

3. People on orthogonal axes
#

Picture the people in your society on a chart. Let the horizontal axis be mass. Let the vertical axis be height. Each person is the tip of one arrow. One person is one point: two measurements, two numbers. Ten people are ten points. Each point still has two numbers, the mass and the height of that person.

The horizontal and vertical axes are orthogonal. A step along the mass axis changes only the mass number. The height number stays the same. A step along the height axis changes only the height number. The mass number stays the same. Each axis has its own direction.

Machine learning keeps this chart and adds features as new axes. Age can be a third orthogonal axis. Blood pressure can be a fourth. Each new axis adds one real number for every person. A step along that axis changes only that feature.

The mass coordinate is the mass. The height coordinate is the height. The number on an axis belongs to that axis alone.

The points can still form a tilted cloud. Height and mass often rise together. That is a fact about the people. The axes stay at right angles. The ideal chart still gives every feature its own orthogonal direction, so each coordinate carries that feature alone.

4. A complex number is a pair of real numbers
#

A qubit coordinate is not a mass, and it is not a height. To write it, we need a complex number. A complex number is two real numbers kept as one pair:

\[ a + ib \]

\(a\) is the first number of the pair. \(b\) is the second. The letter \(i\) is the mark that says “\(b\) is the second number.” You can draw \(a + ib\) as the point \((a, b)\) on a plane. That picture is enough here.

One complex number is two real numbers. Two complex numbers are four real numbers.

5. One qubit is two complex numbers
#

A pure qubit has two basis vectors. Their names are \(|0\rangle\) and \(|1\rangle\). They are orthogonal, in the same sense as the \(x\)-axis and the \(y\)-axis. \(|0\rangle\) is one direction. \(|1\rangle\) is the other. A step along \(|0\rangle\) does not move you along \(|1\rangle\).

A pure state is one vector built from those two directions:

\[ |\psi\rangle = \alpha|0\rangle + \beta|1\rangle \]

\(\alpha\) is the weight on \(|0\rangle\). \(\beta\) is the weight on \(|1\rangle\). Both weights are complex:

\[ \alpha = a + ib, \qquad \beta = c + id \]

So the qubit vector is the list of four real numbers \((a, b, c, d)\).

Count the axes and you get 2. Those are the complex directions \(|0\rangle\) and \(|1\rangle\). Count the real numbers inside the weights and you get 4. Both counts are true. They count different things.

The vector space where this state lives is called a Hilbert space. In this article that name means the space of these arrows.

6. The arrow has length 1
#

The chance of a result is a number from 0 to 1. For this state, the chance of result 0 is the squared length of \(\alpha\). The chance of result 1 is the squared length of \(\beta\). The two chances add to 1, because one of those two results must happen.

That rule is the length of the arrow:

\[ a^2 + b^2 + c^2 + d^2 = 1 \]

The same rule in complex form is \(|\alpha|^2 + |\beta|^2 = 1\).

The four real numbers sit on a sphere in four-dimensional real space. The sphere is a three-dimensional surface. Its name is the 3-sphere, written \(S^3\).

One equation ties the four numbers together. A free number is one you can still choose. Three free real numbers remain.

7. One extra turn does not make a new state
#

A complex number of length 1 is a turn by some angle. The symbol \(e^{i\gamma}\) means “turn by the angle \(\gamma\).” Multiply both weights by that same turn:

\[ |\psi_2\rangle = e^{i\gamma}|\psi_1\rangle \]

Every chance stays the same. For a pure state, these two vectors are the same physical state. The angle \(\gamma\) does not name a new situation you can detect.

A turn that multiplies the whole vector is a global phase.

\[ 4 - 1 - 1 = 2 \]

The first subtraction is the length. That is a rule the four numbers must obey. The second is the global phase. That is the same state written again. Two free real numbers are left.

The turn that does change the physics is a turn of one weight and not the other. That difference of turn is the relative phase. It shows up in the next section as the angle \(\phi\).

8. Two angles place the point on a sphere
#

Every pure qubit state can be written with the two free numbers:

\[ |\psi\rangle = \cos(\theta/2)\,|0\rangle + e^{i\phi}\sin(\theta/2)\,|1\rangle \]

\(\theta\) runs from \(0\) to \(\pi\). That is \(0^\circ\) to \(180^\circ\). \(\phi\) runs from \(0\) to \(2\pi\). That is \(0^\circ\) to \(360^\circ\).

\(\theta\) is the angle down from the north pole. \(\phi\) is the angle around the equator. A globe uses the same pair. Latitude and longitude are two numbers for a point on a sphere.

The \(2\) in \(\theta/2\) lines the poles up with the basis names. \(\theta = 0\) is the north pole, the state \(|0\rangle\). \(\theta = \pi\), a half-turn of the point, is the south pole, the state \(|1\rangle\). On the Bloch sphere those poles are the ends of the \(Z\) axis:

\[ +Z = |0\rangle, \qquad -Z = |1\rangle \]

Seeing Three Dimensions draws the six axis directions and the states that sit on them.

These two states differ by the relative phase \(\phi\). They are different points. A measurement can give different chances for them.

\[ \frac{|0\rangle + |1\rangle}{\sqrt{2}}, \qquad \frac{|0\rangle + i|1\rangle}{\sqrt{2}} \]

The first is the \(+X\) point. The second is the \(+Y\) point.

\[ \frac{|0\rangle - |1\rangle}{\sqrt{2}}, \qquad \frac{|0\rangle - i|1\rangle}{\sqrt{2}} \]

The first is the \(-X\) point. The second is the \(-Y\) point.

A global phase is different. These two vectors are the same point on the sphere:

\[ \frac{|0\rangle + |1\rangle}{\sqrt{2}}, \qquad e^{i\gamma}\frac{|0\rangle + |1\rangle}{\sqrt{2}} \]
%%{init: {"flowchart": {"rankSpacing": 18, "wrappingWidth": 480}}}%%
flowchart TD
    A["4 real numbers"]
    B["3 when length is 1"]
    C["2 angles on the sphere"]
    A --> B --> C

9. Three coordinates, and only two are free
#

The same point has ordinary coordinates \(x\), \(y\), and \(z\) in the room where you draw the sphere. The two angles produce them. In the diagram, \(\theta\) is measured down from \(+Z\) to the state arrow. \(\phi\) is measured around the equator from \(+X\) to the shadow of that arrow on the \(XY\) plane. The vertical drop from the tip to the equator has length \(\cos\theta\). The radius of that shadow on the equator has length \(\sin\theta\).

Bloch sphere: theta from plus Z, phi from plus X, and x y z from sine and cosine

\[ x = \sin\theta\cos\phi \]\[ y = \sin\theta\sin\phi \]\[ z = \cos\theta \]

Three coordinates appear because the drawing is in ordinary 3D space. They are not three free numbers. Square them and add. The pieces with \(\phi\) add up by \(\cos^2\phi + \sin^2\phi = 1\), so that part is \(\sin^2\theta\). Then

\[ x^2 + y^2 + z^2 = \sin^2\theta + \cos^2\theta = 1 \]

Every point on the sphere obeys that equation. Choose two of \(x\), \(y\), and \(z\) inside the allowed range, and the equation fixes the rest. The two angles \(\theta\) and \(\phi\) are the two free numbers. The triple \((x, y, z)\) is the same point in Cartesian form.

Check the north pole. \(\theta = 0\), so \(x = 0\), \(y = 0\), \(z = 1\). That point is \(|0\rangle\).

Check the \(+X\) point. \(\theta = \pi/2\) and \(\phi = 0\), so \(x = 1\), \(y = 0\), \(z = 0\).

These \(x\), \(y\), and \(z\) are not the four numbers \(a\), \(b\), \(c\), and \(d\) from §5. The four numbers are the weights, before the length rule and the global phase. The three coordinates are the point on the sphere, after those two steps.

10. Inside the ball, three numbers are free
#

§5 through §9 describe a pure state. A pure state is one arrow of length 1. Its point is on the surface.

A mixed state is what you have when the qubit is not one pure arrow. Two common cases lead there. The preparation is a random pick among pure states. Or this qubit is one part of a larger pure state, and you ignore the other parts.

One mixed qubit needs three real numbers. They are the coordinates \(x\), \(y\), and \(z\) of a point in the ball. On the surface, \(x^2 + y^2 + z^2 = 1\). Inside the ball, \(x^2 + y^2 + z^2\) is less than 1. The surface points are the pure states. The interior points are the mixed states.

On the surface the sphere equation removes one number, so two angles are enough. Inside the ball all three coordinates can move, as long as the point stays inside. The third number says how far the point is from the center.

11. Two angles per qubit cover a product
#

A new feature axis adds one real number, as in §3. A new qubit does a different thing.

If the joint state is a product, each qubit keeps its own two angles. A product state is one pure state for each qubit, with no extra link between them. Three qubits in a product are three separate points on three spheres, six free real numbers.

A general pure state of \(n\) qubits needs more than that.

The space has \(2^n\) orthogonal complex axes. There are \(2^n\) basis vectors and \(2^n\) complex weights. Each complex weight is two real numbers, so the list holds \(2 \times 2^n\) real numbers. The length of the joint arrow removes one. The global phase of the whole joint state removes one. The count of free real numbers is

\[ 2 \times 2^{n} - 2 \]
QubitsBasis vectorsComplex weightsReal numbers in the weightsFree real numbers
12242
24486
3881614

For one qubit, \(2 \times 2 - 2 = 2\). The number of complex axes and the number of angles match. That match stops at two qubits.

Two qubits have four complex axes, and a general pure state has six free real numbers. Two spheres carry four of them.

Three qubits have eight complex axes, and a general pure state has fourteen free real numbers. Three spheres carry six of them.

This state of two qubits uses the extra link:

\[ |\Phi\rangle = \frac{|00\rangle + |11\rangle}{\sqrt{2}} \]

Measure the first qubit in the 0 and 1 basis and get \(0\), and the second qubit is \(0\). Get \(1\), and the second is \(1\). Ignore either qubit. Then every yes-or-no measurement on the one you keep comes out each way half the time. Its point sits at the center of its ball. The center has no record that the two results match. The match is in the joint weights. Bell’s inequality asks what that kind of match implies.

A state that cannot be written as a product is entangled. The joint list of weights does not split into one list per qubit.

12. Eight labels for three qubits
#

The usual basis for three qubits is the list of 3-bit strings. Each string is one orthogonal direction:

\[ |000\rangle,\ |001\rangle,\ |010\rangle,\ |011\rangle,\ |100\rangle,\ |101\rangle,\ |110\rangle,\ |111\rangle \]

Eight labels. Eight basis vectors. A general pure state is one arrow in that space, a weighted sum of the eight directions:

\[ |\psi\rangle = c_{000}|000\rangle + c_{001}|001\rangle + \cdots + c_{111}|111\rangle \]

Each \(c\) is a complex weight, called an amplitude. The squared length \(|c|^2\) is the chance of that 3-bit string, if you measure in this basis. The eight chances add to 1, because the arrow has length 1.

The basis vector is the label. The amplitude is the weight on that label. The state vector is the whole list of weights. It is the same idea as §2: a vector is a mix of the basis arrows. The weights mean a different thing. On the people chart the weight is the measurement. Here the weight is an amplitude, and the measurement comes later.

13. Amplitude and energy are two lists
#

Energy is a second list, on a second basis.

The operator that stands for energy is the Hamiltonian. The vocabulary map keeps the state, the quantity you measure, and the operator as separate words. Energy is the quantity. The Hamiltonian is the operator. The state is still the list of amplitudes.

The Hamiltonian has its own orthogonal basis, the energy basis. Each vector in that basis has an energy: the value you get for sure when the state is that vector. A three-qubit space has eight of those vectors, so it has eight energy numbers. Some of them may be equal.

The same state can be written on that basis:

\[ |\psi\rangle = a_1|E_1\rangle + a_2|E_2\rangle + \cdots + a_8|E_8\rangle \]

\(|a_k|^2\) is the chance of reading the energy \(E_k\). The amplitude \(a_k\) is the weight. The energy \(E_k\) is the value on the label. They sit in two columns of the same row.

ColumnWhat it holds
Basis labelWhich result this slot names
AmplitudeThe state’s complex weight on that slot
EnergyThe Hamiltonian’s number for an energy slot

The state vector is the middle column. You read an energy from the energy column of the energy basis. The amplitude in that row is the weight for that energy.

14. Time and place
#

Time changes the state. The basis labels stay fixed.

When the Hamiltonian does not change with time, each energy-basis amplitude turns by a phase:

\[ a_k(t) = a_k(0)\, e^{-i E_k t/\hbar} \]

\(\hbar\) is Planck’s constant divided by \(2\pi\). It turns an energy times a time into an angle.

The length of \(a_k\) stays fixed, so the chance of each energy stays fixed. The phase still turns.

In the bit-string basis, the chances change when those bit strings are not the energy basis vectors. They stay fixed when each bit string is itself an energy basis vector, because then each string already has one energy. A number you follow in time is a moving amplitude, or a chance built from amplitudes.

Place belongs to a different basis. A wave function \(\psi(x, t)\) is the list of amplitudes whose label is a position \(x\). There is a label for every place, so that space is infinite. \(|\psi(x, t)|^2\) is the probability density at place \(x\) and time \(t\). Multiply it by a tiny length and you get the chance of finding the particle in that tiny interval. The value \(\psi(x, t)\) is an amplitude. The energy is the list of energy-basis values from §13. It is a separate list from the values of \(\psi\).

A three-qubit space is the finite list in §12. Its labels are bit strings. They are not places in the room, and they are not moments of time. A chip that holds the three qubits sits somewhere on the bench. That is where the device is. It is not one of the eight basis vectors.

15. The counts side by side
#

What you are countingOne pure qubitThree qubits, general pure state
Orthogonal complex axes28
Basis vectors28
Real numbers inside the weights416
Free real numbers214
Sphere coordinates \(x, y, z\)3, with one equationno single sphere holds the state
Bloch spheres that show the full state1none

One sphere shows one pure qubit. On that sphere, \(x\), \(y\), and \(z\) obey one equation, so two angles are enough. Three spheres show a product of three pure qubits, or the three local points you get by ignoring partners. The full joint state is the list of amplitudes on the eight basis vectors.

Related reading#

Hashtags
#

#Qubit #BlochSphere #QuantumComputing #QuantumMechanics #HilbertSpace #ProbabilityAmplitude #PureState #LinearAlgebra #MachineLearning #Superposition

Related

From Geometry to Quantum Mechanics
·600 words·3 mins· loading
Mathematics Research & Academia Geometry Quantum Mechanics Quantum Computing Linear Algebra Mathematics
From Geometry to Quantum Mechanics # Part 26 of the Learning Quantum Physics series. See the same …
Opening a Power: Where the Coefficients Come From
·1593 words·8 mins· loading
Mathematics Research & Academia Mathematics Mathematics for Machine Learning Mathematics for AI Applied Mathematics Algebra
Opening a Power: Where the Coefficients Come From # A power such as $(x+y)^{55}$ is 55 factors of …
The Taylor Series: Polynomials That Copy a Curve
·2592 words·13 mins· loading
Mathematics Research & Academia Mathematics Mathematics for Machine Learning Mathematics for AI Applied Mathematics
The Taylor Series: Polynomials That Copy a Curve # A calculator finds $\sin 0.5$ without a stored …
Functions, Equations, and Their Shapes
·2187 words·11 mins· loading
Mathematics Research & Academia Mathematics Mathematics for Machine Learning Mathematics for AI Applied Mathematics Geometry
Functions, Equations, and Their Shapes # A graph shows a relationship between numbers. This article …