ArticleslgStudy

physics

Surface code

Surface code is a physics topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Surface code rather than just read about it. In short: The surface code is a topological quantum error correcting code, and an example of a stabilizer code, defined on a two-dimensional spin lattice. The first type of surface code introduced by Alexei Kitaev in 1997 was the toric code, which gets its name from its periodic boundary conditions, giving it the shape of a torus.

Surface code — main illustration
Surface code — illustration

Key takeaways

  • Surface code belongs to physics; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Surface code to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Surface code from memory before moving on to harder problems.

Reference excerpt

The surface code is a topological quantum error correcting code, and an example of a stabilizer code, defined on a two-dimensional spin lattice. The first type of surface code introduced by Alexei Kitaev in 1997 was the toric code, which gets its name from its periodic boundary conditions, giving it the shape of a torus. These conditions give the model translational invariance, which is useful for analytic study. The toric code is the simplest and most well studied of the quantum double models. It is also the simplest example of topological order—Z2 topological order (first studied in the context of Z2 spin liquid in 1991). The toric code can also be considered to be a Z2 lattice gauge theory in a particular limit. However, on many quantum computation platforms, experimental realization of a surface code is much easier if the code can be embedded on a 2D plane. This motivated the design of another type of surface code with open boundary conditions, the planar code. As of 2025, Google Quantum AI has implemented a distance-7 planar code on their newest generation of superconducting quantum processors, Willow processor, demonstrating a below-threshold physical error rate.

Definition The surface code is defined on a two-dimensional lattice, usually chosen to be the square lattice. Below, we will first illustrate the basic concept with the toric code, where the lattice has periodic boundary conditions, i.e., the top boundary is connected to the bottom and the left boundary to the right. Topologically, this is equivalent to defining the lattice on a torus.

A qubit is located on each edge of the lattice. For a d × d lattice, there are d2 horizontal edges and d2 vertical edges, thus 2d2 qubits in total. Stabilizer operators are defined on the qubits around each vertex v and plaquette (face) p of the lattice as follows: Av=∏i∈vXi,Bp=∏i∈pZi. Here i∈v denotes the edges touching the vertex v, and i∈p denotes the edges surrounding the plaquette p. The code space of the toric code is the subspace for which all stabilizers act trivially, hence for any state |ψ⟩ in this space it holds that Av|ψ⟩=|ψ⟩,∀v,Bp|ψ⟩=|ψ⟩,∀p. For the toric code, this space is four-dimensional, and so can be used to store two qubits of quantum information. This can be proven by considering the number of independent stabilizer operators: For a d × d lattice, there are d2 vertex stabilizers and d2 plaquette stabilizers, but the product of all vertex stabilizers is I and so is the product of all plaquette stabilizers. Therefore there are 2d2 − 2 independent stabilizers, leaving 2 qubits worth of degrees of freedom. The occurrence of errors will usually move the state out of the code space, resulting in vertices and plaquettes for which the above condition does not hold. Specifically, a Pauli Z error on qubit i flips the two vertex stabilizers Av such that i∈v (the endpoints of the edge i), and a Pauli X error on qubit i flips the two plaquette stabilizers Bp such that i∈p (the plaquettes on either side of the edge i). The positions of these violations is the syndrome of the code, which can be used for error correction. The unique nature of topological codes such as the surface code is that stabilizer violations can be interpreted as quasiparticles. Specifically, if the code is in a state |ϕ⟩ such that Av|ϕ⟩=−|ϕ⟩, a quasiparticle known as an e anyon can be said to exist on the vertex v. Similarly a violation of some Bp is associated with an m anyon on the plaquette p. The code space, with no stabilizer violation, corresponds to the anyonic vacuum. The above-mentioned fact that the product of all vertex (resp. plaquette) stabilizers is I means that the number of e (resp. m) anyons on a toric code is always even.

A single-qubit Z error can be associated with an edge, and creates a pair of e anyons at both endpoints of that edge. However, two e anyons at the same location will annihilate each other, so a Z error can also effectively move an e anyon along an edge, allowing e anyons to be transported on the lattice. If the initial pair of anyons end up meeting each other and annihilating, then their paths form a loop.

If the loop is topologically trivial, then it can be written as a combination of plaquettes (Z stabilizer generators) on the lattice. Therefore the loop represents a Z stabilizer of the code, and has no effect on the stored information. The annihilation of the anyons, in this case, corrects all of the errors involved in their creation and transport. However, if the loop is topologically non-trivial, then it represents a non-trivial logical operator. Although re-annihilation of the anyons returns the state to the code space, it also implements a logical operation on the stored information. The errors, in this case, are therefore not corrected but consolidated. On a torus, there are two independent topologically non-trivial loops: One looping horizontally on the toric code lattice, one looping vertically. These can be identified with the Z operators of the two logical qubits encoded in the toric code. By considering the dual graph of the lattice, it can be seen that the above paragraph also applies to X errors and m anyons. Note that the horizontal Z operator and the vertical X operator belong to the same qubit, and vice versa. This ensures the correct commutation relations between logical operators.

… excerpt ends here. Continue reading the full article.

Illustrations

Surface code: The topologically nontrivial loops of the torus. Moving anyons along these implement logical Pauli operators on the stored qubits.
The topologically nontrivial loops of the torus. Moving anyons along these implement logical Pauli operators on the stored qubits.

Worked examples

Example 1 — a first encounter with Surface code

Start with the simplest possible case. Write down what Surface code claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In physics, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Surface code before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Surface code ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Surface code

In research
Surface code appears in physics research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Surface code in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Surface code is common in secondary-school and first-year university syllabi. It links to neighbouring topics Condensed matter physics, Fault-tolerant computer systems, Quantum information science, so understanding it makes those chapters shorter.
In everyday life
Look for Surface code outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Surface code” →

How to study Surface code in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Surface code means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Surface code out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Surface code in simple terms?

The surface code is a topological quantum error correcting code, and an example of a stabilizer code, defined on a two-dimensional spin lattice. The first type of surface code introduced by Alexei Kitaev in 1997 was the toric code, which gets its name from its periodic boundary conditions, giving i…

Why does Surface code matter?

Because it connects several physics ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Surface code?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Surface code.

Tags

  • Condensed matter physics
  • Fault-tolerant computer systems
  • Quantum information science
  • Quantum phases

Keep exploring