# Is ($|+⟩$$⟨0| + |-⟩$$⟨1|$ ) similar to ($|0⟩$$⟨+| + |1⟩$$⟨-|$ )?

Is ($$|+⟩⟨0|$$ + $$|-⟩⟨1|$$ ) similar to ($$|0⟩⟨+|$$ + $$|1⟩⟨-|$$ ) ?

Can we just reversed it this way when doing Dirac manipulation? I try to calculate HZH = X and i need to reverse the second H

• You can just write the matrix form of $H$ and do the calculation. Jul 22, 2021 at 13:28

In general, you cannot do this. One is the Hermitian conjugate of the other. Now, in this specific case, the operator is Hermitian so they happen to be equal.

• is all cases of H?H , i can do this way? how to know the operator is Hermitian, can elaborate more. I know U<t> = U Jul 22, 2021 at 13:47
• To know the operator is Hermitian: write out the (any) matrix representation using an orthonormal basis and check. Jul 22, 2021 at 14:23
• Can you do all cases of $H?H$ this way? That depends on what you mean. Yes, you can always say that $H=|+\rangle\langle 0|+|-\rangle\langle 1|=|0\rangle\langle +|+|1\rangle\langle -|$ because that is a mathematical identity. Jul 22, 2021 at 14:24

In this particular case, this is true as pointed out by DaftWullie. As commmented by narip, you can just write this out in the matrix form and see that they are equal. That is:

$$\begin{equation} |+\rangle \langle 0| + |-\rangle\langle 1| = \dfrac{1}{\sqrt{2}}\begin{pmatrix} 1 \\ 1 \end{pmatrix} \begin{pmatrix} 1 & 0 \end{pmatrix} + \dfrac{1}{\sqrt{2}}\begin{pmatrix} 1 \\ -1 \end{pmatrix} \begin{pmatrix} 0 & 1 \end{pmatrix} = \dfrac{1}{\sqrt{2}}\begin{pmatrix} 1 & 1 \\ 1 & -1 \end{pmatrix} \end{equation}$$ and $$\begin{equation} |0\rangle \langle +| + |1\rangle\langle -| = \begin{pmatrix} 1 \\ 0 \end{pmatrix} \dfrac{1}{\sqrt{2}}\begin{pmatrix} 1 & 1 \end{pmatrix} + \begin{pmatrix} 0 \\ 1 \end{pmatrix} \dfrac{1}{\sqrt{2}}\begin{pmatrix} 1 & -1 \end{pmatrix} = \dfrac{1}{\sqrt{2}}\begin{pmatrix} 1 & 1 \\ 1 & -1 \end{pmatrix} \end{equation}$$ And therefore, $$|+\rangle \langle 0| + |-\rangle\langle 1| = |0\rangle \langle +| + |1\rangle\langle -| = \dfrac{1}{\sqrt{2}}\begin{pmatrix} 1 & 1 \\ 1 & -1 \end{pmatrix} = H$$

However, this is not true in general. For instance,

$$\begin{equation} |i\rangle \langle 0| + |-i\rangle\langle 1| = \dfrac{1}{\sqrt{2}}\begin{pmatrix} 1 \\ i \end{pmatrix} \begin{pmatrix} 1 & 0 \end{pmatrix} + \dfrac{1}{\sqrt{2}}\begin{pmatrix} 1 \\ -i \end{pmatrix} \begin{pmatrix} 0 & 1 \end{pmatrix} = \dfrac{1}{\sqrt{2}}\begin{pmatrix} 1 & 1 \\ i & -i \end{pmatrix} \end{equation}$$ and $$\begin{equation} |0\rangle \langle i| + |1\rangle\langle -i| = \begin{pmatrix} 1 \\ 0 \end{pmatrix} \dfrac{1}{\sqrt{2}}\begin{pmatrix} 1 & i\end{pmatrix} + \begin{pmatrix} 0 \\ 1\end{pmatrix} \dfrac{1}{\sqrt{2}} \begin{pmatrix} 1 & -i \end{pmatrix} = \dfrac{1}{\sqrt{2}}\begin{pmatrix} 1 & i \\ 1 & -i \end{pmatrix} \end{equation}$$