# What is the motivation for using dual lattice in the surface code?

I'm learning surface codes from a theoretical perspective. In all the literature I read, they just introduced the dual lattice for working with $$Z$$ strings without many words addressing why we need to do this. And it seems to me that all the stuff they did on the dual lattice can be done in the original lattice.

I can think of two needs for using dual lattice. One is that we only have measure qubits on the facets so need to switch to dual lattice to measure the other set of stabilizers. The other is to make the drawing more clear to the readers.

Are there any deeper mathematical or theoretical motivations?

Literature I have read: An Introduction to Topological Quantum Codes by Bombin; Quantum Error Correction for Beginners by Devitt et al.; Surface codes: Towards practical large-scale quantum computation by Fowler et al.

## Primal and dual lattice

We do not need to use the dual lattice. The observation that the primal lattice is sufficient to describe both the $$X$$- and $$Z$$-type stabilizer generators is correct. To that end, we associate the data qubits with the edges of the lattice, one type of operators, e.g. $$X$$, with the vertices and the other type of operators, e.g. $$Z$$, with the faces of the lattice.

However, the use of the dual lattice is an elegant way to compress the description of the code since it emphasizes the symmetry that exists between the two stabilizer types. The symmetry mimics the familiar symmetry of primal lattice and dual lattice that maps primal vertices to dual faces, primal edges to dual edges (orthogonal to the primal edges) and primal faces to dual vertices.

## Geometry

Note that the key property of vertices relevant to the definition of the surface code is that each vertex is incident on (usually) four nearby edges. The key property of faces is exactly the same: each face is incident on (usually) four nearby edges. Features that distinguish vertices and faces, such as their geometric dimension, are irrelevant. The use of primal and dual lattice underscores this fact.

The incidence relationships arise naturally from the geometry of either lattice. However, what is essential for the definition of the surface code is not the geometry, but the incidence relationships. They determine which stabilizer generators act on which data qubits and that is ultimately what defines a stabilizer code.

(That said, the fact that the incidence relationships arise from a two-dimensional geometry does make the code highly practical for implementation on quantum processors that have the form of a two-dimensional grid of qubits.)

## Measure qubits

At the most abstract level, the surface code does not include measure qubits. Instead, it consists of data qubits and a collection of observables called stabilizer generators. The observables mostly take the form of four-body Pauli operators $$XXXX$$ and $$ZZZZ$$ and measure $$+1$$ when the state of the system is in the code subspace.

In practice, hardware platforms generally do not provide direct means of measuring such four-body operators. Therefore, in order to accomplish the measurement we use auxiliary qubits, allow them to interact with four data qubits and measure them instead. On some level, this can be thought of as an implementation detail in the sense that on a hypothetical platform which did provide the four-body measurements as elementary operations no measure qubits would be needed at all.

If you study abstract questions such as the code distance or the form of logical operators then you can ignore the technical details of how the four-body measurements are accomplished including the existence of measure qubits. On the other hand, if you study questions about fault-tolerance or code placement on specific hardware, then those details are important and you must account for the measure qubits.

## Drawing the surface codes

Drawing the surface code is equally convenient on the primal and dual lattice. Drawing both at the same time is likely to make the drawing less legible.

For an alternative way of drawing the so-called rotated surface codes, see figure 13 on page 19 and the surrounding discussion in this paper. In this representation, data qubits correspond to vertices and operators of both types are represented as faces of the lattice.