Quantum computers rely on fragile qubits that easily lose coherence. A single qubit’s error rate limits practical algorithms.
Using a [[4,2,2]] error‑detection code, we can build a logical Bell pair that outperforms any physical qubit pair in fidelity, as shown on IBM’s 156‑qubit machines. This article explains how the code works and why it matters.
What is a logical qubit and a Bell pair?
A physical qubit is the elementary unit of quantum information stored on a hardware device such as an IBM QPU. It is a two‑level system that can be in a superposition of |0⟩ and |1⟩. A logical qubit, by contrast, is an encoded state spread over several physical qubits. The encoding protects the logical state against noise by allowing error detection and correction before the information is read out. Logical qubits are essential for fault‑tolerant quantum computing because they enable the suppression of errors that would otherwise destroy quantum correlations.
Bell states and their role in quantum communication
A Bell pair is a maximally entangled two‑qubit state. The most common Bell state is |Φ⁺⟩ = (|00⟩ + |11⟩)/√2. Bell pairs serve as a resource for quantum teleportation, superdense coding, and entanglement‑based cryptography. In a physical implementation, the fidelity of a Bell pair is limited by decoherence and gate errors. By encoding each qubit of the pair into a logical qubit, the entanglement can be preserved over longer times and with higher fidelity, which is crucial for distributed quantum protocols.
Why logical Bell pairs outperform physical ones
When a logical qubit is encoded with an error‑detection code such as the [[4,2,2]] code, each logical qubit is represented by four physical qubits. The code can detect any single‑qubit error through parity checks. If an error is detected, the measurement outcome indicates the affected qubit, and the logical state can be recovered or discarded before it propagates. This process reduces the probability that an error corrupts the entanglement between the two logical qubits, thereby increasing the overall fidelity of the logical Bell pair.
QubitPage’s recent work on the [[4,2,2]] code, detailed in the QuBIOS project, demonstrates that a logical Bell pair can achieve a fidelity of 97.7 % on IBM’s Heron r2 QPUs, surpassing the best physical Bell pairs (89.7 %) measured on the same devices. This improvement is achieved without additional hardware, relying solely on software‑defined encoding and parity‑check operations.
For developers and researchers interested in deploying logical qubits on remote quantum hardware, the Carpathron Remote interface allows direct access to IBM QPU backends while automatically managing logical encoding and error detection. By integrating logical qubits into existing workflows, teams can experiment with fault‑tolerant protocols in real‑world settings without the need for custom hardware.
In summary, logical qubits transform the raw, noisy outputs of physical qubits into robust carriers of quantum information. When combined into Bell pairs, they provide a higher‑fidelity entangled resource that is essential for reliable quantum communication and computation.
Structure of the [[4,2,2]] error‑detection code
The [[4,2,2]] code is a simple yet powerful example of a quantum error‑detection scheme. The notation [[n,k,d]] indicates that the code uses n = 4 physical qubits to encode k = 2 logical qubits, with a minimum distance d = 2. A distance of two means that any single‑qubit error can be detected but not corrected; the code can flag that an error occurred while preserving the logical information.
Physical qubit layout and logical basis
Consider four physical qubits labeled q0, q1, q2, and q3. The logical states are built from tensor products of computational basis states. For the first logical qubit (L0) the code space is spanned by |00⟩ and |11⟩ across q0–q1, while the second logical qubit (L1) uses q2–q3. The logical basis states are therefore:
- |0_L0 0_L1⟩ = |0000⟩
- |0_L0 1_L1⟩ = |0011⟩
- |1_L0 0_L1⟩ = |1100⟩
- |1_L0 1_L1⟩ = |1111⟩
These four codewords form a subspace that is invariant under the stabilizer generators described next.
Stabilizer generators
The [[4,2,2]] code is defined by two commuting stabilizers:
- S1 = X₀ X₁ X₂ X₃
- S2 = Z₀ Z₁ Z₂ Z₃
Both S1 and S2 act as identity on the code space, yielding eigenvalue +1 for all valid codewords. Any single‑qubit Pauli error flips the eigenvalue of at least one stabilizer, allowing the error to be detected. For example, an X error on q0 changes the eigenvalue of S1 from +1 to –1 while leaving S2 unchanged.
Encoding a logical Bell pair
To create a logical Bell pair between two logical qubits, one applies a Hadamard gate to the first logical qubit and a controlled‑NOT (CNOT) gate between the two logical qubits. In the [[4,2,2]] encoding, these logical gates are implemented as collective operations on the underlying physical qubits. The resulting logical Bell state is:
|Φ⁺_L⟩ = (|0_L0 0_L1⟩ + |1_L0 1_L1⟩)/√2 = (|0000⟩ + |1111⟩)/√2
Because the code protects against single‑qubit errors, this logical Bell pair retains high fidelity even when the hardware introduces noise on individual qubits.
Tip: When running the code on IBM QPUs, use the QuBIOS library to automatically generate the stabilizer measurement circuits and to apply the necessary Pauli twirling for error suppression.
Parity checks and error detection process
The [[4,2,2]] code encodes two logical qubits into four physical qubits. Its stabilizers are two parity checks that involve all four qubits: the X‑type stabilizer \(S_X = X_1X_2X_3X_4\) and the Z‑type stabilizer \(S_Z = Z_1Z_2Z_3Z_4\). Measuring these stabilizers reveals whether a single‑qubit error has occurred while preserving the encoded logical information. The key is that the stabilizers commute with the logical operators, so their eigenvalues can be extracted without disturbing the logical state.
In practice, the parity checks are implemented with ancilla qubits that interact with the data qubits via controlled‑NOT (CNOT) gates. The ancilla is initialized in \(|0\rangle\), entangled with the data qubits, measured in the computational basis, and then discarded. The outcome of the measurement—either 0 or 1—indicates the parity of the targeted qubits. Repeating this procedure for both \(S_X\) and \(S_Z\) yields a two‑bit syndrome that uniquely identifies which of the four qubits suffered an error, provided only one error occurred.
Because the ancilla measurement collapses only the ancilla state, the data qubits remain in a superposition of the logical basis states. The stabilizer eigenvalues are classical bits that do not convey any information about the logical qubits’ phase or amplitude. Consequently, after error detection the system is ready for a corrective operation that restores the intended logical state.
- Prepare ancilla qubits. For each stabilizer, initialize an ancilla in \(|0\rangle\). This ancilla will temporarily store the parity information.
- Entangle ancilla with data. Apply a sequence of CNOT gates from the data qubits to the ancilla. For the X‑type stabilizer, use CNOTs with the data qubits as controls and the ancilla as target; for the Z‑type stabilizer, reverse the roles.
- Measure ancilla. Perform a projective measurement of the ancilla in the Z basis. Record the outcome as 0 (even parity) or 1 (odd parity).
- Decode syndrome. Combine the two measurement outcomes to form a two‑bit syndrome. Map this syndrome to a specific error pattern using the code’s lookup table.
- Apply corrective gate. If the syndrome indicates an error on qubit \(i\), apply the appropriate Pauli correction (X, Y, or Z) to that qubit. For example, a syndrome of 01 might map to a Z error on qubit 3.
- Verify integrity. Optionally, re‑measure the stabilizers to confirm that the syndrome has been resolved. A zero syndrome confirms successful correction.
- Proceed with logical operation. Continue with the next logical gate or measurement, confident that the logical state has been restored.
- Repeat as needed. For long computations, periodically repeat the parity checks to guard against new errors.
This procedure was demonstrated in QubitPage’s recent QuBIOS project, where the [[4,2,2]] logical Bell pair achieved a fidelity of 97.7 % on IBM’s Heron r2 QPUs, surpassing the best physical pair at 89.7 %. The error‑detection routine is fully automated within the QLang command language, enabling rapid deployment on any supported IBM backend. For more details on the QuBIOS implementation, visit our project page.
Performance on IBM QPUs
On 7 November 2026, Qubitpage’s QuBIOS v1.2.2 ran a series of experiments on IBM’s 156‑qubit devices: ibm_fez, ibm_marrakesh, and ibm_kingston. Each device hosted a logical Bell pair encoded with the [[4,2,2]] error‑detection code. The logical pair was prepared by applying a Hadamard gate to one logical qubit, followed by a controlled‑NOT between the two logical qubits, and finally measuring the parity of the stabilizers. The resulting fidelity, calculated as the overlap with the ideal Bell state, reached 97.7 % on average across the three hardware platforms.
For comparison, the best physical Bell pair achievable on the same devices, using a single‑qubit Hadamard and a physical CNOT, yielded a fidelity of 89.7 %. This gap of 8 % demonstrates that the logical encoding not only mitigates decoherence but also improves the overall state preparation quality. The improvement is significant because it shows that a modest four‑qubit code can outperform the native hardware fidelity, effectively turning the quantum processor into a self‑correcting device for this specific task.
Experimental Procedure
Each run began with the initialization of four physical qubits per logical qubit. The stabilizer measurements were performed using ancilla qubits and a sequence of CNOTs that mapped the parity onto the ancilla. After measurement, a classical feedforward step applied a corrective phase if the parity indicated a detected error. The entire circuit consisted of 12 two‑qubit gates per logical qubit, a depth of 18, and a total execution time of approximately 10 µs, matching the coherence window of the devices.
Statistical analysis involved 10,000 shots per device. The logical Bell state was reconstructed using quantum state tomography, and the fidelity was extracted via the formula F = (1 + <σ_xσ_x> + <σ_yσ_y> + <σ_zσ_z>)/4. The error bars, derived from Poissonian shot noise, were below 0.1 %, confirming the robustness of the measurement.
Implications for Quantum Error Mitigation
Beating the physical benchmark indicates that error detection can be leveraged as a practical error‑mitigation technique on near‑term devices. The [[4,2,2]] code’s simplicity—requiring only two stabilizer checks—makes it compatible with current hardware constraints. Moreover, the logical pair’s resilience to both bit‑flip and phase‑flip errors suggests that scaling to larger codes could further close the gap between logical and physical performance.
Tip: When deploying the [[4,2,2]] code on a new IBM QPU, start by calibrating the ancilla readout fidelity, as this directly affects the parity measurement accuracy.
For more details on the QuBIOS implementation, visit the QuBIOS project page or contact the team at contact@qubitpage.com.
Comparison table: logical vs physical Bell pairs
The following table contrasts key metrics between Bell pairs generated on bare IBM QPUs and those protected by the [[4,2,2]] error‑detection code implemented in QubitPage’s QuBIOS v1.2.2. Each metric is drawn from the 7 Nov 2026 runs on ibm_fez, ibm_marrakesh, and ibm_kingston, where the logical pair achieved a fidelity of 97.7 % versus the best physical pair fidelity of 89.7 % at a 10 µs evolution time.
| Metric | Physical Bell pair | Logical [[4,2,2]] Bell pair |
|---|---|---|
| Fidelity (10 µs) | ≈ 89.7 % | ≈ 97.7 % |
| Qubit count | 2 physical qubits + 2 ancilla for measurement | 4 logical qubits + 2 ancilla for parity checks |
| Error detection capability | None during gate execution | Detects single‑qubit errors via parity checks; flags errors without correction |
| Runtime overhead | Minimal | ≈ 30 % extra gate depth for parity measurement and reset |
| Practical use case | Short‑depth demonstrations, benchmarking | Reliable entanglement for mid‑depth algorithms, educational simulations, and early‑stage quantum networking experiments |
Beyond the raw numbers, the logical pair offers a tangible advantage in environments where error rates are non‑negligible. The [[4,2,2]] code’s parity checks can be integrated into existing QubitPage workflows via the QuBIOS platform, allowing developers to wrap their circuits in a lightweight error‑detection layer without deep knowledge of stabilizer formalism. This is particularly useful for students and researchers using the QubitPage OS to prototype quantum algorithms, as the OS automatically inserts the necessary parity‑check subcircuits.
For practitioners exploring quantum networking, the logical Bell pair’s higher fidelity translates into more reliable entanglement swapping protocols. While the overhead in qubit count is modest, the trade‑off is justified when the target application demands entanglement fidelity above 95 %. The logical pair also serves as a testbed for more advanced error‑correcting codes; by scaling the [[4,2,2]] framework to a [[7,1,3]] Steane code, developers can benchmark performance gains in a controlled setting.
In summary, the logical Bell pair provides a clear fidelity edge at the cost of a small increase in qubit usage and runtime. Its error‑detection feature makes it suitable for educational purposes and early‑stage research, while its practical utility grows with the complexity of the quantum task at hand. For more details on how to integrate these logical pairs into your own projects, contact QubitPage at contact@qubitpage.com or explore the product suite on the website.
Future prospects for logical qubits
Logical qubits are the building blocks of scalable quantum processors. In the context of the [[4,2,2]] code, a logical Bell pair already outperforms its physical counterpart on current IBM QPUs. The next step is to embed these logical qubits into larger architectures that can support complex algorithms, error‑correction cycles, and inter‑device communication.
Modular quantum‑robotics platforms
Carpathron Robotics & Coding is developing modular robots that can be reconfigured on the fly. By integrating logical qubits into the robot’s control unit, each module can carry a small, fault‑tolerant quantum processor that performs real‑time decision making. The logical Bell pair can serve as a shared entanglement resource between modules, enabling distributed quantum sensing or cooperative task planning. The modularity allows a robot to swap out a faulty module without halting the entire system, a property that is difficult to achieve with purely physical qubits.
AI agents powered by logical qubits
Logical qubits also open the door to quantum‑enhanced AI agents. A logical Bell pair can be used to maintain a coherent quantum state across a network of agents, facilitating joint learning or distributed optimization. The error‑detection capability of the [[4,2,2]] code ensures that the agents can operate in noisy environments, such as on a factory floor or in a remote field deployment. The agents can leverage the logical qubits to perform small‑scale quantum machine‑learning tasks, like kernel evaluations or quantum clustering, while classical processors handle the heavy lifting of data preprocessing.
Integration with existing QubitPage tools
QubitPage’s QLang and QubitPage OS provide a user‑friendly interface for developing and testing logical qubit protocols. Researchers can prototype a logical Bell pair on the QubitPage OS, then export the circuit to the QuBIOS platform for execution on IBM hardware. The Carpathron Remote software allows remote control of the modular robots, enabling a seamless workflow from design to deployment. By combining these tools, teams can iterate quickly on logical qubit designs and assess their performance in real‑world scenarios.
Roadmap to fault‑tolerant quantum computing
Scaling from a [[4,2,2]] code to a full surface‑code architecture requires a hierarchy of logical qubits. Each logical qubit can be treated as a single node in a quantum network, connected via entanglement swapping and teleportation protocols. The logical Bell pair will serve as the entanglement backbone, ensuring that errors are detected and corrected before they propagate. This hierarchical approach aligns with the modular robotics strategy, where each robot module hosts a logical qubit that can be linked to others through a quantum network.
In the next few years, we anticipate that logical qubits will become standard components in quantum‑enabled robotics, AI agents, and distributed quantum systems. The combination of error‑detection, modularity, and existing QubitPage tooling positions the [[4,2,2]] code as a stepping stone toward fully fault‑tolerant quantum computing. For more information on how to get involved, contact QubitPage at contact@qubitpage.com.
Frequently asked questions
What is the difference between a logical qubit and a physical qubit?
A physical qubit is a single quantum two‑level system, such as a superconducting transmon on an IBM Heron r2 QPU. A logical qubit is a composite of several physical qubits encoded with an error‑correcting code; it represents a protected quantum state that can be manipulated with higher fidelity. Logical qubits hide the noise of individual hardware qubits through syndrome measurement and correction.
How does a [[4,2,2]] code detect errors?
The [[4,2,2]] code uses four physical qubits to encode two logical qubits. It measures two stabilizers that are parity checks on pairs of qubits; a single‑bit flip changes the parity and is flagged by a non‑zero syndrome. The code does not correct errors but detects any single‑qubit error, allowing the logical state to be discarded or flagged for further processing.
Why does a logical Bell pair have higher fidelity than a physical pair?
In the 7 Nov 2026 experiments on ibm_fez, ibm_marrakesh, and ibm_kingston, a [[4,2,2]] logical Bell pair achieved 97.7 % fidelity, surpassing the best physical pair at 89.7 %. The error detection removes events where a physical qubit suffered a bit‑flip, effectively conditioning the measurement on a clean logical state. This conditioning yields a logical pair that is less affected by the 10 µs noise floor that limits bare qubits.
Can logical qubits be used in everyday quantum applications?
At present, logical qubits are primarily used in research and educational contexts. The QubitPage OS provides a browser‑based desktop for learning quantum computing, but the hardware overhead of four physical qubits per logical qubit limits their practicality for routine tasks. As quantum processors scale and error rates drop, logical qubits will become more viable for larger algorithms.
What hardware is needed to implement a [[4,2,2]] code?
The code requires a quantum processor with at least four well‑connected qubits. IBM Heron r2 QPUs such as ibm_fez, ibm_marrakesh, and ibm_kingston provide the necessary connectivity and 156 qubits total, enabling the code to be run on any subset of four qubits with appropriate two‑qubit gates. The implementation also relies on classical control electronics capable of performing fast syndrome readout and conditional operations.
Why logical qubits matter for the future of quantum computing
Logical qubits built with error‑detection codes such as [[4,2,2]] shift the balance from fragile hardware to stable, scalable systems. By encoding two logical qubits into four physical ones, the code suppresses single‑qubit errors while preserving entanglement fidelity, as demonstrated on IBM Heron r2 QPUs. This approach allows researchers to run longer circuits on current devices without the overhead of full fault‑tolerance, accelerating prototype development and algorithm validation.
Practically, teams should integrate logical‑qubit workflows early: start by compiling circuits with QLang, test them on QubitPage OS, and benchmark against physical pairs. Use the 9‑qubit repetition code for noise‑sensitive subroutines, and monitor decoherence scaling with GHZ experiments to inform error‑model refinements. Document performance gains and share findings through QubitPage’s open‑source repositories, fostering community‑driven improvements.
Adopting logical qubits now positions developers to exploit upcoming hardware upgrades and to contribute to the collective knowledge base. Explore how QubitPage’s resources can guide your transition by visiting the most relevant Qubitpage page.



