# What information about the logical state does one obtain from the stabilizers?

Consider the initialization of a surface code into $$\vert 0\rangle_L$$. This is done by initializing all the data qubits into $$\vert 0\rangle$$ respectively and then turning on the $$XXXX$$ and $$ZZZZ$$ stabilizers. The $$ZZZZ$$ stabilizers all give value $$+1$$ and the $$XXXX$$ stabilizers give random outcomes. However, let's assume that we got lucky in our current experiment and got all $$+1$$ outcomes for both $$X$$ and $$Z$$ stabilizers.

Now consider initializing to $$\vert +\rangle_L$$. This is done by transversally initializing all data qubits to $$\vert +\rangle$$, then turning on the same stabilizers. Let's assume we got lucky with the $$Z$$ stabilizers this time and all the eigenvalues are again $$+1$$.

It seems that knowing the stabilizer outcomes is not sufficient to know whether my logical state is $$\vert 0 \rangle$$ or $$\vert +\rangle$$.

In general, given $$n$$ qubits that are in the $$+1$$ eigenstate of $$k$$ stabilizers, what, if anything, can we say about the logical state of the $$n-k$$ remaining logical qubits?

TL;DR Yes, getting $$+1$$ outcomes for all stabilizers only tells you that it is a logical state but gives no information as to which state it is. You cannot conclude anything about the logical state from stabilizer measurement outcomes. For a stabilizer code, $$n-k = r$$ stabilizer splits the total Hilbert space into $$2^r$$ different orthogonal subspaces. The only information that stabilizer measurements give us is to tell us which subspace our state lies in. If your state is in the codespace, all stabilizer measurements would be $$+1$$ outcomes. If it is not in the codespace, some (at least one) stabilizer measurement outcome would be $$-1$$.

For simplicity, I will use $$0$$ for $$+1$$ outcome and $$1$$ for $$-1$$ outcome for stabilizer measurements.

For an $$[\![n,k,d]\!]$$ stabilizer code, with stabilizer generators $$\langle S \rangle$$ and $$|S| = n-k=r\,,$$ i.e., there are $$r$$ different stabilizer generators. Each stabilizer measurement splits the total Hilbert space of $$n$$ qubits, $$\mathcal{H}$$, into two parts, one with outcome $$0$$ and one with outcome $$1$$. Then the total Hilbert space of $$n$$ qubits, $$\mathcal{H}$$ of dimension $$2^n$$ is split into $$2^r$$ different orthogonal subspaces with each having $$2^{n-r} = 2^k$$ dimensions.

$$\mathcal{H} = \bigoplus_{J = 1}^{2^r}\mathbb{C}^{2^k} \,.$$

Each subspace thus then corresponds to a particular stabilizer measurement outcome, i.e., the binary string of $$r$$ bits. The codespace is the subspace where all stabilizers give $$0$$ outcome, so the corresponding syndrome is $$00\cdots0$$. Similarly, each such orthogonal subspace will correspond to a $$r$$ bit binary string.

So, the only information syndrome measurement gives is to tell us which subspace our state lies in. If our state is in the codespace, it will give you syndrome $$00\cdots00$$. However, it does not have any information as to which state in the codespace it is. All $$0$$ syndrome only tells you that your state is in the codespace. Similarly, other syndrome measurement outcomes only tell you which subspace your state is in. This helps us make a decision as to which correction operation to apply to shift this other subspace back into the codespace.

### A simple example of a three-qubit repetition code

Consider a three-qubit repetition code. It has stabilizers $$ZZI$$ and $$IIZ$$. Each stabilizer will split the Hilbert space into two parts, and hence, there would be a total of 4 subspaces in the Hilbert space.

You can have 4 different stabilizer measurement outcomes. $$00, 01, 10, 11$$. The only information it provides you is to tell you which subspace your state lies in. If, say, for example, you get syndrome $$00$$, you can only conclude my state is in the codespace, i.e., my state must be of the form:

$$|\psi\rangle = a |000\rangle + b |111\rangle\,,$$ but you do not have any information about $$a$$ and $$b$$. You will get syndrome $$00$$ for every valid state of the above form, i.e., every logical encoded state.

Similarly, if you get a syndrome $$10$$, you can conclude that your state lies in the subspace spanned by $$\{|100\rangle, |011\rangle \}\,,$$ but the syndrome itself does not contain any information about which state it is. You will get the same syndrome $$10$$ for every state in this subspace.