Does a 3 qudit code always exist? (except for qubits)

There is a famous $$[[3,1,2]]_3$$ qutrit stabilizer code with stabilizer generators $$XXX$$ $$ZZZ$$ where it should be clear from context that $$X$$ and $$Z$$ here denote the appropriate qudit versions $$X= \begin{bmatrix} 0 & 0 & 1 \\ 1 & 0 & 0 \\ 0 & 1 & 0 \end{bmatrix}$$ and $$Z= \begin{bmatrix} 1 & 0 & 0 \\ 0 & \omega & 0 \\ 0 & 0 & \omega^2 \end{bmatrix}$$ where $$\omega=e^{2 \pi i /3}$$. Similarly for any qudit of dimension $$q$$, with $$q$$ odd, there is a $$[[3,1,2]]_q$$ stabilizer code with stabilizer generators given by $$XXX$$ $$ZZZ^{-2}$$ where $$X$$ and $$Z$$ here are the appropriate $$q \times q$$ qudit Pauli matrices (i.e. the "clock and shift" matrices given here https://en.wikipedia.org/wiki/Generalizations_of_Pauli_matrices ). Also to be clear $$Z^{-2}$$ is just the square of the inverse and could also be written as $$Z^{-2} =(Z^2)^\dagger=(Z^\dagger)^2$$ (note that for a qutrit $$Z^{-2}=Z$$ so this construciton just yields the standard 3 qutrit code).

What about qudits of dimension $$q$$ with $$q$$ even? Then this construction fails since the code cannot detect the single qudit error $$IIX^{q/2}$$ and so the distance will be $$d=1$$ instead of $$d=2$$. And at least for qubits ( $$q=2$$ ) we know it is impossible to have a $$[[3,1,2]]$$ stabilizer code. In fact it is impossible to have any, even non-stabilizer, code encoding a single logical qubit into three physical qubits, see Why can't there be an error detecting code with fewer than 4 qubits? .

So my question becomes: For a qudit of even dimension $$q >2$$ is it always possible to have a distance $$2$$ code encoding one logical qudit into $$3$$ physical qudits? Is it never possible? I am also interested in the much narrower stabilizer code version of this question i.e. do $$[[3,1,2]]_q$$ stabilizer codes exist for $$q>2$$ even?

One can show that a $$[\![3,1,2]\!]_q$$ can be purified to a $$[\![4,0,3]\!]_q$$ with a reference system; or reversely, the $$[\![4,0,3]\!]_q$$ "punctured" to a $$[\![3,1,2]\!]_q$$. This is a general feature of quantum maximum distance separable codes, see Proposition 7 in [1].

Now $$[\![4,0,3]\!]_q$$ codes are also known as absolutely maximally entangled states, and these have been shown to exist when $$n=4$$ for all q>2. For all $$q \neq 2,6$$ there exist classical Latin squares from which one can construct such states, for $$q=6$$ there is a recently found quantum construction, see [2] and also the table [3].

No stabilizer code has been found for $$q=6$$, but to my knowledge it is not excluded that there might exist an "exotic" one over some nice error basis [4,5].

• This is a fabulous answer thanks so much! I don't understand all the connections here nearly as well as you. What would be the $[[4,0,3]]_3$ code that is the purification of the $[[3,1,2]]_3$ code? And what would be a classical latin square from which one can construct that $[[4,0,3]]_3$ stabilizer state? Commented May 14 at 14:44
• Ok I was inspired by your answer so I asked a related question here quantumcomputing.stackexchange.com/questions/38300/… Commented May 14 at 16:58
• First time in ages for me to check SE, and lucky enough to come across a question I know something about :) Eq. 11 in arxiv.org/abs/1506.08857 gives you the 4-qutrit AME state (i.e. the $[\![4,0,3]\!]$), and Eq 28 gives you the corresponding pair of Latin squares. There is some work on when such constructions are equivalent to classical MDS codes and stabilizer codes, that should also be in the literature from these authors. Commented May 14 at 20:43
• So Fig. 3 in arxiv.org/abs/1306.2879 gives you the $[[4,0,3]]_3$ stabilizer code, that is stabilizer states. It is easy to check that the state has all 2-RDMs mixed by checking all products of at most 2 generators. You can see that this graph happens to work for all odd dimensions. Commented May 14 at 20:57
• For Proposition 7 that you mention above, there is a correspondence between $((n-1,q,n/2))_q$ QMDS codes and $((n,1,n/2+1))_q$ codes (equivalently $AME(n,q)$ states). Beneath Theorem 19 of arxiv.org/pdf/quant-ph/9612015 Rains says "If K = 1, this construction is reversible", which seems to imply that there is a general correspondence between $((n,1,d))_q$ codes and pure $((n-1,q,d-1))_q$ codes. Am I reading Rains correctly? Is this Proposition 7 a special case of the Rains result for when $d=n/2 +1$ ? Commented May 15 at 15:39