Quantum Computing · Topic 1

Quantum computing basics, from qubits to algorithms

Quantum computers process information using the rules of quantum physics: superposition, interference and entanglement. This page builds every basic idea from scratch, with no physics degree required. Each concept comes with a picture, an interactive demo you can play with, and the minimal maths that makes it precise.

19 sections 4 interactive demos 7 mini-games 4 animated diagrams ≈ 90 min read

1. Why quantum computing?

Classical computers, from your phone to the largest supercomputer, store information as bits that are either 0 or 1, and change them with logic gates. They're extraordinarily good at almost everything. But some problems grow so fast with their size that no classical computer will ever solve them exactly. Simulating molecules is one example: describing 50 interacting electrons exactly needs more numbers than there are atoms in a planet.

A quantum computer stores information in qubits and manipulates it with quantum operations. For certain problems this lets it use an approach no classical machine can efficiently imitate: preparing a large superposition, then using interference so that wrong answers cancel out and right answers reinforce each other.

⚗️ Simulating nature

Chemistry, materials and drug discovery: molecules are quantum systems, so a quantum computer is a natural simulator. This is widely seen as the most likely first big win.

🔐 Cryptography

Shor's algorithm would break RSA and elliptic-curve cryptography on a large, error-corrected machine. That is why "post-quantum" cryptography is being rolled out now.

🔎 Search & optimisation

Grover's algorithm gives a quadratic speed-up for unstructured search. Heuristics for optimisation are being researched, but proven advantages there are limited.

🚫 Not a faster everything

Quantum computers won't speed up spreadsheets, web servers or video games. They are specialised accelerators for specific problem structures.

The one-sentence versionA quantum computer works with amplitudes, numbers that behave like waves, over many possible answers at once. It is useful only when an algorithm can make the amplitudes of wrong answers cancel and the right answer's amplitude grow before you look.

2. Bits vs qubits

Classical bit 0 1 always exactly one of two values reading it doesn't change it Qubit |0⟩ |1⟩ |ψ⟩ any point onthe sphere
A bit is a switch. A qubit's state is a direction, so it carries continuous information, though you can only ever read out one bit from it.

Physicists write quantum states with Dirac (bra-ket) notation. The two basis states of a qubit are written |0⟩ and |1⟩ (read "ket zero" and "ket one"). Under the hood, these are just two-dimensional column vectors:

NotationVectorMeaning
|0⟩10Like a classical 0
|1⟩01Like a classical 1
α|0⟩ + β|1⟩αβA superposition: α and β are complex numbers called amplitudes
Classical bitQubit
State0 or 1α|0⟩ + β|1⟩, with |α|² + |β|² = 1
Reading itGives the stored value; no changeGives 0 or 1 at random (Born rule) and changes the state
CopyingFreeImpossible for unknown states (no-cloning theorem)
OperationsLogic gates (AND, OR, NOT), often irreversibleUnitary gates, always reversible (except measurement)
n of them describe…One of 2ⁿ values2ⁿ complex amplitudes at once

3. Superposition and amplitudes

A qubit in superposition isn't "secretly 0 or 1 and we just don't know which". It is in a genuinely different state, described by two amplitudes α and β. Amplitudes are not probabilities: they can be negative or complex. Probabilities only appear when you measure:

The Born ruleMeasuring α|0⟩ + β|1⟩ gives 0 with probability |α|² and 1 with probability |β|². Because something must happen, |α|² + |β|² = 1 (the state is normalised).

Try it: prepare a superposition, then measure it

State:
P(0)
P(1)

The state is cos(θ/2)|0⟩ + sin(θ/2)|1⟩. At θ = 90° it's the equal superposition |+⟩.

Measurements: 0
0
0 1
0

Measure to collapse the state.

Each measurement uses a fresh, identically prepared qubit. A single result tells you almost nothing; the statistics over many "shots" reveal |α|² and |β|².

|0⟩ |1⟩ measure |0⟩|1⟩ before: 50% / 50% result 0: the state is now |0⟩ result 1: the state is now |1⟩
Measurement "collapses" the superposition: the outcome is random, and afterwards the qubit is in the state that was observed. All the amplitude information is gone.

4. The Bloch sphere: picturing one qubit

Any single-qubit state can be written using two angles:

|ψ⟩ = cos(θ/2)|0⟩ + e^{iφ} sin(θ/2)|1⟩        θ ∈ [0°, 180°],  φ ∈ [0°, 360°)

Those two angles are the latitude and longitude of a point on a unit sphere, the Bloch sphere. The north pole is |0⟩ and the south pole is |1⟩. Points on the equator are equal superpositions that differ only in their relative phase φ. Every single-qubit gate is a rotation of this sphere.

Try it: drive the Bloch vector with angles and gates

Start from:
Apply a gate (watch it rotate):
Gates applied: —
α =   β =
P(0)
P(1)

Things to try: H on |0⟩ gives |+⟩ (the equator). Then Z flips the phase to |−⟩, and the probabilities don't change at all. Apply H again and you land on |1⟩. Phase is invisible to measurement until interference converts it into probability.

Point on the sphereStateMeasured in the 0/1 basis
North pole|0⟩Always 0
South pole|1⟩Always 1
Equator, front (+x)|+⟩ = (|0⟩ + |1⟩)/√250 / 50
Equator, back (−x)|−⟩ = (|0⟩ − |1⟩)/√250 / 50, but a different state from |+⟩
Equator, ±y|±i⟩ = (|0⟩ ± i|1⟩)/√250 / 50
⚠️ Common confusionOn the Bloch sphere, opposite points are orthogonal states: |0⟩ and |1⟩ are 180° apart on the sphere, even though their vectors are at 90° in the underlying space. That's why θ/2 appears in the formula. Also, a global phase (multiplying the whole state by e^{iγ}) has no physical effect and doesn't show up on the sphere.

5. Measurement

Why this matters for algorithmsSince one run returns only n classical bits from n qubits, a useful quantum algorithm must end in a state where the answer has high probability. Simply "computing all answers in parallel" and reading one at random is useless. Interference (next section) is what makes the right answer likely.
Game · Measurement

Mystery qubit

Everyday picture: polarised sunglasses. Vertically polarised light passes a vertical filter every time, but through a diagonal filter it gets through only half the time, at random. Choosing which filter to look through is choosing a measurement basis.

Your mission: a machine prepares the same secret state every time: |0⟩, |1⟩, |+⟩ or |−⟩. Each measurement uses a fresh copy. Name the state using as few measurements as possible.

It's…

Make some measurements, then name the state.

6. Phase and interference: the real source of power

Amplitudes add like waves. Two contributions with the same phase add up (constructive interference); with opposite phases they cancel (destructive interference). Quantum algorithms are choreographed so that paths leading to wrong answers cancel.

source φ = 0 D0 D1 always clicks never clicks: the two paths cancel beam splitter ≈ H beam splitter ≈ H path Apath B
A single photon is split into a superposition of two paths (faint violet dots). When the paths recombine, the amplitudes toward D1 cancel and those toward D0 add, so D0 clicks every time. In circuit language: H · H = I.

Try it: H → phase φ → H, and watch the amplitudes add up

amplitude of |0⟩ amplitude of |1⟩ orange = path A, violet = path B (rotated by φ), green = total
P(0)
P(1)

P(0) = cos²(φ/2). At φ = 0 the |1⟩ contributions cancel; at φ = 180° (a Z gate) the |0⟩ contributions cancel instead, so H·Z·H = X.

7. Quantum gates

A quantum gate is a unitary matrix U (one with U†U = I) applied to the state vector. Unitary means it preserves total probability and is reversible: every gate can be undone. That is very different from a classical AND gate, which throws information away.

GateMatrixWhat it doesOn the Bloch sphere
X (NOT)0110|0⟩ ↔ |1⟩ (bit flip)180° about x
Y0−ii0Bit flip + phase flip180° about y
Z100−1|1⟩ → −|1⟩ (phase flip)180° about z
H (Hadamard)1/√21/√21/√2−1/√2|0⟩ → |+⟩, |1⟩ → |−⟩; creates and undoes superposition180° about the x+z diagonal
S100iQuarter-turn phase90° about z
T100e^{iπ/4}Eighth-turn phase45° about z
Rx(θ), Ry(θ), Rz(θ)e^{−iθσ/2}Continuous rotations, the dials of variational algorithmsθ about x, y or z
CNOT (2 qubits)1000010000010010Flips the target if the control is 1Creates entanglement (no single-sphere picture)

The CNOT matrix is written with the control as the first (left) qubit and basis order |00⟩, |01⟩, |10⟩, |11⟩. Qiskit lists bits in the opposite order (qubit 0 rightmost), which swaps how this matrix looks.

Game · Gates

Gate maze

Everyday picture: a Rubik's cube. Every gate is a rotation, every rotation can be undone, and there are clever shortcuts. The six dots are the six "poles" of the Bloch sphere from section 4. Reach the target in as few moves as possible.

Level 1 of 8 · Moves 0 · Fewest possible 1

8. Many qubits: the exponential state space

Two qubits have four basis states, |00⟩, |01⟩, |10⟩, |11⟩, and a general two-qubit state needs four amplitudes. Every added qubit doubles the number of amplitudes: n qubits are described by 2ⁿ complex numbers. Combining independent qubits uses the tensor product, e.g. |0⟩ ⊗ |1⟩ = |01⟩.

QubitsAmplitudes (2ⁿ)Memory to store the state classically (16 bytes each)
101,02416 KiB: trivial
30≈ 1.07 billion16 GiB: a laptop
40≈ 1.1 trillion16 TiB: a large cluster
50≈ 1.1 × 10¹⁵16 PiB: beyond most supercomputers
300≈ 2 × 10⁹⁰More numbers than atoms in the observable universe (~10⁸⁰)
Game · Many qubits

Rice on the chessboard

Everyday picture: the chessboard legend. Put one grain of rice on the first square and double it on every square after. By square 64 you'd need more rice than the world has ever grown. Each extra qubit is one more square: it doubles the numbers a classical computer must store.

Most people guess in the thousands or millions.

Amplitudes to store (2ⁿ)
Memory (16 bytes each)
That's about
Exponential state ≠ exponential output2ⁿ amplitudes don't mean 2ⁿ answers you can read. Measurement returns just n bits. The exponential space is only useful when an algorithm uses structure (interference, periodicity) to concentrate probability on the answer. Also, many specific circuits can be simulated far more cheaply than the worst case (tensor networks, Clifford simulation), which is why "quantum advantage" claims are carefully contested.

9. Entanglement

Some multi-qubit states can't be written as a product of single-qubit states. These are entangled. The classic example is the Bell state, made with just two gates:

|00⟩  —H on q0→  (|0⟩+|1⟩)/√2 ⊗ |0⟩  —CNOT(q0→q1)→  (|00⟩ + |11⟩)/√2   ← a Bell state
q0 |0⟩q1 |0⟩ H MM superpositionentangle measurement results q1 q0 = 0 0 q1 q0 = 1 1 q1 q0 = 1 1 q1 q0 = 0 0 never 01 or 10
Orange = a definite |0⟩; violet = in superposition/entangled. After the CNOT the two qubits share one state (dashed link). Each result is random, 00 or 11, but the two qubits always agree.
Bell stateMeasurement correlationMade from
|Φ⁺⟩ = (|00⟩ + |11⟩)/√2Always equalH, CNOT
|Φ⁻⟩ = (|00⟩ − |11⟩)/√2Always equal (differs in phase)H, CNOT, then Z
|Ψ⁺⟩ = (|01⟩ + |10⟩)/√2Always oppositeH, CNOT, then X
|Ψ⁻⟩ = (|01⟩ − |10⟩)/√2Always opposite (in every basis)H, CNOT, then X and Z
⚠️ Entanglement doesn't send messagesMeasuring one qubit of a Bell pair instantly tells you the other's result, even light-years away, but you can't choose the outcome, so no information travels faster than light (the no-signalling theorem). Entanglement is a resource: it powers teleportation, superdense coding, quantum key distribution and the speed-ups of quantum algorithms. Bell-test experiments show its correlations can't be explained by hidden pre-agreed values.
Game · Entanglement

The impossible quiz show

Everyday picture: two contestants in separate soundproof rooms. They can agree on a plan beforehand, but once the game starts they can't communicate. Is there a plan that wins more than 75% of the time? Classically, no. With entangled qubits, yes.

Rules: each round, a host hands Alice and Bob a random card, 0 or 1. Each answers 0 or 1. They win if their answers match, except when both get card 1: then their answers must differ. Set their plan below and play 1,000 rounds.

Alice's plan
Card 0 → answer
Card 1 → answer
Bob's plan
Card 0 → answer
Card 1 → answer

Try at least two different plans. The entangled option unlocks after that.

10. Circuit lab: build and simulate

A quantum circuit reads left to right: horizontal lines are qubits (all starting in |0⟩), boxes are gates, and the meter symbols at the end are measurements. This lab runs an exact state-vector simulation of 3 qubits in your browser.

Examples:

Basis states are written |q2 q1 q0⟩, with q0 on the right (the same convention as Qiskit). The amplitude column is what a simulator sees; a real device only ever gives you the shot counts. If the only non-zero amplitude is −1 (as after Grover), that minus sign is a global phase: physically identical to +1.

11. The rules of the game

📵 No-cloning

There's no operation that copies an unknown quantum state. You can't back up a qubit or fan it out like a classical wire. This is why quantum error correction is so different, and why quantum key distribution can detect eavesdroppers.

↩️ Reversibility

Every gate is unitary and can be undone. Only measurement (and noise) is irreversible. Classical logic inside quantum algorithms must also be made reversible, often using extra "ancilla" qubits.

👁️ Observation disturbs

Measuring, or any uncontrolled interaction with the environment, collapses superpositions. Qubits must be extremely well isolated, yet still controllable.

📡 Teleportation

With one shared Bell pair plus two classical bits, a qubit's state can be moved to a distant qubit. The original is destroyed (consistent with no-cloning), and nothing travels faster than light.

12. Noise, decoherence and error correction

Real qubits are fragile. Tiny interactions with the environment, such as heat, stray fields or vibrations, gradually destroy the quantum information. This is decoherence.

equator seen from above: phase information fades coherencetime → T₂ (≈37% left)
Dephasing (T₂) scrambles the relative phase, so the Bloch vector shrinks toward the axis. Energy relaxation (T₁) makes |1⟩ decay to |0⟩. Every gate must finish well within these times.
Error sourceWhat happensTypical metric
Energy relaxation|1⟩ decays to |0⟩T₁ time
DephasingRelative phase drifts randomly; superpositions lose coherenceT₂ time (T₂ ≤ 2T₁)
Gate errorsImperfect control pulses rotate slightly too far, or the wrong way1- and 2-qubit gate fidelity (e.g. 99.9%)
Readout errorsA 0 is reported as 1 or vice versaMeasurement fidelity
Crosstalk & leakageOperating one qubit disturbs neighbours; the state leaves the 0/1 subspaceDevice-specific

Quantum error correction

You can't copy qubits, but you can spread one logical qubit across many physical qubits so that errors can be detected without measuring the encoded data. Helper qubits measure parity checks (syndromes), which reveal where an error happened but not the logical value.

Game · Error correction

Bit-flip detective

Everyday picture: three friends passing on a phone number. If one mishears a digit, the other two outvote them. The quantum twist: you're not allowed to hear the number, because looking would destroy the quantum state. You may only ask pairs of friends "do you two agree?"

A logical bit is stored as three copies (0 → 000, 1 → 111). Noise may flip one copy. Use the two parity checks to decide which qubit to fix.

Round 1 of 8 · Correct calls 0

One copy
Three copies + majority

1 logical qubitfar lower error rate ● data qubits hold the encoded state ○ measure qubits check parities a classical decoder infers errors bigger patch → errors suppressed more, if physical errors are below threshold
A surface-code patch (simplified). The threshold theorem says that if every physical operation is better than a threshold (roughly 1% for the surface code), adding qubits makes logical errors exponentially rarer.
EraWhat it means
NISQ (Noisy Intermediate-Scale Quantum)Tens to thousands of physical qubits without full error correction. Circuits must be short; results need error mitigation and many shots.
Early fault-tolerantFirst logical qubits whose error rates improve as the code grows (experiments since 2023–2024 have shown this "below threshold" behaviour on small codes).
Fault-tolerant (FTQC)Many logical qubits running deep circuits reliably. This is needed for Shor-scale cryptanalysis and most proven speed-ups, and likely requires hundreds to thousands of physical qubits per logical qubit.

13. Quantum algorithms

AlgorithmSolvesSpeed-up vs best known classicalStatus
Deutsch–Jozsa / Bernstein–VaziraniToy "oracle" problemsExponential (or linear-to-one) in oracle queriesTeaching examples of interference
Grover's searchFind a marked item among NQuadratic: ~√N queries instead of ~N (provably optimal)Needs fault tolerance to beat classical in practice
Quantum Fourier Transform (QFT)Fourier transform of amplitudesExponentially fewer gates than a classical FFT on 2ⁿ valuesSubroutine, not a standalone speed-up
Phase estimation (QPE)Eigenvalues of a unitaryCore of Shor and of chemistry algorithmsNeeds fault tolerance
Shor's algorithmFactoring, discrete logarithmsSuperpolynomial: polynomial time vs sub-exponential classicalBreaks RSA/ECC on a large FTQC; far beyond today's machines
Hamiltonian simulationDynamics of quantum systems (chemistry, materials)Exponential for many physical systemsThe most promising long-term application
VQE / QAOA (variational)Ground states, optimisationHeuristic; no proven advantageNISQ-era experiments, hybrid with classical optimisers
HHL (linear systems)Ax = b, in a quantum-encoded formExponential only under strong conditions (data loading, readout)Many caveats; "dequantised" classical rivals exist for some cases

Grover's algorithm in one picture: start with equal amplitudes on all N items; the oracle flips the sign of the marked item's amplitude; the diffusion step reflects every amplitude about the mean, which boosts the marked one. After ~(π/4)√N rounds, the marked item dominates. With N = 4 a single round is exact, as the "Grover finds |11⟩" preset in the circuit lab shows.

Game · Grover search

Find the prize

Everyday picture: finding a name in a shuffled phone book. With no order to exploit, you check entries one by one: on average half the book. Grover's algorithm needs only about √N "looks", by repeatedly nudging probability toward the right answer.

Round 1, the classical way: a prize is behind one of 16 cards. Peek at cards one at a time.

Click cards to peek.

Round 2, the quantum way: all 16 cards start in equal superposition. The oracle flips the sign of the prize's amplitude (one "look"). Diffuse reflects every amplitude about the average, which boosts the flipped one. Repeat, then measure at the right moment. Too many rounds and it overshoots.

Oracle calls 0 · Chance of the prize if you measure now 6.3%

The bars are the simulator's view of the amplitudes; a real quantum computer can't show them to you. You only get the measurement.

14. Quantum computing and cryptography

CryptographyQuantum threatResponse
RSA, Diffie–Hellman, elliptic-curve (ECDH, ECDSA)Broken by Shor's algorithm on a large fault-tolerant machineMigrate to post-quantum algorithms
Symmetric ciphers (AES)Grover roughly halves the effective key lengthUse 256-bit keys (AES-256)
Hash functions (SHA-2, SHA-3)Modest weakeningUse adequate output sizes
Game · Quantum key distribution

Catch the spy

Everyday picture: a tamper-evident seal. You can't peel it off and stick it back without leaving a mark. A spy (Eve) can't copy a photon (no-cloning), and if she measures it through the wrong filter she scrambles it. That leaves errors Alice and Bob can spot.

How it works (BB84): Alice sends photons, each carrying a random bit through a random filter, + or ×. Bob measures each with his own random filter. Afterwards they announce only which filters they used, keep the bits where the filters matched, and compare those bits. You're the security officer: was someone listening?

Round 1 of 5 · Correct verdicts 0 · Errors in compared bits 0

15. Building qubits: the hardware

PlatformQubit is…StrengthsChallenges
SuperconductingA tiny superconducting circuit (e.g. a transmon) cooled to ~10–20 millikelvin in a dilution refrigeratorVery fast gates (tens of ns), mature chip fabricationShort coherence, wiring and cooling at scale, mostly nearest-neighbour connectivity
Trapped ionsIndividual charged atoms held by electric fields, controlled by lasersVery high fidelities, long coherence, all-to-all connectivity within a trapSlower gates (µs), scaling to many ions per trap
Neutral atomsAtoms held in optical tweezers, entangled via Rydberg statesLarge, reconfigurable arrays; atoms are identicalGate fidelity, atom loss, slower cycle times
PhotonicSingle photons in waveguides or fibreRoom-temperature components, natural for networkingPhoton loss, probabilistic entangling operations
Spin qubitsElectron or nuclear spins in silicon quantum dots or defectsTiny footprint, leverages semiconductor manufacturingUniformity and control at scale
TopologicalExotic quasiparticles (e.g. Majorana modes) designed to be intrinsically protectedPotentially much lower error ratesStill early-stage research

DiVincenzo's criteria: what any quantum computer needs

  1. Scalable, well-characterised qubitsYou know exactly what your two-level systems are, and you can add more.
  2. InitialisationReliably reset qubits to a known state such as |0⟩.
  3. Long coherence relative to gate timeMany operations must fit within T₁ and T₂.
  4. A universal set of gatesSingle-qubit rotations plus at least one entangling gate.
  5. Qubit-specific measurementRead out individual qubits accurately.

For quantum networks, two more criteria cover converting between stationary and "flying" qubits (usually photons) and transmitting them faithfully.

16. Your first quantum program (Qiskit)

Qiskit is an open-source Python SDK for building circuits and running them on simulators or real hardware. This program was run with Qiskit 2.5 (pip install qiskit):

from qiskit import QuantumCircuit
from qiskit.primitives import StatevectorSampler
from qiskit.quantum_info import Statevector

qc = QuantumCircuit(2)
qc.h(0)        # put qubit 0 into an equal superposition
qc.cx(0, 1)    # entangle: flip qubit 1 when qubit 0 is 1

print(Statevector.from_instruction(qc))     # amplitudes before measurement
print(qc.draw())

qc.measure_all()
result = StatevectorSampler().run([qc], shots=1000).result()
print(result[0].data.meas.get_counts())     # only '00' and '11', roughly 50/50
$ python bell.py
Statevector([0.70710678+0.j, 0.        +0.j, 0.        +0.j,
             0.70710678+0.j],
            dims=(2, 2))
     ┌───┐
q_0: ┤ H ├──■──
     └───┘┌─┴─┐
q_1: ─────┤ X ├
          └───┘
{'00': 476, '11': 524}
  1. BuildDescribe the circuit: qubits, gates and measurements.
  2. TranspileFor real hardware, the circuit is rewritten into the device's native gates and qubit connectivity, which adds SWAPs and changes depth.
  3. RunExecute many shots on a simulator or a quantum processor (cloud access via providers such as IBM Quantum, Amazon Braket or Azure Quantum).
  4. AnalyseTurn counts into probabilities or expectation values; apply error mitigation on real hardware.

17. Myths vs reality

MythReality
"A quantum computer tries every answer in parallel and picks the best."It evolves amplitudes over all inputs, but measurement returns one random outcome. Only interference that favours the answer makes this useful.
"Quantum computers will replace classical computers."They'll be specialised co-processors working alongside classical systems, which also handle control, decoding and pre- and post-processing.
"More qubits means more power."Quality matters as much as quantity: error rates, coherence, connectivity and the number of logical qubits decide what you can run.
"Quantum computers can solve NP-complete problems efficiently."Not believed to be true. Grover gives only a quadratic speed-up for brute-force search.
"Entanglement allows faster-than-light communication."No. Outcomes are random, and correlations only appear when results are compared over a classical channel.
"Encryption is already broken."Not by any existing machine. But "harvest now, decrypt later" makes migrating to post-quantum cryptography urgent for long-lived secrets.

Glossary

AmplitudeComplex number attached to each basis state; |amplitude|² is its measurement probability.
Basis stateA classical-looking state such as |0⟩, |1⟩ or |101⟩.
Bloch sphereGeometric picture of a single-qubit state as a point on a sphere.
Circuit depthThe number of sequential gate layers; deeper circuits suffer more noise.
Coherence time (T₁, T₂)How long a qubit keeps its energy state (T₁) and its phase (T₂).
EntanglementCorrelation between qubits that can't be described qubit by qubit.
FidelityHow close an actual operation or state is to the ideal one (1 = perfect).
Logical qubitAn error-corrected qubit encoded across many physical qubits.
OracleA black-box subroutine that marks solutions (e.g. by flipping a phase).
ShotOne execution of a circuit ending in measurement.
SuperpositionA state that is a weighted combination of basis states.
UnitaryA reversible, probability-preserving operation, i.e. a quantum gate.

Self-check quiz

Score: 0 / 0 answered

1 · A qubit is in the state 0.6|0⟩ + 0.8|1⟩. What is the probability of measuring 1?
B. Probability = |amplitude|² = 0.8² = 0.64 (and 0.6² = 0.36 for 0; they sum to 1).
2 · |+⟩ and |−⟩ give 50/50 results when measured in the 0/1 basis. How can you tell them apart?
D. They differ in relative phase. Interference (H) converts that phase difference into a measurable probability difference.
3 · What does H applied twice to |0⟩ give?
A. H·H = I. This is destructive interference in action, just like the interferometer where D1 never clicks.
4 · After H on q0 then CNOT(q0→q1), which outcomes can you measure?
C. It's the Bell state (|00⟩ + |11⟩)/√2: random but perfectly correlated.
5 · Why can't you simply copy a qubit to protect it from errors?
B. Quantum error correction measures parity checks (syndromes) that reveal errors without revealing or copying the encoded data.
6 · How many complex amplitudes describe a general state of 20 qubits?
D. Each extra qubit doubles the state space. That's why exact classical simulation hits a wall around 45–50 qubits.
7 · Which cryptography does Shor's algorithm threaten?
A. Shor solves factoring and discrete logarithms efficiently. AES is only weakened by Grover (use 256-bit keys), and ML-KEM is designed to resist quantum attacks.
8 · Grover's algorithm searches N unsorted items in roughly how many queries?
C. A quadratic speed-up, and provably the best possible for unstructured search.