2
$\begingroup$

I see this equations all over for controlled-U operations:

$$ \left|{0}\right>\left<{0}\right| \otimes \mathbf{1} + \left|{1}\right>\left<{1}\right|\otimes U = \begin{pmatrix} \mathbb{1} & 0 \\ 0 & U \end{pmatrix} $$

I have been trying to work this out and can not figure out where I'm going wrong:

$$ \begin{align} \left|{0}\right>\left<{0}\right| \otimes \mathbf{1} + \left|{1}\right>\left<{1}\right|\otimes U &= \begin{pmatrix} 0 \\ 0 \end{pmatrix}\begin{pmatrix} 0 & 0 \end{pmatrix} \otimes \begin{pmatrix} 1 & 0 \\ 0 & 1 \end{pmatrix} + \begin{pmatrix} 1 \\ 1 \end{pmatrix}\begin{pmatrix} 1 & 1 \end{pmatrix} \otimes U\\ &= \begin{pmatrix} 0 & 0 \\ 0 & 0 \end{pmatrix} \otimes\begin{pmatrix} 1 & 0 \\ 0 & 1 \end{pmatrix} + \begin{pmatrix} 1 & 1 \\ 1 & 1 \end{pmatrix} \otimes U \\ &= \begin{pmatrix} 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 \end{pmatrix} + \begin{pmatrix} U & U \\ U & U \end{pmatrix} \\ &= \begin{pmatrix} U & U \\ U & U \end{pmatrix} \neq \begin{pmatrix} \mathbb{1} & 0 \\ 0 & U \end{pmatrix} \end{align} $$

Even checking with python doing the calculations, I get the wrong answer. Where am I going wrong? Or can someone explain what I'm missing?

$\endgroup$

1 Answer 1

4
$\begingroup$

$\left|0\right>$ and $\left|1\right>$ don't mean $\begin{pmatrix}0 \\ 0\end{pmatrix}$ and $\begin{pmatrix}1 \\ 1\end{pmatrix}$.

In bra-ket notation we usually fix some basis and denote by $\left|a\right>$ the element of this basis labeled by the symbol $a$. In the case of a qubit $\left|0\right>$ and $\left|1\right>$ denote the basis vectors $\begin{pmatrix} 1 \\ 0 \end{pmatrix}$ and $\begin{pmatrix}0 \\ 1\end{pmatrix}$

$\endgroup$
1
  • $\begingroup$ I... Thank you. $\endgroup$
    – grepgrok
    Dec 27, 2023 at 4:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.