diff options
Diffstat (limited to 'source/know/concept/repetition-code')
| -rw-r--r-- | source/know/concept/repetition-code/index.md | 88 | 
1 files changed, 44 insertions, 44 deletions
diff --git a/source/know/concept/repetition-code/index.md b/source/know/concept/repetition-code/index.md index 31181bb..99ac630 100644 --- a/source/know/concept/repetition-code/index.md +++ b/source/know/concept/repetition-code/index.md @@ -8,7 +8,7 @@ layout: "concept"  ---  A **repetition code** is a simple approach to error correction: -to protect a bit $x$, make two copies: +to protect a bit $$x$$, make two copies:  $$\begin{aligned}      0 \to 000 @@ -16,7 +16,7 @@ $$\begin{aligned}      1 \to 111  \end{aligned}$$ -If a single-bit error occurs, e.g. $000 \to 100$, +If a single-bit error occurs, e.g. $$000 \to 100$$,  a majority vote resets the minority bit.  Clearly, this does not protect against multi-bit errors,  but that is usually not necessary. @@ -30,7 +30,7 @@ as discussed below.  ## Bit flip code  Suppose that we want to detect errors in -the following arbitrary qubit state $\Ket{\psi}$: +the following arbitrary qubit state $$\Ket{\psi}$$:  $$\begin{aligned}      \Ket{\psi} @@ -38,7 +38,7 @@ $$\begin{aligned}  \end{aligned}$$  For now, let us limit ourselves to detecting **bit flips**, -where $\alpha$ and $\beta$ get switched: +where $$\alpha$$ and $$\beta$$ get switched:  $$\begin{aligned}      \alpha \Ket{0} + \beta \Ket{1} @@ -56,7 +56,7 @@ $$\begin{aligned}      = \alpha \Ket{000} + \beta \Ket{111}  \end{aligned}$$ -In other words, a *logical* $\Ket{0}$ (written $\ket{\overline{0}}$) +In other words, a *logical* $$\Ket{0}$$ (written $$\ket{\overline{0}}$$)  is represented by 3 *physical* qubits, and vice versa:  $$\begin{aligned} @@ -80,7 +80,7 @@ of [quantum gates](/know/concept/quantum-gate/):  <img src="bit-flip-encode.png" style="width:32%">  </a> -So, a little while after encoding the state $\Ket{\psi}$ like that, +So, a little while after encoding the state $$\Ket{\psi}$$ like that,  a bit flip occurs on the 2nd qubit:  $$\begin{aligned} @@ -94,8 +94,8 @@ We could measure the state, but that would make it collapse,  which is probably not what we want.  The trick is to use operators called **stabilizers**, -in this case for example $ZZI = Z_1 \otimes Z_2 \otimes I_3$, -where $I$ is identity and $Z$ is the Pauli-$Z$ gate. +in this case for example $$ZZI = Z_1 \otimes Z_2 \otimes I_3$$, +where $$I$$ is identity and $$Z$$ is the Pauli-$$Z$$ gate.  The 3-qubit basis states are its eigenvectors:  $$\begin{alignedat}{2} @@ -124,13 +124,13 @@ $$\begin{alignedat}{2}      &&= + \Ket{111}  \end{alignedat}$$ -We could measure $ZZI$ for $\ket{\overline{\psi}}$, -and if the eigenvalue is $-1$, +We could measure $$ZZI$$ for $$\ket{\overline{\psi}}$$, +and if the eigenvalue is $$-1$$,  we know that a bit flip has occurred, -whereas if the eigenvalue is $+1$, -there is *maybe* no error ($\Ket{001}$ and $\Ket{110}$ are false negatives). +whereas if the eigenvalue is $$+1$$, +there is *maybe* no error ($$\Ket{001}$$ and $$\Ket{110}$$ are false negatives). -These false negatives are fixed by including another stabilizer $IZZ$, +These false negatives are fixed by including another stabilizer $$IZZ$$,  with these eigenvectors:  $$\begin{alignedat}{2} @@ -159,56 +159,56 @@ $$\begin{alignedat}{2}      &&= + \Ket{111}  \end{alignedat}$$ -In which case $\Ket{100}$ and $\Ket{011}$ are false negatives. -In other words, $IZZ$ cannot detect if the 1st qubit was flipped, -while $ZZI$ cannot protect the 3rd qubit. +In which case $$\Ket{100}$$ and $$\Ket{011}$$ are false negatives. +In other words, $$IZZ$$ cannot detect if the 1st qubit was flipped, +while $$ZZI$$ cannot protect the 3rd qubit.  But by using both, we know exactly which qubit was flipped  thanks to the eigenvalues:  <table style="width:30%;margin:auto;text-align:center;">      <tr>          <th>Error</th> -        <th>$ZZI$</th> -        <th>$IZZ$</th> +        <th>$$ZZI$$</th> +        <th>$$IZZ$$</th>      </tr>      <tr> -        <td>$I$</td> -        <td>$+1$</td> -        <td>$+1$</td> +        <td>$$I$$</td> +        <td>$$+1$$</td> +        <td>$$+1$$</td>      </tr>      <tr> -        <td>$X_1$</td> -        <td>$-1$</td> -        <td>$+1$</td> +        <td>$$X_1$$</td> +        <td>$$-1$$</td> +        <td>$$+1$$</td>      </tr>      <tr> -        <td>$X_2$</td> -        <td>$-1$</td> -        <td>$-1$</td> +        <td>$$X_2$$</td> +        <td>$$-1$$</td> +        <td>$$-1$$</td>      </tr>      <tr> -        <td>$X_1$</td> -        <td>$+1$</td> -        <td>$-1$</td> +        <td>$$X_1$$</td> +        <td>$$+1$$</td> +        <td>$$-1$$</td>      </tr>  </table> -Where e.g. $X_3$ denotes that the 3rd qubit was flipped. +Where e.g. $$X_3$$ denotes that the 3rd qubit was flipped.  The measurement outcomes on the last three rows are called **error syndromes**,  and are obtained by a **syndrome measurement**. -Fortunately, we can measure $ZZI$ and $IZZ$ -without affecting $\ket{\overline{\psi}}$ itself, -by applying $\mathrm{CNOT}$s to some ancillary qubits +Fortunately, we can measure $$ZZI$$ and $$IZZ$$ +without affecting $$\ket{\overline{\psi}}$$ itself, +by applying $$\mathrm{CNOT}$$s to some ancillary qubits  and then measuring those:  <a href="bit-flip-detect.png">  <img src="bit-flip-detect.png" style="width:62%">  </a> -The two measurements, respectively representing $ZZI$ and $IZZ$, -yield $\Ket{1}$ if a bit flip definitely occurred, -and $\Ket{0}$ otherwise. +The two measurements, respectively representing $$ZZI$$ and $$IZZ$$, +yield $$\Ket{1}$$ if a bit flip definitely occurred, +and $$\Ket{0}$$ otherwise.  There is no entanglement,  so the input is untouched. @@ -228,7 +228,7 @@ $$\begin{aligned}  How to detect that?  If we want to protect against phase flips *instead of* bit flips,  we can simply do the same as before, -but along the $X$-axis intead of the $Z$-axis: +but along the $$X$$-axis intead of the $$Z$$-axis:  $$\begin{aligned}      \boxed{ @@ -244,7 +244,7 @@ $$\begin{aligned}      }  \end{aligned}$$ -Such that an arbitrary state $\Ket{\psi}$ is encoded as follows, +Such that an arbitrary state $$\Ket{\psi}$$ is encoded as follows,  by the circuit shown below:  $$\begin{aligned} @@ -258,9 +258,9 @@ $$\begin{aligned}  <img src="phase-flip-encode.png" style="width:40%">  </a> -A phase flip along the $Z$-axis -corresponds to a bit flip along the $X$-axis $\Ket{+} \to \Ket{-}$. -In this case, the stabilizers are $XXI$ and $IXX$, +A phase flip along the $$Z$$-axis +corresponds to a bit flip along the $$X$$-axis $$\Ket{+} \to \Ket{-}$$. +In this case, the stabilizers are $$XXI$$ and $$IXX$$,  and the error detection circuit is as follows:  <a href="phase-flip-detect.png"> @@ -314,7 +314,7 @@ followed by 3 copies of the bit flip encoder:  We thus use 9 physical qubits to store 1 logical qubit.  Fortunately, more efficient schemes exist. -The bit flip stabilizers $ZZI$ and $IZZ$ +The bit flip stabilizers $$ZZI$$ and $$IZZ$$  are applied on a per-block basis, like so:  $$\begin{aligned} @@ -323,7 +323,7 @@ $$\begin{aligned}      IZZ \: III \: III \qquad\quad III \: IZZ \: III \qquad\quad III \: III \: IZZ  \end{aligned}$$ -Whereas the phase flip stabilizers $XXI$ and $IXX$ +Whereas the phase flip stabilizers $$XXI$$ and $$IXX$$  are applied to entire blocks at once:  $$\begin{aligned}  | 
