Equivalent definition of distance for nondegenerate code

Let $$\mathcal{C}$$ be a nondegenerate quantum code. Is it true that $$\mathcal{C}$$ has distance $$d$$ if and only if $$d$$ is the minimum nonzero weight of an error that preserves the codespace?

For a degnerate code this is certainly not true, for example the $$[[9,1,3]]$$ Shor code has distance $$d=3$$ but there are nonidentiy Paulis in the stabilizer like $$ZZI III III$$ of weight $$2$$. So the minimum nonzero weight of an error that preserves the codespace is $$2<3$$.

It is interesting to note that when the codespace has dimension 1 then the normal definition of distance is not well defined but the code is automatically nondegenerate and in the classic paper https://arxiv.org/pdf/quant-ph/9608006.pdf, on page 10, the distance of an $$[[n,0]]$$ code (a stabilizer state) is actually just defined as the smallest non-zero weight of any stabilizer of the code.

Update: I think DaftWullie is right that the way the question was originally asked is a bit circular. The correct way to ask it would be: Given a nondegenerate code of distance $$d$$ is it true that the minimum nonzero weight of a linear operator that preserves the codespace must be $$d$$?

Note: I define the weight of an operator to be $$n-\tau$$ where $$n$$ is the number of qubits in the Hilbert space and $$\tau$$ is the number of qubits on which the operator acts trivially (up to global phase). So any multiple of the identity has weight $$0$$. $$ZZIIIIIII$$ has weight $$2$$, and a generic linear operator has weight $$n$$.

You might want to more carefully specify what you mean by an error. There are several different concepts that one might take:

• any non-identity Pauli operator (I think this is how you're using it)
• any Pauli operator that has a non-trivial syndrome
• any Pauli operator that is not in the stabilizer of the code

For the distance, I would define it to be the minimum weight of a Pauli operator that preserves the codespace (commutes with the stabilizers) AND is not in the stabilizer. This works for both degenerate and non-degenerate codes (your example for the Shor code is eliminated because that's a stabilizer).

If you want to further revise that statement for just non-degenerate codes, then you can define a non-degenerate code as one for which every Pauli operator of weight $$\leq\lfloor d/2\rfloor$$ has a unique syndrome. This means that all operators that commute with the stabilizer have weight at least $$d$$ (If not, take that stabilizer and chop it in two. Both bits have the same syndrome.). Hence, the distance is, indeed, the minimum weight Pauli operator that preserves the codespace. But to be able to use that to determine the distance, you already need to know that the code is degenerate, which means you already need to know the distance to check the uniqueness of the syndromes. It's at risk of being a little circular!

Now that I think more about it I agree with DaftWullie that it is a bit of a circular question since distance is an independently defined quantity but purity/nondegeneracy of a code is always defined relative to distance, which is assumed to already be known.

Define weight enumerators \begin{align*} A_i &= \frac{1}{(Tr(\Pi))^2} \sum_{E \in \mathcal{E}_i} |Tr(E \Pi)|^2 \\ B_i &= \frac{1}{Tr(\Pi)} \sum_{E \in \mathcal{E}_i} Tr( E \Pi E \Pi) \end{align*} Here $$\Pi$$ is the code projector and $$\mathcal{E}_i$$ are the Pauli errors with weight $$i$$. The the code has at least distance $$d$$ if and only if both $$A_d < B_d$$ and $$A_i=B_i$$ for all $$i \leq d-1$$. And the code is pure if $$A_i=0$$ for all $$1 \leq i \leq d$$.

Incidentally, for a codespace of dimension 1 then $$A_i=B_i$$ for all $$i$$. So we have an issue with the definition of distance since there will never be a value of $$d$$ for which $$A_d. In this case there are multiple conventions, discussed here Knill-Laflamme error correction conditions for codespace of dimension 1 and in my linked posts therein. One convention is to say $$d=\infty$$ which isn't very interesting because it assign the same distance to all codespaces of dimension 1. Another convention is to just define distance in this case to be the least $$i \geq 1$$ such that $$B_i \neq 0$$ (for a stabilizer code with $$k=0$$/stabilizer state that means defining $$d$$ to be the smallest weight of a nonidentity stabilizer as in https://quantumcomputing.stackexchange.com/a/27905/19675) (recall that $$A_i=B_i$$ for all codespace of dimension 1 so this is the same as smallest $$i \leq 1$$ such that $$A_i \neq 0$$ which is why it is phrased in the linked answer in terms of the stabilizer no the normalizer)(I prefer talking about it in terms of $$B_i$$ because the statement about distance is still true for all nondegenerate codes of any codespace dimension)(for those not familiar with weight enumerators the best intuition is that $$A_i$$ is the number of Paulis in the stabilizer of weight $$i$$, and $$B_i$$ is the number of Paulis in the normalizer of weight $$i$$ Are the coefficients of the weight enumerator polynomial of a stabilizer code always integers?).