# Does one have multiple degrees of freedom in defining logical states and logical operators of a QEC?

Consider a rotated surface code. Let the surface code have $$Z$$ stabilizers along the top and bottom boundary and $$X$$ stabilizers along the left and right boundary.

If I initialize all the physical qubits in $$\vert 0\rangle$$ and then turn on the stabilizers, I have a logical state - let's call this state $$\vert 0\rangle_L$$. This is just an arbitrary choice, since I could have called it $$\vert 1\rangle_L$$ or $$\vert +\rangle_L$$ or anything else I like.

Now, is it still up to me to decide what is the logical $$X$$ operator of this code? We choose usually a row of physical $$X$$ operators to be defined as $$X_L$$. Given that I have called the surface code's logical state $$\vert 0\rangle_L$$, do I still have a second freedom of choice in what I define to be $$X_L$$?

Obviously, once I define $$X_L$$, the operator that anticommutes with it and commutes with all stabilizers is $$Z_L$$.

Almost...

Yes, the stabilizers of a code define a space. You are nominally free to pick any pair of states within that to be logical 0 and 1, and hence define logical Z.

You then have freedom to define the logical X to be anything that commutes with the stabilizers and anticommutes with logical Z. So the choice is not entirely arbitrary, but it's partially constrained. For a single qubit, you can visualise the Bloch sphere. I can pick any axis through the sphere to define Z. The equator around that axis gives you all the possible logical Xs.

So, why do I say almost? You're not quite finished. Once you've selected logical X and logical Z, there are two operators that anticommute with both. You have a further choice of which you want to be +Y and which -Y. In particular, that means that your statement

Obviously, once I define $$X_L$$, the operator that anticommutes with it and commutes with all stabilizers is $$Z_L$$.

is not so obvious. There are many operators that anticommute with $$X_L$$ and commute with all the stabilizers (all linear combinations $$\cos\theta Z_L+\sin\theta Y_L$$).

• Thanks! I had two questions: About the first paragraph, can I really pick any two states (that are not identical and are $+1$ eigenstates of all stabilizers) to be $\vert 0\rangle_L$ and $\vert 1\rangle_L$ respectively? Or are there more restrictions? I was doing it the other way i.e. first pick a specific stabilizer state to be logical $\vert 0\rangle$, then define logical $X$ (which is an arbitrary operator that commutes with all stabilizers but not a product of stabilizers itself) and go from there to determine logical $\vert 1\rangle$. Is my procedure also correct? Commented Jul 9 at 13:47
• Ah yes, your procedure also works so long as you ensure that logical X maps your logical 0 to an orthogonal state. But the Z logical is already implicitly defined by the selection of the state. Commented Jul 9 at 13:59
• There are no further restrictions that are mathematically imposed on you for selecting the logical states, although many authors that want to develop further results will typically assume that logical x and z are tensor products of paulis. Commented Jul 9 at 14:01
• Thank you for the clarifications Commented Jul 9 at 17:28