\documentclass[11pt]{article}
\usepackage{tikz}
\include{lecture}
\DeclareMathOperator{\tr}{Tr}
\DeclareMathOperator{\pr}{Prob}
\begin{document}
\usetikzlibrary{calc,fadings,decorations.pathreplacing}
\newcommand\pgfmathsinandcos[3]{%
\pgfmathsetmacro#1{sin(#3)}%
\pgfmathsetmacro#2{cos(#3)}%
}
\newcommand\LongitudePlane[3][current plane]{%
\pgfmathsinandcos\sinEl\cosEl{#2} % elevation
\pgfmathsinandcos\sint\cost{#3} % azimuth
\tikzset{#1/.estyle={cm={\cost,\sint*\sinEl,0,\cosEl,(0,0)}}}
}
\newcommand\LatitudePlane[3][current plane]{%
\pgfmathsinandcos\sinEl\cosEl{#2} % elevation
\pgfmathsinandcos\sint\cost{#3} % latitude
\pgfmathsetmacro\yshift{\cosEl*\sint}
\tikzset{#1/.estyle={cm={\cost,0,0,\cost*\sinEl,(0,\yshift)}}} %
}
\newcommand\DrawLongitudeCircle[2][1]{
\LongitudePlane{\angEl}{#2}
\tikzset{current plane/.prefix style={scale=#1}}
% angle of "visibility"
\pgfmathsetmacro\angVis{atan(sin(#2)*cos(\angEl)/sin(\angEl))} %
\draw[current plane] (\angVis:1) arc (\angVis:\angVis+180:1);
\draw[current plane,dashed] (\angVis-180:1) arc (\angVis-180:\angVis:1);
}
\newcommand\DrawLatitudeCircle[2][1]{
\LatitudePlane{\angEl}{#2}
\tikzset{current plane/.prefix style={scale=#1}}
\pgfmathsetmacro\sinVis{sin(#2)/cos(#2)*sin(\angEl)/cos(\angEl)}
% angle of "visibility"
\pgfmathsetmacro\angVis{asin(min(1,max(\sinVis,-1)))}
\draw[current plane] (\angVis:1) arc (\angVis:-\angVis-180:1);
\draw[current plane,dashed] (180-\angVis:1) arc (180-\angVis:\angVis:1);
}
%% document-wide tikz options and styles
\tikzset{%
>=latex, % option for nice arrows
inner sep=0pt,%
outer sep=2pt,%
mark coordinate/.style={inner sep=0pt,outer sep=0pt,minimum size=3pt,
fill=black,circle}%
}
\lecture{25}{11/4/2010}{Error Correction}{Brian Nixon}
In this lecture, we complete our discussion of interactive proof systems and
begin talking about error correcting codes. We gradually build a system that
will secure a single qubit from errors and prove its correctness. Next lecture
we will discuss a different method of single qubit error correction.
\section{Quantum Interactive Proof Systems, continued}
Recall from last lecture that classically a language $L$ has an interactive proof system (IPS)
iff $L\in \PSPACE$. In the quantum setting, both the verifier and the prover gain addition
power so it is not immediately clear how the class of languages that
have a quantum interactive proof system (QIPS) compares. We know that we do not lose power
as the verifier can simply force the prover to adopt a classical
protocol by making an observation after each step. So we at least
have QIPS for all of $\PSPACE$. A recent result proved that we get nothing more than
$\PSPACE$ by demonstrating that any QIPS can be reduced to a similar type as
we used in our graph isomorphism protocol last lecture. In this standard form there are 4 steps:
\begin{enumerate}
\item Prover sends a register $X$ of qubits to Verifier,
\item Verifier picks $b\in \{0,1\}$ uniformly at random and sends it to Prover,
\item Prover sends register $Y$ to Verifier,
\item Verifier decides whether to accept.
\end{enumerate}
Given this form we want to know the probability that the verifier accepts. We can capture
this behavior with a semi-definite program. Semi-definite programs
(SDPs) are similar to linear programs -- they optimize a linear
objective function over the reals under linear inequality constraints;
in addition they can use constaints that require that certain
variables from a semi-definite matrix. They solution to SDPs can be
approximated to within $\epsilon$ in time polynomial in the
size of the program and $1/\epsilon$.
In our case the objective function can be written as
$$ \frac{1}{2} \sum_{i=0}^1
\Pr(\text{Verifier accepts} | b = i) = \frac12\tr(\pi_0 \rho_0)
+\frac12 \tr(\pi_1 \rho_1),$$
where $\pi_i$ denotes the projection onto the accepting subspace in
the case $b=i$, and $\rho_i$ denotes the density operator
related to the combination of $X$ and $Y$ for $b=i$.
The constraints are the following.
\begin{itemize}
\item $\rho_0$ and $\rho_1$ are density operators. This can be
expressed in and SDP program by stipulating that $\rho_0$ and
$\rho_1$ are positive semi-definite matrices, and the linear
equality that they have trace 1.
\item $X$ is independent of $b$. This can be expressed by the linear
equalities that tracing out $Y$ from $\rho_0$ and $\rho_1$ yields
the same matrix: $\tr_Y(\rho_0)=\tr_Y(\rho_1)$.
\end{itemize}
The resulting SDP has exponential size but has enough structure such
that it can be solved in polynomial space.
\section{Multiple Prover IPS}
How does the model change if we allow multiple provers? Such provers are allowed
to collaborate prior to the start of the protocol but are not allowed to communicate
once it has begun (or else there would effectively be a single prover). In the
classical system, the verifier would benefit from such a situation by being able to
check for consistency between the various provers. This way teh
verifier can effectively force the provers to act in a nonadaptive
manner where their anwers do not depend on the questions asked
before. It is known that classically a 2-prover IPS exists exactly for
languages in $\NEXP$ (nondeterministic exponential time), and that
more than 2 provers doesn't buy any more. With quantum systems, the
effect of multiple provers is an open question. The key difficulty
here is that provers can share entangled qubits prior to the start of
the protocol and cannot be viewed as completely disconnected.
\section{Bloch Sphere and Pauli operators}
Our discussion of quantum error correcting codes will be limited to
codes that can correct errors on a single qubit. Before starting that
discussion, we first review an interesting geometric representation of
single qubit systems and operations.
Recall that an operation on a single qubit can be represented by a
2-by-2 matrix.
Let $X=\left( \begin{array}{cc}0&1\\1&0\end{array} \right)$,
$Y=\left( \begin{array}{cc}0&-i\\i&0\end{array} \right)$, and
$Z=\left( \begin{array}{cc}1&0\\0&-1\end{array} \right)$. These
are the Pauli operators. Each of them are Hermitian and unitary so
induce a legal quantum operation on a single qubit.
The following properties of the operators are useful and you should confirm them
for yourself.
\begin{exercise}
\begin{enumerate}
\item $XY=iZ$, $YZ=iX$, $ZX=iY$.
\item $HXH=Z$ where $H$ is the Hadamard matrix.
\item $\{I, X,Y,Z\}$ form a basis for all $2\times 2$ matrices.
\end{enumerate}
\end{exercise}
As operations on qubits, $X$ performs a bit flip, $Z$ performs a
phase flip, and $Y$ corresponds to a combination of the two. The
second item in Exercise 1 shows that $Z$ corresponds to a bit flip in
the Hadamard basis. The third item implies that all single qubit
density operators can be decomposed into $\rho = \alpha I +
\beta X +\gamma Y+\delta Z$. We can easily show that $\alpha=1/2$ in
this case as $\tr(\rho) = 1$, $\tr(I) = 2$, $\tr(X)=\tr(Y)=\tr(Z)=0$, and
the trace is a linear operator on matrices. This allows us to write
any single qubit density operator as
\begin{equation}\label{25:eq:rho}
\rho = \frac12 I + \frac12(c_xX+c_yY+c_zZ).
\end{equation}
A pure state of a single qubit
can be written uniquely as $|\psi \rangle = \cos(\theta)|0\rangle +
e^{i\phi}\sin(\theta)|1\rangle$ up to a global phase shift where
$0\leq \phi < 2\pi$ and $0\leq \theta \leq \frac{\pi}2$. Calculating
the corresponding density operator $\rho = \ket{\psi}\bra{\psi}$ yields
\begin{equation}\label{25:eq:dec}
\rho = \left(
\begin{array}{cc}
\cos^2(\theta) & e^{-i\phi}\sin(\theta)\cos(\theta) \\
e^{i\phi}\sin(\theta)\cos(\theta) & \sin^2(\theta)
\end{array}
\right) =
\frac12 \left(
\begin{array}{cc}
1+\cos(2\theta) & e^{-i\phi}\sin(2\theta) \\
e^{i\phi}\sin(2\theta) & 1-\cos(2\theta)
\end{array}
\right).
\end{equation}
Equating (\ref{25:eq:rho}) and (\ref{25:eq:dec}) yields
\[ \left\{ \begin{array}{rcl}
c_x & = & \sin(2\theta)\cos(\phi)\\
c_y & = & \sin(2\theta)\sin(\phi)\\
c_z & =& \cos(2\theta)
\end{array} \right. \]
These are the polar coordinates of a point on a three-dimensional
sphere with radius 1 centered at the origin. The representation is
known as the Bloch sphere.
\begin{figure}[ht]
\begin{center}
\begin{tikzpicture} % MERC
% Stereographic and cylindrical map projections
% Author: Tomasz M. Trzeciak
% Source: LaTeX-Community.org
%
%% some definitions
\def\R{3} % sphere radius
\def\angEl{25} % elevation angle
\def\angAz{-100} % azimuth angle
\def\angPhiOne{-50} % longitude of point P
\def\angPhiTwo{-35} % longitude of point Q
\def\angBeta{33} % latitude of point P and Q
%% working planes
\pgfmathsetmacro\H{\R*cos(\angEl)} % distance to north pole
\LongitudePlane[xzplane]{\angEl}{\angAz}
\LongitudePlane[pzplane]{\angEl}{\angPhiOne}
\LongitudePlane[qzplane]{\angEl}{\angPhiTwo}
\LatitudePlane[equator]{\angEl}{0}
%% draw background sphere
\fill[ball color=white] (0,0) circle (\R); % 3D lighting effect
%\fill[white] (0,0) circle (\R); % just a white circle
\draw (0,0) circle (\R);
%% characteristic points
\coordinate (O) at (0,0);
\coordinate[mark coordinate] (N) at (0,\H);
\coordinate[mark coordinate] (S) at (0,-\H);
\path[xzplane] (\R,0) coordinate (XE);
\path[pzplane] (\angBeta:\R) coordinate (P);
\path[pzplane] (\R,0) coordinate (PE);
\path[qzplane] (\angBeta:\R) coordinate (Q);
\path[qzplane] (\R,0) coordinate (QE);
%% meridians and latitude circles
% \DrawLongitudeCircle[\R]{\angAz} % xzplane
% \DrawLongitudeCircle[\R]{\angAz+90} % yzplane
\DrawLongitudeCircle[\R]{\angPhiOne} % pzplane
%\DrawLongitudeCircle[\R]{\angPhiTwo} % qzplane
\DrawLatitudeCircle[\R]{\angBeta}
\DrawLatitudeCircle[\R]{0} % equator
% shifted equator in node with nested call to tikz
% (I didn't know it's possible)
%\node at (0,1.6*\R) { \tikz{\DrawLatitudeCircle[\R]{0}} };
%% draw lines and put labels
%\draw (-\R,-\H) -- (-\R,2*\R) (\R,-\H) -- (\R,2*\R);
%\draw[->] (O) -- +(0,1.5*\R) node[above] {$|0\rangle$};
\node[above=8pt] at (N) {$|0\rangle$};%{$\mathbf{N}$};
\node[below=8pt] at (S) {$|1\rangle$};%{$\mathbf{S}$};
\node[right=8pt] at (P) {$|\Phi \rangle$};
\draw[->] (O) -- (P);
\draw[dashed] (O) -- (N);
\draw[dashed] (XE) -- (O) -- (PE);
%\draw[dashed] (O) -- (QE);
%\draw[pzplane,->,thin] (0:0.5*\R) to[bend right=15]
% node[midway,right] {$\beta$} (\angBeta:0.5*\R);
\path[pzplane] (0.5*\angBeta:\R) ;%node[right] {$\hat{1}$};
\path[qzplane] (0.5*\angBeta:\R) ;%node[right] {$\hat{2}$};
\draw[equator,->,thin] (\angAz:0.5*\R) to[bend right=30]
node[pos=0.4,above] {$\phi$} (\angPhiOne:0.5*\R);
\draw[pzplane,->,thin] (90:0.5*\R) to[bend left=30]
node[midway,right] {$\theta$} (\angBeta:0.5*\R);
\draw[equator,->] (-90:\R) arc (-90:-70:\R) ;%node[below=0.3ex] {$x = a\phi$};
\path[xzplane] (0:\R) node[below] {$\theta=0$};
\path[xzplane] (\angBeta:\R);% node[below left] {$\beta=\beta_0$};
\end{tikzpicture}
\end{center}
\caption{Bloch Sphere}
\label{25:fig:bloch_sphere}
\end{figure}
Every single qubit density operator corresponds uniquely to a point on
the Bloch sphere. What about mixed states? These are convex
combinations of pure states so will yield a point on the interior of
the sphere.
What is the effect of the Pauli operators on the Bloch sphere? Applying
$Z$ adds $\pi$ to $\phi$, which amounts to a $180^\circ$ rotation around
the z-axis (or if you prefer, a reflection through the z-axis). A little
calculation will reveal that $X$ performs a rotation of $180^\circ$
around the x-axis, and $Y$ performs a rotation of $180^\circ$ around
the y-axis. Any curiosity you might have been holding towards why the
Pauli operators had their specific names should now be resolved. In
general, any unitary operation on $\ket{\psi}$ corresponds to a
rotation (not necessarily of $180^\circ$) around some axis in the
Bloch sphere.
\begin{exercise}
Show the Hadamard matrix performs a reflection through the plane including
the y and $(x+z)$ axes.
\end{exercise}
We note that $|\langle\phi_1 | \phi_2\rangle|^2=\tr(\rho_1\rho_2)=\frac12+\frac12
(c_{x_1}c_{x_2}+c_{y_1}c_{y_2}+c_{z_1}c_{z_2})$. In particular, orthogonal states
map to antipodal points on the Bloch sphere.
\section{Error Correction}
Error correction seems considerably harder in the quantum setting than
in the classical setting, and we will only discuss error correction on
a single qubit. For comparison, correction on a single bit is easy - consider the
code that repeats each bit thrice. To recover any bit, simply take the majority
view of any triple (taking the view that errors are unlikely to affect more than
one bit out of three).
Why is error correction for a qubit so much harder than the simple code
we gave for the classical bit? There are three main reasons. First, a qubit
has a continuum of possibilities where a bit's value lies in a discrete set.
Second, it is easy to copy a bit but in the quantum setting we have the no
cloning rule restricting us. Third, if we do a measurement in the course
of detecting and correcting errors, that will collapse the state and
may destroy information.
In the face of these apparent difficulties we first restrict our question farther
to simply correcting for the possibility of a bit flip error, noting that this
corresponds to the only possible error in the classical environment.
Taking our cue from the classical code, let us consider a system of three qubits
that we bind together by applying CNOT's to get $\alpha|000\rangle
+\beta|111\rangle$. See the first half of Figure \ref{25:fig:bflip_correction}.
There are four possible output states after a single bit flip error,
namely $\alpha|000\rangle +\beta|111\rangle$,
$\alpha|100\rangle +\beta|011\rangle$, $\alpha|010\rangle +\beta|101\rangle$, and
$\alpha|001\rangle +\beta|110\rangle$. Fortunately, these exist in orthogonal subspaces
so we can separate them perfectly. In fact, we can figure out the
error and correct if efficiently, as indicated in the second half of
Figure \ref{25:fig:bflip_correction}.
Consider the effect of reapplying the CNOT gates. If bit flips occurred
or the bit flips occurred on the extra qubits, this results
in the first qubit returning to $\alpha|0\rangle +\beta|1\rangle$. We
can correct the remaining error case
by adding a CNOT gate that modifies the first qubit and is controlled by the other two.
After this procedure the other two qubits
take on a pure value of either $|0\rangle$ or $|1\rangle$. In the field of error correction
these extra two bits are called ``syndromes'' and they tell us exactly
what error occurred:
\begin{eqnarray*}
& 00 & \textrm{for no error} \\
& 01 & \textrm{for a bit flip on the third qubit} \\
& 10 & \textrm{for a bit flip on the second qubit} \\
& 11 & \textrm{for a bit flip on the first qubit.}
\end{eqnarray*}
\begin{figure}[ht]
\begin{align*}
\Qcircuit @C=1em @R=.7em {
\lstick{|\phi\rangle} & \ctrl{1} & \ctrl{2} & \multigate{2}{E_{\text{bit}}} & \ctrl{1} & \ctrl{2} & \targ & \rstick{|\phi \rangle} \qw\\
\lstick{|0\rangle} & \targ & \qw & \ghost{E_{\text{bit}}} & \targ & \qw & \ctrl{-1} & \qw & & & \mbox{Syndrome}\\%& \rstick{b_2} \\
\lstick{|0\rangle} & \qw & \targ & \ghost{E_{\text{bit}}} & \qw & \targ & \ctrl{-2} & \qw \\
\\ & \mbox{encoding} & & & & \mbox{decoding}
\gategroup{1}{1}{3}{3}{.7em}{_\}} \gategroup{1}{5}{3}{7}{1.4em}{_\}} \gategroup{2}{8}{3}{8}{1.4em}{\}}
}%& \rstick{} \qw}
\end{align*}
\caption{Bit flip correction}
\label{25:fig:bflip_correction}
\end{figure}
It is important to note that if there is a phase flip during the error
stage, it appears in the final state $\ket{\phi}$ on the first qubit.
You should verify this for yourself.
To correct a phase flip we can use the fact $HZH = X$ and apply our
circuit for correcting bit flips with the error zone flanked by
$H^{\otimes 3}$. As a bit flip here corresponds to a phase flip in the
previous circuit, it passes through as a phase flip did before.
\begin{figure}[ht]
\begin{align*}
\Qcircuit @C=1em @R=.7em {
\lstick{|\phi\rangle} & \ctrl{1} & \ctrl{2} & \gate{H} & \multigate{2}{E_{\text{phase}}} & \gate{H} & \ctrl{1} & \ctrl{2} & \targ & \rstick{|\phi \rangle} \qw\\
\lstick{|0\rangle} & \targ & \qw & \gate{H} & \ghost{E_{\text{phase}}} & \gate{H} & \targ & \qw & \ctrl{-1} & \qw \\%& \rstick{b_2} \\
\lstick{|0\rangle} & \qw & \targ & \gate{H} & \ghost{E_{\text{phase}}} & \gate{H} & \qw & \targ & \ctrl{-2} & \qw}%& \rstick{} \qw}
\end{align*}
\caption{Phase flip correction}
\label{25:fig:pflip_correction}
\end{figure}
We can handle combined errors by concatenating both codes as in Figure
\ref{25:fig:full_error_correction}. We use the bit flip code
internally to correct a bit flip and transfer a phase flip onto the
first of the three qubits in the block. The dashed line in Figure
\ref{25:fig:full_error_correction} encircles one of the internal bit
flip codes. There are three such blocks, namely one for each of the
qubits of the external code, fore which we use our phase flip code.
\begin{figure}[ht]
\begin{align*}
\Qcircuit @C=1em @R=.7em {
\lstick{|\phi\rangle} & \ctrl{3} & \ctrl{6} & \gate{H} & \ctrl{1} & \ctrl{2} & \multigate{8}{E} & \ctrl{1} & \ctrl{2} & \targ & \gate{H} & \ctrl{3} & \ctrl{6} & \targ & \rstick{|\phi \rangle} \qw\\
\lstick{|0\rangle} & \qw & \qw & \qw & \targ & \qw & \ghost{E} & \targ & \qw & \ctrl{-1} & \qw & \qw & \qw & \qw & \qw \\%& \rstick{b_2} \\
\lstick{|0\rangle} & \qw & \qw & \qw & \qw & \targ & \ghost{E} & \qw & \targ & \ctrl{-2} & \qw & \qw & \qw & \qw & \qw \\%& \rstick{} \qw}
\lstick{|0\rangle} & \targ & \qw & \gate{H} & \ctrl{1} & \ctrl{2} & \ghost{E} & \ctrl{1} & \ctrl{2} & \targ & \gate{H} & \targ & \qw & \ctrl{-3} & \qw \\%& \rstick{b_2} \\
\lstick{|0\rangle} & \qw & \qw & \qw & \targ & \qw & \ghost{E} & \targ & \qw & \ctrl{-1} & \qw & \qw & \qw & \qw & \qw \\%& \rstick{} \qw}
\lstick{|0\rangle} & \qw & \qw & \qw & \qw & \targ & \ghost{E} & \qw & \targ & \ctrl{-2} & \qw & \qw & \qw & \qw & \qw \\%& \rstick{b_2} \\
\lstick{|0\rangle} & \qw & \targ & \gate{H} & \ctrl{1} & \ctrl{2} & \ghost{E} & \ctrl{1} & \ctrl{2} & \targ & \gate{H} & \qw & \targ & \ctrl{-6} & \qw \\%& \rstick{} \qw}
\lstick{|0\rangle} & \qw & \qw & \qw & \targ & \qw & \ghost{E} & \targ & \qw & \ctrl{-1} & \qw & \qw & \qw & \qw & \qw \\%& \rstick{b_2} \\
\lstick{|0\rangle} & \qw & \qw & \qw & \qw & \targ & \ghost{E} & \qw & \targ & \ctrl{-2} & \qw & \qw & \qw & \qw & \qw}%& \rstick{} \qw}
\end{align*}
\caption{Full Single Qubit Error Correction}
\label{25:fig:full_error_correction}
\end{figure}
The resulting 9-qubit code can correct a single bit flip $X$, a single
phase flip $Z$, and their combination $Y$. By linearity, this means
that the code can correct {\em any} single-qubit error $E$, as any
such $E$ can be written as a linear combination of $I$, $X$, $Y$, and
$Z$. Here we can see the magic of quantum linearity at work --
although there is a continuum of possible single-qubit errors, is
suffices to correct a discrete set (bit and phase flips and their
combinations) in order to correct all.
Next lecture we will discuss a different method of single qubit error correction that
uses only $7$ qubits to represent a single logical qubit.
\end{document}