How to get smaller stabilizer codes with Gottesman's construction?

I'm following the construction from Section 3.5 of Daniel Gottesman's thesis (third paragraph), which is supposed to allow us to construct an $$\left[ \hspace{-1pt} \left[ n-1, \, k + 1, \, d - 1 \right] \hspace{-1pt} \right]$$ stabilizer code $$C'$$ from an $$\left[ \hspace{-1pt} \left[ n, \, k, \, d \right] \hspace{-1pt} \right]$$ stabilizer code $$C$$, by:

1. Choosing a generating set $$\left \lbrace M_j \right \rbrace$$ for the stabilizers of $$C$$ such that there exists a qubit $$q$$ where $$M_1$$ has an $$X$$ on $$q$$, $$M_2$$ has a $$Z$$ on $$q$$, and the remaining $$M_j$$'s are not supported on $$q$$.
2. Removing $$M_1$$ and $$M_2$$ from $$\left \lbrace M_j \right \rbrace$$, and removing the now-unnecessary $$I$$ from each remaining generator to obtain $$\left \lbrace M'_j \right \rbrace$$.

For example, we can begin with the $$\left[ \hspace{-1pt} \left[ 5,\,1,\,3 \right] \hspace{-1pt} \right]$$ code: $$$$S = \begin{array}{ccccc} X & Z & Z & X & I \\ I & X & Z & Z & X \\ X & I & X & Z & Z \\ Z & X & I & X & Z \end{array},$$$$ we can choose a new generating set: $$$$S = \begin{array}{ccccc} X & Z & Z & X & I \\ I & X & Z & Z & X \\ X & I & X & Z & Z \\ Y & X & X & Y & I \end{array},$$$$ choose $$q$$ to be the rightmost qubit, $$IXZZX = M_1$$, $$XIXZZ = M_2$$. After removing these two generators and the rightmost qubit, we're left with $$$$S' = \begin{array}{cccc} X & Z & Z & X \\ Y & X & X & Y \end{array},$$$$ which is a $$\left[ \hspace{-1pt} \left[ 4,\, 2,\, 2 \right] \hspace{-1pt} \right]$$ code, as intended.

However, if we instead begin with the $$\left[ \hspace{-1pt} \left[9,\, 1,\, 3 \right] \hspace{-1pt} \right]$$ rotated surface code: $$$$S = \begin{array}{ccccccccc} Z & Z & I & I & I & I & I & I & I \\ X & X & I & X & X & I & I & I & I \\ I & Z & Z & I & Z & Z & I & I & I \\ I & I & X & I & I & X & I & I & I \\ I & I & I & X & I & I & X & I & I \\ I & I & I & Z & Z & I & Z & Z & I \\ I & I & I & I & X & X & I & X & X \\ I & I & I & I & I & I & I & Z & Z \end{array}.$$$$ I can take the leftmost qubit to be $$q$$, and the top two stabilizers to be $$M_2$$ and $$M_1$$ respectively. No other generator has support on $$q$$, so: $$$$S' = \begin{array}{ccccccccc} Z & Z & I & Z & Z & I & I & I \\ I & X & I & I & X & I & I & I \\ I & I & X & I & I & X & I & I \\ I & I & Z & Z & I & Z & Z & I \\ I & I & I & X & X & I & X & X \\ I & I & I & I & I & I & Z & Z \end{array}.$$$$ This code is intended to have distance 2, but it instead has distance 1. Am I doing something wrong?

I think that Gottesman's proof implicitly assumes that the stabilisers of the code all have weight which is at least that of the distance of the code: his construction of the distance says that assume you have a weight $$w$$ operator on the new set of qubits that commutes with them. Then there is an operator of weight $$w+1$$ that commutes with the original set of stabilizers. But he does not distinguish between whether that operator is a stabilizer or a logical operator, he just relates that to the original distance of the code.
• Isn't $Z_{1,2}$ a stabilizer? Mar 20 at 13:19