In Python, the Hadamard gate, also known as the H gate is defined as follows:
H=1./np.sqrt(2)*np.matrix('1 1; 1 -1')
The Hadamard gate rotates the initial qubit by 180 degrees around the x axis, then 90 degrees about the y axis.
We know that the qubit that resides on the equator of the sphere would be in a superposition of |"0"> and |"1">, and in equal parts of each. The Hadamard gate when applied to the |"0"> qubit as in H|"0"> transforms it to be in a superposition of equal parts |"0"> and |"1">.
A plot of H|"0"> can be seen with the plot_bloch(H*zero_qubit) statement as follows:
Here, we can see this is equal to |"+">. In words/algebra, that means that H|"0"> = |"+">. H|"1"> does likewise, though because of the starting point differing and rotations the gate performs, the result lies elsewhere, on the opposite end of H|"0"> on the equator. A plot of H|"1"> can be seen with the plot_bloch(H*one_qubit) statement as follows:
Here, we can see this is equal to |"-">. In words/algebra, that means that H|"1"> = |"-">.