<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www2.physics.siu.edu/qunet/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Ddghunter</id>
	<title>Qunet - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://www2.physics.siu.edu/qunet/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Ddghunter"/>
	<link rel="alternate" type="text/html" href="https://www2.physics.siu.edu/qunet/wiki/index.php/Special:Contributions/Ddghunter"/>
	<updated>2026-04-10T00:34:33Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.31.7</generator>
	<entry>
		<id>https://www2.physics.siu.edu/qunet/wiki/index.php?title=Chapter_3_-_Physics_of_Quantum_Information&amp;diff=2348</id>
		<title>Chapter 3 - Physics of Quantum Information</title>
		<link rel="alternate" type="text/html" href="https://www2.physics.siu.edu/qunet/wiki/index.php?title=Chapter_3_-_Physics_of_Quantum_Information&amp;diff=2348"/>
		<updated>2013-03-25T19:42:02Z</updated>

		<summary type="html">&lt;p&gt;Ddghunter: /* General Properties */ bad link&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===Introduction===&lt;br /&gt;
&lt;br /&gt;
It was a great realization that information is physical and that a&lt;br /&gt;
(classical) Turing machine is not the end of the story of&lt;br /&gt;
computation.  The physical system in which the information is stored&lt;br /&gt;
and manipulated is important and qubits are quite different from&lt;br /&gt;
bits.  &lt;br /&gt;
&lt;br /&gt;
In this chapter, some background in quantum mechanics is provided.&lt;br /&gt;
Not all of this chapter will be directly relevant to our discussion,&lt;br /&gt;
but it is included to progress our understanding&lt;br /&gt;
of how quantum mechanics from a textbook is related to quantum&lt;br /&gt;
computing.  The connection is clear, but the story seems&lt;br /&gt;
incomplete from a physicists perspective.  For the subject of error&lt;br /&gt;
prevention methods, some of this chapter will be vital---in&lt;br /&gt;
particular, the section(s) concerning the density matrix.  Not only&lt;br /&gt;
is this vital, it is often not covered in quantum mechanics&lt;br /&gt;
classes, both undergraduate and graduate.  &lt;br /&gt;
&lt;br /&gt;
It is also worth emphasizing that this chapter is primarily aimed at&lt;br /&gt;
physicists and for any others who are interested in the background&lt;br /&gt;
physics.  However, it is not necessary for much of what follows.&lt;br /&gt;
&lt;br /&gt;
===Schrodinger's Equation===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A common starting point in quantum mechanics is Schrodinger's equation.  This equation is not derived or justified here, but is given in a general form:&lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt;&lt;br /&gt;
H \left\vert \Psi\right\rangle = i\hbar\frac{\partial}{\partial t}\left\vert \Psi\right\rangle,&lt;br /&gt;
\,\!&amp;lt;/math&amp;gt;|3.1}}&amp;lt;br /&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;H\,\!&amp;lt;/math&amp;gt; is the Hamiltonian, &amp;lt;!-- \index{Hamiltonian} --&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\hbar\,\!&amp;lt;/math&amp;gt; is Planck's constant &lt;br /&gt;
&amp;lt;!-- \index{Planck's constant} --&amp;gt; &lt;br /&gt;
(divided by &amp;lt;math&amp;gt;2\pi\,\!&amp;lt;/math&amp;gt;), and &amp;lt;math&amp;gt;t\,\!&amp;lt;/math&amp;gt; is time.  The Hamiltonian contains what&lt;br /&gt;
is known about the system's evolution.  &lt;br /&gt;
Most of the time in these notes, we let &amp;lt;math&amp;gt;\hbar = 1\,\!&amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This equation is (formally) solved by taking the time derivative to be&lt;br /&gt;
an ordinary derivative (we assume no explicit time dependence for&lt;br /&gt;
&amp;lt;math&amp;gt;H \,\!&amp;lt;/math&amp;gt;), so &lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt;&lt;br /&gt;
H \left\vert \Psi\right\rangle = i\frac{d \left\vert \Psi\right\rangle}{dt}.&lt;br /&gt;
\,\!&amp;lt;/math&amp;gt;|3.2}}&amp;lt;br /&amp;gt;&lt;br /&gt;
This means that &lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt;&lt;br /&gt;
-iHdt =  \frac{d \left\vert \Psi\right\rangle}{\left\vert \Psi\right\rangle},&lt;br /&gt;
\,\!&amp;lt;/math&amp;gt;|3.3}}&amp;lt;br /&amp;gt;&lt;br /&gt;
so&lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt;\begin{align}&lt;br /&gt;
 \ln \left\vert \Psi\right\rangle &amp;amp;= -iHt + C, \\&lt;br /&gt;
\Rightarrow\left\vert \Psi(t)\right\rangle &amp;amp;= e^{-iHt}\left\vert \Psi(0)\right\rangle.  &lt;br /&gt;
\end{align}&lt;br /&gt;
\,\!&amp;lt;/math&amp;gt;|3.4}}&lt;br /&gt;
Now if &amp;lt;math&amp;gt;H\,\!&amp;lt;/math&amp;gt; is Hermitian (it is), then the matrix &lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt;&lt;br /&gt;
U =  e^{-iHt}&lt;br /&gt;
\,\!&amp;lt;/math&amp;gt;|3.5}}&amp;lt;br /&amp;gt;&lt;br /&gt;
is unitary.  &amp;lt;!-- \index{unitary matrix}--&amp;gt;&lt;br /&gt;
(If this is unclear, see [[Appendix C - Vectors and Linear Algebra]], in particular the section entitled [[Appendix C - Vectors and Linear Algebra#Unitary Matrices|Unitary Matrices]].)  Any&lt;br /&gt;
transformation on a closed system can be described by a unitary&lt;br /&gt;
transformation and any unitary transformation can be obtained by the&lt;br /&gt;
exponentiation of a Hermitian matrix.  &lt;br /&gt;
&lt;br /&gt;
The end result and important point is that the evolution of a quantum&lt;br /&gt;
state is, in general, given by a unitary matrix&lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt;&lt;br /&gt;
\left\vert \Psi(t)\right\rangle = U\left\vert \Psi(0)\right\rangle.  &lt;br /&gt;
\,\!&amp;lt;/math&amp;gt;|3.6}}&amp;lt;br /&amp;gt;&lt;br /&gt;
So our objective in quantum information processing is to create a&lt;br /&gt;
unitary evolution, and eventual measurement, which will produce a&lt;br /&gt;
particular outcome.&lt;br /&gt;
&lt;br /&gt;
====Exponentiating a Matrix====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;expmatrix&amp;quot;&amp;gt; ''Aside: a note about the exponentiation of a matrix.''&amp;lt;/div&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
It may seem strange to exponentiate a matrix.  However, you can define&lt;br /&gt;
a function of a matrix according to its Taylor expansion.  The details&lt;br /&gt;
of this are primarily unimportant here, but for demonstration purposes,&lt;br /&gt;
it is written out.  &lt;br /&gt;
&lt;br /&gt;
The Taylor expansion of an exponential is the following:&lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt;&lt;br /&gt;
e^x = \sum_{n=0}^\infty \frac{x^n}{n!}&lt;br /&gt;
\,\!&amp;lt;/math&amp;gt;|3.7}}&amp;lt;br /&amp;gt;&lt;br /&gt;
and this can be used to exponentiate a matrix by letting the matrix&lt;br /&gt;
replace &amp;lt;math&amp;gt;x\,\!&amp;lt;/math&amp;gt; in the equation.  This can also be used to prove that &lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt;&lt;br /&gt;
e^{ix}=\cos x +i\sin x.  &lt;br /&gt;
\,\!&amp;lt;/math&amp;gt;|3.8}}&amp;lt;br /&amp;gt;&lt;br /&gt;
''End Aside''&lt;br /&gt;
&lt;br /&gt;
===Density Matrix for Pure States===&lt;br /&gt;
&lt;br /&gt;
Now let us consider the object (a ''density matrix, or &lt;br /&gt;
density operator, of rank one'') &amp;lt;!-- \index{density matrix}\index{density&lt;br /&gt;
matrix!pure state} --&amp;gt;&lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt;&lt;br /&gt;
\rho = \left\vert\psi\right\rangle \left\langle \psi\right\vert,&lt;br /&gt;
&amp;lt;/math&amp;gt;|3.9}}&amp;lt;br /&amp;gt;&lt;br /&gt;
which is just the outer product of two vectors.  (See Appendix C.2.4, [[Appendix C - Vectors and Linear Algebra#Outer Product|Outer Product]].) &lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt;\left\vert \psi\right\rangle = \left\vert \psi(t)\right\rangle\,\!&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\rho=\rho(t)\,\!&amp;lt;/math&amp;gt; is also true.  If we&lt;br /&gt;
differentiate this with respect to &amp;lt;math&amp;gt;t\,\!&amp;lt;/math&amp;gt;, we discover&amp;lt;!-- \index{Schr\&amp;quot;odinger Equation!&lt;br /&gt;
  for density matrix} --&amp;gt;&lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt;\begin{align}&lt;br /&gt;
\frac{\partial \rho }{\partial t} &amp;amp;= &lt;br /&gt;
           \left(\frac{\partial \left\vert \psi\right\rangle}{\partial t}\right)\left\langle\psi\right\vert &lt;br /&gt;
            + \left\vert \psi\right\rangle\left(\frac{\partial \left\langle\psi\right\vert}{\partial t}\right)\\&lt;br /&gt;
                   &amp;amp;= (-iH)\rho + \rho (iH) = -i[H,\rho].&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;|3.10}} &lt;br /&gt;
This is merely the Schrodinger equation for a density matrix with the solution&lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt;&lt;br /&gt;
\rho(t) = U\rho(0)U^\dagger.&lt;br /&gt;
&amp;lt;/math&amp;gt;|3.11}}&amp;lt;br /&amp;gt;&lt;br /&gt;
This follows from &amp;lt;math&amp;gt;\left\vert\psi(t)\right\rangle\left\langle\psi(t)\right\vert =&lt;br /&gt;
U\left\vert\psi(0)\right\rangle\left\langle\psi(0)\right\vert U^\dagger\,\!&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Consider our two-state system, &lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt;&lt;br /&gt;
\left\vert 0\right\rangle = \left(\begin{array}{c} 1 \\ 0 \end{array}\right), &lt;br /&gt;
                   \;\;\; \mbox{and} \;\;\; &lt;br /&gt;
\left\vert 1\right\rangle = \left(\begin{array}{c} 0 \\ 1 \end{array}\right).&lt;br /&gt;
&amp;lt;/math&amp;gt;|3.12}}&amp;lt;br /&amp;gt;&lt;br /&gt;
Recall that the arbitrary superposition of these states is shown by &lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt;&lt;br /&gt;
\left\vert \psi\right\rangle = \alpha_0\left\vert 0\right\rangle + \alpha_1\left\vert 1\right\rangle &lt;br /&gt;
           = \left(\begin{array}{c} \alpha_0 \\ \alpha_1 \end{array}\right),&lt;br /&gt;
&amp;lt;/math&amp;gt;|3.13}}&amp;lt;br /&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;\alpha_0\,\!&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\alpha_1\,\!&amp;lt;/math&amp;gt; are complex numbers such that &lt;br /&gt;
&amp;lt;math&amp;gt;|\alpha_0|^2 + |\alpha_1|^2 = 1\,\!&amp;lt;/math&amp;gt;.  The corresponding &lt;br /&gt;
''pure state'' (i.e. rank one) ''density matrix'' is given by &lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt;&lt;br /&gt;
\rho_p = \left\vert\psi\right\rangle\left\langle\psi\right\vert&lt;br /&gt;
     = \left(\begin{array}{cc}&lt;br /&gt;
              |\alpha_0|^2 &amp;amp; \alpha_0 \alpha_1^* \\ &lt;br /&gt;
              \alpha_0^* \alpha_1 &amp;amp; |\alpha_1|^2 \end{array}\right).&lt;br /&gt;
&amp;lt;/math&amp;gt;|3.14}}&amp;lt;br /&amp;gt;&lt;br /&gt;
Note that the superposition in Eq.[[#eq3.13|(3.13)]] can be obtained from any pure state by a unitary transformation.  Here, the trace of&lt;br /&gt;
the density matrix is an important quantity; it is&lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt;&lt;br /&gt;
\mbox{Tr}(\rho_p) = |\alpha_0|^2 + |\alpha_1|^2 = 1.  &lt;br /&gt;
\,\!&amp;lt;/math&amp;gt;|3.15}}&amp;lt;br /&amp;gt;&lt;br /&gt;
Notice also that the determinant of this matrix is zero, indicating that it has a zero eigenvalue:&lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt;&lt;br /&gt;
\det(\rho_p) = |\alpha_0|^2|\alpha_1|^2 - \alpha_0 \alpha_1^*\alpha_0^*&lt;br /&gt;
\alpha_1 = 0.&lt;br /&gt;
&amp;lt;/math&amp;gt;|3.16}}&amp;lt;br /&amp;gt;&lt;br /&gt;
To see this another way, note that the density operator of rank one can be written as &amp;lt;math&amp;gt;U(\left\vert 0\right\rangle\left\langle0\right\vert)U^\dagger\,\!&amp;lt;/math&amp;gt;, so that the determinant is &lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt;\begin{align}&lt;br /&gt;
\det(U(\left\vert 0\right\rangle \left\langle 0\right\vert)U^\dagger) &amp;amp;= \det(U(\left\vert 0\right\rangle\left\langle 0\right\vert)U^{-1})\\&lt;br /&gt;
                            &amp;amp;=  \det(U)\det(\left\vert0\right\rangle\left\langle 0\right\vert)\frac{1}{\det(U)} \\&lt;br /&gt;
                            &amp;amp;= \det(\left\vert 0\right\rangle \left\langle 0\right\vert) = 0.&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;|3.17}}&lt;br /&gt;
This is a characteristic of a pure state and for two-state systems; it is a necessary and sufficient condition for the density operator to represent a pure state of the system.&lt;br /&gt;
&lt;br /&gt;
===Measurements Revisited===&lt;br /&gt;
&lt;br /&gt;
If the state of a quantum system is described by&lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt; &lt;br /&gt;
\left\vert \psi\right\rangle = \alpha_0\left\vert 0\right\rangle + \alpha_1\left\vert 1\right\rangle, &lt;br /&gt;
&amp;lt;/math&amp;gt;|3.18}}&amp;lt;br /&amp;gt;&lt;br /&gt;
then the probability of finding it in the state &amp;lt;math&amp;gt;\left\vert 0\right\rangle\,\!&amp;lt;/math&amp;gt; when measured in&lt;br /&gt;
the computational basis is &amp;lt;math&amp;gt;|\alpha_0|^2\,\!&amp;lt;/math&amp;gt;.  However, this is a&lt;br /&gt;
particular superposition that could be written as &lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt;&lt;br /&gt;
\left\vert \psi\right\rangle = U \left\vert 0\right\rangle.  &lt;br /&gt;
&amp;lt;/math&amp;gt;|3.19}}&amp;lt;br /&amp;gt;&lt;br /&gt;
In the section entitled [[#Schrodinger's Equation|Schrodinger's Equation]] it was shown that this matrix &amp;lt;math&amp;gt;U\,\!&amp;lt;/math&amp;gt; results&lt;br /&gt;
from the exponentiation of a Hermitian matrix. Recall from the section entitled [[Chapter 2 - Qubits and Collections of Qubits#The Pauli Matrices|The Pauli Matrices]] that any &amp;lt;math&amp;gt;2\times 2\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
Hermitian matrix can be written in terms of the Pauli matrices.  To make this explicit using standard conventions, &lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt;\begin{align}&lt;br /&gt;
\left\vert \psi\right\rangle &amp;amp;= U\left\vert 0\right\rangle  \\&lt;br /&gt;
           &amp;amp;= \exp(-i\vec{n}\cdot\vec{\sigma} \theta) \left\vert 0\right\rangle \\&lt;br /&gt;
           &amp;amp;= (\mathbb{I}\cos(\theta) -i\vec{n}\cdot\vec{\sigma} \sin(\theta))\left\vert 0\right\rangle,&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;|3.20}}&lt;br /&gt;
where &amp;lt;math&amp;gt;\vec{n}\,\!&amp;lt;/math&amp;gt; is a unit vector, &amp;lt;math&amp;gt;|\vec{n}|=1\,\!&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\vec{n}\cdot\vec{\sigma} =&lt;br /&gt;
n_1\sigma_1+n_2\sigma_2+n_3\sigma_3\,\!&amp;lt;/math&amp;gt;. (For a proof of this, see [[Appendix C - Vectors and Linear Algebra#Transformations of a Qubit|Section C.5.1]].)  One can write this matrix out explicitly, &lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt;\begin{align}&lt;br /&gt;
 \exp(-i\vec{n}\cdot\vec{\sigma} \theta) &amp;amp;= \left(\begin{array}{cc}&lt;br /&gt;
                                  1 &amp;amp; 0 \\ &lt;br /&gt;
                                  0 &amp;amp; 1 \end{array}\right)\cos(\theta) \\&lt;br /&gt;
                        &amp;amp; \;\;\;   + (-i)\left[ n_1\left(\begin{array}{cc}&lt;br /&gt;
                                  0 &amp;amp; 1 \\ &lt;br /&gt;
                                  1 &amp;amp; 0 \end{array}\right)&lt;br /&gt;
                              + n_2\left(\begin{array}{cc}&lt;br /&gt;
                                  0 &amp;amp; -i \\ &lt;br /&gt;
                                  i &amp;amp; 0 \end{array}\right)&lt;br /&gt;
                              + n_3\left(\begin{array}{cc}&lt;br /&gt;
                                  1 &amp;amp; 0 \\ &lt;br /&gt;
                                  0 &amp;amp; -1 \end{array}\right)\right]\sin(\theta) \\&lt;br /&gt;
                                &amp;amp;= &lt;br /&gt;
         \left(\begin{array}{cc}&lt;br /&gt;
  \cos(\theta) -in_3\sin(\theta) &amp;amp; (-in_1-n_2)\sin(\theta) \\ &lt;br /&gt;
   (-in_1+n_2)\sin(\theta) &amp;amp; \cos(\theta) +in_3\sin(\theta)  \end{array}\right).&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;|3.21}}&lt;br /&gt;
Notice this is a  ''special unitary matrix.''  (See [[Appendix C - Vectors and Linear Algebra]], in particular the subsection [[Appendix C - Vectors and Linear Algebra#Unitary Matrices|Unitary Matrices]].)&lt;br /&gt;
&lt;br /&gt;
To see that any state &amp;lt;math&amp;gt;\left\vert \psi\right\rangle\,\!&amp;lt;/math&amp;gt; for arbitrary coefficients&lt;br /&gt;
&amp;lt;math&amp;gt;\alpha_0\,\!&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\alpha_1\,\!&amp;lt;/math&amp;gt; can be obtained by choosing &amp;lt;math&amp;gt;\vec{n}\,\!&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\theta\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
appropriately, the state &amp;lt;math&amp;gt;\left\vert 0\right\rangle\,\!&amp;lt;/math&amp;gt; can be chosen as a starting point.  &lt;br /&gt;
Then, &lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt;\begin{align}&lt;br /&gt;
U\left\vert 0\right\rangle &amp;amp;= \left(\begin{array}{cc}&lt;br /&gt;
  \cos(\theta) -in_3\sin(\theta) &amp;amp; (-in_1-n_2)\sin(\theta) \\ &lt;br /&gt;
   (-in_1+n_2)\sin(\theta) &amp;amp; \cos(\theta) +in_3\sin(\theta)  &lt;br /&gt;
         \end{array}\right)&lt;br /&gt;
       \left(\begin{array}{c} 1 \\ 0\end{array}\right) \\&lt;br /&gt;
         &amp;amp;=  \left(\begin{array}{c} &lt;br /&gt;
                            \cos(\theta) -in_3\sin(\theta)  \\ &lt;br /&gt;
                            (-in_1+n_2)\sin(\theta)\end{array}\right). &lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;|3.22}}&lt;br /&gt;
For example, choosing &amp;lt;math&amp;gt;\theta=0\,\!&amp;lt;/math&amp;gt; gives the original state; choosing&lt;br /&gt;
&amp;lt;math&amp;gt;\vec{n} = (0,1,0)\,\!&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\theta = \pi/2\,\!&amp;lt;/math&amp;gt; gives &amp;lt;math&amp;gt;\left\vert 1\right\rangle\,\!&amp;lt;/math&amp;gt;; and choosing&lt;br /&gt;
&amp;lt;math&amp;gt;\vec{n} = (0,1,0)\,\!&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\theta = \pi/4\,\!&amp;lt;/math&amp;gt; gives an equal superposition.  &lt;br /&gt;
In general, when the system is in the state  &amp;lt;math&amp;gt;\left\vert \psi\right\rangle = U\left\vert 0\right\rangle\,\!&amp;lt;/math&amp;gt;,&lt;br /&gt;
the probability of finding the state &amp;lt;math&amp;gt;\left\vert 0 \right\rangle \,\!&amp;lt;/math&amp;gt; when a measurement is made in the computational basis is given by &lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt;\begin{align}&lt;br /&gt;
|\left\langle 0\right\vert U\left\vert 0\right\rangle|^2 &amp;amp;= |\cos(\theta) -in_3\sin(\theta)|^2   \\&lt;br /&gt;
                    &amp;amp;= \cos^2(\theta) +n_3^2\sin^2(\theta),  &lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;|3.23}}&lt;br /&gt;
and the probability of finding &amp;lt;math&amp;gt;\left\vert 1\right\rangle\,\!&amp;lt;/math&amp;gt; is&lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt;\begin{align}&lt;br /&gt;
|\left\langle 1\right\vert U\left\vert 1\right\rangle|^2 &amp;amp;= |(-in_1+n_2)\sin(\theta)|^2   \\&lt;br /&gt;
                    &amp;amp;= (n_1^2+n_2^2)\sin^2(\theta).   &lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;|3.24}}&lt;br /&gt;
Notice that the probabilities add up to one if &amp;lt;math&amp;gt;\vec{n}\,\!&amp;lt;/math&amp;gt; is a unit vector.  &lt;br /&gt;
&lt;br /&gt;
What this shows is that there is a transformation that takes the state&lt;br /&gt;
&amp;lt;math&amp;gt;\left\vert 0\right\rangle\,\!&amp;lt;/math&amp;gt;, which has probability &amp;lt;math&amp;gt;1\,\!&amp;lt;/math&amp;gt; of being in the state &amp;lt;math&amp;gt;\left\vert 0\right\rangle\,\!&amp;lt;/math&amp;gt; and&lt;br /&gt;
probability &amp;lt;math&amp;gt;0\,\!&amp;lt;/math&amp;gt; of being in the state &amp;lt;math&amp;gt;\left\vert 1\right\rangle\,\!&amp;lt;/math&amp;gt;, and transforms it&lt;br /&gt;
(using a &amp;lt;nowiki&amp;gt;&amp;quot;rotation''&amp;lt;/nowiki&amp;gt;) into a state with a different (and generic)&lt;br /&gt;
probability of each.  This means that the density matrix corresponding&lt;br /&gt;
to this system always has determinant zero, meaning that(for a two-state system) it has one&lt;br /&gt;
eigenvalue 1 and another eigenvalue 0.  (The determinant is the&lt;br /&gt;
product of the eigenvalues.)&lt;br /&gt;
&lt;br /&gt;
===Density Matrix for Mixed States===&lt;br /&gt;
&lt;br /&gt;
For a system with &amp;lt;math&amp;gt;D\,\!&amp;lt;/math&amp;gt; dimensions, a ''mixed state density matrix'' &lt;br /&gt;
(or density operator, see [[Appendix E - Density Operator: Extensions|Appendix E]]) &amp;lt;!-- \index{density matrix} \index{density operator} --&amp;gt; is a matrix that is used to&lt;br /&gt;
describe a more general state of a quantum system.  This can be written as &lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt;&lt;br /&gt;
\rho_D = \sum_i a_i \rho_i&lt;br /&gt;
\,\! &amp;lt;/math&amp;gt;|3.25}}&amp;lt;br /&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;a_i\geq 0\,\!&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;{\sum}_i a_i=1\,\!&amp;lt;/math&amp;gt;, and the &amp;lt;math&amp;gt;\rho_i\,\!&amp;lt;/math&amp;gt; are pure states.  There is also a generalization of the Bloch sphere which is described in [[Appendix E - Density Operator: Extensions|Appendix E]].  &lt;br /&gt;
&lt;br /&gt;
Mixed state &amp;lt;!-- \index{density matrix!mixed state} --&amp;gt; density matrices are important in all descriptions of physical implementations of quantum information processing.  For this reason, a bit of labor should go into understanding the density matrix. The rest of this section is devoted to the physical interpretation and properties of this description of a quantum system.  The first description presented is called the ensemble interpretation of the density matrix.  This is perhaps the easiest to understand.  Another set of physical systems that are described by density matrices will be given elsewhere.&lt;br /&gt;
&lt;br /&gt;
====General Properties====&lt;br /&gt;
&lt;br /&gt;
In general, a density matrix has the following properties:&lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt;\begin{align}&lt;br /&gt;
\rho = \rho^\dagger, &amp;amp;\;\;\; \mbox{it is hermitian}, \\&lt;br /&gt;
\rho \geq 0,\; &amp;amp;\;\;\; \mbox{it is positive semi-definite},&lt;br /&gt;
                         \\&lt;br /&gt;
\mbox{Tr}(\rho) = 1,\; &amp;amp;\;\;\; \mbox{it is normalized}. &lt;br /&gt;
\end{align}&lt;br /&gt;
\,\!&amp;lt;/math&amp;gt;|3.26}}&lt;br /&gt;
If, in addition, it is a pure state, then &lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt;&lt;br /&gt;
\rho^2 = \rho.&lt;br /&gt;
\,\!&amp;lt;/math&amp;gt;|3.27}}&amp;lt;br /&amp;gt;&lt;br /&gt;
The second property in Eq.[[#eq3.26|(3.26)]] really means that the eigenvalues of the density matrix are greater than or equal to zero.&lt;br /&gt;
&lt;br /&gt;
====Density Matrix for a Mixed State: Two States====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A mixed state density matrix for a two-state system is a rank two density matrix, &amp;lt;math&amp;gt;\rho_m\,\!&amp;lt;/math&amp;gt;, which can be described by &lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt;&lt;br /&gt;
\rho_m = \left[a_1\rho_1 + a_2\rho_2\right],&lt;br /&gt;
&amp;lt;/math&amp;gt;|3.28}}&amp;lt;br /&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;\rho_1 = \left\vert\psi_1\right\rangle\left\langle \psi_1\right\vert\,\!&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\rho_2 = \left \vert \psi_2\right\rangle\left\langle \psi_2\right\vert \,\!&amp;lt;/math&amp;gt; &lt;br /&gt;
and &amp;lt;math&amp;gt;a_1 + a_2=1\,\!&amp;lt;/math&amp;gt;.  The &amp;lt;math&amp;gt;a_i\,\!&amp;lt;/math&amp;gt; are probabilities and must sum to one.&lt;br /&gt;
(Note, if &amp;lt;math&amp;gt;\left\vert \psi\right\rangle_1=\left\vert \psi\right\rangle_2\,\!&amp;lt;/math&amp;gt;, or if one &amp;lt;math&amp;gt;a_i\,\!&amp;lt;/math&amp;gt; or one&lt;br /&gt;
&amp;lt;math&amp;gt;\left\vert \psi\right\rangle_i\,\!&amp;lt;/math&amp;gt; is zero, then this reduces to a pure state.)  In this mixture, &lt;br /&gt;
the probability of finding the state &amp;lt;math&amp;gt;\left\vert \psi_1\right\rangle\,\!&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;a_1\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
and the probability of finding the state &amp;lt;math&amp;gt;\left\vert \psi_2\right\rangle\,\!&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;a_2\,\!&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
====Description of Open Quantum Systems: An Example====&lt;br /&gt;
&lt;br /&gt;
One example of the utility of a density matrix is the following&lt;br /&gt;
statistical problem.  Let us consider a collection of electrons in a box, where their&lt;br /&gt;
spin is a two-state system being either up or down when measured.  If&lt;br /&gt;
a subset of these electrons is prepared in the state &amp;lt;nowiki&amp;gt;''up''&amp;lt;/nowiki&amp;gt; before&lt;br /&gt;
being put in the box and the rest &amp;lt;nowiki&amp;gt;''down,''&amp;lt;/nowiki&amp;gt; then the description of&lt;br /&gt;
the system of particles is given by &lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt;&lt;br /&gt;
\rho = a_u \left\vert\uparrow\right\rangle\left\langle\uparrow\right\vert +&lt;br /&gt;
         a_d\left\vert\downarrow\right\rangle\left\langle\downarrow\right\vert,&lt;br /&gt;
&amp;lt;/math&amp;gt;|3.29}}&amp;lt;br /&amp;gt;&lt;br /&gt;
where the fraction of  &amp;lt;nowiki&amp;gt;''up''&amp;lt;/nowiki&amp;gt; particles is &amp;lt;math&amp;gt;a_u\,\!&amp;lt;/math&amp;gt; and the fraction of &amp;lt;nowiki&amp;gt;''down''&amp;lt;/nowiki&amp;gt; is &amp;lt;math&amp;gt;a_d\,\!&amp;lt;/math&amp;gt;.  Our system is described by this density matrix---if a particle is chosen at random from the box and measured, the state of the particle is &amp;lt;math&amp;gt;\left\vert \uparrow\right\rangle\,\!&amp;lt;/math&amp;gt; with probability &amp;lt;math&amp;gt;a_u\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
and &amp;lt;math&amp;gt;\left\vert \downarrow\right\rangle\,\!&amp;lt;/math&amp;gt; with probability &amp;lt;math&amp;gt;a_d\,\!&amp;lt;/math&amp;gt;.  This is known as the &amp;quot;statistical&lt;br /&gt;
interpretation&amp;quot; of the density operator. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
There is another example that is more relevant for our purposes. Let us consider another two-state system.&lt;br /&gt;
If there is some probability &amp;lt;math&amp;gt;p\,\!&amp;lt;/math&amp;gt; for an error to occur, let us say it is a unitary operator &amp;lt;math&amp;gt;U_e\,\!&amp;lt;/math&amp;gt;, then the density matrix for the&lt;br /&gt;
system is &lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt;&lt;br /&gt;
\rho_e = (1-p)\left\vert\psi\right\rangle\left\langle\psi\right\vert + pU_e\left\vert\psi\right\rangle\left\langle\psi\right\vert U_e^\dagger.  &lt;br /&gt;
&amp;lt;/math&amp;gt;|3.30}}&amp;lt;br /&amp;gt;&lt;br /&gt;
This is the same form as Eq.[[#eq3.31|(3.31)]].  &lt;br /&gt;
&lt;br /&gt;
Note that in each &lt;br /&gt;
case the probabilities associated with the density matrix &amp;lt;math&amp;gt;p,1-p\,\!&amp;lt;/math&amp;gt;, and&lt;br /&gt;
&amp;lt;math&amp;gt;a_u,a_d\,\!&amp;lt;/math&amp;gt;, (generally, &amp;lt;math&amp;gt;a_i\,\!&amp;lt;/math&amp;gt;) are classical probabilities;&lt;br /&gt;
they are associated with a classical probability distribution---the&lt;br /&gt;
probability for error/no error and up/down.  These are not&lt;br /&gt;
probabilities associated with the superposition of the quantum state&lt;br /&gt;
in the equation &amp;lt;math&amp;gt;\left\vert \psi\right\rangle = \alpha_0 \left\vert 0\right\rangle + \alpha_1\left\vert 1\right\rangle\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
given by the square of the moduli of the coefficients.  This is an&lt;br /&gt;
important distinction!  The state&lt;br /&gt;
&amp;lt;math&amp;gt;\left\vert \psi\right\rangle\,\!&amp;lt;/math&amp;gt; can be taken to the state &amp;lt;math&amp;gt;\left\vert 0\right\rangle\,\!&amp;lt;/math&amp;gt; with a unitary&lt;br /&gt;
transformation.  This state is deterministic in the sense that the&lt;br /&gt;
result &amp;lt;math&amp;gt;\left\vert 0\right\rangle\,\!&amp;lt;/math&amp;gt; will be obtained from a measurement in the&lt;br /&gt;
computational basis since there is no probability for obtaining&lt;br /&gt;
&amp;lt;math&amp;gt;\left\vert 1\right\rangle\,\!&amp;lt;/math&amp;gt;.  However, for nonzero &amp;lt;math&amp;gt;\left\vert \psi\right\rangle\,\!&amp;lt;/math&amp;gt; and a non-identity&lt;br /&gt;
operator &amp;lt;math&amp;gt;U\,\!&amp;lt;/math&amp;gt;, the matrix &amp;lt;math&amp;gt;\rho_e\,\!&amp;lt;/math&amp;gt; has rank two and thus can never have&lt;br /&gt;
probability &amp;lt;math&amp;gt;1\,\!&amp;lt;/math&amp;gt; for either of the two states, &amp;lt;math&amp;gt;\left\vert 0\right\rangle\,\!&amp;lt;/math&amp;gt; or &amp;lt;math&amp;gt;\left\vert 1\right\rangle\,\!&amp;lt;/math&amp;gt;.&lt;br /&gt;
Thus we have maximum knowledge about a pure state since&lt;br /&gt;
there is a way to choose a measurement, perhaps after a unitary&lt;br /&gt;
transformation, which achieves a certain result with probability &amp;lt;math&amp;gt;1\,\!&amp;lt;/math&amp;gt;.&lt;br /&gt;
For the mixed state density operator this is not possible.  The state &lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt;&lt;br /&gt;
\rho = \left(\begin{array}{cc} &lt;br /&gt;
              1/2 &amp;amp; 0 \\ &lt;br /&gt;
                0 &amp;amp; 1/2 \end{array}\right),&lt;br /&gt;
&amp;lt;/math&amp;gt;|3.31}}&amp;lt;br /&amp;gt;&lt;br /&gt;
for which we have the least amount of knowledge, is called the&lt;br /&gt;
maximally mixed state. &amp;lt;!-- \index{maximally mixed state! two qubits}--&amp;gt;  The&lt;br /&gt;
state could be either up or down with equal probability and neither is&lt;br /&gt;
a better guess.  If the two eigenvalues are not equal, then there is a&lt;br /&gt;
better guess (or bet) as to the result of a measurement. If one&lt;br /&gt;
eigenvalue is zero, then there is a definite best guess.  &lt;br /&gt;
&lt;br /&gt;
To be more specific, independent of basis (unitary transformations),&lt;br /&gt;
one always has a probability greater than zero of measuring&lt;br /&gt;
&amp;lt;math&amp;gt;\left\vert \uparrow\right\rangle\,\!&amp;lt;/math&amp;gt; and probability greater than zero of measuring&lt;br /&gt;
&amp;lt;math&amp;gt;\left\vert \downarrow\right\rangle\,\!&amp;lt;/math&amp;gt;. Thus the  state described by the density matrix is&lt;br /&gt;
a ''mixed state'' &amp;lt;!-- \index{mixed state density matrix}--&amp;gt; in the sense&lt;br /&gt;
that it can be considered a statistical mixture of the  two states&lt;br /&gt;
&amp;lt;math&amp;gt;\left\vert \uparrow\right\rangle\,\!&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\left\vert \downarrow\right\rangle\,\!&amp;lt;/math&amp;gt;.  This, because classical&lt;br /&gt;
probabilities are included separately, is significantly different from&lt;br /&gt;
the pure state density matrix, which is a special case of all density&lt;br /&gt;
matrices.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To see that mixtures remain after a unitary transformation on the&lt;br /&gt;
system, note that a unitary matrix does not change the eigenvalues.  &lt;br /&gt;
This is because the eigenvalue equation is the same for a Hermitian&lt;br /&gt;
matrix and its corresponding diagonal matrix.  Let &amp;lt;math&amp;gt;\rho =&lt;br /&gt;
U\rho_d U^\dagger\,\!&amp;lt;/math&amp;gt;.  It can now be seen, &lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt;\begin{align}&lt;br /&gt;
\det(\rho -\lambda\mathbb{I}) &amp;amp;=&lt;br /&gt;
               \det(U(\rho_d-\lambda\mathbb{I})U^\dagger) \\&lt;br /&gt;
                        &amp;amp;=&lt;br /&gt;
                        \det(U)\det(\rho_d-\lambda\mathbb{I})\det(U^\dagger) \\&lt;br /&gt;
                        &amp;amp;=&lt;br /&gt;
                        \det(U)\det(\rho_d-\lambda\mathbb{I})\det(U^{-1}) \\&lt;br /&gt;
                        &amp;amp;= \det(\rho_d-\lambda\mathbb{I}).&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;|3.32}}&lt;br /&gt;
&lt;br /&gt;
====Two-State Example: Bloch Sphere====&lt;br /&gt;
&lt;br /&gt;
Since our interest is primarily in qubits, which are two-state&lt;br /&gt;
systems, we return to a two-state example. &lt;br /&gt;
&lt;br /&gt;
A very convenient representation of two state density matrices, one&lt;br /&gt;
that can written in the so-called Bloch sphere &amp;lt;!-- \index{Bloch sphere}--&amp;gt;&lt;br /&gt;
representation given the fact that the density matrix is Hermitian, &lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt;&lt;br /&gt;
\rho_2 = \frac{1}{2}(\mathbb{I} + \vec{n}\cdot\vec{\sigma}),&lt;br /&gt;
&amp;lt;/math&amp;gt;|3.33}}&amp;lt;br /&amp;gt;&lt;br /&gt;
where, for the density matrix to be positive &amp;lt;math&amp;gt;|\vec{n}| \leq 1\,\!&amp;lt;/math&amp;gt;, and the&lt;br /&gt;
&amp;lt;math&amp;gt;\sigma_i\,\!&amp;lt;/math&amp;gt; are the Pauli matrices &amp;lt;!-- \index{Pauli matrices}--&amp;gt;&lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt;&lt;br /&gt;
\vec{\sigma} = (\sigma_x,\sigma_y,\sigma_z) = \left(&lt;br /&gt;
\left(\begin{array}{cc}&lt;br /&gt;
              0 &amp;amp; 1 \\ &lt;br /&gt;
              1 &amp;amp; 0 \end{array}\right),&lt;br /&gt;
\left(\begin{array}{cc}&lt;br /&gt;
               0 &amp;amp; -i \\ &lt;br /&gt;
               i &amp;amp;  0 \end{array}\right),&lt;br /&gt;
\left(\begin{array}{cc}&lt;br /&gt;
              1 &amp;amp; 0 \\ &lt;br /&gt;
              0 &amp;amp; -1 \end{array}\right)&lt;br /&gt;
\right).&lt;br /&gt;
&amp;lt;/math&amp;gt;|3.34}}&amp;lt;br /&amp;gt;&lt;br /&gt;
The matrix entries on the RHS of this equation are the [[Chapter 2 - Qubits and Collections of Qubits#The Pauli Matrices|The Pauli matrices]] discussed above.  It is not difficult to convince yourself that any Hermitian matrix can be written as a real linear combination of the three Pauli matrices and the identity.  The eigenvalues are given by&lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt;&lt;br /&gt;
\lambda_\pm = \frac{1\pm|\vec{n}|}{2}.&lt;br /&gt;
&amp;lt;/math&amp;gt;|3.35}}&amp;lt;br /&amp;gt;&lt;br /&gt;
When &amp;lt;math&amp;gt;|\vec{n}| = 1\,\!&amp;lt;/math&amp;gt;, the state is pure, i.e., that the matrix &lt;br /&gt;
has rank one since it has one eigenvalue one and one zero.  If &amp;lt;math&amp;gt;|\vec{n}|&lt;br /&gt;
&amp;lt; 1\,\!&amp;lt;/math&amp;gt;, the density matrix represents a mixed state since rank is&lt;br /&gt;
greater than one--there are two non-zero eigenvalues.  These leads to&lt;br /&gt;
the following picture: the pure states lie on the surface of the&lt;br /&gt;
sphere (&amp;lt;math&amp;gt;\vec{n}\cdot \vec{n} =1\,\!&amp;lt;/math&amp;gt;), and mixed states lie in the interior of&lt;br /&gt;
the sphere with the maximally mixed state at the origin.  This is&lt;br /&gt;
supposedly due to Bloch. Hence the name Bloch sphere.  &lt;br /&gt;
&lt;br /&gt;
Using &amp;lt;math&amp;gt;\rho^2 =\rho\,\!&amp;lt;/math&amp;gt; the condition that &amp;lt;math&amp;gt;\vec{n}\cdot\vec{n} =1\,\!&amp;lt;/math&amp;gt; for a pure&lt;br /&gt;
state can also be determined.  The square in the Bloch sphere&lt;br /&gt;
representation yields&lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt;&lt;br /&gt;
\rho_2^2 = \frac{1}{4}\left(\mathbb{I} + 2\vec{n}\cdot\vec{\sigma} + (\vec{n}\cdot\vec{\sigma})^2\right), &lt;br /&gt;
&amp;lt;/math&amp;gt;|3.36}}&amp;lt;br /&amp;gt;&lt;br /&gt;
and using &lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt;&lt;br /&gt;
\sigma_i \sigma_j = \mathbb{I}\delta_{ij} + i\epsilon_{ijk}\sigma_k,&lt;br /&gt;
&amp;lt;/math&amp;gt;|3.37}}&amp;lt;br /&amp;gt;&lt;br /&gt;
then &amp;lt;math&amp;gt;\rho_2^2 =\rho_2\,\!&amp;lt;/math&amp;gt; if and only if &amp;lt;math&amp;gt;\vec{n}\cdot\vec{n} =1\,\!&amp;lt;/math&amp;gt;.  This technique is&lt;br /&gt;
used for higher dimensions.  See [[Appendix E - Density Operator: Extensions|Appendix E]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Two density matrices &amp;lt;math&amp;gt;\rho_1=(1/2)(\mathbb{I} +\vec{n}\cdot\vec{\sigma})\,\!&amp;lt;/math&amp;gt; and &lt;br /&gt;
&amp;lt;math&amp;gt;\rho_2=(1/2)(\mathbb{I} +\vec{m}\cdot\vec{\sigma})\,\!&amp;lt;/math&amp;gt;, correspond to orthogonal &lt;br /&gt;
states when &lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt;\begin{align}&lt;br /&gt;
\mbox{Tr}(\rho_1\rho_2) &amp;amp;= \frac{1}{4}\mbox{Tr}\big(\mathbb{I} + (\vec{n}\cdot\vec{\sigma})(\vec{m}\cdot\vec{\sigma})\big) \\&lt;br /&gt;
                  &amp;amp;= \frac{1}{2}(1+\vec{n}\cdot\vec{m}) =0.&lt;br /&gt;
\end{align}&amp;lt;/math&amp;gt;|3.38}}&amp;lt;br /&amp;gt;&lt;br /&gt;
This implies that &lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt;&lt;br /&gt;
\vec{n}\cdot\vec{m} = |\vec{n}||\vec{m}|\cos(\theta) = -1.&lt;br /&gt;
&amp;lt;/math&amp;gt;|3.39}}&amp;lt;br /&amp;gt;&lt;br /&gt;
Since the magnitudes must be one, the orthogonal states correspond to &lt;br /&gt;
pure states on a surface of a sphere which are represented by &lt;br /&gt;
antipodal points.&lt;br /&gt;
&lt;br /&gt;
====Rotations of Bloch Vectors====&lt;br /&gt;
&lt;br /&gt;
As shown above, the solution to the Schrodinger equation for the density operator is (see [[#eq3.11|Eq.(3.11)]])&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\rho(t) = U(t)\rho(0) U^\dagger(t).&lt;br /&gt;
\,\!&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
In general an open system will evolve according to &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\rho = U \rho_0 U^\dagger,&lt;br /&gt;
\,\!&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
whether or not the time dependence is explicitly taken into account.  When the density operator is represented using the Bloch vector, the vector is rotated by the unitary transformation.  This is seen through an explicit calculation.  &lt;br /&gt;
&lt;br /&gt;
There are two ways to see this.  One is to simply act with the matrices in the Euler angle parameterization in [[Appendix C - Vectors and Linear Algebra#Transformations of a Qubit|Section C.5.1]] one each of the Pauli matrices to show that indeed,&lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt;&lt;br /&gt;
U\vec{m}\cdot\vec{\sigma} U^\dagger = \sum_{ij} m_i R_{ij} \sigma_j.&lt;br /&gt;
\,\!&amp;lt;/math&amp;gt;|3.40}}&lt;br /&gt;
This is easily seen to be a standard rotation matrix.  (See for example http://en.wikipedia.org/wiki/Rotation_matrix.)  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Another way to do this is to take &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\rho_0 = \frac{1}{2}(\mathbb{I} + \vec{m}\cdot\vec{\sigma}),&lt;br /&gt;
\,\!&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
as in [[#eq3.33|Eq.(3.33)]].  (Recall &amp;lt;math&amp;gt;\vec{m}\cdot\vec{\sigma} = \sum\!{}_i \; m_i \sigma_i\,\!&amp;lt;/math&amp;gt;.)  Now act on &amp;lt;math&amp;gt;\rho&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;U\,\!&amp;lt;/math&amp;gt; as given in [[Appendix C - Vectors and Linear Algebra#Transformations of a Qubit|Section C.5.1]] by the so-called adjoint action &amp;lt;math&amp;gt;\rho = U \rho_0 U^\dagger\,\!&amp;lt;/math&amp;gt;, &lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt;&lt;br /&gt;
\rho = [\mathbb{I}\cos(\theta/2)-i\vec{n}\cdot\vec{\sigma}\sin(\theta/2)]\frac{1}{2}(\mathbb{I} + \vec{m}\cdot\vec{\sigma})[\mathbb{I}\cos(\theta/2)+i\vec{n}\cdot\vec{\sigma}\sin(\theta/2)].&lt;br /&gt;
\,\!&amp;lt;/math&amp;gt;|3.41}}&lt;br /&gt;
To do this calculation explicitly, it helps (but is not necessary) to use the following identity,&lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt;&lt;br /&gt;
\sum_i \epsilon_{ijk}\epsilon_{ilm} = \delta_{jl}\delta_{km} - \delta_{jm}\delta_{kl}.&lt;br /&gt;
\,\!&amp;lt;/math&amp;gt;|3.42}}&lt;br /&gt;
Then, if one only considers the non-trivial part of the density operator, &amp;lt;math&amp;gt;\vec{m}\cdot\vec{\sigma}\,\!&amp;lt;/math&amp;gt;, the result is &lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt;&lt;br /&gt;
e^{-i\vec{n}\cdot\vec{\sigma}\theta/2} \vec{m}\cdot\vec{\sigma} e^{i\vec{n}\cdot\vec{\sigma}\theta/2} &lt;br /&gt;
          = \vec{m}\cdot\vec{\sigma} \cos(\theta) + (\vec{n}\cdot\vec{m}) (\vec{n}\cdot\vec{\sigma})(1-\cos(\theta)) + (\vec{n}\times \vec{m})\cdot\vec{\sigma}\sin(\theta),&lt;br /&gt;
\,\!&amp;lt;/math&amp;gt;|3.43}}&lt;br /&gt;
or &lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt;\begin{align}&lt;br /&gt;
e^{-i\vec{n}\cdot\vec{\sigma}\theta/2} \vec{m}\cdot\vec{\sigma} e^{i\vec{n}\cdot\vec{\sigma}\theta/2} &lt;br /&gt;
          &amp;amp;= \frac{1}{2}\vec{m}\cdot\vec{\sigma} \cos(\theta) + \frac{1}{2}(\vec{n}\cdot\vec{m}) (\vec{n}\cdot\vec{\sigma})\cos(\theta) + (\vec{n}\cdot\vec{m}) (\vec{n}\cdot\vec{\sigma}) \\&lt;br /&gt;
           &amp;amp; \;\;\;\; + (\vec{n}\times \vec{m})\cdot\vec{\sigma}\sin(\theta)&lt;br /&gt;
+\frac{1}{2}[(\vec{n}\times\vec{m})\times\vec{n}]\cdot\vec{\sigma}\cos(\theta)\end{align}&lt;br /&gt;
\,\!&amp;lt;/math&amp;gt;|3.44}}&lt;br /&gt;
where&lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt;&lt;br /&gt;
(\vec{n}\times \vec{m})\cdot\vec{\sigma} = \sum_{ijk} \epsilon_{ijk} n_im_j\sigma_k.&lt;br /&gt;
\,\!&amp;lt;/math&amp;gt;|3.45}}&lt;br /&gt;
Therefore, the result of the action of &amp;lt;math&amp;gt;U\,\!&amp;lt;/math&amp;gt; is to produce, from  &amp;lt;math&amp;gt;\vec{m}\,\!&amp;lt;/math&amp;gt;, the vector&lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt;&lt;br /&gt;
\vec{m}^\prime= \vec{m} \cos(\theta) + (\vec{n}\cdot\vec{m})\vec{n}(1-\cos(\theta)) + (\vec{n}\times \vec{m})\sin(\theta).&lt;br /&gt;
\,\!&amp;lt;/math&amp;gt;|3.46}}&lt;br /&gt;
This equation can be interpreted as follows.  We consider three components of the vector, the part along the axis of rotation and the two parts in the plane perpendicular to the axis of rotation.  The part of the vector along the axis of rotation &amp;lt;math&amp;gt;(\vec{m}\cdot\vec{n})\vec{n}\,\!&amp;lt;/math&amp;gt; does not change.  The parts perpendicular to &amp;lt;math&amp;gt;(\vec{m}\cdot\vec{n})\vec{n}\,\!&amp;lt;/math&amp;gt; change just like a vector rotated in a plane, but these parts are rotated in the plane perpendicular to the rotation axis and sitting at the end of the vector &amp;lt;math&amp;gt;(\vec{m}\cdot\vec{n})\vec{n}\,\!&amp;lt;/math&amp;gt;.  It takes a bit of geometry and vector algebra to show this is the case.&lt;br /&gt;
&lt;br /&gt;
===Expectation Values===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The expectation value &amp;lt;!-- \index{expectation value}--&amp;gt; &lt;br /&gt;
of an operator &amp;lt;math&amp;gt;\mathcal{O}\,\!&amp;lt;/math&amp;gt;, is given by &lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt;&lt;br /&gt;
\langle \mathcal{O} \rangle = \mbox{Tr}(\rho \mathcal{O}),&lt;br /&gt;
&amp;lt;/math&amp;gt;|3.47}}&amp;lt;br /&amp;gt;&lt;br /&gt;
and is the &amp;quot;average value&amp;quot; of the operator.  For a pure state &lt;br /&gt;
&amp;lt;math&amp;gt;\rho_p = \left\vert\psi\right\rangle\left\langle\psi\right\vert\,\!&amp;lt;/math&amp;gt;, this reduces to &lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt;&lt;br /&gt;
(\langle \mathcal{O} \rangle)_p = \left\langle\psi\right\vert \mathcal{O}\left\vert \psi\right\rangle.  &lt;br /&gt;
&amp;lt;/math&amp;gt;|3.48}}&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Chapter 4 - Entanglement#Introduction|Continue to '''Chapter 4 - Entanglement''']]&lt;/div&gt;</summary>
		<author><name>Ddghunter</name></author>
		
	</entry>
	<entry>
		<id>https://www2.physics.siu.edu/qunet/wiki/index.php?title=Appendix_A_-_Basic_Probability_Concepts&amp;diff=2346</id>
		<title>Appendix A - Basic Probability Concepts</title>
		<link rel="alternate" type="text/html" href="https://www2.physics.siu.edu/qunet/wiki/index.php?title=Appendix_A_-_Basic_Probability_Concepts&amp;diff=2346"/>
		<updated>2013-03-03T22:27:13Z</updated>

		<summary type="html">&lt;p&gt;Ddghunter: grammar&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;In this appendix definitions and some example calculations are&lt;br /&gt;
presented which will aid in our discussions.  This is not meant to be&lt;br /&gt;
a comprehensive introduction to the topic.  It is primarily meant to&lt;br /&gt;
serve as a means for introducing notation and terminology for the&lt;br /&gt;
course.&lt;br /&gt;
&lt;br /&gt;
By definition, probability is the chance of a certain event occurring from a set of events that could possibly occur. Let us start with the most primitive example of probability, flipping a coin.  Now, we know the set of possible outcomes is heads or tails, &amp;lt;math&amp;gt;S=\left\{H,T\right\}.\,\!&amp;lt;/math&amp;gt;  Since there are only two events that can occur and we know that there is an equal chance for them both to occur, we say that the probability for each occurring is &amp;lt;math&amp;gt;1/2,\,\!&amp;lt;/math&amp;gt; i.e. &amp;lt;math&amp;gt;P(H)=1/2\,\!&amp;lt;/math&amp;gt;  and  &amp;lt;math&amp;gt;P(T)=1/2,\,\!&amp;lt;/math&amp;gt; because the probabilities for every possible outcome of an event must equal &amp;lt;math&amp;gt;1,\,\!&amp;lt;/math&amp;gt; i.e. &amp;lt;math&amp;gt;P(H)+P(T)=1.\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In probability, the Boolean operator '''''and''''' can be somewhat counter intuitive at first.  For instance, if someone were to tell you that he/she has '''5''' apples '''''and''''' just received '''3''' more, the operation that takes place in your head is he/she has &amp;lt;math&amp;gt;5 + 3 = 8\,\!&amp;lt;/math&amp;gt; apples.  But, when working with probabilities, the Boolean '''''and''''' corresponds with multiplication.  For example, say the probability that Bob stays and works through his lunch hour is &amp;lt;math&amp;gt;1/6\,\!&amp;lt;/math&amp;gt; and the probability that Kathy stays and works through lunch is &amp;lt;math&amp;gt;5/6.\,\!&amp;lt;/math&amp;gt; Now if I were to ask, &amp;quot;What is the probability that Bob '''''and''''' Kathy stay and work through lunch?&amp;quot;, you would not want add the probabilities because &amp;lt;math&amp;gt;P(B)+P(K)=1.\,\!&amp;lt;/math&amp;gt;  This would imply that both will work through lunch, which doesn't make sense because we cannot guarantee, from the knowledge that we have, both will work through lunch.  Instead, let us multiply their respective probabilities, &amp;lt;math&amp;gt;P(B)*P(K)=5/36.\,\!&amp;lt;/math&amp;gt;  Since the answer is lower than the probability for each individual, it makes much more sense because, intuitively, the more uncertainty (i.e. more probabilities &amp;lt; 1) in a system, the more uncertain we are of success.&lt;br /&gt;
&lt;br /&gt;
Now that we have examined the Boolean '''''and''''', lets take a look at '''''or'''''.  '''''Or''''' corresponds with addition, which follows directly from the condition that all probabilities for the outcomes of events must add up to &amp;lt;math&amp;gt;1.\,\!&amp;lt;/math&amp;gt;  Revisiting the example of flipping a coin, we see that the two possible outcomes that occur are you obtain heads '''''or''''' you obtain tails. &amp;lt;math&amp;gt;P(H)+P(T)=1.\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(This example is a variation of one given by David Griffiths in ''Introduction to Quantum Mechanics'' ([[Bibliography#Griffiths:qmbook|David J. Griffiths’ book [4]]]))&lt;br /&gt;
&lt;br /&gt;
''Example'':  Suppose that in some room, there are four people with the following heights:  &lt;br /&gt;
#1 person is '''1.5''' meters tall&lt;br /&gt;
#1 person is '''1.6''' meters tall&lt;br /&gt;
#2 people are '''1.8''' meters tall&lt;br /&gt;
Let&amp;lt;math&amp;gt;N\,\!&amp;lt;/math&amp;gt; stand for the total number of people.  We might write the number of people with certain heights as &lt;br /&gt;
&amp;lt;math&amp;gt;N(1.5) = 1\,\!&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;N(1.6)=1\,\!&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;N(1.8)=2\,\!&amp;lt;/math&amp;gt;. &lt;br /&gt;
&amp;lt;center&amp;gt;The total number of people is&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
N = \sum_{j=0}^\infty N(j),&lt;br /&gt;
\,\!&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;where &amp;lt;math&amp;gt;j\,\!&amp;lt;/math&amp;gt; runs over all values. It is easily seen that &amp;lt;math&amp;gt;N=4\,\!&amp;lt;/math&amp;gt;.&amp;lt;/center&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
Now if I draw a name out of a hat that contains each person's name&lt;br /&gt;
once, I will get the name of a person who is 1.6 meters tall with&lt;br /&gt;
probability &amp;lt;math&amp;gt;1/4\,\!&amp;lt;/math&amp;gt;.  (We assume that each person has a unique name and&lt;br /&gt;
that it appears once and only once in the hat.)  We write this as&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
P(1.6) = 1/4&lt;br /&gt;
\,\!&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
and we would generally write for any value&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
P(j) = \frac{N(j)}{N}. &lt;br /&gt;
\,\!&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
Now since we are going to get someone's name when we draw, we must&lt;br /&gt;
have &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\sum_j P(j) = 1,&lt;br /&gt;
\,\!&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
which is easy enough to check.  &lt;br /&gt;
&lt;br /&gt;
There are several aspects of this probability distribution that we might like to know.  Here are some that are particularly useful: &amp;lt;!-- \index{median}\index{mean} \index{average}--&amp;gt;&lt;br /&gt;
#The ''most probable'' value (or ''mode'') for the height is 1.8 meters.&lt;br /&gt;
#The ''median'' is 1.7 meters (two people above and two below).&lt;br /&gt;
#The ''average'' (or ''mean'') is given by&lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt;\begin{align}\left\langle height\right\rangle &amp;amp;= \frac{1(1.5)+1(1.6)+2(1.8)}{4} \\ &amp;amp;=  \frac{6.8}{4} = 1.7. \end{align}&amp;lt;/math&amp;gt;|A.1}}&lt;br /&gt;
Note that the mean and the median do not have to be the same.  If there is an odd number of values, the median is the middle number in the list; if even, it is the mean of the two middle values. It is mere coincidence that they are the same here.  &lt;br /&gt;
The bracket, &amp;lt;math&amp;gt;\left\langle\cdot\right\rangle\,\!&amp;lt;/math&amp;gt;, is the standard notation for finding  the ''average value''&amp;lt;!-- \index{average}--&amp;gt; &lt;br /&gt;
of a function.  This is done by calculating &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\left\langle f(j)\right\rangle = \sum_{j=0}^\infty f(j)P(j).\,\!&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
For the average this is just &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\left\langle j\right\rangle = \sum_{j=0}^\infty jP(j)= \sum_{j=0}^\infty j\frac{N(j)}{N}.  \,\!&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
'''Note:'''  The ''average value'' is called the ''expectation value'' &amp;lt;!-- \index{expectation value} --&amp;gt; in quantum mechanics.  This can be&lt;br /&gt;
misleading because it is ''not'' the most probable, nor is it &amp;lt;nowiki&amp;gt;''what to expect.''&amp;lt;/nowiki&amp;gt; &lt;br /&gt;
&lt;br /&gt;
When one would like to discuss the properties of a particular probability distribution, describing it takes some effort.  It is not enough to know the average, median, and most probable values; a lot of details of the probability distribution remain unknown to us if these are all we are given.  What else would one like to know?  Without describing it entirely, one may like to know more about the &amp;lt;nowiki&amp;gt;''shape''&amp;lt;/nowiki&amp;gt; of the distribution.  For example, how spread out is it?&lt;br /&gt;
&lt;br /&gt;
The most important measure of this is the ''variance'',&amp;lt;!-- \index{variance}--&amp;gt; which is the ''standard deviation'' &amp;lt;!-- \index{standard deviation} --&amp;gt; squared ( &amp;lt;math&amp;gt;\sigma^2\!&amp;lt;/math&amp;gt; ).  The variance is defined as (in terms of our variable &amp;lt;math&amp;gt;j\,\!&amp;lt;/math&amp;gt;) &lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt;\sigma^2 = \langle(\Delta j)^2\rangle, \,\!&amp;lt;/math&amp;gt;|A.2}}&lt;br /&gt;
where &amp;lt;math&amp;gt;\Delta j = j -\langle j \rangle\,\!&amp;lt;/math&amp;gt;.  This can also be written as &lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt;\sigma^2 = \langle j^2\rangle - \langle j \rangle^2.\,\!&amp;lt;/math&amp;gt;|A.3}}&lt;br /&gt;
&lt;br /&gt;
===Stirling's Formula===&lt;br /&gt;
&lt;br /&gt;
For large &amp;lt;math&amp;gt;n \,\!&amp;lt;/math&amp;gt;, the following approximation is quite useful:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
n! \approx \sqrt{2\pi n} \; n^n e^{-n}.&lt;br /&gt;
\,\!&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;/div&gt;</summary>
		<author><name>Ddghunter</name></author>
		
	</entry>
	<entry>
		<id>https://www2.physics.siu.edu/qunet/wiki/index.php?title=Appendix_F_-_Classical_Error_Correcting_Codes&amp;diff=2345</id>
		<title>Appendix F - Classical Error Correcting Codes</title>
		<link rel="alternate" type="text/html" href="https://www2.physics.siu.edu/qunet/wiki/index.php?title=Appendix_F_-_Classical_Error_Correcting_Codes&amp;diff=2345"/>
		<updated>2013-03-03T21:31:20Z</updated>

		<summary type="html">&lt;p&gt;Ddghunter: /* Parity Check Matrix */ Clarifying equations, correcting redundency&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===Introduction===&lt;br /&gt;
&lt;br /&gt;
Classical error correcting codes are in use in a wide variety of digital electronics and other classical information systems.  It is a good idea to learn some of the basic definitions, ideas, methods, and simple examples of classical error correcting codes in order to understand the (slightly) more complicated quantum error correcting codes.  There are many good introductions to classical error correction.  Here we follow a few sources which also discuss quantum error correcting codes: the book by [[Bibliography#LoeppWootters|Loepp and Wootters [25]]], an article in [[Bibliography#LoPopescueSpiller|Lo, Popescu, and Spiller [26]]] by Steane, [[Bibliography#GottDiss|Gottesman's Thesis [27]]], and [[Bibliography#Gaitan:book|Gaitan's Book [3]]] on quantum error correction, which also discusses classical error correction.&lt;br /&gt;
&lt;br /&gt;
===Binary Operations===&lt;br /&gt;
&lt;br /&gt;
The set &amp;lt;math&amp;gt; \{0,1\} \,\!&amp;lt;/math&amp;gt; is a group under addition.  (See [[Appendix D - Group Theory#Example 3|Section D.2.8]] of [[Appendix D - Group Theory|Appendix D]].)  The way this is achieved is by deciding that we will only use these two numbers in our language and using addition modulo 2, meaning &amp;lt;math&amp;gt; 0+0=0, 1+0 = 0+1 = 1, \,\!&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;1+1 =0\,\!&amp;lt;/math&amp;gt;.   If we also include the operation of multiplication and these two operations follow the distributive law, the set becomes a '''field''' (a Galois Field), which is denoted GF&amp;lt;math&amp;gt;(2)\,\!&amp;lt;/math&amp;gt;.  Since one often works with strings of bits, it is very useful to consider the string of bits to be a vector and to use vector addition (which is component-wise addition) and vector multiplication (which is the inner product).  For example, the addition of the vector &amp;lt;math&amp;gt;(0,0,1)\,\!&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;(0,1,1)\,\!&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;(0,0,1) + (0,1,1) = (0,1,0)\,\!&amp;lt;/math&amp;gt;.  The inner product between these two vectors is  &amp;lt;math&amp;gt;(0,0,1) \cdot (0,1,1) = 0\cdot 0 + 0\cdot 1 + 1\cdot 1 = 0 +0 +1=1\,\!&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Definitions and Basics===&lt;br /&gt;
&lt;br /&gt;
====Definition 1====&lt;br /&gt;
The inner product is also called a '''checksum''' or '''parity check''' since it shows whether or not the first and second vectors agree, or have an even number of 1's at the positions specified by the ones in the other vector.  We may say that the first vector satisfies the parity check of the other vector, or vice versa.&lt;br /&gt;
&lt;br /&gt;
====Definition 2====&lt;br /&gt;
The '''weight''' or '''Hamming weight''' is the number of non-zero components of a vector or string.  The weight of a vector &amp;lt;math&amp;gt;v\,\!&amp;lt;/math&amp;gt; is denoted wt(&amp;lt;math&amp;gt;v\,\!&amp;lt;/math&amp;gt;).  &lt;br /&gt;
&lt;br /&gt;
====Definition 3====&lt;br /&gt;
The '''Hamming distance''' is the number of places where two vectors differ.  Let the two vectors be &amp;lt;math&amp;gt;v\,\!&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;w\,\!&amp;lt;/math&amp;gt;.  Then the Hamming distance is also equal to wt(&amp;lt;math&amp;gt;v+w\,\!&amp;lt;/math&amp;gt;).  The Hamming distance between &amp;lt;math&amp;gt;v\,\!&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;w\,\!&amp;lt;/math&amp;gt; will be denoted &amp;lt;math&amp;gt;d_H(v,w)\,\!&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
====Definition 4====&lt;br /&gt;
We use &amp;lt;math&amp;gt;\{0,1\}^n\,\!&amp;lt;/math&amp;gt; to denote the set of all binary vectors of length &amp;lt;math&amp;gt;n\,\!&amp;lt;/math&amp;gt;.  A '''code''' &amp;lt;math&amp;gt;C\,\!&amp;lt;/math&amp;gt; of length &amp;lt;math&amp;gt;n\,\!&amp;lt;/math&amp;gt; is any subset of that set.  The set of all elements of &amp;lt;math&amp;gt;C\,\!&amp;lt;/math&amp;gt; is called the set of '''codewords'''.  We also say there are &amp;lt;math&amp;gt;2^n\,\!&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;n\,\!&amp;lt;/math&amp;gt;-bit words in the space.  &lt;br /&gt;
&lt;br /&gt;
Suppose &amp;lt;math&amp;gt;n\,\!&amp;lt;/math&amp;gt; bits are used to encode &amp;lt;math&amp;gt;k\,\!&amp;lt;/math&amp;gt; logical bits.  We use the notation &amp;lt;math&amp;gt;[n,k] \,\!&amp;lt;/math&amp;gt; do denote such a code.&lt;br /&gt;
&lt;br /&gt;
====Definition 5====&lt;br /&gt;
The '''minimum distance''' of a code is the smallest Hamming distance between any two non-equal vectors in a code.  This can be written &lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt;&lt;br /&gt;
d_{Hmin}(C) = \underset{v,w\in C,v\neq w}{\mbox{min}}d_H(v,w).&lt;br /&gt;
 \,\!&amp;lt;/math&amp;gt;|F.1}}&lt;br /&gt;
For shorthand, we also use &amp;lt;math&amp;gt; d(C)\,\!&amp;lt;/math&amp;gt; or &amp;lt;math&amp;gt; d\,\!&amp;lt;/math&amp;gt; if &amp;lt;math&amp;gt; C\,\!&amp;lt;/math&amp;gt; is understood.&lt;br /&gt;
&lt;br /&gt;
When that code has a distance &amp;lt;math&amp;gt;d\,\!&amp;lt;/math&amp;gt;, the notation &amp;lt;math&amp;gt;[n,k,d] \,\!&amp;lt;/math&amp;gt; is used.&lt;br /&gt;
&lt;br /&gt;
====Example 1====&lt;br /&gt;
It is interesting to note that if we encode redundantly using &amp;lt;math&amp;gt; 0_L=00 \,\!&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;1_L=11\,\!&amp;lt;/math&amp;gt; as our logical zero and logical one respectively, then we could detect single bit errors but not correct them.  For example, if we receive &amp;lt;math&amp;gt; 01\,\!&amp;lt;/math&amp;gt;, we know this cannot be one of our encoded states.  So an error must have occurred.  However, we don't know whether the sender sent &amp;lt;math&amp;gt; 0_L=00 \,\!&amp;lt;/math&amp;gt; or &amp;lt;math&amp;gt;1_L=11\,\!&amp;lt;/math&amp;gt;.  We do know that an error has occurred though, as long as we know only one error has occurred.  Such an encoding can be used as an '''error detecting code'''.  In this case there are two code words, &amp;lt;math&amp;gt; 0_L=00 \,\!&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;1_L=11\,\!&amp;lt;/math&amp;gt;, but four words in the space.  The minimum distance is 2, which is the distance between the two code words.&lt;br /&gt;
&lt;br /&gt;
====Example 2====&lt;br /&gt;
The three-bit redundant encoding was already given in [[Chapter 7 - Quantum Error Correcting Codes|Chapter 7]].  One takes logical zero and logical one states to be&lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt; &lt;br /&gt;
0_L =  000 \;\;\; \mbox{ and } \;\;\; 1_L = 111,&lt;br /&gt;
\,\!&amp;lt;/math&amp;gt;|F.2}}&lt;br /&gt;
where the subscript &amp;lt;math&amp;gt;L \,\!&amp;lt;/math&amp;gt; is used to denote a &amp;quot;logical&amp;quot; state; that is, one that is encoded.  Recall that this code is able to detect and correct one error.  In this case there are two code words out of eight possible words, and the minimal distance is 3.&lt;br /&gt;
&lt;br /&gt;
====Definition 6====&lt;br /&gt;
The '''rate''' of a code is given by the ration of the number of logical bits to the number of bits, &amp;lt;math&amp;gt;k/n\,\!&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
====Definition 7====&lt;br /&gt;
A '''linear code''' &amp;lt;math&amp;gt;C_l\,\!&amp;lt;/math&amp;gt; is a code that is closed under addition.&lt;br /&gt;
&lt;br /&gt;
===Linear Codes===&lt;br /&gt;
&lt;br /&gt;
Linear codes are particularly useful because they are able to efficiently identify errors and the associated correct codewords.  This ability is due to the added structure these codes have. &lt;br /&gt;
&lt;br /&gt;
====Generator Matrix====&lt;br /&gt;
&lt;br /&gt;
For linear codes, any linear combination of codewords is a codeword.  One key feature of a linear code is that it can be specified by a &amp;lt;nowiki&amp;gt;''generator matrix,''&amp;lt;/nowiki&amp;gt; &amp;lt;math&amp;gt;G\,\!&amp;lt;/math&amp;gt;&amp;lt;ref&amp;gt;Recall that we are working with binary codes.  Thus the entries of the matrix will also be binary numbers, i.e., 0's and 1's.&amp;lt;/ref&amp;gt;. For an &amp;lt;math&amp;gt; [n,k]\,\!&amp;lt;/math&amp;gt; code, the '''generator matrix''' is an &amp;lt;math&amp;gt; n\times k\,\!&amp;lt;/math&amp;gt; matrix with columns that form a basis for the &amp;lt;math&amp;gt;k\,\!&amp;lt;/math&amp;gt;-dimensional coding sub-space of the &amp;lt;math&amp;gt;n\,\!&amp;lt;/math&amp;gt;-dimensional binary vector space.  In other words, the vectors comprising the rows form a basis that will span the code space.  (Note that one may also use the transpose of this matrix as the definition for &amp;lt;math&amp;gt;G\,\!&amp;lt;/math&amp;gt;.)  Any code word &amp;lt;math&amp;gt;w\,\!&amp;lt;/math&amp;gt; described by a vector &amp;lt;math&amp;gt;v\,\!&amp;lt;/math&amp;gt; can be written in terms of the generator matrix as &amp;lt;math&amp;gt;w = Gv\,\!&amp;lt;/math&amp;gt;.  Note that &amp;lt;math&amp;gt;G\,\!&amp;lt;/math&amp;gt; is independent of the input and output vectors.  In addition, &amp;lt;math&amp;gt;G\,\!&amp;lt;/math&amp;gt; is not unique.  If columns are switched or even added to produce a new vector that replaces a column, then the generator matrix is still valid for the code.  This is due to the requirement that the columns be linearly independent, which is still satisfied if these operations are performed.&lt;br /&gt;
&lt;br /&gt;
====Parity Check Matrix====&lt;br /&gt;
Once &amp;lt;math&amp;gt;G\,\!&amp;lt;/math&amp;gt; is obtained, one can calculate another useful matrix, &amp;lt;math&amp;gt;P.\,\!&amp;lt;/math&amp;gt;  &amp;lt;math&amp;gt;P\,\!&amp;lt;/math&amp;gt; is an &amp;lt;math&amp;gt;(n- k)\times n\,\!&amp;lt;/math&amp;gt; matrix which has the property that&lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt;&lt;br /&gt;
PG = 0.&lt;br /&gt;
\,\!&amp;lt;/math&amp;gt;|F.3}}&lt;br /&gt;
The matrix &amp;lt;math&amp;gt;P\,\!&amp;lt;/math&amp;gt; is called the '''parity check matrix''' or '''dual matrix'''.  The rank of &amp;lt;math&amp;gt;P\,\!&amp;lt;/math&amp;gt; is at most  &amp;lt;math&amp;gt;n- k\,\!&amp;lt;/math&amp;gt; and has the property that it annihilates any code word.  To see this, recall any code word &amp;lt;math&amp;gt;w\,\!&amp;lt;/math&amp;gt; can be written as &amp;lt;math&amp;gt;Gv.\,\!&amp;lt;/math&amp;gt;  Therefore, &amp;lt;math&amp;gt;Pw=PGv =0\,\!&amp;lt;/math&amp;gt; since &amp;lt;math&amp;gt;PG =0.\,\!&amp;lt;/math&amp;gt;  That is to say, &amp;lt;math&amp;gt;Pw=0\,\!&amp;lt;/math&amp;gt; if and only if &amp;lt;math&amp;gt;w\,\!&amp;lt;/math&amp;gt; is a code word.  This means that &amp;lt;math&amp;gt;P\,\!&amp;lt;/math&amp;gt; can be used to test whether or not a word is in the code. &lt;br /&gt;
&lt;br /&gt;
Suppose an error occurs on a code word &amp;lt;math&amp;gt;w\,\!&amp;lt;/math&amp;gt; to produce &amp;lt;math&amp;gt;w^\prime = w + e\,\!&amp;lt;/math&amp;gt;.  It follows that&lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt;&lt;br /&gt;
Pw^\prime = P(w+e) = Pe,&lt;br /&gt;
\,\!&amp;lt;/math&amp;gt;|F.4}}&lt;br /&gt;
since &amp;lt;math&amp;gt;Pw=0\,\!&amp;lt;/math&amp;gt;.  This result, &amp;lt;math&amp;gt;Pe\,\!&amp;lt;/math&amp;gt; is called the '''error syndrome''' and the measurement to identify &amp;lt;math&amp;gt;Pe\,\!&amp;lt;/math&amp;gt; is the '''syndrome measurement'''.  Therefore, the result depends only on the error and not on the original code word.  If the error can be determined from this result, then it can be corrected independent of the code word.  However, in order to have &amp;lt;math&amp;gt;Pe\,\!&amp;lt;/math&amp;gt; be unique, two different results, &amp;lt;math&amp;gt;Pe_1\,\!&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;Pe_2\,\!&amp;lt;/math&amp;gt;, must not be equal.  This is possible if a distance &amp;lt;math&amp;gt;d\,\!&amp;lt;/math&amp;gt; code is constructed such that the parity check matrix has &amp;lt;math&amp;gt;d-1=2t\,\!&amp;lt;/math&amp;gt; linearly independent columns.  This enables the errors to be identified and corrected.&lt;br /&gt;
&lt;br /&gt;
It is important to emphasize that these two matrices define the code as well as the check and necessary recovery operations.  The matrix &amp;lt;math&amp;gt;G\,\!&amp;lt;/math&amp;gt; is determined by the code.  Once this matrix is determined, there is a method for determining the parity check matrix, &amp;lt;math&amp;gt;P\,\!&amp;lt;/math&amp;gt; which is a set of &amp;lt;math&amp;gt;n-k\,\!&amp;lt;/math&amp;gt; mutually orthogonal vectors that are also orthogonal to the code space defined by the generator matrix.  It is possible to determine the parity matrix from the generator matrix.  The method for doing this can be found in Steane's article in [[Bibliography#LoPopescuSpiller|Lo, Popescu, and Spiller [26]]] and it goes as follows.  One first puts &amp;lt;math&amp;gt;G^T\,\!&amp;lt;/math&amp;gt; in the form of an augmented matrix &amp;lt;math&amp;gt;(I_k|A),\,\!&amp;lt;/math&amp;gt; where &amp;lt;math&amp;gt;I_k\,\!&amp;lt;/math&amp;gt; is the &amp;lt;math&amp;gt;k\times k\,\!&amp;lt;/math&amp;gt; identity matrix.  Then the parity check matrix is &amp;lt;math&amp;gt;P = (A^T|I_{n-k}).\,\!&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Errors===&lt;br /&gt;
&lt;br /&gt;
For any classical error correcting code, there are general conditions that must be satisfied in order for the code to be able to detect and correct errors.  The two examples above show how the error can be detected; here, the objective is to give some general conditions.  &lt;br /&gt;
&lt;br /&gt;
Note that any state containing an error may be written as the sum of the original (logical or encoded) state  &amp;lt;math&amp;gt;w \,\!&amp;lt;/math&amp;gt; and another vector &amp;lt;math&amp;gt;e \,\!&amp;lt;/math&amp;gt;.  The error vector &amp;lt;math&amp;gt;e \,\!&amp;lt;/math&amp;gt; has ones in the places where errors are present and zeroes everywhere else.  To ensure that the error may be corrected, the following condition must be satisfied for two states with errors occurring:&lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt;&lt;br /&gt;
w_1 + e_1 \neq w_2 + e_2.&lt;br /&gt;
\,\!&amp;lt;/math&amp;gt;|F.5}}&lt;br /&gt;
This condition is called the '''disjointness condition'''.  This condition means that an error on one state cannot be confused with an error on another state.  If it could, then the state including the error could not be uniquely identified with an encoded state and the state could not be corrected to its original state after the error occurred.  More specifically, for a code to correct &amp;lt;math&amp;gt;t\,\!&amp;lt;/math&amp;gt;  single-bit errors, it must have distance at least &amp;lt;math&amp;gt;2t + 1 \,\!&amp;lt;/math&amp;gt; between any two codewords; i.e., it must be true that &amp;lt;math&amp;gt;d(C) \geq 2t + 1 \,\!&amp;lt;/math&amp;gt;.  An &amp;lt;math&amp;gt;[n,k]\,\!&amp;lt;/math&amp;gt; code with minimal distance &amp;lt;math&amp;gt;d \,\!&amp;lt;/math&amp;gt; is denoted &amp;lt;math&amp;gt;[n,k,d]\,\!&amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Example 3====&lt;br /&gt;
An important example of an error correcting code is called the &amp;lt;math&amp;gt;[7,4,3]&amp;lt;/math&amp;gt; Hamming code.  This code, as the notation indicates, encodes &amp;lt;math&amp;gt;k=4&amp;lt;/math&amp;gt; bits of information into &amp;lt;math&amp;gt;n=7&amp;lt;/math&amp;gt; bits.  It also does it in such a way that one error can be detected and corrected since it has a distance of &amp;lt;math&amp;gt;3&amp;lt;/math&amp;gt;.  The generator matrix for this code can be taken to be &lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt;&lt;br /&gt;
G^T = \left(\begin{array}{ccccccc}&lt;br /&gt;
          1 &amp;amp; 0 &amp;amp; 0 &amp;amp; 0 &amp;amp; 1 &amp;amp; 1 &amp;amp; 0 \\&lt;br /&gt;
          0 &amp;amp; 1 &amp;amp; 0 &amp;amp; 0 &amp;amp; 1 &amp;amp; 1 &amp;amp; 1 \\&lt;br /&gt;
          0 &amp;amp; 0 &amp;amp; 1 &amp;amp; 0 &amp;amp; 1 &amp;amp; 0 &amp;amp; 1 \\&lt;br /&gt;
          0 &amp;amp; 0 &amp;amp; 0 &amp;amp; 1 &amp;amp; 0 &amp;amp; 1 &amp;amp; 1 &lt;br /&gt;
    \end{array}\right).&lt;br /&gt;
\,\!&amp;lt;/math&amp;gt;|F.6}}&lt;br /&gt;
(See for example [[Bibliography#LoeppWootters|Loepp and Wootters [25]]].)  From this the parity check matrix, &amp;lt;math&amp;gt;P\,\!&amp;lt;/math&amp;gt; can be calculated (as stated above) by finding a set of &amp;lt;math&amp;gt;n-k\,\!&amp;lt;/math&amp;gt; mutually orthogonal vectors that are also orthogonal to the code space defined by the generator matrix.  Alternatively, one could use the method in Steane's article in [[Bibliography#LoPopescuSpiller|Lo, Popescu, and Spiller [26]]].  Put &amp;lt;math&amp;gt;G^T\,\!&amp;lt;/math&amp;gt; in the form &amp;lt;math&amp;gt;(I_k|A),\,\!&amp;lt;/math&amp;gt; where &amp;lt;math&amp;gt;I_k\,\!&amp;lt;/math&amp;gt; is the &amp;lt;math&amp;gt;k\times k\,\!&amp;lt;/math&amp;gt; identity matrix.  Then the parity check matrix is &amp;lt;math&amp;gt;P = (A^T|I_{n-k}).\,\!&amp;lt;/math&amp;gt;  In either case, one can arrive at the following parity check matrix for this code:&lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt;&lt;br /&gt;
P = \left(\begin{array}{ccccccc}&lt;br /&gt;
          1 &amp;amp; 1 &amp;amp; 1 &amp;amp; 0 &amp;amp; 1 &amp;amp; 0 &amp;amp; 0 \\&lt;br /&gt;
          1 &amp;amp; 1 &amp;amp; 0 &amp;amp; 1 &amp;amp; 0 &amp;amp; 1 &amp;amp; 0 \\&lt;br /&gt;
          0 &amp;amp; 1 &amp;amp; 1 &amp;amp; 1 &amp;amp; 0 &amp;amp; 0 &amp;amp; 1 &lt;br /&gt;
    \end{array}\right).&lt;br /&gt;
\,\!&amp;lt;/math&amp;gt;|F.7}}&lt;br /&gt;
It is useful to note that the code can also be defined by the parity check matrix.  Only the codewords are annihilated by the parity check matrix.&lt;br /&gt;
&lt;br /&gt;
===The Disjointness Condition and Correcting Errors===&lt;br /&gt;
&lt;br /&gt;
The motivation for the disjointness condition, [[#eqF.5|Eq.(F.5)]], is to associate each vector in the space with a particular code word.  That is, assuming that only certain errors occur, each error vector should be associated to a particular vector in the code space when the error is added to the original code word.  This partitions the set into disjoint subsets, with each containing only one code vector.  A message is decoded correctly if the vector (the one containing the error) is in the subset that is associated with the original vector (the one with no error).  For example, if one vector is sent, say &amp;lt;math&amp;gt; v_1 \,\!&amp;lt;/math&amp;gt;, and an error occurs during transmission to produce &amp;lt;math&amp;gt; v_2 = v_1 +e\,\!&amp;lt;/math&amp;gt;, then this vector must be in the subset containing &amp;lt;math&amp;gt; v_1 \,\!&amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
A way to decode is to record an array of possible code words, possible errors, and the combinations of those errors and code words.  The array can be set up as a top row of the code word vectors and a leftmost column of errors, with the element of the first row and the first column being the zero vector and all subsequent entries in the column being errors.  Then the element at the top of a column (say the jth column) is added to the error in the corresponding row (say the kth row) to get the j,k entry of the array.  With this array one can associate a column with a subset that is disjoint with the other sets.  Identifying the erred code word in a column associates it with a code word and thus corrects the error.&lt;br /&gt;
&lt;br /&gt;
====Example 4====&lt;br /&gt;
&lt;br /&gt;
In this example we are going to use &amp;lt;math&amp;gt;G\,\!&amp;lt;/math&amp;gt;  [[#eqF.6| (F.6)]] and &amp;lt;math&amp;gt;P\,\!&amp;lt;/math&amp;gt;  [[#eqF.7| (F.7)]] from the example above.&lt;br /&gt;
&lt;br /&gt;
The set of code words is given by all of the linear combinations of the rows of &amp;lt;math&amp;gt;P,\,\!&amp;lt;/math&amp;gt; meaning there are &amp;lt;math&amp;gt;2^3\,\!&amp;lt;/math&amp;gt; code words. The set of code words, &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C = \left\{0000000, 1110100, 1101010, 0111001, 0100111, 1010011, 0011110, 1001101\right\}.\,\!&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;div id=&amp;quot;TableF.1&amp;quot;&amp;gt;&amp;lt;big&amp;gt;'''TABLE F.1'''&amp;lt;/big&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;10&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |Table F.1: ''Array to determine possible errors on an unknown code word in set &amp;lt;math&amp;gt;C\,\!&amp;lt;/math&amp;gt;''&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;math&amp;gt;0000000\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;1110100\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;1101010\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;0111001\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;0100111\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;1010011\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;0011110\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;1001101\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;math&amp;gt;1000000\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;0110100\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;0101010\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;1111001\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;1100111\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;0010011\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;1011110\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;0001101\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;math&amp;gt;0100000\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;1010100\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;1001010\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;0011001\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;0000111\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;1110011\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;0111110\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;1101101\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;math&amp;gt;0010000\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;1100100\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;1111010\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;0101001\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;0110111\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;1000011\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;0001110\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;1011101\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;math&amp;gt;0001000\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;1111100\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;1100010\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;0110001\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;0101111\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;1011011\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;0010110\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;1000101\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;math&amp;gt;0000100\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;1110000\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;1101110\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;0111101\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;0100011\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;1010111\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;0011010\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;1001001\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;math&amp;gt;0000010\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;1110110\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;1101000\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;0111011\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;0100101\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;1010001\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;0011100\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;1001111\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;math&amp;gt;0000001\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;1110101\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;1101011\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;0111000\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;0100110\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;1010010\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;0011111\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;1001100\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, suppose you are expecting to receive a code word, &amp;lt;math&amp;gt;c\in C.\,\!&amp;lt;/math&amp;gt;  But, instead you receive &amp;lt;math&amp;gt;0101111\notin C.\,\!&amp;lt;/math&amp;gt;  What we are able to do is look at Table F.1 and see that &amp;lt;math&amp;gt;0101111\,\!&amp;lt;/math&amp;gt; is in column 5.  Since the columns of this table represent the disjoint subsets of our code space, we see that &amp;lt;math&amp;gt;c = 0100111\,\!&amp;lt;/math&amp;gt; and the error that occurred was &amp;lt;math&amp;gt;e_{4}\,\!&amp;lt;/math&amp;gt; or &amp;lt;math&amp;gt;0001000.\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===The Hamming Bound===&lt;br /&gt;
&lt;br /&gt;
The Hamming bound is a bound that restricts the rate of the code.  Due to the disjointness condition, a certain number of bits are required to ensure our ability to detect and correct errors.  Suppose there is a set of &amp;lt;math&amp;gt; n\,\!&amp;lt;/math&amp;gt; bit vectors for encoding &amp;lt;math&amp;gt; k\,\!&amp;lt;/math&amp;gt; bits of information.  There is a set of error vectors of weight &amp;lt;math&amp;gt; t \,\!&amp;lt;/math&amp;gt; that has &amp;lt;math&amp;gt; C(n,t)\,\!&amp;lt;/math&amp;gt; elements&amp;lt;ref&amp;gt;That is, &amp;lt;math&amp;gt; n \,\!&amp;lt;/math&amp;gt; choose &amp;lt;math&amp;gt; t \,\!&amp;lt;/math&amp;gt; vectors. The notation is &amp;lt;math&amp;gt; C(n,t) = {n\choose t} = \frac{n!}{(n-t)!t!}.\,\!&amp;lt;/math&amp;gt;&amp;lt;/ref&amp;gt;.  So the number of error vectors, including errors of weight up to &amp;lt;math&amp;gt; t \,\!&amp;lt;/math&amp;gt;, is &lt;br /&gt;
&amp;lt;math&amp;gt; \sum_{i=0}^t C(n,i). \,\!&amp;lt;/math&amp;gt;  (Note that no error is also part of the set of error vectors.  The objective is to be able to design a code that can correct all errors up to those of weight &amp;lt;math&amp;gt; t \,\!&amp;lt;/math&amp;gt;, and this includes no error at all.)  Since there are &amp;lt;math&amp;gt; 2^n\,\!&amp;lt;/math&amp;gt; vectors in the whole space of &amp;lt;math&amp;gt; n\,\!&amp;lt;/math&amp;gt; bits, and assuming &amp;lt;math&amp;gt; m\,\!&amp;lt;/math&amp;gt; vectors are used for the encoding, the Hamming bound is&lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt; &lt;br /&gt;
m\sum_{i=0}^t C(n,i) \leq 2^n.&lt;br /&gt;
\,\!&amp;lt;/math&amp;gt;|F.8}}&lt;br /&gt;
For linear codes, &amp;lt;math&amp;gt; m=2^k,\,\!&amp;lt;/math&amp;gt; so &lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt; &lt;br /&gt;
2^k\sum_{i=0}^t C(n,i) \leq 2^n.&lt;br /&gt;
\,\!&amp;lt;/math&amp;gt;|F.9}}&lt;br /&gt;
Taking the logarithm, &lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt; &lt;br /&gt;
k \leq n - \log_2\left(\sum_{i=0}^t C(n,i)\right).&lt;br /&gt;
\,\!&amp;lt;/math&amp;gt;|F.10}}&lt;br /&gt;
For large &amp;lt;math&amp;gt; n, k \,\!&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; t \,\!&amp;lt;/math&amp;gt;, we can use [[#LoPopescueSpiller|Stirling's formula]] to show that &lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt; &lt;br /&gt;
\frac{k}{n} \leq 1 - H\left(\frac{t}{n}\right),&lt;br /&gt;
\,\!&amp;lt;/math&amp;gt;|F.11}}&lt;br /&gt;
where &amp;lt;math&amp;gt; H(x) = -x\log x -(1-x)\log (1-x) \,\!&amp;lt;/math&amp;gt; and we have neglected an overall multiplicative constant that goes to 1 as  &amp;lt;math&amp;gt; n\rightarrow \infty. \,\!&amp;lt;/math&amp;gt;  (Again, see the article in [[Bibliography#LoPopescueSpiller|Lo, Popescu, and Spiller [26]]] by Steane.)&lt;br /&gt;
&lt;br /&gt;
===More Definitions===&lt;br /&gt;
&lt;br /&gt;
====Definition 8: Dual Code====&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt;\mathcal{C}\,\!&amp;lt;/math&amp;gt; be a code and let &amp;lt;math&amp;gt;v\,\!&amp;lt;/math&amp;gt; be a vector in the code space.  The '''dual code''', denoted &amp;lt;math&amp;gt;\mathcal{C}^\perp\,\!&amp;lt;/math&amp;gt;, is the set of all vectors that have zero inner product with all &amp;lt;math&amp;gt;v\in \mathcal{C}\,\!&amp;lt;/math&amp;gt;.  In other words, it is the set of all vectors &amp;lt;math&amp;gt;u\,\!&amp;lt;/math&amp;gt; such that &amp;lt;math&amp;gt;u\cdot v = 0\,\!&amp;lt;/math&amp;gt; for all  &amp;lt;math&amp;gt;v\in \mathcal{C}\,\!&amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
For binary vectors, a vector can be orthogonal to itself.  Note that this is different from ordinary vectors in 3-d space.  &lt;br /&gt;
&lt;br /&gt;
The dual code is a useful entity in classical error correction and will be used in the construction of the quantum error correcting codes known as [[Chapter 7 - Quantum Error Correcting Codes#CSS codes|CSS codes]].&lt;br /&gt;
&lt;br /&gt;
===Final Comments===&lt;br /&gt;
&lt;br /&gt;
As can be seen from the Hamming bound, there is a limit to the rate of an error correcting code.  This does not indicate whether or not codes that satisfy these bounds exist, but it does tell us that no codes exist that do not satisfy these bounds.  Encoding, decoding, error detection and correction are all difficult problems to solve in general.  One of the advantages of the linear codes is that they provide a systematic method for identifying errors on a code through the use of the parity check operation.  More generally, checking to see whether or not a bit string (vector) is in the code space would require a look-up table.  This would be much more time-consuming than using the parity check matrix; matrix multiplication is quite efficient relative to the look-up table.  &lt;br /&gt;
&lt;br /&gt;
Many of these ideas and definitions will be utilized in [[Chapter 7 - Quantum Error Correcting Codes|Chapter 7]] on quantum error correction.  Some linear codes, including the Hamming code above, will have quantum analogues---as do many quantum error correcting codes.  In quantum computers, as will be discussed, error correction is necessary due to the delicacy of quantum information.  Such discussions will be taken up in [[Chapter 7 - Quantum Error Correcting Codes|Chapter 7]].&lt;br /&gt;
&lt;br /&gt;
==Footnotes==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Ddghunter</name></author>
		
	</entry>
	<entry>
		<id>https://www2.physics.siu.edu/qunet/wiki/index.php?title=Appendix_F_-_Classical_Error_Correcting_Codes&amp;diff=2344</id>
		<title>Appendix F - Classical Error Correcting Codes</title>
		<link rel="alternate" type="text/html" href="https://www2.physics.siu.edu/qunet/wiki/index.php?title=Appendix_F_-_Classical_Error_Correcting_Codes&amp;diff=2344"/>
		<updated>2013-03-03T21:20:44Z</updated>

		<summary type="html">&lt;p&gt;Ddghunter: /* Linear Codes */ Correcting Redundency&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===Introduction===&lt;br /&gt;
&lt;br /&gt;
Classical error correcting codes are in use in a wide variety of digital electronics and other classical information systems.  It is a good idea to learn some of the basic definitions, ideas, methods, and simple examples of classical error correcting codes in order to understand the (slightly) more complicated quantum error correcting codes.  There are many good introductions to classical error correction.  Here we follow a few sources which also discuss quantum error correcting codes: the book by [[Bibliography#LoeppWootters|Loepp and Wootters [25]]], an article in [[Bibliography#LoPopescueSpiller|Lo, Popescu, and Spiller [26]]] by Steane, [[Bibliography#GottDiss|Gottesman's Thesis [27]]], and [[Bibliography#Gaitan:book|Gaitan's Book [3]]] on quantum error correction, which also discusses classical error correction.&lt;br /&gt;
&lt;br /&gt;
===Binary Operations===&lt;br /&gt;
&lt;br /&gt;
The set &amp;lt;math&amp;gt; \{0,1\} \,\!&amp;lt;/math&amp;gt; is a group under addition.  (See [[Appendix D - Group Theory#Example 3|Section D.2.8]] of [[Appendix D - Group Theory|Appendix D]].)  The way this is achieved is by deciding that we will only use these two numbers in our language and using addition modulo 2, meaning &amp;lt;math&amp;gt; 0+0=0, 1+0 = 0+1 = 1, \,\!&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;1+1 =0\,\!&amp;lt;/math&amp;gt;.   If we also include the operation of multiplication and these two operations follow the distributive law, the set becomes a '''field''' (a Galois Field), which is denoted GF&amp;lt;math&amp;gt;(2)\,\!&amp;lt;/math&amp;gt;.  Since one often works with strings of bits, it is very useful to consider the string of bits to be a vector and to use vector addition (which is component-wise addition) and vector multiplication (which is the inner product).  For example, the addition of the vector &amp;lt;math&amp;gt;(0,0,1)\,\!&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;(0,1,1)\,\!&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;(0,0,1) + (0,1,1) = (0,1,0)\,\!&amp;lt;/math&amp;gt;.  The inner product between these two vectors is  &amp;lt;math&amp;gt;(0,0,1) \cdot (0,1,1) = 0\cdot 0 + 0\cdot 1 + 1\cdot 1 = 0 +0 +1=1\,\!&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Definitions and Basics===&lt;br /&gt;
&lt;br /&gt;
====Definition 1====&lt;br /&gt;
The inner product is also called a '''checksum''' or '''parity check''' since it shows whether or not the first and second vectors agree, or have an even number of 1's at the positions specified by the ones in the other vector.  We may say that the first vector satisfies the parity check of the other vector, or vice versa.&lt;br /&gt;
&lt;br /&gt;
====Definition 2====&lt;br /&gt;
The '''weight''' or '''Hamming weight''' is the number of non-zero components of a vector or string.  The weight of a vector &amp;lt;math&amp;gt;v\,\!&amp;lt;/math&amp;gt; is denoted wt(&amp;lt;math&amp;gt;v\,\!&amp;lt;/math&amp;gt;).  &lt;br /&gt;
&lt;br /&gt;
====Definition 3====&lt;br /&gt;
The '''Hamming distance''' is the number of places where two vectors differ.  Let the two vectors be &amp;lt;math&amp;gt;v\,\!&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;w\,\!&amp;lt;/math&amp;gt;.  Then the Hamming distance is also equal to wt(&amp;lt;math&amp;gt;v+w\,\!&amp;lt;/math&amp;gt;).  The Hamming distance between &amp;lt;math&amp;gt;v\,\!&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;w\,\!&amp;lt;/math&amp;gt; will be denoted &amp;lt;math&amp;gt;d_H(v,w)\,\!&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
====Definition 4====&lt;br /&gt;
We use &amp;lt;math&amp;gt;\{0,1\}^n\,\!&amp;lt;/math&amp;gt; to denote the set of all binary vectors of length &amp;lt;math&amp;gt;n\,\!&amp;lt;/math&amp;gt;.  A '''code''' &amp;lt;math&amp;gt;C\,\!&amp;lt;/math&amp;gt; of length &amp;lt;math&amp;gt;n\,\!&amp;lt;/math&amp;gt; is any subset of that set.  The set of all elements of &amp;lt;math&amp;gt;C\,\!&amp;lt;/math&amp;gt; is called the set of '''codewords'''.  We also say there are &amp;lt;math&amp;gt;2^n\,\!&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;n\,\!&amp;lt;/math&amp;gt;-bit words in the space.  &lt;br /&gt;
&lt;br /&gt;
Suppose &amp;lt;math&amp;gt;n\,\!&amp;lt;/math&amp;gt; bits are used to encode &amp;lt;math&amp;gt;k\,\!&amp;lt;/math&amp;gt; logical bits.  We use the notation &amp;lt;math&amp;gt;[n,k] \,\!&amp;lt;/math&amp;gt; do denote such a code.&lt;br /&gt;
&lt;br /&gt;
====Definition 5====&lt;br /&gt;
The '''minimum distance''' of a code is the smallest Hamming distance between any two non-equal vectors in a code.  This can be written &lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt;&lt;br /&gt;
d_{Hmin}(C) = \underset{v,w\in C,v\neq w}{\mbox{min}}d_H(v,w).&lt;br /&gt;
 \,\!&amp;lt;/math&amp;gt;|F.1}}&lt;br /&gt;
For shorthand, we also use &amp;lt;math&amp;gt; d(C)\,\!&amp;lt;/math&amp;gt; or &amp;lt;math&amp;gt; d\,\!&amp;lt;/math&amp;gt; if &amp;lt;math&amp;gt; C\,\!&amp;lt;/math&amp;gt; is understood.&lt;br /&gt;
&lt;br /&gt;
When that code has a distance &amp;lt;math&amp;gt;d\,\!&amp;lt;/math&amp;gt;, the notation &amp;lt;math&amp;gt;[n,k,d] \,\!&amp;lt;/math&amp;gt; is used.&lt;br /&gt;
&lt;br /&gt;
====Example 1====&lt;br /&gt;
It is interesting to note that if we encode redundantly using &amp;lt;math&amp;gt; 0_L=00 \,\!&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;1_L=11\,\!&amp;lt;/math&amp;gt; as our logical zero and logical one respectively, then we could detect single bit errors but not correct them.  For example, if we receive &amp;lt;math&amp;gt; 01\,\!&amp;lt;/math&amp;gt;, we know this cannot be one of our encoded states.  So an error must have occurred.  However, we don't know whether the sender sent &amp;lt;math&amp;gt; 0_L=00 \,\!&amp;lt;/math&amp;gt; or &amp;lt;math&amp;gt;1_L=11\,\!&amp;lt;/math&amp;gt;.  We do know that an error has occurred though, as long as we know only one error has occurred.  Such an encoding can be used as an '''error detecting code'''.  In this case there are two code words, &amp;lt;math&amp;gt; 0_L=00 \,\!&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;1_L=11\,\!&amp;lt;/math&amp;gt;, but four words in the space.  The minimum distance is 2, which is the distance between the two code words.&lt;br /&gt;
&lt;br /&gt;
====Example 2====&lt;br /&gt;
The three-bit redundant encoding was already given in [[Chapter 7 - Quantum Error Correcting Codes|Chapter 7]].  One takes logical zero and logical one states to be&lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt; &lt;br /&gt;
0_L =  000 \;\;\; \mbox{ and } \;\;\; 1_L = 111,&lt;br /&gt;
\,\!&amp;lt;/math&amp;gt;|F.2}}&lt;br /&gt;
where the subscript &amp;lt;math&amp;gt;L \,\!&amp;lt;/math&amp;gt; is used to denote a &amp;quot;logical&amp;quot; state; that is, one that is encoded.  Recall that this code is able to detect and correct one error.  In this case there are two code words out of eight possible words, and the minimal distance is 3.&lt;br /&gt;
&lt;br /&gt;
====Definition 6====&lt;br /&gt;
The '''rate''' of a code is given by the ration of the number of logical bits to the number of bits, &amp;lt;math&amp;gt;k/n\,\!&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
====Definition 7====&lt;br /&gt;
A '''linear code''' &amp;lt;math&amp;gt;C_l\,\!&amp;lt;/math&amp;gt; is a code that is closed under addition.&lt;br /&gt;
&lt;br /&gt;
===Linear Codes===&lt;br /&gt;
&lt;br /&gt;
Linear codes are particularly useful because they are able to efficiently identify errors and the associated correct codewords.  This ability is due to the added structure these codes have. &lt;br /&gt;
&lt;br /&gt;
====Generator Matrix====&lt;br /&gt;
&lt;br /&gt;
For linear codes, any linear combination of codewords is a codeword.  One key feature of a linear code is that it can be specified by a &amp;lt;nowiki&amp;gt;''generator matrix,''&amp;lt;/nowiki&amp;gt; &amp;lt;math&amp;gt;G\,\!&amp;lt;/math&amp;gt;&amp;lt;ref&amp;gt;Recall that we are working with binary codes.  Thus the entries of the matrix will also be binary numbers, i.e., 0's and 1's.&amp;lt;/ref&amp;gt;. For an &amp;lt;math&amp;gt; [n,k]\,\!&amp;lt;/math&amp;gt; code, the '''generator matrix''' is an &amp;lt;math&amp;gt; n\times k\,\!&amp;lt;/math&amp;gt; matrix with columns that form a basis for the &amp;lt;math&amp;gt;k\,\!&amp;lt;/math&amp;gt;-dimensional coding sub-space of the &amp;lt;math&amp;gt;n\,\!&amp;lt;/math&amp;gt;-dimensional binary vector space.  In other words, the vectors comprising the rows form a basis that will span the code space.  (Note that one may also use the transpose of this matrix as the definition for &amp;lt;math&amp;gt;G\,\!&amp;lt;/math&amp;gt;.)  Any code word &amp;lt;math&amp;gt;w\,\!&amp;lt;/math&amp;gt; described by a vector &amp;lt;math&amp;gt;v\,\!&amp;lt;/math&amp;gt; can be written in terms of the generator matrix as &amp;lt;math&amp;gt;w = Gv\,\!&amp;lt;/math&amp;gt;.  Note that &amp;lt;math&amp;gt;G\,\!&amp;lt;/math&amp;gt; is independent of the input and output vectors.  In addition, &amp;lt;math&amp;gt;G\,\!&amp;lt;/math&amp;gt; is not unique.  If columns are switched or even added to produce a new vector that replaces a column, then the generator matrix is still valid for the code.  This is due to the requirement that the columns be linearly independent, which is still satisfied if these operations are performed.&lt;br /&gt;
&lt;br /&gt;
====Parity Check Matrix====&lt;br /&gt;
Once &amp;lt;math&amp;gt;G\,\!&amp;lt;/math&amp;gt; is obtained, one can calculate another useful matrix, &amp;lt;math&amp;gt;P.\,\!&amp;lt;/math&amp;gt;  &amp;lt;math&amp;gt;P\,\!&amp;lt;/math&amp;gt; is an &amp;lt;math&amp;gt;(n- k)\times n\,\!&amp;lt;/math&amp;gt; matrix which has the property that&lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt;&lt;br /&gt;
PG = 0.&lt;br /&gt;
\,\!&amp;lt;/math&amp;gt;|F.3}}&lt;br /&gt;
The matrix &amp;lt;math&amp;gt;P\,\!&amp;lt;/math&amp;gt; is called the '''parity check matrix''' or '''dual matrix'''.  The rank of &amp;lt;math&amp;gt;P\,\!&amp;lt;/math&amp;gt; is at most  &amp;lt;math&amp;gt;n- k\,\!&amp;lt;/math&amp;gt; and has the property that it annihilates any code word.  To see this, recall any code word is written as &amp;lt;math&amp;gt;Gv\,\!&amp;lt;/math&amp;gt;: &amp;lt;math&amp;gt;PGv =0\,\!&amp;lt;/math&amp;gt; since &amp;lt;math&amp;gt;PG =0.\,\!&amp;lt;/math&amp;gt;  Also, due to the rank of &amp;lt;math&amp;gt;P,\,\!&amp;lt;/math&amp;gt; it can be shown that &amp;lt;math&amp;gt;Pw =0\,\!&amp;lt;/math&amp;gt; only if &amp;lt;math&amp;gt;w\,\!&amp;lt;/math&amp;gt; is a code word.  That is to say, &amp;lt;math&amp;gt;Pw=0\,\!&amp;lt;/math&amp;gt; if and only if &amp;lt;math&amp;gt;w\,\!&amp;lt;/math&amp;gt; is a code word.  This means that &amp;lt;math&amp;gt;P\,\!&amp;lt;/math&amp;gt; can be used to test whether or not a word is in the code. &lt;br /&gt;
&lt;br /&gt;
Suppose an error occurs on a code word &amp;lt;math&amp;gt;w\,\!&amp;lt;/math&amp;gt; to produce &amp;lt;math&amp;gt;w^\prime = w + e\,\!&amp;lt;/math&amp;gt;.  It follows that&lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt;&lt;br /&gt;
Pw^\prime = P(w+e) = Pe,&lt;br /&gt;
\,\!&amp;lt;/math&amp;gt;|F.4}}&lt;br /&gt;
since &amp;lt;math&amp;gt;Pw=0\,\!&amp;lt;/math&amp;gt;.  This result, &amp;lt;math&amp;gt;Pe\,\!&amp;lt;/math&amp;gt; is called the '''error syndrome''' and the measurement to identify &amp;lt;math&amp;gt;Pe\,\!&amp;lt;/math&amp;gt; is the '''syndrome measurement'''.  Therefore, the result depends only on the error and not on the original code word.  If the error can be determined from this result, then it can be corrected independent of the code word.  However, in order to have &amp;lt;math&amp;gt;Pe\,\!&amp;lt;/math&amp;gt; be unique, two different results, &amp;lt;math&amp;gt;Pe_1\,\!&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;Pe_2\,\!&amp;lt;/math&amp;gt;, must not be equal.  This is possible if a distance &amp;lt;math&amp;gt;d\,\!&amp;lt;/math&amp;gt; code is constructed such that the parity check matrix has &amp;lt;math&amp;gt;d-1=2t\,\!&amp;lt;/math&amp;gt; linearly independent columns.  This enables the errors to be identified and corrected.&lt;br /&gt;
&lt;br /&gt;
It is important to emphasize that these two matrices define the code as well as the check and necessary recovery operations.  The matrix &amp;lt;math&amp;gt;G\,\!&amp;lt;/math&amp;gt; is determined by the code.  Once this matrix is determined, there is a method for determining the parity check matrix, &amp;lt;math&amp;gt;P\,\!&amp;lt;/math&amp;gt; which is a set of &amp;lt;math&amp;gt;n-k\,\!&amp;lt;/math&amp;gt; mutually orthogonal vectors that are also orthogonal to the code space defined by the generator matrix.  It is possible to determine the parity matrix from the generator matrix.  The method for doing this can be found in Steane's article in [[Bibliography#LoPopescuSpiller|Lo, Popescu, and Spiller [26]]] and it goes as follows.  One first puts &amp;lt;math&amp;gt;G^T\,\!&amp;lt;/math&amp;gt; in the form of an augmented matrix &amp;lt;math&amp;gt;(I_k|A),\,\!&amp;lt;/math&amp;gt; where &amp;lt;math&amp;gt;I_k\,\!&amp;lt;/math&amp;gt; is the &amp;lt;math&amp;gt;k\times k\,\!&amp;lt;/math&amp;gt; identity matrix.  Then the parity check matrix is &amp;lt;math&amp;gt;P = (A^T|I_{n-k}).\,\!&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Errors===&lt;br /&gt;
&lt;br /&gt;
For any classical error correcting code, there are general conditions that must be satisfied in order for the code to be able to detect and correct errors.  The two examples above show how the error can be detected; here, the objective is to give some general conditions.  &lt;br /&gt;
&lt;br /&gt;
Note that any state containing an error may be written as the sum of the original (logical or encoded) state  &amp;lt;math&amp;gt;w \,\!&amp;lt;/math&amp;gt; and another vector &amp;lt;math&amp;gt;e \,\!&amp;lt;/math&amp;gt;.  The error vector &amp;lt;math&amp;gt;e \,\!&amp;lt;/math&amp;gt; has ones in the places where errors are present and zeroes everywhere else.  To ensure that the error may be corrected, the following condition must be satisfied for two states with errors occurring:&lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt;&lt;br /&gt;
w_1 + e_1 \neq w_2 + e_2.&lt;br /&gt;
\,\!&amp;lt;/math&amp;gt;|F.5}}&lt;br /&gt;
This condition is called the '''disjointness condition'''.  This condition means that an error on one state cannot be confused with an error on another state.  If it could, then the state including the error could not be uniquely identified with an encoded state and the state could not be corrected to its original state after the error occurred.  More specifically, for a code to correct &amp;lt;math&amp;gt;t\,\!&amp;lt;/math&amp;gt;  single-bit errors, it must have distance at least &amp;lt;math&amp;gt;2t + 1 \,\!&amp;lt;/math&amp;gt; between any two codewords; i.e., it must be true that &amp;lt;math&amp;gt;d(C) \geq 2t + 1 \,\!&amp;lt;/math&amp;gt;.  An &amp;lt;math&amp;gt;[n,k]\,\!&amp;lt;/math&amp;gt; code with minimal distance &amp;lt;math&amp;gt;d \,\!&amp;lt;/math&amp;gt; is denoted &amp;lt;math&amp;gt;[n,k,d]\,\!&amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Example 3====&lt;br /&gt;
An important example of an error correcting code is called the &amp;lt;math&amp;gt;[7,4,3]&amp;lt;/math&amp;gt; Hamming code.  This code, as the notation indicates, encodes &amp;lt;math&amp;gt;k=4&amp;lt;/math&amp;gt; bits of information into &amp;lt;math&amp;gt;n=7&amp;lt;/math&amp;gt; bits.  It also does it in such a way that one error can be detected and corrected since it has a distance of &amp;lt;math&amp;gt;3&amp;lt;/math&amp;gt;.  The generator matrix for this code can be taken to be &lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt;&lt;br /&gt;
G^T = \left(\begin{array}{ccccccc}&lt;br /&gt;
          1 &amp;amp; 0 &amp;amp; 0 &amp;amp; 0 &amp;amp; 1 &amp;amp; 1 &amp;amp; 0 \\&lt;br /&gt;
          0 &amp;amp; 1 &amp;amp; 0 &amp;amp; 0 &amp;amp; 1 &amp;amp; 1 &amp;amp; 1 \\&lt;br /&gt;
          0 &amp;amp; 0 &amp;amp; 1 &amp;amp; 0 &amp;amp; 1 &amp;amp; 0 &amp;amp; 1 \\&lt;br /&gt;
          0 &amp;amp; 0 &amp;amp; 0 &amp;amp; 1 &amp;amp; 0 &amp;amp; 1 &amp;amp; 1 &lt;br /&gt;
    \end{array}\right).&lt;br /&gt;
\,\!&amp;lt;/math&amp;gt;|F.6}}&lt;br /&gt;
(See for example [[Bibliography#LoeppWootters|Loepp and Wootters [25]]].)  From this the parity check matrix, &amp;lt;math&amp;gt;P\,\!&amp;lt;/math&amp;gt; can be calculated (as stated above) by finding a set of &amp;lt;math&amp;gt;n-k\,\!&amp;lt;/math&amp;gt; mutually orthogonal vectors that are also orthogonal to the code space defined by the generator matrix.  Alternatively, one could use the method in Steane's article in [[Bibliography#LoPopescuSpiller|Lo, Popescu, and Spiller [26]]].  Put &amp;lt;math&amp;gt;G^T\,\!&amp;lt;/math&amp;gt; in the form &amp;lt;math&amp;gt;(I_k|A),\,\!&amp;lt;/math&amp;gt; where &amp;lt;math&amp;gt;I_k\,\!&amp;lt;/math&amp;gt; is the &amp;lt;math&amp;gt;k\times k\,\!&amp;lt;/math&amp;gt; identity matrix.  Then the parity check matrix is &amp;lt;math&amp;gt;P = (A^T|I_{n-k}).\,\!&amp;lt;/math&amp;gt;  In either case, one can arrive at the following parity check matrix for this code:&lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt;&lt;br /&gt;
P = \left(\begin{array}{ccccccc}&lt;br /&gt;
          1 &amp;amp; 1 &amp;amp; 1 &amp;amp; 0 &amp;amp; 1 &amp;amp; 0 &amp;amp; 0 \\&lt;br /&gt;
          1 &amp;amp; 1 &amp;amp; 0 &amp;amp; 1 &amp;amp; 0 &amp;amp; 1 &amp;amp; 0 \\&lt;br /&gt;
          0 &amp;amp; 1 &amp;amp; 1 &amp;amp; 1 &amp;amp; 0 &amp;amp; 0 &amp;amp; 1 &lt;br /&gt;
    \end{array}\right).&lt;br /&gt;
\,\!&amp;lt;/math&amp;gt;|F.7}}&lt;br /&gt;
It is useful to note that the code can also be defined by the parity check matrix.  Only the codewords are annihilated by the parity check matrix.&lt;br /&gt;
&lt;br /&gt;
===The Disjointness Condition and Correcting Errors===&lt;br /&gt;
&lt;br /&gt;
The motivation for the disjointness condition, [[#eqF.5|Eq.(F.5)]], is to associate each vector in the space with a particular code word.  That is, assuming that only certain errors occur, each error vector should be associated to a particular vector in the code space when the error is added to the original code word.  This partitions the set into disjoint subsets, with each containing only one code vector.  A message is decoded correctly if the vector (the one containing the error) is in the subset that is associated with the original vector (the one with no error).  For example, if one vector is sent, say &amp;lt;math&amp;gt; v_1 \,\!&amp;lt;/math&amp;gt;, and an error occurs during transmission to produce &amp;lt;math&amp;gt; v_2 = v_1 +e\,\!&amp;lt;/math&amp;gt;, then this vector must be in the subset containing &amp;lt;math&amp;gt; v_1 \,\!&amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
A way to decode is to record an array of possible code words, possible errors, and the combinations of those errors and code words.  The array can be set up as a top row of the code word vectors and a leftmost column of errors, with the element of the first row and the first column being the zero vector and all subsequent entries in the column being errors.  Then the element at the top of a column (say the jth column) is added to the error in the corresponding row (say the kth row) to get the j,k entry of the array.  With this array one can associate a column with a subset that is disjoint with the other sets.  Identifying the erred code word in a column associates it with a code word and thus corrects the error.&lt;br /&gt;
&lt;br /&gt;
====Example 4====&lt;br /&gt;
&lt;br /&gt;
In this example we are going to use &amp;lt;math&amp;gt;G\,\!&amp;lt;/math&amp;gt;  [[#eqF.6| (F.6)]] and &amp;lt;math&amp;gt;P\,\!&amp;lt;/math&amp;gt;  [[#eqF.7| (F.7)]] from the example above.&lt;br /&gt;
&lt;br /&gt;
The set of code words is given by all of the linear combinations of the rows of &amp;lt;math&amp;gt;P,\,\!&amp;lt;/math&amp;gt; meaning there are &amp;lt;math&amp;gt;2^3\,\!&amp;lt;/math&amp;gt; code words. The set of code words, &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C = \left\{0000000, 1110100, 1101010, 0111001, 0100111, 1010011, 0011110, 1001101\right\}.\,\!&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;div id=&amp;quot;TableF.1&amp;quot;&amp;gt;&amp;lt;big&amp;gt;'''TABLE F.1'''&amp;lt;/big&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;10&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |Table F.1: ''Array to determine possible errors on an unknown code word in set &amp;lt;math&amp;gt;C\,\!&amp;lt;/math&amp;gt;''&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;math&amp;gt;0000000\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;1110100\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;1101010\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;0111001\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;0100111\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;1010011\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;0011110\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;1001101\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;math&amp;gt;1000000\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;0110100\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;0101010\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;1111001\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;1100111\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;0010011\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;1011110\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;0001101\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;math&amp;gt;0100000\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;1010100\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;1001010\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;0011001\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;0000111\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;1110011\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;0111110\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;1101101\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;math&amp;gt;0010000\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;1100100\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;1111010\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;0101001\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;0110111\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;1000011\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;0001110\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;1011101\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;math&amp;gt;0001000\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;1111100\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;1100010\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;0110001\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;0101111\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;1011011\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;0010110\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;1000101\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;math&amp;gt;0000100\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;1110000\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;1101110\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;0111101\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;0100011\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;1010111\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;0011010\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;1001001\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;math&amp;gt;0000010\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;1110110\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;1101000\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;0111011\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;0100101\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;1010001\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;0011100\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;1001111\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;math&amp;gt;0000001\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;1110101\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;1101011\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;0111000\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;0100110\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;1010010\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;0011111\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;1001100\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, suppose you are expecting to receive a code word, &amp;lt;math&amp;gt;c\in C.\,\!&amp;lt;/math&amp;gt;  But, instead you receive &amp;lt;math&amp;gt;0101111\notin C.\,\!&amp;lt;/math&amp;gt;  What we are able to do is look at Table F.1 and see that &amp;lt;math&amp;gt;0101111\,\!&amp;lt;/math&amp;gt; is in column 5.  Since the columns of this table represent the disjoint subsets of our code space, we see that &amp;lt;math&amp;gt;c = 0100111\,\!&amp;lt;/math&amp;gt; and the error that occurred was &amp;lt;math&amp;gt;e_{4}\,\!&amp;lt;/math&amp;gt; or &amp;lt;math&amp;gt;0001000.\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===The Hamming Bound===&lt;br /&gt;
&lt;br /&gt;
The Hamming bound is a bound that restricts the rate of the code.  Due to the disjointness condition, a certain number of bits are required to ensure our ability to detect and correct errors.  Suppose there is a set of &amp;lt;math&amp;gt; n\,\!&amp;lt;/math&amp;gt; bit vectors for encoding &amp;lt;math&amp;gt; k\,\!&amp;lt;/math&amp;gt; bits of information.  There is a set of error vectors of weight &amp;lt;math&amp;gt; t \,\!&amp;lt;/math&amp;gt; that has &amp;lt;math&amp;gt; C(n,t)\,\!&amp;lt;/math&amp;gt; elements&amp;lt;ref&amp;gt;That is, &amp;lt;math&amp;gt; n \,\!&amp;lt;/math&amp;gt; choose &amp;lt;math&amp;gt; t \,\!&amp;lt;/math&amp;gt; vectors. The notation is &amp;lt;math&amp;gt; C(n,t) = {n\choose t} = \frac{n!}{(n-t)!t!}.\,\!&amp;lt;/math&amp;gt;&amp;lt;/ref&amp;gt;.  So the number of error vectors, including errors of weight up to &amp;lt;math&amp;gt; t \,\!&amp;lt;/math&amp;gt;, is &lt;br /&gt;
&amp;lt;math&amp;gt; \sum_{i=0}^t C(n,i). \,\!&amp;lt;/math&amp;gt;  (Note that no error is also part of the set of error vectors.  The objective is to be able to design a code that can correct all errors up to those of weight &amp;lt;math&amp;gt; t \,\!&amp;lt;/math&amp;gt;, and this includes no error at all.)  Since there are &amp;lt;math&amp;gt; 2^n\,\!&amp;lt;/math&amp;gt; vectors in the whole space of &amp;lt;math&amp;gt; n\,\!&amp;lt;/math&amp;gt; bits, and assuming &amp;lt;math&amp;gt; m\,\!&amp;lt;/math&amp;gt; vectors are used for the encoding, the Hamming bound is&lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt; &lt;br /&gt;
m\sum_{i=0}^t C(n,i) \leq 2^n.&lt;br /&gt;
\,\!&amp;lt;/math&amp;gt;|F.8}}&lt;br /&gt;
For linear codes, &amp;lt;math&amp;gt; m=2^k,\,\!&amp;lt;/math&amp;gt; so &lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt; &lt;br /&gt;
2^k\sum_{i=0}^t C(n,i) \leq 2^n.&lt;br /&gt;
\,\!&amp;lt;/math&amp;gt;|F.9}}&lt;br /&gt;
Taking the logarithm, &lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt; &lt;br /&gt;
k \leq n - \log_2\left(\sum_{i=0}^t C(n,i)\right).&lt;br /&gt;
\,\!&amp;lt;/math&amp;gt;|F.10}}&lt;br /&gt;
For large &amp;lt;math&amp;gt; n, k \,\!&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; t \,\!&amp;lt;/math&amp;gt;, we can use [[#LoPopescueSpiller|Stirling's formula]] to show that &lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt; &lt;br /&gt;
\frac{k}{n} \leq 1 - H\left(\frac{t}{n}\right),&lt;br /&gt;
\,\!&amp;lt;/math&amp;gt;|F.11}}&lt;br /&gt;
where &amp;lt;math&amp;gt; H(x) = -x\log x -(1-x)\log (1-x) \,\!&amp;lt;/math&amp;gt; and we have neglected an overall multiplicative constant that goes to 1 as  &amp;lt;math&amp;gt; n\rightarrow \infty. \,\!&amp;lt;/math&amp;gt;  (Again, see the article in [[Bibliography#LoPopescueSpiller|Lo, Popescu, and Spiller [26]]] by Steane.)&lt;br /&gt;
&lt;br /&gt;
===More Definitions===&lt;br /&gt;
&lt;br /&gt;
====Definition 8: Dual Code====&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt;\mathcal{C}\,\!&amp;lt;/math&amp;gt; be a code and let &amp;lt;math&amp;gt;v\,\!&amp;lt;/math&amp;gt; be a vector in the code space.  The '''dual code''', denoted &amp;lt;math&amp;gt;\mathcal{C}^\perp\,\!&amp;lt;/math&amp;gt;, is the set of all vectors that have zero inner product with all &amp;lt;math&amp;gt;v\in \mathcal{C}\,\!&amp;lt;/math&amp;gt;.  In other words, it is the set of all vectors &amp;lt;math&amp;gt;u\,\!&amp;lt;/math&amp;gt; such that &amp;lt;math&amp;gt;u\cdot v = 0\,\!&amp;lt;/math&amp;gt; for all  &amp;lt;math&amp;gt;v\in \mathcal{C}\,\!&amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
For binary vectors, a vector can be orthogonal to itself.  Note that this is different from ordinary vectors in 3-d space.  &lt;br /&gt;
&lt;br /&gt;
The dual code is a useful entity in classical error correction and will be used in the construction of the quantum error correcting codes known as [[Chapter 7 - Quantum Error Correcting Codes#CSS codes|CSS codes]].&lt;br /&gt;
&lt;br /&gt;
===Final Comments===&lt;br /&gt;
&lt;br /&gt;
As can be seen from the Hamming bound, there is a limit to the rate of an error correcting code.  This does not indicate whether or not codes that satisfy these bounds exist, but it does tell us that no codes exist that do not satisfy these bounds.  Encoding, decoding, error detection and correction are all difficult problems to solve in general.  One of the advantages of the linear codes is that they provide a systematic method for identifying errors on a code through the use of the parity check operation.  More generally, checking to see whether or not a bit string (vector) is in the code space would require a look-up table.  This would be much more time-consuming than using the parity check matrix; matrix multiplication is quite efficient relative to the look-up table.  &lt;br /&gt;
&lt;br /&gt;
Many of these ideas and definitions will be utilized in [[Chapter 7 - Quantum Error Correcting Codes|Chapter 7]] on quantum error correction.  Some linear codes, including the Hamming code above, will have quantum analogues---as do many quantum error correcting codes.  In quantum computers, as will be discussed, error correction is necessary due to the delicacy of quantum information.  Such discussions will be taken up in [[Chapter 7 - Quantum Error Correcting Codes|Chapter 7]].&lt;br /&gt;
&lt;br /&gt;
==Footnotes==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Ddghunter</name></author>
		
	</entry>
	<entry>
		<id>https://www2.physics.siu.edu/qunet/wiki/index.php?title=Appendix_F_-_Classical_Error_Correcting_Codes&amp;diff=2343</id>
		<title>Appendix F - Classical Error Correcting Codes</title>
		<link rel="alternate" type="text/html" href="https://www2.physics.siu.edu/qunet/wiki/index.php?title=Appendix_F_-_Classical_Error_Correcting_Codes&amp;diff=2343"/>
		<updated>2013-03-03T21:19:34Z</updated>

		<summary type="html">&lt;p&gt;Ddghunter: /* More Definitions */ Numbering Correction&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===Introduction===&lt;br /&gt;
&lt;br /&gt;
Classical error correcting codes are in use in a wide variety of digital electronics and other classical information systems.  It is a good idea to learn some of the basic definitions, ideas, methods, and simple examples of classical error correcting codes in order to understand the (slightly) more complicated quantum error correcting codes.  There are many good introductions to classical error correction.  Here we follow a few sources which also discuss quantum error correcting codes: the book by [[Bibliography#LoeppWootters|Loepp and Wootters [25]]], an article in [[Bibliography#LoPopescueSpiller|Lo, Popescu, and Spiller [26]]] by Steane, [[Bibliography#GottDiss|Gottesman's Thesis [27]]], and [[Bibliography#Gaitan:book|Gaitan's Book [3]]] on quantum error correction, which also discusses classical error correction.&lt;br /&gt;
&lt;br /&gt;
===Binary Operations===&lt;br /&gt;
&lt;br /&gt;
The set &amp;lt;math&amp;gt; \{0,1\} \,\!&amp;lt;/math&amp;gt; is a group under addition.  (See [[Appendix D - Group Theory#Example 3|Section D.2.8]] of [[Appendix D - Group Theory|Appendix D]].)  The way this is achieved is by deciding that we will only use these two numbers in our language and using addition modulo 2, meaning &amp;lt;math&amp;gt; 0+0=0, 1+0 = 0+1 = 1, \,\!&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;1+1 =0\,\!&amp;lt;/math&amp;gt;.   If we also include the operation of multiplication and these two operations follow the distributive law, the set becomes a '''field''' (a Galois Field), which is denoted GF&amp;lt;math&amp;gt;(2)\,\!&amp;lt;/math&amp;gt;.  Since one often works with strings of bits, it is very useful to consider the string of bits to be a vector and to use vector addition (which is component-wise addition) and vector multiplication (which is the inner product).  For example, the addition of the vector &amp;lt;math&amp;gt;(0,0,1)\,\!&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;(0,1,1)\,\!&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;(0,0,1) + (0,1,1) = (0,1,0)\,\!&amp;lt;/math&amp;gt;.  The inner product between these two vectors is  &amp;lt;math&amp;gt;(0,0,1) \cdot (0,1,1) = 0\cdot 0 + 0\cdot 1 + 1\cdot 1 = 0 +0 +1=1\,\!&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Definitions and Basics===&lt;br /&gt;
&lt;br /&gt;
====Definition 1====&lt;br /&gt;
The inner product is also called a '''checksum''' or '''parity check''' since it shows whether or not the first and second vectors agree, or have an even number of 1's at the positions specified by the ones in the other vector.  We may say that the first vector satisfies the parity check of the other vector, or vice versa.&lt;br /&gt;
&lt;br /&gt;
====Definition 2====&lt;br /&gt;
The '''weight''' or '''Hamming weight''' is the number of non-zero components of a vector or string.  The weight of a vector &amp;lt;math&amp;gt;v\,\!&amp;lt;/math&amp;gt; is denoted wt(&amp;lt;math&amp;gt;v\,\!&amp;lt;/math&amp;gt;).  &lt;br /&gt;
&lt;br /&gt;
====Definition 3====&lt;br /&gt;
The '''Hamming distance''' is the number of places where two vectors differ.  Let the two vectors be &amp;lt;math&amp;gt;v\,\!&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;w\,\!&amp;lt;/math&amp;gt;.  Then the Hamming distance is also equal to wt(&amp;lt;math&amp;gt;v+w\,\!&amp;lt;/math&amp;gt;).  The Hamming distance between &amp;lt;math&amp;gt;v\,\!&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;w\,\!&amp;lt;/math&amp;gt; will be denoted &amp;lt;math&amp;gt;d_H(v,w)\,\!&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
====Definition 4====&lt;br /&gt;
We use &amp;lt;math&amp;gt;\{0,1\}^n\,\!&amp;lt;/math&amp;gt; to denote the set of all binary vectors of length &amp;lt;math&amp;gt;n\,\!&amp;lt;/math&amp;gt;.  A '''code''' &amp;lt;math&amp;gt;C\,\!&amp;lt;/math&amp;gt; of length &amp;lt;math&amp;gt;n\,\!&amp;lt;/math&amp;gt; is any subset of that set.  The set of all elements of &amp;lt;math&amp;gt;C\,\!&amp;lt;/math&amp;gt; is called the set of '''codewords'''.  We also say there are &amp;lt;math&amp;gt;2^n\,\!&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;n\,\!&amp;lt;/math&amp;gt;-bit words in the space.  &lt;br /&gt;
&lt;br /&gt;
Suppose &amp;lt;math&amp;gt;n\,\!&amp;lt;/math&amp;gt; bits are used to encode &amp;lt;math&amp;gt;k\,\!&amp;lt;/math&amp;gt; logical bits.  We use the notation &amp;lt;math&amp;gt;[n,k] \,\!&amp;lt;/math&amp;gt; do denote such a code.&lt;br /&gt;
&lt;br /&gt;
====Definition 5====&lt;br /&gt;
The '''minimum distance''' of a code is the smallest Hamming distance between any two non-equal vectors in a code.  This can be written &lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt;&lt;br /&gt;
d_{Hmin}(C) = \underset{v,w\in C,v\neq w}{\mbox{min}}d_H(v,w).&lt;br /&gt;
 \,\!&amp;lt;/math&amp;gt;|F.1}}&lt;br /&gt;
For shorthand, we also use &amp;lt;math&amp;gt; d(C)\,\!&amp;lt;/math&amp;gt; or &amp;lt;math&amp;gt; d\,\!&amp;lt;/math&amp;gt; if &amp;lt;math&amp;gt; C\,\!&amp;lt;/math&amp;gt; is understood.&lt;br /&gt;
&lt;br /&gt;
When that code has a distance &amp;lt;math&amp;gt;d\,\!&amp;lt;/math&amp;gt;, the notation &amp;lt;math&amp;gt;[n,k,d] \,\!&amp;lt;/math&amp;gt; is used.&lt;br /&gt;
&lt;br /&gt;
====Example 1====&lt;br /&gt;
It is interesting to note that if we encode redundantly using &amp;lt;math&amp;gt; 0_L=00 \,\!&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;1_L=11\,\!&amp;lt;/math&amp;gt; as our logical zero and logical one respectively, then we could detect single bit errors but not correct them.  For example, if we receive &amp;lt;math&amp;gt; 01\,\!&amp;lt;/math&amp;gt;, we know this cannot be one of our encoded states.  So an error must have occurred.  However, we don't know whether the sender sent &amp;lt;math&amp;gt; 0_L=00 \,\!&amp;lt;/math&amp;gt; or &amp;lt;math&amp;gt;1_L=11\,\!&amp;lt;/math&amp;gt;.  We do know that an error has occurred though, as long as we know only one error has occurred.  Such an encoding can be used as an '''error detecting code'''.  In this case there are two code words, &amp;lt;math&amp;gt; 0_L=00 \,\!&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;1_L=11\,\!&amp;lt;/math&amp;gt;, but four words in the space.  The minimum distance is 2, which is the distance between the two code words.&lt;br /&gt;
&lt;br /&gt;
====Example 2====&lt;br /&gt;
The three-bit redundant encoding was already given in [[Chapter 7 - Quantum Error Correcting Codes|Chapter 7]].  One takes logical zero and logical one states to be&lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt; &lt;br /&gt;
0_L =  000 \;\;\; \mbox{ and } \;\;\; 1_L = 111,&lt;br /&gt;
\,\!&amp;lt;/math&amp;gt;|F.2}}&lt;br /&gt;
where the subscript &amp;lt;math&amp;gt;L \,\!&amp;lt;/math&amp;gt; is used to denote a &amp;quot;logical&amp;quot; state; that is, one that is encoded.  Recall that this code is able to detect and correct one error.  In this case there are two code words out of eight possible words, and the minimal distance is 3.&lt;br /&gt;
&lt;br /&gt;
====Definition 6====&lt;br /&gt;
The '''rate''' of a code is given by the ration of the number of logical bits to the number of bits, &amp;lt;math&amp;gt;k/n\,\!&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
====Definition 7====&lt;br /&gt;
A '''linear code''' &amp;lt;math&amp;gt;C_l\,\!&amp;lt;/math&amp;gt; is a code that is closed under addition.&lt;br /&gt;
&lt;br /&gt;
===Linear Codes===&lt;br /&gt;
&lt;br /&gt;
Linear codes are particularly useful because they are able to efficiently identify errors and the associated correct codewords.  This ability is due to the added structure these codes have.  These will be discussed in the following sections. &lt;br /&gt;
&lt;br /&gt;
====Generator Matrix====&lt;br /&gt;
&lt;br /&gt;
For linear codes, any linear combination of codewords is a codeword.  One key feature of a linear code is that it can be specified by a &amp;lt;nowiki&amp;gt;''generator matrix,''&amp;lt;/nowiki&amp;gt; &amp;lt;math&amp;gt;G\,\!&amp;lt;/math&amp;gt;&amp;lt;ref&amp;gt;Recall that we are working with binary codes.  Thus the entries of the matrix will also be binary numbers, i.e., 0's and 1's.&amp;lt;/ref&amp;gt;. For an &amp;lt;math&amp;gt; [n,k]\,\!&amp;lt;/math&amp;gt; code, the '''generator matrix''' is an &amp;lt;math&amp;gt; n\times k\,\!&amp;lt;/math&amp;gt; matrix with columns that form a basis for the &amp;lt;math&amp;gt;k\,\!&amp;lt;/math&amp;gt;-dimensional coding sub-space of the &amp;lt;math&amp;gt;n\,\!&amp;lt;/math&amp;gt;-dimensional binary vector space.  In other words, the vectors comprising the rows form a basis that will span the code space.  (Note that one may also use the transpose of this matrix as the definition for &amp;lt;math&amp;gt;G\,\!&amp;lt;/math&amp;gt;.)  Any code word &amp;lt;math&amp;gt;w\,\!&amp;lt;/math&amp;gt; described by a vector &amp;lt;math&amp;gt;v\,\!&amp;lt;/math&amp;gt; can be written in terms of the generator matrix as &amp;lt;math&amp;gt;w = Gv\,\!&amp;lt;/math&amp;gt;.  Note that &amp;lt;math&amp;gt;G\,\!&amp;lt;/math&amp;gt; is independent of the input and output vectors.  In addition, &amp;lt;math&amp;gt;G\,\!&amp;lt;/math&amp;gt; is not unique.  If columns are switched or even added to produce a new vector that replaces a column, then the generator matrix is still valid for the code.  This is due to the requirement that the columns be linearly independent, which is still satisfied if these operations are performed.&lt;br /&gt;
&lt;br /&gt;
====Parity Check Matrix====&lt;br /&gt;
Once &amp;lt;math&amp;gt;G\,\!&amp;lt;/math&amp;gt; is obtained, one can calculate another useful matrix, &amp;lt;math&amp;gt;P.\,\!&amp;lt;/math&amp;gt;  &amp;lt;math&amp;gt;P\,\!&amp;lt;/math&amp;gt; is an &amp;lt;math&amp;gt;(n- k)\times n\,\!&amp;lt;/math&amp;gt; matrix which has the property that&lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt;&lt;br /&gt;
PG = 0.&lt;br /&gt;
\,\!&amp;lt;/math&amp;gt;|F.3}}&lt;br /&gt;
The matrix &amp;lt;math&amp;gt;P\,\!&amp;lt;/math&amp;gt; is called the '''parity check matrix''' or '''dual matrix'''.  The rank of &amp;lt;math&amp;gt;P\,\!&amp;lt;/math&amp;gt; is at most  &amp;lt;math&amp;gt;n- k\,\!&amp;lt;/math&amp;gt; and has the property that it annihilates any code word.  To see this, recall any code word is written as &amp;lt;math&amp;gt;Gv\,\!&amp;lt;/math&amp;gt;: &amp;lt;math&amp;gt;PGv =0\,\!&amp;lt;/math&amp;gt; since &amp;lt;math&amp;gt;PG =0.\,\!&amp;lt;/math&amp;gt;  Also, due to the rank of &amp;lt;math&amp;gt;P,\,\!&amp;lt;/math&amp;gt; it can be shown that &amp;lt;math&amp;gt;Pw =0\,\!&amp;lt;/math&amp;gt; only if &amp;lt;math&amp;gt;w\,\!&amp;lt;/math&amp;gt; is a code word.  That is to say, &amp;lt;math&amp;gt;Pw=0\,\!&amp;lt;/math&amp;gt; if and only if &amp;lt;math&amp;gt;w\,\!&amp;lt;/math&amp;gt; is a code word.  This means that &amp;lt;math&amp;gt;P\,\!&amp;lt;/math&amp;gt; can be used to test whether or not a word is in the code. &lt;br /&gt;
&lt;br /&gt;
Suppose an error occurs on a code word &amp;lt;math&amp;gt;w\,\!&amp;lt;/math&amp;gt; to produce &amp;lt;math&amp;gt;w^\prime = w + e\,\!&amp;lt;/math&amp;gt;.  It follows that&lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt;&lt;br /&gt;
Pw^\prime = P(w+e) = Pe,&lt;br /&gt;
\,\!&amp;lt;/math&amp;gt;|F.4}}&lt;br /&gt;
since &amp;lt;math&amp;gt;Pw=0\,\!&amp;lt;/math&amp;gt;.  This result, &amp;lt;math&amp;gt;Pe\,\!&amp;lt;/math&amp;gt; is called the '''error syndrome''' and the measurement to identify &amp;lt;math&amp;gt;Pe\,\!&amp;lt;/math&amp;gt; is the '''syndrome measurement'''.  Therefore, the result depends only on the error and not on the original code word.  If the error can be determined from this result, then it can be corrected independent of the code word.  However, in order to have &amp;lt;math&amp;gt;Pe\,\!&amp;lt;/math&amp;gt; be unique, two different results, &amp;lt;math&amp;gt;Pe_1\,\!&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;Pe_2\,\!&amp;lt;/math&amp;gt;, must not be equal.  This is possible if a distance &amp;lt;math&amp;gt;d\,\!&amp;lt;/math&amp;gt; code is constructed such that the parity check matrix has &amp;lt;math&amp;gt;d-1=2t\,\!&amp;lt;/math&amp;gt; linearly independent columns.  This enables the errors to be identified and corrected.&lt;br /&gt;
&lt;br /&gt;
It is important to emphasize that these two matrices define the code as well as the check and necessary recovery operations.  The matrix &amp;lt;math&amp;gt;G\,\!&amp;lt;/math&amp;gt; is determined by the code.  Once this matrix is determined, there is a method for determining the parity check matrix, &amp;lt;math&amp;gt;P\,\!&amp;lt;/math&amp;gt; which is a set of &amp;lt;math&amp;gt;n-k\,\!&amp;lt;/math&amp;gt; mutually orthogonal vectors that are also orthogonal to the code space defined by the generator matrix.  It is possible to determine the parity matrix from the generator matrix.  The method for doing this can be found in Steane's article in [[Bibliography#LoPopescuSpiller|Lo, Popescu, and Spiller [26]]] and it goes as follows.  One first puts &amp;lt;math&amp;gt;G^T\,\!&amp;lt;/math&amp;gt; in the form of an augmented matrix &amp;lt;math&amp;gt;(I_k|A),\,\!&amp;lt;/math&amp;gt; where &amp;lt;math&amp;gt;I_k\,\!&amp;lt;/math&amp;gt; is the &amp;lt;math&amp;gt;k\times k\,\!&amp;lt;/math&amp;gt; identity matrix.  Then the parity check matrix is &amp;lt;math&amp;gt;P = (A^T|I_{n-k}).\,\!&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Errors===&lt;br /&gt;
&lt;br /&gt;
For any classical error correcting code, there are general conditions that must be satisfied in order for the code to be able to detect and correct errors.  The two examples above show how the error can be detected; here, the objective is to give some general conditions.  &lt;br /&gt;
&lt;br /&gt;
Note that any state containing an error may be written as the sum of the original (logical or encoded) state  &amp;lt;math&amp;gt;w \,\!&amp;lt;/math&amp;gt; and another vector &amp;lt;math&amp;gt;e \,\!&amp;lt;/math&amp;gt;.  The error vector &amp;lt;math&amp;gt;e \,\!&amp;lt;/math&amp;gt; has ones in the places where errors are present and zeroes everywhere else.  To ensure that the error may be corrected, the following condition must be satisfied for two states with errors occurring:&lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt;&lt;br /&gt;
w_1 + e_1 \neq w_2 + e_2.&lt;br /&gt;
\,\!&amp;lt;/math&amp;gt;|F.5}}&lt;br /&gt;
This condition is called the '''disjointness condition'''.  This condition means that an error on one state cannot be confused with an error on another state.  If it could, then the state including the error could not be uniquely identified with an encoded state and the state could not be corrected to its original state after the error occurred.  More specifically, for a code to correct &amp;lt;math&amp;gt;t\,\!&amp;lt;/math&amp;gt;  single-bit errors, it must have distance at least &amp;lt;math&amp;gt;2t + 1 \,\!&amp;lt;/math&amp;gt; between any two codewords; i.e., it must be true that &amp;lt;math&amp;gt;d(C) \geq 2t + 1 \,\!&amp;lt;/math&amp;gt;.  An &amp;lt;math&amp;gt;[n,k]\,\!&amp;lt;/math&amp;gt; code with minimal distance &amp;lt;math&amp;gt;d \,\!&amp;lt;/math&amp;gt; is denoted &amp;lt;math&amp;gt;[n,k,d]\,\!&amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Example 3====&lt;br /&gt;
An important example of an error correcting code is called the &amp;lt;math&amp;gt;[7,4,3]&amp;lt;/math&amp;gt; Hamming code.  This code, as the notation indicates, encodes &amp;lt;math&amp;gt;k=4&amp;lt;/math&amp;gt; bits of information into &amp;lt;math&amp;gt;n=7&amp;lt;/math&amp;gt; bits.  It also does it in such a way that one error can be detected and corrected since it has a distance of &amp;lt;math&amp;gt;3&amp;lt;/math&amp;gt;.  The generator matrix for this code can be taken to be &lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt;&lt;br /&gt;
G^T = \left(\begin{array}{ccccccc}&lt;br /&gt;
          1 &amp;amp; 0 &amp;amp; 0 &amp;amp; 0 &amp;amp; 1 &amp;amp; 1 &amp;amp; 0 \\&lt;br /&gt;
          0 &amp;amp; 1 &amp;amp; 0 &amp;amp; 0 &amp;amp; 1 &amp;amp; 1 &amp;amp; 1 \\&lt;br /&gt;
          0 &amp;amp; 0 &amp;amp; 1 &amp;amp; 0 &amp;amp; 1 &amp;amp; 0 &amp;amp; 1 \\&lt;br /&gt;
          0 &amp;amp; 0 &amp;amp; 0 &amp;amp; 1 &amp;amp; 0 &amp;amp; 1 &amp;amp; 1 &lt;br /&gt;
    \end{array}\right).&lt;br /&gt;
\,\!&amp;lt;/math&amp;gt;|F.6}}&lt;br /&gt;
(See for example [[Bibliography#LoeppWootters|Loepp and Wootters [25]]].)  From this the parity check matrix, &amp;lt;math&amp;gt;P\,\!&amp;lt;/math&amp;gt; can be calculated (as stated above) by finding a set of &amp;lt;math&amp;gt;n-k\,\!&amp;lt;/math&amp;gt; mutually orthogonal vectors that are also orthogonal to the code space defined by the generator matrix.  Alternatively, one could use the method in Steane's article in [[Bibliography#LoPopescuSpiller|Lo, Popescu, and Spiller [26]]].  Put &amp;lt;math&amp;gt;G^T\,\!&amp;lt;/math&amp;gt; in the form &amp;lt;math&amp;gt;(I_k|A),\,\!&amp;lt;/math&amp;gt; where &amp;lt;math&amp;gt;I_k\,\!&amp;lt;/math&amp;gt; is the &amp;lt;math&amp;gt;k\times k\,\!&amp;lt;/math&amp;gt; identity matrix.  Then the parity check matrix is &amp;lt;math&amp;gt;P = (A^T|I_{n-k}).\,\!&amp;lt;/math&amp;gt;  In either case, one can arrive at the following parity check matrix for this code:&lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt;&lt;br /&gt;
P = \left(\begin{array}{ccccccc}&lt;br /&gt;
          1 &amp;amp; 1 &amp;amp; 1 &amp;amp; 0 &amp;amp; 1 &amp;amp; 0 &amp;amp; 0 \\&lt;br /&gt;
          1 &amp;amp; 1 &amp;amp; 0 &amp;amp; 1 &amp;amp; 0 &amp;amp; 1 &amp;amp; 0 \\&lt;br /&gt;
          0 &amp;amp; 1 &amp;amp; 1 &amp;amp; 1 &amp;amp; 0 &amp;amp; 0 &amp;amp; 1 &lt;br /&gt;
    \end{array}\right).&lt;br /&gt;
\,\!&amp;lt;/math&amp;gt;|F.7}}&lt;br /&gt;
It is useful to note that the code can also be defined by the parity check matrix.  Only the codewords are annihilated by the parity check matrix.&lt;br /&gt;
&lt;br /&gt;
===The Disjointness Condition and Correcting Errors===&lt;br /&gt;
&lt;br /&gt;
The motivation for the disjointness condition, [[#eqF.5|Eq.(F.5)]], is to associate each vector in the space with a particular code word.  That is, assuming that only certain errors occur, each error vector should be associated to a particular vector in the code space when the error is added to the original code word.  This partitions the set into disjoint subsets, with each containing only one code vector.  A message is decoded correctly if the vector (the one containing the error) is in the subset that is associated with the original vector (the one with no error).  For example, if one vector is sent, say &amp;lt;math&amp;gt; v_1 \,\!&amp;lt;/math&amp;gt;, and an error occurs during transmission to produce &amp;lt;math&amp;gt; v_2 = v_1 +e\,\!&amp;lt;/math&amp;gt;, then this vector must be in the subset containing &amp;lt;math&amp;gt; v_1 \,\!&amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
A way to decode is to record an array of possible code words, possible errors, and the combinations of those errors and code words.  The array can be set up as a top row of the code word vectors and a leftmost column of errors, with the element of the first row and the first column being the zero vector and all subsequent entries in the column being errors.  Then the element at the top of a column (say the jth column) is added to the error in the corresponding row (say the kth row) to get the j,k entry of the array.  With this array one can associate a column with a subset that is disjoint with the other sets.  Identifying the erred code word in a column associates it with a code word and thus corrects the error.&lt;br /&gt;
&lt;br /&gt;
====Example 4====&lt;br /&gt;
&lt;br /&gt;
In this example we are going to use &amp;lt;math&amp;gt;G\,\!&amp;lt;/math&amp;gt;  [[#eqF.6| (F.6)]] and &amp;lt;math&amp;gt;P\,\!&amp;lt;/math&amp;gt;  [[#eqF.7| (F.7)]] from the example above.&lt;br /&gt;
&lt;br /&gt;
The set of code words is given by all of the linear combinations of the rows of &amp;lt;math&amp;gt;P,\,\!&amp;lt;/math&amp;gt; meaning there are &amp;lt;math&amp;gt;2^3\,\!&amp;lt;/math&amp;gt; code words. The set of code words, &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C = \left\{0000000, 1110100, 1101010, 0111001, 0100111, 1010011, 0011110, 1001101\right\}.\,\!&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;div id=&amp;quot;TableF.1&amp;quot;&amp;gt;&amp;lt;big&amp;gt;'''TABLE F.1'''&amp;lt;/big&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;10&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |Table F.1: ''Array to determine possible errors on an unknown code word in set &amp;lt;math&amp;gt;C\,\!&amp;lt;/math&amp;gt;''&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;math&amp;gt;0000000\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;1110100\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;1101010\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;0111001\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;0100111\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;1010011\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;0011110\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;1001101\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;math&amp;gt;1000000\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;0110100\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;0101010\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;1111001\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;1100111\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;0010011\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;1011110\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;0001101\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;math&amp;gt;0100000\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;1010100\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;1001010\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;0011001\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;0000111\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;1110011\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;0111110\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;1101101\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;math&amp;gt;0010000\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;1100100\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;1111010\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;0101001\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;0110111\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;1000011\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;0001110\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;1011101\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;math&amp;gt;0001000\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;1111100\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;1100010\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;0110001\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;0101111\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;1011011\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;0010110\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;1000101\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;math&amp;gt;0000100\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;1110000\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;1101110\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;0111101\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;0100011\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;1010111\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;0011010\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;1001001\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;math&amp;gt;0000010\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;1110110\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;1101000\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;0111011\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;0100101\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;1010001\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;0011100\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;1001111\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;math&amp;gt;0000001\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;1110101\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;1101011\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;0111000\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;0100110\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;1010010\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;0011111\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;1001100\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, suppose you are expecting to receive a code word, &amp;lt;math&amp;gt;c\in C.\,\!&amp;lt;/math&amp;gt;  But, instead you receive &amp;lt;math&amp;gt;0101111\notin C.\,\!&amp;lt;/math&amp;gt;  What we are able to do is look at Table F.1 and see that &amp;lt;math&amp;gt;0101111\,\!&amp;lt;/math&amp;gt; is in column 5.  Since the columns of this table represent the disjoint subsets of our code space, we see that &amp;lt;math&amp;gt;c = 0100111\,\!&amp;lt;/math&amp;gt; and the error that occurred was &amp;lt;math&amp;gt;e_{4}\,\!&amp;lt;/math&amp;gt; or &amp;lt;math&amp;gt;0001000.\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===The Hamming Bound===&lt;br /&gt;
&lt;br /&gt;
The Hamming bound is a bound that restricts the rate of the code.  Due to the disjointness condition, a certain number of bits are required to ensure our ability to detect and correct errors.  Suppose there is a set of &amp;lt;math&amp;gt; n\,\!&amp;lt;/math&amp;gt; bit vectors for encoding &amp;lt;math&amp;gt; k\,\!&amp;lt;/math&amp;gt; bits of information.  There is a set of error vectors of weight &amp;lt;math&amp;gt; t \,\!&amp;lt;/math&amp;gt; that has &amp;lt;math&amp;gt; C(n,t)\,\!&amp;lt;/math&amp;gt; elements&amp;lt;ref&amp;gt;That is, &amp;lt;math&amp;gt; n \,\!&amp;lt;/math&amp;gt; choose &amp;lt;math&amp;gt; t \,\!&amp;lt;/math&amp;gt; vectors. The notation is &amp;lt;math&amp;gt; C(n,t) = {n\choose t} = \frac{n!}{(n-t)!t!}.\,\!&amp;lt;/math&amp;gt;&amp;lt;/ref&amp;gt;.  So the number of error vectors, including errors of weight up to &amp;lt;math&amp;gt; t \,\!&amp;lt;/math&amp;gt;, is &lt;br /&gt;
&amp;lt;math&amp;gt; \sum_{i=0}^t C(n,i). \,\!&amp;lt;/math&amp;gt;  (Note that no error is also part of the set of error vectors.  The objective is to be able to design a code that can correct all errors up to those of weight &amp;lt;math&amp;gt; t \,\!&amp;lt;/math&amp;gt;, and this includes no error at all.)  Since there are &amp;lt;math&amp;gt; 2^n\,\!&amp;lt;/math&amp;gt; vectors in the whole space of &amp;lt;math&amp;gt; n\,\!&amp;lt;/math&amp;gt; bits, and assuming &amp;lt;math&amp;gt; m\,\!&amp;lt;/math&amp;gt; vectors are used for the encoding, the Hamming bound is&lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt; &lt;br /&gt;
m\sum_{i=0}^t C(n,i) \leq 2^n.&lt;br /&gt;
\,\!&amp;lt;/math&amp;gt;|F.8}}&lt;br /&gt;
For linear codes, &amp;lt;math&amp;gt; m=2^k,\,\!&amp;lt;/math&amp;gt; so &lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt; &lt;br /&gt;
2^k\sum_{i=0}^t C(n,i) \leq 2^n.&lt;br /&gt;
\,\!&amp;lt;/math&amp;gt;|F.9}}&lt;br /&gt;
Taking the logarithm, &lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt; &lt;br /&gt;
k \leq n - \log_2\left(\sum_{i=0}^t C(n,i)\right).&lt;br /&gt;
\,\!&amp;lt;/math&amp;gt;|F.10}}&lt;br /&gt;
For large &amp;lt;math&amp;gt; n, k \,\!&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; t \,\!&amp;lt;/math&amp;gt;, we can use [[#LoPopescueSpiller|Stirling's formula]] to show that &lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt; &lt;br /&gt;
\frac{k}{n} \leq 1 - H\left(\frac{t}{n}\right),&lt;br /&gt;
\,\!&amp;lt;/math&amp;gt;|F.11}}&lt;br /&gt;
where &amp;lt;math&amp;gt; H(x) = -x\log x -(1-x)\log (1-x) \,\!&amp;lt;/math&amp;gt; and we have neglected an overall multiplicative constant that goes to 1 as  &amp;lt;math&amp;gt; n\rightarrow \infty. \,\!&amp;lt;/math&amp;gt;  (Again, see the article in [[Bibliography#LoPopescueSpiller|Lo, Popescu, and Spiller [26]]] by Steane.)&lt;br /&gt;
&lt;br /&gt;
===More Definitions===&lt;br /&gt;
&lt;br /&gt;
====Definition 8: Dual Code====&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt;\mathcal{C}\,\!&amp;lt;/math&amp;gt; be a code and let &amp;lt;math&amp;gt;v\,\!&amp;lt;/math&amp;gt; be a vector in the code space.  The '''dual code''', denoted &amp;lt;math&amp;gt;\mathcal{C}^\perp\,\!&amp;lt;/math&amp;gt;, is the set of all vectors that have zero inner product with all &amp;lt;math&amp;gt;v\in \mathcal{C}\,\!&amp;lt;/math&amp;gt;.  In other words, it is the set of all vectors &amp;lt;math&amp;gt;u\,\!&amp;lt;/math&amp;gt; such that &amp;lt;math&amp;gt;u\cdot v = 0\,\!&amp;lt;/math&amp;gt; for all  &amp;lt;math&amp;gt;v\in \mathcal{C}\,\!&amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
For binary vectors, a vector can be orthogonal to itself.  Note that this is different from ordinary vectors in 3-d space.  &lt;br /&gt;
&lt;br /&gt;
The dual code is a useful entity in classical error correction and will be used in the construction of the quantum error correcting codes known as [[Chapter 7 - Quantum Error Correcting Codes#CSS codes|CSS codes]].&lt;br /&gt;
&lt;br /&gt;
===Final Comments===&lt;br /&gt;
&lt;br /&gt;
As can be seen from the Hamming bound, there is a limit to the rate of an error correcting code.  This does not indicate whether or not codes that satisfy these bounds exist, but it does tell us that no codes exist that do not satisfy these bounds.  Encoding, decoding, error detection and correction are all difficult problems to solve in general.  One of the advantages of the linear codes is that they provide a systematic method for identifying errors on a code through the use of the parity check operation.  More generally, checking to see whether or not a bit string (vector) is in the code space would require a look-up table.  This would be much more time-consuming than using the parity check matrix; matrix multiplication is quite efficient relative to the look-up table.  &lt;br /&gt;
&lt;br /&gt;
Many of these ideas and definitions will be utilized in [[Chapter 7 - Quantum Error Correcting Codes|Chapter 7]] on quantum error correction.  Some linear codes, including the Hamming code above, will have quantum analogues---as do many quantum error correcting codes.  In quantum computers, as will be discussed, error correction is necessary due to the delicacy of quantum information.  Such discussions will be taken up in [[Chapter 7 - Quantum Error Correcting Codes|Chapter 7]].&lt;br /&gt;
&lt;br /&gt;
==Footnotes==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Ddghunter</name></author>
		
	</entry>
	<entry>
		<id>https://www2.physics.siu.edu/qunet/wiki/index.php?title=Appendix_F_-_Classical_Error_Correcting_Codes&amp;diff=2342</id>
		<title>Appendix F - Classical Error Correcting Codes</title>
		<link rel="alternate" type="text/html" href="https://www2.physics.siu.edu/qunet/wiki/index.php?title=Appendix_F_-_Classical_Error_Correcting_Codes&amp;diff=2342"/>
		<updated>2013-03-03T21:18:22Z</updated>

		<summary type="html">&lt;p&gt;Ddghunter: /* The Disjointness Condition and Correcting Errors */ Add Example 4&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===Introduction===&lt;br /&gt;
&lt;br /&gt;
Classical error correcting codes are in use in a wide variety of digital electronics and other classical information systems.  It is a good idea to learn some of the basic definitions, ideas, methods, and simple examples of classical error correcting codes in order to understand the (slightly) more complicated quantum error correcting codes.  There are many good introductions to classical error correction.  Here we follow a few sources which also discuss quantum error correcting codes: the book by [[Bibliography#LoeppWootters|Loepp and Wootters [25]]], an article in [[Bibliography#LoPopescueSpiller|Lo, Popescu, and Spiller [26]]] by Steane, [[Bibliography#GottDiss|Gottesman's Thesis [27]]], and [[Bibliography#Gaitan:book|Gaitan's Book [3]]] on quantum error correction, which also discusses classical error correction.&lt;br /&gt;
&lt;br /&gt;
===Binary Operations===&lt;br /&gt;
&lt;br /&gt;
The set &amp;lt;math&amp;gt; \{0,1\} \,\!&amp;lt;/math&amp;gt; is a group under addition.  (See [[Appendix D - Group Theory#Example 3|Section D.2.8]] of [[Appendix D - Group Theory|Appendix D]].)  The way this is achieved is by deciding that we will only use these two numbers in our language and using addition modulo 2, meaning &amp;lt;math&amp;gt; 0+0=0, 1+0 = 0+1 = 1, \,\!&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;1+1 =0\,\!&amp;lt;/math&amp;gt;.   If we also include the operation of multiplication and these two operations follow the distributive law, the set becomes a '''field''' (a Galois Field), which is denoted GF&amp;lt;math&amp;gt;(2)\,\!&amp;lt;/math&amp;gt;.  Since one often works with strings of bits, it is very useful to consider the string of bits to be a vector and to use vector addition (which is component-wise addition) and vector multiplication (which is the inner product).  For example, the addition of the vector &amp;lt;math&amp;gt;(0,0,1)\,\!&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;(0,1,1)\,\!&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;(0,0,1) + (0,1,1) = (0,1,0)\,\!&amp;lt;/math&amp;gt;.  The inner product between these two vectors is  &amp;lt;math&amp;gt;(0,0,1) \cdot (0,1,1) = 0\cdot 0 + 0\cdot 1 + 1\cdot 1 = 0 +0 +1=1\,\!&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Definitions and Basics===&lt;br /&gt;
&lt;br /&gt;
====Definition 1====&lt;br /&gt;
The inner product is also called a '''checksum''' or '''parity check''' since it shows whether or not the first and second vectors agree, or have an even number of 1's at the positions specified by the ones in the other vector.  We may say that the first vector satisfies the parity check of the other vector, or vice versa.&lt;br /&gt;
&lt;br /&gt;
====Definition 2====&lt;br /&gt;
The '''weight''' or '''Hamming weight''' is the number of non-zero components of a vector or string.  The weight of a vector &amp;lt;math&amp;gt;v\,\!&amp;lt;/math&amp;gt; is denoted wt(&amp;lt;math&amp;gt;v\,\!&amp;lt;/math&amp;gt;).  &lt;br /&gt;
&lt;br /&gt;
====Definition 3====&lt;br /&gt;
The '''Hamming distance''' is the number of places where two vectors differ.  Let the two vectors be &amp;lt;math&amp;gt;v\,\!&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;w\,\!&amp;lt;/math&amp;gt;.  Then the Hamming distance is also equal to wt(&amp;lt;math&amp;gt;v+w\,\!&amp;lt;/math&amp;gt;).  The Hamming distance between &amp;lt;math&amp;gt;v\,\!&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;w\,\!&amp;lt;/math&amp;gt; will be denoted &amp;lt;math&amp;gt;d_H(v,w)\,\!&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
====Definition 4====&lt;br /&gt;
We use &amp;lt;math&amp;gt;\{0,1\}^n\,\!&amp;lt;/math&amp;gt; to denote the set of all binary vectors of length &amp;lt;math&amp;gt;n\,\!&amp;lt;/math&amp;gt;.  A '''code''' &amp;lt;math&amp;gt;C\,\!&amp;lt;/math&amp;gt; of length &amp;lt;math&amp;gt;n\,\!&amp;lt;/math&amp;gt; is any subset of that set.  The set of all elements of &amp;lt;math&amp;gt;C\,\!&amp;lt;/math&amp;gt; is called the set of '''codewords'''.  We also say there are &amp;lt;math&amp;gt;2^n\,\!&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;n\,\!&amp;lt;/math&amp;gt;-bit words in the space.  &lt;br /&gt;
&lt;br /&gt;
Suppose &amp;lt;math&amp;gt;n\,\!&amp;lt;/math&amp;gt; bits are used to encode &amp;lt;math&amp;gt;k\,\!&amp;lt;/math&amp;gt; logical bits.  We use the notation &amp;lt;math&amp;gt;[n,k] \,\!&amp;lt;/math&amp;gt; do denote such a code.&lt;br /&gt;
&lt;br /&gt;
====Definition 5====&lt;br /&gt;
The '''minimum distance''' of a code is the smallest Hamming distance between any two non-equal vectors in a code.  This can be written &lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt;&lt;br /&gt;
d_{Hmin}(C) = \underset{v,w\in C,v\neq w}{\mbox{min}}d_H(v,w).&lt;br /&gt;
 \,\!&amp;lt;/math&amp;gt;|F.1}}&lt;br /&gt;
For shorthand, we also use &amp;lt;math&amp;gt; d(C)\,\!&amp;lt;/math&amp;gt; or &amp;lt;math&amp;gt; d\,\!&amp;lt;/math&amp;gt; if &amp;lt;math&amp;gt; C\,\!&amp;lt;/math&amp;gt; is understood.&lt;br /&gt;
&lt;br /&gt;
When that code has a distance &amp;lt;math&amp;gt;d\,\!&amp;lt;/math&amp;gt;, the notation &amp;lt;math&amp;gt;[n,k,d] \,\!&amp;lt;/math&amp;gt; is used.&lt;br /&gt;
&lt;br /&gt;
====Example 1====&lt;br /&gt;
It is interesting to note that if we encode redundantly using &amp;lt;math&amp;gt; 0_L=00 \,\!&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;1_L=11\,\!&amp;lt;/math&amp;gt; as our logical zero and logical one respectively, then we could detect single bit errors but not correct them.  For example, if we receive &amp;lt;math&amp;gt; 01\,\!&amp;lt;/math&amp;gt;, we know this cannot be one of our encoded states.  So an error must have occurred.  However, we don't know whether the sender sent &amp;lt;math&amp;gt; 0_L=00 \,\!&amp;lt;/math&amp;gt; or &amp;lt;math&amp;gt;1_L=11\,\!&amp;lt;/math&amp;gt;.  We do know that an error has occurred though, as long as we know only one error has occurred.  Such an encoding can be used as an '''error detecting code'''.  In this case there are two code words, &amp;lt;math&amp;gt; 0_L=00 \,\!&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;1_L=11\,\!&amp;lt;/math&amp;gt;, but four words in the space.  The minimum distance is 2, which is the distance between the two code words.&lt;br /&gt;
&lt;br /&gt;
====Example 2====&lt;br /&gt;
The three-bit redundant encoding was already given in [[Chapter 7 - Quantum Error Correcting Codes|Chapter 7]].  One takes logical zero and logical one states to be&lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt; &lt;br /&gt;
0_L =  000 \;\;\; \mbox{ and } \;\;\; 1_L = 111,&lt;br /&gt;
\,\!&amp;lt;/math&amp;gt;|F.2}}&lt;br /&gt;
where the subscript &amp;lt;math&amp;gt;L \,\!&amp;lt;/math&amp;gt; is used to denote a &amp;quot;logical&amp;quot; state; that is, one that is encoded.  Recall that this code is able to detect and correct one error.  In this case there are two code words out of eight possible words, and the minimal distance is 3.&lt;br /&gt;
&lt;br /&gt;
====Definition 6====&lt;br /&gt;
The '''rate''' of a code is given by the ration of the number of logical bits to the number of bits, &amp;lt;math&amp;gt;k/n\,\!&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
====Definition 7====&lt;br /&gt;
A '''linear code''' &amp;lt;math&amp;gt;C_l\,\!&amp;lt;/math&amp;gt; is a code that is closed under addition.&lt;br /&gt;
&lt;br /&gt;
===Linear Codes===&lt;br /&gt;
&lt;br /&gt;
Linear codes are particularly useful because they are able to efficiently identify errors and the associated correct codewords.  This ability is due to the added structure these codes have.  These will be discussed in the following sections. &lt;br /&gt;
&lt;br /&gt;
====Generator Matrix====&lt;br /&gt;
&lt;br /&gt;
For linear codes, any linear combination of codewords is a codeword.  One key feature of a linear code is that it can be specified by a &amp;lt;nowiki&amp;gt;''generator matrix,''&amp;lt;/nowiki&amp;gt; &amp;lt;math&amp;gt;G\,\!&amp;lt;/math&amp;gt;&amp;lt;ref&amp;gt;Recall that we are working with binary codes.  Thus the entries of the matrix will also be binary numbers, i.e., 0's and 1's.&amp;lt;/ref&amp;gt;. For an &amp;lt;math&amp;gt; [n,k]\,\!&amp;lt;/math&amp;gt; code, the '''generator matrix''' is an &amp;lt;math&amp;gt; n\times k\,\!&amp;lt;/math&amp;gt; matrix with columns that form a basis for the &amp;lt;math&amp;gt;k\,\!&amp;lt;/math&amp;gt;-dimensional coding sub-space of the &amp;lt;math&amp;gt;n\,\!&amp;lt;/math&amp;gt;-dimensional binary vector space.  In other words, the vectors comprising the rows form a basis that will span the code space.  (Note that one may also use the transpose of this matrix as the definition for &amp;lt;math&amp;gt;G\,\!&amp;lt;/math&amp;gt;.)  Any code word &amp;lt;math&amp;gt;w\,\!&amp;lt;/math&amp;gt; described by a vector &amp;lt;math&amp;gt;v\,\!&amp;lt;/math&amp;gt; can be written in terms of the generator matrix as &amp;lt;math&amp;gt;w = Gv\,\!&amp;lt;/math&amp;gt;.  Note that &amp;lt;math&amp;gt;G\,\!&amp;lt;/math&amp;gt; is independent of the input and output vectors.  In addition, &amp;lt;math&amp;gt;G\,\!&amp;lt;/math&amp;gt; is not unique.  If columns are switched or even added to produce a new vector that replaces a column, then the generator matrix is still valid for the code.  This is due to the requirement that the columns be linearly independent, which is still satisfied if these operations are performed.&lt;br /&gt;
&lt;br /&gt;
====Parity Check Matrix====&lt;br /&gt;
Once &amp;lt;math&amp;gt;G\,\!&amp;lt;/math&amp;gt; is obtained, one can calculate another useful matrix, &amp;lt;math&amp;gt;P.\,\!&amp;lt;/math&amp;gt;  &amp;lt;math&amp;gt;P\,\!&amp;lt;/math&amp;gt; is an &amp;lt;math&amp;gt;(n- k)\times n\,\!&amp;lt;/math&amp;gt; matrix which has the property that&lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt;&lt;br /&gt;
PG = 0.&lt;br /&gt;
\,\!&amp;lt;/math&amp;gt;|F.3}}&lt;br /&gt;
The matrix &amp;lt;math&amp;gt;P\,\!&amp;lt;/math&amp;gt; is called the '''parity check matrix''' or '''dual matrix'''.  The rank of &amp;lt;math&amp;gt;P\,\!&amp;lt;/math&amp;gt; is at most  &amp;lt;math&amp;gt;n- k\,\!&amp;lt;/math&amp;gt; and has the property that it annihilates any code word.  To see this, recall any code word is written as &amp;lt;math&amp;gt;Gv\,\!&amp;lt;/math&amp;gt;: &amp;lt;math&amp;gt;PGv =0\,\!&amp;lt;/math&amp;gt; since &amp;lt;math&amp;gt;PG =0.\,\!&amp;lt;/math&amp;gt;  Also, due to the rank of &amp;lt;math&amp;gt;P,\,\!&amp;lt;/math&amp;gt; it can be shown that &amp;lt;math&amp;gt;Pw =0\,\!&amp;lt;/math&amp;gt; only if &amp;lt;math&amp;gt;w\,\!&amp;lt;/math&amp;gt; is a code word.  That is to say, &amp;lt;math&amp;gt;Pw=0\,\!&amp;lt;/math&amp;gt; if and only if &amp;lt;math&amp;gt;w\,\!&amp;lt;/math&amp;gt; is a code word.  This means that &amp;lt;math&amp;gt;P\,\!&amp;lt;/math&amp;gt; can be used to test whether or not a word is in the code. &lt;br /&gt;
&lt;br /&gt;
Suppose an error occurs on a code word &amp;lt;math&amp;gt;w\,\!&amp;lt;/math&amp;gt; to produce &amp;lt;math&amp;gt;w^\prime = w + e\,\!&amp;lt;/math&amp;gt;.  It follows that&lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt;&lt;br /&gt;
Pw^\prime = P(w+e) = Pe,&lt;br /&gt;
\,\!&amp;lt;/math&amp;gt;|F.4}}&lt;br /&gt;
since &amp;lt;math&amp;gt;Pw=0\,\!&amp;lt;/math&amp;gt;.  This result, &amp;lt;math&amp;gt;Pe\,\!&amp;lt;/math&amp;gt; is called the '''error syndrome''' and the measurement to identify &amp;lt;math&amp;gt;Pe\,\!&amp;lt;/math&amp;gt; is the '''syndrome measurement'''.  Therefore, the result depends only on the error and not on the original code word.  If the error can be determined from this result, then it can be corrected independent of the code word.  However, in order to have &amp;lt;math&amp;gt;Pe\,\!&amp;lt;/math&amp;gt; be unique, two different results, &amp;lt;math&amp;gt;Pe_1\,\!&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;Pe_2\,\!&amp;lt;/math&amp;gt;, must not be equal.  This is possible if a distance &amp;lt;math&amp;gt;d\,\!&amp;lt;/math&amp;gt; code is constructed such that the parity check matrix has &amp;lt;math&amp;gt;d-1=2t\,\!&amp;lt;/math&amp;gt; linearly independent columns.  This enables the errors to be identified and corrected.&lt;br /&gt;
&lt;br /&gt;
It is important to emphasize that these two matrices define the code as well as the check and necessary recovery operations.  The matrix &amp;lt;math&amp;gt;G\,\!&amp;lt;/math&amp;gt; is determined by the code.  Once this matrix is determined, there is a method for determining the parity check matrix, &amp;lt;math&amp;gt;P\,\!&amp;lt;/math&amp;gt; which is a set of &amp;lt;math&amp;gt;n-k\,\!&amp;lt;/math&amp;gt; mutually orthogonal vectors that are also orthogonal to the code space defined by the generator matrix.  It is possible to determine the parity matrix from the generator matrix.  The method for doing this can be found in Steane's article in [[Bibliography#LoPopescuSpiller|Lo, Popescu, and Spiller [26]]] and it goes as follows.  One first puts &amp;lt;math&amp;gt;G^T\,\!&amp;lt;/math&amp;gt; in the form of an augmented matrix &amp;lt;math&amp;gt;(I_k|A),\,\!&amp;lt;/math&amp;gt; where &amp;lt;math&amp;gt;I_k\,\!&amp;lt;/math&amp;gt; is the &amp;lt;math&amp;gt;k\times k\,\!&amp;lt;/math&amp;gt; identity matrix.  Then the parity check matrix is &amp;lt;math&amp;gt;P = (A^T|I_{n-k}).\,\!&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Errors===&lt;br /&gt;
&lt;br /&gt;
For any classical error correcting code, there are general conditions that must be satisfied in order for the code to be able to detect and correct errors.  The two examples above show how the error can be detected; here, the objective is to give some general conditions.  &lt;br /&gt;
&lt;br /&gt;
Note that any state containing an error may be written as the sum of the original (logical or encoded) state  &amp;lt;math&amp;gt;w \,\!&amp;lt;/math&amp;gt; and another vector &amp;lt;math&amp;gt;e \,\!&amp;lt;/math&amp;gt;.  The error vector &amp;lt;math&amp;gt;e \,\!&amp;lt;/math&amp;gt; has ones in the places where errors are present and zeroes everywhere else.  To ensure that the error may be corrected, the following condition must be satisfied for two states with errors occurring:&lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt;&lt;br /&gt;
w_1 + e_1 \neq w_2 + e_2.&lt;br /&gt;
\,\!&amp;lt;/math&amp;gt;|F.5}}&lt;br /&gt;
This condition is called the '''disjointness condition'''.  This condition means that an error on one state cannot be confused with an error on another state.  If it could, then the state including the error could not be uniquely identified with an encoded state and the state could not be corrected to its original state after the error occurred.  More specifically, for a code to correct &amp;lt;math&amp;gt;t\,\!&amp;lt;/math&amp;gt;  single-bit errors, it must have distance at least &amp;lt;math&amp;gt;2t + 1 \,\!&amp;lt;/math&amp;gt; between any two codewords; i.e., it must be true that &amp;lt;math&amp;gt;d(C) \geq 2t + 1 \,\!&amp;lt;/math&amp;gt;.  An &amp;lt;math&amp;gt;[n,k]\,\!&amp;lt;/math&amp;gt; code with minimal distance &amp;lt;math&amp;gt;d \,\!&amp;lt;/math&amp;gt; is denoted &amp;lt;math&amp;gt;[n,k,d]\,\!&amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Example 3====&lt;br /&gt;
An important example of an error correcting code is called the &amp;lt;math&amp;gt;[7,4,3]&amp;lt;/math&amp;gt; Hamming code.  This code, as the notation indicates, encodes &amp;lt;math&amp;gt;k=4&amp;lt;/math&amp;gt; bits of information into &amp;lt;math&amp;gt;n=7&amp;lt;/math&amp;gt; bits.  It also does it in such a way that one error can be detected and corrected since it has a distance of &amp;lt;math&amp;gt;3&amp;lt;/math&amp;gt;.  The generator matrix for this code can be taken to be &lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt;&lt;br /&gt;
G^T = \left(\begin{array}{ccccccc}&lt;br /&gt;
          1 &amp;amp; 0 &amp;amp; 0 &amp;amp; 0 &amp;amp; 1 &amp;amp; 1 &amp;amp; 0 \\&lt;br /&gt;
          0 &amp;amp; 1 &amp;amp; 0 &amp;amp; 0 &amp;amp; 1 &amp;amp; 1 &amp;amp; 1 \\&lt;br /&gt;
          0 &amp;amp; 0 &amp;amp; 1 &amp;amp; 0 &amp;amp; 1 &amp;amp; 0 &amp;amp; 1 \\&lt;br /&gt;
          0 &amp;amp; 0 &amp;amp; 0 &amp;amp; 1 &amp;amp; 0 &amp;amp; 1 &amp;amp; 1 &lt;br /&gt;
    \end{array}\right).&lt;br /&gt;
\,\!&amp;lt;/math&amp;gt;|F.6}}&lt;br /&gt;
(See for example [[Bibliography#LoeppWootters|Loepp and Wootters [25]]].)  From this the parity check matrix, &amp;lt;math&amp;gt;P\,\!&amp;lt;/math&amp;gt; can be calculated (as stated above) by finding a set of &amp;lt;math&amp;gt;n-k\,\!&amp;lt;/math&amp;gt; mutually orthogonal vectors that are also orthogonal to the code space defined by the generator matrix.  Alternatively, one could use the method in Steane's article in [[Bibliography#LoPopescuSpiller|Lo, Popescu, and Spiller [26]]].  Put &amp;lt;math&amp;gt;G^T\,\!&amp;lt;/math&amp;gt; in the form &amp;lt;math&amp;gt;(I_k|A),\,\!&amp;lt;/math&amp;gt; where &amp;lt;math&amp;gt;I_k\,\!&amp;lt;/math&amp;gt; is the &amp;lt;math&amp;gt;k\times k\,\!&amp;lt;/math&amp;gt; identity matrix.  Then the parity check matrix is &amp;lt;math&amp;gt;P = (A^T|I_{n-k}).\,\!&amp;lt;/math&amp;gt;  In either case, one can arrive at the following parity check matrix for this code:&lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt;&lt;br /&gt;
P = \left(\begin{array}{ccccccc}&lt;br /&gt;
          1 &amp;amp; 1 &amp;amp; 1 &amp;amp; 0 &amp;amp; 1 &amp;amp; 0 &amp;amp; 0 \\&lt;br /&gt;
          1 &amp;amp; 1 &amp;amp; 0 &amp;amp; 1 &amp;amp; 0 &amp;amp; 1 &amp;amp; 0 \\&lt;br /&gt;
          0 &amp;amp; 1 &amp;amp; 1 &amp;amp; 1 &amp;amp; 0 &amp;amp; 0 &amp;amp; 1 &lt;br /&gt;
    \end{array}\right).&lt;br /&gt;
\,\!&amp;lt;/math&amp;gt;|F.7}}&lt;br /&gt;
It is useful to note that the code can also be defined by the parity check matrix.  Only the codewords are annihilated by the parity check matrix.&lt;br /&gt;
&lt;br /&gt;
===The Disjointness Condition and Correcting Errors===&lt;br /&gt;
&lt;br /&gt;
The motivation for the disjointness condition, [[#eqF.5|Eq.(F.5)]], is to associate each vector in the space with a particular code word.  That is, assuming that only certain errors occur, each error vector should be associated to a particular vector in the code space when the error is added to the original code word.  This partitions the set into disjoint subsets, with each containing only one code vector.  A message is decoded correctly if the vector (the one containing the error) is in the subset that is associated with the original vector (the one with no error).  For example, if one vector is sent, say &amp;lt;math&amp;gt; v_1 \,\!&amp;lt;/math&amp;gt;, and an error occurs during transmission to produce &amp;lt;math&amp;gt; v_2 = v_1 +e\,\!&amp;lt;/math&amp;gt;, then this vector must be in the subset containing &amp;lt;math&amp;gt; v_1 \,\!&amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
A way to decode is to record an array of possible code words, possible errors, and the combinations of those errors and code words.  The array can be set up as a top row of the code word vectors and a leftmost column of errors, with the element of the first row and the first column being the zero vector and all subsequent entries in the column being errors.  Then the element at the top of a column (say the jth column) is added to the error in the corresponding row (say the kth row) to get the j,k entry of the array.  With this array one can associate a column with a subset that is disjoint with the other sets.  Identifying the erred code word in a column associates it with a code word and thus corrects the error.&lt;br /&gt;
&lt;br /&gt;
====Example 4====&lt;br /&gt;
&lt;br /&gt;
In this example we are going to use &amp;lt;math&amp;gt;G\,\!&amp;lt;/math&amp;gt;  [[#eqF.6| (F.6)]] and &amp;lt;math&amp;gt;P\,\!&amp;lt;/math&amp;gt;  [[#eqF.7| (F.7)]] from the example above.&lt;br /&gt;
&lt;br /&gt;
The set of code words is given by all of the linear combinations of the rows of &amp;lt;math&amp;gt;P,\,\!&amp;lt;/math&amp;gt; meaning there are &amp;lt;math&amp;gt;2^3\,\!&amp;lt;/math&amp;gt; code words. The set of code words, &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C = \left\{0000000, 1110100, 1101010, 0111001, 0100111, 1010011, 0011110, 1001101\right\}.\,\!&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;div id=&amp;quot;TableF.1&amp;quot;&amp;gt;&amp;lt;big&amp;gt;'''TABLE F.1'''&amp;lt;/big&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;10&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |Table F.1: ''Array to determine possible errors on an unknown code word in set &amp;lt;math&amp;gt;C\,\!&amp;lt;/math&amp;gt;''&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;math&amp;gt;0000000\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;1110100\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;1101010\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;0111001\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;0100111\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;1010011\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;0011110\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;1001101\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;math&amp;gt;1000000\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;0110100\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;0101010\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;1111001\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;1100111\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;0010011\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;1011110\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;0001101\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;math&amp;gt;0100000\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;1010100\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;1001010\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;0011001\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;0000111\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;1110011\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;0111110\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;1101101\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;math&amp;gt;0010000\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;1100100\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;1111010\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;0101001\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;0110111\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;1000011\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;0001110\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;1011101\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;math&amp;gt;0001000\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;1111100\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;1100010\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;0110001\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;0101111\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;1011011\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;0010110\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;1000101\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;math&amp;gt;0000100\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;1110000\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;1101110\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;0111101\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;0100011\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;1010111\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;0011010\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;1001001\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;math&amp;gt;0000010\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;1110110\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;1101000\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;0111011\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;0100101\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;1010001\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;0011100\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;1001111\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;math&amp;gt;0000001\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;1110101\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;1101011\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;0111000\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;0100110\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;1010010\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;0011111\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;1001100\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, suppose you are expecting to receive a code word, &amp;lt;math&amp;gt;c\in C.\,\!&amp;lt;/math&amp;gt;  But, instead you receive &amp;lt;math&amp;gt;0101111\notin C.\,\!&amp;lt;/math&amp;gt;  What we are able to do is look at Table F.1 and see that &amp;lt;math&amp;gt;0101111\,\!&amp;lt;/math&amp;gt; is in column 5.  Since the columns of this table represent the disjoint subsets of our code space, we see that &amp;lt;math&amp;gt;c = 0100111\,\!&amp;lt;/math&amp;gt; and the error that occurred was &amp;lt;math&amp;gt;e_{4}\,\!&amp;lt;/math&amp;gt; or &amp;lt;math&amp;gt;0001000.\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===The Hamming Bound===&lt;br /&gt;
&lt;br /&gt;
The Hamming bound is a bound that restricts the rate of the code.  Due to the disjointness condition, a certain number of bits are required to ensure our ability to detect and correct errors.  Suppose there is a set of &amp;lt;math&amp;gt; n\,\!&amp;lt;/math&amp;gt; bit vectors for encoding &amp;lt;math&amp;gt; k\,\!&amp;lt;/math&amp;gt; bits of information.  There is a set of error vectors of weight &amp;lt;math&amp;gt; t \,\!&amp;lt;/math&amp;gt; that has &amp;lt;math&amp;gt; C(n,t)\,\!&amp;lt;/math&amp;gt; elements&amp;lt;ref&amp;gt;That is, &amp;lt;math&amp;gt; n \,\!&amp;lt;/math&amp;gt; choose &amp;lt;math&amp;gt; t \,\!&amp;lt;/math&amp;gt; vectors. The notation is &amp;lt;math&amp;gt; C(n,t) = {n\choose t} = \frac{n!}{(n-t)!t!}.\,\!&amp;lt;/math&amp;gt;&amp;lt;/ref&amp;gt;.  So the number of error vectors, including errors of weight up to &amp;lt;math&amp;gt; t \,\!&amp;lt;/math&amp;gt;, is &lt;br /&gt;
&amp;lt;math&amp;gt; \sum_{i=0}^t C(n,i). \,\!&amp;lt;/math&amp;gt;  (Note that no error is also part of the set of error vectors.  The objective is to be able to design a code that can correct all errors up to those of weight &amp;lt;math&amp;gt; t \,\!&amp;lt;/math&amp;gt;, and this includes no error at all.)  Since there are &amp;lt;math&amp;gt; 2^n\,\!&amp;lt;/math&amp;gt; vectors in the whole space of &amp;lt;math&amp;gt; n\,\!&amp;lt;/math&amp;gt; bits, and assuming &amp;lt;math&amp;gt; m\,\!&amp;lt;/math&amp;gt; vectors are used for the encoding, the Hamming bound is&lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt; &lt;br /&gt;
m\sum_{i=0}^t C(n,i) \leq 2^n.&lt;br /&gt;
\,\!&amp;lt;/math&amp;gt;|F.8}}&lt;br /&gt;
For linear codes, &amp;lt;math&amp;gt; m=2^k,\,\!&amp;lt;/math&amp;gt; so &lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt; &lt;br /&gt;
2^k\sum_{i=0}^t C(n,i) \leq 2^n.&lt;br /&gt;
\,\!&amp;lt;/math&amp;gt;|F.9}}&lt;br /&gt;
Taking the logarithm, &lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt; &lt;br /&gt;
k \leq n - \log_2\left(\sum_{i=0}^t C(n,i)\right).&lt;br /&gt;
\,\!&amp;lt;/math&amp;gt;|F.10}}&lt;br /&gt;
For large &amp;lt;math&amp;gt; n, k \,\!&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; t \,\!&amp;lt;/math&amp;gt;, we can use [[#LoPopescueSpiller|Stirling's formula]] to show that &lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt; &lt;br /&gt;
\frac{k}{n} \leq 1 - H\left(\frac{t}{n}\right),&lt;br /&gt;
\,\!&amp;lt;/math&amp;gt;|F.11}}&lt;br /&gt;
where &amp;lt;math&amp;gt; H(x) = -x\log x -(1-x)\log (1-x) \,\!&amp;lt;/math&amp;gt; and we have neglected an overall multiplicative constant that goes to 1 as  &amp;lt;math&amp;gt; n\rightarrow \infty. \,\!&amp;lt;/math&amp;gt;  (Again, see the article in [[Bibliography#LoPopescueSpiller|Lo, Popescu, and Spiller [26]]] by Steane.)&lt;br /&gt;
&lt;br /&gt;
===More Definitions===&lt;br /&gt;
&lt;br /&gt;
====Definition 11: Dual Code====&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt;\mathcal{C}\,\!&amp;lt;/math&amp;gt; be a code and let &amp;lt;math&amp;gt;v\,\!&amp;lt;/math&amp;gt; be a vector in the code space.  The '''dual code''', denoted &amp;lt;math&amp;gt;\mathcal{C}^\perp\,\!&amp;lt;/math&amp;gt;, is the set of all vectors that have zero inner product with all &amp;lt;math&amp;gt;v\in \mathcal{C}\,\!&amp;lt;/math&amp;gt;.  In other words, it is the set of all vectors &amp;lt;math&amp;gt;u\,\!&amp;lt;/math&amp;gt; such that &amp;lt;math&amp;gt;u\cdot v = 0\,\!&amp;lt;/math&amp;gt; for all  &amp;lt;math&amp;gt;v\in \mathcal{C}\,\!&amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
For binary vectors, a vector can be orthogonal to itself.  Note that this is different from ordinary vectors in 3-d space.  &lt;br /&gt;
&lt;br /&gt;
The dual code is a useful entity in classical error correction and will be used in the construction of the quantum error correcting codes known as [[Chapter 7 - Quantum Error Correcting Codes#CSS codes|CSS codes]].&lt;br /&gt;
&lt;br /&gt;
===Final Comments===&lt;br /&gt;
&lt;br /&gt;
As can be seen from the Hamming bound, there is a limit to the rate of an error correcting code.  This does not indicate whether or not codes that satisfy these bounds exist, but it does tell us that no codes exist that do not satisfy these bounds.  Encoding, decoding, error detection and correction are all difficult problems to solve in general.  One of the advantages of the linear codes is that they provide a systematic method for identifying errors on a code through the use of the parity check operation.  More generally, checking to see whether or not a bit string (vector) is in the code space would require a look-up table.  This would be much more time-consuming than using the parity check matrix; matrix multiplication is quite efficient relative to the look-up table.  &lt;br /&gt;
&lt;br /&gt;
Many of these ideas and definitions will be utilized in [[Chapter 7 - Quantum Error Correcting Codes|Chapter 7]] on quantum error correction.  Some linear codes, including the Hamming code above, will have quantum analogues---as do many quantum error correcting codes.  In quantum computers, as will be discussed, error correction is necessary due to the delicacy of quantum information.  Such discussions will be taken up in [[Chapter 7 - Quantum Error Correcting Codes|Chapter 7]].&lt;br /&gt;
&lt;br /&gt;
==Footnotes==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Ddghunter</name></author>
		
	</entry>
	<entry>
		<id>https://www2.physics.siu.edu/qunet/wiki/index.php?title=Appendix_F_-_Classical_Error_Correcting_Codes&amp;diff=2341</id>
		<title>Appendix F - Classical Error Correcting Codes</title>
		<link rel="alternate" type="text/html" href="https://www2.physics.siu.edu/qunet/wiki/index.php?title=Appendix_F_-_Classical_Error_Correcting_Codes&amp;diff=2341"/>
		<updated>2013-03-03T18:57:18Z</updated>

		<summary type="html">&lt;p&gt;Ddghunter: /* Errors */ punctutation&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===Introduction===&lt;br /&gt;
&lt;br /&gt;
Classical error correcting codes are in use in a wide variety of digital electronics and other classical information systems.  It is a good idea to learn some of the basic definitions, ideas, methods, and simple examples of classical error correcting codes in order to understand the (slightly) more complicated quantum error correcting codes.  There are many good introductions to classical error correction.  Here we follow a few sources which also discuss quantum error correcting codes: the book by [[Bibliography#LoeppWootters|Loepp and Wootters [25]]], an article in [[Bibliography#LoPopescueSpiller|Lo, Popescu, and Spiller [26]]] by Steane, [[Bibliography#GottDiss|Gottesman's Thesis [27]]], and [[Bibliography#Gaitan:book|Gaitan's Book [3]]] on quantum error correction, which also discusses classical error correction.&lt;br /&gt;
&lt;br /&gt;
===Binary Operations===&lt;br /&gt;
&lt;br /&gt;
The set &amp;lt;math&amp;gt; \{0,1\} \,\!&amp;lt;/math&amp;gt; is a group under addition.  (See [[Appendix D - Group Theory#Example 3|Section D.2.8]] of [[Appendix D - Group Theory|Appendix D]].)  The way this is achieved is by deciding that we will only use these two numbers in our language and using addition modulo 2, meaning &amp;lt;math&amp;gt; 0+0=0, 1+0 = 0+1 = 1, \,\!&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;1+1 =0\,\!&amp;lt;/math&amp;gt;.   If we also include the operation of multiplication and these two operations follow the distributive law, the set becomes a '''field''' (a Galois Field), which is denoted GF&amp;lt;math&amp;gt;(2)\,\!&amp;lt;/math&amp;gt;.  Since one often works with strings of bits, it is very useful to consider the string of bits to be a vector and to use vector addition (which is component-wise addition) and vector multiplication (which is the inner product).  For example, the addition of the vector &amp;lt;math&amp;gt;(0,0,1)\,\!&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;(0,1,1)\,\!&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;(0,0,1) + (0,1,1) = (0,1,0)\,\!&amp;lt;/math&amp;gt;.  The inner product between these two vectors is  &amp;lt;math&amp;gt;(0,0,1) \cdot (0,1,1) = 0\cdot 0 + 0\cdot 1 + 1\cdot 1 = 0 +0 +1=1\,\!&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Definitions and Basics===&lt;br /&gt;
&lt;br /&gt;
====Definition 1====&lt;br /&gt;
The inner product is also called a '''checksum''' or '''parity check''' since it shows whether or not the first and second vectors agree, or have an even number of 1's at the positions specified by the ones in the other vector.  We may say that the first vector satisfies the parity check of the other vector, or vice versa.&lt;br /&gt;
&lt;br /&gt;
====Definition 2====&lt;br /&gt;
The '''weight''' or '''Hamming weight''' is the number of non-zero components of a vector or string.  The weight of a vector &amp;lt;math&amp;gt;v\,\!&amp;lt;/math&amp;gt; is denoted wt(&amp;lt;math&amp;gt;v\,\!&amp;lt;/math&amp;gt;).  &lt;br /&gt;
&lt;br /&gt;
====Definition 3====&lt;br /&gt;
The '''Hamming distance''' is the number of places where two vectors differ.  Let the two vectors be &amp;lt;math&amp;gt;v\,\!&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;w\,\!&amp;lt;/math&amp;gt;.  Then the Hamming distance is also equal to wt(&amp;lt;math&amp;gt;v+w\,\!&amp;lt;/math&amp;gt;).  The Hamming distance between &amp;lt;math&amp;gt;v\,\!&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;w\,\!&amp;lt;/math&amp;gt; will be denoted &amp;lt;math&amp;gt;d_H(v,w)\,\!&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
====Definition 4====&lt;br /&gt;
We use &amp;lt;math&amp;gt;\{0,1\}^n\,\!&amp;lt;/math&amp;gt; to denote the set of all binary vectors of length &amp;lt;math&amp;gt;n\,\!&amp;lt;/math&amp;gt;.  A '''code''' &amp;lt;math&amp;gt;C\,\!&amp;lt;/math&amp;gt; of length &amp;lt;math&amp;gt;n\,\!&amp;lt;/math&amp;gt; is any subset of that set.  The set of all elements of &amp;lt;math&amp;gt;C\,\!&amp;lt;/math&amp;gt; is called the set of '''codewords'''.  We also say there are &amp;lt;math&amp;gt;2^n\,\!&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;n\,\!&amp;lt;/math&amp;gt;-bit words in the space.  &lt;br /&gt;
&lt;br /&gt;
Suppose &amp;lt;math&amp;gt;n\,\!&amp;lt;/math&amp;gt; bits are used to encode &amp;lt;math&amp;gt;k\,\!&amp;lt;/math&amp;gt; logical bits.  We use the notation &amp;lt;math&amp;gt;[n,k] \,\!&amp;lt;/math&amp;gt; do denote such a code.&lt;br /&gt;
&lt;br /&gt;
====Definition 5====&lt;br /&gt;
The '''minimum distance''' of a code is the smallest Hamming distance between any two non-equal vectors in a code.  This can be written &lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt;&lt;br /&gt;
d_{Hmin}(C) = \underset{v,w\in C,v\neq w}{\mbox{min}}d_H(v,w).&lt;br /&gt;
 \,\!&amp;lt;/math&amp;gt;|F.1}}&lt;br /&gt;
For shorthand, we also use &amp;lt;math&amp;gt; d(C)\,\!&amp;lt;/math&amp;gt; or &amp;lt;math&amp;gt; d\,\!&amp;lt;/math&amp;gt; if &amp;lt;math&amp;gt; C\,\!&amp;lt;/math&amp;gt; is understood.&lt;br /&gt;
&lt;br /&gt;
When that code has a distance &amp;lt;math&amp;gt;d\,\!&amp;lt;/math&amp;gt;, the notation &amp;lt;math&amp;gt;[n,k,d] \,\!&amp;lt;/math&amp;gt; is used.&lt;br /&gt;
&lt;br /&gt;
====Example 1====&lt;br /&gt;
It is interesting to note that if we encode redundantly using &amp;lt;math&amp;gt; 0_L=00 \,\!&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;1_L=11\,\!&amp;lt;/math&amp;gt; as our logical zero and logical one respectively, then we could detect single bit errors but not correct them.  For example, if we receive &amp;lt;math&amp;gt; 01\,\!&amp;lt;/math&amp;gt;, we know this cannot be one of our encoded states.  So an error must have occurred.  However, we don't know whether the sender sent &amp;lt;math&amp;gt; 0_L=00 \,\!&amp;lt;/math&amp;gt; or &amp;lt;math&amp;gt;1_L=11\,\!&amp;lt;/math&amp;gt;.  We do know that an error has occurred though, as long as we know only one error has occurred.  Such an encoding can be used as an '''error detecting code'''.  In this case there are two code words, &amp;lt;math&amp;gt; 0_L=00 \,\!&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;1_L=11\,\!&amp;lt;/math&amp;gt;, but four words in the space.  The minimum distance is 2, which is the distance between the two code words.&lt;br /&gt;
&lt;br /&gt;
====Example 2====&lt;br /&gt;
The three-bit redundant encoding was already given in [[Chapter 7 - Quantum Error Correcting Codes|Chapter 7]].  One takes logical zero and logical one states to be&lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt; &lt;br /&gt;
0_L =  000 \;\;\; \mbox{ and } \;\;\; 1_L = 111,&lt;br /&gt;
\,\!&amp;lt;/math&amp;gt;|F.2}}&lt;br /&gt;
where the subscript &amp;lt;math&amp;gt;L \,\!&amp;lt;/math&amp;gt; is used to denote a &amp;quot;logical&amp;quot; state; that is, one that is encoded.  Recall that this code is able to detect and correct one error.  In this case there are two code words out of eight possible words, and the minimal distance is 3.&lt;br /&gt;
&lt;br /&gt;
====Definition 6====&lt;br /&gt;
The '''rate''' of a code is given by the ration of the number of logical bits to the number of bits, &amp;lt;math&amp;gt;k/n\,\!&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
====Definition 7====&lt;br /&gt;
A '''linear code''' &amp;lt;math&amp;gt;C_l\,\!&amp;lt;/math&amp;gt; is a code that is closed under addition.&lt;br /&gt;
&lt;br /&gt;
===Linear Codes===&lt;br /&gt;
&lt;br /&gt;
Linear codes are particularly useful because they are able to efficiently identify errors and the associated correct codewords.  This ability is due to the added structure these codes have.  These will be discussed in the following sections. &lt;br /&gt;
&lt;br /&gt;
====Generator Matrix====&lt;br /&gt;
&lt;br /&gt;
For linear codes, any linear combination of codewords is a codeword.  One key feature of a linear code is that it can be specified by a &amp;lt;nowiki&amp;gt;''generator matrix,''&amp;lt;/nowiki&amp;gt; &amp;lt;math&amp;gt;G\,\!&amp;lt;/math&amp;gt;&amp;lt;ref&amp;gt;Recall that we are working with binary codes.  Thus the entries of the matrix will also be binary numbers, i.e., 0's and 1's.&amp;lt;/ref&amp;gt;. For an &amp;lt;math&amp;gt; [n,k]\,\!&amp;lt;/math&amp;gt; code, the '''generator matrix''' is an &amp;lt;math&amp;gt; n\times k\,\!&amp;lt;/math&amp;gt; matrix with columns that form a basis for the &amp;lt;math&amp;gt;k\,\!&amp;lt;/math&amp;gt;-dimensional coding sub-space of the &amp;lt;math&amp;gt;n\,\!&amp;lt;/math&amp;gt;-dimensional binary vector space.  In other words, the vectors comprising the rows form a basis that will span the code space.  (Note that one may also use the transpose of this matrix as the definition for &amp;lt;math&amp;gt;G\,\!&amp;lt;/math&amp;gt;.)  Any code word &amp;lt;math&amp;gt;w\,\!&amp;lt;/math&amp;gt; described by a vector &amp;lt;math&amp;gt;v\,\!&amp;lt;/math&amp;gt; can be written in terms of the generator matrix as &amp;lt;math&amp;gt;w = Gv\,\!&amp;lt;/math&amp;gt;.  Note that &amp;lt;math&amp;gt;G\,\!&amp;lt;/math&amp;gt; is independent of the input and output vectors.  In addition, &amp;lt;math&amp;gt;G\,\!&amp;lt;/math&amp;gt; is not unique.  If columns are switched or even added to produce a new vector that replaces a column, then the generator matrix is still valid for the code.  This is due to the requirement that the columns be linearly independent, which is still satisfied if these operations are performed.&lt;br /&gt;
&lt;br /&gt;
====Parity Check Matrix====&lt;br /&gt;
Once &amp;lt;math&amp;gt;G\,\!&amp;lt;/math&amp;gt; is obtained, one can calculate another useful matrix, &amp;lt;math&amp;gt;P.\,\!&amp;lt;/math&amp;gt;  &amp;lt;math&amp;gt;P\,\!&amp;lt;/math&amp;gt; is an &amp;lt;math&amp;gt;(n- k)\times n\,\!&amp;lt;/math&amp;gt; matrix which has the property that&lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt;&lt;br /&gt;
PG = 0.&lt;br /&gt;
\,\!&amp;lt;/math&amp;gt;|F.3}}&lt;br /&gt;
The matrix &amp;lt;math&amp;gt;P\,\!&amp;lt;/math&amp;gt; is called the '''parity check matrix''' or '''dual matrix'''.  The rank of &amp;lt;math&amp;gt;P\,\!&amp;lt;/math&amp;gt; is at most  &amp;lt;math&amp;gt;n- k\,\!&amp;lt;/math&amp;gt; and has the property that it annihilates any code word.  To see this, recall any code word is written as &amp;lt;math&amp;gt;Gv\,\!&amp;lt;/math&amp;gt;: &amp;lt;math&amp;gt;PGv =0\,\!&amp;lt;/math&amp;gt; since &amp;lt;math&amp;gt;PG =0.\,\!&amp;lt;/math&amp;gt;  Also, due to the rank of &amp;lt;math&amp;gt;P,\,\!&amp;lt;/math&amp;gt; it can be shown that &amp;lt;math&amp;gt;Pw =0\,\!&amp;lt;/math&amp;gt; only if &amp;lt;math&amp;gt;w\,\!&amp;lt;/math&amp;gt; is a code word.  That is to say, &amp;lt;math&amp;gt;Pw=0\,\!&amp;lt;/math&amp;gt; if and only if &amp;lt;math&amp;gt;w\,\!&amp;lt;/math&amp;gt; is a code word.  This means that &amp;lt;math&amp;gt;P\,\!&amp;lt;/math&amp;gt; can be used to test whether or not a word is in the code. &lt;br /&gt;
&lt;br /&gt;
Suppose an error occurs on a code word &amp;lt;math&amp;gt;w\,\!&amp;lt;/math&amp;gt; to produce &amp;lt;math&amp;gt;w^\prime = w + e\,\!&amp;lt;/math&amp;gt;.  It follows that&lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt;&lt;br /&gt;
Pw^\prime = P(w+e) = Pe,&lt;br /&gt;
\,\!&amp;lt;/math&amp;gt;|F.4}}&lt;br /&gt;
since &amp;lt;math&amp;gt;Pw=0\,\!&amp;lt;/math&amp;gt;.  This result, &amp;lt;math&amp;gt;Pe\,\!&amp;lt;/math&amp;gt; is called the '''error syndrome''' and the measurement to identify &amp;lt;math&amp;gt;Pe\,\!&amp;lt;/math&amp;gt; is the '''syndrome measurement'''.  Therefore, the result depends only on the error and not on the original code word.  If the error can be determined from this result, then it can be corrected independent of the code word.  However, in order to have &amp;lt;math&amp;gt;Pe\,\!&amp;lt;/math&amp;gt; be unique, two different results, &amp;lt;math&amp;gt;Pe_1\,\!&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;Pe_2\,\!&amp;lt;/math&amp;gt;, must not be equal.  This is possible if a distance &amp;lt;math&amp;gt;d\,\!&amp;lt;/math&amp;gt; code is constructed such that the parity check matrix has &amp;lt;math&amp;gt;d-1=2t\,\!&amp;lt;/math&amp;gt; linearly independent columns.  This enables the errors to be identified and corrected.&lt;br /&gt;
&lt;br /&gt;
It is important to emphasize that these two matrices define the code as well as the check and necessary recovery operations.  The matrix &amp;lt;math&amp;gt;G\,\!&amp;lt;/math&amp;gt; is determined by the code.  Once this matrix is determined, there is a method for determining the parity check matrix, &amp;lt;math&amp;gt;P\,\!&amp;lt;/math&amp;gt; which is a set of &amp;lt;math&amp;gt;n-k\,\!&amp;lt;/math&amp;gt; mutually orthogonal vectors that are also orthogonal to the code space defined by the generator matrix.  It is possible to determine the parity matrix from the generator matrix.  The method for doing this can be found in Steane's article in [[Bibliography#LoPopescuSpiller|Lo, Popescu, and Spiller [26]]] and it goes as follows.  One first puts &amp;lt;math&amp;gt;G^T\,\!&amp;lt;/math&amp;gt; in the form of an augmented matrix &amp;lt;math&amp;gt;(I_k|A),\,\!&amp;lt;/math&amp;gt; where &amp;lt;math&amp;gt;I_k\,\!&amp;lt;/math&amp;gt; is the &amp;lt;math&amp;gt;k\times k\,\!&amp;lt;/math&amp;gt; identity matrix.  Then the parity check matrix is &amp;lt;math&amp;gt;P = (A^T|I_{n-k}).\,\!&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Errors===&lt;br /&gt;
&lt;br /&gt;
For any classical error correcting code, there are general conditions that must be satisfied in order for the code to be able to detect and correct errors.  The two examples above show how the error can be detected; here, the objective is to give some general conditions.  &lt;br /&gt;
&lt;br /&gt;
Note that any state containing an error may be written as the sum of the original (logical or encoded) state  &amp;lt;math&amp;gt;w \,\!&amp;lt;/math&amp;gt; and another vector &amp;lt;math&amp;gt;e \,\!&amp;lt;/math&amp;gt;.  The error vector &amp;lt;math&amp;gt;e \,\!&amp;lt;/math&amp;gt; has ones in the places where errors are present and zeroes everywhere else.  To ensure that the error may be corrected, the following condition must be satisfied for two states with errors occurring:&lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt;&lt;br /&gt;
w_1 + e_1 \neq w_2 + e_2.&lt;br /&gt;
\,\!&amp;lt;/math&amp;gt;|F.5}}&lt;br /&gt;
This condition is called the '''disjointness condition'''.  This condition means that an error on one state cannot be confused with an error on another state.  If it could, then the state including the error could not be uniquely identified with an encoded state and the state could not be corrected to its original state after the error occurred.  More specifically, for a code to correct &amp;lt;math&amp;gt;t\,\!&amp;lt;/math&amp;gt;  single-bit errors, it must have distance at least &amp;lt;math&amp;gt;2t + 1 \,\!&amp;lt;/math&amp;gt; between any two codewords; i.e., it must be true that &amp;lt;math&amp;gt;d(C) \geq 2t + 1 \,\!&amp;lt;/math&amp;gt;.  An &amp;lt;math&amp;gt;[n,k]\,\!&amp;lt;/math&amp;gt; code with minimal distance &amp;lt;math&amp;gt;d \,\!&amp;lt;/math&amp;gt; is denoted &amp;lt;math&amp;gt;[n,k,d]\,\!&amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Example 3====&lt;br /&gt;
An important example of an error correcting code is called the &amp;lt;math&amp;gt;[7,4,3]&amp;lt;/math&amp;gt; Hamming code.  This code, as the notation indicates, encodes &amp;lt;math&amp;gt;k=4&amp;lt;/math&amp;gt; bits of information into &amp;lt;math&amp;gt;n=7&amp;lt;/math&amp;gt; bits.  It also does it in such a way that one error can be detected and corrected since it has a distance of &amp;lt;math&amp;gt;3&amp;lt;/math&amp;gt;.  The generator matrix for this code can be taken to be &lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt;&lt;br /&gt;
G^T = \left(\begin{array}{ccccccc}&lt;br /&gt;
          1 &amp;amp; 0 &amp;amp; 0 &amp;amp; 0 &amp;amp; 1 &amp;amp; 1 &amp;amp; 0 \\&lt;br /&gt;
          0 &amp;amp; 1 &amp;amp; 0 &amp;amp; 0 &amp;amp; 1 &amp;amp; 1 &amp;amp; 1 \\&lt;br /&gt;
          0 &amp;amp; 0 &amp;amp; 1 &amp;amp; 0 &amp;amp; 1 &amp;amp; 0 &amp;amp; 1 \\&lt;br /&gt;
          0 &amp;amp; 0 &amp;amp; 0 &amp;amp; 1 &amp;amp; 0 &amp;amp; 1 &amp;amp; 1 &lt;br /&gt;
    \end{array}\right).&lt;br /&gt;
\,\!&amp;lt;/math&amp;gt;|F.6}}&lt;br /&gt;
(See for example [[Bibliography#LoeppWootters|Loepp and Wootters [25]]].)  From this the parity check matrix, &amp;lt;math&amp;gt;P\,\!&amp;lt;/math&amp;gt; can be calculated (as stated above) by finding a set of &amp;lt;math&amp;gt;n-k\,\!&amp;lt;/math&amp;gt; mutually orthogonal vectors that are also orthogonal to the code space defined by the generator matrix.  Alternatively, one could use the method in Steane's article in [[Bibliography#LoPopescuSpiller|Lo, Popescu, and Spiller [26]]].  Put &amp;lt;math&amp;gt;G^T\,\!&amp;lt;/math&amp;gt; in the form &amp;lt;math&amp;gt;(I_k|A),\,\!&amp;lt;/math&amp;gt; where &amp;lt;math&amp;gt;I_k\,\!&amp;lt;/math&amp;gt; is the &amp;lt;math&amp;gt;k\times k\,\!&amp;lt;/math&amp;gt; identity matrix.  Then the parity check matrix is &amp;lt;math&amp;gt;P = (A^T|I_{n-k}).\,\!&amp;lt;/math&amp;gt;  In either case, one can arrive at the following parity check matrix for this code:&lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt;&lt;br /&gt;
P = \left(\begin{array}{ccccccc}&lt;br /&gt;
          1 &amp;amp; 1 &amp;amp; 1 &amp;amp; 0 &amp;amp; 1 &amp;amp; 0 &amp;amp; 0 \\&lt;br /&gt;
          1 &amp;amp; 1 &amp;amp; 0 &amp;amp; 1 &amp;amp; 0 &amp;amp; 1 &amp;amp; 0 \\&lt;br /&gt;
          0 &amp;amp; 1 &amp;amp; 1 &amp;amp; 1 &amp;amp; 0 &amp;amp; 0 &amp;amp; 1 &lt;br /&gt;
    \end{array}\right).&lt;br /&gt;
\,\!&amp;lt;/math&amp;gt;|F.7}}&lt;br /&gt;
It is useful to note that the code can also be defined by the parity check matrix.  Only the codewords are annihilated by the parity check matrix.&lt;br /&gt;
&lt;br /&gt;
===The Disjointness Condition and Correcting Errors===&lt;br /&gt;
&lt;br /&gt;
The motivation for the disjointness condition, [[#eqF.5|Eq.(F.5)]], is to associate each vector in the space with a particular code word.  That is, assuming that only certain errors occur, each error vector should be associated to a particular vector in the code space when the error is added to the original code word.  This partitions the set into disjoint subsets, with each containing only one code vector.  A message is decoded correctly if the vector (the one containing the error) is in the subset that is associated with the original vector (the one with no error).  For example, if one vector is sent, say &amp;lt;math&amp;gt; v_1 \,\!&amp;lt;/math&amp;gt;, and an error occurs during transmission to produce &amp;lt;math&amp;gt; v_2 = v_1 +e\,\!&amp;lt;/math&amp;gt;, then this vector must be in the subset containing &amp;lt;math&amp;gt; v_1 \,\!&amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
A way to decode is to record an array of possible code words, possible errors, and the combinations of those errors and code words.  The array can be set up as a top row of the code word vectors and a leftmost column of errors, with the element of the first row and the first column being the zero vector and all subsequent entries in the column being errors.  Then the element at the top of a column (say the jth column) is added to the error in the corresponding row (say the kth row) to get the j,k entry of the array.  With this array one can associate a column with a subset that is disjoint with the other sets.  Identifying the erred code word in a column associates it with a code word and thus corrects the error.&lt;br /&gt;
&lt;br /&gt;
===The Hamming Bound===&lt;br /&gt;
&lt;br /&gt;
The Hamming bound is a bound that restricts the rate of the code.  Due to the disjointness condition, a certain number of bits are required to ensure our ability to detect and correct errors.  Suppose there is a set of &amp;lt;math&amp;gt; n\,\!&amp;lt;/math&amp;gt; bit vectors for encoding &amp;lt;math&amp;gt; k\,\!&amp;lt;/math&amp;gt; bits of information.  There is a set of error vectors of weight &amp;lt;math&amp;gt; t \,\!&amp;lt;/math&amp;gt; that has &amp;lt;math&amp;gt; C(n,t)\,\!&amp;lt;/math&amp;gt; elements&amp;lt;ref&amp;gt;That is, &amp;lt;math&amp;gt; n \,\!&amp;lt;/math&amp;gt; choose &amp;lt;math&amp;gt; t \,\!&amp;lt;/math&amp;gt; vectors. The notation is &amp;lt;math&amp;gt; C(n,t) = {n\choose t} = \frac{n!}{(n-t)!t!}.\,\!&amp;lt;/math&amp;gt;&amp;lt;/ref&amp;gt;.  So the number of error vectors, including errors of weight up to &amp;lt;math&amp;gt; t \,\!&amp;lt;/math&amp;gt;, is &lt;br /&gt;
&amp;lt;math&amp;gt; \sum_{i=0}^t C(n,i). \,\!&amp;lt;/math&amp;gt;  (Note that no error is also part of the set of error vectors.  The objective is to be able to design a code that can correct all errors up to those of weight &amp;lt;math&amp;gt; t \,\!&amp;lt;/math&amp;gt;, and this includes no error at all.)  Since there are &amp;lt;math&amp;gt; 2^n\,\!&amp;lt;/math&amp;gt; vectors in the whole space of &amp;lt;math&amp;gt; n\,\!&amp;lt;/math&amp;gt; bits, and assuming &amp;lt;math&amp;gt; m\,\!&amp;lt;/math&amp;gt; vectors are used for the encoding, the Hamming bound is&lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt; &lt;br /&gt;
m\sum_{i=0}^t C(n,i) \leq 2^n.&lt;br /&gt;
\,\!&amp;lt;/math&amp;gt;|F.8}}&lt;br /&gt;
For linear codes, &amp;lt;math&amp;gt; m=2^k,\,\!&amp;lt;/math&amp;gt; so &lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt; &lt;br /&gt;
2^k\sum_{i=0}^t C(n,i) \leq 2^n.&lt;br /&gt;
\,\!&amp;lt;/math&amp;gt;|F.9}}&lt;br /&gt;
Taking the logarithm, &lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt; &lt;br /&gt;
k \leq n - \log_2\left(\sum_{i=0}^t C(n,i)\right).&lt;br /&gt;
\,\!&amp;lt;/math&amp;gt;|F.10}}&lt;br /&gt;
For large &amp;lt;math&amp;gt; n, k \,\!&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; t \,\!&amp;lt;/math&amp;gt;, we can use [[#LoPopescueSpiller|Stirling's formula]] to show that &lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt; &lt;br /&gt;
\frac{k}{n} \leq 1 - H\left(\frac{t}{n}\right),&lt;br /&gt;
\,\!&amp;lt;/math&amp;gt;|F.11}}&lt;br /&gt;
where &amp;lt;math&amp;gt; H(x) = -x\log x -(1-x)\log (1-x) \,\!&amp;lt;/math&amp;gt; and we have neglected an overall multiplicative constant that goes to 1 as  &amp;lt;math&amp;gt; n\rightarrow \infty. \,\!&amp;lt;/math&amp;gt;  (Again, see the article in [[Bibliography#LoPopescueSpiller|Lo, Popescu, and Spiller [26]]] by Steane.)&lt;br /&gt;
&lt;br /&gt;
===More Definitions===&lt;br /&gt;
&lt;br /&gt;
====Definition 11: Dual Code====&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt;\mathcal{C}\,\!&amp;lt;/math&amp;gt; be a code and let &amp;lt;math&amp;gt;v\,\!&amp;lt;/math&amp;gt; be a vector in the code space.  The '''dual code''', denoted &amp;lt;math&amp;gt;\mathcal{C}^\perp\,\!&amp;lt;/math&amp;gt;, is the set of all vectors that have zero inner product with all &amp;lt;math&amp;gt;v\in \mathcal{C}\,\!&amp;lt;/math&amp;gt;.  In other words, it is the set of all vectors &amp;lt;math&amp;gt;u\,\!&amp;lt;/math&amp;gt; such that &amp;lt;math&amp;gt;u\cdot v = 0\,\!&amp;lt;/math&amp;gt; for all  &amp;lt;math&amp;gt;v\in \mathcal{C}\,\!&amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
For binary vectors, a vector can be orthogonal to itself.  Note that this is different from ordinary vectors in 3-d space.  &lt;br /&gt;
&lt;br /&gt;
The dual code is a useful entity in classical error correction and will be used in the construction of the quantum error correcting codes known as [[Chapter 7 - Quantum Error Correcting Codes#CSS codes|CSS codes]].&lt;br /&gt;
&lt;br /&gt;
===Final Comments===&lt;br /&gt;
&lt;br /&gt;
As can be seen from the Hamming bound, there is a limit to the rate of an error correcting code.  This does not indicate whether or not codes that satisfy these bounds exist, but it does tell us that no codes exist that do not satisfy these bounds.  Encoding, decoding, error detection and correction are all difficult problems to solve in general.  One of the advantages of the linear codes is that they provide a systematic method for identifying errors on a code through the use of the parity check operation.  More generally, checking to see whether or not a bit string (vector) is in the code space would require a look-up table.  This would be much more time-consuming than using the parity check matrix; matrix multiplication is quite efficient relative to the look-up table.  &lt;br /&gt;
&lt;br /&gt;
Many of these ideas and definitions will be utilized in [[Chapter 7 - Quantum Error Correcting Codes|Chapter 7]] on quantum error correction.  Some linear codes, including the Hamming code above, will have quantum analogues---as do many quantum error correcting codes.  In quantum computers, as will be discussed, error correction is necessary due to the delicacy of quantum information.  Such discussions will be taken up in [[Chapter 7 - Quantum Error Correcting Codes|Chapter 7]].&lt;br /&gt;
&lt;br /&gt;
==Footnotes==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Ddghunter</name></author>
		
	</entry>
	<entry>
		<id>https://www2.physics.siu.edu/qunet/wiki/index.php?title=Appendix_F_-_Classical_Error_Correcting_Codes&amp;diff=2340</id>
		<title>Appendix F - Classical Error Correcting Codes</title>
		<link rel="alternate" type="text/html" href="https://www2.physics.siu.edu/qunet/wiki/index.php?title=Appendix_F_-_Classical_Error_Correcting_Codes&amp;diff=2340"/>
		<updated>2013-03-03T18:53:16Z</updated>

		<summary type="html">&lt;p&gt;Ddghunter: /* Parity Check Matrix */ punctuation&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===Introduction===&lt;br /&gt;
&lt;br /&gt;
Classical error correcting codes are in use in a wide variety of digital electronics and other classical information systems.  It is a good idea to learn some of the basic definitions, ideas, methods, and simple examples of classical error correcting codes in order to understand the (slightly) more complicated quantum error correcting codes.  There are many good introductions to classical error correction.  Here we follow a few sources which also discuss quantum error correcting codes: the book by [[Bibliography#LoeppWootters|Loepp and Wootters [25]]], an article in [[Bibliography#LoPopescueSpiller|Lo, Popescu, and Spiller [26]]] by Steane, [[Bibliography#GottDiss|Gottesman's Thesis [27]]], and [[Bibliography#Gaitan:book|Gaitan's Book [3]]] on quantum error correction, which also discusses classical error correction.&lt;br /&gt;
&lt;br /&gt;
===Binary Operations===&lt;br /&gt;
&lt;br /&gt;
The set &amp;lt;math&amp;gt; \{0,1\} \,\!&amp;lt;/math&amp;gt; is a group under addition.  (See [[Appendix D - Group Theory#Example 3|Section D.2.8]] of [[Appendix D - Group Theory|Appendix D]].)  The way this is achieved is by deciding that we will only use these two numbers in our language and using addition modulo 2, meaning &amp;lt;math&amp;gt; 0+0=0, 1+0 = 0+1 = 1, \,\!&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;1+1 =0\,\!&amp;lt;/math&amp;gt;.   If we also include the operation of multiplication and these two operations follow the distributive law, the set becomes a '''field''' (a Galois Field), which is denoted GF&amp;lt;math&amp;gt;(2)\,\!&amp;lt;/math&amp;gt;.  Since one often works with strings of bits, it is very useful to consider the string of bits to be a vector and to use vector addition (which is component-wise addition) and vector multiplication (which is the inner product).  For example, the addition of the vector &amp;lt;math&amp;gt;(0,0,1)\,\!&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;(0,1,1)\,\!&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;(0,0,1) + (0,1,1) = (0,1,0)\,\!&amp;lt;/math&amp;gt;.  The inner product between these two vectors is  &amp;lt;math&amp;gt;(0,0,1) \cdot (0,1,1) = 0\cdot 0 + 0\cdot 1 + 1\cdot 1 = 0 +0 +1=1\,\!&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Definitions and Basics===&lt;br /&gt;
&lt;br /&gt;
====Definition 1====&lt;br /&gt;
The inner product is also called a '''checksum''' or '''parity check''' since it shows whether or not the first and second vectors agree, or have an even number of 1's at the positions specified by the ones in the other vector.  We may say that the first vector satisfies the parity check of the other vector, or vice versa.&lt;br /&gt;
&lt;br /&gt;
====Definition 2====&lt;br /&gt;
The '''weight''' or '''Hamming weight''' is the number of non-zero components of a vector or string.  The weight of a vector &amp;lt;math&amp;gt;v\,\!&amp;lt;/math&amp;gt; is denoted wt(&amp;lt;math&amp;gt;v\,\!&amp;lt;/math&amp;gt;).  &lt;br /&gt;
&lt;br /&gt;
====Definition 3====&lt;br /&gt;
The '''Hamming distance''' is the number of places where two vectors differ.  Let the two vectors be &amp;lt;math&amp;gt;v\,\!&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;w\,\!&amp;lt;/math&amp;gt;.  Then the Hamming distance is also equal to wt(&amp;lt;math&amp;gt;v+w\,\!&amp;lt;/math&amp;gt;).  The Hamming distance between &amp;lt;math&amp;gt;v\,\!&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;w\,\!&amp;lt;/math&amp;gt; will be denoted &amp;lt;math&amp;gt;d_H(v,w)\,\!&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
====Definition 4====&lt;br /&gt;
We use &amp;lt;math&amp;gt;\{0,1\}^n\,\!&amp;lt;/math&amp;gt; to denote the set of all binary vectors of length &amp;lt;math&amp;gt;n\,\!&amp;lt;/math&amp;gt;.  A '''code''' &amp;lt;math&amp;gt;C\,\!&amp;lt;/math&amp;gt; of length &amp;lt;math&amp;gt;n\,\!&amp;lt;/math&amp;gt; is any subset of that set.  The set of all elements of &amp;lt;math&amp;gt;C\,\!&amp;lt;/math&amp;gt; is called the set of '''codewords'''.  We also say there are &amp;lt;math&amp;gt;2^n\,\!&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;n\,\!&amp;lt;/math&amp;gt;-bit words in the space.  &lt;br /&gt;
&lt;br /&gt;
Suppose &amp;lt;math&amp;gt;n\,\!&amp;lt;/math&amp;gt; bits are used to encode &amp;lt;math&amp;gt;k\,\!&amp;lt;/math&amp;gt; logical bits.  We use the notation &amp;lt;math&amp;gt;[n,k] \,\!&amp;lt;/math&amp;gt; do denote such a code.&lt;br /&gt;
&lt;br /&gt;
====Definition 5====&lt;br /&gt;
The '''minimum distance''' of a code is the smallest Hamming distance between any two non-equal vectors in a code.  This can be written &lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt;&lt;br /&gt;
d_{Hmin}(C) = \underset{v,w\in C,v\neq w}{\mbox{min}}d_H(v,w).&lt;br /&gt;
 \,\!&amp;lt;/math&amp;gt;|F.1}}&lt;br /&gt;
For shorthand, we also use &amp;lt;math&amp;gt; d(C)\,\!&amp;lt;/math&amp;gt; or &amp;lt;math&amp;gt; d\,\!&amp;lt;/math&amp;gt; if &amp;lt;math&amp;gt; C\,\!&amp;lt;/math&amp;gt; is understood.&lt;br /&gt;
&lt;br /&gt;
When that code has a distance &amp;lt;math&amp;gt;d\,\!&amp;lt;/math&amp;gt;, the notation &amp;lt;math&amp;gt;[n,k,d] \,\!&amp;lt;/math&amp;gt; is used.&lt;br /&gt;
&lt;br /&gt;
====Example 1====&lt;br /&gt;
It is interesting to note that if we encode redundantly using &amp;lt;math&amp;gt; 0_L=00 \,\!&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;1_L=11\,\!&amp;lt;/math&amp;gt; as our logical zero and logical one respectively, then we could detect single bit errors but not correct them.  For example, if we receive &amp;lt;math&amp;gt; 01\,\!&amp;lt;/math&amp;gt;, we know this cannot be one of our encoded states.  So an error must have occurred.  However, we don't know whether the sender sent &amp;lt;math&amp;gt; 0_L=00 \,\!&amp;lt;/math&amp;gt; or &amp;lt;math&amp;gt;1_L=11\,\!&amp;lt;/math&amp;gt;.  We do know that an error has occurred though, as long as we know only one error has occurred.  Such an encoding can be used as an '''error detecting code'''.  In this case there are two code words, &amp;lt;math&amp;gt; 0_L=00 \,\!&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;1_L=11\,\!&amp;lt;/math&amp;gt;, but four words in the space.  The minimum distance is 2, which is the distance between the two code words.&lt;br /&gt;
&lt;br /&gt;
====Example 2====&lt;br /&gt;
The three-bit redundant encoding was already given in [[Chapter 7 - Quantum Error Correcting Codes|Chapter 7]].  One takes logical zero and logical one states to be&lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt; &lt;br /&gt;
0_L =  000 \;\;\; \mbox{ and } \;\;\; 1_L = 111,&lt;br /&gt;
\,\!&amp;lt;/math&amp;gt;|F.2}}&lt;br /&gt;
where the subscript &amp;lt;math&amp;gt;L \,\!&amp;lt;/math&amp;gt; is used to denote a &amp;quot;logical&amp;quot; state; that is, one that is encoded.  Recall that this code is able to detect and correct one error.  In this case there are two code words out of eight possible words, and the minimal distance is 3.&lt;br /&gt;
&lt;br /&gt;
====Definition 6====&lt;br /&gt;
The '''rate''' of a code is given by the ration of the number of logical bits to the number of bits, &amp;lt;math&amp;gt;k/n\,\!&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
====Definition 7====&lt;br /&gt;
A '''linear code''' &amp;lt;math&amp;gt;C_l\,\!&amp;lt;/math&amp;gt; is a code that is closed under addition.&lt;br /&gt;
&lt;br /&gt;
===Linear Codes===&lt;br /&gt;
&lt;br /&gt;
Linear codes are particularly useful because they are able to efficiently identify errors and the associated correct codewords.  This ability is due to the added structure these codes have.  These will be discussed in the following sections. &lt;br /&gt;
&lt;br /&gt;
====Generator Matrix====&lt;br /&gt;
&lt;br /&gt;
For linear codes, any linear combination of codewords is a codeword.  One key feature of a linear code is that it can be specified by a &amp;lt;nowiki&amp;gt;''generator matrix,''&amp;lt;/nowiki&amp;gt; &amp;lt;math&amp;gt;G\,\!&amp;lt;/math&amp;gt;&amp;lt;ref&amp;gt;Recall that we are working with binary codes.  Thus the entries of the matrix will also be binary numbers, i.e., 0's and 1's.&amp;lt;/ref&amp;gt;. For an &amp;lt;math&amp;gt; [n,k]\,\!&amp;lt;/math&amp;gt; code, the '''generator matrix''' is an &amp;lt;math&amp;gt; n\times k\,\!&amp;lt;/math&amp;gt; matrix with columns that form a basis for the &amp;lt;math&amp;gt;k\,\!&amp;lt;/math&amp;gt;-dimensional coding sub-space of the &amp;lt;math&amp;gt;n\,\!&amp;lt;/math&amp;gt;-dimensional binary vector space.  In other words, the vectors comprising the rows form a basis that will span the code space.  (Note that one may also use the transpose of this matrix as the definition for &amp;lt;math&amp;gt;G\,\!&amp;lt;/math&amp;gt;.)  Any code word &amp;lt;math&amp;gt;w\,\!&amp;lt;/math&amp;gt; described by a vector &amp;lt;math&amp;gt;v\,\!&amp;lt;/math&amp;gt; can be written in terms of the generator matrix as &amp;lt;math&amp;gt;w = Gv\,\!&amp;lt;/math&amp;gt;.  Note that &amp;lt;math&amp;gt;G\,\!&amp;lt;/math&amp;gt; is independent of the input and output vectors.  In addition, &amp;lt;math&amp;gt;G\,\!&amp;lt;/math&amp;gt; is not unique.  If columns are switched or even added to produce a new vector that replaces a column, then the generator matrix is still valid for the code.  This is due to the requirement that the columns be linearly independent, which is still satisfied if these operations are performed.&lt;br /&gt;
&lt;br /&gt;
====Parity Check Matrix====&lt;br /&gt;
Once &amp;lt;math&amp;gt;G\,\!&amp;lt;/math&amp;gt; is obtained, one can calculate another useful matrix, &amp;lt;math&amp;gt;P.\,\!&amp;lt;/math&amp;gt;  &amp;lt;math&amp;gt;P\,\!&amp;lt;/math&amp;gt; is an &amp;lt;math&amp;gt;(n- k)\times n\,\!&amp;lt;/math&amp;gt; matrix which has the property that&lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt;&lt;br /&gt;
PG = 0.&lt;br /&gt;
\,\!&amp;lt;/math&amp;gt;|F.3}}&lt;br /&gt;
The matrix &amp;lt;math&amp;gt;P\,\!&amp;lt;/math&amp;gt; is called the '''parity check matrix''' or '''dual matrix'''.  The rank of &amp;lt;math&amp;gt;P\,\!&amp;lt;/math&amp;gt; is at most  &amp;lt;math&amp;gt;n- k\,\!&amp;lt;/math&amp;gt; and has the property that it annihilates any code word.  To see this, recall any code word is written as &amp;lt;math&amp;gt;Gv\,\!&amp;lt;/math&amp;gt;: &amp;lt;math&amp;gt;PGv =0\,\!&amp;lt;/math&amp;gt; since &amp;lt;math&amp;gt;PG =0.\,\!&amp;lt;/math&amp;gt;  Also, due to the rank of &amp;lt;math&amp;gt;P,\,\!&amp;lt;/math&amp;gt; it can be shown that &amp;lt;math&amp;gt;Pw =0\,\!&amp;lt;/math&amp;gt; only if &amp;lt;math&amp;gt;w\,\!&amp;lt;/math&amp;gt; is a code word.  That is to say, &amp;lt;math&amp;gt;Pw=0\,\!&amp;lt;/math&amp;gt; if and only if &amp;lt;math&amp;gt;w\,\!&amp;lt;/math&amp;gt; is a code word.  This means that &amp;lt;math&amp;gt;P\,\!&amp;lt;/math&amp;gt; can be used to test whether or not a word is in the code. &lt;br /&gt;
&lt;br /&gt;
Suppose an error occurs on a code word &amp;lt;math&amp;gt;w\,\!&amp;lt;/math&amp;gt; to produce &amp;lt;math&amp;gt;w^\prime = w + e\,\!&amp;lt;/math&amp;gt;.  It follows that&lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt;&lt;br /&gt;
Pw^\prime = P(w+e) = Pe,&lt;br /&gt;
\,\!&amp;lt;/math&amp;gt;|F.4}}&lt;br /&gt;
since &amp;lt;math&amp;gt;Pw=0\,\!&amp;lt;/math&amp;gt;.  This result, &amp;lt;math&amp;gt;Pe\,\!&amp;lt;/math&amp;gt; is called the '''error syndrome''' and the measurement to identify &amp;lt;math&amp;gt;Pe\,\!&amp;lt;/math&amp;gt; is the '''syndrome measurement'''.  Therefore, the result depends only on the error and not on the original code word.  If the error can be determined from this result, then it can be corrected independent of the code word.  However, in order to have &amp;lt;math&amp;gt;Pe\,\!&amp;lt;/math&amp;gt; be unique, two different results, &amp;lt;math&amp;gt;Pe_1\,\!&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;Pe_2\,\!&amp;lt;/math&amp;gt;, must not be equal.  This is possible if a distance &amp;lt;math&amp;gt;d\,\!&amp;lt;/math&amp;gt; code is constructed such that the parity check matrix has &amp;lt;math&amp;gt;d-1=2t\,\!&amp;lt;/math&amp;gt; linearly independent columns.  This enables the errors to be identified and corrected.&lt;br /&gt;
&lt;br /&gt;
It is important to emphasize that these two matrices define the code as well as the check and necessary recovery operations.  The matrix &amp;lt;math&amp;gt;G\,\!&amp;lt;/math&amp;gt; is determined by the code.  Once this matrix is determined, there is a method for determining the parity check matrix, &amp;lt;math&amp;gt;P\,\!&amp;lt;/math&amp;gt; which is a set of &amp;lt;math&amp;gt;n-k\,\!&amp;lt;/math&amp;gt; mutually orthogonal vectors that are also orthogonal to the code space defined by the generator matrix.  It is possible to determine the parity matrix from the generator matrix.  The method for doing this can be found in Steane's article in [[Bibliography#LoPopescuSpiller|Lo, Popescu, and Spiller [26]]] and it goes as follows.  One first puts &amp;lt;math&amp;gt;G^T\,\!&amp;lt;/math&amp;gt; in the form of an augmented matrix &amp;lt;math&amp;gt;(I_k|A),\,\!&amp;lt;/math&amp;gt; where &amp;lt;math&amp;gt;I_k\,\!&amp;lt;/math&amp;gt; is the &amp;lt;math&amp;gt;k\times k\,\!&amp;lt;/math&amp;gt; identity matrix.  Then the parity check matrix is &amp;lt;math&amp;gt;P = (A^T|I_{n-k}).\,\!&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Errors===&lt;br /&gt;
&lt;br /&gt;
For any classical error correcting code, there are general conditions that must be satisfied in order for the code to be able to detect and correct errors.  The two examples above show how the error can be detected; here, the objective is to give some general conditions.  &lt;br /&gt;
&lt;br /&gt;
Note that any state containing an error may be written as the sum of the original (logical or encoded) state  &amp;lt;math&amp;gt;w \,\!&amp;lt;/math&amp;gt; and another vector &amp;lt;math&amp;gt;e \,\!&amp;lt;/math&amp;gt;.  The error vector &amp;lt;math&amp;gt;e \,\!&amp;lt;/math&amp;gt; has ones in the places where errors are present and zeroes everywhere else.  To ensure that the error may be corrected, the following condition must be satisfied for two states with errors occurring:&lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt;&lt;br /&gt;
w_1 + e_1 \neq w_2 + e_2.&lt;br /&gt;
\,\!&amp;lt;/math&amp;gt;|F.5}}&lt;br /&gt;
This condition is called the '''disjointness condition'''.  This condition means that an error on one state cannot be confused with an error on another state.  If it could, then the state including the error could not be uniquely identified with an encoded state and the state could not be corrected to its original state before the error occurred.  More specifically, for a code to correct &amp;lt;math&amp;gt;t\,\!&amp;lt;/math&amp;gt;  single-bit errors, it must have distance at least &amp;lt;math&amp;gt;2t + 1 \,\!&amp;lt;/math&amp;gt; between any two codewords; i.e., it must be true that &amp;lt;math&amp;gt;d(C) \geq 2t + 1 \,\!&amp;lt;/math&amp;gt;.  An &amp;lt;math&amp;gt;[n,k]\,\!&amp;lt;/math&amp;gt; code with minimal distance &amp;lt;math&amp;gt;d \,\!&amp;lt;/math&amp;gt; is denoted &amp;lt;math&amp;gt;[n,k,d]\,\!&amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Example 3====&lt;br /&gt;
An important example of an error correcting code is called the &amp;lt;math&amp;gt;[7,4,3]&amp;lt;/math&amp;gt; Hamming code.  This code, as the notation indicates, encodes &amp;lt;math&amp;gt;k=4&amp;lt;/math&amp;gt; bits of information into &amp;lt;math&amp;gt;n=7&amp;lt;/math&amp;gt; bits.  It also does it in such a way that one error can be detected and corrected since it has a distance of &amp;lt;math&amp;gt;3&amp;lt;/math&amp;gt;.  The generator matrix for this code can be taken to be &lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt;&lt;br /&gt;
G^T = \left(\begin{array}{ccccccc}&lt;br /&gt;
          1 &amp;amp; 0 &amp;amp; 0 &amp;amp; 0 &amp;amp; 1 &amp;amp; 1 &amp;amp; 0 \\&lt;br /&gt;
          0 &amp;amp; 1 &amp;amp; 0 &amp;amp; 0 &amp;amp; 1 &amp;amp; 1 &amp;amp; 1 \\&lt;br /&gt;
          0 &amp;amp; 0 &amp;amp; 1 &amp;amp; 0 &amp;amp; 1 &amp;amp; 0 &amp;amp; 1 \\&lt;br /&gt;
          0 &amp;amp; 0 &amp;amp; 0 &amp;amp; 1 &amp;amp; 0 &amp;amp; 1 &amp;amp; 1 &lt;br /&gt;
    \end{array}\right).&lt;br /&gt;
\,\!&amp;lt;/math&amp;gt;|F.6}}&lt;br /&gt;
(See for example [[Bibliography#LoeppWootters|Loepp and Wootters [25]]].)  From this the parity check matrix, &amp;lt;math&amp;gt;P\,\!&amp;lt;/math&amp;gt; can be calculated (as stated above) by finding a set of &amp;lt;math&amp;gt;n-k\,\!&amp;lt;/math&amp;gt; mutually orthogonal vectors that are also orthogonal to the code space defined by the generator matrix.  Alternatively, one could use the method in Steane's article in [[Bibliography#LoPopescuSpiller|Lo, Popescu, and Spiller [26]]].  Put &amp;lt;math&amp;gt;G^T\,\!&amp;lt;/math&amp;gt; in the form &amp;lt;math&amp;gt;(I_k|A),\,\!&amp;lt;/math&amp;gt; where &amp;lt;math&amp;gt;I_k\,\!&amp;lt;/math&amp;gt; is the &amp;lt;math&amp;gt;k\times k\,\!&amp;lt;/math&amp;gt; identity matrix.  Then the parity check matrix is &amp;lt;math&amp;gt;P = (A^T|I_{n-k}).\,\!&amp;lt;/math&amp;gt;  In either case, one can arrive at the following parity check matrix for this code:&lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt;&lt;br /&gt;
P = \left(\begin{array}{ccccccc}&lt;br /&gt;
          1 &amp;amp; 1 &amp;amp; 1 &amp;amp; 0 &amp;amp; 1 &amp;amp; 0 &amp;amp; 0 \\&lt;br /&gt;
          1 &amp;amp; 1 &amp;amp; 0 &amp;amp; 1 &amp;amp; 0 &amp;amp; 1 &amp;amp; 0 \\&lt;br /&gt;
          0 &amp;amp; 1 &amp;amp; 1 &amp;amp; 1 &amp;amp; 0 &amp;amp; 0 &amp;amp; 1 &lt;br /&gt;
    \end{array}\right).&lt;br /&gt;
\,\!&amp;lt;/math&amp;gt;|F.7}}&lt;br /&gt;
It is useful to note that the code can also be defined by the parity check matrix.  Only the codewords are annihilated by the parity check matrix.&lt;br /&gt;
&lt;br /&gt;
===The Disjointness Condition and Correcting Errors===&lt;br /&gt;
&lt;br /&gt;
The motivation for the disjointness condition, [[#eqF.5|Eq.(F.5)]], is to associate each vector in the space with a particular code word.  That is, assuming that only certain errors occur, each error vector should be associated to a particular vector in the code space when the error is added to the original code word.  This partitions the set into disjoint subsets, with each containing only one code vector.  A message is decoded correctly if the vector (the one containing the error) is in the subset that is associated with the original vector (the one with no error).  For example, if one vector is sent, say &amp;lt;math&amp;gt; v_1 \,\!&amp;lt;/math&amp;gt;, and an error occurs during transmission to produce &amp;lt;math&amp;gt; v_2 = v_1 +e\,\!&amp;lt;/math&amp;gt;, then this vector must be in the subset containing &amp;lt;math&amp;gt; v_1 \,\!&amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
A way to decode is to record an array of possible code words, possible errors, and the combinations of those errors and code words.  The array can be set up as a top row of the code word vectors and a leftmost column of errors, with the element of the first row and the first column being the zero vector and all subsequent entries in the column being errors.  Then the element at the top of a column (say the jth column) is added to the error in the corresponding row (say the kth row) to get the j,k entry of the array.  With this array one can associate a column with a subset that is disjoint with the other sets.  Identifying the erred code word in a column associates it with a code word and thus corrects the error.&lt;br /&gt;
&lt;br /&gt;
===The Hamming Bound===&lt;br /&gt;
&lt;br /&gt;
The Hamming bound is a bound that restricts the rate of the code.  Due to the disjointness condition, a certain number of bits are required to ensure our ability to detect and correct errors.  Suppose there is a set of &amp;lt;math&amp;gt; n\,\!&amp;lt;/math&amp;gt; bit vectors for encoding &amp;lt;math&amp;gt; k\,\!&amp;lt;/math&amp;gt; bits of information.  There is a set of error vectors of weight &amp;lt;math&amp;gt; t \,\!&amp;lt;/math&amp;gt; that has &amp;lt;math&amp;gt; C(n,t)\,\!&amp;lt;/math&amp;gt; elements&amp;lt;ref&amp;gt;That is, &amp;lt;math&amp;gt; n \,\!&amp;lt;/math&amp;gt; choose &amp;lt;math&amp;gt; t \,\!&amp;lt;/math&amp;gt; vectors. The notation is &amp;lt;math&amp;gt; C(n,t) = {n\choose t} = \frac{n!}{(n-t)!t!}.\,\!&amp;lt;/math&amp;gt;&amp;lt;/ref&amp;gt;.  So the number of error vectors, including errors of weight up to &amp;lt;math&amp;gt; t \,\!&amp;lt;/math&amp;gt;, is &lt;br /&gt;
&amp;lt;math&amp;gt; \sum_{i=0}^t C(n,i). \,\!&amp;lt;/math&amp;gt;  (Note that no error is also part of the set of error vectors.  The objective is to be able to design a code that can correct all errors up to those of weight &amp;lt;math&amp;gt; t \,\!&amp;lt;/math&amp;gt;, and this includes no error at all.)  Since there are &amp;lt;math&amp;gt; 2^n\,\!&amp;lt;/math&amp;gt; vectors in the whole space of &amp;lt;math&amp;gt; n\,\!&amp;lt;/math&amp;gt; bits, and assuming &amp;lt;math&amp;gt; m\,\!&amp;lt;/math&amp;gt; vectors are used for the encoding, the Hamming bound is&lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt; &lt;br /&gt;
m\sum_{i=0}^t C(n,i) \leq 2^n.&lt;br /&gt;
\,\!&amp;lt;/math&amp;gt;|F.8}}&lt;br /&gt;
For linear codes, &amp;lt;math&amp;gt; m=2^k,\,\!&amp;lt;/math&amp;gt; so &lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt; &lt;br /&gt;
2^k\sum_{i=0}^t C(n,i) \leq 2^n.&lt;br /&gt;
\,\!&amp;lt;/math&amp;gt;|F.9}}&lt;br /&gt;
Taking the logarithm, &lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt; &lt;br /&gt;
k \leq n - \log_2\left(\sum_{i=0}^t C(n,i)\right).&lt;br /&gt;
\,\!&amp;lt;/math&amp;gt;|F.10}}&lt;br /&gt;
For large &amp;lt;math&amp;gt; n, k \,\!&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; t \,\!&amp;lt;/math&amp;gt;, we can use [[#LoPopescueSpiller|Stirling's formula]] to show that &lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt; &lt;br /&gt;
\frac{k}{n} \leq 1 - H\left(\frac{t}{n}\right),&lt;br /&gt;
\,\!&amp;lt;/math&amp;gt;|F.11}}&lt;br /&gt;
where &amp;lt;math&amp;gt; H(x) = -x\log x -(1-x)\log (1-x) \,\!&amp;lt;/math&amp;gt; and we have neglected an overall multiplicative constant that goes to 1 as  &amp;lt;math&amp;gt; n\rightarrow \infty. \,\!&amp;lt;/math&amp;gt;  (Again, see the article in [[Bibliography#LoPopescueSpiller|Lo, Popescu, and Spiller [26]]] by Steane.)&lt;br /&gt;
&lt;br /&gt;
===More Definitions===&lt;br /&gt;
&lt;br /&gt;
====Definition 11: Dual Code====&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt;\mathcal{C}\,\!&amp;lt;/math&amp;gt; be a code and let &amp;lt;math&amp;gt;v\,\!&amp;lt;/math&amp;gt; be a vector in the code space.  The '''dual code''', denoted &amp;lt;math&amp;gt;\mathcal{C}^\perp\,\!&amp;lt;/math&amp;gt;, is the set of all vectors that have zero inner product with all &amp;lt;math&amp;gt;v\in \mathcal{C}\,\!&amp;lt;/math&amp;gt;.  In other words, it is the set of all vectors &amp;lt;math&amp;gt;u\,\!&amp;lt;/math&amp;gt; such that &amp;lt;math&amp;gt;u\cdot v = 0\,\!&amp;lt;/math&amp;gt; for all  &amp;lt;math&amp;gt;v\in \mathcal{C}\,\!&amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
For binary vectors, a vector can be orthogonal to itself.  Note that this is different from ordinary vectors in 3-d space.  &lt;br /&gt;
&lt;br /&gt;
The dual code is a useful entity in classical error correction and will be used in the construction of the quantum error correcting codes known as [[Chapter 7 - Quantum Error Correcting Codes#CSS codes|CSS codes]].&lt;br /&gt;
&lt;br /&gt;
===Final Comments===&lt;br /&gt;
&lt;br /&gt;
As can be seen from the Hamming bound, there is a limit to the rate of an error correcting code.  This does not indicate whether or not codes that satisfy these bounds exist, but it does tell us that no codes exist that do not satisfy these bounds.  Encoding, decoding, error detection and correction are all difficult problems to solve in general.  One of the advantages of the linear codes is that they provide a systematic method for identifying errors on a code through the use of the parity check operation.  More generally, checking to see whether or not a bit string (vector) is in the code space would require a look-up table.  This would be much more time-consuming than using the parity check matrix; matrix multiplication is quite efficient relative to the look-up table.  &lt;br /&gt;
&lt;br /&gt;
Many of these ideas and definitions will be utilized in [[Chapter 7 - Quantum Error Correcting Codes|Chapter 7]] on quantum error correction.  Some linear codes, including the Hamming code above, will have quantum analogues---as do many quantum error correcting codes.  In quantum computers, as will be discussed, error correction is necessary due to the delicacy of quantum information.  Such discussions will be taken up in [[Chapter 7 - Quantum Error Correcting Codes|Chapter 7]].&lt;br /&gt;
&lt;br /&gt;
==Footnotes==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Ddghunter</name></author>
		
	</entry>
	<entry>
		<id>https://www2.physics.siu.edu/qunet/wiki/index.php?title=Appendix_F_-_Classical_Error_Correcting_Codes&amp;diff=2339</id>
		<title>Appendix F - Classical Error Correcting Codes</title>
		<link rel="alternate" type="text/html" href="https://www2.physics.siu.edu/qunet/wiki/index.php?title=Appendix_F_-_Classical_Error_Correcting_Codes&amp;diff=2339"/>
		<updated>2013-03-03T18:45:12Z</updated>

		<summary type="html">&lt;p&gt;Ddghunter: /* Parity Check Matrix */ punctuation&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===Introduction===&lt;br /&gt;
&lt;br /&gt;
Classical error correcting codes are in use in a wide variety of digital electronics and other classical information systems.  It is a good idea to learn some of the basic definitions, ideas, methods, and simple examples of classical error correcting codes in order to understand the (slightly) more complicated quantum error correcting codes.  There are many good introductions to classical error correction.  Here we follow a few sources which also discuss quantum error correcting codes: the book by [[Bibliography#LoeppWootters|Loepp and Wootters [25]]], an article in [[Bibliography#LoPopescueSpiller|Lo, Popescu, and Spiller [26]]] by Steane, [[Bibliography#GottDiss|Gottesman's Thesis [27]]], and [[Bibliography#Gaitan:book|Gaitan's Book [3]]] on quantum error correction, which also discusses classical error correction.&lt;br /&gt;
&lt;br /&gt;
===Binary Operations===&lt;br /&gt;
&lt;br /&gt;
The set &amp;lt;math&amp;gt; \{0,1\} \,\!&amp;lt;/math&amp;gt; is a group under addition.  (See [[Appendix D - Group Theory#Example 3|Section D.2.8]] of [[Appendix D - Group Theory|Appendix D]].)  The way this is achieved is by deciding that we will only use these two numbers in our language and using addition modulo 2, meaning &amp;lt;math&amp;gt; 0+0=0, 1+0 = 0+1 = 1, \,\!&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;1+1 =0\,\!&amp;lt;/math&amp;gt;.   If we also include the operation of multiplication and these two operations follow the distributive law, the set becomes a '''field''' (a Galois Field), which is denoted GF&amp;lt;math&amp;gt;(2)\,\!&amp;lt;/math&amp;gt;.  Since one often works with strings of bits, it is very useful to consider the string of bits to be a vector and to use vector addition (which is component-wise addition) and vector multiplication (which is the inner product).  For example, the addition of the vector &amp;lt;math&amp;gt;(0,0,1)\,\!&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;(0,1,1)\,\!&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;(0,0,1) + (0,1,1) = (0,1,0)\,\!&amp;lt;/math&amp;gt;.  The inner product between these two vectors is  &amp;lt;math&amp;gt;(0,0,1) \cdot (0,1,1) = 0\cdot 0 + 0\cdot 1 + 1\cdot 1 = 0 +0 +1=1\,\!&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Definitions and Basics===&lt;br /&gt;
&lt;br /&gt;
====Definition 1====&lt;br /&gt;
The inner product is also called a '''checksum''' or '''parity check''' since it shows whether or not the first and second vectors agree, or have an even number of 1's at the positions specified by the ones in the other vector.  We may say that the first vector satisfies the parity check of the other vector, or vice versa.&lt;br /&gt;
&lt;br /&gt;
====Definition 2====&lt;br /&gt;
The '''weight''' or '''Hamming weight''' is the number of non-zero components of a vector or string.  The weight of a vector &amp;lt;math&amp;gt;v\,\!&amp;lt;/math&amp;gt; is denoted wt(&amp;lt;math&amp;gt;v\,\!&amp;lt;/math&amp;gt;).  &lt;br /&gt;
&lt;br /&gt;
====Definition 3====&lt;br /&gt;
The '''Hamming distance''' is the number of places where two vectors differ.  Let the two vectors be &amp;lt;math&amp;gt;v\,\!&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;w\,\!&amp;lt;/math&amp;gt;.  Then the Hamming distance is also equal to wt(&amp;lt;math&amp;gt;v+w\,\!&amp;lt;/math&amp;gt;).  The Hamming distance between &amp;lt;math&amp;gt;v\,\!&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;w\,\!&amp;lt;/math&amp;gt; will be denoted &amp;lt;math&amp;gt;d_H(v,w)\,\!&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
====Definition 4====&lt;br /&gt;
We use &amp;lt;math&amp;gt;\{0,1\}^n\,\!&amp;lt;/math&amp;gt; to denote the set of all binary vectors of length &amp;lt;math&amp;gt;n\,\!&amp;lt;/math&amp;gt;.  A '''code''' &amp;lt;math&amp;gt;C\,\!&amp;lt;/math&amp;gt; of length &amp;lt;math&amp;gt;n\,\!&amp;lt;/math&amp;gt; is any subset of that set.  The set of all elements of &amp;lt;math&amp;gt;C\,\!&amp;lt;/math&amp;gt; is called the set of '''codewords'''.  We also say there are &amp;lt;math&amp;gt;2^n\,\!&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;n\,\!&amp;lt;/math&amp;gt;-bit words in the space.  &lt;br /&gt;
&lt;br /&gt;
Suppose &amp;lt;math&amp;gt;n\,\!&amp;lt;/math&amp;gt; bits are used to encode &amp;lt;math&amp;gt;k\,\!&amp;lt;/math&amp;gt; logical bits.  We use the notation &amp;lt;math&amp;gt;[n,k] \,\!&amp;lt;/math&amp;gt; do denote such a code.&lt;br /&gt;
&lt;br /&gt;
====Definition 5====&lt;br /&gt;
The '''minimum distance''' of a code is the smallest Hamming distance between any two non-equal vectors in a code.  This can be written &lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt;&lt;br /&gt;
d_{Hmin}(C) = \underset{v,w\in C,v\neq w}{\mbox{min}}d_H(v,w).&lt;br /&gt;
 \,\!&amp;lt;/math&amp;gt;|F.1}}&lt;br /&gt;
For shorthand, we also use &amp;lt;math&amp;gt; d(C)\,\!&amp;lt;/math&amp;gt; or &amp;lt;math&amp;gt; d\,\!&amp;lt;/math&amp;gt; if &amp;lt;math&amp;gt; C\,\!&amp;lt;/math&amp;gt; is understood.&lt;br /&gt;
&lt;br /&gt;
When that code has a distance &amp;lt;math&amp;gt;d\,\!&amp;lt;/math&amp;gt;, the notation &amp;lt;math&amp;gt;[n,k,d] \,\!&amp;lt;/math&amp;gt; is used.&lt;br /&gt;
&lt;br /&gt;
====Example 1====&lt;br /&gt;
It is interesting to note that if we encode redundantly using &amp;lt;math&amp;gt; 0_L=00 \,\!&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;1_L=11\,\!&amp;lt;/math&amp;gt; as our logical zero and logical one respectively, then we could detect single bit errors but not correct them.  For example, if we receive &amp;lt;math&amp;gt; 01\,\!&amp;lt;/math&amp;gt;, we know this cannot be one of our encoded states.  So an error must have occurred.  However, we don't know whether the sender sent &amp;lt;math&amp;gt; 0_L=00 \,\!&amp;lt;/math&amp;gt; or &amp;lt;math&amp;gt;1_L=11\,\!&amp;lt;/math&amp;gt;.  We do know that an error has occurred though, as long as we know only one error has occurred.  Such an encoding can be used as an '''error detecting code'''.  In this case there are two code words, &amp;lt;math&amp;gt; 0_L=00 \,\!&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;1_L=11\,\!&amp;lt;/math&amp;gt;, but four words in the space.  The minimum distance is 2, which is the distance between the two code words.&lt;br /&gt;
&lt;br /&gt;
====Example 2====&lt;br /&gt;
The three-bit redundant encoding was already given in [[Chapter 7 - Quantum Error Correcting Codes|Chapter 7]].  One takes logical zero and logical one states to be&lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt; &lt;br /&gt;
0_L =  000 \;\;\; \mbox{ and } \;\;\; 1_L = 111,&lt;br /&gt;
\,\!&amp;lt;/math&amp;gt;|F.2}}&lt;br /&gt;
where the subscript &amp;lt;math&amp;gt;L \,\!&amp;lt;/math&amp;gt; is used to denote a &amp;quot;logical&amp;quot; state; that is, one that is encoded.  Recall that this code is able to detect and correct one error.  In this case there are two code words out of eight possible words, and the minimal distance is 3.&lt;br /&gt;
&lt;br /&gt;
====Definition 6====&lt;br /&gt;
The '''rate''' of a code is given by the ration of the number of logical bits to the number of bits, &amp;lt;math&amp;gt;k/n\,\!&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
====Definition 7====&lt;br /&gt;
A '''linear code''' &amp;lt;math&amp;gt;C_l\,\!&amp;lt;/math&amp;gt; is a code that is closed under addition.&lt;br /&gt;
&lt;br /&gt;
===Linear Codes===&lt;br /&gt;
&lt;br /&gt;
Linear codes are particularly useful because they are able to efficiently identify errors and the associated correct codewords.  This ability is due to the added structure these codes have.  These will be discussed in the following sections. &lt;br /&gt;
&lt;br /&gt;
====Generator Matrix====&lt;br /&gt;
&lt;br /&gt;
For linear codes, any linear combination of codewords is a codeword.  One key feature of a linear code is that it can be specified by a &amp;lt;nowiki&amp;gt;''generator matrix,''&amp;lt;/nowiki&amp;gt; &amp;lt;math&amp;gt;G\,\!&amp;lt;/math&amp;gt;&amp;lt;ref&amp;gt;Recall that we are working with binary codes.  Thus the entries of the matrix will also be binary numbers, i.e., 0's and 1's.&amp;lt;/ref&amp;gt;. For an &amp;lt;math&amp;gt; [n,k]\,\!&amp;lt;/math&amp;gt; code, the '''generator matrix''' is an &amp;lt;math&amp;gt; n\times k\,\!&amp;lt;/math&amp;gt; matrix with columns that form a basis for the &amp;lt;math&amp;gt;k\,\!&amp;lt;/math&amp;gt;-dimensional coding sub-space of the &amp;lt;math&amp;gt;n\,\!&amp;lt;/math&amp;gt;-dimensional binary vector space.  In other words, the vectors comprising the rows form a basis that will span the code space.  (Note that one may also use the transpose of this matrix as the definition for &amp;lt;math&amp;gt;G\,\!&amp;lt;/math&amp;gt;.)  Any code word &amp;lt;math&amp;gt;w\,\!&amp;lt;/math&amp;gt; described by a vector &amp;lt;math&amp;gt;v\,\!&amp;lt;/math&amp;gt; can be written in terms of the generator matrix as &amp;lt;math&amp;gt;w = Gv\,\!&amp;lt;/math&amp;gt;.  Note that &amp;lt;math&amp;gt;G\,\!&amp;lt;/math&amp;gt; is independent of the input and output vectors.  In addition, &amp;lt;math&amp;gt;G\,\!&amp;lt;/math&amp;gt; is not unique.  If columns are switched or even added to produce a new vector that replaces a column, then the generator matrix is still valid for the code.  This is due to the requirement that the columns be linearly independent, which is still satisfied if these operations are performed.&lt;br /&gt;
&lt;br /&gt;
====Parity Check Matrix====&lt;br /&gt;
Once &amp;lt;math&amp;gt;G\,\!&amp;lt;/math&amp;gt; is obtained, one can calculate another useful matrix, &amp;lt;math&amp;gt;P.\,\!&amp;lt;/math&amp;gt;  &amp;lt;math&amp;gt;P\,\!&amp;lt;/math&amp;gt; is an &amp;lt;math&amp;gt;(n\times k)\times n\,\!&amp;lt;/math&amp;gt; matrix which has the property that&lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt;&lt;br /&gt;
PG = 0.&lt;br /&gt;
\,\!&amp;lt;/math&amp;gt;|F.3}}&lt;br /&gt;
The matrix &amp;lt;math&amp;gt;P\,\!&amp;lt;/math&amp;gt; is called the '''parity check matrix''' or '''dual matrix'''.  The rank of &amp;lt;math&amp;gt;P\,\!&amp;lt;/math&amp;gt; is at most  &amp;lt;math&amp;gt;n- k\,\!&amp;lt;/math&amp;gt; and has the property that it annihilates any code word.  To see this, recall any code word is written as &amp;lt;math&amp;gt;Gv\,\!&amp;lt;/math&amp;gt;: &amp;lt;math&amp;gt;PGv =0\,\!&amp;lt;/math&amp;gt; since &amp;lt;math&amp;gt;PG =0\,\!&amp;lt;/math&amp;gt;.  Also, due to the rank of &amp;lt;math&amp;gt;P\,\!&amp;lt;/math&amp;gt;, it can be shown that &amp;lt;math&amp;gt;Pw =0\,\!&amp;lt;/math&amp;gt; only if &amp;lt;math&amp;gt;w\,\!&amp;lt;/math&amp;gt; is a code word.  That is to say, &amp;lt;math&amp;gt;Pw=0\,\!&amp;lt;/math&amp;gt; if and only if &amp;lt;math&amp;gt;w\,\!&amp;lt;/math&amp;gt; is a code word.  This means that &amp;lt;math&amp;gt;P\,\!&amp;lt;/math&amp;gt; can be used to test whether or not a word is in the code. &lt;br /&gt;
&lt;br /&gt;
Suppose an error occurs on a code word &amp;lt;math&amp;gt;w\,\!&amp;lt;/math&amp;gt; to produce &amp;lt;math&amp;gt;w^\prime = w + e\,\!&amp;lt;/math&amp;gt;.  It follows that&lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt;&lt;br /&gt;
Pw^\prime = P(w+e) = Pe,&lt;br /&gt;
\,\!&amp;lt;/math&amp;gt;|F.4}}&lt;br /&gt;
since &amp;lt;math&amp;gt;Pw=0\,\!&amp;lt;/math&amp;gt;.  This result, &amp;lt;math&amp;gt;Pe\,\!&amp;lt;/math&amp;gt; is called the '''error syndrome''' and the measurement to identify &amp;lt;math&amp;gt;Pe\,\!&amp;lt;/math&amp;gt; is the '''syndrome measurement'''.  Therefore, the result depends only on the error and not on the original code word.  If the error can be determined from this result, then it can be corrected independent of the code word.  However, in order to have &amp;lt;math&amp;gt;Pe\,\!&amp;lt;/math&amp;gt; be unique, two different results, &amp;lt;math&amp;gt;Pe_1\,\!&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;Pe_2\,\!&amp;lt;/math&amp;gt;, must not be equal.  This is possible if a distance &amp;lt;math&amp;gt;d\,\!&amp;lt;/math&amp;gt; code is constructed such that the parity check matrix has &amp;lt;math&amp;gt;d-1=2t\,\!&amp;lt;/math&amp;gt; linearly independent columns.  This enables the errors to be identified and corrected.&lt;br /&gt;
&lt;br /&gt;
It is important to emphasize that these two matrices define the code as well as the check and necessary recovery operations.  The matrix &amp;lt;math&amp;gt;G\,\!&amp;lt;/math&amp;gt; is determined by the code.  Once this matrix is determined, there is a method for determining the parity check matrix, &amp;lt;math&amp;gt;P\,\!&amp;lt;/math&amp;gt; which is a set of &amp;lt;math&amp;gt;n-k\,\!&amp;lt;/math&amp;gt; mutually orthogonal vectors that are also orthogonal to the code space defined by the generator matrix.  It is possible to determine the parity matrix from the generator matrix.  The method for doing this can be found in Steane's article in [[Bibliography#LoPopescuSpiller|Lo, Popescu, and Spiller [26]]] and it goes as follows.  One first puts &amp;lt;math&amp;gt;G^T\,\!&amp;lt;/math&amp;gt; in the form of an augmented matrix &amp;lt;math&amp;gt;(I_k|A),\,\!&amp;lt;/math&amp;gt; where &amp;lt;math&amp;gt;I_k\,\!&amp;lt;/math&amp;gt; is the &amp;lt;math&amp;gt;k\times k\,\!&amp;lt;/math&amp;gt; identity matrix.  Then the parity check matrix is &amp;lt;math&amp;gt;P = (A^T|I_{n-k}).\,\!&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Errors===&lt;br /&gt;
&lt;br /&gt;
For any classical error correcting code, there are general conditions that must be satisfied in order for the code to be able to detect and correct errors.  The two examples above show how the error can be detected; here, the objective is to give some general conditions.  &lt;br /&gt;
&lt;br /&gt;
Note that any state containing an error may be written as the sum of the original (logical or encoded) state  &amp;lt;math&amp;gt;w \,\!&amp;lt;/math&amp;gt; and another vector &amp;lt;math&amp;gt;e \,\!&amp;lt;/math&amp;gt;.  The error vector &amp;lt;math&amp;gt;e \,\!&amp;lt;/math&amp;gt; has ones in the places where errors are present and zeroes everywhere else.  To ensure that the error may be corrected, the following condition must be satisfied for two states with errors occurring:&lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt;&lt;br /&gt;
w_1 + e_1 \neq w_2 + e_2.&lt;br /&gt;
\,\!&amp;lt;/math&amp;gt;|F.5}}&lt;br /&gt;
This condition is called the '''disjointness condition'''.  This condition means that an error on one state cannot be confused with an error on another state.  If it could, then the state including the error could not be uniquely identified with an encoded state and the state could not be corrected to its original state before the error occurred.  More specifically, for a code to correct &amp;lt;math&amp;gt;t\,\!&amp;lt;/math&amp;gt;  single-bit errors, it must have distance at least &amp;lt;math&amp;gt;2t + 1 \,\!&amp;lt;/math&amp;gt; between any two codewords; i.e., it must be true that &amp;lt;math&amp;gt;d(C) \geq 2t + 1 \,\!&amp;lt;/math&amp;gt;.  An &amp;lt;math&amp;gt;[n,k]\,\!&amp;lt;/math&amp;gt; code with minimal distance &amp;lt;math&amp;gt;d \,\!&amp;lt;/math&amp;gt; is denoted &amp;lt;math&amp;gt;[n,k,d]\,\!&amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Example 3====&lt;br /&gt;
An important example of an error correcting code is called the &amp;lt;math&amp;gt;[7,4,3]&amp;lt;/math&amp;gt; Hamming code.  This code, as the notation indicates, encodes &amp;lt;math&amp;gt;k=4&amp;lt;/math&amp;gt; bits of information into &amp;lt;math&amp;gt;n=7&amp;lt;/math&amp;gt; bits.  It also does it in such a way that one error can be detected and corrected since it has a distance of &amp;lt;math&amp;gt;3&amp;lt;/math&amp;gt;.  The generator matrix for this code can be taken to be &lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt;&lt;br /&gt;
G^T = \left(\begin{array}{ccccccc}&lt;br /&gt;
          1 &amp;amp; 0 &amp;amp; 0 &amp;amp; 0 &amp;amp; 1 &amp;amp; 1 &amp;amp; 0 \\&lt;br /&gt;
          0 &amp;amp; 1 &amp;amp; 0 &amp;amp; 0 &amp;amp; 1 &amp;amp; 1 &amp;amp; 1 \\&lt;br /&gt;
          0 &amp;amp; 0 &amp;amp; 1 &amp;amp; 0 &amp;amp; 1 &amp;amp; 0 &amp;amp; 1 \\&lt;br /&gt;
          0 &amp;amp; 0 &amp;amp; 0 &amp;amp; 1 &amp;amp; 0 &amp;amp; 1 &amp;amp; 1 &lt;br /&gt;
    \end{array}\right).&lt;br /&gt;
\,\!&amp;lt;/math&amp;gt;|F.6}}&lt;br /&gt;
(See for example [[Bibliography#LoeppWootters|Loepp and Wootters [25]]].)  From this the parity check matrix, &amp;lt;math&amp;gt;P\,\!&amp;lt;/math&amp;gt; can be calculated (as stated above) by finding a set of &amp;lt;math&amp;gt;n-k\,\!&amp;lt;/math&amp;gt; mutually orthogonal vectors that are also orthogonal to the code space defined by the generator matrix.  Alternatively, one could use the method in Steane's article in [[Bibliography#LoPopescuSpiller|Lo, Popescu, and Spiller [26]]].  Put &amp;lt;math&amp;gt;G^T\,\!&amp;lt;/math&amp;gt; in the form &amp;lt;math&amp;gt;(I_k|A),\,\!&amp;lt;/math&amp;gt; where &amp;lt;math&amp;gt;I_k\,\!&amp;lt;/math&amp;gt; is the &amp;lt;math&amp;gt;k\times k\,\!&amp;lt;/math&amp;gt; identity matrix.  Then the parity check matrix is &amp;lt;math&amp;gt;P = (A^T|I_{n-k}).\,\!&amp;lt;/math&amp;gt;  In either case, one can arrive at the following parity check matrix for this code:&lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt;&lt;br /&gt;
P = \left(\begin{array}{ccccccc}&lt;br /&gt;
          1 &amp;amp; 1 &amp;amp; 1 &amp;amp; 0 &amp;amp; 1 &amp;amp; 0 &amp;amp; 0 \\&lt;br /&gt;
          1 &amp;amp; 1 &amp;amp; 0 &amp;amp; 1 &amp;amp; 0 &amp;amp; 1 &amp;amp; 0 \\&lt;br /&gt;
          0 &amp;amp; 1 &amp;amp; 1 &amp;amp; 1 &amp;amp; 0 &amp;amp; 0 &amp;amp; 1 &lt;br /&gt;
    \end{array}\right).&lt;br /&gt;
\,\!&amp;lt;/math&amp;gt;|F.7}}&lt;br /&gt;
It is useful to note that the code can also be defined by the parity check matrix.  Only the codewords are annihilated by the parity check matrix.&lt;br /&gt;
&lt;br /&gt;
===The Disjointness Condition and Correcting Errors===&lt;br /&gt;
&lt;br /&gt;
The motivation for the disjointness condition, [[#eqF.5|Eq.(F.5)]], is to associate each vector in the space with a particular code word.  That is, assuming that only certain errors occur, each error vector should be associated to a particular vector in the code space when the error is added to the original code word.  This partitions the set into disjoint subsets, with each containing only one code vector.  A message is decoded correctly if the vector (the one containing the error) is in the subset that is associated with the original vector (the one with no error).  For example, if one vector is sent, say &amp;lt;math&amp;gt; v_1 \,\!&amp;lt;/math&amp;gt;, and an error occurs during transmission to produce &amp;lt;math&amp;gt; v_2 = v_1 +e\,\!&amp;lt;/math&amp;gt;, then this vector must be in the subset containing &amp;lt;math&amp;gt; v_1 \,\!&amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
A way to decode is to record an array of possible code words, possible errors, and the combinations of those errors and code words.  The array can be set up as a top row of the code word vectors and a leftmost column of errors, with the element of the first row and the first column being the zero vector and all subsequent entries in the column being errors.  Then the element at the top of a column (say the jth column) is added to the error in the corresponding row (say the kth row) to get the j,k entry of the array.  With this array one can associate a column with a subset that is disjoint with the other sets.  Identifying the erred code word in a column associates it with a code word and thus corrects the error.&lt;br /&gt;
&lt;br /&gt;
===The Hamming Bound===&lt;br /&gt;
&lt;br /&gt;
The Hamming bound is a bound that restricts the rate of the code.  Due to the disjointness condition, a certain number of bits are required to ensure our ability to detect and correct errors.  Suppose there is a set of &amp;lt;math&amp;gt; n\,\!&amp;lt;/math&amp;gt; bit vectors for encoding &amp;lt;math&amp;gt; k\,\!&amp;lt;/math&amp;gt; bits of information.  There is a set of error vectors of weight &amp;lt;math&amp;gt; t \,\!&amp;lt;/math&amp;gt; that has &amp;lt;math&amp;gt; C(n,t)\,\!&amp;lt;/math&amp;gt; elements&amp;lt;ref&amp;gt;That is, &amp;lt;math&amp;gt; n \,\!&amp;lt;/math&amp;gt; choose &amp;lt;math&amp;gt; t \,\!&amp;lt;/math&amp;gt; vectors. The notation is &amp;lt;math&amp;gt; C(n,t) = {n\choose t} = \frac{n!}{(n-t)!t!}.\,\!&amp;lt;/math&amp;gt;&amp;lt;/ref&amp;gt;.  So the number of error vectors, including errors of weight up to &amp;lt;math&amp;gt; t \,\!&amp;lt;/math&amp;gt;, is &lt;br /&gt;
&amp;lt;math&amp;gt; \sum_{i=0}^t C(n,i). \,\!&amp;lt;/math&amp;gt;  (Note that no error is also part of the set of error vectors.  The objective is to be able to design a code that can correct all errors up to those of weight &amp;lt;math&amp;gt; t \,\!&amp;lt;/math&amp;gt;, and this includes no error at all.)  Since there are &amp;lt;math&amp;gt; 2^n\,\!&amp;lt;/math&amp;gt; vectors in the whole space of &amp;lt;math&amp;gt; n\,\!&amp;lt;/math&amp;gt; bits, and assuming &amp;lt;math&amp;gt; m\,\!&amp;lt;/math&amp;gt; vectors are used for the encoding, the Hamming bound is&lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt; &lt;br /&gt;
m\sum_{i=0}^t C(n,i) \leq 2^n.&lt;br /&gt;
\,\!&amp;lt;/math&amp;gt;|F.8}}&lt;br /&gt;
For linear codes, &amp;lt;math&amp;gt; m=2^k,\,\!&amp;lt;/math&amp;gt; so &lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt; &lt;br /&gt;
2^k\sum_{i=0}^t C(n,i) \leq 2^n.&lt;br /&gt;
\,\!&amp;lt;/math&amp;gt;|F.9}}&lt;br /&gt;
Taking the logarithm, &lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt; &lt;br /&gt;
k \leq n - \log_2\left(\sum_{i=0}^t C(n,i)\right).&lt;br /&gt;
\,\!&amp;lt;/math&amp;gt;|F.10}}&lt;br /&gt;
For large &amp;lt;math&amp;gt; n, k \,\!&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; t \,\!&amp;lt;/math&amp;gt;, we can use [[#LoPopescueSpiller|Stirling's formula]] to show that &lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt; &lt;br /&gt;
\frac{k}{n} \leq 1 - H\left(\frac{t}{n}\right),&lt;br /&gt;
\,\!&amp;lt;/math&amp;gt;|F.11}}&lt;br /&gt;
where &amp;lt;math&amp;gt; H(x) = -x\log x -(1-x)\log (1-x) \,\!&amp;lt;/math&amp;gt; and we have neglected an overall multiplicative constant that goes to 1 as  &amp;lt;math&amp;gt; n\rightarrow \infty. \,\!&amp;lt;/math&amp;gt;  (Again, see the article in [[Bibliography#LoPopescueSpiller|Lo, Popescu, and Spiller [26]]] by Steane.)&lt;br /&gt;
&lt;br /&gt;
===More Definitions===&lt;br /&gt;
&lt;br /&gt;
====Definition 11: Dual Code====&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt;\mathcal{C}\,\!&amp;lt;/math&amp;gt; be a code and let &amp;lt;math&amp;gt;v\,\!&amp;lt;/math&amp;gt; be a vector in the code space.  The '''dual code''', denoted &amp;lt;math&amp;gt;\mathcal{C}^\perp\,\!&amp;lt;/math&amp;gt;, is the set of all vectors that have zero inner product with all &amp;lt;math&amp;gt;v\in \mathcal{C}\,\!&amp;lt;/math&amp;gt;.  In other words, it is the set of all vectors &amp;lt;math&amp;gt;u\,\!&amp;lt;/math&amp;gt; such that &amp;lt;math&amp;gt;u\cdot v = 0\,\!&amp;lt;/math&amp;gt; for all  &amp;lt;math&amp;gt;v\in \mathcal{C}\,\!&amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
For binary vectors, a vector can be orthogonal to itself.  Note that this is different from ordinary vectors in 3-d space.  &lt;br /&gt;
&lt;br /&gt;
The dual code is a useful entity in classical error correction and will be used in the construction of the quantum error correcting codes known as [[Chapter 7 - Quantum Error Correcting Codes#CSS codes|CSS codes]].&lt;br /&gt;
&lt;br /&gt;
===Final Comments===&lt;br /&gt;
&lt;br /&gt;
As can be seen from the Hamming bound, there is a limit to the rate of an error correcting code.  This does not indicate whether or not codes that satisfy these bounds exist, but it does tell us that no codes exist that do not satisfy these bounds.  Encoding, decoding, error detection and correction are all difficult problems to solve in general.  One of the advantages of the linear codes is that they provide a systematic method for identifying errors on a code through the use of the parity check operation.  More generally, checking to see whether or not a bit string (vector) is in the code space would require a look-up table.  This would be much more time-consuming than using the parity check matrix; matrix multiplication is quite efficient relative to the look-up table.  &lt;br /&gt;
&lt;br /&gt;
Many of these ideas and definitions will be utilized in [[Chapter 7 - Quantum Error Correcting Codes|Chapter 7]] on quantum error correction.  Some linear codes, including the Hamming code above, will have quantum analogues---as do many quantum error correcting codes.  In quantum computers, as will be discussed, error correction is necessary due to the delicacy of quantum information.  Such discussions will be taken up in [[Chapter 7 - Quantum Error Correcting Codes|Chapter 7]].&lt;br /&gt;
&lt;br /&gt;
==Footnotes==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Ddghunter</name></author>
		
	</entry>
	<entry>
		<id>https://www2.physics.siu.edu/qunet/wiki/index.php?title=Appendix_A_-_Basic_Probability_Concepts&amp;diff=2338</id>
		<title>Appendix A - Basic Probability Concepts</title>
		<link rel="alternate" type="text/html" href="https://www2.physics.siu.edu/qunet/wiki/index.php?title=Appendix_A_-_Basic_Probability_Concepts&amp;diff=2338"/>
		<updated>2013-03-03T18:36:41Z</updated>

		<summary type="html">&lt;p&gt;Ddghunter: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;In this appendix definitions and some example calculations are&lt;br /&gt;
presented which will aid in our discussions.  This is not meant to be&lt;br /&gt;
a comprehensive introduction to the topic.  It is primarily meant to&lt;br /&gt;
serve as a means for introducing notation and terminology for the&lt;br /&gt;
course.&lt;br /&gt;
&lt;br /&gt;
By definition, probability is the chance of a certain event occurring from a set of events that could possibly occur. Let us start with the most primitive example of a probability, flipping a coin.  Now we know the set of possible outcomes is heads or tails, &amp;lt;math&amp;gt;S=\left\{H,T\right\}.\,\!&amp;lt;/math&amp;gt; Now since there are only two events that can occur and we know that there is an equal chance for them both to occur, we say that the probability for each occurring is &amp;lt;math&amp;gt;1/2,\,\!&amp;lt;/math&amp;gt; i.e. &amp;lt;math&amp;gt;P(H)=1/2\,\!&amp;lt;/math&amp;gt;  and  &amp;lt;math&amp;gt;P(T)=1/2,\,\!&amp;lt;/math&amp;gt; because the probabilities for every possible outcome of an event must equal &amp;lt;math&amp;gt;1,\,\!&amp;lt;/math&amp;gt; i.e. &amp;lt;math&amp;gt;P(H)+P(T)=1.\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In probability, the Boolean operator '''''and''''' can be somewhat counter intuitive at first.  For instance, if someone were to tell you that he/she has '''5''' apples '''''and''''' just received '''3''' more, the operation that takes place in your head is he/she has &amp;lt;math&amp;gt;5 + 3 = 8\,\!&amp;lt;/math&amp;gt; apples.  But, when working with probabilities, the Boolean '''''and''''' corresponds with multiplication.  For example, say the probability that Bob stays and works through his lunch hour is &amp;lt;math&amp;gt;1/6\,\!&amp;lt;/math&amp;gt; and the probability that Kathy stays and works through lunch is &amp;lt;math&amp;gt;5/6.\,\!&amp;lt;/math&amp;gt; Now if I were to ask, &amp;quot;What is the probability that Bob '''''and''''' Kathy stay and work through lunch?&amp;quot;, you would not want add the probabilities because &amp;lt;math&amp;gt;P(B)+P(K)=1.\,\!&amp;lt;/math&amp;gt;  This would imply that both will work through lunch, which doesn't make sense because we cannot guarantee, from the knowledge that we have, both will work through lunch.  Instead, let us multiply their respective probabilities, &amp;lt;math&amp;gt;P(B)*P(K)=5/36.\,\!&amp;lt;/math&amp;gt;  Since the answer is lower than the probability for each individual, it makes much more sense because, intuitively, the more uncertainty (i.e. more probabilities &amp;lt; 1) in a system, the more uncertain we are of success.&lt;br /&gt;
&lt;br /&gt;
Now that we have examined the Boolean '''''and''''', lets take a look at '''''or'''''.  '''''Or''''' corresponds with addition, which follows directly from the condition that all probabilities for the outcomes of events must add up to &amp;lt;math&amp;gt;1.\,\!&amp;lt;/math&amp;gt;  Revisiting the example of flipping a coin, we see that the two possible outcomes that occur are you obtain heads '''''or''''' you obtain tails. &amp;lt;math&amp;gt;P(H)+P(T)=1.\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(This example is a variation of one given by David Griffiths in ''Introduction to Quantum Mechanics'' ([[Bibliography#Griffiths:qmbook|David J. Griffiths’ book [4]]]))&lt;br /&gt;
&lt;br /&gt;
''Example'':  Suppose that in some room, there are four people with the following heights:  &lt;br /&gt;
#1 person is '''1.5''' meters tall&lt;br /&gt;
#1 person is '''1.6''' meters tall&lt;br /&gt;
#2 people are '''1.8''' meters tall&lt;br /&gt;
Let&amp;lt;math&amp;gt;N\,\!&amp;lt;/math&amp;gt; stand for the total number of people.  We might write the number of people with certain heights as &lt;br /&gt;
&amp;lt;math&amp;gt;N(1.5) = 1\,\!&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;N(1.6)=1\,\!&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;N(1.8)=2\,\!&amp;lt;/math&amp;gt;. &lt;br /&gt;
&amp;lt;center&amp;gt;The total number of people is&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
N = \sum_{j=0}^\infty N(j),&lt;br /&gt;
\,\!&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;where &amp;lt;math&amp;gt;j\,\!&amp;lt;/math&amp;gt; runs over all values. It is easily seen that &amp;lt;math&amp;gt;N=4\,\!&amp;lt;/math&amp;gt;.&amp;lt;/center&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
Now if I draw a name out of a hat that contains each person's name&lt;br /&gt;
once, I will get the name of a person who is 1.6 meters tall with&lt;br /&gt;
probability &amp;lt;math&amp;gt;1/4\,\!&amp;lt;/math&amp;gt;.  (We assume that each person has a unique name and&lt;br /&gt;
that it appears once and only once in the hat.)  We write this as&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
P(1.6) = 1/4&lt;br /&gt;
\,\!&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
and we would generally write for any value&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
P(j) = \frac{N(j)}{N}. &lt;br /&gt;
\,\!&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
Now since we are going to get someone's name when we draw, we must&lt;br /&gt;
have &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\sum_j P(j) = 1,&lt;br /&gt;
\,\!&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
which is easy enough to check.  &lt;br /&gt;
&lt;br /&gt;
There are several aspects of this probability distribution that we might like to know.  Here are some that are particularly useful: &amp;lt;!-- \index{median}\index{mean} \index{average}--&amp;gt;&lt;br /&gt;
#The ''most probable'' value (or ''mode'') for the height is 1.8 meters.&lt;br /&gt;
#The ''median'' is 1.7 meters (two people above and two below).&lt;br /&gt;
#The ''average'' (or ''mean'') is given by&lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt;\begin{align}\left\langle height\right\rangle &amp;amp;= \frac{1(1.5)+1(1.6)+2(1.8)}{4} \\ &amp;amp;=  \frac{6.8}{4} = 1.7. \end{align}&amp;lt;/math&amp;gt;|A.1}}&lt;br /&gt;
Note that the mean and the median do not have to be the same.  If there is an odd number of values, the median is the middle number in the list; if even, it is the mean of the two middle values. It is mere coincidence that they are the same here.  &lt;br /&gt;
The bracket, &amp;lt;math&amp;gt;\left\langle\cdot\right\rangle\,\!&amp;lt;/math&amp;gt;, is the standard notation for finding  the ''average value''&amp;lt;!-- \index{average}--&amp;gt; &lt;br /&gt;
of a function.  This is done by calculating &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\left\langle f(j)\right\rangle = \sum_{j=0}^\infty f(j)P(j).\,\!&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
For the average this is just &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\left\langle j\right\rangle = \sum_{j=0}^\infty jP(j)= \sum_{j=0}^\infty j\frac{N(j)}{N}.  \,\!&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
'''Note:'''  The ''average value'' is called the ''expectation value'' &amp;lt;!-- \index{expectation value} --&amp;gt; in quantum mechanics.  This can be&lt;br /&gt;
misleading because it is ''not'' the most probable, nor is it &amp;lt;nowiki&amp;gt;''what to expect.''&amp;lt;/nowiki&amp;gt; &lt;br /&gt;
&lt;br /&gt;
When one would like to discuss the properties of a particular probability distribution, describing it takes some effort.  It is not enough to know the average, median, and most probable values; a lot of details of the probability distribution remain unknown to us if these are all we are given.  What else would one like to know?  Without describing it entirely, one may like to know more about the &amp;lt;nowiki&amp;gt;''shape''&amp;lt;/nowiki&amp;gt; of the distribution.  For example, how spread out is it?&lt;br /&gt;
&lt;br /&gt;
The most important measure of this is the ''variance'',&amp;lt;!-- \index{variance}--&amp;gt; which is the ''standard deviation'' &amp;lt;!-- \index{standard deviation} --&amp;gt; squared ( &amp;lt;math&amp;gt;\sigma^2\!&amp;lt;/math&amp;gt; ).  The variance is defined as (in terms of our variable &amp;lt;math&amp;gt;j\,\!&amp;lt;/math&amp;gt;) &lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt;\sigma^2 = \langle(\Delta j)^2\rangle, \,\!&amp;lt;/math&amp;gt;|A.2}}&lt;br /&gt;
where &amp;lt;math&amp;gt;\Delta j = j -\langle j \rangle\,\!&amp;lt;/math&amp;gt;.  This can also be written as &lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt;\sigma^2 = \langle j^2\rangle - \langle j \rangle^2.\,\!&amp;lt;/math&amp;gt;|A.3}}&lt;br /&gt;
&lt;br /&gt;
===Stirling's Formula===&lt;br /&gt;
&lt;br /&gt;
For large &amp;lt;math&amp;gt;n \,\!&amp;lt;/math&amp;gt;, the following approximation is quite useful:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
n! \approx \sqrt{2\pi n} \; n^n e^{-n}.&lt;br /&gt;
\,\!&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;/div&gt;</summary>
		<author><name>Ddghunter</name></author>
		
	</entry>
	<entry>
		<id>https://www2.physics.siu.edu/qunet/wiki/index.php?title=Appendix_A_-_Basic_Probability_Concepts&amp;diff=2337</id>
		<title>Appendix A - Basic Probability Concepts</title>
		<link rel="alternate" type="text/html" href="https://www2.physics.siu.edu/qunet/wiki/index.php?title=Appendix_A_-_Basic_Probability_Concepts&amp;diff=2337"/>
		<updated>2013-03-03T17:59:59Z</updated>

		<summary type="html">&lt;p&gt;Ddghunter: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;In this appendix definitions and some example calculations are&lt;br /&gt;
presented which will aid in our discussions.  This is not meant to be&lt;br /&gt;
a comprehensive introduction to the topic.  It is primarily meant to&lt;br /&gt;
serve as a means for introducing notation and terminology for the&lt;br /&gt;
course.&lt;br /&gt;
&lt;br /&gt;
By definition, probability is the chance of a certain event occurring from a set of events that could possibly occur. Let us start with the most primitive example of a probability, flipping a coin.  Now we know the set of possible outcomes is heads or tails, &amp;lt;math&amp;gt;S=\left\{H,T\right\}.\,\!&amp;lt;/math&amp;gt; Now since there are only two events that can occur and we know that there is an equal chance for them both to occur, we say that the probability for each occurring is '''1/2''', i.e. &amp;lt;math&amp;gt;P(H)=1/2\,\!&amp;lt;/math&amp;gt;  and  &amp;lt;math&amp;gt;P(T)=1/2\,\!&amp;lt;/math&amp;gt;, because the probabilities for every possible outcome of an event must equal '''1''', i.e. &amp;lt;math&amp;gt;P(H)+P(T)=1.\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In probability, the Boolean operator '''''and''''' can be somewhat counter intuitive at first.  For instance, if someone were to tell you that he/she has 5 apples '''''and''''' just received 3 more, the operation that takes place in your head is he/she has &amp;lt;math&amp;gt;5 + 3 = 8\,\!&amp;lt;/math&amp;gt; apples.  But, when working with probabilities, the Boolean '''''and''''' corresponds with multiplication.  For example, say the probability that Bob stays and works through his lunch hour is '''1/6''' and the probability that Kathy stays and works through lunch is '''5/6'''. Now if I were to ask, &amp;quot;What is the probability that Bob '''''and''''' Kathy stay and work through lunch?&amp;quot;, you would not want add the probabilities because &amp;lt;math&amp;gt;P(B)+P(K)=1.\,\!&amp;lt;/math&amp;gt;  This would imply that both will work through lunch, which doesn't make sense because we cannot guarantee, from the knowledge that we have, both will work through lunch.  Instead, let us multiply their respective probabilities, &amp;lt;math&amp;gt;P(B)*P(K)=5/36.\,\!&amp;lt;/math&amp;gt;  Since the answer is lower than the probability for each individual, it makes much more sense because, intuitively, the more uncertainty (i.e. more probabilities &amp;lt; 1) in a system, the more uncertain we are of success.&lt;br /&gt;
&lt;br /&gt;
Now that we have examined the Boolean '''''and''''', lets take a look at '''''or'''''.  '''''Or''''' corresponds with addition, which follows directly from the condition that all probabilities for the outcomes of events must add up to '''1'''.  Revisiting the example of flipping a coin, we see that the two possible outcomes that occur are you obtain heads '''''or''''' you obtain tails. &amp;lt;math&amp;gt;P(H)+P(T)=1.\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(This example is a variation of one given by David Griffiths in ''Introduction to Quantum Mechanics'' ([[Bibliography#Griffiths:qmbook|David J. Griffiths’ book [4]]]))&lt;br /&gt;
&lt;br /&gt;
''Example'':  Suppose that in some room, there are four people with the following heights:  &lt;br /&gt;
#1 person is 1.5 meters tall&lt;br /&gt;
#1 person is 1.6 meters tall&lt;br /&gt;
#2 people are 1.8 meters tall&lt;br /&gt;
Let&amp;lt;math&amp;gt;N\,\!&amp;lt;/math&amp;gt; stand for the total number of people.  We might write the number of people with certain heights as &lt;br /&gt;
&amp;lt;math&amp;gt;N(1.5) = 1\,\!&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;N(1.6)=1\,\!&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;N(1.8)=2\,\!&amp;lt;/math&amp;gt;. &lt;br /&gt;
&amp;lt;center&amp;gt;The total number of people is&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
N = \sum_{j=0}^\infty N(j),&lt;br /&gt;
\,\!&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;where &amp;lt;math&amp;gt;j\,\!&amp;lt;/math&amp;gt; runs over all values. It is easily seen that &amp;lt;math&amp;gt;N=4\,\!&amp;lt;/math&amp;gt;.&amp;lt;/center&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
Now if I draw a name out of a hat that contains each person's name&lt;br /&gt;
once, I will get the name of a person who is 1.6 meters tall with&lt;br /&gt;
probability &amp;lt;math&amp;gt;1/4\,\!&amp;lt;/math&amp;gt;.  (We assume that each person has a unique name and&lt;br /&gt;
that it appears once and only once in the hat.)  We write this as&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
P(1.6) = 1/4&lt;br /&gt;
\,\!&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
and we would generally write for any value&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
P(j) = \frac{N(j)}{N}. &lt;br /&gt;
\,\!&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
Now since we are going to get someone's name when we draw, we must&lt;br /&gt;
have &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\sum_j P(j) = 1,&lt;br /&gt;
\,\!&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
which is easy enough to check.  &lt;br /&gt;
&lt;br /&gt;
There are several aspects of this probability distribution that we might like to know.  Here are some that are particularly useful: &amp;lt;!-- \index{median}\index{mean} \index{average}--&amp;gt;&lt;br /&gt;
#The ''most probable'' value (or ''mode'') for the height is 1.8 meters.&lt;br /&gt;
#The ''median'' is 1.7 meters (two people above and two below).&lt;br /&gt;
#The ''average'' (or ''mean'') is given by&lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt;\begin{align}\left\langle height\right\rangle &amp;amp;= \frac{1(1.5)+1(1.6)+2(1.8)}{4} \\ &amp;amp;=  \frac{6.8}{4} = 1.7. \end{align}&amp;lt;/math&amp;gt;|A.1}}&lt;br /&gt;
Note that the mean and the median do not have to be the same.  If there is an odd number of values, the median is the middle number in the list; if even, it is the mean of the two middle values. It is mere coincidence that they are the same here.  &lt;br /&gt;
The bracket, &amp;lt;math&amp;gt;\left\langle\cdot\right\rangle\,\!&amp;lt;/math&amp;gt;, is the standard notation for finding  the ''average value''&amp;lt;!-- \index{average}--&amp;gt; &lt;br /&gt;
of a function.  This is done by calculating &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\left\langle f(j)\right\rangle = \sum_{j=0}^\infty f(j)P(j).\,\!&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
For the average this is just &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\left\langle j\right\rangle = \sum_{j=0}^\infty jP(j)= \sum_{j=0}^\infty j\frac{N(j)}{N}.  \,\!&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
'''Note:'''  The ''average value'' is called the ''expectation value'' &amp;lt;!-- \index{expectation value} --&amp;gt; in quantum mechanics.  This can be&lt;br /&gt;
misleading because it is ''not'' the most probable, nor is it &amp;lt;nowiki&amp;gt;''what to expect.''&amp;lt;/nowiki&amp;gt; &lt;br /&gt;
&lt;br /&gt;
When one would like to discuss the properties of a particular probability distribution, describing it takes some effort.  It is not enough to know the average, median, and most probable values; a lot of details of the probability distribution remain unknown to us if these are all we are given.  What else would one like to know?  Without describing it entirely, one may like to know more about the &amp;lt;nowiki&amp;gt;''shape''&amp;lt;/nowiki&amp;gt; of the distribution.  For example, how spread out is it?&lt;br /&gt;
&lt;br /&gt;
The most important measure of this is the ''variance'',&amp;lt;!-- \index{variance}--&amp;gt; which is the ''standard deviation'' &amp;lt;!-- \index{standard deviation} --&amp;gt; squared ( &amp;lt;math&amp;gt;\sigma^2\!&amp;lt;/math&amp;gt; ).  The variance is defined as (in terms of our variable &amp;lt;math&amp;gt;j\,\!&amp;lt;/math&amp;gt;) &lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt;\sigma^2 = \langle(\Delta j)^2\rangle, \,\!&amp;lt;/math&amp;gt;|A.2}}&lt;br /&gt;
where &amp;lt;math&amp;gt;\Delta j = j -\langle j \rangle\,\!&amp;lt;/math&amp;gt;.  This can also be written as &lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt;\sigma^2 = \langle j^2\rangle - \langle j \rangle^2.\,\!&amp;lt;/math&amp;gt;|A.3}}&lt;br /&gt;
&lt;br /&gt;
===Stirling's Formula===&lt;br /&gt;
&lt;br /&gt;
For large &amp;lt;math&amp;gt;n \,\!&amp;lt;/math&amp;gt;, the following approximation is quite useful:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
n! \approx \sqrt{2\pi n} \; n^n e^{-n}.&lt;br /&gt;
\,\!&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;/div&gt;</summary>
		<author><name>Ddghunter</name></author>
		
	</entry>
	<entry>
		<id>https://www2.physics.siu.edu/qunet/wiki/index.php?title=Appendix_A_-_Basic_Probability_Concepts&amp;diff=2336</id>
		<title>Appendix A - Basic Probability Concepts</title>
		<link rel="alternate" type="text/html" href="https://www2.physics.siu.edu/qunet/wiki/index.php?title=Appendix_A_-_Basic_Probability_Concepts&amp;diff=2336"/>
		<updated>2013-03-03T17:55:01Z</updated>

		<summary type="html">&lt;p&gt;Ddghunter: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;In this appendix definitions and some example calculations are&lt;br /&gt;
presented which will aid in our discussions.  This is not meant to be&lt;br /&gt;
a comprehensive introduction to the topic.  It is primarily meant to&lt;br /&gt;
serve as a means for introducing notation and terminology for the&lt;br /&gt;
course.&lt;br /&gt;
&lt;br /&gt;
By definition, probability is the chance of a certain event occurring from a set of events that could possibly occur. Let us start with the most primitive example of a probability, flipping a coin.  Now we know the set of possible outcomes is heads or tails, &amp;lt;math&amp;gt;S=\left\{H,T\right\}.\,\!&amp;lt;/math&amp;gt; Now since there are only two events that can occur and we know that there is an equal chance for them both to occur, we say that the probability for each occurring is '''1/2''', i.e. &amp;lt;math&amp;gt;P(H)=1/2\,\!&amp;lt;/math&amp;gt;  and  &amp;lt;math&amp;gt;P(T)=1/2\,\!&amp;lt;/math&amp;gt;, because the probabilities for every possible outcome of an event must equal '''1''', i.e. &amp;lt;math&amp;gt;P(H)+P(T)=1.\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In probability, the Boolean operator '''''and''''' can be somewhat counter intuitive at first.  For instance, if someone were to tell you that he/she has 5 apples '''''and''''' just received 3 more, the operation that takes place in your head is he/she has &amp;lt;math&amp;gt;5 + 3 = 8\,\!&amp;lt;/math&amp;gt; apples.  But, when working with probabilities, the Boolean '''''and''''' corresponds with multiplication.  For example, say the probability that Bob stays and works through his lunch hour is '''1/6''' and the probability that Kathy stays and works through lunch is '''5/6'''. Now if I were to ask, &amp;quot;What is the probability that Bob '''''and''''' Kathy stay and work through lunch?&amp;quot;, you would not want add the probabilities because &amp;lt;math&amp;gt;P(B)+P(K)=1.\,\!&amp;lt;/math&amp;gt;  This would imply that both will work through lunch, which doesn't make sense because we cannot guarantee, from the knowledge that we have, both will work through lunch.  Instead, let us multiply their respective probabilities, &amp;lt;math&amp;gt;P(B)*P(K)=5/36.\,\!&amp;lt;/math&amp;gt;  Since the answer is lower than the probability for each individual, it makes much more sense because, intuitively, the more uncertainty (i.e. more probabilities &amp;lt; 1) in a system, the more uncertain we are of success.&lt;br /&gt;
&lt;br /&gt;
Now that we have examined the Boolean '''''and''''', lets take a look at '''''or'''''.  '''''Or''''' corresponds with addition, which follows directly from the condition that all probabilities for the outcomes of events must add up to '''1'''.  Revisiting the example of flipping a coin, we see that the two possible outcomes that occur are you obtain heads '''''or''''' you obtain tails. &amp;lt;math&amp;gt;P(H)+P(T)=1.\,\!&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(This example is a variation of one given by David Griffiths in ''Introduction to Quantum Mechanics'' ([[Bibliography#Griffiths:qmbook|David J. Griffiths’ book [4]]]))&lt;br /&gt;
&lt;br /&gt;
''Example'':  Suppose that in some room, there are four people with the following heights:  &lt;br /&gt;
#1 person is 1.5 meters tall&lt;br /&gt;
#1 person is 1.6 meters tall&lt;br /&gt;
#2 people are 1.8 meters tall&lt;br /&gt;
Let&amp;lt;math&amp;gt;N\,\!&amp;lt;/math&amp;gt; stand for the total number of people.  We might write the number of people with certain heights as &lt;br /&gt;
&amp;lt;math&amp;gt;N(1.5) = 1\,\!&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;N(1.6)=1\,\!&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;N(1.8)=2\,\!&amp;lt;/math&amp;gt;. &lt;br /&gt;
&amp;lt;center&amp;gt;The total number of people is&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
N = \sum_{j=0}^\infty N(j),&lt;br /&gt;
\,\!&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;where &amp;lt;math&amp;gt;j\,\!&amp;lt;/math&amp;gt; runs over all values. It is easily seen that &amp;lt;math&amp;gt;N=4\,\!&amp;lt;/math&amp;gt;.&amp;lt;/center&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
Now if I draw a name out of a hat that contains each person's name&lt;br /&gt;
once, I will get the name of a person who is 1.6 meters tall with&lt;br /&gt;
probability &amp;lt;math&amp;gt;1/4\,\!&amp;lt;/math&amp;gt;.  (We assume that each person has a unique name and&lt;br /&gt;
that it appears once and only once in the hat.)  We write this as&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
P(1.6) = 1/4&lt;br /&gt;
\,\!&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
and we would generally write for any value&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
P(j) = \frac{N(j)}{N}. &lt;br /&gt;
\,\!&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
Now since we are going to get someone's name when we draw, we must&lt;br /&gt;
have &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\sum_j P(j) = 1,&lt;br /&gt;
\,\!&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
which is easy enough to check.  &lt;br /&gt;
&lt;br /&gt;
There are several aspects of this probability distribution that we might like to know.  Here are some that are particularly useful: &amp;lt;!-- \index{median}\index{mean} \index{average}--&amp;gt;&lt;br /&gt;
#The ''most probable'' value for the height is 1.8 meters.&lt;br /&gt;
#The ''median'' is 1.7 meters (two people above and two below).&lt;br /&gt;
#The ''average'' (or ''mean'') is given by&lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt;\begin{align}\left\langle height\right\rangle &amp;amp;= \frac{1(1.5)+1(1.6)+2(1.8)}{4} \\ &amp;amp;=  \frac{6.8}{4} = 1.7. \end{align}&amp;lt;/math&amp;gt;|A.1}}&lt;br /&gt;
Note that the mean and the median do not have to be the same.  If there is an odd number of values, the median is the middle number in the list; if even, it is the mean of the two middle values. It is mere coincidence that they are the same here.  &lt;br /&gt;
The bracket, &amp;lt;math&amp;gt;\left\langle\cdot\right\rangle\,\!&amp;lt;/math&amp;gt;, is the standard notation for finding  the ''average value''&amp;lt;!-- \index{average}--&amp;gt; &lt;br /&gt;
of a function.  This is done by calculating &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\left\langle f(j)\right\rangle = \sum_{j=0}^\infty f(j)P(j).\,\!&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
For the average this is just &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\left\langle j\right\rangle = \sum_{j=0}^\infty jP(j)= \sum_{j=0}^\infty j\frac{N(j)}{N}.  \,\!&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
'''Note:'''  The ''average value'' is called the ''expectation value'' &amp;lt;!-- \index{expectation value} --&amp;gt; in quantum mechanics.  This can be&lt;br /&gt;
misleading because it is ''not'' the most probable, nor is it &amp;lt;nowiki&amp;gt;''what to expect.''&amp;lt;/nowiki&amp;gt; &lt;br /&gt;
&lt;br /&gt;
When one would like to discuss the properties of a particular probability distribution, describing it takes some effort.  It is not enough to know the average, median, and most probable values; a lot of details of the probability distribution remain unknown to us if these are all we are given.  What else would one like to know?  Without describing it entirely, one may like to know more about the &amp;lt;nowiki&amp;gt;''shape''&amp;lt;/nowiki&amp;gt; of the distribution.  For example, how spread out is it?&lt;br /&gt;
&lt;br /&gt;
The most important measure of this is the ''variance'',&amp;lt;!-- \index{variance}--&amp;gt; which is the ''standard deviation'' &amp;lt;!-- \index{standard deviation} --&amp;gt; squared ( &amp;lt;math&amp;gt;\sigma^2\!&amp;lt;/math&amp;gt; ).  The variance is defined as (in terms of our variable &amp;lt;math&amp;gt;j\,\!&amp;lt;/math&amp;gt;) &lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt;\sigma^2 = \langle(\Delta j)^2\rangle, \,\!&amp;lt;/math&amp;gt;|A.2}}&lt;br /&gt;
where &amp;lt;math&amp;gt;\Delta j = j -\langle j \rangle\,\!&amp;lt;/math&amp;gt;.  This can also be written as &lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt;\sigma^2 = \langle j^2\rangle - \langle j \rangle^2.\,\!&amp;lt;/math&amp;gt;|A.3}}&lt;br /&gt;
&lt;br /&gt;
===Stirling's Formula===&lt;br /&gt;
&lt;br /&gt;
For large &amp;lt;math&amp;gt;n \,\!&amp;lt;/math&amp;gt;, the following approximation is quite useful:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
n! \approx \sqrt{2\pi n} \; n^n e^{-n}.&lt;br /&gt;
\,\!&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;/div&gt;</summary>
		<author><name>Ddghunter</name></author>
		
	</entry>
	<entry>
		<id>https://www2.physics.siu.edu/qunet/wiki/index.php?title=Appendix_A_-_Basic_Probability_Concepts&amp;diff=2335</id>
		<title>Appendix A - Basic Probability Concepts</title>
		<link rel="alternate" type="text/html" href="https://www2.physics.siu.edu/qunet/wiki/index.php?title=Appendix_A_-_Basic_Probability_Concepts&amp;diff=2335"/>
		<updated>2013-03-03T16:13:08Z</updated>

		<summary type="html">&lt;p&gt;Ddghunter: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;In this appendix definitions and some example calculations are&lt;br /&gt;
presented which will aid in our discussions.  This is not meant to be&lt;br /&gt;
a comprehensive introduction to the topic.  It is primarily meant to&lt;br /&gt;
serve as a means for introducing notation and terminology for the&lt;br /&gt;
course.  This example is a variation of one given by David Griffiths&lt;br /&gt;
in ''Intoduction to Quantum Mechanics'' ([[Bibliography#Griffiths:qmbook|David J. Giffiths’s book [4]]]).&lt;br /&gt;
&lt;br /&gt;
''Example'':  Suppose that in some room, there are four people with the following heights:  &lt;br /&gt;
#1 person is 1.5 meters tall&lt;br /&gt;
#1 person is 1.6 meters tall&lt;br /&gt;
#2 people are 1.8 meters tall&lt;br /&gt;
Let&amp;lt;math&amp;gt;N\,\!&amp;lt;/math&amp;gt; stand for the number of people.  We might write their heights as &lt;br /&gt;
&amp;lt;math&amp;gt;N(1.5) = 1\,\!&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;N(1.6)=1\,\!&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;N(1.8)=2\,\!&amp;lt;/math&amp;gt;. The total number of people is &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
N = \sum_{j=0}^\infty N(j),&lt;br /&gt;
\,\!&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;j\,\!&amp;lt;/math&amp;gt; runs over all values and (in this case) we are rounding to the&lt;br /&gt;
nearest tenth of a meter.  It is easily seen that &amp;lt;math&amp;gt;N=4\,\!&amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
Now if I draw a name out of a hat that contains each person's name&lt;br /&gt;
once, I will get the name of a person who is 1.6 meters tall with&lt;br /&gt;
probability &amp;lt;math&amp;gt;1/4\,\!&amp;lt;/math&amp;gt;.  (We assume that each person has a unique name and&lt;br /&gt;
that it appears once and only once in the hat.)  We write this as&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
P(1.6) = 1/4&lt;br /&gt;
\,\!&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
and we would generally write for any value&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
P(j) = \frac{N(j)}{N}. &lt;br /&gt;
\,\!&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
Now since we are going to get someone's name when we draw, we must&lt;br /&gt;
have &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\sum_j P(j) = 1,&lt;br /&gt;
\,\!&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
which is easy enough to check.  &lt;br /&gt;
&lt;br /&gt;
There are several aspects of this probability distribution that we might like to know.  Here are some that are particularly useful: &amp;lt;!-- \index{median}\index{mean} \index{average}--&amp;gt;&lt;br /&gt;
#The ''most probable'' value for the height is 1.8 meters.&lt;br /&gt;
#The ''median'' is 1.7 meters (two people above and two below).&lt;br /&gt;
#The ''average'' (or ''mean'') is given by&lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt;\begin{align}\left\langle height\right\rangle &amp;amp;= \frac{1(1.5)+1(1.6)+2(1.8)}{4} \\ &amp;amp;=  \frac{6.8}{4} = 1.7. \end{align}&amp;lt;/math&amp;gt;|A.1}}&lt;br /&gt;
Note that the mean and the median do not have to be the same.  If there is an odd number of values, the median is the middle number in the list; if even, it is the mean of the two middle values. It is mere coincidence that they are the same here.  &lt;br /&gt;
The bracket, &amp;lt;math&amp;gt;\left\langle\cdot\right\rangle\,\!&amp;lt;/math&amp;gt;, is the standard notation for finding  the ''average value''&amp;lt;!-- \index{average}--&amp;gt; &lt;br /&gt;
of a function.  This is done by calculating &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\left\langle f(j)\right\rangle = \sum_{j=0}^\infty f(j)P(j).\,\!&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
For the average this is just &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\left\langle j\right\rangle = \sum_{j=0}^\infty jP(j)= \sum_{j=0}^\infty j\frac{N(j)}{N}.  \,\!&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
'''Note:'''  The ''average value'' is called the ''expectation value'' &amp;lt;!-- \index{expectation value} --&amp;gt; in quantum mechanics.  This can be&lt;br /&gt;
misleading because it is ''not'' the most probable, nor is it &amp;lt;nowiki&amp;gt;''what to expect.''&amp;lt;/nowiki&amp;gt; &lt;br /&gt;
&lt;br /&gt;
When one would like to discuss the properties of a particular probability distribution, describing it takes some effort.  It is not enough to know the average, median, and most probable values; a lot of details of the probability distribution remain unknown to us if these are all we are given.  What else would one like to know?  Without describing it entirely, one may like to know more about the &amp;lt;nowiki&amp;gt;''shape''&amp;lt;/nowiki&amp;gt; of the distribution.  For example, how spread out is it?&lt;br /&gt;
&lt;br /&gt;
The most important measure of this is the ''variance'',&amp;lt;!-- \index{variance}--&amp;gt; which is the ''standard deviation'' &amp;lt;!-- \index{standard deviation} --&amp;gt; squared ( &amp;lt;math&amp;gt;\sigma^2\!&amp;lt;/math&amp;gt; ).  The variance is defined as (in terms of our variable &amp;lt;math&amp;gt;j\,\!&amp;lt;/math&amp;gt;) &lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt;\sigma^2 = \langle(\Delta j)^2\rangle, \,\!&amp;lt;/math&amp;gt;|A.2}}&lt;br /&gt;
where &amp;lt;math&amp;gt;\Delta j = j -\langle j \rangle\,\!&amp;lt;/math&amp;gt;.  This can also be written as &lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt;\sigma^2 = \langle j^2\rangle - \langle j \rangle^2.\,\!&amp;lt;/math&amp;gt;|A.3}}&lt;br /&gt;
&lt;br /&gt;
===Stirling's Formula===&lt;br /&gt;
&lt;br /&gt;
For large &amp;lt;math&amp;gt;n \,\!&amp;lt;/math&amp;gt;, the following approximation is quite useful:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
n! \approx \sqrt{2\pi n} \; n^n e^{-n}.&lt;br /&gt;
\,\!&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;/div&gt;</summary>
		<author><name>Ddghunter</name></author>
		
	</entry>
	<entry>
		<id>https://www2.physics.siu.edu/qunet/wiki/index.php?title=Chapter_1_-_Introduction&amp;diff=2333</id>
		<title>Chapter 1 - Introduction</title>
		<link rel="alternate" type="text/html" href="https://www2.physics.siu.edu/qunet/wiki/index.php?title=Chapter_1_-_Introduction&amp;diff=2333"/>
		<updated>2012-12-24T19:24:55Z</updated>

		<summary type="html">&lt;p&gt;Ddghunter: /* Obstacles to Building a Reliable Quantum Computer */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===Introduction===&lt;br /&gt;
&lt;br /&gt;
''In science one tries to tell people, in such a way as to be understood by everyone, something that no one ever knew before. But in poetry, it's the exact opposite.''&lt;br /&gt;
&lt;br /&gt;
-Paul Dirac&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===An Introduction to Quantum Computation===&lt;br /&gt;
&lt;br /&gt;
This introductory chapter is a survey of, and introduction to, topics in quantum information&lt;br /&gt;
processing. All of these topics (and more) will be revisited in later sections. Therefore,&lt;br /&gt;
it is not necessary, nor expected, that the reader will feel the subjects have been completely explained in this&lt;br /&gt;
introductory material.  Furthermore, if one has some background in quantum computing, this chapter may be skipped.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Quantum Mechanics====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So what is quantum mechanics? We should think of it as a set of rules, in some ways&lt;br /&gt;
similar to Newton’s laws, which describe the way the world works. These are the rules&lt;br /&gt;
to which we must carefully attend in order to build what we will describe as a quantum&lt;br /&gt;
computing device. We will return to this topic briefly again later. However, as is done in&lt;br /&gt;
many places, this question is never quite answered directly. Most often we simply learn the&lt;br /&gt;
rules and how to use them. The question itself is perhaps a little vague because there are many&lt;br /&gt;
physical systems that don’t quite fit into an either/or categorization of quantum vs. classical (since, as stated already, classical mechanics is an approximation to quantum mechanics).&lt;br /&gt;
Also, it should be noted that throughout these notes the terms will be somewhat misused, in&lt;br /&gt;
the sense that certain systems will be called quantum mechanical or classical, and from now&lt;br /&gt;
on, with few exceptions, no care will be taken to discuss subtleties.  &lt;br /&gt;
&lt;br /&gt;
====Quantum Computing and Quantum Information Processing====&lt;br /&gt;
&lt;br /&gt;
A quantum computer would be a computer that would take advantage of quantum mechanical &lt;br /&gt;
evolutions according to which physical systems behave. We often think of quantum mechanics&lt;br /&gt;
as being the set of mechanical laws or principles that only very small particles obey. While this&lt;br /&gt;
is not really true, it is a somewhat reasonable way of explaining things to the layman since the world of the &amp;quot;small&amp;quot; is the world where these laws are most often used and were discovered. For our&lt;br /&gt;
purposes, we should note that everything obeys the laws of quantum mechanics and that&lt;br /&gt;
Newtonian mechanics are rules that we use to approximate quantum mechanics. However,&lt;br /&gt;
quantum mechanical control and natural quantum mechanical evolution, which cannot be approximated by Newton's laws, &lt;br /&gt;
are what we are talking about when we talk about quantum systems. We must have very particular quantum mechanical&lt;br /&gt;
evolution, which cannot be reasonably approximated with classical mechanics, and use it in a&lt;br /&gt;
particular way to really perform a quantum computation or to really do quantum information&lt;br /&gt;
processing.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We have not yet built a quantum computing device. However, there are many reasons&lt;br /&gt;
to study quantum information processing other than building a fully functional quantum&lt;br /&gt;
computer. One main reason we haven’t built one is that we have to figure out how. The&lt;br /&gt;
experiments to perform quantum computation in physical devices take an enormous amount&lt;br /&gt;
of effort due to noises which corrupt the information. We are going to need to fix the&lt;br /&gt;
corrupted information, avoid the noises, or do away with them by some other means. A &lt;br /&gt;
reason to study quantum computing, and quantum information processing more&lt;br /&gt;
generally, is that there are really many quantum information processing tasks, or tasks&lt;br /&gt;
which can be thought of in this way, which concern quantum control. Precise control of&lt;br /&gt;
a quantum system is important for a variety of reasons, not the least of which is that our&lt;br /&gt;
world is quantum mechanical! When we get right down to the very basic elements of the&lt;br /&gt;
universe, they behave quantum mechanically. If there is one thing that the study of quantum&lt;br /&gt;
information processing has already taught us, it's that we need to pay attention to quantum&lt;br /&gt;
mechanics because it can be very useful to be able to manipulate quantum systems and take&lt;br /&gt;
advantage of uniquely quantum properties. Quantum technologies are going to be extremely&lt;br /&gt;
important in the future, even if we never built a quantum computer. (Oh, but we will!) As&lt;br /&gt;
Feynman said, “There is plenty of room at the bottom.” We have a lot to discover about&lt;br /&gt;
the world of the small.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Since noise has been, and is still, such a problem for quantum information, we need to deal with it. People quickly recognized this problem, and Peter Shor, and others, really made remarkable statements with their work on quantum error correcting codes. Their work showed that errors could, in principle, be corrected, leading the way for future research since it was then plausible that a quantum computer could be built – there are no fundamental obstacles. However, quantum error correcting codes are, in some sense, a software solution to a hardware problem. More physical treatments include codes which avoid errors, and control methods which are designed to average noises away. However, an all-out attack will include several different methods of error prevention used together. Error prevention methods are the subject of the last part of this course/book.&lt;br /&gt;
&lt;br /&gt;
====Motivation====&lt;br /&gt;
Why do we want to build a quantum computing device?&lt;br /&gt;
&lt;br /&gt;
#To make computers faster and more compact, we have been making them smaller (This has obeyed Moore’s law, see, [[Bibliography#Moore'sLaw:article|Moore's Law article [16]]]).  However, there is a limit to how much smaller we can make them and still have them function as they do now. This is due to quantum mechanics. In other words, the limit to small scale computational technology is governed by quantum mechanics, since, at a certain scale, the current computational systems will not be able to be approximated by Newtonian mechanics. So, to make things smaller, we need to use quantum mechanics! More than this though, the fact that Moore’s law cannot continue indefinitely means that we will need to look elsewhere for advances in computing power. One way to increase computing power is to use parallel computations. However, there are processes which cannot be parallel. So where do we turn? A quantum computer would help with this.&lt;br /&gt;
#We now know of several different quantum algorithms which are faster than any known classical algorithm for performing the same task. Some are actually provably faster. These are listed and discussed further in the next section.&lt;br /&gt;
#Quantum information can be used in a variety of ways beyond computing. Such as quantum cryptography, quantum games, and quantum communication of all sorts. &lt;br /&gt;
&lt;br /&gt;
An important point to take away from this section is that information is stored and&lt;br /&gt;
manipulated by physical devices. The way in which they behave is important for the tasks&lt;br /&gt;
that are to be performed.&lt;br /&gt;
&lt;br /&gt;
====Specific Uses====&lt;br /&gt;
There are at least three advantages of quantum computing devices which are often quoted:&lt;br /&gt;
&lt;br /&gt;
#Factor large integers more efficiently than a classical machine (known as Shor’s algorithm).&lt;br /&gt;
#Find an object in an unsorted database more efficiently than a classical machine (known as Govers algorithm).&lt;br /&gt;
#Simulate quantum mechanical systems more efficiently than any classical system (due to Feynman and others).&lt;br /&gt;
&lt;br /&gt;
====COMMENTS====&lt;br /&gt;
Shor’s algorithm would render RSA encryption useless. It is more efficient than any&lt;br /&gt;
known classical algorithm. (There is a quantum answer to this problem however-quantum&lt;br /&gt;
cryptography through QKD.)&lt;br /&gt;
&lt;br /&gt;
Gover’s algorithm is better than any classical algorithm – phone book example: classical&lt;br /&gt;
algorithm grows as &amp;lt;math&amp;gt;N/2\,\!&amp;lt;/math&amp;gt; and Grover’s grows as &amp;lt;math&amp;gt;\sqrt{N}\,\!&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Simulating quantum mechanical systems is quite difficult classically. For physical scientists&lt;br /&gt;
this could be the most important application of quantum computers. This could enable&lt;br /&gt;
the simulation of nuclear systems, solid-state devices, biological molecules and molecular&lt;br /&gt;
interactions, etc. much more efficiently than classical simulation.  This would enable calculations which are practically impossible now.&lt;br /&gt;
&lt;br /&gt;
====How do quantum computers provide an advantage?====&lt;br /&gt;
The claim is that quantum computers could solve some problems more efficiently than any &lt;br /&gt;
classical one. So viewing our information systems as quantum systems, we may note that&lt;br /&gt;
quantum mechanics is more than a description of the physical world (which is how physicists have&lt;br /&gt;
treated it for years) and is instead a set of rules governing the behaviour of information when stored&lt;br /&gt;
and manipulated quantum mechanically.  &lt;br /&gt;
&lt;br /&gt;
So the natural question is, “How does it do this?” We may also ask, “Where is the&lt;br /&gt;
advantage?” In other words, “What exactly about quantum mechanics enables us to achieve&lt;br /&gt;
speed-ups and other information processing tasks more efficiently than classical systems?”&lt;br /&gt;
Many people, as of the time of this writing, would likely say they don’t know. For example,&lt;br /&gt;
it is not known if there is a classical algorithm which could factor efficiently (By efficiently&lt;br /&gt;
here, let us just say that we mean “fewer resources,” and be more specific later). Or perhaps they would say &amp;lt;nowiki&amp;gt;&amp;quot;entanglement&amp;quot;&amp;lt;/nowiki&amp;gt; is responsible for the apparent speedups.  But this is a subject yet to be discussed.  One can present an intuitive plausible argument for why we believe a quantum computer can accomplish things a classical one cannot. However, there is no claim of a proof of anything at this point.  &lt;br /&gt;
&lt;br /&gt;
The argument concerns the fact that when a given machine has a different set of rules for operating, we expect&lt;br /&gt;
it to be able to do different things. The rules by which classical computing machines function are, in &lt;br /&gt;
some real sense, different from the ones governing the behavior of quantum machines. This is &lt;br /&gt;
quite vague, especially given the earlier comments about how everything really is quantum &lt;br /&gt;
mechanical. One may think about it (but someone is sure to argue) as a “classical object” &lt;br /&gt;
transforms according to a “classical equation of motion” and the result is determined by &lt;br /&gt;
its initial state, which is “classical.” A quantum mechanical state transforms according to a&lt;br /&gt;
“quantum equation of motion” and the result of the evolution is determined by some initial &lt;br /&gt;
conditions, which describe a “quantum system.” Perhaps this sounds like a circular argument,&lt;br /&gt;
primarily involving semantics.  However, the motivation for this as a definition comes from vector and tensor analysis: an object is a tensor if it transforms like a tensor. So we might say, an object is classical if it obeys classical equations.  In practice, this is often the way things are done.  If the physical system can be well-approximated using classical mechanics, we call it classical.  &lt;br /&gt;
&lt;br /&gt;
One can further argue that there are states which are uniquely quantum mechanical. &lt;br /&gt;
These are states which would have been mysterious to Newton, and indeed they were mysterious&lt;br /&gt;
to Einstein.  Furthermore, they are still mysterious today! The important point is&lt;br /&gt;
that there is no known classical analogue for some quantum states and one can effectively argue that there can be no classical analogue.&lt;br /&gt;
They are unique to quantum mechanics.  Some of these states are called entangled states.  However, &lt;br /&gt;
there are things one can do using quantum systems using un-entangled states that we have no idea how to do using classical systems.    &lt;br /&gt;
&lt;br /&gt;
So the answer to the question, &amp;quot;How do quantum computers provide an advantage?&amp;quot; is that we don't really know.  &lt;br /&gt;
&lt;br /&gt;
Let us first discuss&lt;br /&gt;
bits and qubits. We will then discuss quantum states of many particles which correspond &lt;br /&gt;
to entangled states. Finally, we will revisit this notion of intuition behind the quantum &lt;br /&gt;
mechanical speed-ups.&lt;br /&gt;
&lt;br /&gt;
===Bits and Qubits: An Introduction===&lt;br /&gt;
A ''classical bit'' is represented by two different states of a classical system. In classical computers&lt;br /&gt;
it is represented by two different values of an electrical potential difference. The two&lt;br /&gt;
different states of the system are represented by 0 and 1.&lt;br /&gt;
&lt;br /&gt;
A ''quantum bit'' or ''qubit'' (better, but less often used is Qbit, see [[Bibliography#Mermin:qcbook|N. David Mermin's book [1]]]) is represented by two&lt;br /&gt;
states of a quantum mechanical system. The two different states are represented by &amp;lt;math&amp;gt;\left\vert{0}\right\rangle&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\left\vert{1}\right\rangle&amp;lt;/math&amp;gt;. This notation is common and is explained in some detail in Appendix C.2.2, [[Appendix C - Vectors and Linear Algebra#Complex Vectors|Complex Vectors]].&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:Doublewell.jpeg]]&lt;br /&gt;
&lt;br /&gt;
Figure 1.1: This is a double well with a ball in one of the two wells.&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Let us discuss a way in which to think about the differences between classical and quantum&lt;br /&gt;
systems. We will consider two wells, or valleys, with a hill in between as in Fig. 1.1.&lt;br /&gt;
First we will consider a classical system and we will suppose there are no frictional forces.&lt;br /&gt;
If we start the ball rolling where it is in the figure, then it will roll back and forth in Well&lt;br /&gt;
0. (Well 0, or “Well zero” is our name for the well on the left-hand side.) It will never leave&lt;br /&gt;
Well 0 if we leave it alone. If we wanted it to go into Well 1 (the well on the right-hand side)&lt;br /&gt;
we would need to nudge it or push it a little to get it over the hill. Or we could just pick it&lt;br /&gt;
up and move it from one well to the other.&lt;br /&gt;
&lt;br /&gt;
Now suppose the system is quantum mechanical.&amp;lt;ref&amp;gt;For those with a little background in physics, these are potential wells. An example is a ball in between two hills for the classical case. For the quantum case, we can think of a quantum particle in a potential well&lt;br /&gt;
with this shape and solve Schr¨odinger’s equation.&amp;lt;/ref&amp;gt; In this case, if we set up the system&lt;br /&gt;
so that the particle initially has some kinetic energy (imagine a moving “quantum ball”),&lt;br /&gt;
and let it go, there is some probability, after some amount of time, that the particle will be&lt;br /&gt;
found in Well 1. This is true when the energy of the ball was not great enough to travel over&lt;br /&gt;
the hill in the classical analogy. The probability of it being found in the other well depends&lt;br /&gt;
on several things; the initial energy of the particle, the width of the hill, and the height of&lt;br /&gt;
the hill (equivalently the depth(s) of the wells, which could be different). However, it won’t&lt;br /&gt;
happen with a classical bit! So this is a difference between the classical and quantum mechanics.&amp;lt;ref&amp;gt; Now, if it is admitted that every particle is described by quantum mechanics, the the classically forbidden zone is forbidden because the probability of finding the ball there is extremely small (essentially zero).&amp;lt;/ref&amp;gt; In&lt;br /&gt;
quantum mechanics, the particle is in some sense in both wells at the same time. This has&lt;br /&gt;
to do with the “wave” nature of quantum mechanics. We then say that the particle is in a&lt;br /&gt;
superposition of Well 0 and Well 1 at the same time. Mathematically, we describe these&lt;br /&gt;
different physical “states” or conditions of the system in the following way.&lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt;\begin{align}\mbox{Particle is in Well } 0&amp;amp;=\left\vert{0}\right\rangle, \\  \mbox{Particle is in Well } 1&amp;amp;=\left\vert{1}\right\rangle\end{align}&amp;lt;/math&amp;gt;|1.1}}&lt;br /&gt;
In other words, the state of the system is “the particle is in Well 0” is written mathematically as &amp;lt;math&amp;gt;\left\vert{0}\right\rangle&amp;lt;/math&amp;gt;, and simiarly for &amp;lt;math&amp;gt;\left\vert{1}\right\rangle\,\!&amp;lt;/math&amp;gt;. If the particle is in a superposition of the two, which will mean some probability for finding the particle in each well, we would write this as&lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt;\left\vert{\psi}\right\rangle=\alpha\left\vert{0}\right\rangle+\beta\left\vert{1}\right\rangle\,\!&amp;lt;/math&amp;gt;|1.2}}&lt;br /&gt;
where &amp;lt;math&amp;gt;\alpha\,\!&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\beta\,\!&amp;lt;/math&amp;gt; are complex numbers (see [[Appendix B]]) and the probability of the particle&lt;br /&gt;
being found in Well 0 is &amp;lt;math&amp;gt;|\alpha|^2\,\!&amp;lt;/math&amp;gt; and the probability of it being found in Well 1 is &amp;lt;math&amp;gt;|\beta|^2\,\!&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Now, some (physicists no less) have asked how to make a deterministic transformation&lt;br /&gt;
in a quantum system. After all, this seems to be probabilistic. The way to do that is the&lt;br /&gt;
following. We make the hill very wide and tall and we put the particle right down in the&lt;br /&gt;
bottom of one well and give it as little initial energy as possible. Then if we want it moved&lt;br /&gt;
to the other well, we pick it up and move it&amp;lt;ref&amp;gt;Again a note for physicists. If we cool it to its ground state and make sure we don’t have stray kicks that will knock it out, we achieve this. Then we put the right amount of energy to get it to transition to the first excited state.&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If we measure the system, i.e. look to see if it is Well 0 or Well 1, we will “project it into&lt;br /&gt;
one state or the other.” In other words, suppose the system is in the state &amp;lt;math&amp;gt;\left|\psi\right\rangle\,\!&amp;lt;/math&amp;gt; above. If we&lt;br /&gt;
look to see where the particle is and find it in Well 1, then the probability is clearly zero &lt;br /&gt;
that it is in the other well. This is called the projection postulate in quantum mechanics and&lt;br /&gt;
we will see how to represent this mathematically later.  &lt;br /&gt;
&lt;br /&gt;
Throughout the notes, when trying to think about a physical qubit, this simple picture&lt;br /&gt;
is often helpful. Therefore, we will refer back to it from time to time.&lt;br /&gt;
&lt;br /&gt;
===Obstacles to Building a Reliable Quantum Computer===&lt;br /&gt;
&lt;br /&gt;
Noise is the greatest obstacle to building a quantum computer. This was also the case with&lt;br /&gt;
early electronic classical computing devices. In this case there is an intuitive explanation.  In a quantum computation, a quantum system becomes entangled.  Without going into detail, let us just say highly correlated is synonymous with entangled.  (Entangled states are discussed in [[Chapter 4 - Entanglement|Chapter 4]].)  Affecting one part of the system can affect another since two parts are highly correlated.  Entanglement is believed by some to be responsible for the power of some quantum information processing tasks and there is evidence for this.  However, the fact that these entangled systems are being used during the computation means that if a noise affects one part of the system, then other parts of the system are also affected.  In this sense, quantum systems are very delicate and must be handled with care.  &lt;br /&gt;
&lt;br /&gt;
For our purposes, we will need to discuss ''open-system evolution'' and ''closed-system evolution''. A closed system is one which does not have any interaction with external objects. We may also refer to such a system as isolated. For example, one knows that if a jar has a very good lid on it, no liquid can leak out, or into, the jar. So if we put a certain amount of liquid in it now, we can expect it will all be there later. This is a closed system and the liquid is isolated from masses external to the jar. In other words, no other mass can get in or out.&lt;br /&gt;
&lt;br /&gt;
A better example is what we call thermally isolated or a thermally closed system, meaning no heat energy is exchanged &lt;br /&gt;
with any other system. An open system is one which &lt;br /&gt;
can interact with its environment in some way. In these examples, a lid that is not sealed &lt;br /&gt;
can allow liquid vapor to escape and one that is not thermally isolated, or thermally closed &lt;br /&gt;
can heat up or cool down.&lt;br /&gt;
&lt;br /&gt;
For the quantum information processing tasks we have in mind, we will consider quantum information which is isolated form its environment and what we usually mean is that the quantum system is isolated and cannot be affected by an outside source.  It is important to note that isolated, or closed systems, are ideal. While they may often be good approximations to a system, they are never really completely isolated or closed.  One may consider larger and larger systems to try to obtain a closed system, but this is most often impractical, although it can be useful for modeling.  The fact that systems are never completely closed means that errors ''will'' creep into our quantum information processing, and we must find a way in which to deal with these errors in order to build reliable quantum information processing devices.&lt;br /&gt;
&lt;br /&gt;
==Further Reading==&lt;br /&gt;
&lt;br /&gt;
[[Bibliography#Mermin:qcbook|N. David Mermin's book [1]]] is a recent and excellent introductory text.  [[Bibliography#NielsenChuang:book|Nielsen and Chuang's book [2]]] is also very good and has become somewhat of a standard reference.  [[Bibliography#Preskill:notes|John Preskill's notes [5]]] are free to read and were part of the motivation for writing this book.  They are quite thorough and even include exercises on his course page.  One may also want to consult Quantiki's (http://www.quantiki.org/) excellent encyclopedia of quantum information http://www.quantiki.org/wiki/Main_Page.  There is an article concerning introductory material, entitled [http://www.quantiki.org/wiki/Basic_concepts_in_quantum_computation Basic Concepts in Quantum Computation], and also tutorials on various topics.&lt;br /&gt;
&lt;br /&gt;
==Footnotes==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Chapter 2 - Qubits and Collections of Qubits#Introduction|Continue to '''Chapter 2 - Qubits and Collections of Qubits''']]&lt;/div&gt;</summary>
		<author><name>Ddghunter</name></author>
		
	</entry>
	<entry>
		<id>https://www2.physics.siu.edu/qunet/wiki/index.php?title=Chapter_1_-_Introduction&amp;diff=2332</id>
		<title>Chapter 1 - Introduction</title>
		<link rel="alternate" type="text/html" href="https://www2.physics.siu.edu/qunet/wiki/index.php?title=Chapter_1_-_Introduction&amp;diff=2332"/>
		<updated>2012-12-24T19:24:11Z</updated>

		<summary type="html">&lt;p&gt;Ddghunter: /* How do quantum computers provide an advantage? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===Introduction===&lt;br /&gt;
&lt;br /&gt;
''In science one tries to tell people, in such a way as to be understood by everyone, something that no one ever knew before. But in poetry, it's the exact opposite.''&lt;br /&gt;
&lt;br /&gt;
-Paul Dirac&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===An Introduction to Quantum Computation===&lt;br /&gt;
&lt;br /&gt;
This introductory chapter is a survey of, and introduction to, topics in quantum information&lt;br /&gt;
processing. All of these topics (and more) will be revisited in later sections. Therefore,&lt;br /&gt;
it is not necessary, nor expected, that the reader will feel the subjects have been completely explained in this&lt;br /&gt;
introductory material.  Furthermore, if one has some background in quantum computing, this chapter may be skipped.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Quantum Mechanics====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So what is quantum mechanics? We should think of it as a set of rules, in some ways&lt;br /&gt;
similar to Newton’s laws, which describe the way the world works. These are the rules&lt;br /&gt;
to which we must carefully attend in order to build what we will describe as a quantum&lt;br /&gt;
computing device. We will return to this topic briefly again later. However, as is done in&lt;br /&gt;
many places, this question is never quite answered directly. Most often we simply learn the&lt;br /&gt;
rules and how to use them. The question itself is perhaps a little vague because there are many&lt;br /&gt;
physical systems that don’t quite fit into an either/or categorization of quantum vs. classical (since, as stated already, classical mechanics is an approximation to quantum mechanics).&lt;br /&gt;
Also, it should be noted that throughout these notes the terms will be somewhat misused, in&lt;br /&gt;
the sense that certain systems will be called quantum mechanical or classical, and from now&lt;br /&gt;
on, with few exceptions, no care will be taken to discuss subtleties.  &lt;br /&gt;
&lt;br /&gt;
====Quantum Computing and Quantum Information Processing====&lt;br /&gt;
&lt;br /&gt;
A quantum computer would be a computer that would take advantage of quantum mechanical &lt;br /&gt;
evolutions according to which physical systems behave. We often think of quantum mechanics&lt;br /&gt;
as being the set of mechanical laws or principles that only very small particles obey. While this&lt;br /&gt;
is not really true, it is a somewhat reasonable way of explaining things to the layman since the world of the &amp;quot;small&amp;quot; is the world where these laws are most often used and were discovered. For our&lt;br /&gt;
purposes, we should note that everything obeys the laws of quantum mechanics and that&lt;br /&gt;
Newtonian mechanics are rules that we use to approximate quantum mechanics. However,&lt;br /&gt;
quantum mechanical control and natural quantum mechanical evolution, which cannot be approximated by Newton's laws, &lt;br /&gt;
are what we are talking about when we talk about quantum systems. We must have very particular quantum mechanical&lt;br /&gt;
evolution, which cannot be reasonably approximated with classical mechanics, and use it in a&lt;br /&gt;
particular way to really perform a quantum computation or to really do quantum information&lt;br /&gt;
processing.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We have not yet built a quantum computing device. However, there are many reasons&lt;br /&gt;
to study quantum information processing other than building a fully functional quantum&lt;br /&gt;
computer. One main reason we haven’t built one is that we have to figure out how. The&lt;br /&gt;
experiments to perform quantum computation in physical devices take an enormous amount&lt;br /&gt;
of effort due to noises which corrupt the information. We are going to need to fix the&lt;br /&gt;
corrupted information, avoid the noises, or do away with them by some other means. A &lt;br /&gt;
reason to study quantum computing, and quantum information processing more&lt;br /&gt;
generally, is that there are really many quantum information processing tasks, or tasks&lt;br /&gt;
which can be thought of in this way, which concern quantum control. Precise control of&lt;br /&gt;
a quantum system is important for a variety of reasons, not the least of which is that our&lt;br /&gt;
world is quantum mechanical! When we get right down to the very basic elements of the&lt;br /&gt;
universe, they behave quantum mechanically. If there is one thing that the study of quantum&lt;br /&gt;
information processing has already taught us, it's that we need to pay attention to quantum&lt;br /&gt;
mechanics because it can be very useful to be able to manipulate quantum systems and take&lt;br /&gt;
advantage of uniquely quantum properties. Quantum technologies are going to be extremely&lt;br /&gt;
important in the future, even if we never built a quantum computer. (Oh, but we will!) As&lt;br /&gt;
Feynman said, “There is plenty of room at the bottom.” We have a lot to discover about&lt;br /&gt;
the world of the small.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Since noise has been, and is still, such a problem for quantum information, we need to deal with it. People quickly recognized this problem, and Peter Shor, and others, really made remarkable statements with their work on quantum error correcting codes. Their work showed that errors could, in principle, be corrected, leading the way for future research since it was then plausible that a quantum computer could be built – there are no fundamental obstacles. However, quantum error correcting codes are, in some sense, a software solution to a hardware problem. More physical treatments include codes which avoid errors, and control methods which are designed to average noises away. However, an all-out attack will include several different methods of error prevention used together. Error prevention methods are the subject of the last part of this course/book.&lt;br /&gt;
&lt;br /&gt;
====Motivation====&lt;br /&gt;
Why do we want to build a quantum computing device?&lt;br /&gt;
&lt;br /&gt;
#To make computers faster and more compact, we have been making them smaller (This has obeyed Moore’s law, see, [[Bibliography#Moore'sLaw:article|Moore's Law article [16]]]).  However, there is a limit to how much smaller we can make them and still have them function as they do now. This is due to quantum mechanics. In other words, the limit to small scale computational technology is governed by quantum mechanics, since, at a certain scale, the current computational systems will not be able to be approximated by Newtonian mechanics. So, to make things smaller, we need to use quantum mechanics! More than this though, the fact that Moore’s law cannot continue indefinitely means that we will need to look elsewhere for advances in computing power. One way to increase computing power is to use parallel computations. However, there are processes which cannot be parallel. So where do we turn? A quantum computer would help with this.&lt;br /&gt;
#We now know of several different quantum algorithms which are faster than any known classical algorithm for performing the same task. Some are actually provably faster. These are listed and discussed further in the next section.&lt;br /&gt;
#Quantum information can be used in a variety of ways beyond computing. Such as quantum cryptography, quantum games, and quantum communication of all sorts. &lt;br /&gt;
&lt;br /&gt;
An important point to take away from this section is that information is stored and&lt;br /&gt;
manipulated by physical devices. The way in which they behave is important for the tasks&lt;br /&gt;
that are to be performed.&lt;br /&gt;
&lt;br /&gt;
====Specific Uses====&lt;br /&gt;
There are at least three advantages of quantum computing devices which are often quoted:&lt;br /&gt;
&lt;br /&gt;
#Factor large integers more efficiently than a classical machine (known as Shor’s algorithm).&lt;br /&gt;
#Find an object in an unsorted database more efficiently than a classical machine (known as Govers algorithm).&lt;br /&gt;
#Simulate quantum mechanical systems more efficiently than any classical system (due to Feynman and others).&lt;br /&gt;
&lt;br /&gt;
====COMMENTS====&lt;br /&gt;
Shor’s algorithm would render RSA encryption useless. It is more efficient than any&lt;br /&gt;
known classical algorithm. (There is a quantum answer to this problem however-quantum&lt;br /&gt;
cryptography through QKD.)&lt;br /&gt;
&lt;br /&gt;
Gover’s algorithm is better than any classical algorithm – phone book example: classical&lt;br /&gt;
algorithm grows as &amp;lt;math&amp;gt;N/2\,\!&amp;lt;/math&amp;gt; and Grover’s grows as &amp;lt;math&amp;gt;\sqrt{N}\,\!&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Simulating quantum mechanical systems is quite difficult classically. For physical scientists&lt;br /&gt;
this could be the most important application of quantum computers. This could enable&lt;br /&gt;
the simulation of nuclear systems, solid-state devices, biological molecules and molecular&lt;br /&gt;
interactions, etc. much more efficiently than classical simulation.  This would enable calculations which are practically impossible now.&lt;br /&gt;
&lt;br /&gt;
====How do quantum computers provide an advantage?====&lt;br /&gt;
The claim is that quantum computers could solve some problems more efficiently than any &lt;br /&gt;
classical one. So viewing our information systems as quantum systems, we may note that&lt;br /&gt;
quantum mechanics is more than a description of the physical world (which is how physicists have&lt;br /&gt;
treated it for years) and is instead a set of rules governing the behaviour of information when stored&lt;br /&gt;
and manipulated quantum mechanically.  &lt;br /&gt;
&lt;br /&gt;
So the natural question is, “How does it do this?” We may also ask, “Where is the&lt;br /&gt;
advantage?” In other words, “What exactly about quantum mechanics enables us to achieve&lt;br /&gt;
speed-ups and other information processing tasks more efficiently than classical systems?”&lt;br /&gt;
Many people, as of the time of this writing, would likely say they don’t know. For example,&lt;br /&gt;
it is not known if there is a classical algorithm which could factor efficiently (By efficiently&lt;br /&gt;
here, let us just say that we mean “fewer resources,” and be more specific later). Or perhaps they would say &amp;lt;nowiki&amp;gt;&amp;quot;entanglement&amp;quot;&amp;lt;/nowiki&amp;gt; is responsible for the apparent speedups.  But this is a subject yet to be discussed.  One can present an intuitive plausible argument for why we believe a quantum computer can accomplish things a classical one cannot. However, there is no claim of a proof of anything at this point.  &lt;br /&gt;
&lt;br /&gt;
The argument concerns the fact that when a given machine has a different set of rules for operating, we expect&lt;br /&gt;
it to be able to do different things. The rules by which classical computing machines function are, in &lt;br /&gt;
some real sense, different from the ones governing the behavior of quantum machines. This is &lt;br /&gt;
quite vague, especially given the earlier comments about how everything really is quantum &lt;br /&gt;
mechanical. One may think about it (but someone is sure to argue) as a “classical object” &lt;br /&gt;
transforms according to a “classical equation of motion” and the result is determined by &lt;br /&gt;
its initial state, which is “classical.” A quantum mechanical state transforms according to a&lt;br /&gt;
“quantum equation of motion” and the result of the evolution is determined by some initial &lt;br /&gt;
conditions, which describe a “quantum system.” Perhaps this sounds like a circular argument,&lt;br /&gt;
primarily involving semantics.  However, the motivation for this as a definition comes from vector and tensor analysis: an object is a tensor if it transforms like a tensor. So we might say, an object is classical if it obeys classical equations.  In practice, this is often the way things are done.  If the physical system can be well-approximated using classical mechanics, we call it classical.  &lt;br /&gt;
&lt;br /&gt;
One can further argue that there are states which are uniquely quantum mechanical. &lt;br /&gt;
These are states which would have been mysterious to Newton, and indeed they were mysterious&lt;br /&gt;
to Einstein.  Furthermore, they are still mysterious today! The important point is&lt;br /&gt;
that there is no known classical analogue for some quantum states and one can effectively argue that there can be no classical analogue.&lt;br /&gt;
They are unique to quantum mechanics.  Some of these states are called entangled states.  However, &lt;br /&gt;
there are things one can do using quantum systems using un-entangled states that we have no idea how to do using classical systems.    &lt;br /&gt;
&lt;br /&gt;
So the answer to the question, &amp;quot;How do quantum computers provide an advantage?&amp;quot; is that we don't really know.  &lt;br /&gt;
&lt;br /&gt;
Let us first discuss&lt;br /&gt;
bits and qubits. We will then discuss quantum states of many particles which correspond &lt;br /&gt;
to entangled states. Finally, we will revisit this notion of intuition behind the quantum &lt;br /&gt;
mechanical speed-ups.&lt;br /&gt;
&lt;br /&gt;
===Bits and Qubits: An Introduction===&lt;br /&gt;
A ''classical bit'' is represented by two different states of a classical system. In classical computers&lt;br /&gt;
it is represented by two different values of an electrical potential difference. The two&lt;br /&gt;
different states of the system are represented by 0 and 1.&lt;br /&gt;
&lt;br /&gt;
A ''quantum bit'' or ''qubit'' (better, but less often used is Qbit, see [[Bibliography#Mermin:qcbook|N. David Mermin's book [1]]]) is represented by two&lt;br /&gt;
states of a quantum mechanical system. The two different states are represented by &amp;lt;math&amp;gt;\left\vert{0}\right\rangle&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\left\vert{1}\right\rangle&amp;lt;/math&amp;gt;. This notation is common and is explained in some detail in Appendix C.2.2, [[Appendix C - Vectors and Linear Algebra#Complex Vectors|Complex Vectors]].&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:Doublewell.jpeg]]&lt;br /&gt;
&lt;br /&gt;
Figure 1.1: This is a double well with a ball in one of the two wells.&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Let us discuss a way in which to think about the differences between classical and quantum&lt;br /&gt;
systems. We will consider two wells, or valleys, with a hill in between as in Fig. 1.1.&lt;br /&gt;
First we will consider a classical system and we will suppose there are no frictional forces.&lt;br /&gt;
If we start the ball rolling where it is in the figure, then it will roll back and forth in Well&lt;br /&gt;
0. (Well 0, or “Well zero” is our name for the well on the left-hand side.) It will never leave&lt;br /&gt;
Well 0 if we leave it alone. If we wanted it to go into Well 1 (the well on the right-hand side)&lt;br /&gt;
we would need to nudge it or push it a little to get it over the hill. Or we could just pick it&lt;br /&gt;
up and move it from one well to the other.&lt;br /&gt;
&lt;br /&gt;
Now suppose the system is quantum mechanical.&amp;lt;ref&amp;gt;For those with a little background in physics, these are potential wells. An example is a ball in between two hills for the classical case. For the quantum case, we can think of a quantum particle in a potential well&lt;br /&gt;
with this shape and solve Schr¨odinger’s equation.&amp;lt;/ref&amp;gt; In this case, if we set up the system&lt;br /&gt;
so that the particle initially has some kinetic energy (imagine a moving “quantum ball”),&lt;br /&gt;
and let it go, there is some probability, after some amount of time, that the particle will be&lt;br /&gt;
found in Well 1. This is true when the energy of the ball was not great enough to travel over&lt;br /&gt;
the hill in the classical analogy. The probability of it being found in the other well depends&lt;br /&gt;
on several things; the initial energy of the particle, the width of the hill, and the height of&lt;br /&gt;
the hill (equivalently the depth(s) of the wells, which could be different). However, it won’t&lt;br /&gt;
happen with a classical bit! So this is a difference between the classical and quantum mechanics.&amp;lt;ref&amp;gt; Now, if it is admitted that every particle is described by quantum mechanics, the the classically forbidden zone is forbidden because the probability of finding the ball there is extremely small (essentially zero).&amp;lt;/ref&amp;gt; In&lt;br /&gt;
quantum mechanics, the particle is in some sense in both wells at the same time. This has&lt;br /&gt;
to do with the “wave” nature of quantum mechanics. We then say that the particle is in a&lt;br /&gt;
superposition of Well 0 and Well 1 at the same time. Mathematically, we describe these&lt;br /&gt;
different physical “states” or conditions of the system in the following way.&lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt;\begin{align}\mbox{Particle is in Well } 0&amp;amp;=\left\vert{0}\right\rangle, \\  \mbox{Particle is in Well } 1&amp;amp;=\left\vert{1}\right\rangle\end{align}&amp;lt;/math&amp;gt;|1.1}}&lt;br /&gt;
In other words, the state of the system is “the particle is in Well 0” is written mathematically as &amp;lt;math&amp;gt;\left\vert{0}\right\rangle&amp;lt;/math&amp;gt;, and simiarly for &amp;lt;math&amp;gt;\left\vert{1}\right\rangle\,\!&amp;lt;/math&amp;gt;. If the particle is in a superposition of the two, which will mean some probability for finding the particle in each well, we would write this as&lt;br /&gt;
{{Equation|&amp;lt;math&amp;gt;\left\vert{\psi}\right\rangle=\alpha\left\vert{0}\right\rangle+\beta\left\vert{1}\right\rangle\,\!&amp;lt;/math&amp;gt;|1.2}}&lt;br /&gt;
where &amp;lt;math&amp;gt;\alpha\,\!&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\beta\,\!&amp;lt;/math&amp;gt; are complex numbers (see [[Appendix B]]) and the probability of the particle&lt;br /&gt;
being found in Well 0 is &amp;lt;math&amp;gt;|\alpha|^2\,\!&amp;lt;/math&amp;gt; and the probability of it being found in Well 1 is &amp;lt;math&amp;gt;|\beta|^2\,\!&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Now, some (physicists no less) have asked how to make a deterministic transformation&lt;br /&gt;
in a quantum system. After all, this seems to be probabilistic. The way to do that is the&lt;br /&gt;
following. We make the hill very wide and tall and we put the particle right down in the&lt;br /&gt;
bottom of one well and give it as little initial energy as possible. Then if we want it moved&lt;br /&gt;
to the other well, we pick it up and move it&amp;lt;ref&amp;gt;Again a note for physicists. If we cool it to its ground state and make sure we don’t have stray kicks that will knock it out, we achieve this. Then we put the right amount of energy to get it to transition to the first excited state.&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If we measure the system, i.e. look to see if it is Well 0 or Well 1, we will “project it into&lt;br /&gt;
one state or the other.” In other words, suppose the system is in the state &amp;lt;math&amp;gt;\left|\psi\right\rangle\,\!&amp;lt;/math&amp;gt; above. If we&lt;br /&gt;
look to see where the particle is and find it in Well 1, then the probability is clearly zero &lt;br /&gt;
that it is in the other well. This is called the projection postulate in quantum mechanics and&lt;br /&gt;
we will see how to represent this mathematically later.  &lt;br /&gt;
&lt;br /&gt;
Throughout the notes, when trying to think about a physical qubit, this simple picture&lt;br /&gt;
is often helpful. Therefore, we will refer back to it from time to time.&lt;br /&gt;
&lt;br /&gt;
===Obstacles to Building a Reliable Quantum Computer===&lt;br /&gt;
&lt;br /&gt;
Noise is the greatest obstacle to building a quantum computer. This was also the case with&lt;br /&gt;
early electronic classical computing devices. In this case there is an intuitive explanation.  In a quantum computation, a quantum system becomes entangled.  Without going into detail, let us just say highly correlated is synonymous with entangled.  (Entangled states are discussed in [[Chapter 4 - Entanglement|Chapter 4]].)  Affecting one part of the system can affect another since two parts are highly correlated.  Entanglement is believed by some to be responsible for the power of some quantum information processing tasks and there is evidence for this.  However, the fact that these entangled systems are being used during the computation means that if a noise affects one part of the system, then other parts of the system are also affected.  In this sense, quantum systems are very delicate and must be handled with care.  &lt;br /&gt;
&lt;br /&gt;
For our purposes, we will need to discuss ''open-system evolution'' and ''closed-system evolution''. A closed system is one which does not have any interaction with external objects. We may also refer to such a system as isolated. For example, one knows that if a jar has a very good lid on it, no liquid can leak out, or into, the jar. So if we put a certain amount of liquid in it now, we can expect it will all be there later. This is a closed system and the liquid is isolated from masses external to the jar. In other words, no other mass can get in or out.&lt;br /&gt;
&lt;br /&gt;
A better example is what we call thermally isolated or a thermally closed system, meaning no heat energy is exchanged &lt;br /&gt;
with any other system. An open system is one which &lt;br /&gt;
can interact with its environment in some way. In these examples, a lid that is not sealed &lt;br /&gt;
can allow liquid vapor to escape and one that is not thermally isolated, or thermally closed &lt;br /&gt;
can heat up or cool down.&lt;br /&gt;
&lt;br /&gt;
For the quantum information processing tasks we have in mind, we will consider quantum information which is isolated form its environment and what we usually mean is that the quantum system is isolated and cannot be affected by an outside source.  It is important to note that isolated, or closed systems, are ideal. While they may often be good approximations to a system, they are basically never really completely isolated or closed.  One may consider larger and larger systems to try to obtain a closed system, but this is most often impractical, although it can be useful for modeling.  The fact that systems are never completely closed means that errors ''will'' creep into our quantum information processing, and we must find a way in which to deal with these errors in order to build reliable quantum information processing devices.&lt;br /&gt;
&lt;br /&gt;
==Further Reading==&lt;br /&gt;
&lt;br /&gt;
[[Bibliography#Mermin:qcbook|N. David Mermin's book [1]]] is a recent and excellent introductory text.  [[Bibliography#NielsenChuang:book|Nielsen and Chuang's book [2]]] is also very good and has become somewhat of a standard reference.  [[Bibliography#Preskill:notes|John Preskill's notes [5]]] are free to read and were part of the motivation for writing this book.  They are quite thorough and even include exercises on his course page.  One may also want to consult Quantiki's (http://www.quantiki.org/) excellent encyclopedia of quantum information http://www.quantiki.org/wiki/Main_Page.  There is an article concerning introductory material, entitled [http://www.quantiki.org/wiki/Basic_concepts_in_quantum_computation Basic Concepts in Quantum Computation], and also tutorials on various topics.&lt;br /&gt;
&lt;br /&gt;
==Footnotes==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Chapter 2 - Qubits and Collections of Qubits#Introduction|Continue to '''Chapter 2 - Qubits and Collections of Qubits''']]&lt;/div&gt;</summary>
		<author><name>Ddghunter</name></author>
		
	</entry>
	<entry>
		<id>https://www2.physics.siu.edu/qunet/wiki/index.php?title=Chapter_13_-_Topological_Quantum_Error_Correction&amp;diff=2008</id>
		<title>Chapter 13 - Topological Quantum Error Correction</title>
		<link rel="alternate" type="text/html" href="https://www2.physics.siu.edu/qunet/wiki/index.php?title=Chapter_13_-_Topological_Quantum_Error_Correction&amp;diff=2008"/>
		<updated>2012-11-19T23:14:59Z</updated>

		<summary type="html">&lt;p&gt;Ddghunter: /* Surface Code */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Surface Code ==&lt;br /&gt;
===Introduction===&lt;br /&gt;
&lt;br /&gt;
Surface codes  are topological quantum error-correcting codes in which we can think of qubits being arranged on a 2-D lattice of qubits with only nearest neighbor interactions. This in practice may prove to be a very useful feature, since for many systems interacting qubits that are close to each other is substantially less difficult than ones that are further apart. We can think of physical qubits as being arranged on the edges of a lattice as shown in Figure 1. An example of the surface code are toric code and  planar code, the main difference between both of them is the boundary condition. In the toric code, the boundaries  are periodic whereas  in the case of the planar code, the boundaries are not periodic. In the toric code, the qubits are arranged on a lattice which can be thought of as spread over a surface of a torus, and in a planar code case we think of the data qubits as living on a simple 2-D plane and ancilla qubits on the faces and the intersections.&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:lattice.jpg]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;'''Figure 1'''&amp;lt;br&amp;gt;A two-dimensional array implementation of the surface code. Data qubits are open circles, measurements (ancilla) qubits are filled circles.&amp;lt;br&amp;gt;The yellow area is to  measure-Z qubits while the green area is to  measure-X qubits.&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The stabilizer generators for the surface code are the tensor products of ''Z'' on the four data qubits around each face, and the tensor products of ''X'' on&lt;br /&gt;
the four data qubits around each intersection. Neighbouring stabilizers share two data qubits ensuring that adjacent ''X'' and ''Z'' stabilizers commute. The qubit ''Z'' eigenstate are called the ground state &amp;lt;math&amp;gt;\left\vert{g}\right\rangle&amp;lt;/math&amp;gt;  and the excited state &amp;lt;math&amp;gt;\left\vert{e}\right\rangle&amp;lt;/math&amp;gt;. The ground state is the ''+1'' eigenstate of ''Z'', with &amp;lt;math&amp;gt;Z\left\vert{g}\right\rangle=+\left\vert{g}\right\rangle&amp;lt;/math&amp;gt;, and the excited state is the ''-1'' eigenstate, with &amp;lt;math&amp;gt;Z\left\vert{e}\right\rangle=-\left\vert{e}\right\rangle&amp;lt;/math&amp;gt;. It is tempting to think of the qubit as a kind of quantum transistor, with the ground state corresponding to &amp;quot;off&amp;quot; and the excited state to &amp;quot;on&amp;quot;. However, in distinct contrast to a classical logical element, a qubit can exist in a superposition of its eigenstate, &amp;lt;math&amp;gt;\left\vert{\psi}\right\rangle=\alpha\left\vert{g}\right\rangle+\beta\left\vert{g}\right\rangle&amp;lt;/math&amp;gt;, so a qubit can be both &amp;quot;off&amp;quot; and on&amp;quot; at the same time. A measurment &amp;lt;math&amp;gt;M_Z&amp;lt;/math&amp;gt; of the qubit will however return only one of two possible measurement outcomes,''+1'' with the qubit state projected to &amp;lt;math&amp;gt;\left\vert{g}\right\rangle&amp;lt;/math&amp;gt;, or ''-1'' with the qubit state projected to &amp;lt;math&amp;gt;\left\vert{e}\right\rangle&amp;lt;/math&amp;gt; .&lt;br /&gt;
&lt;br /&gt;
A planar code has four boundaries, two that are called “smooth” and two that are called “rough”. Smooth boundaries have four-term ''Z'' stabilizer generators, and three-term ''X'' stabilizer generators, whereas rough boundaries have four-term ''X'' stabilizer generators and three-term ''Z'' stabilizer generators. A planar code, with two rough and two smooth boundaries can encode a single logical qubit (as in Figure 2). Also look at http://arxiv.org/abs/1208.0928 it is an excellent reference as it represents a comprehensive review of the surface code, also written for the absolute beginner.&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:boundaries.jpg]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;'''Figure 2'''&amp;lt;br&amp;gt;Examples of smooth and rough boundaries. This figure has been copied with a permission from the authors of Ref. 2&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Syndrome Extraction and Error Detection===&lt;br /&gt;
Detecting errors involves measuring check operators, and observing which ones give a value of ''-1'' (due to anti-commuting with errors). This information helps us guess where errors occurred. In practice, of course, errors do not have to occur on their own, and often one can observe multiple instances next to each other. In these cases, the error operators form error chains throughout the lattice. Since only&lt;br /&gt;
the ends of such error chains anti-commute with the check operators, determining where errors occurred often involves guessing the most likely scenario. In the planar case, the chains  connect opposite boundaries of the same type (either left to right, or top to bottom), and&lt;br /&gt;
in the toric case, chains that span all the way across a given dimension of the lattice.  They turn out to the change the encoded, logical&lt;br /&gt;
state of the qubit and hence are called logical errors. Two examples are shown Figures 3 and 4. &amp;lt;math&amp;gt;Z_L&amp;lt;/math&amp;gt; is a chain of ''Z'' operators that connects two rough boundaries, and &amp;lt;math&amp;gt;X_L&amp;lt;/math&amp;gt; chain of ''X'' operators that connects two smooth ones.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:defect.jpg]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;'''Figure 3'''&amp;lt;br&amp;gt;Examples of error syndromes on the Surface code (planar and toric). The state is initialized to the ''+1'' eigenstate of all stabilizers.&amp;lt;br&amp;gt;Shaded qubits indicate locations of ''X'' errors. This figure has been copied with a permission from the authors of Ref. 5&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:error.jpg]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;'''Figure 4'''&amp;lt;br&amp;gt;A planar surface code in which a logical ''Z (X)'' error is a chain of ''Z (X)''&lt;br /&gt;
operators that spans the whole lattice, and connects rough (smooth) boundaries.&amp;lt;br&amp;gt;This figure has been copied with a permission from the authors of Ref. 5&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:error_toric.jpg]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;'''Figure 5'''&amp;lt;br&amp;gt;We can encode two qubits in a toric code, since there are no boundaries.&amp;lt;br&amp;gt;This shows how logical operations are done on a) the first qubit, and b) the second.&amp;lt;br&amp;gt;In both cases, the logical operations involve applying a set of operators (either ''X'' or ''Z'') in a chain that goes around one of the dimensions of the torus.&amp;lt;br&amp;gt;This figure has been copied with a permission from the authors of Ref. 2&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The  ancilla qubits are used for determining the measurement outcomes of the four-term (and three-term on boundaries) check operators without actually needing to measure them directly. We call these outcomes syndromes, and use them to determine where errors have occurred. A generic circuit capable of determining the sign of a stabilize in  Figure 6. The approach consists of initializing the ancilla qubits, performing a collection of CNOT gates with neighboring data qubits, and finally reading out (measuring) the ancillas.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:circuit.jpg]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;'''Figure 6'''&amp;lt;br&amp;gt;a) General circuit determining the sign of a stabilizer S.&amp;lt;br&amp;gt;b) Circuit determining the sign of a stabilizer ''XXXX''.&amp;lt;br&amp;gt;c) Circuit determining the sign of a stabilizer ''ZZZZ''.&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The orientation of the CNOT gates is different when dealing with ancilla qubits that are located on the vertices, from the ones that sit on the plaquettes. In the former case, the ancilla qubits play the role of control, while the data qubits are targets. The situation is reversed in the latter scenario. An example of the plaquette readout is shown in Figure 7. The syndrome is now the change in eigenvalues measured between sequential timeslices, just as the syndrome for error-free syndrome extraction likely set of errors that is consistent with the observed syndrome, now in three dimensions: two spatial and one temporal.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:cycle.jpg]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; A syndrome measurement typically involves six steps:&amp;lt;br&amp;gt;ancilla qubit initialization, CNOTs with the four surrounding data qubits fewer on boundaries in a planar code case, and finally ancilla qubit readout.&amp;lt;br&amp;gt;This example shows a temporal order of the CNOT gates of north, west, east, and south. This figure has been copied with a permission from the authors of Ref. 2&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Error Correction===&lt;br /&gt;
After each ancilla is read, its value is checked against a result from the previous iteration, and if the values differ, the syndrome change&lt;br /&gt;
location (in time and space) is recorded. Next, a matching of all the syndrome changes collected up to this point is used to guess where errors occurred. An example of this is shown in Figure 8, where we can see that in this particular scenario, a collection of ''X'' errors (shown as ''X''s in blue) after six readout cycles, have led to the given space-time locations of syndrome changes (red dots). We stress that one could get the same readout pattern from a different set of errors, hence the best we can do when guessing where the errors occurred is find a guess that is the most likely scenario.&lt;br /&gt;
&lt;br /&gt;
To do this, we observe that shorter error chains are more likely than longer  ones and therefore use a minimum-weight matching algorithm  to match the syndrome change locations and obtain a likely error pattern. Before the matching algorithm can find a minimum-weight solution, however, we need to convert our matching results into something that the matching algorithm can understand. This is done by converting all the syndrome change results into a graph, with the locations of the syndrome changes representing the graph’s nodes, and edges between  these nodes having a weight which depends on the distance between them. The edge weight is measured in faces along the spatial dimensions and ancilla qubit readout cycles along the time dimension.&lt;br /&gt;
&lt;br /&gt;
Finally, the corrected lattice is then passed onto error detection routines which can determine whether a logical  error has occurred. If it has, then the simulation is stopped and the previous cycle step (at which the simulation was “frozen”) recorded. If no logical error has been detected, the simulation is reverted to the state just before the “perfect readout” cycle began and continues on.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:graph.jpg]]&amp;lt;br&amp;gt;&lt;br /&gt;
a) An example of syndrome change locations (red dots) after six readout cycles. The ''X'' operators represent the actual errors that the lattice suffered,&amp;lt;br&amp;gt;which lead to the given syndrome change location pattern. These now have to be matched to obtain a guess as to where the errors happened.&amp;lt;br&amp;gt;b) The matching of syndrome changes gives us information on which errors should be corrected.&amp;lt;br&amp;gt;This figure has been copied with a permission from the authors of Ref. 5&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
'''1.''' Austin  Fowler, Matteo Mariantoni, John  Martinis, Andrew  Cleland, http://arxiv.org/abs/1208.0928, Submitted on 4 Aug 2012.&amp;lt;br&amp;gt;&lt;br /&gt;
'''2.''' Austin Fowler, Ashley Stephens, and Peter Groszkowski,  Phy. Rev. A. '''80''' 052312 (2009).&amp;lt;br&amp;gt;&lt;br /&gt;
'''3.''' David Wang, Austin Fowler, and Lloyd Hollenberg, Phy. Rev. A, '''83''', 020302 (2010).&amp;lt;br&amp;gt;&lt;br /&gt;
'''4.''' Austin  Fowler, David  Wang, and Lloyd Hollenberg, Quantum Information &amp;amp; Computation '''11''', 8-18 (2011).&amp;lt;br&amp;gt;&lt;br /&gt;
'''5.''' Peter Groszkowski, Master thesis, Waterloo, Ontario, Canada, 2009.&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Ddghunter</name></author>
		
	</entry>
	<entry>
		<id>https://www2.physics.siu.edu/qunet/wiki/index.php?title=Chapter_13_-_Topological_Quantum_Error_Correction&amp;diff=2007</id>
		<title>Chapter 13 - Topological Quantum Error Correction</title>
		<link rel="alternate" type="text/html" href="https://www2.physics.siu.edu/qunet/wiki/index.php?title=Chapter_13_-_Topological_Quantum_Error_Correction&amp;diff=2007"/>
		<updated>2012-11-19T22:13:26Z</updated>

		<summary type="html">&lt;p&gt;Ddghunter: /* Syndrome Extraction and Error Detection */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Surface Code ==&lt;br /&gt;
===Introduction===&lt;br /&gt;
&lt;br /&gt;
Surface codes  are topological quantum error-correcting codes in which we can think of qubits being arranged on a 2-D lattice of qubits with only nearest neighbor interactions. This in practice may prove to be a very useful feature, since for many systems interacting qubits that are close to each other is substantially less difficult than ones that are further apart. We can think of physical qubits as being arranged on the edges of a lattice as shown in Figure 1. An example of the surface code are toric code and  planar code, the main difference between both of them is the boundary condition. In the toric code, the boundaries  are periodic whereas  in the case of the planar code, the boundaries are not periodic. In the toric code, the qubits are arranged on a lattice which can be thought of as spread over a surface of a torus, and in a planar code case we think of the data qubits as living on a simple 2-D plane and ancilla qubits on the faces and the intersections.&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:lattice.jpg]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;'''Figure 1'''&amp;lt;/center&amp;gt;&amp;lt;center&amp;gt;A two-dimensional array implementation of the surface code. Data qubits are open circles, measurements (ancilla) qubits are filled circles.&amp;lt;/center&amp;gt;&amp;lt;center&amp;gt;The yellow area is to  measure-Z qubits while the green area is to  measure-X qubits.&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The stabilizer generators for the surface code are the tensor products of ''Z'' on the four data qubits around each face, and the tensor products of ''X'' on&lt;br /&gt;
the four data qubits around each intersection. Neighbouring stabilizers share two data qubits ensuring that adjacent ''X'' and ''Z'' stabilizers commute. The qubit ''Z'' eigenstate are called the ground state &amp;lt;math&amp;gt;\left\vert{g}\right\rangle&amp;lt;/math&amp;gt;  and the excited state &amp;lt;math&amp;gt;\left\vert{e}\right\rangle&amp;lt;/math&amp;gt;. The ground state is the ''+1'' eigenstate of ''Z'', with &amp;lt;math&amp;gt;Z\left\vert{g}\right\rangle=+\left\vert{g}\right\rangle&amp;lt;/math&amp;gt;, and the excited state is the ''-1'' eigenstate, with &amp;lt;math&amp;gt;Z\left\vert{e}\right\rangle=-\left\vert{e}\right\rangle&amp;lt;/math&amp;gt;. It is tempting to think of the qubit as a kind of quantum transistor, with the ground state corresponding to &amp;quot;off&amp;quot; and the excited state to &amp;quot;on&amp;quot;. However, in distinct contrast to a classical logical element, a qubit can exist in a superposition of its eigenstate, &amp;lt;math&amp;gt;\left\vert{\psi}\right\rangle=\alpha\left\vert{g}\right\rangle+\beta\left\vert{g}\right\rangle&amp;lt;/math&amp;gt;, so a qubit can be both &amp;quot;off&amp;quot; and on&amp;quot; at the same time. A measurment &amp;lt;math&amp;gt;M_Z&amp;lt;/math&amp;gt; of the qubit will however return only one of two possible measurement outcomes,''+1'' with the qubit state projected to &amp;lt;math&amp;gt;\left\vert{g}\right\rangle&amp;lt;/math&amp;gt;, or ''-1'' with the qubit state projected to &amp;lt;math&amp;gt;\left\vert{e}\right\rangle&amp;lt;/math&amp;gt; .&lt;br /&gt;
&lt;br /&gt;
A planar code has four boundaries, two that are called “smooth” and two that are called “rough”. Smooth boundaries have four-term ''Z'' stabilizer generators, and three-term ''X'' stabilizer generators, whereas rough boundaries have four-term ''X'' stabilizer generators and three-term ''Z'' stabilizer generators. A planar code, with two rough and two smooth boundaries can encode a single logical qubit (as in Figure 2). Also look at http://arxiv.org/abs/1208.0928 it is an excellent reference as it represents a comprehensive review of the surface code, also written for the absolute beginner.&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:boundaries.jpg]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;'''Figure 2'''&amp;lt;/center&amp;gt;&amp;lt;center&amp;gt;Examples of smooth and rough boundaries. This figure has been copied with a permission from the authors of Ref.2&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Syndrome Extraction and Error Detection===&lt;br /&gt;
Detecting errors involves measuring check operators, and observing which ones give a value of ''-1'' (due to anti-commuting with errors). This information helps us guess where errors occurred. In practice, of course, errors do not have to occur on their own, and often one can observe multiple instances next to each other. In these cases, the error operators form error chains throughout the lattice. Since only&lt;br /&gt;
the ends of such error chains anti-commute with the check operators, determining where errors occurred often involves guessing the most likely scenario. In the planar case, the chains  connect opposite boundaries of the same type (either left to right, or top to bottom), and&lt;br /&gt;
in the toric case, chains that span all the way across a given dimension of the lattice.  They turn out to the change the encoded, logical&lt;br /&gt;
state of the qubit and hence are called logical errors. Two examples are shown Figures 3 and 4. &amp;lt;math&amp;gt;Z_L&amp;lt;/math&amp;gt; is a chain of ''Z'' operators that connects two rough boundaries, and &amp;lt;math&amp;gt;X_L&amp;lt;/math&amp;gt; chain of ''X'' operators that connects two smooth ones.&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:defect.jpg]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;'''Figure 3'''&amp;lt;/center&amp;gt;&amp;lt;center&amp;gt;Examples of error syndromes on the Surface code (planar and toric). The state is initialized to the ''+1'' eigenstate of all stabilizers.&amp;lt;/center&amp;gt;&amp;lt;center&amp;gt;Shaded qubits indicate locations of ''X'' errors. This figure has been copied with a permission from the authors of Ref.5&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:error.jpg]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;'''Figure 4'''&amp;lt;/center&amp;gt;&amp;lt;center&amp;gt;A planar surface code in which a logical ''Z (X)'' error is a chain of ''Z (X)''&lt;br /&gt;
operators that spans the whole lattice, and connects rough (smooth) boundaries.&amp;lt;/center&amp;gt;&amp;lt;center&amp;gt;This figure has been copied with a permission from the authors of Ref.5&amp;lt;/center&amp;gt;&lt;/div&gt;</summary>
		<author><name>Ddghunter</name></author>
		
	</entry>
	<entry>
		<id>https://www2.physics.siu.edu/qunet/wiki/index.php?title=Chapter_13_-_Topological_Quantum_Error_Correction&amp;diff=1930</id>
		<title>Chapter 13 - Topological Quantum Error Correction</title>
		<link rel="alternate" type="text/html" href="https://www2.physics.siu.edu/qunet/wiki/index.php?title=Chapter_13_-_Topological_Quantum_Error_Correction&amp;diff=1930"/>
		<updated>2012-11-10T00:23:24Z</updated>

		<summary type="html">&lt;p&gt;Ddghunter: /* Surface Code */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Surface Code ==&lt;br /&gt;
===Introduction===&lt;br /&gt;
&lt;br /&gt;
Surface codes  are topological quantum error-correcting codes in which we can think of qubits being arranged on a 2-D lattice of qubits with only nearest neighbor interactions. This in practice may prove to be a very useful feature, since for many systems interacting qubits that are close to each other is substantially less difficult than ones that are further apart. We can think of physical qubits as being arranged on the edges of a lattice as shown in Figure 1. An example of the surface code are toric code and  planar code, the main difference between both of them is the boundary condition. In the toric code, the boundaries  are periodic whereas  in the case of the planar code, the boundaries are not periodic. In the toric code, the qubits are arranged on a lattice which can be thought of as spread over a surface of a torus, and in a planar code case we think of the data qubits as living on a simple 2-D plane and ancilla qubits on the faces and the intersections.&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:lattice.jpg]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;'''Figure 1'''&amp;lt;/center&amp;gt;&amp;lt;center&amp;gt;A two-dimensional array implementation of the surface code. Data qubits are open circles, measurements (ancilla) qubits are filled circles.&amp;lt;/center&amp;gt;&amp;lt;center&amp;gt;The yellow area is to  measure-Z qubits while the green area is to  measure-X qubits.&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The stabilizer generators for the surface code are the tensor products of ''Z'' on the four data qubits around each face, and the tensor products of ''X'' on&lt;br /&gt;
the four data qubits around each intersection. Neighbouring stabilizers share two data qubits ensuring that adjacent ''X'' and ''Z'' stabilizers commute. The qubit ''Z'' eigenstate are called the ground state &amp;lt;math&amp;gt;\left\vert{g}\right\rangle&amp;lt;/math&amp;gt;  and the excited state &amp;lt;math&amp;gt;\left\vert{e}\right\rangle&amp;lt;/math&amp;gt;. The ground state is the ''+1'' eigenstate of ''Z'', with &amp;lt;math&amp;gt;Z\left\vert{g}\right\rangle=+\left\vert{g}\right\rangle&amp;lt;/math&amp;gt;, and the excited state is the ''-1'' eigenstate, with &amp;lt;math&amp;gt;Z\left\vert{e}\right\rangle=-\left\vert{e}\right\rangle&amp;lt;/math&amp;gt;. It is tempting to think of the qubit as a kind of quantum transistor, with the ground state corresponding to &amp;quot;off&amp;quot; and the excited state to &amp;quot;on&amp;quot;. However, in distinct contrast to a classical logical element, a qubit can exist in a superposition of its eigenstate, &amp;lt;math&amp;gt;\left\vert{\psi}\right\rangle=\alpha\left\vert{g}\right\rangle+\beta\left\vert{g}\right\rangle&amp;lt;/math&amp;gt;, so a qubit can be both &amp;quot;off&amp;quot; and on&amp;quot; at the same time. A measurment &amp;lt;math&amp;gt;M_Z&amp;lt;/math&amp;gt; of the qubit will however return only one of two possible measurement outcomes,''+1'' with the qubit state projected to &amp;lt;math&amp;gt;\left\vert{g}\right\rangle&amp;lt;/math&amp;gt;, or ''-1'' with the qubit state projected to &amp;lt;math&amp;gt;\left\vert{e}\right\rangle&amp;lt;/math&amp;gt; .&lt;br /&gt;
&lt;br /&gt;
A planar code has four boundaries, two that are called “smooth” and two that are called “rough”. Smooth boundaries have four-term ''Z'' stabilizer generators, and three-term ''X'' stabilizer generators, whereas rough boundaries have four-term ''X'' stabilizer generators and three-term ''Z'' stabilizer generators. A planar code, with two rough and two smooth boundaries can encode a single logical qubit (as in Figure 2). Also look at http://arxiv.org/abs/1208.0928 it is an excellent reference as it represents a comprehensive review of the surface code, also written for the absolute beginner.&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:boundaries.jpg]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;'''Figure 2'''&amp;lt;/center&amp;gt;&amp;lt;center&amp;gt;Examples of smooth and rough boundaries. This figure has been copied with a permission from the authors of Ref.2&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Syndrome Extraction and Error Detection===&lt;br /&gt;
Detecting errors involves measuring check operators, and observing which ones give a value of ''-1'' (due to anti-commuting with errors). This information helps us guess where errors occurred. In practice, of course, errors do not have to occur on their own, and often one can observe multiple instances next to each other. In these cases, the error operators form error chains throughout the lattice. Since only&lt;br /&gt;
the ends of such error chains anti-commute with the check operators, determining where errors occurred often involves guessing the most likely scenario. In the planar case, the chains  connect opposite boundaries of the same type (either left to right, or top to bottom), and&lt;br /&gt;
in the toric case, chains that span all the way across a given dimension of the lattice.  They turn out to the change the encoded, logical&lt;br /&gt;
state of the qubit and hence are called logical errors. Two examples are shown Figures 3 and 4. &amp;lt;math&amp;gt;Z_L&amp;lt;/math&amp;gt; is a chain of ''Z'' operators that connects two rough boundaries, and &amp;lt;math&amp;gt;X_L&amp;lt;/math&amp;gt; chain of ''X'' operators that connects two smooth ones.&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:defect.jpg]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;Examples of error syndromes on the Surface code (planar and toric). The state is initialized to the ''+1'' eigenstate of all stabilizers.&amp;lt;/center&amp;gt;&amp;lt;center&amp;gt;Shaded qubits indicate locations of ''X'' errors. This figure has been copied with a permission from the authors of Ref.5&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:error.jpg]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;A planar surface code in which a logical ''Z (X)'' error is a chain of ''Z (X)''&lt;br /&gt;
operators that spans the whole lattice, and connects rough (smooth) boundaries.&amp;lt;/center&amp;gt;&amp;lt;center&amp;gt;This figure has been copied with a permission from the authors of Ref.5&amp;lt;/center&amp;gt;&lt;/div&gt;</summary>
		<author><name>Ddghunter</name></author>
		
	</entry>
	<entry>
		<id>https://www2.physics.siu.edu/qunet/wiki/index.php?title=Chapter_13_-_Topological_Quantum_Error_Correction&amp;diff=1929</id>
		<title>Chapter 13 - Topological Quantum Error Correction</title>
		<link rel="alternate" type="text/html" href="https://www2.physics.siu.edu/qunet/wiki/index.php?title=Chapter_13_-_Topological_Quantum_Error_Correction&amp;diff=1929"/>
		<updated>2012-11-10T00:17:47Z</updated>

		<summary type="html">&lt;p&gt;Ddghunter: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Surface Code ==&lt;br /&gt;
===Introduction===&lt;br /&gt;
&lt;br /&gt;
Surface codes  are topological quantum error-correcting codes in which we can think of qubits being arranged on a 2-D lattice of qubits with only nearest neighbor interactions. This in practice may prove to be a very useful feature, since for many systems interacting qubits that are close to each other is substantially less difficult than ones that are further apart. We can think of physical qubits as being arranged on the edges of a lattice as shown in Figure 1. An example of the surface code are toric code and  planar code, the main difference between both of them is the boundary condition. In the toric code, the boundaries  are periodic whereas  in the case of the planar code, the boundaries are not periodic. In the toric code, the qubits are arranged on a lattice which can be thought of as spread over a surface of a torus, and in a planar code case we think of the data qubits as living on a simple 2-D plane and ancilla qubits on the faces and the intersections.&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:lattice.jpg]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;'''Figure 1'''&amp;lt;/center&amp;gt;&amp;lt;center&amp;gt;A two-dimensional array implementation of the surface code. Data qubits are open circles, measurements (ancilla) qubits are filled circles.&amp;lt;/center&amp;gt;&amp;lt;center&amp;gt;The yellow area is to  measure-Z qubits while the green area is to  measure-X qubits.&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The stabilizer generators for the surface code are the tensor products of ''Z'' on the four data qubits around each face, and the tensor products of ''X'' on&lt;br /&gt;
the four data qubits around each intersection. Neighbouring stabilizers share two data qubits ensuring that adjacent ''X'' and ''Z'' stabilizers commute. The qubit ''Z'' eigenstate are called the ground state &amp;lt;math&amp;gt;\left\vert{g}\right\rangle&amp;lt;/math&amp;gt;  and the excited state &amp;lt;math&amp;gt;\left\vert{e}\right\rangle&amp;lt;/math&amp;gt;. The ground state is the ''+1'' eigenstate of ''Z'', with &amp;lt;math&amp;gt;Z\left\vert{g}\right\rangle=+\left\vert{g}\right\rangle&amp;lt;/math&amp;gt;, and the excited state is the ''-1'' eigenstate, with &amp;lt;math&amp;gt;Z\left\vert{e}\right\rangle=-\left\vert{e}\right\rangle&amp;lt;/math&amp;gt;. It is tempting to think of the qubit as a kind of quantum transistor, with the ground state corresponding to &amp;quot;off&amp;quot; and the excited state to &amp;quot;on&amp;quot;. However, in distinct contrast to a classical logical element, a qubit can exist in a superposition of its eigenstate, &amp;lt;math&amp;gt;\left\vert{\psi}\right\rangle=\alpha\left\vert{g}\right\rangle+\beta\left\vert{g}\right\rangle&amp;lt;/math&amp;gt;, so a qubit can be both &amp;quot;off&amp;quot; and on&amp;quot; at the same time. A measurment ''M_Z'' of the qubit will however return only one of two possible measurement outcomes,''+1'' with the qubit state projected to &amp;lt;math&amp;gt;\left\vert{g}\right\rangle&amp;lt;/math&amp;gt;, or ''-1'' with the qubit state projected to &amp;lt;math&amp;gt;\left\vert{e}\right\rangle&amp;lt;/math&amp;gt; .&lt;br /&gt;
&lt;br /&gt;
A planar code has four boundaries, two that are called “smooth” and two that are called “rough”. Smooth boundaries have four-term ''Z'' stabilizer generators, and three-term ''X'' stabilizer generators, whereas rough boundaries have four-term ''X'' stabilizer generators and three-term ''Z'' stabilizer generators. A planar code, with two rough and two smooth boundaries can encode a single logical qubit (as in Figure 2). Also look at http://arxiv.org/abs/1208.0928 it is an excellent reference as it represents a comprehensive review of the surface code, also written for the absolute beginner.&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:boundaries.jpg]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;'''Figure 2'''&amp;lt;/center&amp;gt;&amp;lt;center&amp;gt;Examples of smooth and rough boundaries. This figure has been copied with a permission from the authors of Ref.2&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Syndrome Extraction and Error Detection===&lt;br /&gt;
Detecting errors involves measuring check operators, and observing which ones give a value of ''-1'' (due to anti-commuting with errors). This information helps us guess where errors occurred. In practice, of course, errors do not have to occur on their own, and often one can observe multiple instances next to each other. In these cases, the error operators form error chains throughout the lattice. Since only&lt;br /&gt;
the ends of such error chains anti-commute with the check operators, determining where errors occurred often involves guessing the most likely scenario. In the planar case, the chains  connect opposite boundaries of the same type (either left to right, or top to bottom), and&lt;br /&gt;
in the toric case, chains that span all the way across a given dimension of the lattice.  They turn out to the change the encoded, logical&lt;br /&gt;
state of the qubit and hence are called logical errors. Two examples are shown Figures 3 and 4. ''Z_L'' is a chain of ''Z'' operators that connects two rough boundaries, and ''X_L'' chain of ''X'' operators that connects two smooth ones.&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:defect.jpg]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;Examples of error syndromes on the Surface code (planar and toric). The state is initialized to the ''+1'' eigenstate of all stabilizers.&amp;lt;/center&amp;gt;&amp;lt;center&amp;gt;Shaded qubits indicate locations of ''X'' errors. This figure has been copied with a permission from the authors of Ref.5&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:error.jpg]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;A planar surface code in which a logical ''Z (X)'' error is a chain of ''Z (X)''&lt;br /&gt;
operators that spans the whole lattice, and connects rough (smooth) boundaries.&amp;lt;/center&amp;gt;&amp;lt;center&amp;gt;This figure has been copied with a permission from the authors of Ref.5&amp;lt;/center&amp;gt;&lt;/div&gt;</summary>
		<author><name>Ddghunter</name></author>
		
	</entry>
	<entry>
		<id>https://www2.physics.siu.edu/qunet/wiki/index.php?title=File:Graph.jpg&amp;diff=1928</id>
		<title>File:Graph.jpg</title>
		<link rel="alternate" type="text/html" href="https://www2.physics.siu.edu/qunet/wiki/index.php?title=File:Graph.jpg&amp;diff=1928"/>
		<updated>2012-11-10T00:09:53Z</updated>

		<summary type="html">&lt;p&gt;Ddghunter: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Ddghunter</name></author>
		
	</entry>
	<entry>
		<id>https://www2.physics.siu.edu/qunet/wiki/index.php?title=File:Error_toric.jpg&amp;diff=1927</id>
		<title>File:Error toric.jpg</title>
		<link rel="alternate" type="text/html" href="https://www2.physics.siu.edu/qunet/wiki/index.php?title=File:Error_toric.jpg&amp;diff=1927"/>
		<updated>2012-11-10T00:09:35Z</updated>

		<summary type="html">&lt;p&gt;Ddghunter: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Ddghunter</name></author>
		
	</entry>
	<entry>
		<id>https://www2.physics.siu.edu/qunet/wiki/index.php?title=File:Error.jpg&amp;diff=1926</id>
		<title>File:Error.jpg</title>
		<link rel="alternate" type="text/html" href="https://www2.physics.siu.edu/qunet/wiki/index.php?title=File:Error.jpg&amp;diff=1926"/>
		<updated>2012-11-10T00:09:19Z</updated>

		<summary type="html">&lt;p&gt;Ddghunter: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Ddghunter</name></author>
		
	</entry>
	<entry>
		<id>https://www2.physics.siu.edu/qunet/wiki/index.php?title=File:Cycle.jpg&amp;diff=1925</id>
		<title>File:Cycle.jpg</title>
		<link rel="alternate" type="text/html" href="https://www2.physics.siu.edu/qunet/wiki/index.php?title=File:Cycle.jpg&amp;diff=1925"/>
		<updated>2012-11-10T00:08:53Z</updated>

		<summary type="html">&lt;p&gt;Ddghunter: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Ddghunter</name></author>
		
	</entry>
	<entry>
		<id>https://www2.physics.siu.edu/qunet/wiki/index.php?title=File:Defect.jpg&amp;diff=1924</id>
		<title>File:Defect.jpg</title>
		<link rel="alternate" type="text/html" href="https://www2.physics.siu.edu/qunet/wiki/index.php?title=File:Defect.jpg&amp;diff=1924"/>
		<updated>2012-11-10T00:08:35Z</updated>

		<summary type="html">&lt;p&gt;Ddghunter: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Ddghunter</name></author>
		
	</entry>
	<entry>
		<id>https://www2.physics.siu.edu/qunet/wiki/index.php?title=File:Circuit.jpg&amp;diff=1923</id>
		<title>File:Circuit.jpg</title>
		<link rel="alternate" type="text/html" href="https://www2.physics.siu.edu/qunet/wiki/index.php?title=File:Circuit.jpg&amp;diff=1923"/>
		<updated>2012-11-10T00:08:10Z</updated>

		<summary type="html">&lt;p&gt;Ddghunter: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Ddghunter</name></author>
		
	</entry>
	<entry>
		<id>https://www2.physics.siu.edu/qunet/wiki/index.php?title=Chapter_13_-_Topological_Quantum_Error_Correction&amp;diff=1922</id>
		<title>Chapter 13 - Topological Quantum Error Correction</title>
		<link rel="alternate" type="text/html" href="https://www2.physics.siu.edu/qunet/wiki/index.php?title=Chapter_13_-_Topological_Quantum_Error_Correction&amp;diff=1922"/>
		<updated>2012-11-09T05:38:29Z</updated>

		<summary type="html">&lt;p&gt;Ddghunter: /* Introduction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Surface Code ==&lt;br /&gt;
===Introduction===&lt;br /&gt;
&lt;br /&gt;
Surface codes  are topological quantum error-correcting codes in which we can think of qubits being arranged on a 2-D lattice of qubits with only nearest neighbor interactions. This in practice may prove to be a very useful feature, since for many systems interacting qubits that are close to each other is substantially less difficult than ones that are further apart. We can think of physical qubits as being arranged on the edges of a lattice as shown in Figure 1. An example of the surface code are toric code and  planar code, the main difference between both of them is the boundary condition. In the toric code, the boundaries  are periodic whereas  in the case of the planar code, the boundaries are not periodic. In the toric code, the qubits are arranged on a lattice which can be thought of as spread over a surface of a torus, and in a planar code case we think of the data qubits as living on a simple 2-D plane and ancilla qubits on the faces and the intersections.&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:lattice.jpg]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;'''Figure 1'''&amp;lt;/center&amp;gt;&amp;lt;center&amp;gt;A two-dimensional array implementation of the surface code. Data qubits are open circles, measurements (ancilla) qubits are filled circles.&amp;lt;/center&amp;gt;&amp;lt;center&amp;gt;The yellow area is to  measure-Z qubits while the green area is to  measure-X qubits.&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The stabilizer generators for the surface code are the tensor products of ''Z'' on the four data qubits around each face, and the tensor products of ''X'' on&lt;br /&gt;
the four data qubits around each intersection. Neighbouring stabilizers share two data qubits ensuring that adjacent ''X'' and ''Z'' stabilizers commute. The qubit ''Z'' eigenstate are called the ground state &amp;lt;math&amp;gt;\left\vert{g}\right\rangle&amp;lt;/math&amp;gt;  and the excited state &amp;lt;math&amp;gt;\left\vert{e}\right\rangle&amp;lt;/math&amp;gt;. The ground state is the ''+1'' eigenstate of ''Z'', with &amp;lt;math&amp;gt;Z\left\vert{g}\right\rangle=+\left\vert{g}\right\rangle&amp;lt;/math&amp;gt;, and the excited state is the ''-1'' eigenstate, with &amp;lt;math&amp;gt;Z\left\vert{e}\right\rangle=-\left\vert{e}\right\rangle&amp;lt;/math&amp;gt;. It is tempting to think of the qubit as a kind of quantum transistor, with the ground state corresponding to &amp;quot;off&amp;quot; and the excited state to &amp;quot;on&amp;quot;. However, in distinct contrast to a classical logical element, a qubit can exist in a superposition of its eigenstate, &amp;lt;math&amp;gt;\left\vert{\psi}\right\rangle=\alpha\left\vert{g}\right\rangle+\beta\left\vert{g}\right\rangle&amp;lt;/math&amp;gt;, so a qubit can be both &amp;quot;off&amp;quot; and on&amp;quot; at the same time. A measurment ''M_Z'' of the qubit will however return only one of two possible measurement outcomes,''+1'' with the qubit state projected to &amp;lt;math&amp;gt;\left\vert{g}\right\rangle&amp;lt;/math&amp;gt;, or ''-1'' with the qubit state projected to &amp;lt;math&amp;gt;\left\vert{e}\right\rangle&amp;lt;/math&amp;gt; .&lt;br /&gt;
&lt;br /&gt;
A planar code has four boundaries, two that are called “smooth” and two that are called “rough”. Smooth boundaries have four-term ''Z'' stabilizer generators, and three-term ''X'' stabilizer generators, whereas rough boundaries have four-term ''X'' stabilizer generators and three-term ''Z'' stabilizer generators. A planar code, with two rough and two smooth boundaries can encode a single logical qubit (as in Figure 2). Also look at http://arxiv.org/abs/1208.0928 it is an excellent reference as it represents a comprehensive review of the surface code, also written for the absolute beginner.&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:boundaries.jpg]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;'''Figure 2'''&amp;lt;/center&amp;gt;&amp;lt;center&amp;gt;Examples of smooth and rough boundaries. This figure has been copied with a permission from the authors of Ref.2&amp;lt;/center&amp;gt;&lt;/div&gt;</summary>
		<author><name>Ddghunter</name></author>
		
	</entry>
	<entry>
		<id>https://www2.physics.siu.edu/qunet/wiki/index.php?title=File:Boundaries.jpg&amp;diff=1921</id>
		<title>File:Boundaries.jpg</title>
		<link rel="alternate" type="text/html" href="https://www2.physics.siu.edu/qunet/wiki/index.php?title=File:Boundaries.jpg&amp;diff=1921"/>
		<updated>2012-11-09T05:35:26Z</updated>

		<summary type="html">&lt;p&gt;Ddghunter: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Ddghunter</name></author>
		
	</entry>
	<entry>
		<id>https://www2.physics.siu.edu/qunet/wiki/index.php?title=Chapter_13_-_Topological_Quantum_Error_Correction&amp;diff=1920</id>
		<title>Chapter 13 - Topological Quantum Error Correction</title>
		<link rel="alternate" type="text/html" href="https://www2.physics.siu.edu/qunet/wiki/index.php?title=Chapter_13_-_Topological_Quantum_Error_Correction&amp;diff=1920"/>
		<updated>2012-11-09T01:17:18Z</updated>

		<summary type="html">&lt;p&gt;Ddghunter: /* Introduction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Surface Code ==&lt;br /&gt;
===Introduction===&lt;br /&gt;
&lt;br /&gt;
Surface codes  are topological quantum error-correcting codes in which we can think of qubits being arranged on a 2-D lattice of qubits with only nearest neighbor interactions. This in practice may prove to be a very useful feature, since for many systems interacting qubits that are close to each other is substantially less difficult than ones that are further apart. We can think of physical qubits as being arranged on the edges of a lattice as shown in Figure 1. An example of the surface code are toric code and  planar code, the main difference between both of them is the boundary condition. In the toric code, the boundaries  are periodic whereas  in the case of the planar code, the boundaries are not periodic. In the toric code, the qubits are arranged on a lattice which can be thought of as spread over a surface of a torus, and in a planar code case we think of the data qubits as living on a simple 2-D plane and ancilla qubits on the faces and the intersections.&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:lattice.jpg]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;'''Figure 1'''&amp;lt;/center&amp;gt;&amp;lt;center&amp;gt;A two-dimensional array implementation of the surface code. Data qubits are open circles, measurements (ancilla) qubits are filled circles.&amp;lt;/center&amp;gt;&amp;lt;center&amp;gt;The yellow area is to  measure-Z qubits while the green area is to  measure-X qubits.&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The stabilizer generators for the surface code are the tensor products of ''Z'' on the four data qubits around each face, and the tensor products of ''X'' on&lt;br /&gt;
the four data qubits around each intersection. Neighbouring stabilizers share two data qubits ensuring that adjacent ''X'' and ''Z'' stabilizers commute. The qubit ''Z'' eigenstate are called the ground state &amp;lt;math&amp;gt;\left\vert{g}\right\rangle&amp;lt;/math&amp;gt;  and the excited state &amp;lt;math&amp;gt;\left\vert{e}\right\rangle&amp;lt;/math&amp;gt;. The ground state is the ''+1'' eigenstate of ''Z'', with &amp;lt;math&amp;gt;Z\left\vert{g}\right\rangle=+\left\vert{g}\right\rangle&amp;lt;/math&amp;gt;, and the excited state is the ''-1'' eigenstate, with &amp;lt;math&amp;gt;Z\left\vert{e}\right\rangle=-\left\vert{e}\right\rangle&amp;lt;/math&amp;gt;. It is tempting to think of the qubit as a kind of quantum transistor, with the ground state corresponding to &amp;quot;off&amp;quot; and the excited state to &amp;quot;on&amp;quot;. However, in distinct contrast to a classical logical element, a qubit can exist in a superposition of its eigenstate, &amp;lt;math&amp;gt;\left\vert{\psi}\right\rangle=\alpha\left\vert{g}\right\rangle+\beta\left\vert{g}\right\rangle&amp;lt;/math&amp;gt;, so a qubit can be both &amp;quot;off&amp;quot; and on&amp;quot; at the same time. A measurment ''M_Z'' of the qubit will however return only one of two possible measurement outcomes,''+1'' with the qubit state projected to &amp;lt;math&amp;gt;\left\vert{g}\right\rangle&amp;lt;/math&amp;gt;, or ''-1'' with the qubit state projected to &amp;lt;math&amp;gt;\left\vert{e}\right\rangle&amp;lt;/math&amp;gt; .&lt;br /&gt;
&lt;br /&gt;
A planar code has four boundaries, two that are called “smooth” and two that are called “rough”. Smooth boundaries have four-term ''Z'' stabilizer generators, and three-term ''X'' stabilizer generators, whereas rough boundaries have four-term ''X'' stabilizer generators and three-term ''Z'' stabilizer generators. A planar code, with two rough and two smooth boundaries can encode a single logical qubit (as in Figure 2). Also look at http://arxiv.org/abs/1208.0928 it is an excellent reference as it represents a comprehensive review of the surface code, also written for the absolute beginner.&lt;/div&gt;</summary>
		<author><name>Ddghunter</name></author>
		
	</entry>
	<entry>
		<id>https://www2.physics.siu.edu/qunet/wiki/index.php?title=Chapter_13_-_Topological_Quantum_Error_Correction&amp;diff=1919</id>
		<title>Chapter 13 - Topological Quantum Error Correction</title>
		<link rel="alternate" type="text/html" href="https://www2.physics.siu.edu/qunet/wiki/index.php?title=Chapter_13_-_Topological_Quantum_Error_Correction&amp;diff=1919"/>
		<updated>2012-11-09T01:13:46Z</updated>

		<summary type="html">&lt;p&gt;Ddghunter: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Surface Code ==&lt;br /&gt;
===Introduction===&lt;br /&gt;
&lt;br /&gt;
Surface codes  are topological quantum error-correcting codes in which we can think of qubits being arranged on a 2-D lattice of qubits with only nearest neighbor interactions. This in practice may prove to be a very useful feature, since for many systems interacting qubits that are close to each other is substantially less difficult than ones that are further apart. We can think of physical qubits as being arranged on the edges of a lattice as shown in Figure 1. An example of the surface code are toric code and  planar code, the main difference between both of them is the boundary condition. In the toric code, the boundaries  are periodic whereas  in the case of the planar code, the boundaries are not periodic. In the toric code, the qubits are arranged on a lattice which can be thought of as spread over a surface of a torus, and in a planar code case we think of the data qubits as living on a simple 2-D plane and ancilla qubits on the faces and the intersections.&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:lattice.jpg]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;'''Figure 1'''&amp;lt;/center&amp;gt;&amp;lt;center&amp;gt;A two-dimensional array implementation of the surface code. Data qubits are open circles, measurements (ancilla) qubits are filled circles.&amp;lt;/center&amp;gt;&amp;lt;center&amp;gt;The yellow area is to  measure-Z qubits while the green area is to  measure-X qubits.&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The stabilizer generators for the surface code are the tensor products of ''Z'' on the four data qubits around each face, and the tensor products of ''X'' on&lt;br /&gt;
the four data qubits around each intersection. Neighbouring stabilizers share two data qubits ensuring that adjacent ''X'' and ''Z'' stabilizers commute. The qubit ''Z'' eigenstate are called the ground state &amp;lt;math&amp;gt;\left\vert{g}\right\rangle&amp;lt;/math&amp;gt;  and the excited state &amp;lt;math&amp;gt;\left\vert{e}\right\rangle&amp;lt;/math&amp;gt;. The ground state is the ''+1'' eigenstate of ''Z'', with &amp;lt;math&amp;gt;Z\left\vert{g}\right\rangle=+\left\vert{g}\right\rangle&amp;lt;/math&amp;gt;, and the excited state is the ''-1'' eigenstate, with &amp;lt;math&amp;gt;Z\left\vert{e}\right\rangle=-\left\vert{e}\right\rangle&amp;lt;/math&amp;gt;. It is tempting to think of the qubit as a kind of quantum transistor, with the ground state corresponding to &amp;quot;off&amp;quot; and the excited state to &amp;quot;on&amp;quot;. However, in distinct contrast to a classical logical element, a qubit can exist in a superposition of its eigenstate, &amp;lt;math&amp;gt;\left\vert{\psi}\right\rangle=\alpha\left\vert{g}\right\rangle+\beta\left\vert{g}\right\rangle&amp;lt;/math&amp;gt;, so a qubit can be both &amp;quot;off&amp;quot; and on&amp;quot; at the same time. A measurment ''M_Z'' of the qubit will however return only one of two possible measurement outcomes,''+1'' with the qubit state projected to &amp;lt;math&amp;gt;\left\vert{g}\right\rangle&amp;lt;/math&amp;gt;, or ''-1'' with the qubit state projected to &amp;lt;math&amp;gt;\left\vert{e}\right\rangle&amp;lt;/math&amp;gt; .&lt;br /&gt;
&lt;br /&gt;
A planar code has four boundaries, two that are called “smooth” and two that are called “rough”. Smooth boundaries have four-term ''Z'' stabilizer generators, and three-term ''X'' stabilizer generators, whereas rough boundaries have four-term ''X'' stabilizer generators and three-term ''Z'' stabilizer generators. A planar code, with two rough and two smooth boundaries can encode a single logical qubit(As in Figure 2). Also look at http://arxiv.org/abs/1208.0928 it is an excellent reference as it represents a comprehensive review of the surface code, also written for the absolute beginner.&lt;/div&gt;</summary>
		<author><name>Ddghunter</name></author>
		
	</entry>
	<entry>
		<id>https://www2.physics.siu.edu/qunet/wiki/index.php?title=Chapter_13_-_Topological_Quantum_Error_Correction&amp;diff=1917</id>
		<title>Chapter 13 - Topological Quantum Error Correction</title>
		<link rel="alternate" type="text/html" href="https://www2.physics.siu.edu/qunet/wiki/index.php?title=Chapter_13_-_Topological_Quantum_Error_Correction&amp;diff=1917"/>
		<updated>2012-11-08T06:43:19Z</updated>

		<summary type="html">&lt;p&gt;Ddghunter: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Surface Code ==&lt;br /&gt;
===Introduction===&lt;br /&gt;
&lt;br /&gt;
Surface codes  are topological quantum error-correcting codes in which we can think of qubits being arranged on a 2-D lattice of qubits with only nearest neighbor interactions. This in practice may prove to be a very useful feature, since for many systems interacting qubits that are close to each other is substantially less difficult than ones that are further apart. We can think of physical qubits as being arranged on the edges of a lattice as shown in Figure 1. An example of the surface code are toric code and  planar code, the main difference between both of them is the boundary condition. In the toric code, the boundaries  are periodic whereas  in the case of the palnar code, the boundaries are not periodic. In the toric code, the qubits are arranged on a lattice which can be thought of as spread over a surface of a torus, and in a planar code case we think of the data qubits as living on a simple 2-D plane and ancilla qubits on the faces and the intersections.&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:lattice.jpg]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;'''Figure 1'''&amp;lt;/center&amp;gt;&amp;lt;center&amp;gt;A two-dimensional array implementation of the surface code. Data qubits are open circles, measurments (ancilla) qubits are filled circles.&amp;lt;/center&amp;gt;&amp;lt;center&amp;gt;The yellow area is to  measure-Z qubits while the green area is to  measure-X qubits.&amp;lt;/center&amp;gt;&lt;/div&gt;</summary>
		<author><name>Ddghunter</name></author>
		
	</entry>
	<entry>
		<id>https://www2.physics.siu.edu/qunet/wiki/index.php?title=Chapter_13_-_Topological_Quantum_Error_Correction&amp;diff=1916</id>
		<title>Chapter 13 - Topological Quantum Error Correction</title>
		<link rel="alternate" type="text/html" href="https://www2.physics.siu.edu/qunet/wiki/index.php?title=Chapter_13_-_Topological_Quantum_Error_Correction&amp;diff=1916"/>
		<updated>2012-11-08T06:42:54Z</updated>

		<summary type="html">&lt;p&gt;Ddghunter: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===Introduction===&lt;br /&gt;
&lt;br /&gt;
Surface codes  are topological quantum error-correcting codes in which we can think of qubits being arranged on a 2-D lattice of qubits with only nearest neighbor interactions. This in practice may prove to be a very useful feature, since for many systems interacting qubits that are close to each other is substantially less difficult than ones that are further apart. We can think of physical qubits as being arranged on the edges of a lattice as shown in Figure 1. An example of the surface code are toric code and  planar code, the main difference between both of them is the boundary condition. In the toric code, the boundaries  are periodic whereas  in the case of the palnar code, the boundaries are not periodic. In the toric code, the qubits are arranged on a lattice which can be thought of as spread over a surface of a torus, and in a planar code case we think of the data qubits as living on a simple 2-D plane and ancilla qubits on the faces and the intersections.&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:lattice.jpg]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;'''Figure 1'''&amp;lt;/center&amp;gt;&amp;lt;center&amp;gt;A two-dimensional array implementation of the surface code. Data qubits are open circles, measurments (ancilla) qubits are filled circles.&amp;lt;/center&amp;gt;&amp;lt;center&amp;gt;The yellow area is to  measure-Z qubits while the green area is to  measure-X qubits.&amp;lt;/center&amp;gt;&lt;/div&gt;</summary>
		<author><name>Ddghunter</name></author>
		
	</entry>
	<entry>
		<id>https://www2.physics.siu.edu/qunet/wiki/index.php?title=File:Lattice.jpg&amp;diff=1915</id>
		<title>File:Lattice.jpg</title>
		<link rel="alternate" type="text/html" href="https://www2.physics.siu.edu/qunet/wiki/index.php?title=File:Lattice.jpg&amp;diff=1915"/>
		<updated>2012-11-08T06:39:05Z</updated>

		<summary type="html">&lt;p&gt;Ddghunter: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Ddghunter</name></author>
		
	</entry>
	<entry>
		<id>https://www2.physics.siu.edu/qunet/wiki/index.php?title=Chapter_13_-_Topological_Quantum_Error_Correction&amp;diff=1914</id>
		<title>Chapter 13 - Topological Quantum Error Correction</title>
		<link rel="alternate" type="text/html" href="https://www2.physics.siu.edu/qunet/wiki/index.php?title=Chapter_13_-_Topological_Quantum_Error_Correction&amp;diff=1914"/>
		<updated>2012-11-08T06:15:06Z</updated>

		<summary type="html">&lt;p&gt;Ddghunter: Created page with '===Introduction===  Surface codes  are topological quantum error-correcting codes in which we can think of qubits being arranged on a $2-D$  lattice of qubits with only nearest n…'&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===Introduction===&lt;br /&gt;
&lt;br /&gt;
Surface codes  are topological quantum error-correcting codes in which we can think of qubits being arranged on a $2-D$  lattice of qubits with only nearest neighbor interactions. This in practice may prove to be a very useful feature, since for many systems interacting qubits that are close to each other is substantially less difficult than ones that are further apart. We can think of physical qubits as being arranged on the edges of a lattice as shown in Figure 1. An example of the surface code are toric code and  planar code, the main difference between both of them is the boundary condition. In the toric code, the boundaries  are periodic whereas  in the case of the palnar code, the boundaries are not periodic. In the toric code, the qubits are arranged on a lattice which can be thought of as spread over a surface of a torus, and in a planar code case we think of the data qubits as living on a simple 2-D plane and ancilla qubits on the faces and the intersections.&lt;/div&gt;</summary>
		<author><name>Ddghunter</name></author>
		
	</entry>
</feed>