Examples of "Caution 3" of Section 5.2.4
Anders B Madsen 29 Dec 2021 20:04
Let $\ket{\psi} = a\ket 0 + b \ket 1$ with $|a|² + |b|²=1$.
Then we compute the effect of the first circuit on $\ket{\psi}\ket 0$:
\begin{align} \ket{\psi}\ket 0 &\stackrel{H\otimes I}{\longmapsto} \frac a{\sqrt 2}\bigl(\ket 0 + \ket 1\bigr)\otimes \ket 0 + \frac b{\sqrt 2}\bigl(\ket 0 - \ket 1\bigr)\otimes \ket 0\\ &\stackrel{C_{not}}{\longmapsto} \frac{a+b}{\sqrt 2}\ket{00} + \frac{a-b}{\sqrt 2}\ket{11} \\ &\stackrel{H\otimes I}{\longmapsto} \frac{a+b}{2}\bigl(\ket 0 + \ket 1\bigr)\otimes \ket 0 + \frac{a-b}{2}\bigl(\ket 0 - \ket 1\bigr)\otimes \ket 1\\ &= \frac {a+b}{2}\bigl(\ket{00} + \ket{10}\bigr) + \frac {a-b}{2}\bigl(\ket{01} - \ket{11}\bigr)\,. \end{align}
And the effect of the second circuit:
(2)\begin{align} \ket{\psi}\ket 0 &\stackrel{I\otimes H}{\longmapsto} \left(a\ket 0 + b\ket 1\right)\otimes \frac 1{\sqrt 2}\left(\ket 0 + \ket 1\right)\\ &= \frac 1{\sqrt 2}\biggl[a\bigl(\ket{00} + \ket{01}\bigr) + b\bigl(\ket{10} + \ket{11}\bigr)\biggr] \\ &\stackrel{\bigwedge^1_{01}Z}{\longmapsto} \frac 1{\sqrt 2}\biggl[a\ket{00} + a\ket{01} + b\ket{10} - b\ket{11}\biggr]\\ &\stackrel{I\otimes H}{\longmapsto} \frac 1{2}\biggl[ a\ket 0 \otimes\bigl(\ket 0 + \ket 1\bigr) + a\ket 0 \otimes\bigl(\ket 0 - \ket 1\bigr) + b\ket 1 \otimes\bigl(\ket 0 + \ket 1\bigr) - b\ket 1 \otimes\bigl(\ket 0 - \ket 1\bigr) \biggr] \\ &= a\ket{00} + b\ket{11}\,. \end{align}
This demonstrates that composition of the Hadamard transformation $H$ with itself on a quantum wire does not necessarily amount to the identity $I$ on that wire (Caution 3). Note in particular, that the output of the second circuit is "maximally" entangled.