Just as the classical computer is built on the bit, the core of quantum programming is the qubit. But what exactly is a qubit? According to the first postulate of quantum mechanics, a qubit is described by a two-element complex vector of magnitude 1.
That might sound like a mouthful, but let’s break it down. Fundamentally, a qubit is a unit of quantum information that holds more than just a 0 or a 1. It holds two complex numbers—its amplitudes—that determine its full state.
🔢 The Role of Complex Numbers
To understand a qubit, you have to get comfortable with the idea of a complex number. A complex number is essentially a pair of numbers: a real number and a special number called an imaginary number. The imaginary number is defined as the square root of -1, written as $i$. It might seem strange, but it’s a powerful tool in physics and mathematics.
Complex numbers can be visualized on a two-dimensional plane, with a real axis and an imaginary axis. This lets us think about them both algebraically and geometrically, which is a big help when things get complicated. The beauty of complex numbers in quantum mechanics is that they provide a concise and elegant way to describe the behavior of quantum objects.
📝 The Quantum State Vector
The information held within a qubit is called its quantum state. We represent this state using a mathematical object called a ket, written as $|\psi\rangle$. This is a column vector containing the two complex numbers that define the qubit’s state. For example, a qubit can be in a state $|\psi\rangle = \alpha|0\rangle + \beta|1\rangle$, where $\alpha$ and $\beta$ are the complex number amplitudes for the basis states $|0\rangle$ and $|1\rangle$.
These basis states are the quantum equivalent of the classical bits 0 and 1. The strange rule is that the sum of the squared magnitudes of $\alpha$ and $\beta$ must always equal 1. This is a fundamental law of nature, ensuring that the probabilities of measuring a 0 or a 1 will always add up to 1.
So, a qubit is not a 0 or a 1. It is a mathematical abstraction, a two-element complex vector, that lets us talk about the quantum state of a physical object. The two complex numbers in this vector define the amplitudes of its basis states. And as we will see, it’s these amplitudes that we manipulate with quantum algorithms to do our computing.
—
Glassner, Andrew. Quantum Computing: From Concepts to Code. No Starch Press, 2025.
More Topics
- The Quantum Threat: How Shor’s Algorithm Puts Modern Encryption at Risk
- Cracking the Code: How Quantum Parallelism Solves Deutsch’s Problem in One Step
- The Deutsch-Jozsa Algorithm: An Exponential Leap in Quantum Problem Solving
- The Bernstein-Vazirani Algorithm: Unmasking a Secret With a Single Query
- Simon’s Algorithm: The First Quantum Speedup That Left Classical Computers in the Dust
- Your First Quantum Program: The ‘Hello, World!’ of a Qubit
- Scaling Up: How Quantum Computers Handle Multiple Qubits