# Weight enumerators for Hermitian operator

Let $$H$$ be Hermitian operator on an $$n$$ qubit Hilbert space $$\mathbb{C}^{2^n}$$. Define the weight enumerator coefficients $$A_j=\frac{1}{(Tr(H))^2} \sum_{E \in \mathcal{E}_j} |tr(EH)|^2$$ where $$\mathcal{E}_j$$ is the set of all Paulis of weight $$j$$. And define the dual weight enumerator coefficients $$B_j=\frac{1}{Tr(H^2)} \sum_{ E \in \mathcal{E}_j} tr(EH E^{\dagger} H).$$ Is it the case that $$B_j \geq A_j$$ for all $$j$$?

Note that if $$H$$ is a projector, i.e. $$H^\dagger=H$$ and $$H^2=H$$ then this is a standard result from the theory of weight enumerators. I am wondering if it is still true when $$H$$ is Hermitian but not necessarily a projection.

I asked a similar question here, but used a wrong definition of $$B_j$$. Specifically, I divided by $$tr(H)$$, but should have divided by $$tr(H^2)$$ as in equation (4) of this paper.

• As @Adam Zalcman described below, this property relies on the positive definiteness of H. On the other hand the quantum MacWilliams identitiy between the A_j and B_j still holds, even if H is not positive semidefinite. Mar 15 at 8:33

TL;DR: No. We can actually blow $$A_j$$ up to infinity while simultaneously sinking $$B_j$$ negative.

## Sneaky plan

Coefficients $$A_j$$ cannot be negative, but if $$H$$ squares to identity and anticommutes with a Pauli $$E$$ then $$\mathrm{tr}(EHE^\dagger H)=-2$$ suggesting that we may be able to make $$B_j$$ negative (if the commuting terms don't contribute too much).

Now, the problem is that any such $$H$$ is necessarily traceless and the normalization coefficient in $$A_j$$ blows up due to division by zero. But this is even better! Let's blow $$A_j$$ up! We'll then have $$A_j\to +\infty$$ and $$B_j$$ finite and maybe even negative.

## Counterexample

We make the idea rigorous by constructing the following single-qubit countrexample. Set $$H=\epsilon I+X$$ for some $$\epsilon>0$$. Compute \begin{align} H^2&=(1+\epsilon^2)I+2\epsilon X\tag1\\ EHE^\dagger H&=(\epsilon I-X)(\epsilon I+X)=(-1+\epsilon^2)I\tag2\\ \mathrm{tr}(H)&=2\epsilon\tag3\\ \mathrm{tr}(H^2)&=2+2\epsilon^2\tag4\\ \mathrm{tr}(EHE^\dagger H)&=-2+2\epsilon^2\tag5 \end{align} where $$E\in\{Y,Z\}$$ and \begin{align} A_1&=\frac{1}{4\epsilon^2}(4+0+0)=\frac{1}{\epsilon^2}\tag6\\ B_1&=\frac{1}{2+2\epsilon^2}(2+2\epsilon^2-2+2\epsilon^2-2+2\epsilon^2)=\frac{-2+6\epsilon^2}{2+2\epsilon^2}\tag7 \end{align} so \begin{align} \lim_{\epsilon\to 0}A_j&=+\infty\tag8\\ \lim_{\epsilon\to 0}B_j&=-1\tag9 \end{align} as anticipated. This means that $$H$$ is a counterexample for sufficiently small $$\epsilon$$.

• oh nice this example is really cool and sneaky. You are awesome! Mar 14 at 0:08

This is just fleshing out some of the themes from Adam Zalcman's answer, which I have already accepted.

The standard proof that $$B_j\geq A_j$$ for a projection $$H$$ uses the spectral theorem to write $$H=\sum_{a} |a> where $$\{ |a> \}$$ is a basis for the codespace. From there one shows that $$A_j=\frac{1}{K^2} \sum_{E \in \mathcal{E}_j } \Bigg| \sum_{a} \Bigg|^2$$ and $$B_j=\frac{1}{K} \sum_{E \in \mathcal{E}_j } \sum_{a,b} \Bigg| \Bigg|^2$$ then shows that $$A_j \leq B_j$$ using Cauchy Schwarz for the $$K^2$$ length vectors $$$$ and $$\frac{1}{K}\delta_{ab}$$.

If $$H$$ is not a projection but merely a generic Hermitian operator then we can again use spectral theorem to write $$H=\sum_{a} a|a> where $$\{ |a> \}$$ is an orthonormal eigenbasis for $$H$$. From there one shows that $$A_j=\frac{1}{K^2} \sum_{E \in \mathcal{E}_j } |a|^2\Bigg| \sum_{a} \Bigg|^2$$ and $$B_j=\frac{1}{K} \sum_{E \in \mathcal{E}_j } \sum_{a,b} ab\Bigg| \Bigg|^2$$ if $$H$$ is positive semidefinite then we can still make the proof of $$A_j \leq B_j$$ work using Cauchy Schwarz for the $$K^2$$ length vectors $$\sqrt{a}\sqrt{b}$$ and $$\frac{1}{K}\delta_{ab}$$. This is a related, but slightly stronger, result than Theorem 3 of https://arxiv.org/abs/quant-ph/9611001

However if $$H$$ has a mix of positive and negative eigenvalues then the proof totally breaks down and not only do we not have $$0 \leq A_j \leq B_j$$ we may even get $$B_j < 0 \leq A_j$$ as in the example from Adam Zalcman above.

Indeed looking back at the example from Adam Zalcman we see that $$H$$ has eigenvalues $$\epsilon \pm 1$$. So for $$0< \epsilon <1$$ we indeed have negative eigenvalues. And for $$\epsilon=\frac{1}{2}$$ it is already clear that $$B_1<0\leq A_1$$.