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
Quantum Computing Stack Exchange is a question and answer site for engineers, scientists, programmers, and computing professionals interested in quantum computing. It only takes a minute to sign up.
Sign up to join this communityIs ($|+⟩$$⟨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
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.
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}