Skip to main content
Chemistry LibreTexts

8.88: Quantum Error Correction

  • Page ID
    149128
  • \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \) \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)\(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\) \(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\)\(\newcommand{\AA}{\unicode[.8,0]{x212B}}\)

    This tutorial deals with quantum error correction as presented by Julian Brown on pages 274-278 in The Quest for the Quantum Computer. Brown's three-qubit example includes an input qubit and two ancillary qubits in the initial state |Ψ00>. This state is encoded and subsequently decoded, with the possibility that in between it acquires an error. The quantum circuit demonstrates how correction occurs if a qubit is flipped due to decoherence at the intermediate state.

    The quantum gates required for the error correction algorithm are:

    \[ \begin{matrix} \text{I} = \begin{pmatrix} 1 & 0 \\ 0 & 1 \end{pmatrix} & \text{CNOT} = \begin{pmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 1 \\ 0 & 0 & 1 & 0 \end{pmatrix} & \text{CnNOT} = \begin{pmatrix} 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 \\ 0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 \end{pmatrix} & \text{IToffoli} = \begin{pmatrix} 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 \\ 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 \end{pmatrix} \end{matrix} \nonumber \]

    The encoding and decoding elements of the circuit in terms of these gates are shown in the appropriate place above the circuit diagram.

    \[ \begin{matrix} \text{Encode = CnNOT kronecker(CNOT, I)} & \text{Decode = IToffoli Encode)} \end{matrix} \nonumber \]

    \[ \begin{matrix} \sqrt{ \frac{1}{3}} + \sqrt{ \frac{2}{3}} |1 \rangle & \cdots & \cdot & \cdots & \cdot & \cdots & \text{E} & \cdots & \cdot & \cdots & \cdot & \cdots & \oplus & \triangleright & \sqrt{ \frac{1}{3}} |0 \rangle + \sqrt{ \frac{2}{3}} |1 \rangle \\ ~ & ~ & | & ~ & | & ~ & \text{R} & ~ & | & ~ & | & ~ & | \\ |0 \rangle & \cdots & \oplus & \cdots & | & \cdots & \text{R} & \cdots & \oplus & \cdots & | & \cdots & \cdot & \triangleright & |0 \rangle or |1 \rangle \\ ~ & ~ & ~ & ~ & | & ~ & \text{O} & ~ & ~ & ~ & | & ~ & | \\ |0 \rangle & \cdots & \cdots & \cdots & \oplus & \cdots & \text{R} & \cdots & \cdots & \cdots & \oplus & \cdots & \cdot & \triangleright & |0 \rangle or |1 \rangle \end{matrix} \nonumber \]

    Given an initial state, the encodng step creates an entangled Bell state as demonstrated below.

    \[ \begin{matrix} \text{Initial State} & \text{Encode} & \text{Encoded state} \\ \begin{pmatrix} \sqrt{ \frac{1}{3}} \\ \sqrt{ \frac{2}{3}} \end{pmatrix} \begin{pmatrix} 1 \\ 0 \end{pmatrix} \begin{pmatrix} 1 \\ 0 \end{pmatrix} = \begin{pmatrix} \sqrt{ \frac{1}{3}} \\ 0 \\ 0 \\ 0 \\ \frac{ \sqrt{2}{3}} \\ 0 \\ 0 \\ 0 \end{pmatrix} & \text{Encode} \begin{pmatrix} \sqrt{ \frac{1}{3}} \\ 0 \\ 0 \\ 0 \\ \sqrt{ \frac{2}{3}} \\ 0 \\ 0 \\ 0 \end{pmatrix} = \begin{pmatrix} 0.577 \\ 0 \\ 0 \\ 0 \\ 0 \\ 0 \\ 0 \\ 0.816 \end{pmatrix} & \begin{pmatrix} \sqrt{ \frac{1}{3}} \\ 0 \end{pmatrix} \begin{pmatrix} 1 \\ 0 \end{pmatrix} \begin{pmatrix} 1 \\ 0 \end{pmatrix} + \begin{pmatrix} 0 \\ \sqrt{ \frac{2}{3}} \end{pmatrix} \begin{pmatrix} 0 \\ 1 \end{pmatrix} \begin{pmatrix} 0 \\ 1 \end{pmatrix} = \begin{pmatrix} \sqrt{ \frac{1}{3}} \\ 0 \\ 0 \\ 0 \\ 0 \\ 0 \\ 0 \\ \sqrt{ \frac{2}{3}} \end{pmatrix} \end{matrix} \nonumber \]

    As an initial example, it is assumed that between encoding and decoding no errors are introduced to the encoded state. This case demonstrates that decoding simply returns the initial state. Susbsequent to this the operation of the circuit when errors occur on each of the wires are examined. These cases demonstrate that the original state appears on the top wire at the completion of the error correction circuit.

    \[ \begin{matrix} \text{No errors:} & \begin{pmatrix} \sqrt{ \frac{1}{3}} \\ 0 \end{pmatrix} \begin{pmatrix} 1 \\ 0 \end{pmatrix} \begin{pmatrix} 1 \\ 0 \end{pmatrix} + \begin{pmatrix} 0 \\ sqrt{ \frac{2}{3}} \end{pmatrix} \begin{pmatrix} 0 \\ 1 \end{pmatrix} \begin{pmatrix} 0 \\ 1 \end{pmatrix} = \begin{pmatrix} \sqrt{ \frac{1}{3}} \\ 0 \\ 0 \\ 0 \\ 0 \\ 0 \\ 0 \sqrt{ \frac{2}{3}} \end{pmatrix} & \text{Decode} \begin{pmatrix} 0.577 \\ 0 \\ 0 \\ 0 \\ 0 \\ 0 \\ 0 \\ 0.816 \end{pmatrix} = \begin{pmatrix} 0.577 \\ 0 \\ 0 \\ 0 \\ 0.816 \\ 0 \\ 0 \\ 0 \end{pmatrix} & \begin{pmatrix} \sqrt{ \frac{1}{3}} \\ \sqrt{ \frac{2}{3}} \end{pmatrix} \begin{pmatrix} 1 \\ 0 \end{pmatrix} \begin{pmatrix} 1 \\ 0 \end{pmatrix} = \begin{pmatrix} \sqrt{ \frac{1}{3}} \\ 0 \\ 0 \\ 0 \\ \sqrt{ \frac{2}{3}} \\ 0 \\ 0 \\ 0 \end{pmatrix} \end{matrix} \nonumber \]

    Next it is shown that if the input state, |Ψ>, is corrupted that the decoder corrects the error and returns the original |Ψ> to the top wire of the circuit. In the example shown below the top qubit is flipped.

    \[ \begin{matrix} \text{Top qubit flipped:} & \begin{pmatrix} 0 \\ \sqrt{ \frac{1}{3}} \end{pmatrix} \begin{pmatrix} 1 \\ 0 \end{pmatrix} \begin{pmatrix} 1 \\ 0 \end{pmatrix} + \begin{pmatrix} \sqrt{ \frac{2}{3}} \\ 0 \end{pmatrix} \begin{pmatrix} 0 \\ 1 \end{pmatrix} \begin{pmatrix} 0 \\ 1 \end{pmatrix} = \begin{pmatrix} 0 \\ 0 \\ 0 \\ \sqrt{ \frac{2}{3}} \\ \sqrt{ \frac{1}{3}} \\ 0 \\ 0 \\ 0 \end{pmatrix} & \text{Decode} \begin{pmatrix} 0 \\ 0 \\ 0 \\ \sqrt{ \frac{2}{3}} \\ \sqrt{ \frac{1}{3}} \\ 0 \\ 0 \\ 0 \end{pmatrix} = \begin{pmatrix} 0 \\ 0 \\ 0 \\ 0.577 \\ 0 \\ 0 \\ 0 \\ 0.816 \end{pmatrix} & \begin{pmatrix} \sqrt{ \frac{1}{3}} \\ \sqrt{ \frac{2}{3}} \end{pmatrix} \begin{pmatrix} 1 \\ 0 \end{pmatrix} \begin{pmatrix} 1 \\ 0 \end{pmatrix} = \begin{pmatrix} 0 \\ 0 \\ 0 \\ \sqrt{ \frac{1}{3}} \\ 0 \\ 0 \\ 0 \\ \sqrt{ \frac{2}{3}} \end{pmatrix} \end{matrix} \nonumber \]

    The circuit can also be expressed using Dirac notation. Truth tables for the gates are provided in the Appendix.

    \[ \begin{matrix} \left( \sqrt{ \frac{1}{3}} |0 \rangle + \sqrt{ \frac{2}{3}} |1 \rangle \right) |00 \rangle \xrightarrow{encode} \sqrt{ \frac{1}{3}} |000 \rangle + \sqrt{ \frac{2}{3}} |111 \rangle \xrightarrow{flip~top}[qubit] \sqrt{ \frac{1}{3}} |100 \rangle + \sqrt{ \frac{2}{3}} |011 \rangle \\ \xrightarrow{CNOT,~I} \sqrt{ \frac{1}{3}} |110 \rangle + \sqrt{ \frac{2}{3}} |011 \rangle \xrightarrow{CnNOT} \sqrt{ \frac{1}{3}} |111 \rangle + \sqrt{ \frac{2}{3}} |011 \rangle \\ \xrightarrow{InToffoli} \sqrt{ \frac{1}{3}} |011 \rangle + \sqrt{ \frac{2}{3}} |111 \rangle = \left( \sqrt{ \frac{1}{3}} |0 \rangle + \sqrt{ \frac{2}{3}} |1 \rangle \right) |11 \rangle \end{matrix} \nonumber \]

    Naturally the ancillary qubits are also susceptible to errors. The following examples show that if a qubit flip occurs on the middle or bottom wire, the circuit still functions properly.

    \[ \begin{matrix} \text{Middle qubit flipped:} & \begin{pmatrix} \sqrt{ \frac{1}{3}} \\ 0 \end{pmatrix} \begin{pmatrix} 0 \\ 1 \end{pmatrix} \begin{pmatrix} 1 \\ 0 \end{pmatrix} + \begin{pmatrix} 0 \\ \sqrt{ \frac{2}{3}} \end{pmatrix} \begin{pmatrix} 1 \\ 0 \end{pmatrix} \begin{pmatrix} 0 \\ 1 \end{pmatrix} = \begin{pmatrix} 0 \\ 0 \\ \sqrt{ \frac{2}{3}} \\ 0 \\ 0 \\ \sqrt{ \frac{1}{3}} \\ 0 \\ 0 \end{pmatrix} & \text{Decode} \begin{pmatrix} 0 \\ 0 \\ \sqrt{ \frac{1}{3}} \\ 0 \\ 0 \\ \sqrt{ \frac{2}{3}} \\ 0 \\ 0 \end{pmatrix} = \begin{pmatrix} 0 \\ 0 \\ 0.577 \\ 0 \\ 0 \\ 0 \\ 0.816 \\ 0 \end{pmatrix} & \begin{pmatrix} \sqrt{ \frac{1}{3}} \\ \sqrt{ \frac{2}{3}} \end{pmatrix} \begin{pmatrix} 0 \\ 1 \end{pmatrix} \begin{pmatrix} 1 \\ 0 \end{pmatrix} = \begin{pmatrix} 0 \\ 0 \\ \sqrt{ \frac{1}{3}} \\ 0 \\ 0 \\ 0 \\ \sqrt{ \frac{2}{3}} \\ 0 \end{pmatrix} \end{matrix} \nonumber \]

    \[ \begin{matrix} \left( \sqrt{ \frac{1}{3}} |0 \rangle + \sqrt{ \frac{2}{3}} |1 \rangle \right) |00 \rangle \xrightarrow{encode} \sqrt{ \frac{1}{3}} |000 \rangle + \sqrt{ \frac{2}{3}} |111 \rangle \xrightarrow{flip~top}[qubit] \sqrt{ \frac{1}{3}} |010 \rangle + \sqrt{ \frac{2}{3}} |101 \rangle \\ \xrightarrow{CNOT,~I} \sqrt{ \frac{1}{3}} |010 \rangle + \sqrt{ \frac{2}{3}} |111 \rangle \xrightarrow{CnNOT} \sqrt{ \frac{1}{3}} |010 \rangle + \sqrt{ \frac{2}{3}} |110 \rangle \\ \xrightarrow{InToffoli} \sqrt{ \frac{1}{3}} |010 \rangle + \sqrt{ \frac{2}{3}} |110 \rangle = \left( \sqrt{ \frac{1}{3}} |0 \rangle + \sqrt{ \frac{2}{3}} |1 \rangle \right) |10 \rangle \end{matrix} \nonumber \]

    \[ \begin{matrix} \text{Bottom qubit flipped:} & \begin{pmatrix} \sqrt{ \frac{1}{3}} \\ 0 \end{pmatrix} \begin{pmatrix} 1 \\ 0 \end{pmatrix} \begin{pmatrix} 0 \\ 1 \end{pmatrix} + \begin{pmatrix} 0 \\ \sqrt{ \frac{2}{3}} \end{pmatrix} \begin{pmatrix} 0 \\ 1 \end{pmatrix} \begin{pmatrix} 1 \\ 0 \end{pmatrix} = \begin{pmatrix} 0 \\ \sqrt{ \frac{1}{3}} \\ 0 \\ 0 \\ 0 \\ 0 \\ \sqrt{ \frac{2}{3}} \\ 0 \end{pmatrix} & \text{Decode} \begin{pmatrix} 0 \\ \sqrt{ \frac{1}{3}} \\ 0 \\ 0 \\ 0 \\ 0 \\ \sqrt{ \frac{2}{3}} \\ 0 \end{pmatrix} = \begin{pmatrix} 0 \\ 0.577 \\ 0 \\ 0 \\ 0 \\ 0.816 \\ 0 \\ 0 \end{pmatrix} & \begin{pmatrix} \sqrt{ \frac{1}{3}} \\ \sqrt{ \frac{2}{3}} \end{pmatrix} \begin{pmatrix} 1 \\ 0 \end{pmatrix} \begin{pmatrix} 0 \\ 1 \end{pmatrix} = \begin{pmatrix} 0 \\ \sqrt{ \frac{1}{3}} \\ 0 \\ 0 \\ 0 \\ \sqrt{ \frac{2}{3}} \\ 0 \\ 0 \end{pmatrix} \end{matrix} \nonumber \]

    \[ \begin{matrix} \left( \sqrt{ \frac{1}{3}} |0 \rangle + \sqrt{ \frac{2}{3}} |1 \rangle \right) |00 \rangle \xrightarrow{encode} \sqrt{ \frac{1}{3}} |000 \rangle + \sqrt{ \frac{2}{3}} |111 \rangle \xrightarrow{flip~top}[qubit] \sqrt{ \frac{1}{3}} |001 \rangle + \sqrt{ \frac{2}{3}} |110 \rangle \\ \xrightarrow{CNOT,~I} \sqrt{ \frac{1}{3}} |001 \rangle + \sqrt{ \frac{2}{3}} |100 \rangle \xrightarrow{CnNOT} \sqrt{ \frac{1}{3}} |001 \rangle + \sqrt{ \frac{2}{3}} |101 \rangle \\ \xrightarrow{InToffoli} \sqrt{ \frac{1}{3}} |001 \rangle + \sqrt{ \frac{2}{3}} |101 \rangle = \left( \sqrt{ \frac{1}{3}} |0 \rangle + \sqrt{ \frac{2}{3}} |1 \rangle \right) |01 \rangle \end{matrix} \nonumber \]

    Appendix

    \[ \begin{matrix} \text{CNOT} & \text{CnNOT} & \text{IToffoli} \\ \begin{pmatrix} \text{Decimal} & \text{Binary} & \text{to} & \text{Binary} & \text{Decimal} \\ 0 & 00 & \text{to} & 00 & 0 \\ 1 & 01 & \text{to} & 01 & 1 \\ 2 & 10 & \text{to} & 11 & 3 \\ 3 & 11 & \text{to} & 10 & 2 \end{pmatrix} & \begin{pmatrix} \text{Decimal} & \text{Binary} & \text{to} & \text{Binary} & \text{Decimal} \\ 0 & 000 & \text{to} & 000 & 0 \\ 1 & 001 & \text{to} & 001 & 1 \\ 2 & 010 & \text{to} & 010 & 2 \\ 3 & 011 & \text{to} & 011 & 3 \\ 4 & 100 & \text{to} & 101 & 5 \\ 5 & 101 & \text{to} & 100 & 4 \\ 6 & 110 & \text{to} & 111 & 7 \\ 7 & 111 & \text{to} & 110 & 6 \end{pmatrix} & \begin{pmatrix} \text{Decimal} & \text{Binary} & \text{to} & \text{Binary} & \text{Decimal} \\ 0 & 000 & \text{to} & 000 & 0 \\ 1 & 001 & \text{to} & 001 & 1 \\ 2 & 010 & \text{to} & 010 & 2 \\ 3 & 011 & \text{to} & 111 & 7 \\ 4 & 100 & \text{to} & 100 & 4 \\ 5 & 101 & \text{to} & 101 & 5 \\ 6 & 110 & \text{to} & 110 & 6 \\ 7 & 111 & \text{to} & 011 & 3 \end{pmatrix} \end{matrix} \nonumber \]


    This page titled 8.88: Quantum Error Correction is shared under a CC BY 4.0 license and was authored, remixed, and/or curated by Frank Rioux via source content that was edited to the style and standards of the LibreTexts platform; a detailed edit history is available upon request.