# Quantum Qubit Math

[5/24/2022] Another work in progress… $\displaystyle|0\rangle=|\!+\!\!Z\rangle=\begin{bmatrix}{1}\\{0}\end{bmatrix},\,\,\,|1\rangle=|\!-\!\!Z\rangle=\begin{bmatrix}{0}\\{1}\end{bmatrix}$

Any measurement results in one of those. They let us define the four superpositions: $\displaystyle|+\rangle=|\!+\!\!Y\rangle=\tfrac{1}{\sqrt{2}}\left(|0\rangle+|1\rangle\right)=\tfrac{1}{\sqrt{2}}\!\begin{bmatrix}{1}\\{1}\end{bmatrix}\\[1.0em]|-\rangle=|\!-\!\!Y\rangle=\tfrac{1}{\sqrt{2}}\left(|0\rangle-|1\rangle\right)=\tfrac{1}{\sqrt{2}}\!\begin{bmatrix}{1}\\{-1}\end{bmatrix}\\[1.5em]|\!+\!\!{i}\rangle=|\!+\!\!X\rangle=\tfrac{1}{\sqrt{2}}\left(|0\rangle+{i}|1\rangle\right)=\tfrac{1}{\sqrt{2}}\!\begin{bmatrix}{1}\\{i}\end{bmatrix}\\[1.0em]|\!-\!\!{i}\rangle=|\!-\!\!X\rangle=\tfrac{1}{\sqrt{2}}\left(|0\rangle-{i}|1\rangle\right)=\tfrac{1}{\sqrt{2}}\!\begin{bmatrix}{1}\\{-i}\end{bmatrix}$

Which together all form the three axes of the Bloch sphere: Spin (in most cases) is a qubit — it has only two measured values that form its basis. All other spin states are superpositions, as shown above. In the context of qubit spin, the Pauli spin matrices are important: $\displaystyle\sigma_{x}=\!\begin{bmatrix}{0}&{1}\\{1}&{0}\end{bmatrix}\!,\,\,\,\sigma_{y}=\!\begin{bmatrix}{0}&{-i}\\{i}&{0}\end{bmatrix}\!,\,\,\,\sigma_{z}=\!\begin{bmatrix}{1}&{1}\\{1}&{-1}\end{bmatrix}$

These act as operators on the spin state.

One thing we can do with operators is calculate the expectation value of the measurement associated with the operator. Given some operator, o, the expectation value is: $\displaystyle\langle{o}\rangle=\langle\Psi|\hat{o}|\Psi\rangle$

It’s the average of a putative set of measurements made on identically prepared systems. We analyze spin on the three axes described above, a basis axis and two orthogonal axes defined by superpositions. $\displaystyle\langle{0}|\sigma_x|{0}\rangle=\begin{bmatrix}{1}&{0}\end{bmatrix}\!\!\begin{bmatrix}{0}&{1}\\[0.2em]{1}&{0}\end{bmatrix}\!\!\begin{bmatrix}{1}\\[0.2em]{0}\end{bmatrix}=\begin{bmatrix}{1}&{0}\end{bmatrix}\!\!\begin{bmatrix}{0}\\[0.2em]{1}\end{bmatrix}\!=0$

And: $\displaystyle\langle{1}|\sigma_x|{1}\rangle=\begin{bmatrix}{0}&{1}\end{bmatrix}\!\!\begin{bmatrix}{0}&{1}\\[0.2em]{1}&{0}\end{bmatrix}\!\!\begin{bmatrix}{0}\\[0.2em]{1}\end{bmatrix}=\begin{bmatrix}{0}&{1}\end{bmatrix}\!\!\begin{bmatrix}{1}\\[0.2em]{0}\end{bmatrix}\!=0$

Which give us expectation values for the X spin operator given the |0〉 and |1〉 states respectively.

For the Y spin operator, we have: $\displaystyle\langle{0}|\sigma_y|{0}\rangle=\begin{bmatrix}{1}&{0}\end{bmatrix}\!\!\begin{bmatrix}{0}&{-i}\\[0.2em]{i}&{0}\end{bmatrix}\!\!\begin{bmatrix}{1}\\[0.2em]{0}\end{bmatrix}=\begin{bmatrix}{1}&{0}\end{bmatrix}\!\!\begin{bmatrix}{0}\\[0.2em]{i}\end{bmatrix}\!=0$

And: $\displaystyle\langle{1}|\sigma_y|{1}\rangle=\begin{bmatrix}{0}&{1}\end{bmatrix}\!\!\begin{bmatrix}{0}&{-i}\\[0.2em]{i}&{0}\end{bmatrix}\!\!\begin{bmatrix}{0}\\[0.2em]{1}\end{bmatrix}=\begin{bmatrix}{0}&{1}\end{bmatrix}\!\!\begin{bmatrix}{-i}\\[0.2em]{0}\end{bmatrix}\!=0$

Which are also zero given the same two states.

An expectation value is the average of possible values. Here, since we know the actual measurement values are +1 and -1, an expectation value of 0 tells us we expect to get either measurement with equal probability (making the average 0).

Finally, for the Z spin operator, we have: $\displaystyle\langle{0}|\sigma_z|{0}\rangle=\begin{bmatrix}{1}&{0}\end{bmatrix}\!\!\begin{bmatrix}{1}&{1}\\[0.2em]{1}&{-1}\end{bmatrix}\!\!\begin{bmatrix}{1}\\[0.2em]{0}\end{bmatrix}=\begin{bmatrix}{1}&{0}\end{bmatrix}\!\!\begin{bmatrix}{1}\\[0.2em]{1}\end{bmatrix}\!=+1$

And: $\displaystyle\langle{1}|\sigma_z|{1}\rangle=\begin{bmatrix}{0}&{1}\end{bmatrix}\!\!\begin{bmatrix}{1}&{1}\\[0.2em]{1}&{-1}\end{bmatrix}\!\!\begin{bmatrix}{0}\\[0.2em]{1}\end{bmatrix}=\begin{bmatrix}{0}&{1}\end{bmatrix}\!\!\begin{bmatrix}{1}\\[0.2em]{-1}\end{bmatrix}\!=-1$

Which makes sense. In the |0〉 state we’re certain to get an “up” (+1) measurement, and in the |1〉 state we’re likewise certain to get a “down” (-1) measurement. In both cases because the qubit is already in those states.

We can calculate the same six expectation values for the other two axes. Next, we’ll do the other lateral axis, the Y-axis: $\displaystyle\langle{+}|\sigma_x|{+}\rangle=\begin{bmatrix}\tfrac{1}{\sqrt{2}}&\tfrac{1}{\sqrt{2}}\end{bmatrix}\!\!\begin{bmatrix}{0}&{1}\\[0.2em]{1}&{0}\end{bmatrix}\!\!\begin{bmatrix}\tfrac{1}{\sqrt{2}}\\[0.5em]\tfrac{1}{\sqrt{2}}\end{bmatrix}=\begin{bmatrix}\tfrac{1}{\sqrt{2}}&\tfrac{1}{\sqrt{2}}\end{bmatrix}\!\!\begin{bmatrix}\tfrac{1}{\sqrt{2}}\\[0.5em]\tfrac{1}{\sqrt{2}}\end{bmatrix}\!=+1$

And: $\displaystyle\langle{-}|\sigma_x|{-}\rangle=\begin{bmatrix}\tfrac{1}{\sqrt{2}}&\tfrac{-1}{\sqrt{2}}\end{bmatrix}\!\!\begin{bmatrix}{0}&{1}\\[0.2em]{1}&{0}\end{bmatrix}\!\!\begin{bmatrix}\tfrac{1}{\sqrt{2}}\\[0.5em]\tfrac{-1}{\sqrt{2}}\end{bmatrix}=\begin{bmatrix}\tfrac{1}{\sqrt{2}}&\tfrac{-1}{\sqrt{2}}\end{bmatrix}\!\!\begin{bmatrix}\tfrac{-1}{\sqrt{2}}\\[0.5em]\tfrac{1}{\sqrt{2}}\end{bmatrix}\!=-1$

Which are the expectation values for the X spin operator given the qubit is in the |+〉 or |-〉 superposition states.

For the Y spin operator and the same states, we have: $\displaystyle\langle{+}|\sigma_y|{+}\rangle=\begin{bmatrix}\tfrac{1}{\sqrt{2}}&\tfrac{1}{\sqrt{2}}\end{bmatrix}\!\!\begin{bmatrix}{0}&{-i}\\[0.2em]{i}&{0}\end{bmatrix}\!\!\begin{bmatrix}\tfrac{1}{\sqrt{2}}\\[0.5em]\tfrac{1}{\sqrt{2}}\end{bmatrix}=\begin{bmatrix}\tfrac{1}{\sqrt{2}}&\tfrac{1}{\sqrt{2}}\end{bmatrix}\!\!\begin{bmatrix}\tfrac{-i}{\sqrt{2}}\\[0.5em]\tfrac{i}{\sqrt{2}}\end{bmatrix}\!=0$

And: $\displaystyle\langle{-}|\sigma_y|{-}\rangle=\begin{bmatrix}\tfrac{1}{\sqrt{2}}&\tfrac{-1}{\sqrt{2}}\end{bmatrix}\!\!\begin{bmatrix}{0}&{-i}\\[0.3em]{i}&{0}\end{bmatrix}\!\!\begin{bmatrix}\tfrac{1}{\sqrt{2}}\\[0.5em]\tfrac{-1}{\sqrt{2}}\end{bmatrix}=\begin{bmatrix}\tfrac{1}{\sqrt{2}}&\tfrac{-1}{\sqrt{2}}\end{bmatrix}\!\!\begin{bmatrix}\tfrac{i}{\sqrt{2}}\\[0.5em]\tfrac{i}{\sqrt{2}}\end{bmatrix}\!=0$

The zero value again indicating an average of measurements.

And for the Z spin operator: $\displaystyle\langle{+}|\sigma_z|{+}\rangle=\begin{bmatrix}\tfrac{1}{\sqrt{2}}&\tfrac{1}{\sqrt{2}}\end{bmatrix}\!\!\begin{bmatrix}{1}&{1}\\[0.2em]{1}&{-1}\end{bmatrix}\!\!\begin{bmatrix}\tfrac{1}{\sqrt{2}}\\[0.5em]\tfrac{1}{\sqrt{2}}\end{bmatrix}=\begin{bmatrix}\tfrac{1}{\sqrt{2}}&\tfrac{1}{\sqrt{2}}\end{bmatrix}\!\!\begin{bmatrix}\tfrac{1}{\sqrt{2}}\\[0.5em]\tfrac{1}{\sqrt{2}}\end{bmatrix}\!=+1$

And: $\displaystyle\langle{-}|\sigma_z|{-}\rangle=\begin{bmatrix}\tfrac{1}{\sqrt{2}}&\tfrac{-1}{\sqrt{2}}\end{bmatrix}\!\!\begin{bmatrix}{1}&{1}\\[0.2em]{1}&{-1}\end{bmatrix}\!\!\begin{bmatrix}\tfrac{1}{\sqrt{2}}\\[0.5em]\tfrac{-1}{\sqrt{2}}\end{bmatrix}=\begin{bmatrix}\tfrac{1}{\sqrt{2}}&\tfrac{-1}{\sqrt{2}}\end{bmatrix}\!\!\begin{bmatrix}{0}\\[0.5em]\tfrac{2}{\sqrt{2}}\end{bmatrix}\!=-1$

Which is similar to the X operator above.

Lastly, the X-axis, which aligns with the particle’s direction of motion. (Photons lack this axis of spin because they move at lightspeed.) We have: $\displaystyle\langle{+i}|\sigma_x|{+i}\rangle=\begin{bmatrix}\tfrac{1}{\sqrt{2}}&\tfrac{-i}{\sqrt{2}}\end{bmatrix}\!\!\begin{bmatrix}{0}&{1}\\[0.2em]{1}&{0}\end{bmatrix}\!\!\begin{bmatrix}\tfrac{1}{\sqrt{2}}\\[0.5em]\tfrac{i}{\sqrt{2}}\end{bmatrix}=\begin{bmatrix}\tfrac{1}{\sqrt{2}}&\tfrac{-i}{\sqrt{2}}\end{bmatrix}\!\!\begin{bmatrix}\tfrac{i}{\sqrt{2}}\\[0.5em]\tfrac{1}{\sqrt{2}}\end{bmatrix}\!=0$

And: $\displaystyle\langle{-i}|\sigma_x|{-i}\rangle=\begin{bmatrix}\tfrac{1}{\sqrt{2}}&\tfrac{i}{\sqrt{2}}\end{bmatrix}\!\!\begin{bmatrix}{0}&{1}\\[0.2em]{1}&{0}\end{bmatrix}\!\!\begin{bmatrix}\tfrac{1}{\sqrt{2}}\\[0.5em]\tfrac{-i}{\sqrt{2}}\end{bmatrix}=\begin{bmatrix}\tfrac{1}{\sqrt{2}}&\tfrac{i}{\sqrt{2}}\end{bmatrix}\!\!\begin{bmatrix}\tfrac{-i}{\sqrt{2}}\\[0.5em]\tfrac{1}{\sqrt{2}}\end{bmatrix}\!=0$

For the X spin operator and the |+i〉 and |-i superposition states. The zero value again signifying a 50/50 result mix.

For the Y spin operator, we have: $\displaystyle\langle{+i}|\sigma_y|{+i}\rangle=\begin{bmatrix}\tfrac{1}{\sqrt{2}}&\tfrac{-i}{\sqrt{2}}\end{bmatrix}\!\!\begin{bmatrix}{0}&{-i}\\[0.2em]{i}&{0}\end{bmatrix}\!\!\begin{bmatrix}\tfrac{1}{\sqrt{2}}\\[0.5em]\tfrac{i}{\sqrt{2}}\end{bmatrix}=\begin{bmatrix}\tfrac{1}{\sqrt{2}}&\tfrac{-i}{\sqrt{2}}\end{bmatrix}\!\!\begin{bmatrix}\tfrac{1}{\sqrt{2}}\\[0.5em]\tfrac{i}{\sqrt{2}}\end{bmatrix}\!=+1$

And: $\displaystyle\langle{-i}|\sigma_y|{-i}\rangle=\begin{bmatrix}\tfrac{1}{\sqrt{2}}&\tfrac{i}{\sqrt{2}}\end{bmatrix}\!\!\begin{bmatrix}{0}&{-i}\\[0.2em]{i}&{0}\end{bmatrix}\!\!\begin{bmatrix}\tfrac{1}{\sqrt{2}}\\[0.5em]\tfrac{-i}{\sqrt{2}}\end{bmatrix}=\begin{bmatrix}\tfrac{1}{\sqrt{2}}&\tfrac{i}{\sqrt{2}}\end{bmatrix}\!\!\begin{bmatrix}\tfrac{-1}{\sqrt{2}}\\[0.5em]\tfrac{i}{\sqrt{2}}\end{bmatrix}\!=-1$

Which are the parallel states.

For the Z spin operator, we have: $\displaystyle\langle{+i}|\sigma_z|{+i}\rangle=\begin{bmatrix}\tfrac{1}{\sqrt{2}}&\tfrac{-i}{\sqrt{2}}\end{bmatrix}\!\!\begin{bmatrix}{1}&{1}\\[0.2em]{1}&{-1}\end{bmatrix}\!\!\begin{bmatrix}\tfrac{1}{\sqrt{2}}\\[0.5em]\tfrac{i}{\sqrt{2}}\end{bmatrix}=\begin{bmatrix}\tfrac{1}{\sqrt{2}}&\tfrac{-i}{\sqrt{2}}\end{bmatrix}\!\!\begin{bmatrix}\tfrac{1+i}{\sqrt{2}}\\[0.7em]\tfrac{1-i}{\sqrt{2}}\end{bmatrix}\!=0$

And: $\displaystyle\langle{-i}|\sigma_z|{-i}\rangle=\begin{bmatrix}\tfrac{1}{\sqrt{2}}&\tfrac{i}{\sqrt{2}}\end{bmatrix}\!\!\begin{bmatrix}{1}&{1}\\[0.2em]{1}&{-1}\end{bmatrix}\!\!\begin{bmatrix}\tfrac{1}{\sqrt{2}}\\[0.5em]\tfrac{-i}{\sqrt{2}}\end{bmatrix}=\begin{bmatrix}\tfrac{1}{\sqrt{2}}&\tfrac{i}{\sqrt{2}}\end{bmatrix}\!\!\begin{bmatrix}\tfrac{1-i}{\sqrt{2}}\\[0.7em]\tfrac{1+i}{\sqrt{2}}\end{bmatrix}\!=0$

Which blah blah blah.

And so on and so on. ${X}$