Soorya Rethinasamy

What the heck is a qubit?

Quantum computing is based on the idea of using qubits to do, well, quantum computing. But what exactly is a qubit?

A qubit is a representation of a system that has some properties. There are many things that can “be” qubits, or be represented by a qubit. For example, you can make a qubit out of a charged ion, a small electric circuit, a combination of small uncharged atoms, or a single photon. An example I found useful is to think about a TV remote. A TV remote might work by using infrared light to communicate with the receiver on a TV. Or it might work by tiny ant-sized leprechauns who sing tunes in a really high register that humans can’t hear. The point is that as long I hit the volume up button and the TV gets louder, I don’t really care about the underlying mechanism. To someone who manufactures TV though, that detail is pretty important. We’re going to focus on the former, an abstract view of what a qubit is, what it’s supposed to do, and how it’s supposed to behave. As a theorist, this is my domain, and I rarely have to worry about what the qubit is actually made of. Maybe we’ll talk about how people build qubits later, if I’m up to it.

Before we reach a qubit, we talk about two-level systems. Any system that only have two settings is a two-level system. Think about a light switch or a coin. In fact you can even make a two-level system out of something that isn’t even one. The amount of water in a 500ml glass can be anything from 0 to 500. But you can define a quantity call “fullness” and say that

\[\begin{align} \operatorname{Fullness} &= 1 \text{ if glass is more than half full.} \\ \operatorname{Fullness} &= 0 \text{ if glass is less than half full.} \end{align}\]

Now, you’ve created a two-level system! In fact, all the electronics in the world are based on this idea. Voltage levels can be any real number, but if it’s below a threshold it’s considered a $0$ and above it, it’s considered a $1$. Manipulating voltage levels is how computers do all their computations. Any two-level can be represented using two values – $0$ and $1$. This representation (of which level the system is in), is called a bit. Let’s stick with coins because they are simple to understand and can generalize to “qubits” in a little bit. The advantage of using a representation is we can study a coin, and once we’re done, everything we learnt should apply to a light switch or voltages levels.

A really boring one-level system is one that is always in just one of the states. It is meaningless to flip a coin if it always lands heads up. Interesting systems can sometimes be in the state $0$ and other times in the state $1$. We typically characterize how often the system is in some state by the probability of that state. A fair balanced coin has equal probability of being either heads or tails. Mathematically, $p(0) = p(1)$. Since it’s a two-level system, no other state is possible, meaning $p(0) + p(1) = 1$. Together, this means $p(0) = p(1) = 0.5$. 50% of the time you get heads, and the other 50% of the time, you get tails. But in general, the coin might not be perfectly balanced, and let’s say that the probability of heads is $p$. Using the same idea above, the proability of tails is $1-p$.

Let’s play a game. In every turn of the game, we flip a coin. If it lands heads up, I give you 5 dollars and if it lands tails up, you give me 4 dollars. We are to play a large number of rounds. You know that I’m a crafty guy, so you suspect that the coin is rigged to land tails up more often than heads. You suspect that the probability of heads is $p$. Should you agree to play this game? In other words, for what values of $p$ do you make money as opposed to lose money? Let’s write down the exact amount you will make in the long run, called the expected reward.

\[\begin{align} \operatorname{Expected Reward} &= p(\text{Heads}) * (+5) + p(\text{Tails}) * (-4) \\ &= 5p - 4(1-p) \\ &= 9p-4. \end{align}\]

Over a long number of turns, you can expect to make $9p-4$ dollars on average per round. So when should you agree to play this game? When this is greater than 0! Which means, $9p-4 \geq 0$ or $p \geq 0.444$. So what do you do? You take the coin, turn around and flip it a large number of times and count the number of heads and tails. Using this, you figure out what $p$ is, and if $p \geq 0.444$, you agree to play the game, and walk away with a huge chunk of change. Knowing the probability of each state is usually very useful.

In this case, the coin is fully characterized by a single number $p$, the heads probability. With it, you can calculate the probability of tails and the expected reward value of any game you want. And what possible values can $p$ take? Anything from $0$ to $1$. A two-level system can always be represented by a single parameter, in this case $p$, whose value lies between $0$ and $1$. I’m going to rewrite this a bit differently, and in a bit (pun intended), it’ll be clear why. We say that a coin is characterized by two parameters $p_0$ and $p_1$, instead of just $p$. But, in addition, we add the constraint that $p_0 + p_1 = 1$. In words, the probability of heads $+$ the probability of tails is 1. This can be succinctly written as \(\mathbf{C} = p_0 \mathbf{H} + p_1 \mathbf{T}.\)

Since there are two parameters, let’s look at a 2D space, and draw what each coin looks like.

Space of all possible coins.

A bit is represented by line is 2D space. Just to hammer the point home, a possible coin is $(0.6, 0.4)$. With this coin, the above game gives a reward of $0.4 * (+5) + 0.6 * (-4) = -0.4$.

Okay okay, I know why you’re here. let’s finally talk about qubits. Some really smart people figured out that as your two-level system gets smaller and smaller, it gets weirder and weirder. TO differentiate between quantum systems and other systems, a qubit is represented with a specific notation $\vert \text{whatever you want} \rangle$. Typically, you will see things like $\vert \psi \rangle$, $\vert 0 \rangle$, $\vert 1 \rangle$, $\vert + \rangle$, etc. What goes inside is just a label.

So what makes them different as two-level systems? Instead of two real numbers (say $p_0$ and $p_1$) and a constraint on them ($p_0 + p_1 = 1$), we need two complex numbers and a different constraint.

\[\vert \psi \rangle = \alpha \vert 0 \rangle + \beta \vert 1 \rangle,\]

with the important constraint

\[\vert \alpha \vert^2 + \vert \beta \vert^2 = 1.\]

Since $\alpha$ and $\beta$ are complex numbers, adding them up directly is incorrect, we need their actual length, which is given by $\vert \alpha \vert$, and $\vert \beta \vert$. That’s half the battle. Switching from real numbers to complex numbers. What does this look like now? Instead of a point on a line in 2D space, a qubit is the point on surface of 3D sphere! (There is a slight complication that points inside the sphere also represented qubits, called mixed states, but we’ll ignore that for now). This sphere is called the Bloch sphere.

Bloch sphere with $4$ qubit states labelled.

The states $\vert 0 \rangle$ and $\vert 1 \rangle$ are along the z-axis and the states $\vert + \rangle$ and $\vert - \rangle$ are along the x-axis. These two states are defined as

\[\begin{align} \vert + \rangle &= \frac{1}{\sqrt{2}}(\vert 0 \rangle + \vert 1 \rangle),\\ \vert - \rangle &= \frac{1}{\sqrt{2}}(\vert 0 \rangle - \vert 1 \rangle). \end{align}\]

Okay, this was a lot, but here’s the really interesting part, so I’m glad you stayed. I’m sure you must have heard some version of the saying “Measuring a quantum state changes the state” or “Measurement collapses a quantum state”. Let’s look at what this means. For a classical bit, there is just one real question of measurement. For a coin, the question is “Is it heads (0) up or tails (1) up?”. That’s the only real question you can ask. For qubits, it turns out there are an infinite number of interesting questions! All you have to do is to pick any two poles to the sphere, and you can ask “is the state 0 or 1 when you measure?” And if your state is not perfectly along the north or south pole you picked, you get 0 or 1 with some probability! Let’s look at some examples to clarify this idea.

Say you have a state that is very near the $\vert 0 \rangle$ state, and you measure along the z-axis. Since the state is close to $0$, you find that the measurement gives $0$ most of the time, but sometimes, you get a $1$. The outcome for each measurement is probabilistic, and you can NEVER know beforehand. This is very different from flipping a coin, since you can technically know if you have all the information like the force of the flip, the air speed, etc. This probability is inherent to the universe, and you cannot escape it. Another example, you have the $vert 0 \rangle$ state and you measure along the x-axis. Since it is equidistant from the +x and the -x axis, you get each of them 50% of the time! The fascinating part of the measurement is that it is inherently probabilistic and after the measurement, the qubit becomes the outcome. If you got 0 (+x) in the last measurement, the state of the doesn’t stay the old state, it “collapses” to the $\vert + \rangle$ state!

The $\vert + \rangle$ is a special kind of mixture of $\vert 0 \rangle$ and $\vert 1 \rangle$, called a quantum superposition. It’s a “fancy mixture” because measusing along the z-axis gives you a 50-50 outcome, but measuring along the x-axis gives 0 100% of the time. The ability to ask different questions makes quantum superposition fascinating!

Okay fine. We’re done with the math. I promised to look at some real qubits. Take a hydrogen atom, which has one electron whizzing around a proton. If you can restrict the electron to being in either the ground state or first excited state, you make a qubit! Call the ground state $\vert 0 \rangle$ and the excited state $\vert 1 \rangle$, and you can create the $\vert + \rangle$ state, which means that the electron is in a superposition of being in the ground state or excited state. Isn’t that just swell.