0

Reading through IBM's intro to quantum computing and gates and I'm confused about the Hadamard gate. When you use an H gate it appears to rotate the qubit along the X axis pi/4 putting it in a superposition.

If my base state was |0> and I pass it through an H gate it will be put into |>. Another H gate will put it back into |0>.

If my base state was |1> then the same happens, where two H gates will return to |1>.

I'd expect two H gates would be the same as a NOT gate and flip |0> to |1>.

I see what is happening but I don't know why. Why doesn't two H gates turn |0> to |1> ?

micah
  • 103

1 Answers1

1

In a nutshell, there are multiple ways of being in a superposition of |0> and |1>.

Take a look at the explanation of the Hadamard gate found here: https://developer.ibm.com/dwblog/2016/quantum-computing-everyone-programmers-perspective/

In the graphic representation, all states "reflect" across the same dotted line. When reflected twice, they go back where they came from. You can see that |0> and |1> are reflected to different places, but that both places have equal probability of measuring in each state.

The most clear mathematical representation is to look at the Hadamard gate as a 2x2 matrix 1/$\sqrt{2}$ [[1,1],[1,-1]]. Square it and you get unity. It might also help to look into the Bloch sphere: Understanding the Hadamard gate on the Bloch sphere