mqt.bench.benchmarks.seven_qubit_steane_code

7 Qubit Steane Code benchmark definition.

Module Contents

create_circuit(num_qubits: int) QuantumCircuit[source]

Returns a quantum circuit implementing the 7 Qubit Steane Code.

The Steane code is a quantum error-correcting code that encodes 1 logical qubit into 7 physical qubits. It is a CSS (Calderbank-Shor-Steane) code based on the classical [7,4,3] Hamming code, capable of correcting arbitrary single-qubit errors.

Encoding:

The logical states are encoded as superpositions of 8 codewords:

  • |0_L> = (|0000000> + |1010101> + |0110011> + |1100110> + |0001111> + |1011010> + |0111100> + |1101001>) / sqrt(8)

  • |1_L> = (|1111111> + |0101010> + |1001100> + |0011001> + |1110000> + |0100101> + |1000011> + |0010110>) / sqrt(8)

Syndrome Extraction:
  • Bit-flip syndrome: 3 ancilla qubits measure X-type stabilizers to detect which qubit (if any) experienced a bit flip. The syndrome value (1-7) directly identifies the affected qubit.

  • Phase-flip syndrome: 3 ancilla qubits measure Z-type stabilizers to detect which qubit (if any) experienced a phase flip. The syndrome value (1-7) directly identifies the affected qubit.

Error Correction:
  • Bit-flip correction: Based on the 3-bit syndrome measurement, X gates are conditionally applied to correct bit flips on any of the 7 data qubits.

  • Phase-flip correction: Based on the 3-bit syndrome measurement, Z gates are conditionally applied to correct phase flips on any of the 7 data qubits.

Circuit Structure:
  • 13 qubits (per logical qubit):
    • 7 data qubits (q): The encoded logical qubit

    • 3 bit-flip syndrome qubits (bfs): For X-error detection

    • 3 phase-flip syndrome qubits (pfs): For Z-error detection

  • 7 classical bits (per logical qubit):
    • 3 bit-flip syndrome measurement bits (bfsm)

    • 3 phase-flip syndrome measurement bits (pfsm)

    • 1 logical qubit measurement bit (m)

Parameters:

num_qubits – number of qubits of the returned quantum circuit (must be divisible by 13)

Returns:

QuantumCircuit – a quantum circuit implementing the 7 Qubit Steane Code