Comparative Analysis of Logical Error Rate Scaling in the Three-Qubit Bit-Flip Code and the Distance-3 Surface Code Under Depolarizing Noise: A Simulation Study Using Qiskit Aer and a Validated Stabilizer-Formalism Engine
Quantum error correction (QEC) is a prerequisite for fault-tolerant quantum computation, yet the overhead cost—the number of physical qubits required to encode and protect a single logical qubit—varies substantially across QEC code families. This paper presents a systematic simulation-based comparison of two paradigmatic QEC codes: the three-qubit bit-flip repetition code and the distance-3 surface code. The bit-flip code is simulated by literal Qiskit Aer circuit execution (encoding, injected depolarizing noise, and dynamic classical feed-forward correction). The distance-3 surface code is instead simulated with a custom, vectorized stabilizer-formalism engine, because its 17-qubit noisy circuit would be far more expensive to run shot-by-shot in Aer at the scale needed here. This engine implements the same Aaronson-Gottesman algorithm underlying Aer's stabilizer backend and is cross-validated against genuine Aer circuit execution at a representative operating point; no surface-code result in this paper comes from literal Aer execution. We apply an independent single-qubit depolarizing channel at physical error rates p ∈ [0.001, 0.30] and measure the resulting logical error rate P_L for each code across 200,000 independent trials per data point (95% Wilson confidence intervals reported throughout). We identify the pseudo-threshold p*—the physical error rate at which a code's logical error rate equals the uncorrected physical error rate, and compare simulated crossover points against closed-form analytical predictions. Our results reveal a more nuanced picture than the naive threshold-theorem intuition suggests. The three-qubit bit-flip code cannot correct phase-type errors under any circumstance: under a full quantum-state-protection criterion its logical error rate exceeds the physical error rate for every physically meaningful p, with the two curves crossing only at p ≈ 0.75 deep in the maximally-mixed regime and of no practical relevance. Under the narrower, but operationally standard, "bit-observable" criterion (protection of a definite computational-basis value only), the code is unconditionally beneficial (P_L < p) across the entire tested range, because the 2/3 fraction of depolarizing weight that manifests as a detectable bit-flip is compressed further by majority-vote correction. These two results are not contradictory: they evaluate different protection goals—preservation of a classical bit value versus preservation of an arbitrary quantum state—and every comparison in this paper that mixes the two is labeled accordingly. Under this study's idealized, single-round setup, the distance-3 surface code achieves a simulated finite-size pseudo-threshold of p*_SC ≈ 0.083 (8.3%)—a result specific to noiseless syndrome extraction, a single correction round, and an exact minimum weight decoder, and not a hardware representative or asymptotic threshold. That figure is roughly three orders of magnitude higher than an order-of-magnitude literature extrapolation of ≈ 5.6 × 10⁻⁵ (substituting the asymptotic literature threshold p_th ≈ 0.75% into a power law fit for a different, many-round, measurement noisy regime, not a dedicated prediction for our exact setup); the gap is attributable to precisely those idealizations. The surface code requires 17 physical qubits per logical qubit in our implementation (9 data + 8 ancilla) versus 3 for the bit-flip code, a ≈ 5.7× overhead, quantitatively illustrating the overhead-versus-protection tradeoff fundamental to near-term fault-tolerant architectures. All simulation code is available at https://github.com/shanjeev-b-u/qec-code-comparison-depolarizing-noise
Quantum error correction (QEC) is a prerequisite for fault-tolerant quantum computation, yet the overhead cost—the number of physical qubits required to encode and protect a single logical qubit—varies substantially across QEC code families. This paper presents a systematic simulation-based comparison of two paradigmatic QEC codes: the three-qubit bit-flip repetition code and the distance-3 surface code. The bit-flip code is simulated by literal Qiskit Aer circuit execution (encoding, injected depolarizing noise, and dynamic classical feed-forward correction). The distance-3 surface code is instead simulated with a custom, vectorized stabilizer-formalism engine, because its 17-qubit noisy circuit would be far more expensive to run shot-by-shot in Aer at the scale needed here. This engine implements the same Aaronson-Gottesman algorithm underlying Aer's stabilizer backend and is cross-validated against genuine Aer circuit execution at a representative operating point; no surface-code result in this paper comes from literal Aer execution. We apply an independent single-qubit depolarizing channel at physical error rates p ∈ [0.001, 0.30] and measure the resulting logical error rate P_L for each code across 200,000 independent trials per data point (95% Wilson confidence intervals reported throughout). We identify the pseudo-threshold p*—the physical error rate at which a code's logical error rate equals the uncorrected physical error rate, and compare simulated crossover points against closed-form analytical predictions. Our results reveal a more nuanced picture than the naive threshold-theorem intuition suggests. The three-qubit bit-flip code cannot correct phase-type errors under any circumstance: under a full quantum-state-protection criterion its logical error rate exceeds the physical error rate for every physically meaningful p, with the two curves crossing only at p ≈ 0.75 deep in the maximally-mixed regime and of no practical relevance. Under the narrower, but operationally standard, "bit-observable" criterion (protection of a definite computational-basis value only), the code is unconditionally beneficial (P_L < p) across the entire tested range, because the 2/3 fraction of depolarizing weight that manifests as a detectable bit-flip is compressed further by majority-vote correction. These two results are not contradictory: they evaluate different protection goals—preservation of a classical bit value versus preservation of an arbitrary quantum state—and every comparison in this paper that mixes the two is labeled accordingly. Under this study's idealized, single-round setup, the distance-3 surface code achieves a simulated finite-size pseudo-threshold of p*_SC ≈ 0.083 (8.3%)—a result specific to noiseless syndrome extraction, a single correction round, and an exact minimum weight decoder, and not a hardware representative or asymptotic threshold. That figure is roughly three orders of magnitude higher than an order-of-magnitude literature extrapolation of ≈ 5.6 × 10⁻⁵ (substituting the asymptotic literature threshold p_th ≈ 0.75% into a power law fit for a different, many-round, measurement noisy regime, not a dedicated prediction for our exact setup); the gap is attributable to precisely those idealizations. The surface code requires 17 physical qubits per logical qubit in our implementation (9 data + 8 ancilla) versus 3 for the bit-flip code, a ≈ 5.7× overhead, quantitatively illustrating the overhead-versus-protection tradeoff fundamental to near-term fault-tolerant architectures. All simulation code is available at https://github.com/shanjeev-b-u/qec-code-comparison-depolarizing-noise
Fault-tolerant quantum computation requires quantum error correction (QEC), and while the performance of various QEC codes has been well characterized under idealized noise conditions, it has not been sufficiently characterized by simulation under realistic noise conditions.In this paper, the performance of three basic QEC codes (3-qubit Bit-Flip, 3-qubit Phase-Flip and Shor's 9-qubit [[9,1,3]]) under simulated depolarizing noise, by using Qiskit Aer, is analyzed systematically in three stages.Stage 1 is a validation of all three implementations under ideal circumstances.Stage 2 tests for 6 different error rates of 0% to 5%, and runs 2048 shots per error rate.Stage 3 brings the analysis from stage 2 to 0% to 10%, but with an uncorrected baseline for comparison.Results verify that Shor's > Bit-Flip > Phase-Flip is consistent over practically relevant error rates.At 1% noise, within current IBM Quantum hardware range, all three codes achieve a logical fidelity of over 98.7%.An error rate of 7-8% is used to identify a cross-over threshold above which the simpler Bit-Flip code can match Shor's code in fidelity with only one-third the number of qubits.
Abstract Quantum computers are powerful tools for certain computational problems, but their fragile quantum states are easily disrupted by environmental noise, causing errors that degrade computational accuracy. Quantum error correction (QEC) addresses this challenge by encoding one logical qubit across multiple physical qubits, so that individual errors can be identified and reversed through redundancy. We used Qiskit Aer, a free open-source quantum circuit simulator, to test the repetition code, one of the simplest QEC methods, under three types of noise: bit-flip, phase-flip, and depolarizing. We compared an unprotected single-qubit baseline (n = 1) to 3-qubit (n = 3) and 5-qubit (n = 5) repetition codes, sweeping the physical error rate p from 0 to 0.15 with 4,000 simulation shots per data point. We hypothesized that larger codes would achieve higher logical success probabilities at all tested noise levels, with n = 5 outperforming n = 3, which would outperform the unprotected baseline. Our results confirmed this scaling trend across all three noise types. At p = 0.10 under bit-flip noise, the baseline achieved 0.713 logical success, while n = 3 reached 0.791 and n = 5 reached 0.843. At low noise (p = 0.02), the n = 5 code approached 0.994 logical success. Simulation results closely matched exact theoretical predictions derived from the binomial failure probability formula, validating our experimental implementation. These findings confirm that even the simplest QEC methods provide meaningful error reduction and that larger codes offer greater protection, demonstrating a foundational principle of quantum error correction using only free simulation tools.
Abstract Quantum computers are powerful tools for certain computational problems, but their fragile quantum states are easily disrupted by environmental noise, causing errors that degrade computational accuracy. Quantum error correction (QEC) addresses this challenge by encoding one logical qubit across multiple physical qubits, so that individual errors can be identified and reversed through redundancy. We used Qiskit Aer, a free open-source quantum circuit simulator, to test the repetition code, one of the simplest QEC methods, under three types of noise: bit-flip, phase-flip, and depolarizing. We compared an unprotected single-qubit baseline (n = 1) to 3-qubit (n = 3) and 5-qubit (n = 5) repetition codes, sweeping the physical error rate p from 0 to 0.15 with 4,000 simulation shots per data point. We hypothesized that larger codes would achieve higher logical success probabilities at all tested noise levels, with n = 5 outperforming n = 3, which would outperform the unprotected baseline. Our results confirmed this scaling trend across all three noise types. At p = 0.10 under bit-flip noise, the baseline achieved 0.713 logical success, while n = 3 reached 0.791 and n = 5 reached 0.843. At low noise (p = 0.02), the n = 5 code approached 0.994 logical success. Simulation results closely matched exact theoretical predictions derived from the binomial failure probability formula, validating our experimental implementation. These findings confirm that even the simplest QEC methods provide meaningful error reduction and that larger codes offer greater protection, demonstrating a foundational principle of quantum error correction using only free simulation tools.
Quantum Error Correction (QEC) is essential for achieving fault-tolerant quantum computation, enabling the protection of fragile quantum information from decoherence and noise. While classical Forward Error Correction (FEC) codes have been highly effective in digital communication systems, their direct application to quantum systems is inadequate mainly due to the no cloning theorem and the continuous nature of quantum errors. Unlike classical FECs, QEC is designed to detect and correct both bit-flip and phase-flip errors without disturbing the encoded quantum state. This paper presents the code structure design and simulation of two quantum error correction codes—the Planar surface code and the 5-qubit Perfect code—using Qiskit and Stim on Google Colab. It is worth mentioning here that the performance of the Steane [ [7], [1], [3]] code is included in the current work as a benchmark. The codes are evaluated under statistical noise models, including amplitude damping and dephasing, which closely mirror the physical behavior of quantum hardware. The primary performance metric, for performance assessment, is the logical error rate, evaluated across a range of physical error rates and code distances under each noise model. The simulation results show that increasing the distance of the Planar code significantly reduces the logical error rates, demonstrating superior performance compared to other similar codes under this study.
Practical quantum computers will require resource-efficient error-correcting codes. The rotated surface code uses approximately half the number of qubits as the unrotated surface code to create a logical qubit with the same error-correcting distance. However, instead of distance, a more useful qubit-saving metric would be based on logical error rates. In this work we find the well-below-threshold scaling of logical to physical error rates under circuit-level noise for both codes at high odd and even distances and then compare the number of qubits used by each code to achieve equal logical error rates. We perform Monte Carlo sampling of memory experiment circuits with all valid CNOT orders using the stabilizer simulator Stim and the uncorrelated minimum-weight perfect matching decoder PyMatching 2. We find that the rotated code uses about 74 % the number of qubits used by the unrotated code to achieve a logical error rate of p L = 10 − 12 at the operational physical error rate of p = 10 − 3 . The ratio remains ≈ 75 % for p values within a factor of two of p = 10 − 3 for all useful p L . Our work finds the low- p L scaling of the surface code and clarifies the qubit savings provided by the rotated surface code, providing numerical justification for its use in future implementations of the surface code.
Quantum error correction (QEC) represents a critical enabler for fault-tolerant quantum computing, protecting fragile quantum states from decoherence and operational errors. This paper provides a comprehensive analysis of leading quantum error correction schemes, focusing on surface codes and topological codes within the context of Noisy Intermediate-Scale Quantum (NISQ) era processors. We examine the theoretical foundations of stabilizer codes, compare surface code implementations with code distances ranging from d=3 to d=17, and analyze topological codes including toric codes and color codes. Our investigation encompasses syndrome extraction circuits, logical qubit encoding strategies, and threshold analysis for contemporary quantum hardware platforms. Performance metrics reveal that surface codes achieve error thresholds of approximately 1% with realistic noise models, while topological codes offer architectural advantages for specific qubit connectivity constraints. We discuss implementation challenges on current NISQ processors including IBM Quantum, Google Sycamore, and IonQ systems, addressing qubit overhead, gate fidelity requirements, and decoding algorithms. This analysis provides insights for selecting appropriate error correction schemes based on application requirements and hardware capabilities.