I dont undestand how to apply a phase shift gate to a qubit. By example how to map $|\psi_0\rangle = \cos (30^\circ) |0\rangle + \sin (30^\circ) |1\rangle$ to $|\psi_1\rangle = \cos(-15^\circ) |0\rangle + \sin(-15^\circ) |1\rangle$
|
A phase gate will not map between the two vectors you give. A phase gate changes the phase of the $\left|1\right>$ component, which is not what you want since for your example all components are real. Your two vectors lie in the X-Z plane of the Bloch sphere. To map from your first vector to your second vector, you need to rotate about the Y axis. The following unitary does the job, with $\theta=(-15)-30=-45$. $$ \left[ \begin{array}[rr] \textrm{cos}(\theta) & -\textrm{sin}(\theta) \\ \textrm{sin}(\theta) & \textrm{cos}(\theta) \end{array} \right] $$ |
|||
|
|
|
So, you have two vectors. Let $|0\rangle = \begin{pmatrix} 1 \\ 0 \\ \end{pmatrix}$ and $|1\rangle = \begin{pmatrix} 0 \\ 1 \\ \end{pmatrix}$. So, your initial vector is $\begin{pmatrix} cos \frac{\pi}{6} \\ sin \frac{\pi}{6} \\ \end{pmatrix}$ and final vector is $\begin{pmatrix} cos \frac{-\pi}{12} \\ sin \frac{-\pi}{12} \\ \end{pmatrix}$. The phase difference between these two vectors, $\theta$ is $cos^{-1} \left[ \frac{\begin{pmatrix} cos \frac{\pi}{6} \\ sin \frac{\pi}{6} \\ \end{pmatrix} . \begin{pmatrix} cos \frac{-\pi}{12} \\ sin \frac{-\pi}{12} \\ \end{pmatrix}}{|\begin{pmatrix} cos \frac{\pi}{6} \\ sin \frac{\pi}{6} \\ \end{pmatrix}| | \begin{pmatrix} cos \frac{-\pi}{12} \\ sin \frac{-\pi}{12} \\ \end{pmatrix}|} \right]$. Evaluate $\theta$ and plug in the value in \begin{pmatrix} 1 & 0 \\ 0 & e^{i\theta} \\ \end{pmatrix}. The resulting matrix will be your gate. |
|||||||||||||||||
|