---
title: "[[4,2,2]] Quantum Error-Detecting Code"
url: https://www.emergentmind.com/topics/4-2-2-quantum-error-detecting-code
type: topic
---

# [[4,2,2]] Quantum Error-Detecting Code

Searching arXiv for recent and foundational papers on the [[4,2,2]] quantum error-detecting code and closely related implementations.
arxiv_search(query="[[4,2,2]] quantum error-detecting code", max_results=10, sort_by="relevance")
Searching arXiv for the exact topic phrase.
The [[4,2,2]] quantum error-detecting code is a stabilizer code that encodes two logical qubits into four physical qubits with distance $d=2$. It is the smallest non-trivial qubit error-detecting code, and its code space is the simultaneous $+1$ eigenspace of two weight-4 stabilizers, typically $X_1X_2X_3X_4$ and $Z_1Z_2Z_3Z_4$. As a consequence, any single-qubit Pauli error anticommutes with at least one stabilizer and is therefore detected, although not corrected. Owing to its low qubit overhead, weight-2 logical operators, and simple parity-check structure, the code has been used in superconducting and trapped-ion experiments, post-selected algorithmic demonstrations, adaptive error-detection protocols without post-selection, entanglement distillation, and concatenated many-hypercube constructions [2211.04543].

## 1. Algebraic definition and logical structure

A standard presentation of the code uses four physical qubits with stabilizer generators
\[
S_X = X_1X_2X_3X_4,\qquad S_Z = Z_1Z_2Z_3Z_4.
\]
The code subspace is therefore four-dimensional and supports two logical qubits. In one widely used computational-basis representation, the logical basis is
\[
\begin{aligned}
|00\rangle_L &= \frac{|0000\rangle + |1111\rangle}{\sqrt2},\\
|01\rangle_L &= \frac{|0011\rangle + |1100\rangle}{\sqrt2},\\
|10\rangle_L &= \frac{|0101\rangle + |1010\rangle}{\sqrt2},\\
|11\rangle_L &= \frac{|0110\rangle + |1001\rangle}{\sqrt2}.
\end{aligned}
\]
In the $X$ basis, one similarly has states such as $|\pm\pm\rangle_L = (|\pm\pm\pm\pm\rangle + |\mp\mp\mp\mp\rangle)/\sqrt2$ [2503.12869].

An alternative but equivalent code-space description uses Bell states. In that formulation,
\[
|C_j\rangle \equiv |\beta_j\rangle_{12}\otimes|\beta_j\rangle_{34},\qquad j=0,1,2,3,
\]
with $\{|\beta_j\rangle\}$ the four Bell states. This representation is especially useful in entanglement-sharing constructions because it exposes a tensor-product structure across qubit pairs while preserving the same stabilizer group generated by $Z_1Z_2Z_3Z_4$ and $X_1X_2X_3X_4$ [1212.4217].

Different works adopt different convenient representatives for the logical Pauli operators under different physical-qubit labelings. In the star-topology superconducting realization, one choice is
\[
\overline X_{1} = X_3X_4,\quad
\overline Z_{1} = Z_1Z_3,\qquad
\overline X_{2} = X_2X_4,\quad
\overline Z_{2} = Z_1Z_2
\]
[2503.12869]. In the trapped-ion “Iceberg code” instantiation, a convenient choice is
\[
\bar X_{1}=X_{1}X_{t},\quad \bar Z_{1}=Z_{1}Z_{b},\qquad
\bar X_{2}=X_{2}X_{t},\quad \bar Z_{2}=Z_{2}Z_{b}
\]
[2211.06703]. In the [[4,2,2]]-encoded VQE study, the logical operators are given as
\[
X_{L,1}=X_0X_2,\quad Z_{L,1}=Z_0Z_1,\qquad
X_{L,2}=X_0X_1,\quad Z_{L,2}=Z_0Z_2
\]
[2405.03032]. These choices all commute with the stabilizers and realize the usual logical Pauli algebra within the code subspace.

The distance-$2$ property means that every single-qubit Pauli error is detectable. In the syndrome convention used in the VQE study, a single $X_j$ error produces $(s_X,s_Z)=(1,0)$, a single $Z_j$ produces $(0,1)$, and a single $Y_j=X_jZ_j$ produces $(1,1)$; runs with nonzero syndrome are discarded rather than corrected [2405.03032].

## 2. Encoding, syndrome extraction, and repeated detection cycles

The logical all-zero state is the four-qubit GHZ state
\[
|00\rangle_L=\frac{|0000\rangle+|1111\rangle}{\sqrt2}.
\]
Several works use ancilla-assisted preparations of this state. In the many-hypercube construction, a minimal fault-tolerant level-1 encoder uses one ancilla prepared in $|+\rangle$, four CNOTs from the ancilla onto the data qubits, an $X$-basis ancilla measurement that projects into the $+1$ eigenspace of $S_Z$, and then a CNOT chain with an $X$-basis measurement to ensure $S_X=+1$; the circuit is described as 1-fault tolerant because a single fault cannot produce two undetected data errors [2512.00561]. In the trapped-ion implementation, a flagged initialization circuit similarly prepares $|\overline{0}\,\overline{0}\rangle$ using one ancilla and an ordering of CNOTs chosen so that an exhaustive Pauli-fault check shows no single fault can produce an undetected logical error [2211.06703].

Syndrome extraction likewise admits several hardware-specific forms. In the trapped-ion Iceberg implementation, mid-circuit readout of $S_X$ and $S_Z$ uses two ancillas in an interleaved flagged pattern: $S_X$ is measured by preparing an ancilla in $|+\rangle$, applying CNOTs in an ordering “A B A,” and measuring in $X$; $S_Z$ is measured by preparing an ancilla in $|0\rangle$, applying CNOTs in an ordering “B A B,” and measuring in $Z$. The ordering is chosen so that a single fault on one ancilla flags the other, and any flip in $S_X$ or $S_Z$ leads to discarding the trial [2211.06703].

The star-topology superconducting realization implements one stabilizer measurement by rotating into the appropriate basis, swapping the ancilla into a central resonator, applying four resonator-data controlled-phase-like interactions, swapping back, undoing the basis change, and measuring the ancilla. A full cycle measures both stabilizers, and the two ancilla sequences are interleaved so that while one ancilla is being read out, the other can already start its first MOVE. The reported gate counts per full cycle are 12 single-qubit $\sqrt Y/\sqrt Y^\dagger$, 2 MOVE, 8 controlled-phase interactions between the resonator and data qubits, and 2 ancilla measurements [2503.12869].

In repeated error-detection protocols, the input state $\psi_{\rm in}$ is prepared so that it overlaps one codeword $\psi_{\rm target}$, with probabilistic encoding giving 50% success in the star-topology experiment. After $N$ rounds of stabilizer measurement, the run is postselected on all syndrome outcomes being $+1$ and on the final data-qubit outcome lying in the logical subspace. The accepted-run probability is defined as
\[
\eta_N \approx \frac12\,P_S^N\,P_L,
\]
where $P_S$ is the per-cycle stabilizer-pass probability and $P_L$ is the logical-subspace acceptance on final readout [2503.12869].

## 3. Fault-tolerant circuit design and architecture-aware implementations

The [[4,2,2]] code is especially attractive on architectures with high connectivity because its stabilizers have weight 4 while its logical operators can be chosen to have weight 2. In the trapped-ion “Iceberg code” construction, the [[4,2,2]] instance is the case $k=2$ of a family encoding $k$ logical qubits into $k+2$ physical qubits. A central architectural feature is that each logical two-qubit operator $\bar\sigma_i\bar\sigma_j$ has physical support on only two qubits, enabling a universal logical gate set
\[
G=\left\{\exp\!\left(-i\tfrac{\theta}{2}\bar P\right)\,\middle|\,\bar P\in\{\bar X_i\bar X_j,\bar Y_i\bar Y_j,\bar Z_i\bar Z_j\},\ \theta\in(0,2\pi)\right\}.
\]
On a trapped-ion device with all-to-all connectivity, each logical rotation compiles non-fault-tolerantly into exactly one Mølmer–Sørensen gate plus up to four single-qubit Cliffords. The paper emphasizes that both unencoded and encoded two-qubit logical rotations use a single MS gate, but in the encoded circuit only Pauli errors diagonal in $Z_pZ_q$ are undetectable, which suppresses the effective two-qubit error rate [2211.06703].

The superconducting star-topology device realizes a different hardware mapping. A single high-$Q$ superconducting resonator sits at the center of a six-leaf star and is coupled, via tunable couplers, to six transmons: four data qubits and two ancilla qubits. Because the resonator couples to all six transmons, any data qubit can interact with any ancilla by way of the central bus, and no SWAP-tree routing is required. Weight-4 stabilizer extraction is therefore implemented with only two ancilla-resonator MOVE operations per ancilla plus four controlled-phase-like interactions per stabilizer [2503.12869].

A distinct architectural direction appears in adaptive open-system simulation. There, the code is used in a post-selection-free protocol in which each detected error triggers an immediate reset of the code block into $\ket{00}_L$. If the target dissipative model already requires stochastic resets at rate $p$, the detected-error resets can be absorbed into that channel by calibrating the detection probability $p_{\rm detect}(r,t)$ and injecting additional resets at rate
\[
p_{\rm inject}(r,t)=\frac{p-p_{\rm detect}(r,t)}{1-p_{\rm detect}(r,t)}.
\]
This converts error detection into part of the intended dissipative dynamics and removes the exponential cost usually associated with post-selection [2509.25326].

## 4. Experimental performance across platforms

The code has been benchmarked in several experimentally distinct regimes.

| Setting | Reported result | Source |
|---|---|---|
| Star-topology superconducting QPU | Logical state fidelities above 96% for every cardinal logical state; logical error-per-cycle values from 0.25(2)% to 0.91(3)%; logical lifetimes above the best physical element | [2503.12869] |
| Logical Bell state in star-topology device | Initial logical fidelity $F_L=0.995$ and logical purity $p_{2,L}=0.98$; Bell-state fidelity decays with $\tau\approx400\,\mu\mathrm s$ and $\epsilon\approx0.25\%$ per cycle up to $N=15$; entanglement survives with $F_L>0.5$ | [2503.12869] |
| Trapped-ion expressive circuits and Quantum Volume | On 8 logical qubits, encoded survival remains $\approx0.6$ at 256 layers vs. $\lesssim0.1$ unencoded with global logical gates; logical Quantum Volume of $2^8$ with heavy-output frequency $>2/3$ for $m=2$ and final discard rate $\simeq87\%$ | [2211.06703] |
| Two-qubit Grover search on IBM superconducting hardware | Success probability $\approx93\%$ unencoded, $\approx96\%$ encoded, and $99.5\%$ with encoded plus measurement-error mitigation on Jakarta | [2211.04543] |
| [[4,2,2]]-encoded VQE for molecular hydrogen | Encoded + PSAP gives $-1135.89\pm0.69$ mHa at $p=0.09\%$ with success probability $99.23\%$; the estimate falls within the chemical accuracy threshold of $1.6$ mHa of the exact energy | [2405.03032] |
| Adaptive open-system simulation on Quantinuum H2 | Logical simulation achieves break-even with physical simulation for $t\le 6$ | [2509.25326] |

These results show that the code has been used in several distinct roles: as a repeated-detection logical memory, as a protection layer for expressive circuits, as a post-selected wrapper for small algorithms, and as a component of adaptive simulations that do not discard shots. The reported metrics differ across platforms, but a common pattern is that single-fault detection improves the retained logical ensemble while leaving residual undetected logical faults governed by the code’s distance-$2$ structure.

## 5. Role in concatenation, entanglement protocols, and networked settings

In the many-hypercube program, the [[4,2,2]] code appears as the $D_4$ building block. There it is explicitly described as a [[4,2,2]] CSS code with stabilizers $S_Z=Z_1Z_2Z_3Z_4$ and $S_X=X_1X_2X_3X_4$, and with level-by-level concatenation yielding
\[
D_{4,\ldots,4}=[[4^L,2^L,2^L]].
\]
The level-1 encoder uses $4$ data qubits plus $1$ ancilla, so $N^{(1)}_4=5$ qubits. The new simultaneous-detection encoder reduces the level-2 overhead from $29$ to $24$, and the level-3 overhead from $203$ to $114$; including repeats on detection failures, this becomes $\simeq60\%$ fewer qubits in practice. Under a circuit-level depolarizing model, the authors report for $D_{4,4,4}$ the fit
\[
p_{\rm block}\simeq 1.1\,p^4,\qquad p\le 10^{-3},
\]
with $p_{\rm block}\approx10^{-14}$ and $p_{\rm CNOT}\approx10^{-15}$ at $p=2\times10^{-4}$ [2512.00561].

The code also supports entanglement-centric tasks. In entanglement sharing, it yields a $(3,4)$ threshold structure: any subset of three or more of the four physical qubits can recover the two logical qubits perfectly, while any subset of size one or two cannot recover the encoded quantum state. In the entanglement-sharing variant, this means that any three players recover full entanglement with the dealer, while any one or two share no entanglement. The construction is permutation invariant, and the bound $E_R(\rho^{DP})\le 2q$ is saturated with one-qubit shares and two ebits of dealer-players entanglement [1212.4217].

In entanglement distillation and re-distillation, four noisy Bell pairs are processed into two higher-fidelity Bell pairs using measurements of the [[4,2,2]] stabilizers on each side. The protocol can either decode immediately or store the resulting four-qubit logical Bell state in memory. The same work derives closed-form expressions for the pass probability, output fidelity, and yield, with
\[
Y_{\mathrm{EDC}}=\tfrac12\,p_{\mathrm{pass}}^{\mathrm{EDC}}.
\]
Under local dephasing at rate $\Gamma=1/T_{\rm coh}$, a single Bell pair decays as
\[
F_{\Phi^+}(t)=\tfrac12\bigl(1+e^{-2\Gamma t}\bigr),
\]
whereas the logical Bell pair decays as
\[
F_L(t)=\tfrac12\bigl(1+e^{-4\Gamma t}\bigr).
\]
The reported advantage of re-distillation over BBPSSW depends primarily on classical communication delay, with threshold values of $T_{\rm cc}$ normalized to $T_{\rm coh}$ on the order of $10^{-2}$ in the benchmark scenarios studied [2509.06446].

## 6. Limitations, trade-offs, and recurrent misconceptions

The central limitation of the [[4,2,2]] code is that it is an error-detecting code, not an error-correcting code. A no-error syndrome does not imply logical correctness. The code detects any single-qubit Pauli error, but weight-2 errors can be undetected, and normalizer elements outside the stabilizer act as logical faults. In the VQE discussion, two bit-flips such as $X_iX_j$ are explicitly noted to be undetected and may map one logical basis state to another [2405.03032]. In the entanglement-distillation setting, multi-qubit errors that commute with both stabilizers are described as the protocol’s residual error floor [2509.06446].

A second trade-off is post-selection overhead. In repeated-detection experiments the accepted-run probability decays approximately as
\[
\eta_N\simeq \tfrac12\,P_S^N\,P_L.
\]
The star-topology experiment reports representative values $P_S\approx0.67$ and $P_L\approx0.87$, which makes acceptance exponentially sensitive to the number of cycles [2503.12869]. In trapped-ion logical Quantum Volume, the reported heavy-output frequency improvement for $m=2$ comes with a final discard rate $\simeq87\%$ [2211.06703]. A common misconception is therefore that the code is only useful when heavy post-selection is acceptable. The adaptive-circuit work shows that this is not universally true: detected errors can be converted into intended random resets, avoiding post-selection entirely in that setting [2509.25326].

A third limitation concerns ancilla-induced fault channels. In the variational quantum machine learning study, the [[4,2,2]] code improves training accuracy only when the ancilla error rate remains below a threshold,
\[
p_{\rm anc}\lesssim 0.003 \quad \text{(gate-noise model)},\qquad
p_{\rm anc}\lesssim 0.004 \quad \text{(environmental-noise model)}.
\]
Above those values, ancilla errors propagated through the logical-rotation and syndrome-extraction circuits outweigh the benefits of discarding detected faults, and the maximum achievable accuracy saturates below unity [2504.06775]. This suggests that, for NISQ applications, the usefulness of the [[4,2,2]] code depends not only on the distance-$2$ detection property itself but also on whether the chosen hardware and compilation strategy keep ancilla-mediated error propagation sufficiently small.

Taken together, these limitations explain the code’s characteristic niche. The [[4,2,2]] code is not a substitute for full fault-tolerant error correction, but it is a compact and experimentally practical primitive for detecting single-qubit faults, studying logical-state behavior, benchmarking architecture-aware stabilizer extraction, and bootstrapping higher-level constructions such as concatenated high-rate codes and LOCC-based entanglement protocols [2512.00561].

Source: https://www.emergentmind.com/topics/4-2-2-quantum-error-detecting-code