No history yet

Quantum Computing Basics

What is a Qubit?

In classical computing, the fundamental unit of information is the bit. A bit is simple. It can be a 0 or a 1, like a light switch that's either off or on. There's no in-between.

Quantum computing introduces a new player: the qubit. A qubit can also be a 0 or a 1. But it can also be a combination of both states at the very same time. This is where things get interesting.

qubit

noun

The basic unit of quantum information. It's the quantum analogue of the classical bit.

To describe the state of a qubit, we use a special notation called Dirac notation. The state 0|0\rangle represents a definite 0, and 1|1\rangle represents a definite 1. The real power of a qubit comes from its ability to exist in a superposition of these two states. We can write the general state of a qubit, which we'll call |\[psi\]\rangle (psi), like this:

ψ=α0+β1|\psi\rangle = \alpha|0\rangle + \beta|1\rangle

Here, α\alpha and β\beta are special numbers called probability amplitudes. They tell us the probability of finding the qubit in the 0|0\rangle state or the 1|1\rangle state when we measure it. Specifically, the probability of measuring 0 is α2|\alpha|^2, and the probability of measuring 1 is β2|\beta|^2. Since these are the only two possibilities, the probabilities must add up to 1.

α2+β2=1|\alpha|^2 + |\beta|^2 = 1

A great way to visualize a qubit's state is with the Bloch sphere. Think of a globe. A classical bit can only be at the North Pole (0|0\rangle) or the South Pole (1|1\rangle). A qubit, however, can be represented by a vector pointing to any point on the surface of that globe. This gives it far more room to store information.

Superposition and Entanglement

Two of the most powerful and counterintuitive ideas in quantum computing are superposition and entanglement. They are what give quantum computers their edge.

Superposition is the principle we just touched on. It's a qubit's ability to be in a combination of states at once. Think of a spinning coin. While it's in the air, it's not definitively heads or tails; it's a blend of both possibilities. Only when it lands (when we measure it) does it settle into one state. A qubit in superposition is like that spinning coin.

Superposition allows a quantum computer to explore many possibilities simultaneously. A system of N qubits can represent 2^N states all at once, an exponential advantage over classical bits.

Entanglement is even stranger. It's a special connection that can link two or more qubits. When qubits are entangled, their fates are intertwined, no matter how far apart they are. If you measure the state of one, you instantly know the state of the other.

Albert Einstein famously called this "spooky action at a distance." For example, imagine two entangled qubits prepared so that if one is measured as 0|0\rangle, the other must be 1|1\rangle, and vice versa. If you take one qubit to the moon and measure it, you'll instantly know the state of the one left on Earth. This perfect correlation is a key resource in quantum algorithms.

Another fundamental principle of quantum computing is entanglement, a phenomenon where two or more qubits become interconnected in such a way that the state of one qubit directly affects the state of another, regardless of the distance between them.

Quantum Gates and Measurement

So, how do we manipulate these qubits? We use quantum gates. Just as classical computers use logic gates like AND, NOT, and OR to process bits, quantum computers use quantum gates to alter the state of qubits. These gates are the building blocks of quantum algorithms.

A sequence of quantum gates applied to a set of qubits is called a quantum circuit. Let's look at two fundamental gates.

Lesson image

The Hadamard (H) gate is one of the most important. Its job is to create superposition. If you apply an H gate to a qubit in the 0|0\rangle state, it transforms into an equal superposition of 0|0\rangle and 1|1\rangle. If you apply it again, it reverts back to the original 0|0\rangle state.

The Controlled-NOT (CNOT) gate acts on two qubits: a control qubit and a target qubit. It flips the state of the target qubit if and only if the control qubit is in the 1|1\rangle state. Otherwise, it does nothing. The CNOT gate is crucial for creating entanglement between qubits.

GateSymbolAction
HadamardHPuts a qubit into a superposition state.
CNOTFlips the target qubit if the control qubit is $

After a series of gate operations, the final step is measurement. This is the act of looking at a qubit to see if it's a 0 or a 1. Measurement is a critical, and tricky, part of quantum computing.

When we measure a qubit that's in a superposition, its state collapses. It randomly picks one of the classical states, 0|0\rangle or 1|1\rangle, based on the probability amplitudes (α2\|\alpha|^2 and β2\|\beta|^2) we saw earlier. Once measured, the quantum superposition is lost, and the qubit behaves just like a classical bit. A quantum algorithm is carefully designed so that when we finally measure, the state we want is the one with the highest probability of appearing.

Now that you've got a handle on the basic building blocks, let's test your knowledge.

Quiz Questions 1/5

What is the primary difference between a classical bit and a qubit?

Quiz Questions 2/5

The state of a qubit is described by the expression ψ=α0+β1|\psi\rangle = \alpha|0\rangle + \beta|1\rangle. What must be true about the probability amplitudes, α\alpha and β\beta?

These concepts, qubits, superposition, entanglement, and gates, form the foundation of all quantum computation.