Solutions: Quantum Computation and Quantum Information by Nielsen and Chuang

Solutions: Quantum Computation and Quantum Information by Nielsen and Chuang

Chapter 4

4.1

(i) $X$

$$ \begin{align} \left| X_{1}\right\rangle &= \frac{1}{\sqrt{2}}\left( \left| 0\right\rangle + \left| 1\right\rangle \right) :\; \left( \frac{\pi}{2},\; 0 \right)\\ \left| X_{-1}\right\rangle &= \frac{1}{\sqrt{2}}\left( \left| 0\right\rangle - \left| 1\right\rangle \right) :\; \left( \frac{\pi}{2},\; \pi \right) \end{align} $$

(ii) $Y$

$$ \begin{align} \left| Y_{1}\right\rangle &= \frac{1}{\sqrt{2}}\left( \left| 0\right\rangle + i\left| 1\right\rangle \right) :\; \left( \frac{\pi}{2},\;\frac{\pi}{2} \right)\\ \left| Y_{-1}\right\rangle &= \frac{1}{\sqrt{2}}\left( \left| 0\right\rangle - i\left| 1\right\rangle \right) :\; \left( \frac{\pi}{2},\;\frac{3\pi}{2} \right) \end{align} $$

(iii) $Z$

$$ \begin{align} \left| Z_{1}\right\rangle &= \left| 0\right\rangle :\; \left( 0,\;0 \right)\\ \left| Z_{-1}\right\rangle &= \left| 1\right\rangle :\; \left( \pi,\;0 \right) \end{align} $$

4.2

$$ \begin{align} \exp\left( iAx \right) &= I + iAx -\frac{x^2}{2!}I -i\frac{x^3}{3!}A+ \cdots \\ &= \left( 1-\frac{x^2}{2!}+\frac{x^4}{4!}\cdots \right)I + i\left(x-\frac{x^3}{3!}+\frac{x^5}{5!}\cdots \right)A \\ &= \cos (x)I + i\sin (x)A \end{align} $$
$$ \begin{align} R_x (\theta) &\equiv \mathrm{e}^{-i\theta X/2} = \cos\frac{\theta}{2}I-i\sin\frac{\theta}{2}X = \begin{pmatrix} \cos\frac{\theta}{2} & -i\sin\frac{\theta}{2} \\ -i\sin\frac{\theta}{2} & \cos\frac{\theta}{2} \end{pmatrix} \\ R_y (\theta) &\equiv \mathrm{e}^{-i\theta Y/2} = \cos\frac{\theta}{2}I-i\sin\frac{\theta}{2}Y = \begin{pmatrix} \cos\frac{\theta}{2} & -\sin\frac{\theta}{2} \\ \sin\frac{\theta}{2} & \cos\frac{\theta}{2} \end{pmatrix} \\ R_z (\theta) &\equiv \mathrm{e}^{-i\theta Z/2} = \cos\frac{\theta}{2}I-i\sin\frac{\theta}{2}Z = \begin{pmatrix} \cos\frac{\theta}{2}-i\sin\frac{\theta}{2} & 0 \\ 0 & \cos\frac{\theta}{2}+i\sin\frac{\theta}{2} \end{pmatrix} = \begin{pmatrix} \mathrm{e}^{-i\theta /2} & 0 \\ 0 & \mathrm{e}^{i\theta /2} \end{pmatrix} \end{align} $$

4.3

$$ \begin{align} T &= \mathrm{e}^{i\pi/8} \begin{pmatrix} \mathrm{e}^{-i\pi/8} & 0 \\ 0 & \mathrm{e} ^{i\pi/8} \end{pmatrix} \\ R_z\left( \pi/4 \right) &= \begin{pmatrix} \mathrm{e}^{-i\pi/8} & 0 \\ 0 & \mathrm{e}^{i\pi/8} \end{pmatrix} \end{align} $$

4.4

$$ \begin{align} R_z\left( \frac{\pi}{2} \right)R_x\left( \frac{\pi}{2} \right)R_z\left( \frac{\pi}{2} \right) &= \begin{pmatrix} \mathrm{e}^{-i\pi/4} & 0 \\ 0 & \mathrm{e}^{i\pi/4} \end{pmatrix} \begin{pmatrix} \cos\frac{\pi}{4} & -i\sin\frac{\pi}{4} \\ i\sin\frac{\pi}{4} & \cos\frac{\pi}{4} \end{pmatrix} \begin{pmatrix} \mathrm{e}^{-i\pi/4} & 0 \\ 0 & \mathrm{e}^{i\pi/4} \end{pmatrix} \\ &= \begin{pmatrix} \mathrm{e}^{-i\pi/2}\cos\frac{\pi}{4} & -i\sin\frac{\pi}{4} \\ -i\sin\frac{\pi}{4} & \mathrm{e}^{i\pi/2}\cos\frac{\pi}{4} \end{pmatrix} \\ &= \begin{pmatrix} \mathrm{e}^{-i\pi/2}\cos\frac{\pi}{4} & \mathrm{e}^{3i\pi/2}\sin\frac{\pi}{4} \\ \mathrm{e}^{3i\pi/2}\sin\frac{\pi}{4} & \mathrm{e}^{i\pi/2}\cos\frac{\pi}{4} \end{pmatrix} \\ &= \frac{\mathrm{e}^{-i\pi/2}}{\sqrt{2}} \begin{pmatrix} 1 & 1 \\ 1 & -1 \end{pmatrix} \end{align} $$

4.5

$$ \begin{align} \left( \hat{n}\cdot\hat{\sigma} \right)^2 &= (n_x^2+n_y^2+n_z^2)I+n_xn_y(XY+YX)+n_yn_z(YZ+ZY)+n_zn_x(ZX+XZ) \\ &= I\;\;\;\left( \because \left| n\right|=1,\;\left\{\sigma_i,\sigma_j \right\}=2I\delta_{ij} \right) \end{align} $$
$$ \begin{align} R_n(\theta) &\equiv \mathrm{e}^{-i\theta\hat{n}\cdot\hat{\sigma}/2} \\ &= I - i\frac{\theta}{2}\hat{n}\cdot\hat{\sigma}-\frac{1}{2!}\left( \frac{\theta}{2} \right)^2I+\frac{i}{3!}\left( \frac{\theta}{2} \right)^3\hat{n}\cdot\hat{\sigma}+\cdots \\ &= \left(1-\frac{1}{2!}\left(\frac{\theta}{2}\right)^2+\frac{1}{4!}\left(\frac{\theta}{2}\right)^4 - \cdots\right)I -i\left(\frac{\theta}{2} - \left(\frac{\theta}{2}\right)^3 + \frac{1}{5!}\left(\frac{\theta}{2}\right)^5 - \cdots\right)\hat{n}\cdot\hat{\sigma} \\ &= \cos\left(\frac{\theta}{2}\right) I - i\sin\left(\frac{\theta}{2}\right)\left(n_xX+n_yY+n_zZ \right) \end{align} $$

4.7

$$ \begin{align} XYX &= iZX = -Y \\ ( &= \begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix} \begin{pmatrix} 0 & -i \\ i & 0 \end{pmatrix} \begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix} = \begin{pmatrix} 0 & i \\ -i & 0 \end{pmatrix} = -Y ) \\ XR_y(\theta)X &= X\mathrm{e}^{-i\theta Y/2}X \\ &= \mathrm{e}^{i\theta Y/2}X^2\;\;\;\left( \because\left\{ X,Y \right\}=0 \right) \\ &= R_y(-\theta) \end{align} $$

4.8

  1. Since Unitary operators transform a state to the other state, both are the point on the Bloch sphere, it can be expressed as the rotation $\mathrm{exp}\left(i\alpha\right)R_{\vec{n}}\left(\theta\right)$
  2. $\alpha=\pi/2,\ \ \theta=\pi,\ \ \vec{n}=\left(1/\sqrt{2},0,1/\sqrt{2}\right)^T$.
    Check:
$$ \begin{align} \mathrm{exp}\left(i\frac{\pi}{2}\right)R_{(1/\sqrt{2},0,1/\sqrt{2})}\left(\pi\right) &= i\left(\cos\left(\frac{\pi}{2}\right)I-i\sin\left(\frac{\pi}{2}\right)\left(\frac{X}{\sqrt{2}}+\frac{Z}{\sqrt{2}}\right)\right) \\ &= \frac{X+Z}{\sqrt{2}} = H \end{align} $$
  1. $\alpha=\pi/4,\ \ \theta=\pi/2,\ \ \vec{n}=\left(0,0,1\right)^T$.
    Check:
$$ \begin{align} \mathrm{exp}\left(i\frac{\pi}{4}\right)R_{(0,0,1)}\left(\frac{\pi}{2}\right) &= \left(\cos\left(\frac{\pi}{4}\right)+i\sin\left(\frac{\pi}{4}\right)\right)\left(\cos\left(\frac{\pi}{4}\right)I-i\sin\left(\frac{\pi}{4}\right)Z\right) \\ &= \frac{1+i}{\sqrt{2}}\frac{1}{\sqrt{2}} \begin{pmatrix} 1-i & 0 \\ 0 & 1+i \end{pmatrix} = \frac{1}{2} \begin{pmatrix} 2 & 0 \\ 0 & 2i \end{pmatrix} = \begin{pmatrix} 1 & 0 \\ 0 & i \end{pmatrix} = S. \end{align} $$

4.9

$$ \begin{align} U &= \mathrm{exp}\left(i\alpha'\right)R_{\vec{n}}(\theta) \\ &= \mathrm{exp}\left(i\alpha'\right)\left(\cos\left(\frac{\theta}{2}\right)I-i\sin\left(\frac{\theta}{2}\right)\left(n_xX+n_yY+n_zZ\right)\right) \\ &= \mathrm{exp}\left(i\alpha'\right) \begin{pmatrix} \cos\frac{\theta}{2}-i\sin\left(\frac{\theta}{2}\right)\left(n_x+n_z\right) & -n_y\sin\frac{\theta}{2} \\ n_y\sin\frac{\theta}{2} & \cos\frac{\theta}{2}-i\sin\left(\frac{\theta}{2}\right)\left(n_x-n_z\right) \end{pmatrix} \\ &= \mathrm{exp}\left(i\alpha'\right) \begin{pmatrix} \left(1-i\tan\left(\frac{\theta}{2}\right)\left(n_x+n_z\right)\right)\cos\frac{\theta}{2} & -n_y\sin\frac{\theta}{2} \\ n_y\sin\frac{\theta}{2} & \left(1-i\tan\left(\frac{\theta}{2}\right)\right)\left(n_x-n_z\right) \end{pmatrix}. \end{align} $$

So, putting $\alpha'=\alpha,\ \ \theta=\gamma/2,\ \ n_x=,\ \ n_y=\cos(\beta/2-\delta/2),\ \ n_z=\sin^2(\beta/2+\delta/2)/\tan^2(\gamma/2)$ gives eq. $(4.12)$.


4.13

In matrix form:

$$ \begin{align} HXH &= \left(\frac{1}{\sqrt{2}}\right)^2 \begin{pmatrix} 1 & 1 \\ 1 & -1 \end{pmatrix} \begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix} \begin{pmatrix} 1 & 1 \\ 1 & -1 \end{pmatrix} \\ &= \frac{1}{2} \begin{pmatrix} 2 & 0 \\ 0 & -2 \end{pmatrix} = Z \\ HYH &= \left(\frac{1}{\sqrt{2}}\right)^2 \begin{pmatrix} 1 & 1 \\ 1 & -1 \end{pmatrix} \begin{pmatrix} 0 & -i \\ i & 0 \end{pmatrix} \begin{pmatrix} 1 & 1 \\ 1 & -1 \end{pmatrix} \\ &= \frac{1}{2} \begin{pmatrix} 0 & 2i \\ -2i & 0 \end{pmatrix} = -Y \\ HZH &= \left(\frac{1}{\sqrt{2}}\right)^2 \begin{pmatrix} 1 & 1 \\ 1 & -1 \end{pmatrix} \begin{pmatrix} 1 & 0 \\ 0 & -1 \end{pmatrix} \begin{pmatrix} 1 & 1 \\ 1 & -1 \end{pmatrix} \\ &= \frac{1}{2} \begin{pmatrix} 0 & 2 \\ 2 & 0 \end{pmatrix} = X \end{align} $$

Directly(?):

$$ \begin{align} HXH &= \left(\frac{1}{\sqrt{2}}\right)^2 \left( X+Z \right)X\left( X+Z \right)\;\;\;\left(\because H = \frac{1}{\sqrt{2}}\left(X+Z\right)\right) \\ &= \frac{1}{2}\left( X+Z \right) \left( I+XZ \right) \\ &= \frac{1}{2}\left( X+X^2Z+Z+ZXZ \right)\\ &= \frac{1}{2}\left( X+2Z+iYZ \right) \\ &= Z \\ HYH &= \frac{1}{2}\left( X+Z \right)Y\left( X+Z \right) \\ &= \frac{1}{2}\left( XYX+XYZ+ZYX+ZYZ \right) \\ &= \frac{1}{2}\left( XYX + ZYZ \right) \\ &= -Y \\ HZH &= \frac{1}{2}\left( X+Z \right)Z\left( X+Z \right) \\ &= \frac{1}{2}\left( XZX+XZ^2+Z^2X+Z^3 \right) \\ &= X \end{align} $$

Although it’s quite straightforward to compute the products of Pauli matrices in matrix form, I strongly recommend to get used to not use matrix. You’ll frequently perform multi-qubit caliculation such as $(X\otimes Y\otimes Z)(X\otimes X\otimes Z)$, then it’s combersome since the dimension of matrix becomes large.


4.14

$$ \begin{align} HTH &= \mathrm{e}^{i\pi/8}HR_z\left(\frac{\pi}{4}\right)H = \mathrm{e}^{i\pi/8}H\mathrm{e}^{-i\pi Z/8}H \\ &= \mathrm{e}^{i\pi/8}H\left[ 1-i\frac{\pi Z}{8}-\frac{1}{2!}\left(\frac{\pi Z}{8}\right)^2+\cdots\right]H \\ &= \mathrm{e}^{i\pi/8}\left[ H^2-i\frac{\pi}{8}HZH-\frac{1}{2!}\left(\frac{\pi}{8}\right)^2HZHHZH+\cdots \right]\;\;\;\left(\because H^2=I\right) \\ &= \mathrm{e}^{i\pi/8}\left[1-i\frac{\pi}{8}X-\frac{1}{2!}\left(\frac{\pi}{8}\right)^2X^2+\cdots \right] \\ &= \mathrm{e}^{i\pi/8}\mathrm{e}^{-i\pi X/8} = \mathrm{e}^{i\pi/8}R_x\left(\frac{\pi}{4}\right) \end{align} $$

4.16

upper:

$$ \begin{equation} I \otimes H = \frac{1}{\sqrt{2}} \begin{pmatrix} 1 & 1 & 0 & 0 \\ 1 & -1 & 0 & 0 \\ 0 & 0 & 1 & 1 \\ 0 & 0 & 1 & -1 \\ \end{pmatrix} \end{equation} $$

lower:

$$ \begin{equation} H \otimes I = \frac{1}{\sqrt{2}} \begin{pmatrix} 1 & 0 & 1 & 0 \\ 0 & 1 & 0 & 1 \\ 1 & 0 & -1 & 0 \\ 0 & 1 & 0 & -1 \end{pmatrix} \end{equation} $$

4.17

Since $HZH=X$,

$$ \begin{align} &\mathrm{controlled-}H\times\mathrm{controlled-}Z\times\mathrm{controlled-}H \\ &= \left(\frac{1}{\sqrt{2}}\right)^2 \begin{pmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 1 & 1 \\ 0 & 0 & 1 & -1 \end{pmatrix} \begin{pmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & -1 \end{pmatrix} \begin{pmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 1 & 1 \\ 0 & 0 & 1 & -1 \end{pmatrix} \\ &= \begin{pmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 1 \\ 0 & 0 & 1 & 0 \end{pmatrix} = \mathrm{CNOT}. \end{align} $$

In another expression,

$$ \begin{align} &\mathrm{controlled-}H\times\mathrm{controlled-}Z\times\mathrm{controlled-}H \\ &= \left(\left|0\right\rangle\left\langle0\right|\otimes I+\left|1\right\rangle\left\langle1\right|\otimes H\right)\;\left(\left|0\right\rangle\left\langle0\right|\otimes I + \left|1\right\rangle\left\langle1\right|\otimes Z\right)\;\left(\left|0\right\rangle\left\langle0\right|\otimes I+\left|1\right\rangle\left\langle1\right|\otimes H\right) \\ &= \left|0\right\rangle\left\langle0\right|\otimes I + \left|1\right\rangle\left\langle1\right|\otimes HZH \\ &= \left|0\right\rangle\left\langle0\right|\otimes I + \left|1\right\rangle\left\langle1\right|\otimes X \\ &= \mathrm{CNOT}. \end{align} $$

4.18

$$ \begin{align} \mathrm{c-}Z_{1,2}\left|\psi_1\right\rangle\otimes\left|\psi_2\right\rangle &= \left(\left|0\right\rangle\left\langle0\right|\otimes I + \left|1\right\rangle\left\langle1\right|\otimes Z\right)\;\left[\left(a_1\left|0\right\rangle+b_1\left|1\right\rangle\right)\otimes\left(a_2\left|0\right\rangle+b_2\left|1\right\rangle\right)\right] \\ &= a_1a_2\left|00\right\rangle+a_1b_2\left|01\right\rangle+b_1a_2\left|10\right\rangle-b_1b_2\left|11\right\rangle \\ \mathrm{c-}Z_{2,1}\left|\psi_1\right\rangle\otimes\left|\psi_2\right\rangle &= \left(I\otimes\left|0\right\rangle\left\langle0\right| + Z\otimes\left|1\right\rangle\left\langle1\right|\right)\;\left[\left(a_1\left|0\right\rangle+b_1\left|1\right\rangle\right)\otimes\left(a_2\left|0\right\rangle+b_2\left|1\right\rangle\right)\right] \\ &= a_1a_2\left|00\right\rangle+a_1b_2\left|01\right\rangle+b_1a_2\left|10\right\rangle-b_1b_2\left|11\right\rangle \end{align} $$

Here we denoted c-$Z_{1,2}$ as a controlled-$Z$ gate which takes the first qubit as the controll qubit and the second qubit as the target qubit.


4.19

$$ \begin{align} \rho &= \begin{pmatrix} a_{00}b_{00} & a_{00}b_{01} & a_{00}b_{10} & a_{00}b_{11} \\ a_{01}b_{00} & a_{01}b_{01} & a_{01}b_{10} & a_{01}b_{11} \\ a_{10}b_{00} & a_{10}b_{01} & a_{10}b_{10} & a_{10}b_{11} \\ a_{11}b_{00} & a_{11}b_{01} & a_{11}b_{10} & a_{11}b_{11} \end{pmatrix} \\ \mathrm{CNOT}(\rho) &= \begin{pmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 1 \\ 0 & 0 & 1 & 0 \end{pmatrix} \begin{pmatrix} a_{00}b_{00} & a_{00}b_{01} & a_{00}b_{10} & a_{00}b_{11} \\ a_{01}b_{00} & a_{01}b_{01} & a_{01}b_{10} & a_{01}b_{11} \\ a_{10}b_{00} & a_{10}b_{01} & a_{10}b_{10} & a_{10}b_{11} \\ a_{11}b_{00} & a_{11}b_{01} & a_{11}b_{10} & a_{11}b_{11} \end{pmatrix} \begin{pmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 1 \\ 0 & 0 & 1 & 0 \end{pmatrix}^{\dagger} \\ &= \begin{pmatrix} a_{00}b_{00} & a_{00}b_{01} & a_{00}b_{11} & a_{00}b_{10} \\ a_{01}b_{00} & a_{01}b_{01} & a_{01}b_{11} & a_{01}b_{10} \\ a_{10}b_{01} & a_{10}b_{00} & a_{10}b_{10} & a_{10}b_{11} \\ a_{11}b_{01} & a_{11}b_{00} & a_{11}b_{10} & a_{11}b_{11} \end{pmatrix} \end{align} $$

4.20

$$ \begin{align} &\left(H\otimes H\right)\;\left(\left|0\right\rangle\left\langle 0\right|\otimes I + \left|1\right\rangle\left\langle 1\right|\otimes X\right)\;\left(H\otimes H\right) \\ &= \left(\frac{1}{\sqrt{2}}\right)^2 \begin{pmatrix} H & H \\ H & -H \end{pmatrix} \begin{pmatrix} I & 0 \\ 0 & X \end{pmatrix} \begin{pmatrix} H & H \\ H & -H \end{pmatrix} \\ &= \frac{1}{2} \begin{pmatrix} H^2+HXH & H^2-HXH \\ H^2-HXH & H^2+HXH \end{pmatrix} \\ &= \frac{1}{2} \begin{pmatrix} I+Z & I-Z \\ I-Z & I+Z \end{pmatrix} = \begin{pmatrix} 1 & 0 & 0 & 0 \\ 0 & 0 & 0 & 1 \\ 0 & 0 & 1 & 0 \\ 0 & 1 & 0 & 0 \end{pmatrix} = \mathrm{CNOT}_{2,1} \end{align} $$

Since $H\left|0\right\rangle=\left|+\right\rangle, H\left|0\right\rangle=\left|-\right\rangle,$ and $H^2=I,$

$$ \begin{align} \mathrm{CNOT}_{1,2}\left|++\right\rangle &= \left(H\otimes H\right)^2\mathrm{CNOT}_{1,2}\left(H\otimes H\right) \left|00\right\rangle \\ &= \left(H\otimes H\right)\mathrm{CNOT}_{2,1}\left|00\right\rangle \\ &= \left(H\otimes H\right)\left|00\right\rangle = \left|++\right\rangle\\ \mathrm{CNOT}_{1,2}\left|-+\right\rangle &= \left(H\otimes H\right)^2\mathrm{CNOT}_{1,2}\left(H\otimes H\right) \left|10\right\rangle \\ &= \left(H\otimes H\right)\mathrm{CNOT}_{2,1}\left|10\right\rangle \\ &= \left(H\otimes H\right)\left|10\right\rangle = \left|-+\right\rangle\\ \mathrm{CNOT}_{1,2}\left|+-\right\rangle &= \left(H\otimes H\right)^2\mathrm{CNOT}_{1,2}\left(H\otimes H\right) \left|01\right\rangle \\ &= \left(H\otimes H\right)\mathrm{CNOT}_{2,1}\left|01\right\rangle \\ &= \left(H\otimes H\right)\left|11\right\rangle = \left|--\right\rangle\\ \mathrm{CNOT}_{1,2}\left|--\right\rangle &= \left(H\otimes H\right)^2\mathrm{CNOT}_{1,2}\left(H\otimes H\right) \left|11\right\rangle \\ &= \left(H\otimes H\right)\mathrm{CNOT}_{2,1}\left|11\right\rangle \\ &= \left(H\otimes H\right)\left|01\right\rangle = \left|+-\right\rangle\\ \end{align} $$

4.21

$$ \begin{align} &\left|00\right\rangle\left|\phi\right\rangle \longrightarrow \left|00\right\rangle\left|\phi\right\rangle \\ &\left|01\right\rangle\left|\phi\right\rangle \longrightarrow \left|01\right\rangle VV^{\dagger}\left|\phi\right\rangle=\left|01\right\rangle\left|\phi\right\rangle \\ &\left|10\right\rangle\left|\phi\right\rangle \longrightarrow \left|10\right\rangle V^{\dagger}V\left|\phi\right\rangle=\left|10\right\rangle\left|\phi\right\rangle \\ &\left|11\right\rangle\left|\phi\right\rangle \longrightarrow \left|11\right\rangle V^2\left|\phi\right\rangle=\left|11\right\rangle U\left|\phi\right\rangle \end{align} $$

4.24

circuit_4_24


$$ \begin{align} \left|\psi_0\right\rangle&=\left|\phi_1\phi_2\phi_3\right\rangle = \left( a_1\left|0\right\rangle+b_1\left|1\right\rangle \right)\left( a_2\left|0\right\rangle+b_2\left|1\right\rangle \right)\left( a_3\left|0\right\rangle+b_3\left|1\right\rangle \right) \\ \left|\psi_1\right\rangle&=\left( a_1\left|0\right\rangle+b_1\left|1\right\rangle \right)\left( a_2\left|0\right\rangle+b_2\left|1\right\rangle \right)\left(\frac{a_3+b_3}{\sqrt{2}}\left|0\right\rangle+\frac{a_3-b_3}{\sqrt{2}}\left|1\right\rangle \right) \\ \left|\psi_2\right\rangle&=\left( a_1\left|0\right\rangle+b_1\left|1\right\rangle \right)\left[ a_2\left|0\right\rangle\left(\frac{a_3+b_3}{\sqrt{2}}\left|0\right\rangle+\frac{a_3-b_3}{\sqrt{2}}\left|1\right\rangle\right)+b_2\left|1\right\rangle\left(\frac{a_3-b_3}{\sqrt{2}}\left|0\right\rangle+\frac{a_3+b_3}{\sqrt{2}}\left|1\right\rangle\right) \right] \\ \left|\psi_3\right\rangle&=\left(a_1\left|0\right\rangle+b_1\left|1\right\rangle\right)\left[ a_2\left|0\right\rangle\left(\frac{a_3+b_3}{\sqrt{2}}\left|0\right\rangle+\frac{a_3-b_3}{\sqrt{2}}\mathrm{e}^{-i\pi/4}\left|1\right\rangle\right)+b_2\left|1\right\rangle\left(\frac{a_3-b_3}{\sqrt{2}}\left|0\right\rangle+\frac{a_3+b_3}{\sqrt{2}}\mathrm{e}^{-i\pi/4}\left|1\right\rangle\right) \right] \\ \left|\psi_4\right\rangle&=a_1\left|0\right\rangle\left[ a_2\left|0\right\rangle\left(\frac{a_3+b_3}{\sqrt{2}}\left|0\right\rangle+\frac{a_3-b_3}{\sqrt{2}}\mathrm{e}^{-i\pi/4}\left|1\right\rangle\right)+b_2\left|1\right\rangle\left(\frac{a_3-b_3}{\sqrt{2}}\left|0\right\rangle+\frac{a_3+b_3}{\sqrt{2}}\mathrm{e}^{-i\pi/4}\left|1\right\rangle\right) \right] \\ &+b_1\left|1\right\rangle\left[ a_2\left|0\right\rangle\left(\frac{a_3-b_3}{\sqrt{2}}\mathrm{e}^{-i\pi/4}\left|0\right\rangle+\frac{a_3+b_3}{\sqrt{2}}\left|1\right\rangle\right)+b_2\left|1\right\rangle\left(\frac{a_3+b_3}{\sqrt{2}}\mathrm{e}^{-i\pi/4}\left|0\right\rangle+\frac{a_3-b_3}{\sqrt{2}}\left|1\right\rangle\right) \right] \\ \left|\psi_5\right\rangle&=a_1\left|0\right\rangle\left[ a_2\left|0\right\rangle\left(\frac{a_3+b_3}{\sqrt{2}}\left|0\right\rangle+\frac{a_3-b_3}{\sqrt{2}}\left|1\right\rangle\right)+b_2\left|1\right\rangle\left(\frac{a_3-b_3}{\sqrt{2}}\left|0\right\rangle+\frac{a_3+b_3}{\sqrt{2}}\left|1\right\rangle\right) \right] \\ &+b_1\left|1\right\rangle\left[ a_2\left|0\right\rangle\left(\frac{a_3-b_3}{\sqrt{2}}\mathrm{e}^{-i\pi/4}\left|0\right\rangle+\frac{a_3+b_3}{\sqrt{2}}\mathrm{e}^{i\pi/4}\left|1\right\rangle\right)+b_2\left|1\right\rangle\left(\frac{a_3+b_3}{\sqrt{2}}\mathrm{e}^{-i\pi/4}\left|0\right\rangle+\frac{a_3-b_3}{\sqrt{2}}\mathrm{e}^{i\pi/4}\left|1\right\rangle\right) \right] \\ \left|\psi_6\right\rangle&=a_1\left|0\right\rangle\left[ a_2\left|0\right\rangle\left(\frac{a_3+b_3}{\sqrt{2}}\left|0\right\rangle+\frac{a_3-b_3}{\sqrt{2}}\left|1\right\rangle\right)+b_2\left|1\right\rangle\left(\frac{a_3+b_3}{\sqrt{2}}\left|0\right\rangle+\frac{a_3-b_3}{\sqrt{2}}\left|1\right\rangle\right) \right] \\ &+b_1\left|1\right\rangle\left[ a_2\left|0\right\rangle\left(\frac{a_3-b_3}{\sqrt{2}}\mathrm{e}^{-i\pi/4}\left|0\right\rangle+\frac{a_3+b_3}{\sqrt{2}}\mathrm{e}^{i\pi/4}\left|1\right\rangle\right)+b_2\left|1\right\rangle\left(\frac{a_3-b_3}{\sqrt{2}}\mathrm{e}^{i\pi/4}\left|0\right\rangle+\frac{a_3+b_3}{\sqrt{2}}\mathrm{e}^{-i\pi/4}\left|1\right\rangle\right) \right] \\ \left|\psi_7\right\rangle&=a_1\left|0\right\rangle\left[ a_2\left|0\right\rangle\left(\frac{a_3+b_3}{\sqrt{2}}\left|0\right\rangle+\frac{a_3-b_3}{\sqrt{2}}\mathrm{e}^{-i\pi/4}\left|1\right\rangle\right)+b_2\left|1\right\rangle\left(\frac{a_3+b_3}{\sqrt{2}}\left|0\right\rangle+\frac{a_3-b_3}{\sqrt{2}}\mathrm{e}^{-i\pi/4}\left|1\right\rangle\right) \right] \\ &+b_1\left|1\right\rangle\left[ a_2\left|0\right\rangle\left(\frac{a_3-b_3}{\sqrt{2}}\mathrm{e}^{-i\pi/4}\left|0\right\rangle+\frac{a_3+b_3}{\sqrt{2}}\left|1\right\rangle\right)+b_2\left|1\right\rangle\left(\frac{a_3-b_3}{\sqrt{2}}\mathrm{e}^{i\pi/4}\left|0\right\rangle+\frac{a_3+b_3}{\sqrt{2}}\mathrm{e}^{-i\pi/2}\left|1\right\rangle\right) \right] \\ \left|\psi_8\right\rangle&=a_1\left|0\right\rangle\left[ a_2\left|0\right\rangle\left(\frac{a_3+b_3}{\sqrt{2}}\left|0\right\rangle+\frac{a_3-b_3}{\sqrt{2}}\mathrm{e}^{-i\pi/4}\left|1\right\rangle\right)+b_2\left|1\right\rangle\left(\frac{a_3+b_3}{\sqrt{2}}\left|0\right\rangle+\frac{a_3-b_3}{\sqrt{2}}\mathrm{e}^{-i\pi/4}\left|1\right\rangle\right) \right] \\ &+b_1\left|1\right\rangle\left[ a_2\left|0\right\rangle\left(\frac{a_3+b_3}{\sqrt{2}}\left|0\right\rangle+\frac{a_3-b_3}{\sqrt{2}}\mathrm{e}^{-i\pi/4}\left|1\right\rangle\right)+b_2\left|1\right\rangle\left(\frac{a_3+b_3}{\sqrt{2}}\mathrm{e}^{-i\pi/2}\left|0\right\rangle+\frac{a_3-b_3}{\sqrt{2}}\mathrm{e}^{i\pi/4}\left|1\right\rangle\right) \right] \\ \left|\psi_9\right\rangle&=a_1\left|0\right\rangle\left[ a_2\left|0\right\rangle\left(\frac{a_3+b_3}{\sqrt{2}}\left|0\right\rangle+\frac{a_3-b_3}{\sqrt{2}}\left|1\right\rangle\right)+b_2\mathrm{e}^{-i\pi/4}\left|1\right\rangle\left(\frac{a_3+b_3}{\sqrt{2}}\left|0\right\rangle+\frac{a_3-b_3}{\sqrt{2}}\left|1\right\rangle\right) \right] \\ &+b_1\left|1\right\rangle\left[ a_2\left|0\right\rangle\left(\frac{a_3+b_3}{\sqrt{2}}\left|0\right\rangle+\frac{a_3-b_3}{\sqrt{2}}\left|1\right\rangle\right)+b_2\mathrm{e}^{-i\pi/4}\left|1\right\rangle\left(\frac{a_3+b_3}{\sqrt{2}}\mathrm{e}^{-i\pi/2}\left|0\right\rangle+\frac{a_3-b_3}{\sqrt{2}}\mathrm{e}^{i\pi/2}\left|1\right\rangle\right) \right] \\ \left|\psi_{10}\right\rangle&=a_1\left|0\right\rangle\left[ a_2\left|0\right\rangle\left(a_3\left|0\right\rangle+b_3\left|1\right\rangle\right)+b_2\mathrm{e}^{-i\pi/4}\left|1\right\rangle\left(a_3\left|0\right\rangle+b_3\left|1\right\rangle\right) \right] \\ &+b_1\left|1\right\rangle\left[ b_2\mathrm{e}^{-3i\pi/4}\left|0\right\rangle\left(b_3\left|0\right\rangle+a_3\left|1\right\rangle\right)+a_2\left|1\right\rangle\left(a_3\left|0\right\rangle+b_3\left|1\right\rangle\right) \right] \end{align} $$
$$ \begin{align} \left|\psi_{11}\right\rangle&=a_1\left|0\right\rangle\left[ a_2\left|0\right\rangle\left(a_3\left|0\right\rangle+b_3\left|1\right\rangle\right)+b_2\mathrm{e}^{-i\pi/2}\left|1\right\rangle\left(a_3\left|0\right\rangle+b_3\left|1\right\rangle\right) \right] \\ &+b_1\mathrm{e}^{-3i\pi/4}\left|1\right\rangle\left[ b_2\left|0\right\rangle\left(b_3\left|0\right\rangle+a_3\left|1\right\rangle\right)+a_2\mathrm{e}^{i\pi/2}\left|1\right\rangle\left(a_3\left|0\right\rangle+b_3\left|1\right\rangle\right) \right] \\ \left|\psi_{12}\right\rangle&=a_1\left|0\right\rangle\left[ a_2\left|0\right\rangle\left(a_3\left|0\right\rangle+b_3\left|1\right\rangle\right)+b_2\mathrm{e}^{-i\pi/2}\left|1\right\rangle\left(a_3\left|0\right\rangle+b_3\left|1\right\rangle\right) \right] \\ &+b_1\mathrm{e}^{-3i\pi/4}\left|1\right\rangle\left[ a_2\mathrm{e}^{i\pi/2}\left|0\right\rangle\left(a_3\left|0\right\rangle+b_3\left|1\right\rangle\right)+b_2\left|1\right\rangle\left(b_3\left|0\right\rangle+a_3\left|1\right\rangle\right) \right] \\ \left|\psi_{13}\right\rangle&=a_1\left|0\right\rangle\left[ a_2\left|0\right\rangle\left(a_3\left|0\right\rangle+b_3\left|1\right\rangle\right)+b_2\left|1\right\rangle\left(a_3\left|0\right\rangle+b_3\left|1\right\rangle\right) \right] \\ &+b_1\left|1\right\rangle\left[ a_2\left|0\right\rangle\left(a_3\left|0\right\rangle+b_3\left|1\right\rangle\right)+b_2\left|1\right\rangle\left(b_3\left|0\right\rangle+a_3\left|1\right\rangle\right) \right] \end{align} $$

4.25

(1) Fredkin gate is constructed by adding a control bit to SWAP gate.

circuit_4_25_1

(2) The first control qubit (bottom line) is not necessary. So,

circuit_4_25_2

(3)

circuit_4_25_3

(4) The last $\mathrm{controlled-}V$ gate commutes with the previous three gates.

circuit_4_25_4

The last two gates commute. Then we can combine $\mathrm{controlled-}V^{\dagger}$ and $\mathrm{CNOT}$ gate (the first two gates also) since they are acting on the same two qubits. Finally we get the implementation of Fredkin gate with 5 two-qubit gates.

circuit_4_25_5

Reference: Five Two-Bit Quantum Gates are Sufficient to Implement the Quantum Fredkin Gate


4.26

circuit_4_26


$$ \begin{align} \left|\psi_0\right\rangle &= \left|\phi_1\right\rangle\otimes\left|\phi_2\right\rangle\otimes\left|\phi_3\right\rangle\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \left(\mathrm{w/}\ \ \left|\phi_i\right\rangle = a_i\left|0\right\rangle+b_i\left|1\right\rangle\right) \\ \left|\psi_1\right\rangle &= \left|\phi_1\right\rangle\otimes\left|\phi_2\right\rangle\otimes\mathrm{e}^{-\pi Y/8}\left|\phi_3\right\rangle \\ \left|\psi_2\right\rangle &= \left|\phi_1\right\rangle\otimes a_2\left|0\right\rangle\otimes\mathrm{e}^{-\pi Y/8}\left|\phi_3\right\rangle + \left|\phi_1\right\rangle\otimes b_2\left|1\right\rangle\otimes X\mathrm{e}^{-\pi Y/8}\left|\phi_3\right\rangle \\ \left|\psi_3\right\rangle &= \left|\phi_1\right\rangle\otimes a_2\left|0\right\rangle\otimes\mathrm{e}^{-\pi Y/4}\left|\phi_3\right\rangle + \left|\phi_1\right\rangle\otimes b_2\left|1\right\rangle\otimes \mathrm{e}^{-\pi Y/8}X\mathrm{e}^{-\pi Y/8}\left|\phi_3\right\rangle \\ \left|\psi_4\right\rangle &= a_1\left|0\right\rangle\otimes a_2\left|0\right\rangle\otimes\mathrm{e}^{-\pi Y/4}\left|\phi_3\right\rangle + b_1\left|1\right\rangle\otimes a_2\left|0\right\rangle\otimes X\mathrm{e}^{-\pi Y/4}\left|\phi_3\right\rangle \\ &+ a_1\left|0\right\rangle\otimes b_2\left|1\right\rangle\otimes\mathrm{e}^{-\pi Y/8}X\mathrm{e}^{-\pi Y/8}\left|\phi_3\right\rangle+b_1\left|1\right\rangle\otimes b_2\left|1\right\rangle\otimes X\mathrm{e}^{-\pi Y/8}X\mathrm{e}^{-\pi Y/8}\left|\phi_3\right\rangle \\ &= a_1\left|0\right\rangle\otimes a_2\left|0\right\rangle\otimes\mathrm{e}^{-\pi Y/4}\left|\phi_3\right\rangle + b_1\left|1\right\rangle\otimes a_2\left|0\right\rangle\otimes X\mathrm{e}^{-\pi Y/4}\left|\phi_3\right\rangle \\ &+ a_1\left|0\right\rangle\otimes b_2\left|1\right\rangle\otimes X\left|\phi_3\right\rangle + b_1\left|1\right\rangle\otimes b_2\left|1\right\rangle\otimes\left|\phi_3\right\rangle \\ \left|\psi_5\right\rangle &= a_1\left|0\right\rangle\otimes a_2\left|0\right\rangle\otimes\mathrm{e}^{-\pi Y/8}\left|\phi_3\right\rangle+b_1\left|1\right\rangle\otimes a_2\left|0\right\rangle\otimes\mathrm{e}^{\pi Y/8}X\mathrm{e}^{-\pi Y/4}\left|\phi_3\right\rangle \\ &+ a_1\left|0\right\rangle\otimes b_2\left|1\right\rangle\otimes\mathrm{e}^{\pi Y/8}X\left|\phi_3\right\rangle+b_1\left|1\right\rangle\otimes b_2\left|1\right\rangle\otimes\mathrm{e}^{\pi Y/8}\left|\phi_3\right\rangle \\ \left|\psi_6\right\rangle &= a_1\left|0\right\rangle\otimes a_2\left|0\right\rangle\otimes\mathrm{e}^{-\pi Y/8}\left|\phi_3\right\rangle+b_1\left|1\right\rangle\otimes a_2\left|0\right\rangle\otimes\mathrm{e}^{\pi Y/8}X\mathrm{e}^{-\pi Y/4}\left|\phi_3\right\rangle \\ &+ a_1\left|0\right\rangle\otimes b_2\left|1\right\rangle\otimes X\mathrm{e}^{\pi Y/8}X\left|\phi_3\right\rangle+b_1\left|1\right\rangle\otimes b_2\left|1\right\rangle\otimes X\mathrm{e}^{\pi Y/8}\left|\phi_3\right\rangle \\ \left|\psi_7\right\rangle &= a_1\left|0\right\rangle\otimes a_2\left|0\right\rangle\otimes\left|\phi_3\right\rangle+b_1\left|1\right\rangle\otimes a_2\left|0\right\rangle\otimes\mathrm{e}^{\pi Y/4}X\mathrm{e}^{-\pi Y/4}\left|\phi_3\right\rangle \\ &+ a_1\left|0\right\rangle\otimes b_2\left|1\right\rangle\otimes\mathrm{e}^{\pi Y/8}X\mathrm{e}^{\pi Y/8}X\left|\phi_3\right\rangle+b_1\left|1\right\rangle\otimes b_2\left|1\right\rangle\otimes\mathrm{e}^{\pi Y/8}X\mathrm{e}^{\pi Y/8}\left|\phi_3\right\rangle \\ &= a_1\left|0\right\rangle\otimes a_2\left|0\right\rangle\otimes\left|\phi_3\right\rangle+b_1\left|1\right\rangle\otimes a_2\left|0\right\rangle\otimes X\mathrm{e}^{\pi Y/2}\left|\phi_3\right\rangle \\ &+ a_1\left|0\right\rangle\otimes b_2\left|1\right\rangle\otimes\left|\phi_3\right\rangle+b_1\left|1\right\rangle\otimes b_2\left|1\right\rangle\otimes X\left|\phi_3\right\rangle \\ &= a_1\left|0\right\rangle\otimes a_2\left|0\right\rangle\otimes\left|\phi_3\right\rangle+b_1\left|1\right\rangle\otimes a_2\left|0\right\rangle\otimes Z\left|\phi_3\right\rangle \\ &+ a_1\left|0\right\rangle\otimes b_2\left|1\right\rangle\otimes\left|\phi_3\right\rangle+b_1\left|1\right\rangle\otimes b_2\left|1\right\rangle\otimes X\left|\phi_3\right\rangle \end{align} $$

4.31

$$ \begin{align} CX_1C &= \left(\left|0\right\rangle\left\langle0\right| I_2+\left|1\right\rangle\left\langle1\right| X_2\right)X_1\left(\left|0\right\rangle\left\langle0\right| I_2+\left|1\right\rangle\left\langle1\right| X_2\right) \\ &= \left(\left|0\right\rangle\left\langle0\right| I_2+\left|1\right\rangle\left\langle1\right| X_2\right)\;\left(\left|1\right\rangle\left\langle0\right|I_2+\left|0\right\rangle\left\langle1\right|X_2\right) \\ &= \left(\left|0\right\rangle\left\langle1\right|+\left|1\right\rangle\left\langle0\right|\right)X_2=X_1X_2 \\ CY_1C &= \left(\left|0\right\rangle\left\langle0\right| I_2+\left|1\right\rangle\left\langle1\right| X_2\right)Y_1\left(\left|0\right\rangle\left\langle0\right| I_2+\left|1\right\rangle\left\langle1\right| X_2\right) \\ &= \left(\left|0\right\rangle\left\langle0\right| I_2+\left|1\right\rangle\left\langle1\right| X_2\right)\;i\left(\left|1\right\rangle\left\langle0\right|I_2-\left|0\right\rangle\left\langle1\right|X_2\right) \\ &= i\left(-\left|0\right\rangle\left\langle1\right|+\left|1\right\rangle\left\langle0\right|\right)X_2=Y_1X_2 \\ CZ_1C &= \left(\left|0\right\rangle\left\langle0\right| I_2+\left|1\right\rangle\left\langle1\right| X_2\right)Z_1\left(\left|0\right\rangle\left\langle0\right| I_2+\left|1\right\rangle\left\langle1\right| X_2\right) \\ &= \left(\left|0\right\rangle\left\langle0\right| I_2+\left|1\right\rangle\left\langle1\right|X_2\right)\;\left(\left|0\right\rangle\left\langle0\right|I_2-\left|1\right\rangle\left\langle1\right|X_2\right) \\ &= \left(\left|0\right\rangle\left\langle0\right|-\left|1\right\rangle\left\langle1\right|\right)I_2 = Z_1 \\ CX_2C &= \left(\left|0\right\rangle\left\langle0\right| I_2+\left|1\right\rangle\left\langle1\right| X_2\right)X_2\left(\left|0\right\rangle\left\langle0\right| I_2+\left|1\right\rangle\left\langle1\right| X_2\right) \\ &= \left(\left|0\right\rangle\left\langle0\right| I_2+\left|1\right\rangle\left\langle1\right| X_2\right)\;\left(\left|0\right\rangle\left\langle0\right|X_2+\left|1\right\rangle\left\langle1\right|I_2\right) \\ &= \left(I_1X_2\right) = X_2 \\ CY_2C &= \left(\left|0\right\rangle\left\langle0\right| I_2+\left|1\right\rangle\left\langle1\right| X_2\right)Y_2\left(\left|0\right\rangle\left\langle0\right| I_2+\left|1\right\rangle\left\langle1\right| X_2\right) \\ &= \left(\left|0\right\rangle\left\langle0\right| I_2+\left|1\right\rangle\left\langle1\right| X_2\right)\;\left(\left|0\right\rangle\left\langle0\right|Y_2-i\left|1\right\rangle\left\langle1\right|Z_2\right) \\ &= \left(\left|0\right\rangle\left\langle0\right|-\left|1\right\rangle\left\langle1\right|\right)Y_2=Z_1Y_2 \\ CZ_2C &= \left(\left|0\right\rangle\left\langle0\right| I_2+\left|1\right\rangle\left\langle1\right| X_2\right)Z_2\left(\left|0\right\rangle\left\langle0\right| I_2+\left|1\right\rangle\left\langle1\right| X_2\right) \\ &= \left(\left|0\right\rangle\left\langle0\right| I_2+\left|1\right\rangle\left\langle1\right| X_2\right)\;\left(\left|0\right\rangle\left\langle0\right|Z_2+i\left|1\right\rangle\left\langle1\right|Y_2\right) \\ &= \left(\left|0\right\rangle\left\langle0\right|-\left|1\right\rangle\left\langle1\right|\right)Z_2=Z_1Z_2 \\ R_{z,1}(\theta)C &= \mathrm{e}^{-i\theta Z_1/2}I_2 \left(\left|0\right\rangle\left\langle0\right| I_2+\left|1\right\rangle\left\langle1\right| X_2\right) \\ &= \left(\left|0\right\rangle\left\langle0\right| I_2+\left|1\right\rangle\left\langle1\right| X_2\right)\mathrm{e}^{-i\theta Z_1/2}I_2=CR_{z,1}(\theta) \\ &\left(\because\left[Z,\left|0\right\rangle\left\langle0\right|\right]=\left[Z,\left|1\right\rangle\left\langle1\right|\right]=0\right) \\ R_{x,2}(\theta)C &= I_1\mathrm{e}^{-i\theta X_2/2}\left(\left|0\right\rangle\left\langle0\right| I_2+\left|1\right\rangle\left\langle1\right| X_2\right) \\ &= \left(\left|0\right\rangle\left\langle0\right| I_2+\left|1\right\rangle\left\langle1\right| X_2\right)I_1\mathrm{e}^{-i\theta X_2/2}=CR_{x,2} \end{align} $$

4.32

$$ \begin{align} \rho' &= \sum_{i=0,1}p_i\rho_i \\ &= \sum_{i=0,1}\mathrm{tr}\left(P_i\rho P_i\right)\frac{P_i\rho P_i}{\mathrm{tr}\left(P_i\rho P_i\right)} \\ &= P_0\rho P_0 + P_1\rho P_1 \end{align} $$
$$ \begin{align} \mathrm{tr}_2(\rho')&=\mathrm{tr}_2\left(P_0\rho P_0\right)+\mathrm{tr}_2\left(P_1\rho P_1\right) \\ &= \mathrm{tr}_2\left(a_{00,00}\left|00\right\rangle\left\langle00\right|+a_{00,10}\left|00\right\rangle\left\langle10\right|+a_{10,00}\left|10\right\rangle\left\langle00\right|+a_{10,10}\left|10\right\rangle\left\langle10\right|\right) \\ &+ \mathrm{tr}_2\left(a_{01,01}\left|01\right\rangle\left\langle01\right|+a_{01,11}\left|01\right\rangle\left\langle11\right|+a_{11,01}\left|11\right\rangle\left\langle01\right|+a_{11,11}\left|11\right\rangle\left\langle11\right|\right) \\ &= \left(a_{00,00}+a_{01,01}\right)\left|0\right\rangle\left\langle0\right|+\left(a_{00,10}+a_{01,11}\right)\left|0\right\rangle\left\langle1\right|+\left(a_{10,00}+a_{11,01}\right)\left|1\right\rangle\left\langle0\right|+\left(a_{10,10}+a_{11,11}\right)\left|1\right\rangle\left\langle1\right| \\ &= \mathrm{tr}_2(\rho) \end{align} $$

4.33

Define $\left|\phi_1\right\rangle=a_1\left|0\right\rangle+b_1\left|1\right\rangle$, $\left|\phi_2\right\rangle=a_2\left|0\right\rangle+b_2\left|1\right\rangle$.

circuit_4_33


$$ \begin{align} \left|\psi_0\right\rangle &= \left(a_1\left|0\right\rangle+b_1\left|1\right\rangle\right)\otimes\left(a_2\left|0\right\rangle+b_2\left|1\right\rangle\right) \\ \left|\psi_1\right\rangle &= a_1a_2\left|00\right\rangle+a_1b_2\left|01\right\rangle+b_1b_2\left|10\right\rangle+a_2b_1\left|11\right\rangle \\ \left|\psi_2\right\rangle &= \left(a_1a_2+b_1b_2\right)\left|00\right\rangle+\left(a_1b_2+a_2b_1\right)\left|01\right\rangle+\left(a_1a_2-b_1b_2\right)\left|10\right\rangle+\left(a_1b_2-a_2b_1\right)\left|11\right\rangle \end{align} $$

This means,

$$ \begin{align} \left|00\right\rangle &\longrightarrow \left|\Phi^+\right\rangle=\frac{\left|00\right\rangle+\left|11\right\rangle}{\sqrt{2}} \\ \left|01\right\rangle &\longrightarrow \left|\Psi^+\right\rangle=\frac{\left|01\right\rangle+\left|10\right\rangle}{\sqrt{2}} \\ \left|10\right\rangle &\longrightarrow \left|\Phi^-\right\rangle=\frac{\left|00\right\rangle-\left|11\right\rangle}{\sqrt{2}} \\ \left|11\right\rangle &\longrightarrow \left|\Psi^-\right\rangle=\frac{\left|01\right\rangle-\left|10\right\rangle}{\sqrt{2}} \end{align} $$

4.34

circuit_4_34


$$ \begin{align} \left|\psi_0\right\rangle&=\left|0\right\rangle\left|\psi_{\mathrm{in}}\right\rangle \\ \left|\psi_1\right\rangle&=\frac{\left|0\right\rangle+\left|1\right\rangle}{\sqrt{2}}\left|\psi_{\mathrm{in}}\right\rangle \\ \left|\psi_2\right\rangle&=\frac{1}{\sqrt{2}}\left(\left|0\right\rangle\left|\psi_{\mathrm{in}}\right\rangle+\left|1\right\rangle U\left|\psi_{\mathrm{in}}\right\rangle\right) \\ \left|\psi_3\right\rangle&=\frac{1}{2}\left[\left|0\right\rangle\left(I+U\right)\left|\psi_{\mathrm{in}}\right\rangle+\left|1\right\rangle\left(1-U\right)\left|\psi_{\mathrm{in}}\right\rangle\right] \end{align} $$

By measuring the first qubit, the second qubit is projected to either $(I+U)\left|\psi_{\mathrm{in}}\right\rangle$ or $(I-U)\left|\psi_{\mathrm{in}}\right\rangle$ which are the eigenvectors of $U$ with the eigenvalues $1$ and $-1$, respectively. So, this circuit implements a measurement of $U$.


4.35

leftmost circuit:
circuit_4_35


$$ \begin{align} \left|\psi_0\right\rangle&=\left(a_1\left|0\right\rangle+b_1\left|1\right\rangle\right)\otimes\left(a_2\left|0\right\rangle+b_2\left|1\right\rangle\right) \\ \left|\psi_1\right\rangle&=a_1a_2\left|00\right\rangle+a_1b_2\left|01\right\rangle+a_2b_1\left|1\right\rangle U\left|0\right\rangle+b_1b_2\left|1\right\rangle U\left|1\right\rangle \\ &=\left|0\right\rangle\left(a_1a_2\left|0\right\rangle+a_1b_2\left|1\right\rangle\right)+\left|1\right\rangle\left(a_2b_1U\left|0\right\rangle+b_1b_2U\left|1\right\rangle\right) \\ \end{align} $$

Then, after the measurement, the second qubit becomes either $\alpha_1\left|0\right\rangle+\beta_1\left|1\right\rangle$ for classical $0$, or $\alpha_2U\left|0\right\rangle+\beta_2U\left|1\right\rangle$ for classical $1$. Here, $\left|\alpha_i^2\right|+\left|\beta_i^2\right|=1$.

middle circuit: At the end of the circuit, the second qubit is either $a_2\left|0\right\rangle+b_2\left|1\right\rangle$ or $a_2U\left|0\right\rangle+b_2U\left|1\right\rangle$.

Therefore, the leftmost circuit is equivalent to the middle circuit.


4.36

circuit_4_36


4.37

$$ \begin{align} V_1U &= \begin{pmatrix} \frac{1}{\sqrt{2}} & \frac{1}{\sqrt{2}} & 0 & 0 \\ \frac{1}{\sqrt{2}} & \frac{-1}{\sqrt{2}} & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 1 \end{pmatrix} \frac{1}{2} \begin{pmatrix} 1 & 1 & 1 & 1 \\ 1 & i & -1 & -i \\ 1 & -1 & 1 & -1 \\ 1 & -i & -1 & i \end{pmatrix} \\ &= \frac{1}{2} \begin{pmatrix} \sqrt{2} & \frac{1+i}{\sqrt{2}} & 0 & \frac{1-i}{\sqrt{2}} \\ 0 & \frac{1-i}{\sqrt{2}} & \sqrt{2} & \frac{1+i}{\sqrt{2}} \\ 1 & -1 & 1 & -1 \\ 1 & -i & -1 & i \end{pmatrix} \\ V_2V_1U &= \begin{pmatrix} \sqrt{\frac{2}{3}} & 0 & \frac{1}{\sqrt{3}} & 0 \\ 0 & 1 & 0 & 0 \\ \frac{1}{\sqrt{3}} & 0 & -\sqrt{\frac{2}{3}} & 0 \\ 0 & 0 & 0 & 1 \end{pmatrix} \frac{1}{2} \begin{pmatrix} \sqrt{2} & \frac{1+i}{\sqrt{2}} & 0 & \frac{1-i}{\sqrt{2}} \\ 0 & \frac{1-i}{\sqrt{2}} & \sqrt{2} & \frac{1+i}{\sqrt{2}} \\ 1 & -1 & 1 & -1 \\ 1 & -i & -1 & i \end{pmatrix} \\ &= \frac{1}{2} \begin{pmatrix} \sqrt{3} & \frac{i}{\sqrt{3}} & \frac{1}{\sqrt{3}} & \frac{-i}{\sqrt{3}} \\ 0 & \frac{1-i}{\sqrt{2}} & \sqrt{2} & \frac{1+i}{\sqrt{2}} \\ 0 & \frac{3+i}{\sqrt{6}} & -\sqrt{\frac{2}{3}} & \frac{3-i}{\sqrt{6}} \\ 1 & -i & -1 & i \end{pmatrix} \\ V_3V_2V_1U &= \begin{pmatrix} \frac{\sqrt{3}}{2} & 0 & 0 & \frac{1}{2} \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ \frac{1}{2} & 0 & 0 & -\frac{\sqrt{3}}{2} \end{pmatrix} \frac{1}{2} \begin{pmatrix} \sqrt{3} & \frac{i}{\sqrt{3}} & \frac{1}{\sqrt{3}} & \frac{-i}{\sqrt{3}} \\ 0 & \frac{1-i}{\sqrt{2}} & \sqrt{2} & \frac{1+i}{\sqrt{2}} \\ 0 & \frac{3+i}{\sqrt{6}} & -\sqrt{\frac{2}{3}} & \frac{3-i}{\sqrt{6}} \\ 1 & -i & -1 & i \end{pmatrix} \\ &= \frac{1}{2} \begin{pmatrix} 2 & 0 & 0 & 0 \\ 0 & \frac{1-i}{\sqrt{2}} & \sqrt{2} & \frac{1+i}{\sqrt{2}} \\ 0 & \frac{3+i}{\sqrt{6}} & -\sqrt{\frac{2}{3}} & \frac{3-i}{\sqrt{6}} \\ 0 & \frac{2\sqrt{3}}{3}i & \frac{2\sqrt{3}}{3} & -\frac{2\sqrt{3}}{3}i \end{pmatrix} \\ V_4V_3V_2V_1U &= \begin{pmatrix} 1 & 0 & 0 & 0 \\ 0 & \frac{\sqrt{3}\left(1+i\right)}{4} & \frac{3-i}{4} & 0 \\ 0 & \frac{3+i}{4} & \frac{-\sqrt{3}\left(1-i\right)}{4} & 0 \\ 0 & 0 & 0 & 1 \end{pmatrix} \frac{1}{2} \begin{pmatrix} 2 & 0 & 0 & 0 \\ 0 & \frac{1-i}{\sqrt{2}} & \sqrt{2} & \frac{1+i}{\sqrt{2}} \\ 0 & \frac{3+i}{\sqrt{6}} & -\sqrt{\frac{2}{3}} & \frac{3-i}{\sqrt{6}} \\ 0 & \frac{2\sqrt{3}}{3}i & \frac{2\sqrt{3}}{3} & -\frac{2\sqrt{3}}{3}i \end{pmatrix} \\ &= \frac{1}{2} \begin{pmatrix} 2 & 0 & 0 & 0 \\ 0 & \frac{4}{\sqrt{6}} & \sqrt{\frac{2}{3}}i & \frac{2}{\sqrt{6}} \\ 0 & 0 & \sqrt{2} & \sqrt{2}i \\ 0 & \frac{2\sqrt{3}}{3}i & \frac{2\sqrt{3}}{3} & -\frac{2\sqrt{3}}{3}i \end{pmatrix} \\ V_5V_4V_3V_2V_1U &= \begin{pmatrix} 1 & 0 & 0 & 0 \\ 0 & \frac{2}{\sqrt{6}} & 0 & -\frac{i}{\sqrt{3}} \\ 0 & 0 & 1 & 0 \\ 0 & \frac{i}{\sqrt{3}} & 0 & -\frac{2}{\sqrt{6}} \end{pmatrix} \frac{1}{2} \begin{pmatrix} 2 & 0 & 0 & 0 \\ 0 & \frac{4}{\sqrt{6}} & \sqrt{\frac{2}{3}}i & \frac{2}{\sqrt{6}} \\ 0 & 0 & \sqrt{2} & \sqrt{2}i \\ 0 & \frac{2\sqrt{3}}{3}i & \frac{2\sqrt{3}}{3} & -\frac{2\sqrt{3}}{3}i \end{pmatrix} \\ &= \begin{pmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & \frac{1}{\sqrt{2}} & \frac{i}{\sqrt{2}} \\ 0 & 0 & -\frac{1}{\sqrt{2}} & \frac{i}{\sqrt{2}} \end{pmatrix} \\ V_6V_5V_4V_3V_2V_1U &= \begin{pmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & \frac{1}{\sqrt{2}} & -\frac{1}{\sqrt{2}} \\ 0 & 0 & -\frac{1}{\sqrt{2}} & -\frac{1}{\sqrt{2}} \end{pmatrix} \begin{pmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & \frac{1}{\sqrt{2}} & \frac{i}{\sqrt{2}} \\ 0 & 0 & -\frac{1}{\sqrt{2}} & \frac{i}{\sqrt{2}} \end{pmatrix} \\ &= \begin{pmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & -i \end{pmatrix} \\ V_7V_6V_5V_4V_3V_2V_1U &= \begin{pmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & i \end{pmatrix} \begin{pmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & -i \end{pmatrix} = I \end{align} $$

4.39

The unitary matrix U acts non-trivially only on the state $\left|010\right\rangle$ and $\left|111\right\rangle$. Then we have the Gray code

$$ \begin{align} g_1:\ &\mathrm{0\ 1\ 0} \\ g_2:\ &\mathrm{0\ 1\ 1} \\ g_3:\ &\mathrm{1\ 1\ 1} \\ \end{align} $$

So, the quantum circuit that implements the transformation is

circuit_4_39


4.40

$$ \begin{align} E\left(R_{\hat{n}}\left(\alpha\right),R_{\hat{n}}\left(\alpha+\beta\right)\right) &= \left| \left[R_{\hat{n}}\left(\alpha\right)-R_{\hat{n}}\left(\alpha+\beta\right)\right]\left|\psi\right\rangle \right| \\ &= \left|\left(\mathrm{e}^{-i\frac{\alpha}{2}\hat{n}\cdot\hat{\sigma}}-\mathrm{e}^{-i\frac{\alpha+\beta}{2}\hat{n}\cdot\hat{\sigma}}\right)\left|\psi\right\rangle\right| \\ &= \left|\mathrm{e}^{-i\frac{\alpha}{2}\hat{n}\cdot\hat{\sigma}}\left(1-\mathrm{e}^{-i\frac{\beta}{2}\hat{n}\cdot\hat{\sigma}}\right)\left|\psi\right\rangle\right| \\ &= \sqrt{\left\langle\psi\right|\left(1-\mathrm{e}^{i\frac{\beta}{2}\hat{n}\cdot\hat{\sigma}}\right)R_{\hat{n}}^{\dagger}\left(\alpha\right)R_{\hat{n}}\left(\alpha\right)\left(1-\mathrm{e}^{-i\frac{\beta}{2}\hat{n}\cdot\hat{\sigma}}\right)\left|\psi\right\rangle} \\ &= \sqrt{\left\langle\psi\right|\left(1-\mathrm{e}^{-i\frac{\beta}{2}\hat{n}\cdot\hat{\sigma}}-\mathrm{e}^{i\frac{\beta}{2}\hat{n}\cdot\hat{\sigma}}+1\right)\left|\psi\right\rangle} \\ &= \sqrt{2-\left\langle\psi\right|\left(\mathrm{e}^{-i\frac{\beta}{2}\hat{n}\cdot\hat{\sigma}}+\mathrm{e}^{i\frac{\beta}{2}\hat{n}\cdot\hat{\sigma}}\right)\left|\psi\right\rangle} \\ &= \sqrt{2-\cos\left(\frac{-\beta}{2}\right)-\cos\left(\frac{\beta}{2}\right)}\ \ \ \ \ \left(\because \mathrm{e}^{x}=\sum_j\frac{x^j}{j!},\ \ \left(\hat{n}\cdot\hat{\sigma}\right)^2=1\right) \\ &= \sqrt{2-2\cos\left(\frac{\beta}{2}\right)} \\ &= \left|1-\mathrm{exp}\left(i\beta/2\right)\right| \end{align} $$

4.41

circuit_4_41


$$ \begin{align} \left|\psi_0\right\rangle &= \left|0\right\rangle\left|0\right\rangle\left|\psi\right\rangle \\ \left|\psi_1\right\rangle &= \frac{1}{2}\left(\left|0\right\rangle+\left|1\right\rangle\right)\otimes\left(\left|0\right\rangle+\left|1\right\rangle\right)\otimes\left|\psi\right\rangle \\ \left|\psi_2\right\rangle &= \frac{1}{2}\left[\left|0\right\rangle\otimes\left(\left|0\right\rangle+\left|1\right\rangle\right)\left|\psi\right\rangle+\left|1\right\rangle\left|0\right\rangle\left|\psi\right\rangle+\left|1\right\rangle\left|1\right\rangle X\left|\psi\right\rangle\right] \\ \left|\psi_3\right\rangle &= \frac{1}{2}\left[\left|0\right\rangle\otimes\left(\left|0\right\rangle+\left|1\right\rangle\right) S\left|\psi\right\rangle+\left|1\right\rangle\left|0\right\rangle S\left|\psi\right\rangle+\left|1\right\rangle\left|1\right\rangle SX\left|\psi\right\rangle\right] \\ \left|\psi_4\right\rangle &= \frac{1}{2}\left[\left|0\right\rangle\otimes\left(\left|0\right\rangle+\left|1\right\rangle\right) S\left|\psi\right\rangle+\left|1\right\rangle\left|0\right\rangle S\left|\psi\right\rangle+\left|1\right\rangle\left|1\right\rangle XSX\left|\psi\right\rangle\right] \\ \left|\psi_5\right\rangle &= \frac{1}{4}\left[\left|00\right\rangle\left(3S+XSX\right)\left|\psi\right\rangle+\left|01\right\rangle\left(S-XSX\right)\left|\psi\right\rangle\right. \\ &+ \left.\left|10\right\rangle\left(S-XSX\right)\left|\psi\right\rangle+\left|11\right\rangle\left(-S+XSX\right)\left|\psi\right\rangle\right] \end{align} $$

So, if the measurement outcomes are both 0, the third qubit is

$$ \begin{align} \left(3S+XSX\right)\left|\psi\right\rangle &= \sqrt{10} \begin{pmatrix} \frac{3+i}{\sqrt{10}} & 0 \\ 0 & \frac{1+3i}{\sqrt{10}} \end{pmatrix} \\ &= \sqrt{10}\mathrm{e}^{i\alpha} \begin{pmatrix} \mathrm{e}^{-i\beta} & 0 \\ 0 & \mathrm{e}^{i\beta} \end{pmatrix} \end{align} $$

Solving the simultaneous equation, we get $\alpha=\pi/4,\ \cos\theta=\cos(2\beta)=3/5$. The probability of both measurement outcomes being 0 is

$$ \begin{align} p\left(00\right) &= \left|\frac{\sqrt{10}\mathrm{e}^{i\frac{\pi}{4}}}{4}\right|^2\left\langle\psi\right|\left(3S+XSX\right)^{\dagger}\left(3S+XSX\right)\left|\psi\right\rangle \\ &= \frac{5}{8} \end{align} $$

4.42

(1) If $\theta$ is natural, then there exist the integer $m$ such that

$$ \begin{align} \mathrm{e}^{mi\theta} = \mathrm{e}^{i2\pi j} = 1 \end{align} $$

where j is an integer. Using that $m$,

$$ \begin{align} \mathrm{e}^{mi\theta} = \frac{\left(3+4i\right)^m}{5^m} \\ 5^m = \left(3+4i\right)^m. \end{align} $$

(2) Obviously, $3+4i=3+4i\ \left(mod\ 5\right)$. For $m=2$, we get $3+4i\ \left(mod\ 5\right)$. So, for all $m> 0$, $\left(3+4i\right)^m = 3+4i\ \left(mod\ 5\right)$. Since $5^m = 0\ \left(mod\ 5\right)$, there is no $m$ such that $\left(3+4i\right)^m=5^m$.


4.43

We proved in previous question that $\theta$ which satisfies $\mathrm{e}^{i\theta}=3/5$ is irrational. So, using the circuit in Exercise 4.41, we can constract arbitrary rotation because $HR_z\left(\theta\right)=R_x\left(\theta\right)$. Therefore, the Hadamard, phase, controlled-$\mathrm{NOT}$ and Toffoli gates are universal.


4.46

The density matrix of a n-qubit state has $2^n\times 2^n=4^n$ entries. Since the trace of a density matrix is 0, $4^n-1$ independent real numbers are required to describe the density matrix.


4.47

Using the Baker-Campbell-Hausdorf formula,

$$ \begin{align} \mathrm{e}^{-iHt} &= \mathrm{e}^{-it\sum_k^L H_k} \\ &= \mathrm{e}^{-it\left(H_1+H_2+\cdots +H_L\right)} \\ &= \mathrm{e}^{-iH_1t}\mathrm{e}^{-it\left(H_2+H_3+\cdots H_L\right)}\ \ \ \ \ \left(\because\left[H_j,\ H_k\right]\ \mathrm{for\ all\ }j,k\right) \\ &\vdots \\ &= \mathrm{e}^{-iH_1t}\mathrm{e}^{-iH_2t}\cdots\mathrm{e}^{-iH_Lt} \end{align} $$

4.48

The largest number of terms possible is,

$$ \begin{align} \sum_{j=1}^c {}_nC_j = O(n^c). \end{align} $$

So, $L$ is upper bounded by a polynomial in $n$.


4.49

Recall that

$$ \begin{align} \ln\left(x\right) &= \ln\left(1\right)+\frac{x-1}{1!}-\frac{\left(x-1\right)^2}{2!}+\frac{2\left(x-1\right)^3}{3!}-\cdots \\ &= \sum_{k=1}^{\infty} \frac{\left(-1\right)^{k+1}\left(x-1\right)^k}{k} \end{align} $$

and replacing x with $\mathrm{e}^{A\Delta t}\mathrm{e}^{B\Delta t}$,

$$ \begin{align} \ln\left(\mathrm{e}^{A\Delta t}\mathrm{e}^{B\Delta t}\right) &= \sum_{k=1}^{\infty}\frac{\left(-1\right)^{k+1}}{k} \left(\mathrm{e}^{A\Delta t}\mathrm{e}^{B\Delta t}-1\right)^k \\ &= \sum_{k=1}^{\infty}\frac{\left(-1\right)^{k+1}}{k} \left[\sum_{l,m=0}^{\infty}\frac{\left(A\Delta t\right)^l\left(B\Delta t\right)^m}{l!m!}-1\right]^k \\ &= \sum_{k=1}^{\infty}\frac{\left(-1\right)^{k+1}}{k} \left[\sum_{\substack{l,m\ge0,\\l+m>0}}\frac{\left(A\Delta t\right)^l\left(B\Delta t\right)^m}{l!m!}\right]^k \\ &= \sum_{k=1}^{\infty}\sum_{\substack{l_1,m_1\ge0,\\l_1+m_1>0}}\cdots\sum_{\substack{l_k,m_k\ge0,\\l_k+m_k>0}}\frac{\left(-1\right)^{k+1}}{k}\frac{\left(A\Delta t\right)^{l_1}\left(B\Delta t\right)^{m_1}\cdots\left(A\Delta t\right)^{l_k}\left(B\Delta t\right)^{m_k}}{l_1!m_1!\cdots l_k!m_k!} \\ &= \left[A\Delta t+B\Delta t+\frac{\left(A\Delta t\right)^2}{2}+\frac{\left(B\Delta t\right)^2}{2}+AB\Delta t^2+O\left(\Delta t^3\right)\right]\ \ \ \ \ \left(k:\ 1\right) \\ &-\frac{1}{2}\left[\left(A\Delta t\right)^2+\left(B\Delta t\right)^2+AB\Delta t^2+BA\Delta t^2+O\left(\Delta t^3\right)\right]\ \ \ \ \ \left(k:\ 2\right) \\ &+O\left(\Delta t^3\right) \\ &= A\Delta t+B\Delta t+\frac{1}{2}\left[A,B\right]\Delta t^2+O\left(\Delta t^3\right). \end{align} $$

Therefore, $\mathrm{e}^{\left(A+B\right)\Delta t}=\mathrm{e}^{A\Delta t}\mathrm{e}^{B\Delta t}\mathrm{e}^{-1/2[A,B]\Delta t^2}+O\left(\Delta t^3\right)$.

And thus

$$ \begin{align} \mathrm{e}^{i\left(A+B\right)\Delta t} &= \mathrm{e}^{iA\Delta t}\mathrm{e}^{iB\Delta t}\mathrm{e}^{\frac{1}{2}\left[A,B\right]\Delta t^2}+O\left(\Delta t^3\right) \\ &= \mathrm{e}^{iA\Delta t}\mathrm{e}^{iB\Delta t}\left[I+O\left(\Delta t^2\right)\right] + O\left(\Delta t^3\right) \\ &= \mathrm{e}^{iA\Delta t}\mathrm{e}^{iB\Delta t}+O\left(\Delta t^2\right), \\ \mathrm{e}^{iA\Delta t/2}\mathrm{e}^{iB\Delta t}\mathrm{e}^{iA\Delta t/2} &= \left[I+\frac{iA\Delta t}{2}+\frac{1}{2!}\left(\frac{iA\Delta t}{2}\right)^2+O\left(\Delta t^3\right)\right] \\ &\times \left[I+iB\Delta t+\frac{\left(iB\Delta t\right)^2}{2!}+O\left(\Delta t^3\right)\right] \\ &\times \left[I+\frac{iA\Delta t}{2}+\frac{1}{2!}\left(\frac{iA\Delta t}{2}\right)^2+O\left(\Delta t^3\right)\right] \\ &= I+i\left(A+B\right)\Delta t+i^2\left(A^2+AB+BA+B^2\right)\frac{\Delta t^2}{2}+O\left(\Delta ^3\right) \\ &= I+i\left(A+B\right)\Delta t+\frac{\left[i\left(A+B\right)\Delta t\right]^2}{2}+O\left(\Delta t^3\right) \\ &= \mathrm{e}^{i\left(A+B\right)\Delta t}+O\left(\Delta t^3\right) \end{align} $$

4.50

(a)

$$ \begin{align} U_{\Delta t} &= \left[\mathrm{e}^{-iH_1\Delta t}\mathrm{e}^{-iH_2\Delta t}\cdots\mathrm{e}^{-iH_L\Delta t}\right]\left[\mathrm{e}^{-iH_L\Delta t}\mathrm{e}^{-iH_{L-1}\Delta t}\cdots\mathrm{e}^{-iH_1\Delta t}\right] \\ &= \mathrm{e}^{-iH_1\Delta t}\cdots\mathrm{e}^{-iH_{L-1}\Delta t}\mathrm{e}^{-2iH_L\Delta t}\mathrm{e}^{-iH_{L-1}\Delta t}\cdots\mathrm{e}^{-iH_1\Delta t} \\ &= \mathrm{e}^{-iH_1\Delta t}\cdots\mathrm{e}^{-iH_{L-2}\Delta t}\left[\mathrm{e}^{-2i\left(H_{L-1}+H_{L}\right)\Delta t}+O\left(\Delta t^3\right)\right]\mathrm{e}^{-iH_{L-2}\Delta t}\cdots\mathrm{e}^{-iH_1\Delta t} \\ &= \mathrm{e}^{-iH_1\Delta t}\cdots\mathrm{e}^{-iH_{L-2}\Delta t}\mathrm{e}^{-2i\left(H_{L-1}+H_{L}\right)\Delta t}\mathrm{e}^{-iH_{L-2}\Delta t}\cdots\mathrm{e}^{-iH_1\Delta t}+O\left(\Delta t^3\right) \\ &\vdots \\ &= \mathrm{e}^{-2iH\Delta t}+O\left(\Delta t^3\right) \end{align} $$

(b)

$$ \begin{align} E\left(U_{\Delta t},\ \mathrm{e}^{-2miH\Delta t}\right) &= E\left(\sum_{k=0}^{m} {}_{m}C_k\mathrm{e}^{-2kiH\Delta t}O\left(\Delta t^{3k}\right),\mathrm{e}^{-2miH\Delta t}\right) \\ &= \left|\left[\sum_{k=0}^m {}_mC_k\mathrm{e}^{-2kiH\Delta t}O\left(\Delta t^{3k}\right)-\mathrm{e}^{-2miH\Delta t}\right]\left|\psi\right\rangle\right| \\ &\le \sum_{k=0}^{m-1}\left|{}_mC_k\mathrm{e}^{-2kiH\Delta t}O\left(\Delta t^{3k}\right)\right| \\ &\le m\alpha\Delta t^3. \end{align} $$

4.51

Since

$$ \begin{align} X &= HZH, \\ Y &= R_z\left(\frac{\pi}{2}\right)XR_z\left(-\frac{\pi}{2}\right) = R_z\left(\frac{\pi}{2}\right)HZHR_z\left(-\frac{\pi}{2}\right), \end{align} $$

the Hamiltonian can be described as

$$ \begin{align} H &= X_1\otimes Y_2\otimes Z_3 \\ &= H_1Z_1H_1\otimes R_z^2\left(\frac{\pi}{2}\right)H_2Z_2H_2R_z^2\left(-\frac{\pi}{2}\right)\otimes Z_3. \end{align} $$

circuit_4_51