Home | Algorithms | Commercialization | Data Science | Information Theories | Quantum Theories | Lab | Linear Algebra |
<< IBM Q - Sqrt T | Measurement on Basis Vectors >> |
$\require{cancel} \newcommand{\Ket}[1]{\left|{#1}\right\rangle} \newcommand{\Bra}[1]{\left\langle{#1}\right|} \newcommand{\Braket}[1]{\left\langle{#1}\right\rangle} \newcommand{\Rsr}[1]{\frac{1}{\sqrt{#1}}} \newcommand{\RSR}[1]{1/\sqrt{#1}} \newcommand{\Verti}{\rvert} \newcommand{\HAT}[1]{\hat{\,#1~}} \DeclareMathOperator{\Tr}{Tr}$
First created in June 2018
This page is a study note of "Quantum Computing: A Gentle Introduction"
by Eleanor Rieffel, Wolfgang Polak, The MIT Press © 2011.
Universal Quantum Gates is a set of quantum logic gates of which a finite sequence can express any unitary operations a quantum computer is capable of.
This text is to discuss an example of universal quantum gates, as in Chapter 5.4 of the book "Quantum Computing: A Gentle Introduction" by Eleanor Rieffel and Wolfgang Polak.
$\text{Phase Shift }K(\sigma)\equiv e^{i\sigma}I =\begin{bmatrix} e^{i\sigma} & 0\\ 0 & e^{i\sigma} \end{bmatrix} ,~\text{Rotation } R(\beta)\equiv \begin{bmatrix} \cos\beta & \sin\beta\\ -\sin\beta & \cos\beta \end{bmatrix} ,~\text{Phase Rotation } T(\alpha)\equiv \begin{bmatrix} e^{i\alpha} & 0\\ 0 & e^{-i\alpha} \end{bmatrix} ,~~ \sigma,\alpha,\beta,\gamma\in\mathbb{R} .$
$K(\sigma)$ is a global phase shift. It changes the vector but not the quantum state, as phase is relative. However, when $K$ is applied as part of a control gate or only to some qubits in the system, it creates a relative phase. $K$ is also useful to "fix up" operation results to the standardised quantum state (one with the first non-zero co-efficient being positive and real).
$R(\beta)$ is a rotation on the Bloch Sphere along the $Y$-axis by the angle $-2\beta$ e.g. A $R(\pi/4)$ rotates $+\HAT{Z}$ to $-\HAT{X}$ by $-\pi/2$. Although $R$ does not explicitly change the phase, it may do so to vectors starting off with a phase (by projection on the $X$-$Y$ plane). e.g. $R(\pi/2)$ is the $Y'$ operator, sending $\Ket0+e^{i\pi/4}\Ket1$ to $e^{i\pi/4}(\Ket0+e^{i~3\pi/4}\Ket1)$ (and can be standardised by applying $K(-\pi/4)$).
$T(\alpha)$ is a rotation on the Bloch Sphere along the $Z$-axis by the angle $-2\alpha$. e.g. A $T(\pi/4)$ rotates $+\HAT{X}$ to $-\HAT{Y}$ by $-\pi/2$. $T(\pi/2)$ is the $Z$ operation, sending $\Ket0+\Ket1$ to $e^{i\pi/2}\Ket0+e^{-i\pi/2}\Ket1$, and after being standardised by applying $K(-\pi/2)$ becomes $\Ket0-\Ket1$.
Based on the above, one can naturally conclude that:
$K(\sigma_1+\sigma_2)=K(\sigma_1)~K(\sigma_2),\quad R(\beta_1+\beta_2)=R(\beta_1)~R(\beta_2),\quad T(\alpha_1+\alpha_2)=T(\alpha_1)~T(\alpha_2) .$
$K(0)=R(0)=T(0)=I.\qquad K(n\sigma)=K^n(\sigma),\quad R(n\beta)=K^n(\beta),\quad T(n\alpha)=T^n(\alpha) .$
$K^{-1}(\sigma)=K(-\sigma),\qquad R^{-1}(\beta)=R(-\beta),\qquad T^{-1}(\alpha)=T(-\alpha). \\ K^T(\sigma)=K(\sigma),\qquad R^T(\beta)=R(-\beta),\qquad T^T(\alpha)=T(\alpha). \\ K^\dagger(\sigma)=K(-\sigma),\qquad R^\dagger(\beta)=R(-\beta),\qquad T^\dagger(\alpha)=T(-\alpha) .$
As the conjugate transpose ($U^\dagger$) equals the inverse ($U^{-1}$), all three operations are unitary.
They are not self-inverse ($U^2=I$). By the buy-2-get-1-free principle, they are not Hermitian.
$K(\sigma)T(\alpha)=T(\alpha)K(\sigma),\quad K(\sigma)R(\beta)=R(\beta)K(\sigma).\quad X~R(\beta)~X=R(-\beta),\quad X~T(\alpha)~X=T(-\alpha) .$
Since $XX=I$, for $U=R$ or $U=T$, generally we have\quad ${X\left(\prod_i U_i(\theta_i)\right)X =\prod_i(X~U_i(\theta_i)~X) =\prod_i U_i(-\theta_i) .}$
$Q(\sigma,\alpha,\beta,\gamma)=K(\sigma)~T(\alpha)~R(\beta)~T(\gamma) =\large \begin{bmatrix} e^{i(\sigma+\alpha+\gamma)}\cos\beta & e^{i(\sigma+\alpha-\gamma)}\sin\beta\\ -e^{i(\sigma-\alpha+\gamma)}\sin\beta & e^{i(\sigma-\alpha-\gamma)}\cos\beta \end{bmatrix} =\begin{bmatrix} e^{i\theta_{00}}\cos\beta & e^{i\theta_{01}}\sin\beta\\ -e^{i\theta_{10}}\sin\beta & e^{i\theta_{11}}\cos\beta \end{bmatrix} =\begin{bmatrix} u_{00} & u_{01}\\ u_{10} & u_{11} \end{bmatrix} .$
$\because QQ^\dagger=I,\quad \begin{bmatrix} u_{00} & u_{01}\\ u_{10} & u_{11} \end{bmatrix} \begin{bmatrix} \bar u_{00} & \bar u_{10}\\ \bar u_{01} & \bar u_{11} \end{bmatrix} =\begin{bmatrix} 1 & 0\\ 0 & 1 \end{bmatrix} ,\\ u_{10}\bar u_{00}+u_{11}\bar u_{01}=0.~~ (u_{00}\bar u_{10}+u_{01}\bar u_{11}=0,~~ |u_{00}|^2+|u_{01}|^2=1,~~ |u_{10}|^2+|u_{11}|^2=1.)$
i.e. $e^{i(\theta_{10}+\pi)}\sin\beta\cdot e^{-i\theta_{00}}\cos\beta +e^{i\theta_{11}}\cos\beta\cdot e^{-i\theta_{01}}\sin\beta =0,\quad [(\theta_{10}+\pi)-\theta_{00}]-[\theta_{11}-\theta_{01}]=\pi,\\ \therefore\theta_{00}+\theta_{11}=\theta_{01}+\theta_{10} .$
So there are only three degrees of freedom as $\theta_{00}+\theta_{11}=\theta_{01}+\theta_{10}.$
Let us solve $\theta_{00}, \theta_{01}, \theta_{10}$ and derive $\theta_{11}=\theta_{01}+\theta_{10}-\theta_{00}$.
$\sigma+\alpha+\gamma=\theta_{00}.\\ \sigma+\alpha-\gamma=\theta_{01}.\\ \sigma-\alpha+\gamma=\theta_{10} .$
$\sigma=\frac{1}{2}(\theta_{01}+\theta_{10}),\quad \alpha=\frac{1}{2}(\theta_{00}-\theta_{10}),\quad \gamma=\frac{1}{2}(\theta_{00}-\theta_{01}),\\ \theta_{00}+\theta_{11}=\theta_{01}+\theta_{10},\quad \alpha+\gamma=\theta_{00}-\sigma,\quad \alpha-\gamma=\frac{1}{2}(\theta_{01}-\theta_{10}) .$
$\small{\begin{array}{| l | l | l | l | l | l | l | l | l | l | l | l |} \hline Q & Form & \beta & \theta_{00} & \theta_{01} & \theta_{10} & \theta_{11} & Constraints & \sigma & \alpha & \gamma & Notes\\ \hline I & \begin{bmatrix}1 & 0\\0 & 1\end{bmatrix} & 0 & 0 & - & - & 0 & \theta_{01}+\theta_{10}=0 & 0 & -\gamma & - & \alpha+\gamma=\theta_{00}-\sigma=0\\ \hline X & \begin{bmatrix}0 & 1\\1 & 0\end{bmatrix} & \pi/2 & - & 0 & \pi & - & \theta_{00}+\theta_{11}=\pi & \pi/2 & \gamma-\pi/2 & - & \alpha-\gamma=\frac{1}{2}(\theta_{01}-\theta_{10})=-\pi/2\\ \hline Y & \begin{bmatrix}0 & -i\\i & 0\end{bmatrix} & \pi/2 & - & 3\pi/2 & 3\pi/2 & - & \theta_{00}+\theta_{11}=3\pi & 3\pi/2 & \gamma & - & \alpha-\gamma=\frac{1}{2}(\theta_{01}-\theta_{10})=0\\ \hline Z & \begin{bmatrix}1 & 0\\0 & -1\end{bmatrix} & 0 & 0 & - & - & \pi & \theta_{01}+\theta_{10}=\pi & \pi/2 & -\gamma-\pi/2 & - & \alpha+\gamma=\theta_{00}-\sigma=-\pi/2\\ \hline Y' & \begin{bmatrix}0 & 1\\-1 & 0\end{bmatrix} & \pi/2 & - & 0 & 0 & - & \theta_{00}+\theta_{11}=0 & 0 & \gamma & - & \alpha-\gamma=\frac{1}{2}(\theta_{01}-\theta_{10})=0\\ \hline H & \frac{1}{\sqrt{2}}\begin{bmatrix}1 & 1\\1 & -1\end{bmatrix} & \pi/4 & 0 & 0 & \pi & \pi & (none) & \pi/2 & -\pi/2 & 0 & (none)\\ \hline \end{array}}$
Since there are multiple ways to rotate to the same target, we now restrict one degree of freedom by letting $\gamma=0$ so $T(\gamma)=I$.
$K(0)~T(0)~R(0)=I,\\ K(\pi/2)~T(-\pi/2)~R(\pi/2)=X,\\ K((3/2)\pi)~T(0)~R(\pi/2)=Y,\\ K(\pi/2)~T(-\pi/2)~R(0)=Z,\\ K(0)~T(0)~R(\pi/2)=Y',\\ K(\pi/2)~T(-\pi/2)~R(\pi/4)=H .$
In the full form of universal quantum gates $Q=K(\sigma)~T(\alpha)~R(\beta)~T(\gamma)$, $T(\gamma)$ seems to be redundant in the above, except in $H$ where $\gamma=0$ with no freedom. It is only because $T(0)=I$ that we omitted $T(\gamma)$ in the above. The true universal quantum gate sequence requires its full form to be general.
Another test: $R(\pi/4)=\frac{1}{\sqrt{2}}(I+Y')$ sends $\Ket0+e^{i\pi/4}\Ket1$ to $\frac{1}{\sqrt{2}}[(\Ket0+e^{i\pi/4}\Ket1)+(e^{i\pi/4}\Ket0-\Ket1)]$.
$R(\pi/2) =\begin{bmatrix} 0 & 1\\ -1 & 0 \end{bmatrix} =Y',\quad Y'[1,e^{i\pi/4}]^T =[e^{i\pi/4},-1]^T =[e^{i\pi/4},e^{i\pi}]^T =e^{i\pi/4}[1,e^{i3\pi/4}]^T .$
$R(\pi/4) =\begin{bmatrix} \cos\pi/4 & \sin\pi/4\\ -\sin\pi/4 & \cos\pi/4 \end{bmatrix} =\frac{1}{\sqrt{2}} \begin{bmatrix} 1 & 1\\ -1 & 1 \end{bmatrix} =\frac{1}{\sqrt{2}}(I+Y') .$
$\displaystyle R(\pi/4)[1,e^{i\pi/4}]^T =\frac{1}{\sqrt{2}}[e^{i~2\pi}+e^{i\pi/4},e^{i\pi/4}+e^{i\pi}]^T =\frac{1}{\sqrt{2}}e^{i\pi/4}[1+e^{i~7\pi/4},1+e^{i~3\pi/4}]^T =\frac{1}{\sqrt{2}}\frac{e^{i\pi/4}}{1+e^{i~7\pi/4}}\left[1,\frac{1+e^{i~3\pi/4}}{1+e^{i~7\pi/4}}\right]^T .$
$R(\beta)T(\alpha)= \begin{bmatrix} e^{i\alpha}\cos\beta & e^{-i\alpha}\sin\beta\\ -e^{i\alpha}\sin\beta & e^{-i\alpha}\cos\beta \end{bmatrix},\quad T(\alpha)R(\beta)= \begin{bmatrix} e^{i\alpha}\cos\beta & e^{i\alpha}\sin\beta\\ -e^{-i\alpha}\sin\beta & e^{-i\alpha}\cos\beta \end{bmatrix} .$
Gate | K T R | $Y$-rotation | $Z$-rotation |
---|---|---|---|
$I$ | $K(0)~T(0)~R(0)$ | 0 | 0 |
$X$ | $K(\pi/2)~T(-\pi/2)~R(\pi/2)$ | $-\pi$ | $\pi$ |
$Y$ | $K((3/2)\pi)~T(0)~R(\pi/2)$ | $-\pi$ | 0 |
$Z$ | $K(\pi/2)~T(-\pi/2)~R(0)$ | 0 | $\pi$ |
$Y'$ | $K(0)~T(0)~R(\pi/2)$ | $-\pi$ | 0 |
$H$ | $K(\pi/2)~T(-\pi/2)~R(\pi/4)$ | $-\pi/2$ | $\pi$ |
<< IBM Q - Sqrt T | Top | Measurement on Basis Vectors >> |