Exercise 10.5
Consider the 9-qubits Shor’s code with codeword as
(1)\[\begin{split}
\begin{align}
|0_L\rangle = \frac{(|000\rangle + |111\rangle)(|000\rangle + |111\rangle)(|000\rangle + |111\rangle)}{2\sqrt{2}} \\
|1_L\rangle = \frac{(|000\rangle - |111\rangle)(|000\rangle - |111\rangle)(|000\rangle - |111\rangle)}{2\sqrt{2}} \\
\end{align}
\end{split}\]
We can encode an arbitrary state in the form \(|\psi\rangle = a|0_L\rangle + b|1_L\rangle\).
No error occur
If there is no phase flip error occur, we have an arbitrary state as \(|\psi\rangle = a|{0}_L\rangle + b|{1}_L\rangle\). Since \(X|0\rangle = |1\rangle\) and \(X|1\rangle = |0\rangle\) we have
(2)\[\begin{split}
\begin{align}
&\frac{X_1X_2X_3X_4X_5X_6(|000\rangle + |111\rangle)(|000\rangle + |111\rangle)(|000\rangle + |111\rangle)}{2\sqrt{2}}\\
=& \frac{(|111\rangle + |000\rangle)(|111\rangle + |000\rangle)(|000\rangle + |111\rangle)}{2\sqrt{2}} = |{0}_L\rangle\\
&\frac{X_1X_2X_3X_4X_5X_6(|000\rangle - |111\rangle)(|000\rangle - |1111\rangle)(|000\rangle - |111\rangle)}{2\sqrt{2}}\\
=& \frac{(|111\rangle - |000\rangle)(|111\rangle - |000\rangle)(|000\rangle - |111\rangle)}{2\sqrt{2}} = |{1}_L\rangle\\
\end{align}
\end{split}\]
Then measuring \(X_1X_2X_3X_4X_5X_6\) for \(|\psi\rangle = a|{0}_L\rangle + b|{1}_L\rangle\), the outcome is \(+1\), and the probability of getting \(_1\) is
(3)\[\begin{split}
\begin{align}
p(m_{123456}=-1) &= \langle \psi|(X_1X_2X_3X_4X_5X_6)^{\dagger}X_1X_2X_3X_4X_5X_6|\psi\rangle\\
&= (a^*\langle {0}_L|+b^*\langle {1}_L|)(a| {0}_L\rangle+b| {1}_L\rangle) = 1
\end{align}
\end{split}\]
The post-measurement state is then
(4)\[
\frac{X_1X_2X_3X_4X_5X_6|\psi\rangle}{p(m_{123456}=-1)} = a|{0}_L\rangle+b|{1}_L\rangle
\]
After measuring \(X_1X_2X_3X_4X_5X_6\) we perform the measurement \(X_4X_5X_6X_7X_8X_9\), and we have
(5)\[ \begin{align}\begin{aligned}\begin{split}
X_4X_5X_6X_7X_8X_9|{0}_L\rangle =
\frac{(|000\rangle + |111\rangle)(|111\rangle + |000\rangle)(|111\rangle + |000\rangle)}{2\sqrt{2}} = |{0}_L\rangle\\\end{split}\\X_4X_5X_6X_7X_8X_9|{1}_L\rangle = \frac{(|000\rangle - |111\rangle)(|111\rangle - |000\rangle)(|111\rangle - |000\rangle)}{2\sqrt{2}} = |{1}_L\rangle
\end{aligned}\end{align} \]
Then measuring \(X_4X_5X_6X_7X_8X_9\) for \(|\psi\rangle = a|{0}_L\rangle + b|{1}_L\rangle\), the outcome is \(+1\), and the probability of getting \(+1\) is
(6)\[\begin{split}
\begin{align}
p(m_{456789}=+1) &= \langle \psi|(X_4X_5X_6X_7X_8X_9)^{\dagger}X_4X_5X_6X_7X_8X_9|\psi\rangle\\
&= (a^*\langle {0}_L|+b^*\langle {1}_L|)(a| {0}_L\rangle+b| {1}_L\rangle) = 1
\end{align}
\end{split}\]
The post-measurement state is then
(7)\[
\frac{X_4X_5X_6X_7X_8X_9|\psi\rangle}{p(m_{456789}=+1)} = a|{0}_L\rangle+b|{1}_L\rangle
\]
Phase flip at first three qubits set
If there is a phase flip error in the first three qubit, the state \(|0_L\rangle\) and \(|1_L\rangle\) becomes
(8)\[\begin{split}
\begin{align}
|0_L\rangle \to |\tilde{0}_L\rangle = \frac{(|000\rangle - |111\rangle)(|000\rangle + |111\rangle)(|000\rangle + |111\rangle)}{2\sqrt{2}} \\
|1_L\rangle \to |\tilde{1}_L\rangle = \frac{(|000\rangle + |111\rangle)(|000\rangle - |111\rangle)(|000\rangle - |111\rangle)}{2\sqrt{2}} \\
\end{align}
\end{split}\]
and the arbitrary state becomes \(|\psi\rangle = a|\tilde{0}_L\rangle + b|\tilde{1}_L\rangle\). Since \(X|0\rangle = |1\rangle\) and \(X|1\rangle = |0\rangle\) we have
(9)\[\begin{split}
\begin{align}
&\frac{X_1X_2X_3X_4X_5X_6(|000\rangle - |111\rangle)(|000\rangle + |111\rangle)(|000\rangle + |111\rangle)}{2\sqrt{2}}\\
=& \frac{(|111\rangle - |000\rangle)(|111\rangle + |000\rangle)(|000\rangle + |111\rangle)}{2\sqrt{2}} = -|\tilde{0}_L\rangle\\
&\frac{X_1X_2X_3X_4X_5X_6(|000\rangle + |111\rangle)(|000\rangle - |1111\rangle)(|000\rangle - |111\rangle)}{2\sqrt{2}}\\
=& \frac{(|111\rangle + |000\rangle)(|111\rangle - |000\rangle)(|000\rangle - |111\rangle)}{2\sqrt{2}} = -|\tilde{1}_L\rangle\\
\end{align}
\end{split}\]
Then measuring \(X_1X_2X_3X_4X_5X_6\) for \(|\psi\rangle = a|\tilde{0}_L\rangle + b|\tilde{1}_L\rangle\), the outcome is \(-1\), and the probability of getting \(-1\) is
(10)\[\begin{split}
\begin{align}
p(m_{123456}=-1) &= \langle \psi|(X_1X_2X_3X_4X_5X_6)^{\dagger}X_1X_2X_3X_4X_5X_6|\psi\rangle\\
&= (a^*\langle \tilde{0}_L|+b^*\langle \tilde{1}_L|)(a| \tilde{0}_L\rangle+b| \tilde{1}_L\rangle) = 1
\end{align}
\end{split}\]
The post-measurement state is then
(11)\[
\frac{X_1X_2X_3X_4X_5X_6|\psi\rangle}{p(m_{123456}=-1)} = -a|\tilde{0}_L\rangle-b|\tilde{1}_L\rangle
\]
After measuring \(X_1X_2X_3X_4X_5X_6\) we perform the measurement \(X_4X_5X_6X_7X_8X_9\), and we have
(12)\[ \begin{align}\begin{aligned}\begin{split}
X_4X_5X_6X_7X_8X_9|\tilde{0}_L\rangle =
\frac{(|000\rangle - |111\rangle)(|111\rangle + |000\rangle)(|111\rangle + |000\rangle)}{2\sqrt{2}} = |\tilde{0}_L\rangle\\\end{split}\\X_4X_5X_6X_7X_8X_9|\tilde{1}_L\rangle = \frac{(|000\rangle + |111\rangle)(|111\rangle - |000\rangle)(|111\rangle - |000\rangle)}{2\sqrt{2}} = |\tilde{1}_L\rangle
\end{aligned}\end{align} \]
Then measuring \(X_4X_5X_6X_7X_8X_9\) for \(|\psi\rangle = -a|\tilde{0}_L\rangle - b|\tilde{1}_L\rangle\), the outcome is \(+1\), and the probability of getting \(+1\) is
(13)\[\begin{split}
\begin{align}
p(m_{456789}=+1) &= \langle \psi|(X_4X_5X_6X_7X_8X_9)^{\dagger}X_4X_5X_6X_7X_8X_9|\psi\rangle\\
&= (-a^*\langle \tilde{0}_L|-b^*\langle \tilde{1}_L|)(-a| \tilde{0}_L\rangle-b| \tilde{1}_L\rangle) = 1
\end{align}
\end{split}\]
The post-measurement state is then
(14)\[
\frac{X_4X_5X_6X_7X_8X_9|\psi\rangle}{p(m_{456789}=+1)} = -a|\tilde{0}_L\rangle-b|\tilde{1}_L\rangle
\]
Phase flip at second three qubits set
If there is a phase flip error in the second three qubit, the state \(|0_L\rangle\) and \(|1_L\rangle\) becomes
(15)\[\begin{split}
\begin{align}
|0_L\rangle \to |\tilde{0}_L\rangle = \frac{(|000\rangle + |111\rangle)(|000\rangle - |111\rangle)(|000\rangle + |111\rangle)}{2\sqrt{2}} \\
|1_L\rangle \to |\tilde{1}_L\rangle = \frac{(|000\rangle - |111\rangle)(|000\rangle + |111\rangle)(|000\rangle - |111\rangle)}{2\sqrt{2}} \\
\end{align}
\end{split}\]
and the arbitrary state becomes \(|\psi\rangle = a|\tilde{0}_L\rangle + b|\tilde{1}_L\rangle\). Since \(X|0\rangle = |1\rangle\) and \(X|1\rangle = |0\rangle\) we have
(16)\[\begin{split}
\begin{align}
&\frac{X_1X_2X_3X_4X_5X_6(|000\rangle + |111\rangle)(|000\rangle - |111\rangle)(|000\rangle + |111\rangle)}{2\sqrt{2}}\\
=& \frac{(|111\rangle + |000\rangle)(|111\rangle - |000\rangle)(|000\rangle + |111\rangle)}{2\sqrt{2}} = -|\tilde{0}_L\rangle\\
&\frac{X_1X_2X_3X_4X_5X_6(|000\rangle - |111\rangle)(|000\rangle + |111\rangle)(|000\rangle - |111\rangle)}{2\sqrt{2}}\\
=& \frac{(|111\rangle - |000\rangle)(|111\rangle + |000\rangle)(|000\rangle - |111\rangle)}{2\sqrt{2}} = -|\tilde{1}_L\rangle\\
\end{align}
\end{split}\]
Then measuring \(X_1X_2X_3X_4X_5X_6\) for \(|\psi\rangle = a|\tilde{0}_L\rangle + b|\tilde{1}_L\rangle\), the outcome is \(-1\), and the probability of getting \(-1\) is
(17)\[\begin{split}
\begin{align}
p(m_{123456}=-1) &= \langle \psi|(X_1X_2X_3X_4X_5X_6)^{\dagger}X_1X_2X_3X_4X_5X_6|\psi\rangle\\
&= (a^*\langle \tilde{0}_L|+b^*\langle \tilde{1}_L|)(a| \tilde{0}_L\rangle+b| \tilde{1}_L\rangle) = 1
\end{align}
\end{split}\]
The post-measurement state is then
(18)\[
\frac{X_1X_2X_3X_4X_5X_6|\psi\rangle}{p(m_{123456}=-1)} = -a|\tilde{0}_L\rangle-b|\tilde{1}_L\rangle
\]
After measuring \(X_1X_2X_3X_4X_5X_6\) we perform the measurement \(X_4X_5X_6X_7X_8X_9\), and we have
\[ \begin{align}\begin{aligned}\begin{split}
X_4X_5X_6X_7X_8X_9|\tilde{0}_L\rangle =
\frac{(|000\rangle + |111\rangle)(|111\rangle - |000\rangle)(|111\rangle + |000\rangle)}{2\sqrt{2}} = -|\tilde{0}_L\rangle\\\end{split}\\X_4X_5X_6X_7X_8X_9|\tilde{1}_L\rangle = \frac{(|000\rangle - |111\rangle)(|111\rangle + |000\rangle)(|111\rangle - |000\rangle)}{2\sqrt{2}} = -|\tilde{1}_L\rangle
\end{aligned}\end{align} \]
Then measuring \(X_4X_5X_6X_7X_8X_9\) for \(|\psi\rangle = -a|\tilde{0}_L\rangle - b|\tilde{1}_L\rangle\), the outcome is \(-1\), and the probability of getting \(-1\) is
(19)\[\begin{split}
\begin{align}
p(m_{456789}=-1) &= \langle \psi|(X_4X_5X_6X_7X_8X_9)^{\dagger}X_4X_5X_6X_7X_8X_9|\psi\rangle\\
&= (-a^*\langle \tilde{0}_L|-b^*\langle \tilde{1}_L|)(-a| \tilde{0}_L\rangle-b| \tilde{1}_L\rangle) = 1
\end{align}
\end{split}\]
The post-measurement state is then
(20)\[
\frac{X_4X_5X_6X_7X_8X_9|\psi\rangle}{p(m_{456789}=-1)} = a|\tilde{0}_L\rangle+b|\tilde{1}_L\rangle
\]
Phase flip at third three qubit set
If there is a phase flip error in the second three qubit, the state \(|0_L\rangle\) and \(|1_L\rangle\) becomes
(21)\[\begin{split}
\begin{align}
|0_L\rangle \to |\tilde{0}_L\rangle = \frac{(|000\rangle + |111\rangle)(|000\rangle + |111\rangle)(|000\rangle - |111\rangle)}{2\sqrt{2}} \\
|1_L\rangle \to |\tilde{1}_L\rangle = \frac{(|000\rangle - |111\rangle)(|000\rangle - |111\rangle)(|000\rangle + |111\rangle)}{2\sqrt{2}} \\
\end{align}
\end{split}\]
and the arbitrary state becomes \(|\psi\rangle = a|\tilde{0}_L\rangle + b|\tilde{1}_L\rangle\). Since \(X|0\rangle = |1\rangle\) and \(X|1\rangle = |0\rangle\) we have
(22)\[\begin{split}
\begin{align}
&\frac{X_1X_2X_3X_4X_5X_6(|000\rangle + |111\rangle)(|000\rangle + |111\rangle)(|000\rangle - |111\rangle)}{2\sqrt{2}}\\
=& \frac{(|111\rangle + |000\rangle)(|111\rangle + |000\rangle)(|000\rangle - |111\rangle)}{2\sqrt{2}} = |\tilde{0}_L\rangle\\
&\frac{X_1X_2X_3X_4X_5X_6(|000\rangle - |111\rangle)(|000\rangle - |111\rangle)(|000\rangle +|111\rangle)}{2\sqrt{2}}\\
=& \frac{(|111\rangle - |000\rangle)(|111\rangle - |000\rangle)(|000\rangle + |111\rangle)}{2\sqrt{2}} = |\tilde{1}_L\rangle\\
\end{align}
\end{split}\]
Then measuring \(X_1X_2X_3X_4X_5X_6\) for \(|\psi\rangle = a|\tilde{0}_L\rangle + b|\tilde{1}_L\rangle\), the outcome is \(+1\), and the probability of getting \(+1\) is
(23)\[\begin{split}
\begin{align}
p(m_{123456}=+1) &= \langle \psi|(X_1X_2X_3X_4X_5X_6)^{\dagger}X_1X_2X_3X_4X_5X_6|\psi\rangle\\
&= (a^*\langle \tilde{0}_L|+b^*\langle \tilde{1}_L|)(a| \tilde{0}_L\rangle+b| \tilde{1}_L\rangle) = 1
\end{align}
\end{split}\]
The post-measurement state is then
(24)\[
\frac{X_1X_2X_3X_4X_5X_6|\psi\rangle}{p(m_{123456}=+1)} = a|\tilde{0}_L\rangle+b|\tilde{1}_L\rangle
\]
After measuring \(X_1X_2X_3X_4X_5X_6\) we perform the measurement \(X_4X_5X_6X_7X_8X_9\), and we have
(25)\[ \begin{align}\begin{aligned}\begin{split}
X_4X_5X_6X_7X_8X_9|\tilde{0}_L\rangle =
\frac{(|000\rangle + |111\rangle)(|111\rangle + |000\rangle)(|111\rangle - |000\rangle)}{2\sqrt{2}} = -|\tilde{0}_L\rangle\\\end{split}\\X_4X_5X_6X_7X_8X_9|\tilde{1}_L\rangle = \frac{(|000\rangle - |111\rangle)(|111\rangle - |000\rangle)(|111\rangle + |000\rangle)}{2\sqrt{2}} = -|\tilde{1}_L\rangle
\end{aligned}\end{align} \]
Then measuring \(X_4X_5X_6X_7X_8X_9\) for \(|\psi\rangle = a|\tilde{0}_L\rangle + b|\tilde{1}_L\rangle\), the outcome is \(-1\), and the probability of getting \(-1\) is
(26)\[\begin{split}
\begin{align}
p(m_{456789}=-1) &= \langle \psi|(X_4X_5X_6X_7X_8X_9)^{\dagger}X_4X_5X_6X_7X_8X_9|\psi\rangle\\
&= (a^*\langle \tilde{0}_L|+b^*\langle \tilde{1}_L|)(a| \tilde{0}_L\rangle+b| \tilde{1}_L\rangle) = 1
\end{align}
\end{split}\]
The post-measurement state is then
(27)\[
\frac{X_4X_5X_6X_7X_8X_9|\psi\rangle}{p(m_{456789}=-1)} = -a|\tilde{0}_L\rangle-b|\tilde{1}_L\rangle
\]
From above calculation we know that,
If there is no error, we measure \(+1\) for \(X_1X_2X_3X_4X_5X_6\) and \(+1\) for \(X_4X_5X_6X_7X_8X_9\)
If there is a phase flip error at the first three qubit set, we measure \(-1\) for \(X_1X_2X_3X_4X_5X_6\) and \(+1\) for \(X_4X_5X_6X_7X_8X_9\)
If there is a phase flip error at the second three qubit set, we measure \(-1\) for \(X_1X_2X_3X_4X_5X_6\) and \(-1\) for \(X_4X_5X_6X_7X_8X_9\)
If there is a phase flip error at the third three qubit set, we measure \(+1\) for \(X_1X_2X_3X_4X_5X_6\) and \(-1\) for \(X_4X_5X_6X_7X_8X_9\)
From above summary, we can easily see that, the syndrome measurement for detecting phase flip errors in the Shor code corresponds to measuring \(X_1X_2X_3X_4X_5X_6\) and \(X_4X_5X_6X_7X_8X_9\)