This set practises Lecture 7 and Lecture 8. Problem 1, Problem 2 and Problem 4 are mostly pen and paper, with a short check at the end. Problem 3 and Problem 5 use the tools of Notebook 7 and Notebook 8. Try each problem before you open its solution. research/hw04_check.py recomputes every number in the solutions.

Problem 1 (Hypergraph products by hand).

Lecture 7 gives the hypergraph product of two classical check matrices () and (): , and , where , , and when . Take .

  1. is the check matrix of the cyclic repetition code (row checks bits and ). Find and , then and .

  2. is the open repetition code: the first rows of the cyclic one. Find , and , and give for and .

  3. is the Hamming code, whose columns are the numbers 1 to 7 in binary,

    Find .

  4. For the Hamming product, show directly that no -type operator of weight 1 or 2 commutes with all the checks. (When does a weight-2 vector lie in ?) Then find a -type logical operator of weight 3.

  5. Compare for the toric code at and for the Hamming product. How many data qubits would 16 separate distance-3 rotated surface codes need?

Check and with Deltakit’s CSSCode.from_matrix, and your weight-3 operator with numpy.

Problem 2 (How many qubits a bivariate bicycle code stores).

Let and , where is the cyclic shift, and let , , and , on qubits.

  1. Show that .
  2. Show that and . Use to show that the two intersections have the same dimension, and conclude that .
  3. Bravyi et al. list , with the same and as a code. Check and with BivariateBicycleCode and with part 2.
  4. Count physical qubits (data plus one ancilla per check) needed to store 12 logical qubits at distance 12: the gross code against 12 rotated surface-code patches of distance 12. Repeat at distance 6 with , and compute for all four codes.
  5. Name two things that 12 separate surface-code patches give you and one gross-code block does not.
Problem 3 (Errors that flip one detector).

Matching needs every error to flip one or two detectors, and Notebook 7 found that most errors of a BB memory flip more. Here you find the few that flip exactly one. Use , a -basis memory experiment of rounds from css_code_memory_circuit, and SI1000Noise(p=1e-3).

  1. With perfect measurements, how many checks does a single error on a data qubit flip? Is there anything like the boundary of a surface code?
  2. How many detectors sit at , at each , and at ? Why?
  3. Which faults can flip exactly one detector? Predict how many such DEM errors there are for and 6, and in which rounds they sit. Then count them with Deltakit.
Problem 4 (The lattice-surgery seam).

Lecture 8’s figure shows the seam of a merge of two distance-3 patches: patch 1’s boundary column, a bridge column prepared in , and patch 2’s boundary column, each with 3 qubits (rows 0, 1, 2 from the top). Between the columns sit four new checks: a square on rows 1–2 left of the bridge, a square on rows 0–1 right of it, a weight-2 cap on row 0 left of it and a cap on row 2 right of it. Two squares fill the remaining places. Lecture 8 and the field map’s lattice-surgery card state the answers to parts 1, 2 and 4; derive them yourself before you look, then do part 3 for any .

  1. Show that the product of the four new checks is .
  2. In the first merged round, why is each new check a random even when the two patches hold a eigenstate? Why is the squares’ outcome predictable?
  3. Extend the pattern to odd distance (squares alternate , down each side of the bridge, out of step on the two sides). How many new checks, squares and bridge qubits are there? Check the product for .
  4. Why is the merged patch measured for rounds rather than once?
Problem 5 (A detector that is the logical).

Lecture 8 compiled a three-round memory of the three-qubit repetition code: data on qubits 0, 2, 4, ancilla 1 checks and ancilla 3 checks . The circuit ends like this:

M 1 3
TICK
DETECTOR rec[-4] rec[-2]
DETECTOR rec[-3] rec[-1]
M 0 2 4
TICK
OBSERVABLE_INCLUDE(0) rec[-3]
DETECTOR rec[-5] rec[-3] rec[-2]
DETECTOR rec[-4] rec[-1] rec[-2]
DETECTOR rec[-1]
  1. Name the five measurements behind rec[-1] to rec[-5] at the end of the circuit, and write each of the last three detectors as a parity of last-round ancilla outcomes , and data outcomes , , .
  2. Earlier rounds add a detector (round 1) and (each later round against the one before) for . Show that the observable is the XOR of all nine detectors. Conclude that an error flips the observable exactly when it flips an odd number of detectors, and that any decoder whose correction reproduces the syndrome is never wrong.
  3. How many detectors should an -round memory of this code have, and how many does the compiler emit? Check with Deltakit for to 4, and test the claim of part 2 on the noisy circuit, with and without the last detector.
  4. Lecture 8 measured 0 failures in 100,000 shots at for the compiled circuit and 4397 without its last detector. Which number estimates the memory’s logical error rate? What does shortest_graphlike_error() return for each noisy circuit?