# Cirac-Zoller CNOT gate implemented by Schmidt-Kaler

I am deriving the Cirac-Zoller CNOT gate as implemented by Schmidt-Kaler following the text of Nakahara & Ohmi's textbook Quantum Computing: From Liner Algebra to Physical Realizations. The gate sequence is as follows

$$U = R_1^+(\pi,\pi) R_2(\pi/2,\pi)\Phi_2^c R_2(\pi/2,0)R_1^+(\pi,0),$$ where the subscript indicates which ion is being acted upon (either ion 1 or ion 2). This can be written as

$$U = [R_1^+(\pi,\pi) \otimes I_2] [I_1\otimes R_2(\pi/2,\pi)\Phi_2^c R_2(\pi/2,0)][R_1^+(\pi,0)\otimes I_2]$$

$$U = [R_1^+(\pi,\pi) R_1^+(\pi,0)] \otimes [R_2(\pi/2,\pi)\Phi_2^c R_2(\pi/2,0)],$$

where $$I_1$$ and $$I_2$$ are the $$2 \times 2$$ identity matrices acting on the first and second ions, respectively. $$R_i^+(\theta,\phi)$$ and $$R_i(\theta,\phi)$$ are blue-detuned and resonant transitions whose matrix representations are

$$R_n^+(\theta,\phi) = \cos \left( \frac{\sqrt{n}\theta}{2} \right)I + \sin\left( \frac{\sqrt{n}\theta}{2} \right) \begin{pmatrix} 0 & -e^{-i\phi} \\ e^{i\phi} & 0\end{pmatrix},$$

$$R_n(\theta,\phi) = \cos \left( \frac{\sqrt{n}\theta}{2} \right)I - i \sin\left( \frac{\sqrt{n}\theta}{2} \right) \begin{pmatrix} 0 & e^{-i\phi} \\ e^{i\phi} & 0\end{pmatrix},$$ in the subspaces spanned by $$\{|0\rangle \otimes |n-1\rangle\, |1\rangle \otimes |n\rangle\}$$ and $$\{ |0\rangle \otimes |n\rangle, |1\rangle \otimes |n\rangle\}$$, respectively. Here, $$n$$ is the index of the vibrational mode of the ion lattice. According to the book, $$U$$ should have the following matrix form

$$U = \begin{pmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & i \\ 0 & 0 & -i & 0 \end{pmatrix}.$$ I cannot get this result. The matrix representations for each gate, using the equations above, are $$R_1^+(\pi,\pi) = \cos \left( \frac{\pi}{2} \right) I + \sin \left( \frac{\pi}{2} \right) \begin{pmatrix} 0 & -e^{-i\pi} \\ e^{i\pi} & 0\end{pmatrix}= \begin{pmatrix} 0 & -1 \\ -1 & 0\end{pmatrix},\\$$

$$R_1^+(\pi,0) = \cos \left( \frac{\pi}{2} \right) I + \sin \left( \frac{\pi}{2} \right) \begin{pmatrix} 0 & -e^{-i0} \\ e^{i0} & 0\end{pmatrix} = \begin{pmatrix} 0 & -1 \\ 1 & 0\end{pmatrix},$$

$$R_2(\pi/2,\pi) = \cos \left( \frac{\pi}{4} \right) I - i \sin \left( \frac{\pi}{4} \right) \begin{pmatrix} 0 & e^{-i\pi} \\ e^{i\pi} & 0\end{pmatrix}= \frac{1}{\sqrt{2}}\begin{pmatrix} 1 & -i \\ i & 1\end{pmatrix},$$

$$R_2(\pi/2,0) = \cos \left( \frac{\pi}{4} \right) I - i \sin \left( \frac{\pi}{4} \right) \begin{pmatrix} 0 & e^{-i0} \\ e^{i0} & 0\end{pmatrix} = \frac{1}{\sqrt{2}}\begin{pmatrix} 1 & -i \\ -i & 1\end{pmatrix},$$

$$R_2^+(\pi/\sqrt{2},\pi/2) = \cos \left( \frac{\pi}{2\sqrt{2}} \right) I + \sin \left( \frac{\pi}{2\sqrt{2}} \right) \begin{pmatrix} 0 & -e^{-i\pi/2} \\ e^{i\pi/2} & 0\end{pmatrix} = \begin{pmatrix} a & ib \\ ib & a\end{pmatrix},$$

$$R_2^+(\pi,0) = \cos \left( \frac{\pi}{2} \right) I + \sin \left( \frac{\pi}{2} \right) \begin{pmatrix} 0 & -e^{-i0} \\ e^{i0} & 0\end{pmatrix} =\begin{pmatrix} 0 & -1 \\ 1 & 0\end{pmatrix},$$ where $$a$$ ($$b$$) is $$\cos(\pi/2\sqrt{2})$$ ($$\sin(\pi/2\sqrt{2})$$). Putting these together, we obtain

$$\Phi_2^c = \begin{pmatrix} a & ib \\ ib & a\end{pmatrix} \begin{pmatrix} 0 & -1 \\ 1 & 0\end{pmatrix}\begin{pmatrix} a & ib \\ ib & a\end{pmatrix} \begin{pmatrix} 0 & -1 \\ 1 & 0\end{pmatrix}=\begin{pmatrix} -a^2 - b^2 & 0 \\ 0 & -a^2-b^2\end{pmatrix} = - \begin{pmatrix} 1 & 0 \\ 0 & 1\end{pmatrix},$$

$$R_2(\pi/2,\pi)\Phi_2^c R_2(\pi/2,0) = \frac{1}{\sqrt{2}}\begin{pmatrix} 1 & -i \\ i & 1\end{pmatrix} \begin{pmatrix} -1 & 0 \\ 0 & -1\end{pmatrix}\frac{1}{\sqrt{2}}\begin{pmatrix} 1 & -i \\ -i & 1\end{pmatrix} = \begin{pmatrix} 0 & i \\ 0 & -1\end{pmatrix}$$

and

$$R_1^+(\pi,\pi) R_1^+(\pi,0) = \begin{pmatrix} 0 & -1 \\ -1 & 0\end{pmatrix} \begin{pmatrix} 0 & -1 \\ 1 & 0\end{pmatrix} = \begin{pmatrix} -1 & 0 \\ 0 & 1\end{pmatrix}.$$

$$U = \begin{pmatrix} -1 & 0 \\ 0 & 1\end{pmatrix} \otimes \begin{pmatrix} 0 & i \\ 0 & -1\end{pmatrix} = \begin{pmatrix} 0 & -i & 0 & 0\\ 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & i \\ 0 & 0 & 0 & -1\end{pmatrix},$$ which is obviously incorrect. I've repeated this a couple times and still get the wrong result every time. Where am I making a mistake?
Your formula for $$R_2(\pi/2,\pi)$$ is incorrect: The resulting matrix is not unitary (but rather rank 1). (There should be +1 in the top right corner.)