Q-Universitiesqplaylearn

QUANTUM COMPUTING THE SOFT WAY

The Qubit

Let us begin by familiarizing with the concept of Qubit as Quantum Physicist Roberta Zambrini, from the Institute of Crossdisciplinary Physics and Complex Systems (IFISC) in Palma de Mallorca (Spain), would explain it to her grandma!

What is a bit?

From "Quantum Computing for the very curious" by Andy Matuschak and Michael Nielsen.

As you know, in ordinary, everyday computers the fundamental unit of information is the bit. It’s a familiar but astonishing fact that all the things those computers do can be broken down into patterns of 0s and 1s, and simple manipulations of 0s and 1s. For me, I feel this most strongly when playing video games. I’ll be enjoying playing a game, when I’ll suddenly be hit by a realization of the astounding complexity behind the imaginary world visible on my screen:

0AD_EgyptianPyramids

Copyright Wildfire Games, used under a Creative Commons Attribution-Share Alike 3.0 license

Underlying every such image is millions of pixels, described by tens of millions of bits. When I move the game controller, I am effectively conducting an orchestra, tens of millions strong, organized through many layers of intermediary ideas, in such a way as to create enjoyment and occasionally sheer delight.

I’ve described a bit as an abstract entity, whose state is 0 or 1. But in the real world, not the world of mathematics, we must find some way of storing our bits in a physical system. That can be done in many different ways. In your computer’s memory chips, bits are most likely stored as tiny electric charges on nanometer-scale capacitors (i.e., little reservoirs of charge), just above the surface of the chip. Old-fashioned hard disks take a different approach, using tiny magnets to store bits. Furthermore, different types of memory use different types of capacitor; different types of hard disk use different approaches to magnetization.

For the most part you don’t notice these differences when you use your computer. Computer designers work very, very hard to make the details of the physical instantiation of the bits invisible not just to the user, but also (often) invisible even to programmers. Many programmers never think about whether a bit is stored in fast on-microprocessor cache memory, in the dynamic RAM chips, or in some type of virtual memory (say, on a hard disk). There are exceptions – programmers working on high-performance programs sometimes do think about these things, to make their programs as fast as possible. But for many programmers it doesn’t much matter how bits are stored. Rather, they can think of the bit in purely abstract terms, as having a state which is either 0 or 1.

From bits to qubits

In a manner similar to the way conventional computers are made up of bits, quantum computers are made up of quantum bits, or qubits. Just like a bit, a qubit has a state. But whereas the state of a bit is a number (0 or 1), the state of a qubit is a vector. More specifically, the state of a qubit is a vector in a two-dimensional vector space. This vector space is known as state space. For instance, here’s a possible state for a qubit:

$$\left[ \begin{array}{c} 1 \\ 0 \end{array} \right].$$

That perhaps sounds strange! What does it mean that the state of a qubit is a two-dimensional vector? We’re going to unpack the answer slowly and gradually. You won’t have a single epiphany where you think “ahah, that’s what a qubit is!” Rather, you’ll gradually build up many details in your understanding, until you get to the point where you’re comfortable working with qubits, with quantum computations, and more generally with quantum mechanics.

One way qubits are similar to bits: we’ve said absolutely nothing about what the qubit actually is, physically. Maybe the state of the qubit is being stored somehow on an electron, or a photon, or an atom. Or maybe it’s being stored in something stranger, perhaps inside some exotic particle or state of matter, even further removed from our everyday experience.

For our purposes in this course none of this matters, no more than you should worry about what type of capacitor is storing the bits inside your computer’s RAM. What you should take away is that: (a) qubits have a state; (b) much like a bit, that state is an abstract mathematical object; but (c) whereas a bit’s abstract state is a number, 0 or 1, the state of a qubit is a 2-dimensional vector; (d) we call the 2-dimensional vector space where states live state space.

Connecting qubits to bits: The computational basis states

Let’s get back to understanding qubits. I’ve described what the state of a qubit is, but given no hint about how (or whether) that’s connected to the state of a classical bit. (Henceforth we’ll use the phrase “classical bit” instead of “conventional bit”, after “classical physics”). In fact, there are two special quantum states which correspond to the 0 and 1 states of a classical bit. The quantum state corresponding to 0 is usually denoted $|0\rangle$. That’s a fancy notation for the following vector:

$|0\rangle := \left[ \begin{array}{c} 1 \\ 0 \end{array} \right].$

This special state $|0\rangle$ is called a computational basis state.

It’s tempting to see the $|0\rangle$ notation and wonder what all the separate pieces mean – what, for instance, does the $| $ mean; what does the $ \rangle $ mean; and so on?

In fact, it’s best to regard $|0\rangle$ as a single symbol, standing for a single mathematical object – that vector we just saw above, $\left[ \begin{array}{c} 1 \\ 0 \end{array} \right]$. The $| $ and $ \rangle $ don’t really have separate meanings except to signify this is a quantum state. In this, $|0\rangle$is much like the symbol 0: both stand for a single mathematical entity. And, as we’ll gradually come to see, a quantum computer can manipulate $|0\rangle$ in ways very similar to how a conventional computer can manipulate 0.

This notation with ∣ and ⟩ is called the ket notation, and things like $|0\rangle $ are called kets. But don’t be thrown off by the unfamiliar terminology – a ket is just a vector, and when we say something is a ket, all we mean is that it’s a vector.

That said, the term ket is most often used in connection with notations like $|0\rangle$. That is, we wouldn’t usually refer to $\left[ \begin{array}{c} 1 \\ 0 \end{array} \right]$ as a ket; we’d call it a vector, instead. If you’re a fan of really sharp definitions and strict consistency, this may seem vague and wishy-washy, but in practice doesn’t cause confusion. It’s just a convention to be aware of!

Alright, so $|0\rangle$is a computational basis state for a qubit, and plays much the same role as 0 does for a classical bit. It won’t surprise you to learn that there is another computational basis state, denoted $|1\rangle$, which plays the same role as 1 does for a bit. Like $|0\rangle$, $|1\rangle$ is just a notation for a two-dimensional vector, in this case:

$|1\rangle := \left[ \begin{array}{c} 0 \\ 1 \end{array} \right].$

Again, we’ll gradually come to see that $|1\rangle$ has all the properties we expect of the 1 state of a classical bit.

General states of a qubit

The computational basis states $|0\rangle$ and $|1\rangle$ are just two possible states for a qubit. Many more states are possible, and those extra states endow qubits with capabilities not available to ordinary classical bits. In general, remember, a quantum state is a two-dimensional vector. Here’s an example, with a graphical illustration emphasizing the vector nature of the state:

cbs-1x

In this example, the state $0.6|0\rangle+0.8|1\rangle$ is just 0.6 times the $|0\rangle$ vector, plus 0.8 times the $|1\rangle$ vector. In the usual vector notation that means the state is:

$$ 0.6|0\rangle + 0.8 |1\rangle = 0.6 \left[ \begin{array}{c} 1 \\ 0 \end{array} \right] + 0.8 \left[ \begin{array}{c} 0 \\ 1 \end{array} \right] = \left[ \begin{array}{c} 0.6 \\ 0.8 \end{array} \right].$$

I’ve been talking about quantum states as two-dimensional vectors. What I didn’t yet mention is that in general they’re complex vectors, that is, they can have complex numbers as entries. Of course, the example just shown has real entries, as do the computational basis states. But for a general quantum state the entries can be complex numbers. So, for instance, another quantum state is the vector

$$\frac{1+i}{2} |0\rangle + \frac{i}{\sqrt{2}} |1\rangle ,$$

which can be written in the conventional component vector representation as

$$\left[ \begin{array}{c} \frac{1+i}{2} \\ \frac{i}{\sqrt{2}} \end{array} \right]$$

Because quantum states are in general vectors with complex entries, the illustration above shouldn’t be taken too literally – the plane is a real vector space, not a complex vector space. Still, visualizing it as a plane is sometimes a handy way of thinking.

I’ve said what a quantum state is, as a mathematical object: it’s a two-dimensional vector in a complex vector space. But why is that true? What does it mean, physically, that it’s a vector? Why a complex vector space, and how should we think about the complex numbers? And what’s a quantum state good for, anyway?

Generalizing a bit the notion of quantum state, which in general is introduced not only for qubits but for any state of quantum particles, let's see from this video how we can explain it to our grandma!

Let’s now get familiar with some more nomenclature commonly used for quantum states.

One of the most common terms is superposition. People will say a state like $0.6|0\rangle+0.8|1\rangle$ is a superposition of $|0\rangle$ and $|1\rangle$. All they mean is that the state is a linear combination of $|0\rangle$ and $|1\rangle$. You may wonder why they don’t just say “linear combination” (and sometimes they do), but the reason is pretty much the same reason English-speakers say “hello” while Spanish-speakers say “hola” – the two terms come out of different cultures and different histories.

Another common term is amplitude. An amplitude is the coefficient for a particular state in superposition. For instance, in the state $0.6|0\rangle+0.8|1\rangle$ the amplitude for $|0\rangle$ is 0.6, and the amplitude for $|1\rangle$ is 0.8.

We’ve learnt that a quantum state is a two-dimensional complex vector. Actually, it can’t be just any old vector, a fact you might have guessed from the very particular amplitudes in some of the examples above. There’s a constraint. The constraint is this: the sums of the squares of the amplitudes must be equal to 1.

So, for example, for the state $0.6 |0\rangle+0.8 |1\rangle$ the sum of the squares of the amplitudes is $0.6^2+0.8^2$, which is $0.36+0.64 = 1$, as we desired.

For a more general quantum state, the amplitudes can be complex numbers, let’s denote them by $\alpha$ and $\beta$ so the state is $\alpha|0\rangle+\beta|1\rangle$. The constraint is now that the sum of the squares of the amplitudes is 1, i.e., $|\alpha|^2+|\beta|^2 = 1$. This is called the normalization constraint. It’s called that because if you think of $|0\rangle$ and $|1\rangle$ as orthonormal vectors, as I drew them earlier,

cbs_redux-1x

then the normalization constraint is the requirement that the length of the state is equal to 1. So it’s a unit vector, or a normalized vector, and that’s why this is called a normalization constraint.

Summing up all these ideas in one sentence: the quantum state of a qubit is a vector of unit length in a two-dimensional complex vector space known as state space.

We’ve gone through a few refinements of this sentence but that sentence is the final version – there’s no missing parts, or further refinement necessary! That’s what the quantum state of a qubit is. Of course, we will explore the definition further, deepening our understanding, but it will always come back to that basic fact.

One common gotcha in thinking about qubits is to look at the $|0\rangle$ state and think it must be the zero vector in the vector space, often denoted 0. But that’s not right at all. The zero vector is at the origin, $0 = \left[ \begin{array}{c} 0 \\ 0 \end{array} \right]$, while the $|0\rangle$ vector is quite different, $|0\rangle = \left[ \begin{array}{c} 1 \\ 0 \end{array} \right] \neq 0$. It’s just an unfortunate notational accident that $|0\rangle$ looks as though it should be the 0 vector. Fortunately, in practice this distinction is easy to get used to, and doesn’t cause confusion. But it’s worth noting.

The Bloch Sphere

A useful way of visualizing qubits is the following geometrical representation. 

Since $|\alpha|^2+|\beta|^2=1$, we can rewrite the state of the qubit as 

$$|\Psi\rangle=e^{i\gamma}\left(\cos{\frac{\theta}{2}}|0\rangle+e^{i\varphi}\sin{\frac{\theta}{2}}|1\rangle\right)\,,$$

where $\gamma,\theta$ and $\varphi$ are all real numbers. Notice that, while it may apparently seem that $|\Psi\rangle$ is identified by four degrees of freedom, as $\alpha$ and $\beta$ are both complex numbers, the normalisation condition reduces this number to three. Moreover, since in Quantum Physics there is no way of detecting observable effects due to overall phases, we can ignore the factor $e^{i\gamma}$ and assume $\alpha$ to be real, yielding to

$$|\Psi\rangle=\cos{\frac{\theta}{2}}|0\rangle+e^{i\varphi}\sin{\frac{\theta}{2}}|1\rangle\,.$$

The numbers $\theta$ and $\varphi$ can be identified as coordinates on a sphere (or, more precisely, a sphere with radius equal to 1), as shown in the figure:

Bloch_sphere2-1

This is the famous Bloch sphere, which can be exploited to visualise single-qubit states and often helps to illustrate ideas about quantum computation and information, since it can be easily used to represent graphically the operations that can be performed on single qubits. However, it must be kept in mind that this intuition is limited because there is no simple generalization of the Bloch sphere known for multiple qubits.

A classical bit could only be at the North Pole or at the South Pole, where the states $|0\rangle$ and $|1\rangle$ are (notice however that this choice of the polar axis is completely arbitrary). A qubit state can be instead represented by any point on the surface, i.e., it can lie anywhere on the sphere.

In other words, the surface of the sphere represents the state space of the qubit states, which is indeed a two-dimensional complex vector space. Its two local degrees of freedom can be then identified by the two angles $\theta$ and $\varphi$.  

© QPlayLearn 2020