Single qubit representation and operations
Measurement
- On a one-qubit state: use outer join as a projectors to calculate the state of a system after a measurement is made. e.g. $P_0 = \rvert 0 \rangle \,\langle 0 \lvert$ and $P_1 = \rvert 1 \rangle \,\langle 1 \lvert$
-
On a two-qubit state:
- apply projector into the measured state
- renormalize the state
Formally:
\[\vert\psi'\rangle=\frac{P_m\,\vert\psi\rangle}{\sqrt{p(m)}}\]i.e. if state is measured to be ‘0’, then apply $P_0$ and renormalize to get the collapsed state. If the state is measured to be ‘1’, then apply $P_1$ and renormalize to get the collapsed state.
In quantum mechanics, a measurement disturbs the state. In orther words, taking a superposition and measureing it, the many different states become just one. This is known as ‘collapse’ of wavefunction.
The Bloch Sphere representation for qubits
Two useful operators, known as projectors $P_0$ and $P_1$:
A convenient geometric representation of single qubit states is the Bloch sphere:
The z-projection is the expectation of the measured component on z-axis.
\[\langle Z\rangle = (+1)P_0 + (-1)P_0\]The expectation value of an operator $A$ is given by: $\langle\psi\vert A\vert\psi\rangle$. Hermitian operators correspond to physical observables - that are the average value of that quantity when measured in a given state.
The Pauli Matrices gives the expectation values along any of the cartesian axes , equivalent to taking expectation values of the any following matrices:
Transformation to Bloch form
Calculation: transform from superposition state to bloch sphere:
Quantum operations on qubits
A quantum operation ‘U’ takes a state $\vert \psi\rangle$ and changes it to a new state $\vert\psi’p\rangle$.$\vert \psi\rangle\rightarrow\vert\psi’p\rangle$ Formally, in math it writes $U\vert\psi\rangle = \vert\psi’\rangle$.
Qubit gates in matrix form and the Pauli Matrices
The cartesian operations and X, Y, Z Pauli matrices
The cartesian rotations are usually referred to as the “Pauli” operators X,Y,Z because they are rotations on the X,Y,Z axis.
X-gate rotates around X axis, if $\vert\psi\rangle = \vert 0 \rangle$, then after 180 degree rotation, it becomes $\vert 1 \rangle$. We writes this as: $X\vert 0\rangle = \vert 1\rangle$ and $X\vert 1\rangle = \vert 0\rangle$. In other words, hence we call a X gate as a flip gate. In superposition notation, we have:
\[X(a_0\vert 0\rangle + a_1\vert 1 \rangle) = a_1\vert 0\rangle + a_0\vert1\rangle\]Refer to the Bloch Sphere diagram, the rotation may change $\theta_B$, which is the angle between the vector and positive z-axis, or $\phi_B$, which is the angle between the vector and negative y-axis. For example, if we are to rotate 180 degree around Z-axis, we are changing $\phi_B$, hence only the part of $\vert 1\rangle$ will change.
list of gates:
- X gates: \(\alpha\vert 0\rangle + \beta\vert 1\rangle \rightarrow \alpha \vert 1\rangle + \beta\vert 0\rangle\) turns a state 180 degree around X axis.
- Y gates: \(\alpha\vert 0\rangle + \beta\vert 1\rangle \rightarrow i\alpha \vert 1 \rangle - i\beta\vert 0\rangle\) turns a state 180 degree around Y axis.
- Z gates: \(\alpha\vert 0\rangle + \beta\vert 1\rangle \rightarrow \alpha \vert 0 \rangle - \beta\vert 1\rangle\) turns a state 180 degree around Z axis.
- S gates: \(\alpha\vert 0\rangle + \beta\vert 1\rangle \rightarrow \alpha \vert 0 \rangle + i\beta\vert 1\rangle\) turns a state 90 degree around Z axis.
- T gates: \(\alpha\vert 0\rangle + \beta\vert 1\rangle \rightarrow \alpha \vert 0 \rangle + e^{i\frac{\pi}{4}}\beta\vert 1\rangle\) turns a state 45 degree around Z axis.
In pursuing a rotation, we can simply left multiply the gate matrix with the state vector, i.e. $T\vert \psi\rangle$. If \(\vert\psi\rangle = a_0\vert 0\rangle + a_1\vert 1 \rangle = \left[\begin{matrix} a_0 \\ a_1 \end{matrix}\right]\), then \(T\vert \psi\rangle = T\left[\begin{matrix} a_0 \\ a_1 \end{matrix}\right]=\left[\begin{matrix} 1&0 \\ 0&e^{i\frac{\pi}{4}} \end{matrix}\right] \left[\begin{matrix} a_0 \\ a_1 \end{matrix}\right].\)
The rotation gates are shown below.
\[X=\left[\begin{matrix} 0&1 \\ 1&0 \end{matrix}\right]\; Y=\left[\begin{matrix} 0&-i \\ i&0 \end{matrix}\right]\; Z=\left[\begin{matrix} 1&0 \\ 0&-1 \end{matrix}\right]\; S=\left[\begin{matrix} 1&0 \\ 0&I \end{matrix}\right]\; T=\left[\begin{matrix} 1&0 \\ 0&e^{i\frac{\pi}{4}} \end{matrix}\right]\]Qubit operations around non-cartesian axes – H gates
The hadamard gate generates superposition states, it rotates around the X+Z axis by an angle $\pi$. It turns in following mode: \(a_0\vert0\rangle+a_1\vert1\rangle\rightarrow\frac{a_0+a_1} {\sqrt2}\vert0\rangle+\frac{a_0-a_1}{\sqrt2}\vert1\rangle\). The H gate matrix is \(H = \frac{1}{\sqrt 2}\left[\begin{matrix} 1&1 \\ 1&-1 \end{matrix}\right]\)
Matrix exponential and arbitrary rotations – R gates
what about the square on exponential of Pauli Matrices? for example: \(X =\left[\begin{matrix} 0&1 \\ 1&0 \end{matrix}\right]\). We can easily calculate that $X^2 = I$ and $X^3=X$, $X^4=I$ and $X^5=X\;\ldots$. This property still holds for other Pauli matrices like $Y,\; Z$.
A rotation by angle $\theta$ around a unit vector $\hat n$ is given by:
for example, if we rotate $\theta$ on X axis, i.e. $R_X(\theta_R)$, then we have our unit vector $\hat n =(X,Y,Z) = (1,0,0)$ and \(\hat n\cdot \sigma = (1, 0, 0)\cdot \sigma = X\). Finally, we will have \(\exp{(i\theta X)}=I\cos \theta + iX\sin\theta\) and \(R_X(\theta_R)=\exp{(-i\frac{\theta}{2}\hat n\cdot\sigma)}=I\cos\frac{\theta}{2} - iX\sin\frac{\theta}{2}\). If we apply this $R_X(\theta_R)$ to a zero qubit $\vert 0\rangle$, then we have:
\[R_X(\theta_R)\vert 0\rangle=\left(I\cos\frac{\theta}{2} - iX\sin\frac{\theta}{2}\right)\vert 0\rangle =\left(I\cos\frac{\theta}{2}\vert 0\rangle - iX\sin\frac{\theta}{2}\vert 0\rangle\right)\] \[R_X(\theta_R)\vert 0\rangle = \cos\frac{\theta_R}{2}\vert 0\rangle - i\sin\frac{\theta_R}{2}\vert 1\rangle\]Notice the negative and fraction of 2 changes when apply the formula!
The global phase does not affect the measurement. There is no difference between $\vert\psi\rangle$ and \(exp^{i\theta_{\text{global}}}\vert\psi\rangle\).
Useful facts
-
In quantum mechanics, unitary operators acting on quantum states produce new quantum states. These ops can be described by unitary matrices. $\vert \psi’\rangle=U\vert\psi\rangle$ and $U^\dagger U=I$. Note: the dagger represents taking Transpose and Complex conjugate $U^\dagger=U^{\text{T}*}$. In quantum Computing context, all Unitary operations are reversible.
-
Some notes on angles usage:
-
Phase angle of complex amplitudes -> polar coordinates:
\[\vert\psi\rangle =a_0\vert 0\rangle +a_1\vert 1\rangle\rightarrow\vert\psi\rangle = \lvert a_0\rvert e^{i\theta_0}\vert 0\rangle + \lvert a_1\rvert e^{i\theta_1} \vert 1\rangle\] -
Angle specifying the position of a qubit on Bloch Sphere:
\[\vert\psi\rangle =a_0\vert 0\rangle +a_1\vert 1\rangle\rightarrow \cos{\frac{\theta_B}{2}}\vert 0\rangle + \sin{\frac{\theta_B}{2}}e^{i\phi_B}\vert 1\rangle\] -
Angle $\theta_R$ of rotation (any) on specified axis(unit vector) $n$:
\[\vert\psi'\rangle = R_n(\theta_R)\vert\psi\rangle\]Useful formulas:
\[R_X(\theta_R)\vert 0\rangle=\cos\frac{\theta_R}{2}\vert 0\rangle - i\sin\frac{\theta_R}{2}\vert 1\rangle\]
-