In this brief tutorial on quantum mechanics & quantum computing you will learn what a qubit is, why qubits can be in superposition states, where the randomness in quantum mechanics comes from, how entanglement is created, why quantum error correction is necessary, and how simple quantum algorithms are constructed.

You can then apply these concepts with our interactive quantum circuit designer that allows you to run simple quantum programs on our servers which simulate a quantum computer (no account required!).

## Prerequisites

This primer on quantum mechanics & quantum computing targets a general audience with high-school-equivalent background in mathematics. No academic degree in physics required.

The mathematical tools needed to understand and apply quantum mechanics are actually not too complicated. To provide perspective: all required mathematical concepts are taught in the first two semester of a typical study program in physics, mathematics, or informatics. Quantum mechanics draws heavily from both analysis (integrals, differential equations, …) and linear algebra (vectors, inner products, …). To describe quantum computers on an abstract level (to write “quantum programs”) linear algebra is sufficient.

If you have learned about the following concepts, you are ready to go:

## Meta-Knowledge

As a layperson (in this context: non-physicists), it is often hard to assess the status of scientific statements: are we talking about speculations, hypotheses, widely accepted theories, or well-tested observations? This “knowledge about knowledge” or “meta-knowledge” is just as important as the knowledge itself. To prevent misconceptions in this regard, here a few “meta-knowledge” facts about the knowledge you can learn in this tutorial:

• The tenets of quantum mechanics, with all their quirks and counterintuitive phenomena, are by now a well-established, extensively tested theory. This is as good as it gets as there is nothing better than a working theory in science. This means in particular: The formalism explained below is learned (in a more mathematical fashion) by every undergrad student of physics around the globe, just as you learn adding and multiplying numbers at school. From a physicist’s perspective, it’s not a fancy or “esoteric” field of study (it is certainly interesting, though).
• Non of the predictions of quantum mechanics presented below are hypothetical. All of them have been experimentally verified multiple times in laboratories all over the world. Seemingly “strange” quantum phenomena like superposions, entanglement, quantum teleportation, etc., are by now standard tools in laboratories (some even in advanced lab courses and/or commercial devices). Creating an entangled pair of photons is for an experimental quantum physicist like mixing a salad dressing is for a professional chef: It’s nice that you can produce it with consistent quality, it is certainly useful for your job, but it’s nothing to brag about.
• The predictive power of the rules of quantum mechanics, in their precise mathematical form, perfectly match experiments. We trust these equations just as much as engineers trusts the laws of classical mechanics to construct airplanes. Consequently, we can use them to engineer “quantum machines” like a quantum computer. So if you ask how a specific quantum phenomenon can be theoretically modeled and explained, you most likely will be given a precise answer.
• The situation is very different if, instead of how, you ask why a certain phenomenon is the way it is. The question why entanglement exists in our universe, and why quantum mechanics is a probabilistic theory at its core, are important and deep questions that should be asked. You will not find answers to these questions below, because, as of now, there is no consensus in the scientific community what the correct answers are. There are hypotheses, untested theories, that draw rough pictures of what quantum mechanics really tells us about the world we live in — but these are hypothetical and not clearly backed by experiments. In this sense, quantum mechanics is a highly useful theory as it stands, but it might be replaced by another, deeper theory in the future. Thus there is still fundamental work to be done and new features of our world to be discovered.
• Luckily, an engineer does not need to know a deeper reason for gravity (like the general theory of relativity) to build a functioning airplane; understanding Newton’s laws of classical mechanics is completely sufficient. For the same reason, we are not hindered by the fact that we cannot explain why quantum mechanics is the way it is on our quest to build a quantum computer.

## From Vectors to Qubits

### A simplified picture

Qubits are the elementary carriers of information of a quantum computer. They play the same role as the bits stored on the solid state drive (SSD) of your notebook which are processed by its central processing unit (CPU) to make fun stuff happen (like printing these letters on your screen). Similarly, a quantum computer must be able to store qubits on a “quantum harddrive” (this is called a quantum memory) and to manipulate qubits on some sort of “quantum CPU” (a quantum processor). The goal of the QrydDemo project is to build such a quantum processor, where each qubit is encoded by a single atom and the manipulations are done by hitting these atoms with lasers (see Platform for more details).

When you think about the bits whizzing around in your notebook, you typically do this in an abstract way: they are just “things” with two possible states (1 or 0); you completely ignore what exactly these two states are (like: high/low voltage in wires, but up/down magnetization on the disc of a harddrive). Why? Because it is a useful abstraction for writing programs! The same is true for programming quantum computers: While the “quantum engineers” (that’s us) who build a quantum processor must be aware of how the qubits are implemented, the “quantum programmer” who uses the quantum computer to run “quantum software” can safely ignore these details and think of qubits as abstract pieces of quantum information. In the following, we will speak about qubits and the things we can do with them in this abstract way. This abstract level to talk about quantum mechanical systems is called quantum information theory.

But what is a qubit, abstractly speaking? One often hears that “a qubit is like a classical bit that can be 0 and 1 at the same time” – but what does that actually mean? Whenever words are to vague to explain things, mathematics comes often to the rescue.

Let us start with a fancy classical bit. Instead of “0” and “1”, we use the two vectors$$0\leftrightarrow\vec e_0 = \begin{pmatrix} 1\\0\end{pmatrix} \qquad\text{and}\qquad 1\leftrightarrow\vec e_1 = \begin{pmatrix}0\\1\end{pmatrix}$$ to label the two states of the bit. There are two immediate questions: Why are we allowed to do this, and why should we do it? The answer to the first question is simple: “0” and “1” are just labels to refer to two states of a system, and we are free to choose different labels, for instance $\vec e_0$ and $\vec e_1$. The answer to the second question seems to be: We shouldn’t! Writing $\vec e_0$ is clearly more cumbersome than just “0”. But remember that we would like to come up with a thing that can be in two states at once. There is no natural way to combine “0” and “1” to something “in between”; but there is for vectors: We can scale and add vectors to form new vectors, a procedure called linear combination!

The most general linear combination of our two “bit vectors” is the vector
$$\vec v =\alpha\cdot\vec e_0+\beta\cdot\vec e_1= \begin{pmatrix} \alpha\\\beta\end{pmatrix}$$ with arbitrary coefficients $\alpha,\beta\in\mathbb{R}$. For $\alpha=1$ and $\beta=0$ it is $\vec v = \vec e_0$ (the “0”), while for $\alpha=0$ and $\beta=1$ it is $\vec v=\vec e_1$ (the “1”). But for, say, $\alpha =0.2$ and $\beta=-0.8$, $\vec v$ is neither $\vec e_0$ nor $\vec e_1$; it is as if $\vec v$ has a bit of both $\vec e_0$ and $\vec e_1$ at the same time! We can therefore put forward the following hypothesis:

The state of a single qubit is described by a two-dimensional vector $\vec v$.

This is correct, but we missed one point. The vector that describes the state of a qubit must have length 1:$$|\vec v |=\sqrt{\alpha^2+\beta^2}\stackrel{!}{=}1$$Why, you ask? Well, this has to do with what happens if we “look” at the qubit, a process called measurement.

• A qubit is a two-dimensional vector of length 1. It is not a classical bit that is in an unkown state 0 or 1.
• The components of the vector are called (probability) amplitudes and can be negative.
• Only the squares of the amplitudes are positive and are interpreted as the probabilities to measure the qubit in a particular state.
• The potential negativity of amplitudes allows for interference – a core feature of quantum mechanics.
• The speedup of quantum computers relies on the interference of amplitudes.

Beware:
The vector $\vec v\in\mathbb{R}^2$ is not a vector in real space, like, e.g., the accelaration vector $\vec a$ of a particle. It is an abstract pair of real numbers that describes the state of a system, rather like the pair $(P,T)$ of pressure $P$ and temperature $T$ describes the property of the air in your room.

### Measurements

If you think about it, our hypothesis that the state of a qubit is described by a two-dimensional vector $\vec v$ isn’t very “quantum”. After all, there are many classical systems that can be described by two-dimensional vectors: The direction and strength in which the wind blows or the magnetic field of the earth points to can both be described in this way — and there is nothing quantum about them. To put it differently: So far our qubit seems to be a bit like a little compass needle that can point in different directions $\vec v$. The quantumness enters the stage when we measure the qubit. In classical physics, there is a one-to-one correspondence between states and observations: Systems in different states look differently when we measure them. At first, this statement seems tautological: isn’t it the sole purpose of different states to describe the different observations we can make? In classical physics, yes; in quantum mechanics, no! When you measure a qubit, it does not look like a compass needle pointing in the direction $\vec v$; it looks like a classical bit pointing in either $\vec e_0$ or $\vec e_1$ and nothing in-between. The probabilities of either result depend on the state $\vec v$, and, as it turns out, are given by the squares of the coefficients of the vector:
$$\vec v = \alpha\,\vec e_0+\beta\,\vec e_1 \;\xrightarrow{\;\text{Measurement}\;}\; \vec v_\mathrm{new}=\begin{cases} \vec e_0 &\text{with probability}\; p_0=\alpha^2\\ \vec e_1 &\text{with probability}\; p_1=\beta^2\\ \end{cases}$$Here, $\vec v_\mathrm{new}$ denotes the new state of the qubit after the measurement.

This rule, which has been confirmed by hundreds of quantum mechanical experiments by now, was formulated by the German physicist Max Born and is thus called the Born rule. Let us summarize the three important (and unintuitive!) features of a quantum mechanical measurement:

1. The outcome of the measurement is discrete (either $\vec e_0$ or $\vec e_1$) although the quantum state $\vec v$ can point in any direction (= is continuous). This emergent discreteness is called quantization and responsible for the name “quantum” in “quantum mechanics”.
2. The measurement outcomes are probabilistic: $\vec e_0$ and $\vec e_1$ are measured randomly with probabilities $p_0$ and $p_1$ (which depend on $\vec v$). This is the famous randomness of quantum mechanics which Albert Einstein didn’t like (see below).
3. The quantum state is changed by the measurement, i.e., the state changes from $\vec v$ to either $\vec e_0$ or $\vec e_1$, depending on the measurement outcome. In quantum mechanics, measurements are thus not passive observations (like in classical physics), but affect the system that is observed! This phenomenon is known as wave function collapse.

The Born rule also explains why the vector $\vec v$ must have length 1 (mathematicians call such a vector normalized): Probabilities must add up to 1; hence, since we interpret the squares of the coefficients as probabilities, they also must add up to 1; but this sum is nothing but the length of $\vec v$ squared:$$p_0+p_1\stackrel{!}{=}1 \quad\Leftrightarrow\quad |\vec v|^2=\alpha^2+\beta^2\stackrel{!}{=}1 \quad\Leftrightarrow\quad |\vec v|\stackrel{!}{=}1$$

There is a very convenient way to parametrize such vectors: They correspond exactly to the points on a circle of radius 1 (a unit circle). But a point on the circle can be described by a single angle $\theta$, where the components (amplitudes) of the vector are given by the two trigonometric functions sine and cosine:
$$\vec v =\cos(\theta)\,\vec e_0+\sin(\theta)\,\vec e_1= \begin{pmatrix}\cos(\theta)\\\sin(\theta)\end{pmatrix} \quad\text{for}\quad 0\leq \theta < 2\pi$$This vector is automatically normalized for all $\theta$ because $\sin^2(\theta)+\cos^2(\theta)=1$. So one should think of the “state space” of a qubit as a circle, where states closer to the x axis are more likely to be measured in $\vec e_1$, and states closer to the y axis more likely collapse to $\vec e_0$.

Let us summarize what we learned so far:

The state of a single qubit is described by a two-dimensional vector$$\vec v=\begin{pmatrix}\alpha\\\beta\end{pmatrix}$$ of length $|\vec v|=\sqrt{\alpha^2+\beta^2}=1$.

If the qubit is measured, it is found either in state$$\vec e_0=\begin{pmatrix}1\\0\end{pmatrix}$$with probability $p_0=\alpha^2$, or in state$$\vec e_1=\begin{pmatrix}0\\1\end{pmatrix}$$with probability $p_1=\beta^2$.

The measurement changes the state of the qubit and is probabilistic. Max Born formulated the Born rule: The probability to measure a qubit in one of its two states is given by the square of the corresponding amplitudes. The quantum state of a qubit is described by a point on the unit circle, i.e., a two-dimensional vector $\vec v$ of length 1. Under a measurement, it “collapses” either on $\vec e_0$ or $\vec e_1$ with probabilities $p_0$ and $p_1$ given by the squares of the amplitudes $\alpha$ and $\beta$.

Beware:
Measuring is often sloppily referred to as “looking at” or “observing” the qubit. However, according to the standard interpretation of quantum mechanics, the measurement process does not have to involve a conscious being (like you) observing the qubit. A measurement in the quantum mechanical sense is any interaction with a macroscopic (measurement) apparatus. So pointing a laser at a qubit and recording its state with a digital camera counts as measurement (even if you do not look at the taken picture).

The change of the qubit state by measuring it — the wave function collapse — is a fundamental principle of quantum mechanics. The fact that the outcome is undetermined until the measurement is performed (and only probabilities can be predicted) makes quantum mechanics an inherently probabilistic theory, a fact that vexed Albert Einstein who exclaimed that “God does not play dice […].” However, in the days since Einstein, experiments of physicists all over the world repeatedly confirmed the predictions of quantum mechanics, and clearly indicate that nature is somewhat of a gambling addict. To fathom the philosophical ramifications of the probabilistic measurement outcomes completely, one must be very clear about the type of randomness we are talking about: If you put a coin in a cup, shake, and put the cup upside down on the table, you have no clue whether the coin landed head or tail until you lift the cup and look. You could say the coin is like a qubit in that you can only predict the probabilities of head and tail when lifting the cup. This analogy is false, though! The difference is that although you do not know whether the coin landed head or tail when the cup hides it, the coin of course landed either head or tail. The probability just reflects your lack of knowledge of the real state of the coin (you could use the X-ray apparatus you happen to have beneath the table to look through the table and check this!). For all we know — and there are ingenious experiments known as Bell tests that support this — the probabilities predicted by quantum mechanics are not consequences of you, the observer, not knowing the “real” state of the qubit before a measurement. The “real” state of the qubit is $\vec v$ until you measure it; and by measuring it you actively change its state on the fly to either $\vec e_0$ or $\vec e_1$. This interpretation of quantum mechanics — known as Copenhagen interpretation — is the most widely held view among quantum physicists (there are contenders known as hidden-variable theories that require a lot of “conceptual gymnastics” to fit experimental results).

At the QRydDemo project, we are no philsophers of science, we are “quantum engineers” who want to build a quantum computer. But still we are affected by this inherent randomness: Whenever a quantum computer performs transformations on its qubits, we have to measure them at the end to extract the outcome of the algorithm. The results we get will be randomly distributed according to some probabilities. This means that quantum algorithms must be run several times (on the order of hundreds to thousands) so that all collected results can be averaged. These averages (whis approximate the probabilities predicted by quantum mechanics) are then the real result of the quantum computation. The different runs of the same algorithm to collect data for the averaging are called “shots” in quantum computing parlance. Albert Einstein commented “God does not play dice […]” when confronted with the randomness of measurement results in quantum mechanics. However, experiments (so called Bell tests) demonstate that nature does play dice.

### Quantum physics notation

If you previously encountered a text on quantum mechanics, you may wonder why none of the above formula look familiar. The reason is that physicsts (more precisely: Paul Dirac) invented a fancy notation for vectors:
$$\vec v\rightarrow\ket{\Psi} \quad\text{and}\quad \vec e_0\rightarrow\ket{0} \quad\text{and}\quad \vec e_1\rightarrow\ket{1}$$The linear combination above then looks like$$\ket{\Psi}=\alpha\ket{0}+\beta\ket{1} \qquad\text{with}\qquad \alpha^2+\beta^2=1$$and is called the quantum state (or wave function) of a single qubit. The numbers $\alpha$ and $\beta$ describe the state completely and are called (probability) amplitudes. A vector of the form $\ket{…}$ is called a ket.

Rephrased in this new notation, a point on the unit circle describes the quantum state $\ket{\Psi}$ of a single qubit, and the unit vectors that define the two axes are $\ket{0}$ and $\ket{1}$. The projections of $\ket{\Psi}$ onto the axis are the amplitudes $\alpha$ and $\beta$.

To be fair: this change of notation is not just to make quantum mechanics “look fancy.” There is a deep mathematical reason why this is a very convenient notation, but this goes far beyond this tutorial. (The notation is called Dirac- or bra-ket notation; the mathematical reason is known as Riesz representation theorem and has to do with how inner products are calculated in this formalism.)

We will stick to this notation in the following because it makes it easy to generalize quantum states to many qubits. Paul Dirac, one of the founding fathers of quantum mechanics, introduced the Dirac notation $\ket{\Psi}$ for vectors that describe quantum states.

### Many qubits

So far we only talked about a single qubit. Just as a computer that can store a single bit is very useless, a quantum computer with a single qubit is nothing to be proud of. To make quantum computers shine, we need many qubits. Two immediate questions arise: How to describe the quantum state of many qubits, and how many is “many” to make a quantum computer useful?

To answer the first question, we must let go of the possibility to visualize the different states many qubits can have; the image of a circle motivated above really only works for a single qubit. The mathematical formalism of linear combinations of vectors, however, carries over to as many qubits as we like. If we follow the concepts of measurements in quantum mechanics, we should expect that if we measure $N$ qubits, we will get a result that looks like $N$ bits, where each bit can be either in state “0” or in state “1”. We write such a quantum state (vector!) where $N$ bits are in the states $x_i\in\{0,1\}$ ($i=1,2,\dots,N$ labels the qubits) as $$\ket{\Psi}=\ket{x_1,x_2,\dots,x_N}=\ket{x_1x_2\dots x_N}\,.$$ In the last expression we dropped the commas to simplify the notation. How many such “classically looking” states are there? Well, there are clearly $2^N$ possible configurations that $N$ bits can have, so that’s how many.

For example, if we consider only $N=2$ qubits and measure them, we will find one of the $2^2=4$ states$$\ket{00},\;\ket{01},\;\ket{10},\;\ket{11}\,.$$Remember that for a single qubit the two states $\ket{0}$ and $\ket{1}$ were simply fancy names for two orthogonal vectors of length 1. The same is true for the four vectors above (or the $2^N$ vectors for $N$ qubits)! But, you say, there are no more than 3 orthogonal vectors in our three-dimensional space, where does the fourth one point to? Well, you have been warned that one can no longer visualize the state space of many qubits. Now you know why: To describe the states for two qubits, one needs a four-dimensional space $\mathbb{R}^4$. In general one needs an $2^N$ dimensional space $\mathbb{R}^{(2^N)}$ for $N$ qubits. Remember that the state vector $\vec v$ (or $\ket{\Psi}$) of qubits is not a vector in our space, but a rather abstract “collection of numbers”. Thus there is nothing inherently problematic about higher-dimensional spaces to describe many qubits. The mathematics of linear algebra really doesn’t care about how many dimensions you have. The only bad thing is that we can no longer imagine how a quantum state “looks like”. But that’s the great strength (and beauty) of mathematics: Whether we can visualize something or not is not important, we can always do abstract calculations with it!

The abstract expressions we are interested in as quantum physicists are superpositions (or linear combinations) of course. After all, that is what quantum mechanics is all about. The most general linear combination of the four basis vectors for $N=2$ qubits is simply$$\ket{\Psi}=\alpha\ket{00}+\beta\ket{01}+\gamma\ket{10}+\delta\ket{11}$$where the four real numbers $\alpha,\beta,\gamma,\delta\in\mathbb{R}$ are our new amplitudes. Because two qubits can be observed in four different states, we now have just as many amplitudes. The Born rule also generalizes in a straightforward way: The probability to measure the two qubits in the state $\ket{00}$ is given by $p_0=\alpha^2$, in state $\ket{01}$ it is $p_1=\beta^2$, in state $\ket{10}$ it is $p_2=\gamma^2$, and in state $\ket{11}$ it is $p_3=\delta^2$. Since the four probabilities must sum up to 1, the “normalization constraint” is now$$\alpha^2+\beta^2+\gamma^2+\delta^2\stackrel{!}{=}1\,.$$In the four dimensional space $\mathbb{R}^4$ to which $\ket{\Psi}$ belongs, this is still equivalent to the requirement that $\ket{\Psi}$ has lenght 1. We see that once you let go of , there is actually not that much fancy stuff

• To describe the quantum state of $n$ qubits, one needs $2^n$ real amplitudes.
• Storing a single amplitude approximately in a classical computer requires 8 bytes of memory. Storing the quantum state of $100$ qubits therefore requires $2^{100}\cdot 8 = 10^{19}$ terabyte of storage! Richard Feynman proposed to build a quantum computer to cope with the exploding resources needed to simulate quantum states of many qubits.

### Manipulating qubits

By now, you know how a quantum state of many qubits can be described, and what it tells us about the probabilities when we measure the qubits. But how do we prepare an arbitrary quantum state $\ket{\Psi_\mathrm{final}}$ in the first place? Well, this is actually the main purpose of a quantum computer:
$$\ket{\Psi_\mathrm{initial}}= \underbrace{\ket{0\dots 0} \;\xrightarrow{\;\text{Do something?}\;}\;\ket{\Psi_\mathrm{final}} }_{\text{The hard part!}} \;\xrightarrow{\;\text{Measure all qubis}\;}\; \begin{cases} \ket{0\dots 0}&:\,p_0=\,?\\ \ket{0\dots 1} &:\,p_1=\,?\\ &\vdots \\ \ket{1\dots 1} &:\,p_{2^n}=\,? \end{cases}$$

TODO

• Operations that change the state of qubits are called quantum gates.
• Quantum gates can be thought of as rotations in high-dimensional vector spaces because rotations do not change the length of vectors.

You are now ready to program a quantum computer!

Or you can hone your theoretical skills further and proceed below …

### The complete picture (Optional)

The above picture of a qubit as two-dimensional vector of length one is almost correct. The only simplification was that the coefficients (the amplitudes) $\alpha$ and $\beta$ were taken to be real numbers $\mathbb{R}$, while in reality they are complex numbers $\mathbb{C}$. This makes the state space of a proper qubit harder (but not impossible) to visualize. None of the examples in this tutorial require this additional structure, so that you can skip this optional part if you like. (The complex number are essential for an efficient formulation of quantum mechanics, though.)

A complex number $\alpha$ can be written as$$\alpha = \alpha_r+i\cdot \alpha_i$$with real part $\alpha_r\in\mathbb{R}$ and imaginary part $\alpha_i\in\mathbb{R}$ (yes, the imaginary part is a real number!). The symbol “$i$” denotes the imaginary unit; it is formally defined by the property $i=\sqrt{-1}$ so that $i^2=-1$. The space of complex numbers is labeled by $\mathbb{C}$.

Calculations with complex numbers simply follow from the distributive and associative laws together with $i\cdot i =-1$. For example, adding two complex numbers yields$$\alpha+\beta=(\alpha_r+i\cdot\alpha_i)+(\beta_r+i\cdot\beta_i)=\underbrace{(\alpha_r+\beta_r)}_{\gamma_r}+i\cdot\underbrace{(\alpha_i+\beta_i)}_{\gamma_i}=\gamma$$and their product is$$\alpha\cdot\beta=(\alpha_r+i\cdot\alpha_i)\cdot(\beta_r+i\cdot\beta_i)=\underbrace{(\alpha_r\beta_r-\alpha_i\beta_i)}_{\delta_r}+i\cdot\underbrace{(\alpha_r\beta_i+\alpha_i\beta_r)}_{\delta_i}=\delta\,.$$Hence one can think of complex numbers as a generalization of real numbers with modified rules for multiplication and addition.

The cool thing about complex numbers is that every polynomial equation has a solution (mathematicians call this algebraically closed)! For example, the equation$$x^2=-1$$ has no solution in the real numbers, but it has two complex solutions: $x_1=+i$ and $x_2=-i$. For this and other reasons, both in mathematics and physics, complex numbers $\mathbb{C}$ are the “standard type” of numbers used for the description of many problems, just as the real numbers $\mathbb{R}$ are the “standard numbers” used in school.

Quantum mechanics is no exception. Therefore the most general quantum state of a qubit can be written as
$$\ket{\Psi}=\alpha\ket{0}+\beta\ket{1}=\begin{pmatrix}\alpha\\\beta\end{pmatrix}$$where the two amplitudes $\alpha,\beta\in\mathbb{C}$ are now complex numbers. You cannot visualize this vector as “pointing” in some direction in a two-dimensional space (the deeper reason for this is that complex numbers, unlike real numbers, cannot be ordered from small to large numbers). For example, where would you say the complex vector$$\begin{pmatrix}i\\0\end{pmatrix}$$ points to? (I have no clue.) This makes the true quantum states less intuitive than the simplified real ones from above, but not less rigorous – we can still do calculations with them!

The condition that the vector must have length 1 now reads$$|\alpha|^2+|\beta|^2\stackrel{!}{=}1$$ where $|\alpha|=\sqrt{\alpha_r^2+\alpha_i^2}$ is called the modulus (or absolute value) of the complex number $\alpha$. Note that $\alpha^2$ does note make sense in the above equation because we want this to be a positive real number (to interpret it as a probability); but for $\alpha=i$ we would get $\alpha^2=-1$, which we cannot read as a probability. By contrast, $|\alpha|^2=\alpha_r^2+\alpha_i^2=0+1^2=1$ is perfectly positive and real.

• A qubit is a two-dimensional vector of length 1. It is not a classical bit that is in an unkown state 0 or 1.
• The components of the vector are called (probability) amplitudes and can be negative.
• Only the squares of the amplitudes are positive and are interpreted as the probabilities to measure the qubit in a particular state.

Do we gain anything by replacing real amplitudes with complex ones? The answer is yes: the space of possible states that a qubit can have becomes in some sense larger when using complex amplitudes. So we should expect that the different states of a qubit can no longer be visualized as a simple unit circle. They can, however, be visualized by a sphere of radius 1, the so called Bloch sphere. To understand how this is possible (it is not obvious!), we first have to state a beautiful equation called Euler’s formula:$$e^{i\varphi}=\cos(\varphi)+i\cdot \sin(\varphi)$$Here $\varphi\in\mathbb{R}$ is an arbitrary real number, $i$ is again the imaginary unit, $\sin$ and $\cos$ are the trigonometric functions, and $e=2.718\dots$ is a very special real number called Euler’s number (it shows up all over mathematics).

TODO

When following mathematical arguments like the ones that led us here, one can easily loose contact to reality and forget what we actually want to achieve. The use of complex amplitudes that gives rise to the Bloch sphere as the state space of a qubit is so far just a (beautiful) mathematical concept. But in the end we want to use mathematics to describe the actual qubits stored in the orbitals of the electrons in our atoms. Do we really need all this unintuitive complexity (pun intended) to describe their states? The clear answer is: Yes! We can change the states of our qubits in ways that cannot be described by real amplitudes. The states of our qubits really are described by points on the Bloch sphere, and not by points on a unit circle. This tells us a very important lesson: Complex numbers are not just inventions of mathematicans, they are, in some sense, the natural language needed to describe nature.