Quantum computing processes information with qubit systems whose states assign an amplitude, or probability with direction, to every possible outcome. Rather than manipulating ordinary variables and bits, quantum instructions change pairs of amplitudes in parallel; measurement then produces the only available output from a run. section 1.4.4 section 2.5
Figure 1.14 The steps of a quantum computation using three qubits. During the computation, we can change the probabilities by applying quantum computing instructions. When a measurement is performed, we get one outcome according to the encoded probabilities.
A computation starts from a qubit state, applies instructions that reshape outcome probabilities, and ends by measuring one binary-string outcome. section 1.4.4
With n qubits, a run can produce one of 2ⁿ binary strings. Each qubit supplies one digit, so registers can encode variables much as groups of classical bits do. Repeating the same computation yields measured outcomes whose frequencies reflect the encoded probabilities; many algorithms aim to raise the probability of desired outcomes before measurement. section 2.2.1 section 2.2
Quantum computing is useful when its probability-based computation can improve a specific task over a classical approach:
- Transform and signal-processing work, where a quantum Fourier-transform implementation is presented as requiring far fewer operations than FFT. section 1.0
- Binary optimization, where amplitudes can be amplified to make desired solutions more likely to be measured. section 2.5
- Sampling probability distributions, searching for desired outcomes, and estimating outcome probabilities. section 1.6
Knapsack as a quantum computation
A knapsack solution can use separate quantum registers for item selection, total value, and total weight. The program prepares an initial qubit state, changes it with instructions, measures one candidate binary string, and repeats runs to collect outcomes. This frames optimization as increasing the chance of measuring a desirable selection. section 2.2.1 section 2.2
Quantum advantage means any improvement over a classical computer for the same computation, not a blanket replacement for classical systems. Practical applications are expected to be specialized computations used with classical computing, so evaluating whether a problem benefits from a quantum, classical, or hybrid approach is central. section 1.1 section 12.1

