Quantum bits,
AKA “qubits”
Like bits in classical computing, qubits are the value stores of a quantum circuit. These stored values can be altered by applying quantum gates to them.
We’ll learn that qubits are mathematically simple structures, yet provide tremendous computational power. While there are multiple ways to implement physical qubits, we’re only interested in the mathematical concept of a qubit. Regardless of what method a quantum computer uses to implement its physical qubits, how they operate as a computing tools remains the same.
Perfect pairs
A qubit is just a pair of numbers. That’s it—two shiny happy number values, holding hands. Let’s call the first number “” and the second number “.” Look at this handsome couple:
We can package and together by storing them in a very small matrix that is only one unit wide and two units tall—and because this matrix is only one unit wide it is not merely a matrix, it’s also a vector. (What’s a matrix? What’s a vector? See our matrix explainer for quick refreshers on both.) So when you think of a qubit you can imagine it as a matrix containing its value on the top and its value on the bottom, like so:
Now that we know a qubit is a matrix, we also know that we can perform addition with qubits, perform multiplication with qubits, and so on—just as one can do with any matrix. (That will become rather important when we eventually introduce the idea of quantum gates, which are also matrices.)
Predictable couples
The thing that makes this pair of numbers special is their relationship to each other, which we can define as follows: multiplied by , added to multiplied by , must always equal one. We can express this as an equation:
The parentheses in the equation above are not strictly necessary as the “order of operations” rules dictate that these multiplications must be carried out prior to the additions—but emphasis can often be more helpful than brevity when learning something new. And now that we understand this relationship we can express it more compactly using exponents rather than multiplications: squared added to squared must always equal one.
A bit further below we’ll add one small wrinkle to this equation, but otherwise this is what defines a qubit. That’s it. It’s that easy.
Named couples
Let’s start plugging in values for and . Each different value combination makes a different sort of qubit. The most frequently used qubit value combinations have names and belong to a set of named vectors called Jones vectors. We’ll begin with the two simplest qubits. This first qubit is named Horizontal and the second is named Vertical. Both are composed from a zero and a one and we can see that this satisfies our qubit definition above.
to be “
0” or “OFF.”
to be “
1” or “ON.”
What does it mean to be named Horizontal or Vertical? Where do these orientation-based names come from? Are there more orientation-based names? To understand, let’s plot these two qubit vectors on a graph. We’ll use the value as our coordinate and the value as our coordinate:
Plotting and as and yields for a Horizontal qubit and for a Vertical qubit.
We can see that the values from a Horizontal qubit, when plotted as and , form a horizontal line from the origin out to . Meanwhile, when we plot the values of a Vertical qubit as and , it forms a vertical line from the origin up to . Before we introduce more named Jones vectors let’s take what we’ve learned about qubit values and generalize it for vectors with more than two elements so we can better understand what these qubit values truly mean.
State vectors
Did it seem strange to read that
the qubit we refer to as “0” begins with an
value of ?
(Or that the qubit we refer to as “1” begins with an
value of ?)
Does that mean we refer to qubits
by their values?
Is that some sort of quantum computing convention?
is considered “
0” or “OFF.”
The short answer is “No.”
To understand why,
we must recognize that
a qubit is the simplest example of a
quantum state vector—a
list of all possible states
for a quantum system to exist in,
with each possible state accompanied by the probability
that the system is indeed in that state.
When a single qubit is measured
there are only two possible states
for it to be in:
or
.
This is why a qubit is represented by a two-element vector;
one element per possible outcome.
On this very short list of possible outcomes,
is the first possible outcome
and is the second possible outcome.
When we say that a
Horizontal qubit is “0”
we’re not referring to the qubit’s
value at all.
We’re instead highlighting the fact that the
in this
pair
happens to be in the “zeroth” slot—the
slot of this
pair.
We’re saying that
for the possible outcome “0”
our qubit is voting , or TRUE.
At the same time we’re saying that
for the possible outcome “1”,
our qubit is voting , or FALSE.
For good measure let’s look at the converse example.
To further clarify—and
to hint at how a quantum circuit
functions—let’s look at a state vector
for a quantum system composed of two qubits.
With one qubit there were two possible outcomes:
0 and 1.
(And because there are only two elements of a qubit vector we named them
and
to make referring to them more convenient.)
For two qubits there are four possible outcomes:
00,
01,
10, and
11.
(We won’t bother to name elements of state vectors larger than two.
It would get unwieldy rather quickly.)
Which of those four possible outcomes
might the following state vector represent?
two qubits.
The above vector represents four possible outcomes
and we see that
three out of those four possible outcomes
are FALSE (0).
Meanwhile, the third of those four possible outcomes
is TRUE (1).
Because the result value of the third possible outcome is
10
we see that this two qubit vector state
is telling us it represents a result of
10.
Let’s break this down the same way we did
with Horizontal and Vertical qubits.
two qubits.
We’ve learned that a single qubit is the simplest example of a quantum state vector. It is a list of the votes per each possible outcome—and for a single qubit there are only two possible outcomes. We’ve also seen that we can represent the state of a multi-qubit system where there are more than two possible outcomes.
Ket notation
Paul Dirac’s “bra-ket” notation offers us a more compact means of describing quantum state vectors—and by extension, qubits. (While “bra-ket” offers us two named elements—“bra” and “ket”—for our purposes we need only focus on the latter.) Kets represent the result value that our quantum vector state represents. They are expressed as values enclosed between a vertical bar and a rightward angle bracket. The following is pronounced “ket zero.”
We began
by stating that
a Horizontal qubit
represents “0”,
and later explained why this was so.
Kets provide us a convenient way
to refer to this result state directly
as in-line text
rather than a clunky matrix.
Similarly, we defined a
Vertical qubit
as representing “1”
and illustrated this as well.
We can now also express this column vector as a ket.
The convenience of ket notation becomes more apparent as we represent state vectors that are larger than a single qubit. (For qubits we must use a state vector that has elements. Meanwhile our ket values are still just digits long.) Here we express four possible states of a two qubit system as both state vectors and their equivalent kets.
Superposition
You’ve probably heard the term
“superposition”—and along with that
you’ve likely been spoonfed some measure of mysticism;
pizza-bagels and whatnot.
In the real, physical world, superposition is indeed weird magic.
But mathematically it’s dead simple:
Superposition is any qubit state
where the
and
values are anything other than
exactly or exactly .
Up until now we’ve thought of
and
values as being either
TRUE (1) or FALSE (0)
but each is actually capable of expressing an entire spectrum between
TRUE (1) and FALSE (0).
Let’s investigate that idea by building on what we’ve already learned.
Given the constraint , if we plot all of the possible and values on a graph as and respectively, the outcome is a circle with a radius of centered at the origin ; ie. a unit circle. All possible combinations of and lay on the perimeter of this circle. To illustrate this, here’s a plot of named Jones vectors as well as their conjugates.
What the and values represent are the individual probability amplitudes for each outcome; that a qubit when measured will be in either a or a state. Measurement itself causes a qubit’s probability wave to collapse, bringing an end to its superposition. The probability that upon measurement a qubit’s probability amplitude will collapse to is , while the probability that it will collapse to is .
We already know that a Horizontal qubit exists in a state of (“ket zero”) and therefore has a 100% chance of being measured as .
Similarly, we also know that a Vertical qubit exists in a state of (“ket one”) and therefore has a 100% chance of being measured as .
Meanwhile, a Diagonal qubit exists in a state of superposition as (“ket plus”). It is a state which does not have a definite result value prior to measurement but it does of course have a definite state vector and that state vector has a positive orientation. (Recall our unit circle diagram above to see how this value lays in a positive quadrant of the graph.) There is a 50% chance of it being measured as (“ket zero”) and a 50% chance of it being measured as (“ket one”).
And finally, an
Anti-diagonal qubit
also exists in a state of superposition,
but as
What does it mean that a Diagonal qubit state and an Anti-diagonal qubit state collapse with the same probabilies? What about their conjugates which also behave in this same fashion? quantum circuits the aspects of quantum computing that quantum algorithms are engineered to take advantage of.
Complex couples
We’ve spent the majority of this primer
describing qubits as containing
Qubits are actually made of
complex number pairs,
meaning there is an imaginary component.
(See the Complex Numbers
page for a quick refresher on
real,
imaginary, and
complex numbers.)
This means one qubit is actually made of four parts:
The
To account for this we must slightly evolve
our definition of a qubit;
specifically the relationship between its
By taking the absolute values
of
Bloch sphere
And that’s really it. That’s what makes a mathematical qubit. But with that last-minute addition of complex numbers above, we can no longer visualize a qubit as a two-dimensional unit circle. Instead we must map our two complex values onto a three dimensional graph known as a Bloch sphere.
Check out our old Bloch Sphere Visualizer to see this in action.