A state table is a tabular view of a quantum state. Each row represents a possible measurement outcome; columns expose information associated with that outcome, such as its amplitude, magnitude, direction, and probability. It turns a compact state vector—a list of complex numbers—into a form that is easier to inspect visually. section 3.0 section 3.1.1
For a single qubit, the table has two outcome rows, 0 and 1. An amplitude is a complex number associated with each outcome. Its magnitude indicates the amplitude bar length, its direction can be represented by color, and its squared magnitude gives the probability of that outcome. Because squared magnitudes sum to 1, probabilities form a valid distribution. section 3.1.1
A useful expanded state table commonly includes:
- Outcome index, optionally shown in decimal and binary form. section 3.1.1
- Amplitude, stored as a complex number for that outcome. section 3.1.1
- Direction and magnitude of the amplitude. section 3.1.1
- Probability, computed as magnitude squared. section 3.1.1
Build an expanded table from a Python state list
Given a list such as state = [a0, a1], create one row per index. For each amplitude state[k], calculate direction with atan2(state[k].imag, state[k].real), magnitude with abs(state[k]), and probability with abs(state[k]) ** 2. Round display values separately so the stored state remains intact. The resulting rows connect each outcome index to its amplitude and derived properties. section 3.1.3
The same pattern generalizes to n qubits. There are 2ⁿ possible outcomes, so the state list and table contain 2ⁿ rows. List indices match integer outcomes, while each row can present either amplitudes directly or probabilities and directions. A valid simulated state has a power-of-two list length and squared amplitude magnitudes totaling 1. section 4.2.2 section 4.6
Figure 3.9 The expanded state table for the example state encoded in Python
Inspect an expanded single-qubit table that aligns outcome indices with complex amplitudes, directions, magnitudes, and probabilities computed in Python. section 3.1.3
