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 is applied to a quantum state and then the outout is measured in the computational basis. Show that when the state $is input to this circuit that the output is with probability 1, and that when the state is input to this circuit the output is with probability 1.$

Answer: First consider the case when the state $is input to the circuit. We have$

So the result of applying to the state is the state .

In the general case the state will produce the result 0 with probability and the value 1 with probability when measured in the computational basis. Since the result in this case is we have and so the result will be with probability , with the result having probability . So the output as measured will always be .

When the state $is input to the circuit we have$

So the result of applying to the state is the state , which when measured in the computational basis will always produce the value .