# Distance of concatenated codes: a counter example?

In the following answer to a recent question, it is claimed that when we concatenate two error correcting codes of distances $$d_1$$ and $$d_2$$, the greatest distance that we can prove without assuming any structure of the code is $$d_1d_2/2$$ while if we know something about the structure, e.g. that it's a CSS code, the distance is at least $$d_1d_2$$.

Are there any known examples of pairs of codes for which the combined distance is less than $$d_1d_2$$? For preference, the codes should be on qubits and expressed within the stabilizer formalism, if that is even possible. The smaller the better!

• Do you want an example only for error-correcting code? Otherwise, a simple example would be concatenating $[\![4,2,2]\!]$ code with $[\![4,2,2]\!]$ yeilds $[\![8,2,2]\!]$ code. Dec 5, 2023 at 21:50
• that would do, if you could provide me with some details (it's not a code I know) Dec 6, 2023 at 8:45

## $$[\![4,2,2 ]\!]$$ code

$$[\![4,2,2 ]\!]$$ is the smallest quantum error-detecting code which can detect a single qubit error. Let's work with the following generators-

\begin{align} g_1 &= XZZX \,,\tag{1.1}\\ g_2 &= YXXY \,.\tag{1.2} \end{align}

Let's choose the logical operators- \begin{align} \overline{X_1} &= XIYY \,, \tag{2.1}\\ \overline{X_2} &= XIXZ \,,\tag{2.2}\\ \overline{Z_1} &= YZYI \,,\tag{2.3}\\ \overline{Z_2} &= IXZZ \,.\tag{2.4} \end{align}

## Concatenating $$[\![4,2,2 ]\!]$$ with $$[\![4,2,2 ]\!]$$

Let $$\mathcal{C}_1 \equiv [\![4,2,2 ]\!] \equiv [\![n_1,k_1,d_1 ]\!]$$ & $$\mathcal{C}_2 \equiv [\![4,2,2 ]\!] \equiv [\![n_2,k_2,d_2 ]\!]\,.$$

Let's concateate $$\mathcal{C}_1$$ & $$\mathcal{C}_2$$. Let the resultant code be $$\mathcal{C} \equiv [\![n,k,d ]\!]\,.$$

Let's first encode two qubits into four qubits, which are then partitioned into two blocks. Block 1 contains qubits $$i$$ and $$ii$$, and block 2 contains qubits $$iii$$ and $$iv$$.

Now, encode the $$j^{\text{th}}$$ block, say $$B(j)$$ using code $$\mathcal{C}_2$$.

The qubits in block $$B(1)$$ will be labelled $$1,2,3,4$$. The qubits in the block $$B(2)$$ will be labelled $$5,6,7,8$$.

Thus, final code $$\mathcal{C}$$ has $$n=8$$.

Each block $$B(j)$$ gets the copy of generators of $$\mathcal{C}_2$$. Hence, we can write first four generators for $$\mathcal{C}\,,$$ where block $$B(1)$$ have

\begin{align} g_1 &= X_1Z_2Z_3X_4 \,,\tag{3.1}\\ g_2 &= Y_1X_2X_3Y_4 \,.\tag{3.2} \end{align}

and block $$B(2)$$ have

\begin{align} g_3 &= X_5Z_6Z_7X_8 \,,\tag{3.3}\\ g_4 &= Y_5X_6X_7Y_8 \,.\tag{3.4} \end{align}

The two remaining generators are the images of $$\mathcal{C}_1$$ under $$\mathcal{C}_2$$. By doing some algebra (using the logical operators given in Eqs.$$(2.1)$$ to $$(2.4)$$), you can see that $$\mathcal{C}_2$$ maps the generators of $$\mathcal{C}_1$$ as follows-

\begin{align} g_5 &= X_iZ_{ii}Z_{iii}X_{iv} = X_1 X_2 X_3 X_4 Z_5 Z_6 Z_7 Z_8\,,\tag{3.5}\\ g_6 &= Y_iX_{ii}X_{iii}Y_{iv} = Y_1 Z_2 X_3 X_4 I_5 X_6 I_7 Y_8\,.\tag{3.6} \end{align}

The number of generators, $$r = n-k = 6$$, hence $$k=2$$, as expected-

We can check that all single-qubit errors anticommute with at least one generator of $$\mathcal{C}$$.

However, weight two errors like $$Z_1Y_2$$ commutes with all generators and $$Z_1 Y_2 \in N(S) \setminus S\,.$$ Hence, $$d=2$$.

## Conclusion

Concatenating $$[\![4,2,2 ]\!]$$ & $$[\![4,2,2 ]\!]$$ results in the $$[\![8,2,2 ]\!]$$ code, and thus satisfying your required condition, $$d < d_1 d_2\,.$$

## Note$$^1$$

The result about distances after code concatenation is much more general than what you have linked.

Concatenating two quantum stabilizer codes $$[\![n_1,k_1,d_1]\!]$$ (as outer layer) and $$[\![n_2,k_2,d_2]\!]$$(as inner layer) gives you a resultant code $$[\![n,k,d]\!]$$ where

Case(1):

• $$n = n_1 n_2\,,$$
• $$k = k_1 k_2 \,,$$
• $$d \geq d_1 d_2\,,$$

holds true if $$n_1 (\text{mod } {k_2}) \neq 0\,.$$

Case(2):

• $$n = \frac{n_1 n_2}{k_2}\,,$$
• $$k = k_1 \,,$$
• $$d \geq \frac{d_1 d_2}{k_2}\,,$$

holds true if $$n_1(\text{mod } {k_2}) =0\,.$$

So, it's preferable to pick codes for which $$k_2$$ does not divide $$n_1$$.

1: Reference for the note$$\to$$ Theorems 3.5 & 3.6 in Frank Gaitan (2008), Quantum Error Correction and Fault Tolerant Quantum Computing, Taylor & Francis Group.

• Do you have a reference for your note? Dec 7, 2023 at 7:25
• @DaftWullie Theorems 3.5 & 3.6 in Frank Gaitan (2008), Quantum Error Correction and Fault Tolerant Quantum Computing, Taylor & Francis Group. Dec 7, 2023 at 7:51
• hmmm I can't seem to lay my hands easily on that book, so I'm trying to reconstruct the result for myself. I think I see it, however, are you missing a case: where $n_1$ and $k_2$ share a common factor that's not $1,k_2$? I assume you get a similar bound of $n=\frac{n_1n_2}{\text{gcd}(n_1,k_2)}$ and $d\geq \frac{d_1d_2}{\text{gcd}(n_1,k_2)}$? Dec 8, 2023 at 10:41
• @DaftWullie This is interesting. Can you elaborate, what concatenation procedure you are using here? I tried few random examples, and it seems that then also get- $$k = \frac{k_1 k_2}{\text{gcd}(n_1, k_2)}$$ My concern, in this case, is that- can you get generators for $\mathcal{C}$ with this type of concatenation procedure, starting with generators for $\mathcal{C}_1$ and $\mathcal{C}_2$? Whereas getting generators for $\mathcal{C}$ with a concatenation procedure where $n = n_1 n_2$ is fairly straightforward. Dec 9, 2023 at 2:37
• I think the construction works exactly as you'd expect it to. Let $n_1=pr$ and $k_2=sr$ where $r=\text{gcd}(n_1,k_2)$. For you first code, you've got a stabilizer which you can block into sections of length $r$. You can collect $s$ of these together and each Pauli operator in those $sr$ qubits translates into a logical operator of $n_2$ qubits. There may be one last logical qubit that you have to pad a bit to make up the numbers. Dec 11, 2023 at 7:38