Back to Module 8 notes

Overview: Problem 8.1 and Problem 8.2 are computations, Problem 8.3 and Problem 8.4 are proofs, Problem 8.5 asks you to reason about circuits, and Problem 8.6 is a Stim exercise.

For the rotated code we use the layout of the notes: data , X-checks , Z-checks (syndrome bits in this order), and .

Problem 1

Problem 8.1 (The smallest planar code).
  1. Apply Definition 8.1 with . List the data sites, number them in reading order, and write down all checks.
  2. Verify that the checks commute, find , and give weight-2 logical operators , . Conclude that this is a code.
  3. For distance , compare the total qubit count (data plus one ancilla per check) of the planar and rotated codes. What does the ratio tend to as ?

Problem 2

Problem 8.2 (Lookup-table decoding of the 17-qubit code).

Consider X errors only. They are detected by the 4 Z-checks.

  1. For each of the 16 possible syndromes, find a minimum-weight X error that produces it. Which syndromes need weight 2?
  2. The decoder applies the table entry for the observed syndrome. Show that it corrects every single X error.
  3. Show that the weight-2 error causes a logical failure, while is corrected. Why is this consistent with ?

Problem 3

Problem 8.3 (Equivalent logical strings).
  1. In the rotated code, show that and are both equivalent to , by writing each product with as an explicit product of X-checks.
  2. Show that is also a logical X operator.
  3. Prove that any X-type logical anticommutes with any Z-type logical in a CSS code, as long as both are nontrivial. Deduce that a horizontal and a vertical boundary-to-boundary string must cross an odd number of times.

Problem 4

Problem 8.4 (Pauli propagation in the check circuits).

Use the X-check circuit of Proposition 8.2 (ancilla , data in CNOT order).

  1. An error hits the ancilla just after CNOT , for (with meaning before the first CNOT, after the first ). Which data error results, and is the measurement outcome flipped?
  2. Show that, up to multiplication by the check , every case has data weight at most 2.
  3. Repeat part 1 for a error on the ancilla of the Z-check circuit.

Problem 5

Problem 8.5 (How hook errors cost distance).

Suppose the X-checks of the rotated code use the N order (TL, BL, TR, BR).

  1. Which pair of data qubits does a hook error on the ancilla of hit? Find a second single-qubit fault such that the two faults together apply up to stabilizers.
  2. Explain why the memory-Z experiment (sensitive to X errors) loses distance, but the memory-X experiment does not.
  3. For general odd with the bad order, explain why faults suffice for a logical error, matching the Stim table in the notes.

Problem 6

Problem 8.6 (Surface code circuits in Stim).
  1. Generate stim.Circuit.generated("surface_code:rotated_memory_z", distance=d, rounds=d, after_clifford_depolarization=p, after_reset_flip_probability=p, before_measure_flip_probability=p, before_round_data_depolarization=p) with for . Count the detectors and explain the count.
  2. Compute len(circuit.shortest_graphlike_error()). Is the circuit-level distance equal to ?
  3. circuit.num_qubits reports 26 for . How many qubits does the circuit actually use, and why the difference?