What is a Qubit?
The classical bit
The bit that we all are familiar with, is the most basic unit of information. It either represents a 1 or a 0. We can think of it as analogous to a switch being on or off. A bit’s current status, either 1 or 0, is known as its state.
The value of the bit being 1 or 0 are just abstractions. In reality, it is just a transistor, the building block of all modern computers. When the transistor allows the passage of current through it we consider this event to represent the 1 and when the transistor blocks the passage of current we consider this event to represent the 0.
You might remember this circuit diagram of a transistor from your physics lessons in the past.
The quantum bit
The quantum bit can represent 0, 1, or both simultaneously. This seems quite counter-intuitive. What does it mean to be two different things simultaneously? This phenomenon is called superposition. We will come back to this in a future lesson about quantum mechanics. For now, we just need to accept that it’s possible to be 0 and 1 at once.
The quantum transistor
A qubit can be built using any two-level quantum system. An example could be a phosphorus atom within a silicon superconductor. There are multiple ways to build a qubit. Unlike the transistor for classical computing, we still haven’t figured out the best way to build a perfect qubit. This is an important ongoing research area, and quantum computing is still very much in its initial stages.
Don’t worry if these words sound new to you. In this course, we will not go into the hardware and implementation details of quantum systems.
The first takeaway here is that the superposition of 0 and 1 is not some third possible state of a bit. It is a special state that we cannot describe by using a classical bit. Let’s see why it is so special.
Let’s introduce some notations to distinguish quantum states from classical states. We will represent the 0 state in quantum as “” and the 1 state as “”. We will study this notation formally in the next lesson.
Think of a slider moving between the values from 0 to 1. A superposition of 0 and 1 means our current state is somewhere on the slider, it could be a little more towards the 0 side, or it could be a little more towards the 1 side. We see from this slider analogy that there are infinitely many possible states that we can call “being both 0 and 1 at the same time”.
We can think of such a quantum state as a whole, with some part being a 0 and the remaining part of it being a 1. Let’s try to capture this concept using our new notation. We can write a superposition state as a combination of and in the form of . We’ll discuss why it is written like this in further detail in the next lesson.
An equal superposition state would mean 50% of the qubit is a 0 and the other 50% of it is a 1. Using this way, we can think of the state to be 100% 0 and 0% . Similarly, we can say the state is 0% 0 and 100% 1.
In the next lesson, we will look at quantum states formally, and hopefully, we’ll be able to wrap our heads around it by having this knowledge about superposition in mind.
The heart of classical computing is the logical operations on strings of numerous 1s and 0s. Everything that we can achieve with our computers today is made possible by simple arithmetic, and logical operations on binary numbers represented using these bits.
As we studied earlier, a bit is just the passage of current through a transistor. We can manipulate the state of a bit by using different combinations of transistors connected to each other. We call them gates.
We should know of the logic gates that can perform logical operations such as AND, OR, NOT, XOR, etc. By applying them to bits, we can change their state according to the desired operation.
A combination of these gates together on one or more bits constitutes a circuit. An example of a circuit is a 4-bit adder. This circuit can take 2 binary numbers represented by 4-bits each and produce their sum as the output. A full adder also handles the resultant carry in the output.
Like classical computation, we use operations that manipulate the state of the qubit to perform meaningful quantum computation. A qubit can have a multitude of different states. So these operations are quite different from classical logic operations. One of the key differences is that all these operations have to be reversible.
A simple way to understand reversibility is to apply the classical NOT gate to the same bit twice. It will revert to its original state when the NOT gate is applied. Consequently, you should also see why the classical AND gate is not reversible.
Quantum gates have the power to perform all the operations that the classical logic gates can perform and do even more than that. A good example, for now, is the gate, also known as the quantum NOT gate. The gate can change the state of a qubit from to and vice versa.
The quantum circuit
A quantum circuit consists of a combination of multiple quantum gates applied on some qubits.
It is possible to create a quantum circuit for a simple 4-bit adder as well, but it will be quite inefficient because we need to apply many quantum gates to simulate classical AND and XOR gates.
Our main reason for using quantum circuits is to solve problems that classical circuits struggle with. They’re not here to replace classical computing.
An example of a useful quantum circuit is a Bell Circuit. It produces an entangled pair of qubits. Don’t worry about understanding what this means for now. We’ll come back to this in a future lesson. Regardless, this circuit uses two quantum gates: the controlled-NOT gate, also known as the gate, and the Hadamard Gate . The gate can be thought of as the quantum version of the classical gate. We’ll look at the Hadamard Gate in a future lesson.