The elementary units of information in classical computing are bits . As their name suggests, bits represent one single bit of information , which means they can take on either of two values - and - at a time.
Qubits are the quantum computing equivalent of bits. They differ from classical bits - among other things - in that they can take on a multitude of values instead of just and until that value is measured , at which point they behave just like classical bits. To explain what this means exactly, we'll need to introduce some further concepts.
Let and denote the so called basis states of a qubit that are the quantum-equivalent of classical bit states. If you look at a qubit directly to learn it's value, you'll see one of these basis states. But while you're not looking - due to it's quantum nature - the state of a qubit may be something more intricate. Generally, it can be expressed as the linear combination of the two basis states: Here, and are complex numbers that indicate the relative weight, with which the two basis states are present in this combination. More precisely, if we now look at the qubit, we'll see the basis state with a probability of and the basis state with a probability of Because these probabilities must add up to one - as and are the only possible outcomes - the equation must hold for all valid qubit states. Let's call and the measurement probabilities of the basis states.
Play around with 2 representations of a single qubit. You adjust the view of the 3D Bloch sphere by clicking on the image and dragging.
As the coefficients and are complex numbers, they can be expressed in the form and Thus, the state of the qubit can be rewritten as
Remember that is a unit vector rotated around the origin, and therefore the square of its norm also equals This means that we can modify the angles and freely without affecting the measurement probabilities. Therefore, we can do an algebraic trick to simplify the expression above. Namely, let's divide the state by to obtain By the rules of exponentiation, Next, let's introduce a new variable with the help of which the state can be further simplified to
We know that Consequently, these two numbers can also be represented geometrically as a vector of unit length, the - and -coordinates of which correspond to and , respectively. (Note that here, we don't need to use the complex plane, only a regular real plane, as both and are real numbers.) Let's define a new variable as twice the angle between this vector and the -axis. Using trigonometry, we find that and , which allows us to rewrite the state as . Notice that we now only need two variables to express the state of the qubit: the angles and Geometrically, this can be represented as another vector pointing to the surface of 3-dimensional sphere with unit radius, where is the angle of the vector and the axis, and is the angle of the vertical projection of the vector on the plane. This representation of qubit states is called the Bloch sphere .
It's important to note that of the two degrees of freedom on the Bloch sphere, only the angle is related to measurement probabilities. is an inherently quantum property called the phase that does not have any physical manifestation directly observable to us. Because of this, it's hard to find any intuitive analogy from everyday life that could help us understand what exactly the phase is. The most useful approach in this context is to look at the phase as a matematical property of quantum objects that we can leverage to design clever algorithms.
Quantum operators are functions that act on the state of a quantum system. Quantum algorithms are sequences of specific quantum operators that modify the state of single or multiple qubits. The physical device that implements quantum algorithms is called a quantum circuit , the building blocks of which are quantum logic gates that correspond to the individual operators in the sequence.
For each quantum operator, there's a corresponding matrix and the state of the qubit can be written as a vector so the algebraic representation of an operator acting on the state is essentially the matrix multiplication . For example, the Hadamard gate is represented by the matrix, which means it can transform a qubit from a state of to . This is a slightly more complicated case of thinking of matrices as linear transformations - as complex numbers are involved - but the basic principles remain the same, and hopefully one can gather a decent understanding by tinkering with the Bloch sphere and its transformations below.
Look at the how a quantum gate - expressed as a unitary matrix - transforms a Bloch sphere