No history yet

Quantum Superposition

The Idea of 'And'

In classical computing, a bit is a simple switch: it's either 0 or 1. There's no in-between. Quantum mechanics, however, operates differently. A quantum bit, or qubit, can exist in a combination of states simultaneously. This property is called superposition.

Think of a spinning coin. While it's in the air, it's not definitively heads or tails. It's in a state that encompasses both possibilities. Only when it lands and we measure it does it collapse into a single, definite outcome. A qubit in superposition is like that spinning coin. It holds the potential for being a 0 and a 1 at the same time.

Superposition allows a quantum system to exist in a linear combination of multiple states until it is measured.

The Maths of Many States

We represent the state of a qubit using a notation called Dirac notation, or ket notation. The two basis states, equivalent to a classical 0 and 1, are written as 0|0\rangle and 1|1\rangle. A qubit in superposition is described as a linear combination of these two states.

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

The probability of measuring the qubit as a 0 or a 1 is determined by the square of the magnitude of its amplitude. For the state to be valid, the sum of these probabilities must equal 1.

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

So, if α=12\alpha = \frac{1}{\sqrt{2}} and β=12\beta = \frac{1}{\sqrt{2}}, then α2=12|\alpha|^2 = \frac{1}{2} and β2=12|\beta|^2 = \frac{1}{2}. This means there is a 50% chance of measuring a 0 and a 50% chance of measuring a 1.

Superposition in Action

Superposition is what gives quantum computers their immense potential. Since one qubit can represent both 0 and 1, a system of nn qubits can represent 2n2^n states all at once. This ability to process a vast number of possibilities simultaneously is known as quantum parallelism.

To create a superposition, we use quantum gates. The most fundamental of these is the Hadamard gate.

Lesson image

The Hadamard gate takes a qubit in a definite state (0|0\rangle or 1|1\rangle) and puts it into an equal superposition. If you apply it to a qubit in the 0|0\rangle state, you get a new state where the probabilities of measuring 0 or 1 are equal.

H0=12(0+1)H|0\rangle = \frac{1}{\sqrt{2}}(|0\rangle + |1\rangle)

Applying it to a 1|1\rangle state also creates an equal superposition, but with a crucial difference in phase.

H1=12(01)H|1\rangle = \frac{1}{\sqrt{2}}(|0\rangle - |1\rangle)

One of the earliest and clearest demonstrations of quantum parallelism is the Deutsch-Jozsa algorithm. This algorithm determines whether a given function is 'constant' (always returns 0 or always returns 1) or 'balanced' (returns 0 for half the inputs and 1 for the other half).

A classical computer would need to check, in the worst case, more than half of the inputs to be certain. Thanks to superposition, a quantum computer can solve this problem in a single operation. It uses Hadamard gates to prepare the input qubits in a superposition of all possible input values, then evaluates the function just once on this superposition state.

Lesson image
Quiz Questions 1/5

What is the defining characteristic of a qubit in a state of superposition?

Quiz Questions 2/5

A qubit is in the state ψ=350+451|\psi\rangle = \frac{3}{5}|0\rangle + \frac{4}{5}|1\rangle. What is the probability of measuring the qubit and finding it in the 1|1\rangle state?