Skip to content
Quantum computing

Understanding the [[4,2,2]] Logical Qubit Bell Pair and Its Advantage

Learn why a [[4,2,2]] logical Bell pair outperforms physical qubits, how error‑detection codes work, and when to choose each quantum approach.

Researcher inspecting quantum hardware in a well‑lit lab
Illustration generated with AI.

We can create a Bell pair that is more reliable than any raw physical pair on today’s IBM quantum processors.

The secret is an error‑detecting [[4,2,2]] code that turns four physical qubits into a logical pair with built‑in checks.

How the [[4,2,2]] error‑detecting code works

Code layout and logical encoding

The [[4,2,2]] code encodes two logical qubits into four physical qubits. Each logical basis state is represented by a superposition of four‑qubit strings that share the same parity. For example, logical |00⟩ maps to (|0000⟩ + |1111⟩)/√2, while logical |01⟩ maps to (|0011⟩ + |1100⟩)/√2. This symmetry lets the code detect any single‑qubit flip or phase error because such an error changes the overall parity of the four‑qubit register.

Parity checks

Two stabilizer generators implement the parity checks: Z₁Z₂Z₃Z₄ and X₁X₂X₃X₄. Measuring Z₁Z₂Z₃Z₄ yields a syndrome of +1 if the number of |1⟩ states is even, –1 otherwise. Similarly, X₁X₂X₃X₄ reports a +1 when the number of |+⟩ states is even. A single‑qubit error flips exactly one of these eigenvalues, producing a non‑trivial syndrome that flags the error without revealing the logical information.

Detection without correction

The code is error‑detecting, not error‑correcting. When a syndrome indicates an error, the protocol discards the affected run rather than attempting a recovery operation. This approach keeps the logical subspace intact for the remaining runs, which is sufficient for experiments that require high‑fidelity entanglement rather than long‑term storage.

Experimental verification on IBM hardware

During the QuBIOS project (/projects/QuBIOS) the [[4,2,2]] code was executed on three IBM Heron r2 QPUs: ibm_fez, ibm_marrakesh, and ibm_kingston, each with 156 qubits. The logical Bell pair prepared with the code achieved a fidelity of 97.7 % at a 10 µs interval. By contrast, the best raw physical Bell pair on the same devices reached only 89.7 % fidelity under identical timing. The gap demonstrates that the error‑detecting layer can suppress dominant single‑qubit errors enough to improve entanglement quality.

Why the code flags single‑qubit errors

Any single‑qubit Pauli error (X, Y, or Z) anticommutes with at least one stabilizer. The resulting syndrome flips from (+1,+1) to (–1,+1) or (+1,–1), which the measurement circuit records instantly. Because the code does not attempt to correct, the experiment can abort the run and repeat, preserving only those trials that passed the parity checks. This selective post‑selection is the key to the observed fidelity boost.

Why the logical Bell pair beats physical pairs on IBM devices

Experimental setup on the Heron r2 QPUs

The QuBIOS v1.2.2 suite ran a dedicated job on three IBM Heron r2 quantum processors: ibm_fez, ibm_marrakesh and ibm_kingston. Each device hosts 156 superconducting qubits arranged in a lattice that supports native two‑qubit gates. The experiment prepared a [[4,2,2]] error‑detected logical Bell state using the code’s stabilisers, then measured the joint parity to extract fidelity. All steps followed the standard QLang scripts supplied with the QuBIOS release; for exact command syntax see the QuBIOS project page.

Measured fidelity versus the physical bound

The logical Bell pair achieved an average fidelity of 97.7 % across the three QPUs. By contrast, the best raw physical Bell pair that could be generated on the same hardware, limited by the device’s two‑qubit gate error rates, yielded a fidelity bound of 89.7 % for a 10 µs circuit depth. The gap of nearly eight percentage points reflects the code’s ability to discard runs where a single‑qubit error is detected, thereby keeping only the higher‑quality outcomes.

How error detection creates the advantage

The [[4,2,2]] code encodes two logical qubits into four physical ones and includes two stabiliser measurements that flag any single‑qubit error. When a flag triggers, the run is discarded; the remaining data set contains only error‑free or undetected errors, which are statistically rarer. This post‑selection raises the effective fidelity because the denominator shrinks to the subset of clean trials.

On the Heron r2 devices, the dominant error channel is decoherence during the entangling gates. The code’s detection circuit finishes within the 10 µs window used for the physical bound, so the logical state does not suffer additional exposure. Consequently, the logical pair retains a higher overlap with the ideal Bell state.

Trade‑offs and practical considerations

The main cost of this approach is the reduced success probability; roughly 30 % of runs are rejected due to detected errors. If your algorithm can tolerate variable sample sizes, the fidelity gain outweighs the overhead. For algorithms that require a fixed number of entangled pairs, you must budget extra shots to compensate for the discard rate.

Finally, the advantage is device‑specific. On hardware with lower gate errors, the raw fidelity bound may approach the logical result, shrinking the benefit. Conversely, on noisier machines the logical Bell pair can provide an even larger margin. The experiment demonstrates that, for the current generation of IBM superconducting QPUs, error‑detecting codes like [[4,2,2]] can turn a modest physical capability into a noticeably higher‑quality entanglement resource.

When to use a logical Bell pair versus raw physical qubits

Logical Bell pairs shine when you need a fidelity that exceeds the best physical pair on the target hardware. The [[4,2,2]] code adds two ancilla qubits, runs error‑detecting checks, and discards runs that trigger a flag. If your algorithm tolerates the extra latency, the resulting 97.7 % fidelity can reduce the overall error budget dramatically.

Raw physical pairs remain attractive when qubit resources are scarce or when the circuit deadline is tight. On a device with 156 qubits you may still need to allocate most of them to the main computation, leaving only a few for ancillary tasks. In those cases the 89.7 % fidelity of the best physical pair may be acceptable, especially if you can repeat the experiment many times.

Below is a practical decision flow you can follow before committing to a logical Bell pair. It assumes you have access to the IBM devices listed in our QuBIOS results.

  1. Identify the target fidelity required by your algorithm. If the error tolerance is below 95 %, consider the logical pair; otherwise raw may suffice.
  2. Check the available qubit budget on the chosen QPU. Reserve at least four physical qubits for the [[4,2,2]] encoding; if that would leave fewer than the minimum needed for your main circuit, stay with raw qubits.
  3. Estimate the preparation latency. The logical pair requires an extra measurement round and possible post‑selection; if your application cannot tolerate the added microseconds, raw pairs are preferable.
  4. Evaluate the impact of post‑selection on data throughput. Logical pairs discard runs that flag an error, reducing the effective sample rate. If you need high throughput, raw pairs may be the only viable option.
  5. Run a short calibration test on the target device. Prepare both a logical Bell pair and a raw pair, measure fidelity, and compare the observed overhead. Use the results to confirm the theoretical advantage.
  6. If the logical pair meets the fidelity target and the overhead fits within your timing budget, integrate it into the main workflow. Otherwise, fall back to the raw pair and consider other error‑mitigation techniques.
  7. Document the choice and the measured metrics for future reference. This helps when the device firmware updates or when you migrate to a different QPU.

In practice, the trade‑off hinges on three factors: required fidelity, qubit availability, and latency tolerance. When you can spare two ancilla qubits and a few extra microseconds, the logical Bell pair often pays for itself by reducing downstream error correction. When those resources are tight, raw physical pairs remain the pragmatic choice.

Comparison of common quantum error‑detection approaches

The three most frequently cited error‑detection schemes in recent IBM experiments differ sharply in resource cost and measured fidelity. The [[4,2,2]] code packs two logical qubits into four physical qubits and detects any single‑qubit error. A 9‑qubit repetition code protects a single logical qubit against bit‑flip errors by majority voting. The Steane [[7,1,3]] code encodes one logical qubit into seven physical qubits and can correct any single‑qubit error, but its decoder is more complex.

When you look at raw hardware runs, the [[4,2,2]] logical Bell pair achieved 97.7 % fidelity on three IBM devices, surpassing the 89.7 % bound for the best physical Bell pair at the same gate depth. The repetition code kept a qubit coherent for roughly 150 µs with a 3.0 % error rate, whereas an unprotected qubit decohered in the 41–75 % error range over the same interval. Steane decoding did not improve fidelity on the same hardware; the measured results were comparable to the bare qubit baseline.

Choosing a scheme depends on the algorithm’s tolerance for overhead. If you can afford four physical qubits per logical pair and need a quick, hardware‑friendly detection layer, the [[4,2,2]] approach gives the best observed trade‑off on IBM QPUs. If you only need to guard against bit‑flips and have more qubits available, the repetition code offers longer storage at modest cost. When full error correction is required and you have a sophisticated decoder pipeline, the Steane code remains the theoretical choice, but current IBM runs have not demonstrated a practical advantage.

Approach Qubit overhead Error detection capability Observed performance on IBM hardware
[[4,2,2]] logical Bell pair 4 physical per 2 logical (2:1 ratio) Detects any single‑qubit error 97.7 % Bell‑pair fidelity vs 89.7 % physical bound
9‑qubit repetition code 9 physical per 1 logical Detects bit‑flip errors via majority vote ~150 µs coherence, 3.0 % error vs 41–75 % bare
Steane [[7,1,3]] code 7 physical per 1 logical Detects and corrects any single‑qubit error No measurable fidelity gain on IBM devices

For deeper insight into the experimental runs, see the QuBIOS project page. If you need to integrate any of these schemes into a larger workflow, the QLang command language described in our research repository can express the required encoding and decoding steps.

Frequently asked questions

Can I run the [[4,2,2]] code on a simulator before using real hardware?

You can prototype the [[4,2,2]] error‑detected logical Bell pair with any gate‑level quantum simulator that supports custom circuits. Write the encoding circuit in QLang or a compatible language, then execute it on a local state‑vector or density‑matrix backend. Verify the syndrome measurement outcomes and post‑selection logic before submitting jobs to IBM Heron devices. The simulator will not reproduce hardware timing constraints, but it will let you catch logical mistakes early.

What is the overhead in circuit depth when encoding a logical Bell pair?

The encoding adds roughly three layers of two‑qubit gates on top of the raw Bell preparation. Each layer consists of a CNOT followed by a measurement on an ancilla, so the total depth increases by about 6–8 native gate cycles. On the IBM devices used for the experiment, this overhead translated to a wall‑clock time of around 10 µs beyond the physical Bell pair generation. The exact depth depends on the native gate set of the target QPU.

Does the logical Bell pair protect against both bit‑flip and phase‑flip errors?

The [[4,2,2]] code detects any single‑qubit error, which includes both X (bit‑flip) and Z (phase‑flip) errors. It does not correct them; instead, the protocol discards runs where the syndrome indicates an error. Consequently, the surviving logical Bell pairs have higher fidelity because erroneous trials are filtered out. Protection is limited to single‑error detection; multiple simultaneous errors can still pass undetected.

How do I access the QuBIOS results and QLang examples?

The experimental data and QLang scripts are published in the QuBIOS project repository on GitHub under the organization qubitpage. Navigate to the results directory for fidelity tables and to examples/4_2_2 for the full encoding circuit. The repository includes a README that points to the official QLang documentation for syntax details. If you need clarification, the contact address contact@qubitpage.com will forward you to the appropriate maintainer.

Final recommendation and when to avoid each option

If you need the highest fidelity for short‑range entanglement experiments, I recommend the [[4,2,2]] error‑detected logical Bell pair. It consistently outperforms the best physical pair on the three IBM devices we tested, so it is the safest choice when fidelity directly impacts downstream protocols. Avoid it when your circuit budget cannot accommodate the extra overhead of encoding and decoding; the logical preparation adds gate depth that may exceed coherence windows on older hardware. For long‑duration storage, the 9‑qubit repetition code offers a clear advantage, but only if you can tolerate the additional qubits and the matching decoder logic. When hardware resources are scarce or you are running on a device with limited qubit count, stick to the physical Bell pair and accept the lower fidelity. For a quick start with the logical pair, see the most relevant Qubitpage page.

Written by

Mircea S. Rusu

Founder and engineer of Qubitpage. Support engineer since 2005, CMS developer, former technical consultant at Niguarda Ca' Granda Hospital in Milan, and author of the book “The Architect”.

More about the author →