# Can one easily compute the weight enumerator of a CSS code constructed from two binary codes $M_1,M_2$?

Consider a CSS code, which is constructed from two binary codes $$M_1$$ and $$M_2$$, so its symplectic matrix is of the form: $$\begin{pmatrix} M_1 & 0 \\ 0 & M_2 \end{pmatrix}.$$

Suppose one knows the weight enumerators of the binary codes $$M_1$$ and $$M_2$$. Can one easily compute the weight enumerator of the CSS code above? What about the special case of $$M_1=M_2$$?

Let us define the "symplectic weight" aka Pauli weight of a codeword $$m\in \mathbb F_2^{2n}$$ as $$\mathrm{swt}(m):= | \{ i \in [n] \; | \; m_i \neq 0 \text{ or } m_{n+i} \neq 0 \}|.$$ This is the Hamming weight when seeing $$M$$ as an additive $$\mathbb{F}_4$$ code. The weight $$\mathrm{wt}(c)$$ of a classical code word $$c\in\mathbb F_2^n$$ is simply the Hamming weight of $$c$$, i.e. the number of non-zero entries.
Any code word in $$M:=\mathrm{CSS}(M_1,M_2)$$ for $$M_1\subset M_2^\perp$$ is of the form $$m=(m_1,m_2)$$ for $$m_1\in M_1$$ and $$m_2\in M_2$$. By definition, we have $$m_1\cdot m_2 = 0$$, hence the following function takes even values on $$M$$: $$\mathrm{y}(m) := |\{ i \in [n] \; | \; m_i = 1 = m_{n+i} \}|.$$ Thus, we have the relation for $$m=(m_1,m_2)\in M$$: $$\mathrm{swt}(m)=\mathrm{wt}(m_1) + \mathrm{wt}(m_2) - \mathrm{y}(m)$$ Due to this additional term, it seems that the classical weight enumerators of $$M_1$$ and $$M_2$$ are insufficient to capture the weight distribution of the CSS code $$M$$.
• I am not sure that is right. suppose I consider a word, written in symplectic notation $(1~0 | 1~0)$ formed from the two binary words $(1 0)$ and $(1 0)$. Its weight is one, not two. – guest-20 Feb 25 at 6:29
• You are right. Somehow I confused myself and thought about Hamming weight not "symplectic weight". Your example does not work, though, since the two words have to be orthogonal. We are basically overcounting by an even number which corresponds to $m_1\cdot m_2$, but computed in the integers. I am not sure if that function has another interpretation. I though I could find something in the literature (Calderbank, Rains etc.) but was unsuccessful. – Markus Heinrich Feb 25 at 8:47