Page Content

Tutorials

Examples of Quantum Error Correcting Codes (QECC)

Several Quantum Error Correcting Codes (QECC) have been developed, each with different properties and capabilities:

Three-Qubit Codes

Three-qubit codes are fundamental examples of quantum error-correcting codes (QECC) that utilize three physical qubits to encode a single logical qubit, providing protection against specific types of errors. They serve as important conceptual building blocks for understanding more complex QECC, such as the Shor 9-qubit code and the Steane 7-qubit code

The primary goal of three-qubit codes is to protect a fragile quantum state of a single qubit from errors caused by interaction with the environment. These errors can manifest as bit flips (X) or phase flips (Z).

Types of Three-Qubit Codes

There are primarily two basic types of three-qubit codes.

Three-Qubit Bit-Flip Code: This code is designed to correct a single bit-flip error that might occur on any of the three physical qubits encoding the logical qubit.

A logical encoded as ∣0⟩ to ∣000⟩ and a logical ∣1⟩ to ∣111⟩ An arbitrary qubit state α∣0⟩+β∣1⟩ is encoded as α (∣000⟩) + β (∣111⟩)

This encoding can be achieved using quantum circuits involving CNOT gates

Three-Qubit Phase-Flip Code: This code is designed to correct a single phase-flip error that might occur on any of the three physical qubits.

To protect against phase flips, the logical basis states are encoded in the superposition basis

|0⟩→ |+++⟩, |1⟩→ |−−−⟩

where |+⟩= (|0⟩+ |1⟩)/√2 and |-⟩= (|0⟩- |1⟩)/√2

 This can be achieved by applying Hadamard gates to each qubit before encoding with CNOT gates (inspired by the bit-flip encoding)

Steane Code (7-qubit code)

The Steane Code is a 7-qubit quantum error correction code (QECC) developed by Andrew Steane in 1996. It is a member of the Calderbank-Shor-Steane (CSS) family of codes, which use classical linear error-correcting codes to correct quantum errors. The Steane code is particularly important in fault-tolerant quantum computing because it allows transversal implementation of key quantum gates.

How It Works

  1. Encoding a Logical Qubit:
    • A single logical qubit ∣ψ⟩ is spread across 7 physical qubits using a special [7,4,3] Hamming code.
    • This redundancy allows error detection without measuring the actual quantum state.
  2. Error Detection:
    • The Steane Code uses six stabilizer measurements to check for errors.
    • Three stabilizers detect bit-flip errors (X errors).
    • Three stabilizers detect phase-flip errors (Z errors).
  3. Error Correction:
    • If an error is detected, corrective operations (X or Z) are applied to fix the faulty qubit.
    • The logical qubit remains protected and intact.

Shor Code (9-qubit code)

The Shor Code was the first quantum error correction code (QECC), developed by Peter Shor in 1995. It is designed to protect a single qubit from both bit-flip errors and phase-flip errors by encoding one logical qubit into nine physical qubits.

How the Shor Code Works (Encoding a Logical Qubit)

Encoding Process: Expanding One Qubit into Nine

A single logical qubit (∣ψ⟩) is encoded into nine physical qubits using quantum entanglement and redundancy.

Step 1: Encode a Logical Qubit into Three Qubits

  • A single qubit in an unknown state:

    ∣ψ⟩=α∣0⟩+β∣1⟩

    We create three copies (not direct copies, but entangled states):

      ∣0L⟩=∣000⟩,∣1L⟩=∣111⟩

      • After encoding:

        ∣ψ⟩→α(∣000⟩)+β(∣111⟩)

        Step 2: Encode Each of the Three Qubits Again

        • Each qubit is further encoded using a Hadamard gate to protect against phase-flip errors:

          ∣000⟩→1/2(∣000⟩+∣111⟩)⊗3

          ∣111⟩→1/2(∣000⟩−∣111⟩)⊗3

          The final 9-qubit encoded state:

          ∣ψ⟩→α(∣000⟩+∣111⟩/2)⊗3+β(∣000⟩−∣111⟩/2)⊗3

          the logical qubit is spread across 9 physical qubits, allowing us to detect and correct errors without measuring the actual quantum information.

          Quantum CSS Codes

          The CSS code was introduced by Peter Shor and Andrew Steane in 1996 and is based on the idea that bit-flip and phase-flip errors can be corrected independently using classical error correction methods.

          How It Works:

          1. Encoding a Logical Qubit:
            • A logical qubit is encoded using two classical error-correcting codes:
              • C1​ corrects bit-flip errors (X errors).
              • C2 corrects phase-flip errors (Z errors).
            • These codes ensure quantum redundancy without violating the no-cloning theorem.
          2. Error Detection:
            • Syndrome measurements check for errors without collapsing the quantum state.
            • Errors are detected using parity checks from classical codes.
          3. Error Correction:
            • If an error is found, corrective operations (X or Z) are applied to restore the logical qubit.
            • Since bit-flip and phase-flip errors are corrected separately, the CSS code is efficient and practical.

          Hamming Code

          The Hamming Code is a classical error-correcting code used to detect and correct errors in data transmission. It is an [n, k, d] linear code, where n is the total length of the codeword, k is the number of message bits, and d is the minimum Hamming distance, which determines the number of errors it can detect and correct.

          How It Works

          1. Encoding Process:
            • A message of k bits is encoded into an n-bit codeword using a generator matrix (G).
            • Redundant parity check bits are added to enable error detection and correction.
          2. Error Detection:
            • The receiver checks the received codeword using a parity check matrix (H).
            • If there is no error, the syndrome (H × received codeword) is zero.
          3. Error Correction:
            • If the syndrome is nonzero, it indicates the position of the erroneous bit.
            • The receiver flips the incorrect bit to recover the original message.

          Surface Code

          Surface code is a leading architecture for quantum error correction, considered highly capable for achieving large-scale, fault-tolerant quantum computation. It is a type of topological quantum code known for its high error threshold compared to concatenated codes like Steane code.

          How the Surface Code Works

          A. Lattice of Physical Qubits

          Surface codes typically utilize a two-dimensional grid or lattice of physical qubits with nearest-neighbor (NN) interactions. This grid comprises two types of qubits:

          1. Data Qubits: Used to store the quantum information for computation.
          2. Ancilla Qubits (measure stabilizers for error detection) : Helper qubits used to detect bit-flip and phase-flip errors by performing error syndrome measurements (ESM).

          Each logical qubit is spread across many physical qubits, protecting it from errors.

          B. Stabilizer Measurements

          • The Surface Code uses stabilizer operators to detect errors without measuring the logical qubit directly.
          • It has X-type stabilizers (for bit-flip errors) and Z-type stabilizers (for phase-flip errors).
          • If an error occurs, the syndrome measurement identifies its location, allowing correction.

          Index