Part II. Mathematical Core · Chapter 8
Complex Numbers for Quantum Computing
Quantum computing runs on complex numbers, and you need exactly three skills with them: conjugate, magnitude, phase. This chapter teaches those three, shows where each enters a calculation, and settles why the imaginary unit is load-bearing rather than decorative.
In this chapter 8 sections
Reader question. Why are complex numbers necessary for tracking quantum phase, and how are probabilities recovered from them?
Complex amplitudes encode magnitude and direction in the complex plane; conjugation produces the nonnegative squared magnitude used by the Born rule, while relative angles survive to control interference.
- This chapter does not offer a general complex-analysis course or use Euler's formula without tying it to state evolution.
- It does not imply that complex amplitudes themselves are directly measurable.
Coordinates on the complex plane
Define real part, imaginary part, conjugate, modulus, and argument.
Quantum amplitudes are complex numbers: quantities of the form , where and are ordinary real numbers and is defined by . The magnitude is the point's distance from the origin, and the squared magnitude is what measurement turns into probability.
The reason for dragging in a second dimension of number is interference. A probability table can only add; it has no way for two live possibilities to erase each other. Complex amplitudes carry both a size and an angle, and the angle lets two contributions to the same outcome cancel without either contribution ceasing to exist. Strip the theory down to real numbers and you lose exactly the phenomenon Part I identified as the engine of every algorithm.
So the deal is simple: amplitudes live on the complex plane, gates move them around that plane, and measurement reads out squared lengths. Every calculation in this part of the book is some variation on those three moves.
Evidence boundary. Complex inner-product spaces require conjugation to produce nonnegative norms. [John Watrous] [Michael A. Nielsen]
Multiplication rotates and scales
Derive polar multiplication with Euler's formula.
The complex conjugate of is ; the same point, reflected across the real axis. Its job is to make magnitudes computable: , a plain nonnegative real number. For an amplitude , the probability contribution is always . Never ; that is a different, generally complex, object, and using it is the most common arithmetic error in early quantum calculation.
Phase comes in two grades, and confusing them causes real bugs. Global phase; multiplying an entire state by the same factor like ; changes nothing measurable: every amplitude picks up the same angle, every squared magnitude is untouched, and no experiment can detect the change. Relative phase; one branch's angle shifting against another's; is physically real. Later interference can convert it into different outcome probabilities, which is the whole trick behind the algorithms in Part IV.
Evidence boundary. Quantum probabilities use squared amplitude magnitudes rather than ordinary squares. [Michael A. Nielsen] [John Preskill]
Why z*z is not a probability
Contrast z² with z* z using a numerical counterexample.
For a complex amplitude z, probability uses z-bar times z, not z times z. The conjugate reverses the sign of the imaginary component, making |z| squared real and nonnegative. For z=(1+i)/2, z squared is i/2, which cannot be a probability; conjugate(z)z=1/2 is the valid Born weight. This distinction is an invariant worth checking in every hand calculation and implementation.
Evidence boundary. Relative complex phase affects interference while global phase leaves physical predictions unchanged. [John Watrous] [Michael A. Nielsen]
Notation contract: i²=−1; z*=a−bi; |z|²=z*z; principal argument convention stated; radians used for phase.
Normalize a two-amplitude state
Carry exact radicals and verify the norm.
If you ever write a statevector simulator, this chapter is your data model. The state is an array of complex numbers; a gate is a matrix of complex numbers; applying a gate is matrix-vector multiplication over that arithmetic. There is no separate probability array to update; probabilities are derived on demand by squaring magnitudes, and only then.
This shapes debugging. A state can carry phases that no single measurement step reveals but that corrupt every later gate, and if your test harness inspects only probabilities at each step it will wave the bug through. Compare amplitudes, or at least compare in a second measurement basis; probability-only testing is blind to exactly the errors quantum code is most prone to.
Relative angle survives a gate
Connect conjugation and phase to one interference calculation.
Global multiplication by exp(i gamma) rotates every amplitude together and cancels from all inner-product magnitudes. A relative phase rotates only one component against another. Hadamard exposes the difference: equal-magnitude amplitudes with relative phase zero reinforce in |0>, while a phase pi makes them reinforce in |1>. The gate has converted angular information into a measurable population difference.
Complex-amplitude arithmetic checker
| Field | Reader-visible record |
|---|---|
| Format | Tested notebook with Argand diagrams and exact/numeric modes |
| Verification | Fixtures verify conjugation, modulus, polar multiplication, normalization, and phase-equivalent probabilities. |
| Availability | Source-embedded acceptance record; no separate download is claimed |
{
"artifact": "Complex-amplitude arithmetic checker",
"format": "Tested notebook with Argand diagrams and exact/numeric modes",
"acceptance_test": "Fixtures verify conjugation, modulus, polar multiplication, normalization, and phase-equivalent probabilities.",
"publication_state": "source-embedded contract and worked fixture"
}Executable reference fixture
Run with Python 3.11 or later. The final assertion is the chapter-level pass condition for this small instance.
import cmath
import math
def normalize(amplitudes):
norm = math.sqrt(sum(abs(value) ** 2 for value in amplitudes))
if norm < 1e-15:
raise ValueError("the zero vector cannot be normalized")
return tuple(value / norm for value in amplitudes)
def probabilities(amplitudes):
return tuple(abs(value) ** 2 for value in amplitudes)
pairs = ((3 + 4j, -2 + 0.5j),
(cmath.rect(2.5, 0.7), cmath.rect(0.4, -1.2)),
(-1j, 1 + 1j))
max_polar_error = 0.0
for left, right in pairs:
product = left * right
polar_product = cmath.rect(abs(left) * abs(right), cmath.phase(left) + cmath.phase(right))
max_polar_error = max(max_polar_error, abs(product - polar_product))
assert abs(product.conjugate() - left.conjugate() * right.conjugate()) < 1e-12
assert abs(abs(left) ** 2 - left.real ** 2 - left.imag ** 2) < 1e-12
assert max_polar_error < 1e-12
raw_states = ((3 + 4j, 0j), (1 + 2j, -2 + 1j), (0.25j, -3, 4 - 2j))
states = tuple(normalize(state) for state in raw_states)
for state in states:
assert abs(sum(probabilities(state)) - 1.0) < 1e-12
phase = cmath.exp(1j * 1.234)
max_probability_shift = 0.0
for state in states:
shifted = tuple(phase * value for value in state)
shift = max(abs(a - b) for a, b in zip(probabilities(state), probabilities(shifted)))
max_probability_shift = max(max_probability_shift, shift)
assert max_probability_shift < 1e-12
wrong_rule_total = sum(abs(value) for value in normalize((3, 4)))
assert abs(wrong_rule_total - 1.0) > 0.1
zero_rejected = False
try:
normalize((0j, 0j))
except ValueError:
zero_rejected = True
assert zero_rejected
print(f"PASS: 08 complex amplitudes verify {len(pairs)} polar products and {len(states)} normalized states; max polar error={max_polar_error:.2e}, global-phase probability shift={max_probability_shift:.2e}")
Scope boundary
- This chapter does not offer a general complex-analysis course or use Euler's formula without tying it to state evolution.
- It does not imply that complex amplitudes themselves are directly measurable.
Depth commitment. Four core operations, one normalization derivation, and one phase-invariance check.
Practice problem
Normalize (1+i, 1−i), express each amplitude in polar form, and predict whether a global phase changes its measurement distribution.
- Deliverable
- Exact normalized vector, polar angles, probability table, and global-phase argument.
- Pass condition
- The checker verifies norm one, probabilities one-half each, and invariant probabilities under three supplied global phases.
Verification record
Expected solution form. Symbolic calculation with an executable complex-arithmetic fixture.
Model answer. The normalized vector is ((1+i)/2,(1-i)/2). Both amplitudes have magnitude 1/sqrt(2), with phases pi/4 and -pi/4. Multiplying the entire vector by exp(i gamma) changes neither computational-basis probability.
Model result and check. The fixture compares exact values where possible and uses declared tolerance for polar angles.
Acceptance test. The checker verifies norm one, probabilities one-half each, and invariant probabilities under three supplied global phases.
Companion work
Artifacts for this chapter
These entries resolve to checked-in local source. Commands are reproduced exactly from the chapter manifest, and source-embedded fixtures are exported as direct downloads.
executable derivation
Complex-amplitude arithmetic checker
Reproduce or test
python3 tools/validate_briefs.py --briefs data/editorial_briefs_00_35.json --from 0 --through 35 --check-rewritten-sources --execute-artifacts
Provenance
Sources and review
- John Watrous. The Theory of Quantum Information. Cambridge University Press / University of Waterloo. 2018textbook
- Michael A. Nielsen and Isaac L. Chuang. Quantum Computation and Quantum Information. Cambridge University Press. 2010textbook
- John Preskill. Lecture Notes for Physics 219: Quantum Computation. California Institute of Technology. 2018graduate lecture notes
The load-bearing claims in the chapter are mapped inline to this registered source set. A citation supports only the bounded claim beside it.