# Defining logical X operator for surface code: equivalent possible definitions

I am currently learning the surface code and I wanted to know if there is an easy and intuitive way to find out all the equivalent possible definitions for the $$X_L$$ (Pauli-X logical operator).

In the following images, the black qubits surrounded by green are the $$Z$$ stabilizers, the black qubits surrounded by yellow the $$X$$ stablizers and the white circles are data qubits. The red cross means that I apply an $$X$$ operator on the associated data qubit.

I originally thought that as long as you have a crossing-line composed of $$X$$ Pauli then you have a logical $$X$$ operator defined. But I think it is not correct given my third example.

First example: this is the "standard" way to define the logical Pauli $$X$$: I could also do the following: But for instance, this wouldn't work: Indeed, if I am correct in this last example the $$Z$$ stabilizers of the third line, second and fourth column will not commute with the operator I applied.

Hence, is there a nice geometrical and intuitive interpretation to define logical operators or I have to check for each attempt to build a logical $$X$$ (which is crossing the surface with $$X$$ operators) if all the stabilizers are commuting ?

An X error on a data qubit places an edge between the two Z stabilizers adjacent to it. The edges must form a contiguous path from one side to the other to be an observable (or equivalently an undetectable logical error). The problem with your third example is you're missing one of the errors, which puts a gap in the path (resulting in the product anticommuting with the two stabilizers with only one edge touching them; an error made up of these bit flips would produce detection events there). Basically: things don't travel from data qubit to data qubit, they travel from stabilizer to stabilizer via the data qubits. This is why visual notation that emphasizes the stabilizers over the data qubits has become more common, I think. • Allright thanks! So on the intuitive level I should consider the stabilizer as being the central elements (the path goes from one stabilizer to another one through data qubits). Could you explain me your second image? I am not sure to understand what it means. Jan 10, 2022 at 18:58
• @StarBucK Each black/gray square/triangle is a stabilizer. Color indicates X vs Z basis, the corners of the shape are the data qubits involved in the stabilizer. The whole thing is tilted 45 degrees compared to the layout you're using, so you get squares instead of diamonds for the stabilizers. There are two holes punched out in the middle of the grid, and this creates a logical qubit with one observable spanning between the two holes and one observable wrapping around one of the holes. Basically... take your diagram, fatten the flowers into tiled diamonds, and rotate 45. Jan 10, 2022 at 19:01
• Ok! Thanks for the clarification I think I understand!! Jan 11, 2022 at 21:47

is there an easy and intuitive way to find out all the equivalent possible definitions for the Pauli-X logical operator

Suppose you have some specific $$X_L$$ that you know. Every equivalent observable $$X_L^\prime$$ will be equal to $$X_L$$ times a subset of the stabilizers of the code. This includes both X and Z stabilizers.

$$\text{EquivablentObservables}(X_L) = \left\{X_L \cdot \prod S {\Huge|} S \subseteq \text{Stabilizers}\right\}$$

You might have intended to only include the observables that were "simple" in some sense, like the direct paths from one side to the other, but the set also includes things like "the observable is three paths from one side to the other" and "the observable is a path from one side to the other oh and also there's this little contractible loop off to the side doing nothing".