OQCL   HomeStart Here7 SessionsTextbookProjectsQUEST LabSubmitUse CasesInstructor GuideReferences

Chapter 2 — Qubits, Measurement, and Single-Qubit Gates

Chapter purpose. Build enough conceptual and mathematical understanding to predict an experiment before running it. The projects below are applications of the chapter, not substitutes for the theory.

1. From state to measurement

Before measurement, a qubit is described by amplitudes. A projective computational-basis measurement produces a classical outcome and, in the ideal model, leaves the state consistent with that outcome. Repeating a circuit many times gives samples from the underlying probability distribution; one run does not reveal the amplitudes of an unknown state.

2. Unitary evolution

Closed-system quantum gates are modeled by unitary matrices U satisfying U†U=I. Unitarity preserves vector length and therefore total probability. It also makes ideal gate evolution reversible. This restriction is why arbitrary classical operations cannot simply be translated gate-for-gate into quantum operations.

3. X, Y, Z and H

X exchanges |0⟩ and |1⟩. Z preserves the computational-basis labels but changes the sign of the |1⟩ amplitude. Y combines a bit flip with phase. H maps computational-basis states to equal superpositions and is central to interference experiments. The identity H²=I is especially useful pedagogically: the first H creates equal measurement probabilities, while the second recombines amplitudes deterministically.

4. Bloch-sphere intuition

Ignoring global phase, every pure single-qubit state can be represented as a point on the Bloch sphere. |0⟩ and |1⟩ occupy opposite poles; states with equal computational-basis probabilities lie around the equator. Gates can often be understood as rotations, giving a geometric complement to matrix multiplication.

5. Shots and uncertainty

A finite-shot experiment estimates probabilities. If the true probability of an event is p and N independent shots are collected, the standard deviation of the observed proportion scales approximately as √[p(1−p)/N]. Increasing shots improves statistical precision but does not remove hardware bias or gate noise.

Student exploration and activities

Use case: calibration and probabilistic output

Single-qubit gates are the alphabet from which larger circuits are built. Repeated shots introduce the first real experimental idea: a quantum program often produces a distribution rather than one deterministic answer. This becomes essential later in VQE, QAOA, QML, and hardware benchmarking.

Problem: randomness is easy to misunderstand

A 50/50 histogram after H does not mean the qubit was secretly a classical bit whose value we did not know. Conversely, H followed by H returns |0⟩ ideally; two 'random-looking' operations do not behave like two independent coin flips. The identity H²=I helps clarify the distinction.

Suggested student activity

Students can predict the histograms from 10 and 10,000 shots before running a simulator. Comparing predictions with measured results helps distinguish sampling fluctuations from systematic errors.

Questions for exploration

Students can make a prediction, explain the reasoning in plain language, and identify an observation that would challenge the prediction. The outcome can then be connected to the mathematical model introduced in this chapter.

Optional reading and references: IBM Quantum Learning · Microsoft Quantum Katas · QWorld QEducation / QBronze · Q-CTRL Black Opal. These are external resources used for comparison, further reading, and pedagogical inspiration; OQCL prose, examples, and project prompts are independently written.

Worked example

Begin with |0⟩. H produces (|0⟩+|1⟩)/√2. Applying H again gives [(|0⟩+|1⟩)+(|0⟩−|1⟩)]/2=|0⟩. Thus H-H is not two independent randomizers; the amplitudes interfere and recover the initial state.

How to reason about the result

Separate three layers: (1) the ideal mathematical prediction, (2) finite-shot sampling, and (3) implementation effects such as noise or compilation. A good laboratory report identifies which layer can plausibly explain an observed discrepancy.

Check your understanding

  1. Why does 10,000 shots not make a noisy QPU equivalent to an ideal simulator?
  2. Calculate the action of X on a|0⟩+b|1⟩.
  3. Why is H²=I evidence that amplitudes, rather than classical probabilities alone, matter?

Projects unlocked

Q03 — Continue from the chapter into the corresponding reproducible experiment.
Q08 — Continue from the chapter into the corresponding reproducible experiment.

Before moving on

You should be able to explain the central idea in your own words, perform the worked example without copying it, and make a falsifiable prediction for the first linked project.