Quantum superposition is the pre-measurement state in which a quantum system has multiple possible outcomes. Rather than holding one classical value, its state encodes a probability for every outcome; those probabilities sum to one. For a multi-qubit system, the outcomes are binary strings, so three qubits have eight possible measurement results. section 1.3 section 1.4.3
Figure 1.9 The steps of a quantum computation using quantum bits (qubits). The example in the diagram uses three qubits, so there are eight possible outcomes, each with a certain measurement probability represented by the filled part of the sectors. When a measurement is performed, we get one result according to the probabilities. The result is interpreted as a binary string.
Use the three-qubit computation diagram to separate the evolving distribution of eight possible outcomes from the one binary-string result returned by measurement. section 1.4.3
Measurement converts that distribution into one observed outcome. Its probability becomes 1, every other outcome’s probability becomes 0, and the observed result is the only data available from that run. Repeating the same computation reveals outcome frequencies governed by the encoded probabilities. section 1.4.3 section 1.4.4
A useful implementation model is a state table: each row represents an outcome and carries an amplitude, described as a probability with direction. Multiple nonzero amplitudes mean the system is in superposition. Quantum gates evolve this state by recombining amplitude pairs selected by a target qubit; pair members differ at that qubit’s binary position. section 1.4.4 section 4.3.3
Simulating a gate on a three-qubit state
A simulator can store eight complex amplitudes in a Python list. `transform(state, t, gate)` generates the outcome-index pairs for target qubit `t`, then `process_pair` replaces each pair with the two values produced by the gate matrix. Applying an X gate to target 0 swaps adjacent-pair amplitudes; changing the target changes which binary indices are paired. Hardware applies the gate across the state immediately, while the simulator processes pairs one at a time. section 4.3.3
Figure 4.22 Butterfly diagrams of the pairs of outcomes in a three-qubit system for targets 0, 1, and 2
Compare butterfly pairings for targets 0, 1, and 2 to see how a target qubit selects amplitude pairs across a three-qubit superposition. section 4.3.3
Superposition enables quantum parallelism: a gate changes the amplitudes for possible outcomes in parallel. This is analogous to SIMD processing, but measurement still yields only one sampled outcome. A practical use is preparing equal superposition over candidate item selections and value-register states before encoding a knapsack problem with controlled phase rotations and an inverse quantum Fourier transform. section 4.3.3 section 10.1.2
Figure 10.6 The value (rows) of each possible knapsack selection (columns)
Inspect the grid state to see possible item selections as columns and their encoded values as rows after equal-superposition preparation and value-function encoding. section 10.1.2


