Orientation guide
Amplitudes, Measurement, and Gates
One qubit, four gates, and a meter — that is all the machinery this guide uses, and it is enough to watch interference happen in arithmetic you can check by hand. You will normalize states, multiply matrices, and learn why the measurement basis is part of the answer.
In this chapter 11 sections
Reader question. How can a reader calculate a complete one-qubit experiment from preparation through gate application to measurement?
Represent the qubit as a normalized two-entry complex vector, multiply by the chosen unitary matrices in declared order, and square final magnitudes only after all amplitudes have combined; the measurement basis is part of the experiment.
- This guide does not cover mixed states, tomography, or multi-qubit entanglement.
- It does not treat a statevector simulator's private state as physically readable output.
Declare the vector before touching a gate
Fix basis order, normalization, and phase conventions.
A quantum state is not a list of probabilities; it is a vector of amplitudes. Gates transform the amplitudes. Measurement then converts the state into classical data, with probabilities computed from the squared magnitudes. Every quantum program, whatever its size, runs the same loop:
- Prepare an initial state.
- Apply gates that transform the amplitudes.
- Arrange interference so useful outcomes grow and useless ones cancel.
- Measure, producing one classical record.
- Interpret the samples, usually over many repeated shots.
Confuse amplitudes with probabilities and almost every quantum algorithm becomes mysterious. Track amplitudes carefully and the mystery turns into linear algebra.
Work in the computational basis, and . A general pure state is , subject to the normalization condition . Measurement in this basis returns 0 with probability and 1 with probability .
Because amplitudes are complex, the squared magnitude deserves one line of care: for , , equivalently where is the complex conjugate. Normalize wrong and every probability you compute afterwards is wrong too.
Evidence boundary. A pure one-qubit state is a normalized vector in a two-dimensional complex Hilbert space. [John Watrous] [Michael A. Nielsen]
Four matrices, one execution order
Derive X, Z, H, and S actions on the basis states.
X gate
It swaps the basis states: and . On the computational basis this is the quantum analogue of NOT.
Z gate
It leaves alone and flips the sign of : . Measure immediately and you see nothing; apply another gate and the flipped phase changes what interferes with what. Z is the purest phase gate in the set.
H gate
It maps to and to . Hadamard is the simplest gate that creates superposition, which makes it the best gate for learning interference.
S gate
It leaves alone and multiplies the component by ; a quarter-turn of phase where Z applies a half-turn. Four gates, and you can already build every phenomenon this guide discusses.
Take the state . A computational-basis measurement gives 0 and 1 with equal probability. But apply first and then measure, and ; the outcome is now 0 with certainty.
Same state, different statistics, because the effective measurement changed. This is why "the measurement probability" is never a complete description of a state: you must specify the basis, or equivalently the circuit that runs before the meter. A claim about a quantum state that does not say how it was measured is an incomplete claim.
Evidence boundary. X, Z, H, and phase gates are unitary matrices whose order of multiplication determines the result. [Michael A. Nielsen] [John Preskill]
The HZH phase detector
Trace an imaginary or negative phase into a measurable outcome.
Two states that differ only by an overall phase; versus , or versus ; make identical predictions for every possible measurement. Global phase is unphysical, a residue of the notation.
Relative phase is different. The states and differ by a sign on one component only, and as the Hadamard example showed, that sign decides whether a later gate produces or . The quick test: if you cannot factor the phase out in front of the whole state, it is relative, and it matters.
Interference is amplitude addition, nothing more. When two computational paths contribute amplitudes to the same outcome, those amplitudes add. Aligned, they reinforce; grows. Opposed, they cancel; .
A quantum algorithm earns its keep when its circuit steers amplitudes so that wrong or irrelevant outputs cancel and useful outputs survive or grow. Probability can never do this; probabilities only ever add upward. The ability to subtract is the whole game.
Evidence boundary. Measurement probabilities depend on the selected basis and are computed from squared amplitude magnitudes. [John Watrous] [Michael A. Nielsen]
Notation contract: Basis order (|0>, |1>); column vectors; gates act right-to-left in products; global phase equivalence must be stated explicitly.
Changing the question changes the statistics
Express X-basis measurement as a basis rotation followed by Z measurement.
A small statevector simulator is the reference implementation of everything in this guide:
state: complex vector
gate: unitary matrix
operation: state <- gate * state
measurement: sample according to squared magnitudes
Four ideas, each one line. This approach will not scale; the vector doubles with every qubit; but it is the right way to build early correctness, and Part V has you write one from scratch.
On a real device there are no matrices; there are pulses, fields, voltages, lasers, and optical elements, each engineered to approximate a target unitary. A symbolic in your circuit becomes hardware-specific control, and the approximation is never exact. The questions that determine whether the math survives contact with the machine:
- What gate set is native to the device?
- How long does each gate take?
- What is the measured error rate per gate?
- How many extra gates does compilation add?
- Does limited connectivity force swap operations?
- Does calibration drift change behavior over hours or days?
A one-qubit calculation protocol
Turn the arithmetic into a reusable checklist and diagnostic.
- Normalize , , and .
- Apply , , , and to both and .
- Compute and identify the familiar gate you just built.
- Show that and .
- Write down two states with identical computational-basis probabilities but different outcomes after a Hadamard.
- Write pseudocode for a one-qubit statevector simulator.
- Explain why a shot histogram is not the same thing as a quantum state.
Part II of the book turns this working session into a complete toolkit:
- Complex Numbers for Quantum Computing; the arithmetic of phase, done properly.
- Vectors, Bases, and Amplitudes; the state space as a vector space.
- Matrices as Gates; unitary transformations beyond one qubit's worth of intuition.
- Interference as Engine of Quantum Algorithms; the engine, examined under load.
Then continue to Multi-Qubit Circuits, Entanglement, and No-Hype Protocols, where a second qubit changes the game entirely.
One-qubit calculation notebook
| Field | Reader-visible record |
|---|---|
| Format | Tested Python notebook plus printable hand-calculation grid |
| Verification | Tests verify normalization after every gate, H²=I, HZH=X, and exact probabilities for the guide's examples. |
| Availability | Source-embedded acceptance record; no separate download is claimed |
{
"artifact": "One-qubit calculation notebook",
"format": "Tested Python notebook plus printable hand-calculation grid",
"acceptance_test": "Tests verify normalization after every gate, H²=I, HZH=X, and exact probabilities for the guide's examples.",
"publication_state": "source-embedded contract and worked fixture"
}
Scope boundary
- This guide does not cover mixed states, tomography, or multi-qubit entanglement.
- It does not treat a statevector simulator's private state as physically readable output.
Depth commitment. Two complete calculations, four gate definitions, and one reusable protocol.
Practice problem
Trace |0> through S, H, Z, and H in the stated order, checking normalization after each operation and predicting Z-basis outcomes.
- Deliverable
- A state-after-each-gate table with exact complex entries and final probabilities.
- Pass condition
- Each row equals the notebook fixture; norms equal one and probabilities sum to one.
Verification record
Expected solution form. Exact symbolic table followed by a numerical tolerance check.
Model answer. In circuit time order, |0> remains |0> after S, becomes |+> after H, becomes |-> after Z, and becomes |1> after the final H. Every intermediate norm is one; the final Z-basis result is 1 with certainty.
Model result and check. The notebook independently evaluates the matrix product and compares every row to the published solution.
Acceptance test. Each row equals the notebook fixture; norms equal one and probabilities sum to one.
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.