Creating superpositions with the H gate
Now, let's revisit our old friend from Chapter 4, Starting at the Ground Level with Terra, the Hadamard or H gate. This is a fairly specialized gate that we can use to make a generic qubit superposition. But there's more to it than that; we can also make use of the H gate to change the axis of measurement from the generic z (or computational) axis to the x axis to gain additional insights into the qubit behavior. More on that in the There's more section.
The H gate can be expressed as the following unitary matrix:
Unless you are really good at interpreting matrix operations, it might not be entirely clear just what this gate will do with your qubits. If we describe the behavior as a combination of 2 qubit rotations instead, things might become clearer. When you apply the Hadamard gate to your qubit, you run it through two rotations: first a rotation around the y axis, and then a rotation around the...