Implications of commuting within the code space

The question:

I have a Hilbert space $$\mathcal{H}=\mathcal{H}_A\otimes \mathcal{H}_B$$, and a codespace $$\mathcal{H}_{code}\subset \mathcal{H}$$, so that $$\mathcal{H}=\mathcal{H}_{code}\oplus\mathcal{H}_\perp$$. I know that for all $$\psi,\phi\in \mathcal{H}_{code}$$, and for all $$\mathcal{O}_A=\mathcal{O}_A\otimes \mathcal{I}_B$$, we have

$$\langle\phi|[\mathcal{O}_A,\mathcal{O}]|\psi\rangle =0$$

I would like to know what I can conclude about the operator $$\mathcal{O}$$ from this.

Some thoughts:

Without the projection into the codespace, we could conclude that $$\mathcal{O}=\mathcal{O}_B$$. With the projection, the most general thing I can think to write down that satisfies the constraint is

$$\mathcal{O}=\mathcal{O}_B + \Pi_\perp \mathcal{O}'\Pi_\perp$$

for any operator $$\mathcal{O}'$$, where $$\Pi_\perp$$ projects onto $$\mathcal{H}_\perp$$. There may be a more general expression, however.

The most related statements I have found occur in the context of operator algebra quantum error correction. For instance (see for instance Preskill and Pastawski, theorem 1) the condition to correct a noise channel $$\mathcal{N}(\cdot)=\sum_k N_k(\cdot )N_k^\dagger$$ with respect to an algebra $$\mathcal{A}$$ is that

$$[X,\Pi N_k^\dagger N_l \Pi]=0$$

for all $$X\in \mathcal{A}$$ and all Kraus operators $$N_l,N_k$$. This looks like my condition if I took $$\mathcal{O}_A$$ to be a logical operator. This has lead me to study von Neumann algebras and the theory of operator algebra quantum error correction, but so far this has not been fruitful in answering my original question.

• Note that I am more or less repeating this question from the math stack exchange: math.stackexchange.com/questions/3448634/…. Since I have not received any answers there I thought I would reframe the question in a quantum information context (the context in which it arose) and put it here as well. If thats not in line with community guidelines I can take down the math posting. – Alex May Nov 26 '19 at 21:39

I have some ideas

1) Since $$[\mathcal{O}^\dagger_A, \mathcal{O}] = - [\mathcal{O}_A, \mathcal{O}^\dagger]^\dagger$$ and $$\mathcal{O} = (\mathcal{O}+\mathcal{O}^\dagger)/2 + (\mathcal{O}-\mathcal{O}^\dagger)/2$$ you can solve it only for self-adjoint operators $$\mathcal{O}=\mathcal{O}^\dagger$$. And even more, you can consider only real self-adjoint operators $$\mathcal{O} = \mathcal{O}^\dagger = \mathcal{O}^T$$.

2) You can rewrite your equation as $$\text{Tr}\big( \mathcal{O} \cdot [E_{\psi\phi}, \mathcal{O}_A]\big) = 0,~~ E_{\psi\phi} = |\psi\rangle\langle \phi|$$ hence it must be $$\text{Tr}\big( \mathcal{O} \cdot [\Pi X \Pi, \mathcal{O}_A]\big) = 0$$ for every operator $$X$$ on $$\mathcal{H}$$.
Also the last equation means that $$\mathcal{O}^\dagger$$ is orthogonal to the subspace $$\mathrm{span}\{[\Pi X \Pi, \mathcal{O}_A]\}$$ in the operator space with the Hilbert-Schmidt inner product on it.

Update

Using the last characterization it's not hard to show that there is a counterexample to your guess of a general formula. Let $$|\phi\rangle = |v\rangle_A|w\rangle_B$$ and $$\mathcal{H}_{code} = \{\lambda |\phi\rangle, \lambda \in \mathbb{C}\}$$, i.e. it's 1-dimensional and generated by a product state. In this case $$\Pi X \Pi = \chi |\phi\rangle\langle\phi| = \chi |v\rangle\langle v| \otimes |w\rangle\langle w|$$ So $$[\Pi X \Pi, \mathcal{O}_A \otimes I_B] = [\chi |v\rangle\langle v|, \mathcal{O}_A ] \otimes |w\rangle\langle w|$$ The last expression is not equal to zero only if $$[\chi |v\rangle\langle v|, \mathcal{O}_A ] \neq 0$$.

It's easy to see that if $$[M,E_{11}]=0$$, where $$M$$ is some $$n \times n$$ matrix and $$E_{11}$$ is a matrix with a single non-zero element in the $$(1,1)$$ position, then it must be $$m_{12}=m_{13}=...=m_{1n}=0, m_{21}=m_{31}=...=m_{n1}=0$$ (and vice versa). So dimension of the subspace $$\text{span}\{[M,E_{11}]\}$$ equals to $$2(n-1)$$.

Let $$d_A = \text{dim}\mathcal{H}_A$$, $$d_B = \text{dim}\mathcal{H}_B$$. We have that $$\text{dim} \big( \text{span} \{ [\Pi X \Pi, \mathcal{O}_A \otimes I_B] \} \big) = 2(d_A-1)$$ So dimension of the subspace of solutions $$\mathcal{O}$$ must be $$d_A^2d_B^2 - 2(d_A-1)$$
But your general formula gives no more than $$d_B^2 + (d_Ad_B-1)^2$$ dimensional subspace. If $$d_B=2$$ and $$d_A>2$$ it's just not enough.