## Quantum Country exercise 4

This is one in a series of posts working through the exercises in the Quantum Country online introduction to quantum computing and related topics. The exercises in the original document are not numbered; I have added my own numbers for convenience in referring to them.

Exercise 4. Consider a quantum circuit in which the Hadamard gate $H$ is applied to a quantum state $\vert \psi \rangle$ and then the outout is measured in the computational basis.  Show that when the state

Answer: First consider the case when the state $H \left( \frac{\vert 0 \rangle + \vert 1 \rangle}{\sqrt{2}} \right) = \frac{1}{\sqrt{2}} \begin{bmatrix} 1 & 1 \\ 1 & -1 \end{bmatrix} \frac{1}{\sqrt{2}} \begin{bmatrix} 1 \\ 1 \end{bmatrix}$ $= \frac{1}{2} \begin{bmatrix} 2 \\ 0 \end{bmatrix} = \begin{bmatrix} 1 \\ 0 \end{bmatrix} = \vert 0 \rangle$

So the result of applying $H$ to the state is the state $\vert 0 \rangle$.

In the general case the state $\alpha \vert 0 \rangle + \beta \vert 1 \rangle$ will produce the result 0 with probability $|\alpha|^2$ and the value 1 with probability $|\alpha|^2$ when measured in the computational basis. Since the result in this case is $\vert 0 \rangle$ we have $\alpha = 1$ and $\beta = 0$ so the result will be $m = 0$ with probability $|1|^2 = 1$, with the result $m = 1$ having probability $|0|^2 = 0$. So the output as measured will always be $m = 0$.

When the state $H \left( \frac{\vert 0 \rangle - \vert 1 \rangle}{\sqrt{2}} \right) = \frac{1}{\sqrt{2}} \begin{bmatrix} 1 & 1 \\ 1 & -1 \end{bmatrix} \frac{1}{\sqrt{2}} \begin{bmatrix} 1 \\ -1 \end{bmatrix}$ $= \frac{1}{2} \begin{bmatrix} 0 \\ 2 \end{bmatrix} = \begin{bmatrix} 0 \\ 1 \end{bmatrix} = \vert 1 \rangle$

So the result of applying $H$ to the state is the state $\vert 1 \rangle$, which when measured in the computational basis will always produce the value $m = 1$.

This entry was posted in quantum country. Bookmark the permalink.