# The probability of $|+\rangle$ to be in $|0\rangle$ or $|1\rangle$?

The following image is from IBM Q Experience beginner's guide HERE.

The gate sequences are being applied to the qubit $|0\rangle$. I only do not understand why in the second row, the probabilities are 85, 15. I see that the H and then T gates take $|0\rangle$ to the plane X-Y with angle $\frac{\pi}{4}$ from both axis (in Bloch sphere), but I cannot see where the Hadamard gate before the measurement takes this. Any hint is appreciated.

• FWIW, for a rotation angle $\alpha$ the rightmost column is $\sin^2\alpha/2$. – J.G. May 31 '18 at 23:09
• Thanks @J.G. . Could you tell me why it is $sin^2\,\alpha/2$? – Mathophile-Mathochist Jun 1 '18 at 14:16
• We get qubits from spin-$1/2$ fermions, which are spinors. This halves the angle appearing in $\exp i\theta$, and the real and imaginary parts thereof are the desired amplitudes. – J.G. Jun 1 '18 at 14:55

The states $|0\rangle$ and $|1\rangle$ lie on the $+z$-axis and $-z$-axis of the Bloch sphere, and the $|+\rangle$ and $|-\rangle$ states lie on the $\pm x$-axis. The Hadamard gate $H$ performs a rotation that transforms $|0\rangle$ to $|+\rangle$ and $|1\rangle$ to $|-\rangle$ (i.e. it's a 180-degree rotation about an axis 45 degrees from both the $z$-axis and the $x$-axis). So if you apply $HZH$, you first turn $|0\rangle$ into $|+\rangle$, then you turn $|+\rangle$ into $|-\rangle$ (since the $Z$ operator is a 180-degree rotation about the $z$-axis), then you turn $|-\rangle$ into $|1\rangle$.
If, on the other hand, you apply $HTH$, then you first turn $|0\rangle$ into $|+\rangle$, as before, but then you rotate only 45 degrees around the $z$-axis. This leaves you midway between the $x$ and $y$ axes. When you apply the second $H$, you will end up on the opposite side of the axis of rotation (which, again, evenly splits the $z$ and $x$ axes). Doing this rotation will land you much closer to the $|0\rangle$ state (the "north pole" of the Bloch sphere) than the $|1\rangle$ state (the "south pole"); trying this on a globe (or some other sphere you have laying around) might offer some intuition as to how this works. As such, the probability of being $|0\rangle$ should be much higher than the probability of being $|1\rangle$.
• @Mathophile-Mathochist Because $\sin^2 \pi/8 = (1-\cos\pi/4)/2=(1-1/\sqrt{2})/2\approx 0.146$. – J.G. Jun 1 '18 at 14:33