These problems practise Lecture 1 and Lecture 2. Each one starts on paper and ends with a few lines of code that confirm the answer, so try the paper part first and run the code second. Problem 1 and Problem 2 drill the algebra of Lecture 1. Problem 3 asks about a code too large to check by hand. Problem 4 and Problem 5 use the tableau and measurement rules of Lecture 2, and Problem 6 reads detection events in the memory circuit of Notebook 2.

Qubits are numbered from 0, as in Stim. A Pauli string such as XYZI means , with qubit 0 on the left.

Pauli and stabilizer algebra

Problem 1 (Pauli products and the symplectic form).

Let be the string XYZI and the string ZZXX.

  1. Compute and , phases included. Do and commute?
  2. Write both as binary vectors and compute their symplectic product. Does it agree with part 1?
  3. Show that exactly half of the Pauli strings on four qubits (signs ignored) commute with . Hint: the symplectic product with a fixed vector is a linear map .
  4. Check parts 1 to 3 with stim.PauliString.
Problem 2 (The four-qubit code).

The code has stabilizer generators and .

  1. Check that and commute, and find .
  2. Show that , , and are logical operators with the commutation relations of two qubits: anticommutes with exactly when .
  3. Show that the distance is 2: every single-qubit error is detected, and some weight-2 error is a logical operator.
  4. Use the Knill–Laflamme conditions of Lecture 1 to show that the code cannot correct every single-qubit error. Which pair of errors breaks them?
  5. Build the code with CSSCode.from_matrix and confirm . Does the object report a distance? If not, find by brute force over all strings of ‘s.
Problem 3 (A rectangular surface code).

RotatedPlanarCode(width=3, height=5) places 15 data qubits on a grid of 3 columns and 5 rows, at coordinates and .

  1. Count the checks before running anything. Every square of four neighbouring qubits carries a weight-4 check, and in a checkerboard, and an edge of qubits carries weight-2 checks. If the checks are independent, what is ? Deltakit puts the weight-2 checks on the long edges: predict the shapes of and .
  2. Search all strings of ‘s and all strings of ‘s for logical operators. What is the lightest weight of each type, and how many logicals have it? Compare with code.x_distance and code.z_distance.
  3. Which edges do the lightest logicals connect? Use this to predict the distances of RotatedPlanarCode(width=5, height=3).
  4. Suppose errors are much more frequent than errors (biased noise). Which of the two orientations would you choose, and why?

Clifford circuits and Stim

Problem 4 (A tableau by hand).
  1. Let . Using , and the table of Lecture 2, compute and for . Which familiar gate is ?
  2. Count the single-qubit Cliffords, up to global phase, by counting the possible images of and then of . How many remain if the signs of the images are ignored?
  3. The number of -qubit Cliffords up to global phase is . Check part 2 against it, then enumerate and with stim.Tableau.iter_all.
Problem 5 (The GHZ argument with stabilizers).

The three-qubit GHZ state has stabilizer generators , and .

  1. Show that , and each equal minus a stabilizer, so each has the value with certainty.
  2. Suppose each qubit carried predetermined answers to “measure ” and “measure ”, and the outcome of a product such as was the product of the answers. Show that part 1 forces . What does the state say about ?
  3. Give , and without computing an amplitude.
  4. Measure on qubit 0 and suppose the outcome is . Use the Gottesman–Knill update rule to find the new stabilizer generators. What state are qubits 1 and 2 in? Repeat for the outcome .
  5. Check parts 1, 3 and 4 with stim.TableauSimulator.
Problem 6 (Reading detection events).

Take the distance-3 repetition-code memory with two rounds from Lecture 2. Data qubits sit at and ancillas at ; the ancilla at measures and the one at measures :

position x     0     1     2     3     4
               d --- a --- d --- a --- d
round 0              m0          m1
round 1              m2          m3
data M         m6          m5          m4

The detectors and the observable are, with sums mod 2, , , , , , and .

  1. For each fault, predict which detectors fire and whether flips.
    • (a) An error on data qubit at the start of round 0, before any check.
    • (b) A wrong outcome of the ancilla at in round 1.
    • (c) A error on data qubit between the rounds.
    • (d) errors on data qubits and , both between the rounds.
    • (e) An error on data qubit between the rounds.
  2. Faults (d) and (e) fire the same detectors. A decoder that picks the most likely explanation chooses which, and what happens to the logical qubit? What does this say about how many errors a distance-3 code corrects?
  3. Check part 1 by inserting each fault into the noiseless Stim circuit and sampling one shot.

Back to Lecture 1 · Back to Lecture 2 · All homework