# Can we always simultaneously diagonalize $H_A \otimes \mathbb{1}$ and $\mathbb{1} \otimes H_B$?

Suppose we have systems $$A$$ and $$B$$ with respective Hamiltonians $$H_A \otimes \mathbb{1}$$ and $$\mathbb{1} \otimes H_B$$. These Hamiltonians commute, so they share the same eigenbasis and hence can be simultaneously diagonalized.

If we work in the shared eigenbasis, is it true that we can rewrite the Hamiltonians as $$D_A \otimes \mathbb{1}$$ and $$\mathbb{1}\otimes D_B$$ where $$D_A$$ and $$D_B$$ are diagonal matrices of $$H_A$$ and $$H_B$$ respectively?

If this is relevant, let's suppose that the total Hamiltonian is $$H = H_A \otimes \mathbb{1} + \mathbb{1} \otimes H_B.$$ My guess is that for this to work we need $$[H_A, H_B] = 0$$ and not $$[H_A \otimes \mathbb{1}, \mathbb{1} \otimes H_B] = 0$$, but I'm struggling to prove that.

Edit: $$H_A$$, $$H_B$$ have the same dimension.

• So the hamiltonians are acting on two separate subsystems? Commented Jan 5, 2023 at 23:42
• @Dani007 I've edited the question to make it more clear Commented Jan 5, 2023 at 23:47
• Do $A$ and $B$ necessarily have the same dimension? Commented Jan 6, 2023 at 0:00
• @MarkS I've edited the question. The answer is yes. Commented Jan 6, 2023 at 0:24

TL;DR: You can always achieve simultaneous diagonalization of $$H_A\otimes\mathbb{1}$$ and $$\mathbb{1}\otimes H_B$$ even if $$[H_A, H_B]\ne 0$$. And yes, this does follow from the fact that $$[H_A\otimes\mathbb{1}, \mathbb{1}\otimes H_B]=0$$. Moreover, it is true whether or not the Hilbert spaces of $$A$$ and $$B$$ have the same dimension.

I will prove it in two different ways. The first one shows that $$[H_A\otimes\mathbb{1}, \mathbb{1}\otimes H_B]=0$$ is the correct condition. The second also shows that diagonalization may be achieved in a product basis which is sometimes useful to know. Finally, I'll show the irrelevance of $$[H_A, H_B]$$.

## Simultaneous diagonalization

A general argument is to use the theorem about simultaneous diagonalization:

Theorem. If $$A$$ and $$B$$ are normal and $$[A,B]=0$$ then there exists unitary $$U$$ such that $$UAU^\dagger$$ and $$UBU^\dagger$$ are both diagonal.

See for example wikipedia. Recall that matrix $$M$$ is called normal if it commutes with its Hermitian conjugate, i.e. $$[M,M^\dagger]=0$$. All Hermitian matrices and all unitary matrices are normal.

To see how the theorem applies in your case, set $$A:=H_A\otimes\mathbb{1}$$ and $$B:=\mathbb{1}\otimes H_B$$. Note that both $$H_A\otimes\mathbb{1}$$ and $$\mathbb{1}\otimes H_B$$ are Hermitian and thus normal. Moreover \begin{align} [A,B]&=[H_A\otimes\mathbb{1}, \mathbb{1}\otimes H_B]\tag1\\ &=(H_A\otimes\mathbb{1})\circ(\mathbb{1}\otimes H_B) - (\mathbb{1}\otimes H_B)\circ(H_A\otimes\mathbb{1})\tag2\\ &= H_A\otimes H_B - H_A\otimes H_B\tag3\\ &=0.\tag4 \end{align} Thus, all assumptions of the theorem are satisfied and we obtain that there exists a unitary $$U_{AB}$$ such that $$U_{AB}(H_A\otimes\mathbb{1})U_{AB}^\dagger$$ and $$U_{AB}(\mathbb{1}\otimes H_B)U_{AB}^\dagger$$ are diagonal.

## Independent diagonalization

There is a simple way to reach the same conclusion which is less general, but also proves that $$U_{AB}$$ is a product unitary. It is based on the observation that the basis change on $$A$$ required for the diagonalization of $$H_A$$ is independent of the basis change on $$B$$ required for the diagonalization of $$H_B$$.

Suppose that $$V_A$$ is a unitary diagonalizing $$H_A$$ and $$W_B$$ is a unitary diagonalizing $$H_B$$ \begin{align} V_A H_A V_A^\dagger = D_A\tag5\\ W_B H_B W_B^\dagger = D_B\tag6 \end{align} where $$D_A$$ and $$D_B$$ are diagonal. Define $$U_{AB}:=V_A\otimes W_B$$. Then $$U_{AB}(H_A\otimes\mathbb{1})U_{AB}^\dagger = (V_AH_AV_A^\dagger)\otimes(W_B\mathbb{1}W_B^\dagger)=D_A\otimes\mathbb{1}\tag7$$ and similarly, $$U_{AB}(\mathbb{1}\otimes H_B)U_{AB}^\dagger = (V_A\mathbb{1}V_A^\dagger)\otimes(W_BH_BW_B^\dagger)=\mathbb{1}\otimes D_B.\tag8$$

## Irrelevance of $$[H_A,H_B]$$

As a counterexample to the relevance of $$[H_A,H_B]$$ consider $$H_A=X$$ and $$H_B=Z$$ where $$X$$ and $$Z$$ are the single-qubit Pauli matrices. Clearly, $$[X,Z]=-2iY\ne 0$$. However, both $$X\otimes\mathbb{1}$$ and $$\mathbb{1}\otimes Z$$ are diagonal in the basis consisting of $$|{+}\rangle|0\rangle$$, $$|{+}\rangle|1\rangle$$, $$|{-}\rangle|0\rangle$$ and $$|{-}\rangle|1\rangle$$.

I'm assuming these Hamiltonians act on separate subsystems, since that's the only way to guarantee that $$[H_A \otimes \mathbb{1}, \mathbb{1} \otimes H_B] = 0$$. Since the two Hamiltonians act on separate subsystems, they commute qubit-wise, which means you can apply diagonalizing unitaries to each subsystem independently. Let's say $$U_A$$ and $$U_B$$ diagonalize $$H_A$$ and $$H_B$$, respectively. Then $$U_A \otimes U_B$$ simultaneously diagonalizes both Hamiltonians.

Without loss of generality, let's look at just the first Hamiltonian, $$H_A \otimes \mathbb{1}$$. By the definition of diagonalization,

$$H_A \otimes \mathbb{1} = (U_A \otimes U_B) D (U_A \otimes U_B)^{\dagger}$$

Where $$D$$ is the diagonalized Hamiltonian. Because the diagonalizing unitaries acted on different components, we can write $$D$$ as a tensor product

$$D = D_A \otimes D_I$$

which gives us

$$H_A \otimes \mathbb{1} = U_A D_A U_A^{\dagger} \otimes U_B D_I U_B^{\dagger}$$

Since

$$U_B \mathbb{1} U_B^{\dagger} = \mathbb{1}$$

we can see that the diagonal Hamiltonian $$D$$ can indeed be written as $$D_A \otimes \mathbb{1}$$.