liveBook · Manning

Quantum amplitude

As explained in Building Quantum Software with Python

A quantum amplitude is a complex-valued coefficient of a quantum state whose squared magnitude determines an outcome probability and whose phase carries directional information.

A quantum amplitude is the value attached to one possible measurement outcome in a quantum state. Unlike an ordinary probability, it has both magnitude and direction: amplitudes are conveniently represented as complex numbers, or visually as arrows. The probability of an outcome is the squared magnitude of its amplitude; direction does not directly determine how often that outcome appears in repeated measurements. section 2.2.2 section 1.4.2

A one-qubit state has two amplitudes, one for outcome 0 and one for outcome 1. An n-qubit state has one complex amplitude for each of its 2ⁿ binary outcomes. Valid states are normalized: the sum of every amplitude’s squared magnitude equals 1. This makes the squared magnitudes a complete probability distribution for measurement. section 3.1 section 4.2.2

A “clock” representation of a quantum state and the unit color wheel
sidebar figure

Use the clock view to distinguish an amplitude’s length from its direction; both describe the state, while squared length supplies the measurement probability. section 3.1.1

Represent amplitudes in Python as complex-number lists:

  • Store a single-qubit state as two entries, where each index is its corresponding outcome. section 3.1.3
  • Use abs(amplitude)**2 to calculate an outcome probability, and verify that their sum is 1. section 3.1.3
  • Use atan2(amplitude.imag, amplitude.real) when a state table needs an amplitude direction in radians. section 3.1.3
  • For multiple qubits, use a list of 2ⁿ complex values indexed by the integer form of each outcome. section 4.2.2

Encoding a one-qubit state

The list [sqrt(0.3), -sqrt(0.7)] assigns amplitudes to outcomes 0 and 1. Their squared magnitudes are 0.3 and 0.7, so repeated measurement samples 0 with probability 0.3 and 1 with probability 0.7. The negative second amplitude has a direction of 180°, showing information that probabilities alone omit. section 3.1.3

Quantum gates operate by recombining pairs of amplitudes while preserving the pair’s combined probability. Computation therefore changes amplitudes rather than merely selecting a result. For optimization-style tasks, amplitude amplification aims to raise the probability of desired outcomes; measurement then samples one binary-string outcome from the resulting distribution. section 3.2 section 2.5

Uniform amplitudes across three qubits

Starting from [1, 0, 0, 0, 0, 0, 0, 0], applying a Hadamard gate to each of three qubits produces eight equal real amplitudes, approximately 0.35355. Equal magnitudes give every three-bit outcome the same probability. section 4.3.4

How Building Quantum Software with Python covers it

How deep it goes
Explains complex representation, magnitude, direction, normalization, list encoding, and gate updates, while deferring detailed amplitude analysis.
Examples
Uses single-qubit complex lists, a negative real amplitude, state tables, and Hadamard-created uniform three-qubit amplitudes.
What it assumes
Teaches amplitudes through visualizations and Python while referring unfamiliar complex-number details to an appendix.
What you can do after
Build it from scratch as normalized Python lists of complex values and derive outcome probabilities from squared magnitudes.
How it connects
Connects quantum amplitudes to quantum states, quantum gates, quantum measurement, Hadamard gates, and amplitude amplification.

Also explained in

Compare how 2 books explain quantum amplitude →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Building Quantum Software with Python. The section links point to the parts of the book it draws on.