Back to Module 6 notes

Roadmap: Problem 6.1 and Problem 6.2 drill the three measurement cases; Problem 6.3 asks for a proof; Problem 6.4 is a destabilizer trace by hand; Problem 6.5 is about logical measurements on a code; Problem 6.6 and Problem 6.7 are coding exercises with Stim.

Conventions: outcome , ; qubits numbered from 1 in the math and from 0 in Stim.

Problem 1

Problem 6.1 (Two measurements on a Bell pair).

Start from . Measure with outcome , then with outcome .

  1. Classify each measurement and give the stabilizer generators after each step.
  2. What is the joint distribution of ? What is the final state?
  3. Contrast with measuring and then . Why are the outcomes correlated there but not here?

Problem 2

Problem 6.2 (The GHZ state).

Let .

  1. For each of , , , , , , say whether the outcome is deterministic (and give it) or random.
  2. Measure with outcome . Give the new generators and describe the remaining two-qubit state.
  3. Measure instead, with outcome . Give the new generators and the state.

Problem 3

Problem 6.3 (Fair coins and a valid update).

Let be a stabilizer state with generators , and let anticommute with () and commute with .

  1. Show .
  2. Show that is a set of pairwise commuting, independent Paulis that stabilize the post-measurement state.
  3. A student instead uses . Show by an example that this list need not be a stabilizer group.

Problem 4

Problem 6.4 (An Aaronson-Gottesman trace).

After , , on , the Aaronson-Gottesman tableau is

  1. Check two of the defining relations of a destabilizer tableau.
  2. Measure and suppose the random outcome is . Carry out the three steps of the random case and write the new tableau (ignore destabilizer signs).
  3. Now measure . Show that it is deterministic and compute the outcome with the scratch row.

Problem 5

Problem 6.5 (Measuring the Steane code).

The Steane code has -checks , , and the same -checks (Module 4). Classify a measurement of each operator on an arbitrary code state: , , , , . For the logical ones, explain how the outcome distribution depends on the encoded state, and what the code becomes afterwards.

Problem 6

Problem 6.6 (Coding: an Aaronson-Gottesman simulator checked against Stim).

Extend your tableau class from Homework 5 to the -row Aaronson-Gottesman layout (destabilizers, stabilizers, scratch) and implement measure(a) returning (m, was_random). Test it against stim.TableauSimulator on 200 random 5-qubit circuits of 40 operations (H, S, CNOT, and Z measurements): use peek_z(a) (which returns , , or for random) to check that your simulator agrees on random versus deterministic and on deterministic values, and postselect_z(a, desired_value=...) to force Stim to follow your random outcomes.

Problem 7

Problem 6.7 (Coding: detectors in a two-round repetition code).

Build a Stim circuit for the 3-qubit bit-flip code with data qubits 0, 1, 2 and ancillas 3, 4 that measure and (Stim numbering). Do two rounds of syndrome extraction (CNOT data-to-ancilla, then MR on the ancillas), then measure all data qubits. Define six detectors: the two round-1 syndromes; the two round-2 syndromes each XORed with round 1; and the two final data parities each XORed with the round-2 syndrome. Mark OBSERVABLE_INCLUDE on the final measurement of qubit 2. Insert X_ERROR(1) on one data qubit just before round 2, and tabulate which detectors fire for errors on qubits 0, 1, 2 and for no error.