量子コンピューティングを勉強していて、よく量子ゲートの動作や量子回路の簡略化の方法を忘れるので、備忘録として投稿します。この分野を勉強する方々にも役に立つと幸いです。主に以下のページを参考にしました。
The basics of Quantum Computing
IBM | Quantum Computing
量子ゲートの行列表示
- Pauli-X gate
$$
X = \left(\begin{matrix}
0 & 1 \\
1 & 0
\end{matrix}\right)
$$
- Pauli-Y gate
$$
Y = \left(\begin{matrix}
0 & -i \\
i & 0
\end{matrix}\right)
$$
- Pauli-Z gate
$$
Z = \left(\begin{matrix}
1 & 0 \\
0 & -1
\end{matrix}\right)
$$
- Rx gate
$$
R_x(\theta) = e^{-i\frac{\theta}{2}X} = \left(\begin{matrix}
\cos(\frac{\theta}{2}) & -i\sin(\frac{\theta}{2}) \\
-i\sin(\frac{\theta}{2}) & \cos(\frac{\theta}{2})
\end{matrix}\right)
$$
- Ry gate
$$
R_y(\theta) = e^{-i\frac{\theta}{2}Y} = \left(\begin{matrix}
\cos(\frac{\theta}{2}) & -\sin(\frac{\theta}{2}) \\
-\sin(\frac{\theta}{2}) & \cos(\frac{\theta}{2})
\end{matrix}\right)
$$
- Rz gate
$$
R_z(\theta) = e^{-i\frac{\theta}{2}Z} = \left(\begin{matrix}
e^{-i\frac{\theta}{2}} & 0 \\
0 & e^{i\frac{\theta}{2}}
\end{matrix}\right)
$$
- Phase gate
$$
S = \left(\begin{matrix}
1 & 0 \\
0 & i
\end{matrix}\right)
$$
- $\frac{\pi}{8}$ gate (T gate)
$$
T = \exp{(i\pi / 8)} \left(\begin{matrix}
\exp{(-i\pi / 8)} & 0 \\
0 & \exp{(i\pi / 8)}
\end{matrix}\right) = \left(\begin{matrix}
1 & 0 \\
0 & \exp{(i\pi / 4)}
\end{matrix}\right)
$$
- Hadamard gate
$$
H = \frac{1}{\sqrt{2}}\left(\begin{matrix}
1 & 1 \\
1 & -1
\end{matrix}\right)
$$
- controlled not (またはCNOT、controlled X)
第1量子ビットが制御ビット、第2量子ビットが標的ビットの場合の行列:
$$
CNOT_{1, 2} = \left(\begin{matrix}
1 & 0 & 0 & 0 \\
0 & 1 & 0 & 0 \\
0 & 0 & 0 & 1 \\
0 & 0 & 1 & 0
\end{matrix}\right)
$$
量子回路としての表示:
- 任意のユニタリオペレータ$U$について、以下を満たすような実数$\alpha, \beta, \gamma, \delta$が存在する。
$$
U = e^{i\alpha}R_z(\beta)R_y(\gamma)R_z(\delta)
$$
相互関係
相互関係と呼ぶのかは知りませんが、ここでは同じ動作を示す量子回路の組をいくつか説明します。
1量子回路
- $XZX = -Z$
- $HXH=Z$
- $HYH=-Y$
- $HZH = X$
- $HTH=R_x(\frac{\pi}{4})$
- $SHZHS^\dagger = Y$
- $S=T^2$
- $XYX=-Y$
- $XR_y(\theta)X=R_y(-\theta)$
2量子回路
- controlled Rz gate =
$$
CNOT_{1,2} (I \otimes R_z(-\theta/2)) CNOT_{1,2} (I \otimes R_z(\theta/2))
$$
==