Recommended resources
The freely available resources this lesson will direct you to.
- Suppressing quantum errors by scaling a surface code logical qubitwww.youtube.com
- Progress Towards Quantum Error Correction with the Surface Code | Qiskit Seminar Serieswww.youtube.com
- Quantum Error Correction: Surface Codesopencourse.inf.ed.ac.uk
- Fault-Tolerant Stabilizer Measurements in Surface Codes ...arxiv.org
Hello! Welcome back to our exploration of fault-tolerant quantum computing.
In our last lesson, we defined the surface code, specifying its layout on a 2D lattice and identifying its two types of stabilizer generators: the plaquette operators (products of Pauli-) and the vertex operators (products of Pauli-). We saw that the code's state lives in the simultaneous +1 eigenspace of all these stabilizers.
Today, we address the crucial next question: how do we actually check if the state is still in this correct subspace? An error, like an errant bit-flip () or phase-flip (), will cause the state to no longer be a +1 eigenstate of some stabilizers. Our goal is to measure the eigenvalues of all stabilizers to get an "error syndrome"—a map of which stabilizers have been violated—without disturbing the logical information itself.
This leads us to our learning outcome: Implement syndrome measurement circuits for X and Z stabilizers in the surface code. We'll construct the specific gate sequences that perform these measurements using ancilla qubits.
1. The Core Idea: Ancilla-Based Stabilizer Measurement
To measure a stabilizer operator like without collapsing the state of the data qubits (), we use an auxiliary qubit, or ancilla. The general procedure is a form of quantum non-demolition (QND) measurement:
- Prepare an ancilla qubit in a known initial state, typically .
- Perform a sequence of entangling gates between the ancilla and the data qubits that are part of the stabilizer. This sequence is designed to imprint the eigenvalue of the stabilizer operator onto the state of the ancilla.
- Measure the ancilla qubit. The measurement outcome reveals the stabilizer's eigenvalue ( or ) without revealing the individual states of the data qubits.
A measurement outcome of (ancilla measured as ) signals an error, and we record a "syndrome" at that stabilizer's location.
2. The Z-Stabilizer (Plaquette) Measurement Circuit
Let's begin with the circuit for measuring a Z-type plaquette stabilizer, . The following video provides an excellent, clear explanation of the standard circuit.
Progress Towards Quantum Error Correction with the Surface Code | Qiskit Seminar Series
The Qiskit Seminar Series video 'Progress Towards Quantum Error Correction with the Surface Code' presents a very clear walkthrough of the syndrome measurement circuits. This first segment focuses on the Z-type stabilizer.
Please watch the segment from 13:48 to 15:15. Pay close attention to the gate sequence and the logic explaining why an odd number of |1⟩ states in the data qubits flips the ancilla's measurement outcome.
As the video explains, the circuit works as follows for a weight-4 plaquette stabilizer :
-
Initialize: The ancilla qubit is prepared in the state.
-
Superposition: A Hadamard gate puts the ancilla into an equal superposition: .
-
Entangle: A sequence of four Controlled-Z () gates are applied, one for each data qubit in the plaquette, with the ancilla as the control and the data qubit as the target (or vice-versa, as the gate is symmetric).
The gate's action is to apply a phase of to the component of the joint state. Due to phase kickback, if a data qubit is in state , it flips the phase of the component of the ancilla's superposition.
-
Interfere: Another Hadamard gate is applied to the ancilla. This transforms the phase information into population information.
-
Measure: The ancilla is measured in the computational basis.
Let's trace the state of the ancilla. After the gate, it's in . After the four gates, its state becomes , where is the number of data qubits in the state .
- If is even, the ancilla state is . The final gate transforms this back to . The eigenvalue of the stabilizer is .
- If is odd, the ancilla state is . The final gate transforms this to . The eigenvalue of the stabilizer is .
Therefore, measuring the ancilla in state successfully flags a syndrome.
3. The X-Stabilizer (Vertex) Measurement Circuit
Measuring an X-type vertex stabilizer, , uses a very similar circuit. The core quantum mechanical principle is to change the measurement basis. Since , we can measure an operator by first transforming it into a operator, performing the standard measurement, and then transforming back.
The same video segment explains this elegant construction.
Progress Towards Quantum Error Correction with the Surface Code | Qiskit Seminar Series
Continuing with the Qiskit video, this next part shows how the Z-stabilizer circuit is adapted to measure X-stabilizers by simply adding a change of basis.
Please watch from 15:15 to 16:04. Notice how Hadamard gates are applied to the data qubits to effectively measure in the X-basis.
The circuit for a weight-4 vertex stabilizer is:
- Basis Change (Data): Apply Hadamard gates to all four data qubits ().
- Z-Stabilizer Measurement: Perform the exact same Z-stabilizer measurement circuit we just discussed, using the ancilla qubit.
- Basis Change Back (Data): Apply Hadamard gates to the four data qubits again to return them to the computational basis.
This "sandwich" of Hadamard gates around the operations is a fundamental technique for switching between and type operations.
The Google Quantum AI team uses a slightly different but equivalent circuit in their experiments, where Hadamards are also placed on the ancilla to use CNOTs instead of CZs, achieving the same logical effect. The underlying principle of basis change remains the key.
Test your understanding!
You have a single data qubit and a single ancilla qubit . You want to measure the Pauli operator on the data qubit. Write down the sequence of gates needed to perform this measurement using the ancilla.
Show answer
Based on the vertex measurement protocol, the sequence is:
- Initialize to .
- Apply to (basis change).
- Apply to (prepare for phase kickback).
- Apply a gate between and .
- Apply to (interfere and read out phase).
- Apply to (change basis back).
- Measure .
Measuring in corresponds to eigenvalue +1 for , and corresponds to eigenvalue -1.
4. Assembling a Full Syndrome Extraction Cycle
In a real surface code, we must measure all stabilizers across the entire lattice. This is done in repeated cycles. A full syndrome extraction cycle typically involves measuring all stabilizers of one type, followed by all stabilizers of the other type. For instance, a round of all X-stabilizer measurements, followed by a round of all Z-stabilizer measurements.
Given your preference for original sources, the following research paper provides a concrete example of what these full circuit implementations look like.
Fault-Tolerant Stabilizer Measurements in Surface Codes ...
The paper 'Fault-Tolerant Stabilizer Measurements in Surface Codes...' provides detailed circuit diagrams in its appendix. These show a complete syndrome measurement cycle for a distance-3 surface code.
Please navigate to 'Appendix B Stabilizer measurement circuits'. Study Figure S2. This figure shows the explicit gate sequences for measuring all stabilizers of a d=3 unrotated surface code. Trace the steps for both a Z-plaquette measurement (top circuit) and an X-vertex measurement (bottom circuit), identifying the initialization, basis changes (H gates), entangling gates (CZs), and measurements.
From studying Figure S2, you can observe several key features of a practical implementation:
- Parallelism: All the Z-plaquette checks are performed simultaneously in one part of the cycle, and all X-vertex checks are done in another. This is possible because their ancillas are distinct.
- Gate Layers: The circuits are broken down into discrete time steps or "layers" of gates that can be executed in parallel. You can see distinct layers for initialization, Hadamards, and the different sets of gates.
- Boundary Conditions: Notice that stabilizers at the boundary involve fewer qubits (e.g., weight-2), and thus fewer gates in their measurement circuits. The diagrams show this implicitly by which qubits are acted upon.
This detailed, explicit construction represents the "implementation" of the syndrome measurement circuits, moving from the conceptual gadget to a complete, scheduled algorithm for a small code.
Conclusion
In this lesson, we have constructed the essential circuits for error detection in the surface code. By understanding these building blocks, you now have the tools to simulate the first and most critical step of quantum error correction: finding out where errors have occurred.
Key Takeaways:
- Syndrome measurement is performed using ancilla qubits in a quantum non-demolition protocol.
- The circuit for a Z-type plaquette stabilizer uses Hadamard gates on the ancilla to transform phase information (from gates) into a measurable outcome.
- The circuit for an X-type vertex stabilizer is identical, but is "sandwiched" by Hadamard gates on the data qubits to perform a basis change.
- A full syndrome extraction cycle on a surface code involves repeatedly executing these measurement circuits in parallel across the lattice, typically alternating between X- and Z-type stabilizer rounds.
Preview of the next lesson:
We now know how to generate the error syndrome—the set of violated stabilizer outcomes. The next challenge is to use this information to infer the most likely error that occurred. In the next lesson, we will interpret syndrome measurement outcomes to identify error chains on the surface code lattice. This will lead us directly into the fascinating problem of quantum decoding.