Learn

Quantum Computing Basics

Classical computers process information as bits, each either 0 or 1. Quantum computers process information as qubits, which follow the laws of quantum mechanics. For certain problems, such as factoring large numbers and simulating molecules and materials, quantum algorithms are known that outperform the best known classical methods. Other areas, including optimization, are still being researched. For most everyday computing, classical computers remain the right tool.

At Phi₀ we work on the hardware side of quantum computing: superconducting circuits, cryogenic electronics, and the systems that bring them together.

How does a quantum computer work?

Qubits: beyond 0 and 1

A classical bit is either 0 or 1. A qubit can be in a superposition of 0 and 1, described by two complex amplitudes. When the qubit is measured, the result is 0 or 1, with probabilities given by the squared magnitudes of those amplitudes, and the superposition is gone. The amplitudes also carry a phase. A classical bit has nothing like it, and the relative phase between amplitudes is what makes interference possible.

A qubit can be prepared in a superposition of 0 and 1; each measurement gives a single result. The sphere is a schematic picture of the qubit state.

Entanglement

When qubits are entangled, their joint state cannot be described qubit by qubit. For suitable entangled states, measurements along several different directions show correlations that no pair of classical objects carrying pre-agreed values could produce. Bell tests compare such measurement settings and have confirmed this. Each individual result is still random, so entanglement cannot be used to send signals faster than light.

For a maximally entangled pair, how often the results agree depends on the angle between the measurement directions. Compared across a chain of small angles, the agreement exceeds what any pre-agreed values allow, as Bell tests have confirmed.

Interference

Quantum algorithms are designed so that the amplitudes leading to wrong answers largely cancel each other, while those leading to the right answer add up. This makes the right answer likely, though not always certain, so a computation may be repeated. Interference is what turns superposition and entanglement into a useful result.

Waves in phase add up and waves out of phase cancel. In quantum algorithms, interference acts on probability amplitudes; the wave picture is an analogy.
Sixteen waves of equal amplitude: with their phases spread evenly they cancel, and as the phases line up their sum grows into one large wave. Quantum algorithms adjust phases so that the amplitude of the desired result grows; the wave picture is an analogy.
Grover search over eight candidates: after two rounds, the probability of measuring the target rises from 12.5% to 94.5% (ideal model).

Gates and circuits

Quantum gates change the state of qubits, much as logic gates do for classical bits. A Hadamard gate turns a qubit that starts in 0 or 1 into an equal superposition. A CNOT (controlled-NOT) gate flips a target qubit only when a control qubit is 1, and can create entanglement between suitably prepared qubits. Phase gates change the relative phase between 0 and 1. Sequences of gates form quantum circuits that run algorithms.

Why the state space matters

In general, the state of n qubits is described by 2ⁿ amplitudes:

  • 10 qubits: 1,024 amplitudes
  • 20 qubits: about one million amplitudes
  • 50 qubits: about one quadrillion amplitudes

Storing all of them takes memory that doubles with every added qubit: about 17 GB at 30 qubits and about 18 petabytes at 50, at 16 bytes per amplitude. Some circuits can still be simulated efficiently with other methods, but in general the cost grows exponentially. This does not mean that a quantum computer tries every answer at once: a measurement returns only n bits, and an algorithm must use interference to make the right answer likely.

A closer look

A fair coin and a qubit in superposition can give exactly the same measurement results. The difference is in how the possible outcomes are linked. In each grid, the rows and columns list the possible outcomes. The diagonal squares are the probabilities, and they add up to 1. The other squares are not probabilities: a colored square means the two outcomes have a fixed phase relationship (coherence), so they can interfere, adding up or cancelling like waves. A Hadamard gate turns the qubit state |+⟩ into 0 every time, while a coin stays 50/50. Classical randomness leaves these squares empty.

One qubit

Classical
A fair coin
0 or 1, probability ½ each
01
0½
1½
Quantum
|+⟩
superposition of 0 and 1
01
0½
1½

Three qubits

Classical
Three coin flips
each of the 8 outcomes with probability ⅛
000001010011100101110111
000⅛
001⅛
010⅛
011⅛
100⅛
101⅛
110⅛
111⅛
Quantum
|+⟩ ⊗ |+⟩ ⊗ |+⟩
superposition, not entangled
000001010011100101110111
000⅛
001⅛
010⅛
011⅛
100⅛
101⅛
110⅛
111⅛

Three qubits, correlated

Classical
Either 000 or 111
one of the two, probability ½ each
000001010011100101110111
000½
001
010
011
100
101
110
111½
Quantum
(|000⟩ + |111⟩) / √2
GHZ state, entangled
000001010011100101110111
000½
001
010
011
100
101
110
111½
  • diagonal: probability of each outcome (adds up to 1)
  • colored off-diagonal: coherence, a fixed phase relationship between two outcomes; they can interfere (not a probability)
  • empty: zero

Read out as 0s and 1s, each pair gives the same results. Only the quantum states have colored squares off the diagonal (coherence): they show which outcomes can interfere, like the waves above. That is what a quantum computer uses.

The Grover example above searches the same eight outcomes and starts from |+⟩ ⊗ |+⟩ ⊗ |+⟩. Its first step flips the phase of the target: the probabilities stay the same and only the off-diagonal squares change. The second step turns that phase difference into a higher probability for the target.

Where quantum computers may help

  • Chemistry, materials and medicine: simulating molecules, catalysts, battery materials and molecular interactions in drug discovery at the quantum level
  • Finance and logistics: optimization and risk analysis are being studied; known speedups are modest, and a practical advantage has not yet been shown
  • Security: a large fault-tolerant quantum computer running Shor’s algorithm could break RSA and elliptic-curve cryptography. NIST published its first post-quantum cryptography standards (FIPS 203, 204 and 205) in August 2024.
  • Machine learning: quantum-enhanced algorithms are an active research area; a practical advantage has not yet been shown

Example: finding a hidden period

Shor’s algorithm factors large numbers by finding a hidden period. The two animations below show the idea on the number 15.

Shor's idea on a small example: the remainders of powers of 7 divided by 15 repeat every 4 steps, and the period gives the factors of 15. For large numbers, no efficient classical method is known for finding the period.
The quantum Fourier transform turns a periodic state into peaks that reveal the period; classical post-processing turns the measured hint into the period (ideal 16-position example).

Further reading

← All Learn guides