Orientation Guides

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.

Listen to this chapter

At one qubit, quantum computing's famous weirdness reduces to a single fact: amplitudes add before they square. Everything else in this guide — phase, basis-dependence, interference — is that fact working itself out in arithmetic.

The guide is a working session, not a survey. Keep a pencil nearby and redo each calculation as you go; the payoff is that Part II of the book will feel like a review of things your hands already know.

Core concepts: amplitude, normalization, unitary gates, phase, measurement basis, interference.

Two Hadamard gates on one wire split and then cancel an amplitude Interference in one line: two Hadamards undo each other |0> H H M |0> every time splits the amplitude recombines it samples once the |1> amplitude created by the first H is cancelled exactly by the second — that cancellation is interference
Notice there is no randomness anywhere on this wire: the two H gates split and then exactly cancel the amplitude, so even the meter reads a deterministic outcome. Randomness enters only when a circuit fails to arrange such cancellation.

The loop every quantum program runs

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:

  1. Prepare an initial state.
  2. Apply gates that transform the amplitudes.
  3. Arrange interference so useful outcomes grow and useless ones cancel.
  4. Measure, producing one classical record.
  5. 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.

The one-qubit state

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.

Worked example: normalize three vectors

Vector [1, 1]

The squared norm is , so the norm is and the normalized state is — which you will meet constantly as .

Vector [1, i]

The squared norm is again , giving . Measurement probabilities are and — identical to the previous vector. The on the amplitude is phase: invisible to an immediate measurement, decisive once later gates let the components interfere.

Vector [1, 1+i]

Here , so the squared norm is and the normalized state is . Now the measurement probabilities genuinely differ: and . Three vectors, three lessons: norms come from squared magnitudes, phases hide from single measurements, and normalization is what makes the numbers mean probabilities at all.

The four gates worth memorizing

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.

Worked example: prove that H squared is the identity

Multiply the matrix by itself:

The matrix product is:

Multiplying by gives the identity matrix, so : applying Hadamard twice returns the original state exactly. The figure at the top of this guide is this equation drawn as a circuit. Notice where the cancellation happened — the off-diagonal entries summed to zero. That is destructive interference, caught in the act of matrix multiplication.

Measurement is basis-dependent

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.

Global phase versus relative phase

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 the engine

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.

Misconceptions worth unlearning

"If the probabilities are 50/50, the state is fully known." Many different states produce identical immediate measurement statistics in one basis. The states , , and all look the same to a single computational-basis meter.

"Phase is just a mathematical trick." Relative phase changes later interference, and later interference changes what the meter shows. A trick that moves measurement outcomes is physics.

"A simulator shows the amplitudes, so hardware can reveal them too." Statevector simulators expose the mathematical state because they are classical calculations with the vector in memory. Hardware gives you samples from measurements — nothing more, ever.

The computer-science view

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.

What this means on hardware

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?

What this buys you in diligence

A company claiming application-level value should be able to answer, without hesitation:

  • Which circuit or algorithm creates the claimed advantage?
  • How deep is that circuit after compilation to real hardware?
  • What hardware error model does the claim assume?
  • How many shots does the result need?
  • What classical baseline is it compared against?
  • Does the result depend on postselection, error mitigation, or full error correction?

Missing answers do not prove the claim is false. They prove it is not yet diligence-grade.

Exercises

  1. Normalize , , and .
  2. Apply , , , and to both and .
  3. Compute and identify the familiar gate you just built.
  4. Show that and .
  5. Write down two states with identical computational-basis probabilities but different outcomes after a Hadamard.
  6. Write pseudocode for a one-qubit statevector simulator.
  7. Explain why a shot histogram is not the same thing as a quantum state.

Check your understanding

You have this guide when you can, without notes:

  • Normalize complex state vectors.
  • Apply one-qubit gates by matrix multiplication.
  • Explain the difference between global and relative phase.
  • Explain why the measurement basis is part of any probability statement.
  • Interpret a shot histogram without overclaiming what it shows.

Part II of the book turns this working session into a complete toolkit:

Then continue to Multi-Qubit Circuits, Entanglement, and No-Hype Protocols, where a second qubit changes the game entirely.