# Why don't I get what I expect when measuring with respect to a different basis?


Looking at the Bloch sphere, I would expect to get $$\ket{+}$$ half of the time, and $$\ket{-}$$ the other half, and I have been able to empirically verify this. However, according to the mathematics presented in the aforementioned book, I should be able to express this state $$\ket{\psi} = \alpha\ket{0} + \beta\ket{1}$$, with the $$\alpha$$ and $$\beta$$ previously mentioned, as follows:

$$\ket{\psi} = \alpha\ket{0} + \beta\ket{1} = \alpha\frac{\ket{+} + \ket{-}}{\sqrt{2}} + \beta\frac{\ket{+} - \ket{-}}{\sqrt{2}} = \frac{\alpha + \beta}{\sqrt{2}}\ket{+} + \frac{\alpha -\beta}{\sqrt{2}}\ket{-}$$

This math seems sound to me, however if I attempt to translate to this new basis using my $$\alpha$$ and $$\beta$$, I get

$$\frac{\sqrt{2+\sqrt{2}} + \sqrt{2-\sqrt{2}}}{2\sqrt{2}}\ket{+} + \frac{\sqrt{2+\sqrt{2}} -\sqrt{2-\sqrt{2}}}{2\sqrt{2}}\ket{-}$$

Since $$\left(\frac{\sqrt{2+\sqrt{2}} + \sqrt{2-\sqrt{2}}}{2\sqrt{2}}\right)^2 \approx 0.85$$ this is not at all what I expect from looking at the Bloch sphere, and does not match what I am able to demonstrate empirically. What am I missing?

For reference, the important bit of my Q# code I've been using to test this is:

Rx(PI()/4.0, qubit);
set state = Measure([PauliX], [qubit]);
• Hi @Techmaster21 and welcome to Quantum Computing SE. What are the obtained empirical results for the last case? Apr 19, 2020 at 16:40

I think there should be $$-i$$ in the expression for $$\beta$$:

$$$$R_x\left(\frac{\pi}{4}\right) |0\rangle= \begin{pmatrix} \cos\left(\frac{\pi}{8}\right) & -i \sin\left(\frac{\pi}{8}\right) \\ -i \sin\left(\frac{\pi}{8}\right) & \cos\left(\frac{\pi}{8}\right) \end{pmatrix} \begin{pmatrix} 1 \\ 0\end{pmatrix} = \\ =\frac{\sqrt{2 + \sqrt{2}}}{2} |0\rangle - i \frac{\sqrt{2 - \sqrt{2}}}{2} |1\rangle$$$$

So, we will have:

$$|\psi\rangle = \frac{\sqrt{2 + \sqrt{2}} -i \sqrt{2 - \sqrt{2}}}{2\sqrt{2}} |+\rangle + \frac{\sqrt{2 + \sqrt{2}} + i \sqrt{2 - \sqrt{2}}}{2\sqrt{2}} |-\rangle$$

Then:

$$\left|\frac{\sqrt{2 + \sqrt{2}} -i \sqrt{2 - \sqrt{2}}}{2\sqrt{2}}\right|^2 = 0.5$$

• Thanks for your answer Davit! You hit on two misunderstandings/mistakes I had made. One is that I forgot that phi is measured from the x axis! I for some reason thought that phi was 0 here, which made me miss an i. Secondly, I also believed that Rx rotated clockwise, but it instead rotates counterclockwise (as it should). These two add together to make my expression for Beta off by a -i. Thank you! Apr 19, 2020 at 18:19
• You're welcome @Techmaster21. Also, I want to add that, in this problem, for any $\theta$ (from $R_x(\theta)$), the final probability for $|+\rangle$ will be the same. Apr 19, 2020 at 18:32