---
title: Four-Qubit Iceberg Code Overview
url: https://www.emergentmind.com/topics/four-qubit-iceberg-code
type: topic
---

# Four-Qubit Iceberg Code Overview

The Four-Qubit Iceberg Code is the four-physical-qubit, two-logical-qubit member of the Iceberg family of quantum error-detecting stabilizer codes, obtained by specializing \([[k+2,k,2]]\) to \(k=2\), equivalently \([[n,n-2,2]]\) at \(n=4\), or \([[2m,2m-2,2]]\) at \(m=2\). In all of these parameterizations the code is \([[4,2,2]]\): it encodes \(2\) logical qubits into \(4\) physical qubits, has distance \(2\), detects any single-qubit error, and is used primarily in detection-and-discard protocols rather than full single-error correction [2211.06703][2604.09956][2604.13219]. Earlier literature studied the same \([[4,2,2]]\) stabilizer code without the “Iceberg” name; in particular, the magic-state distillation paper on \(\mathcal C_4\) explicitly does not mention “Iceberg,” while later work identifies the four-qubit Iceberg code directly with the \([4,2,2]\) code [1204.4221][2605.15344].

## 1. Terminology and identification

The terminology “Iceberg code” originates in trapped-ion-oriented work that defines a family of stabilizer codes with parameters \([[k+2,k,2]]\) for even \(k\), labels two special qubits as \(t\) and \(b\), and emphasizes that many logical operators have support on only two physical qubits [2211.06703]. Within that family, the four-qubit case is the smallest nontrivial instance, since \(k=2\) gives \([[4,2,2]]\) [2504.21172].

The same four-qubit object appears in older and parallel literature under other names. In the magic-state distillation literature it is the four-qubit error-detecting code \(\mathcal C_4\), a \([[4,2,2]]\) stabilizer code with stabilizers \(XXXX\) and \(ZZZZ\), used operationally as an ordinary stabilizer code rather than as a subsystem code [1204.4221]. In the “Fire and ice” architecture it is again the \([4,2,2]\) code, now explicitly called the “four-qubit Iceberg code,” and used as the inner code of larger concatenated CSS constructions [2605.15344].

The nomenclature is not universal across four-qubit coding theory. The classification paper on four-qubit pure codes does not use the term “Iceberg code,” but it proves that every four-qubit pure code is local-unitarily equivalent to a subspace of the unique \(((4,4,2))_2\) code, realized as the simultaneous \(+1\) eigenspace of \(X^{\otimes 4}\) and \(Z^{\otimes 4}\) [2507.02185]. By contrast, a four-qubit deletion-correcting code and a four-qubit amplitude-damping code are different constructions whose papers explicitly do not use the term “Iceberg code” [2001.08405][2411.12952].

## 2. Stabilizer definition, logical structure, and basis states

In the Iceberg presentation, the four physical qubits are labeled \(t,b,1,2\), where \(t\) and \(b\) are “top” and “bottom” qubits. The stabilizer generators are the two global parity operators
\[
S_z = Z_t Z_b Z_1 Z_2,\qquad S_x = X_t X_b X_1 X_2.
\]
Because there are \(4\) physical qubits and \(2\) independent stabilizer generators, the codespace has dimension \(2^{4-2}=2^2\), so the code indeed encodes \(2\) logical qubits [2504.21172].

A standard logical Pauli choice in the Iceberg family is
\[
\overline X_i = X_t X_i,\qquad \overline Z_i = Z_i Z_b,\qquad i\in\{1,2\},
\]
so that, explicitly,
\[
\overline X_1 = X_tX_1,\quad \overline X_2 = X_tX_2,\quad \overline Z_1 = Z_1Z_b,\quad \overline Z_2 = Z_2Z_b.
\]
The literature also emphasizes stabilizer-equivalent representative freedom. For the four-qubit case, one may equally use
\[
\overline Z_1 = Z_1 \sim Z_t Z_b Z_2,\qquad \overline Z_2 = Z_2 \sim Z_t Z_b Z_1,
\]
and this flexibility is operationally important because different representatives correspond to different hardware-efficient gate realizations [2504.21172]. In the earlier \(\mathcal C_4\) notation, one valid logical choice is
\[
\bar{X}_1=X\otimes X\otimes I\otimes I,\quad
\bar{Z}_1=Z\otimes I\otimes I\otimes Z,
\]
\[
\bar{X}_2=X\otimes I\otimes I\otimes X,\quad
\bar{Z}_2=Z\otimes Z\otimes I\otimes I,
\]
again illustrating that the same \([[4,2,2]]\) code admits multiple logical coordinate systems [1204.4221].

A convenient encoded computational basis, in the qubit ordering \((t,b,1,2)\), is
\[
|\overline{00}\rangle = \frac{1}{\sqrt 2}\bigl(|0000\rangle + |1111\rangle\bigr),
\]
\[
|\overline{01}\rangle = \frac{1}{\sqrt 2}\bigl(|0011\rangle + |1100\rangle\bigr),
\]
\[
|\overline{10}\rangle = \frac{1}{\sqrt 2}\bigl(|0101\rangle + |1010\rangle\bigr),
\]
\[
|\overline{11}\rangle = \frac{1}{\sqrt 2}\bigl(|0110\rangle + |1001\rangle\bigr),
\]
up to relabeling conventions for the physical qubit order [2504.21172]. The all-logical-zero state of the general Iceberg family is an \(n\)-qubit GHZ state; for \(n=4\),
\[
|\overline{0}\rangle^{\otimes 2}
=
\frac{1}{\sqrt{2}}\left(|0000\rangle+|1111\rangle\right),
\]
which matches the first basis vector above [2211.06703].

From a structural viewpoint, the code is the simultaneous \(+1\) eigenspace of \(X^{\otimes 4}\) and \(Z^{\otimes 4}\). The classification result that the unique \(((4,4,2))_2\) code has basis
\[
|0000\rangle+|1111\rangle,\;
|0011\rangle+|1100\rangle,\;
|0101\rangle+|1010\rangle,\;
|0110\rangle+|1001\rangle
\]
places the four-qubit Iceberg code within a canonical four-qubit pure-code normal form [2507.02185].

## 3. Symmetry, transversal structure, and encoded operations

A central symmetry of the \([[4,2,2]]\) code is exchange of \(X\) and \(Z\). In the \(\mathcal C_4\) formulation, this implies that \(H^{\otimes 4}\) is a valid encoded gate, and, for the logical Pauli choice used there, it acts as a logical Hadamard on both encoded qubits followed, or equivalently preceded, by a logical SWAP:
\[
H^{\otimes 4} \sim \bar H_1 \bar H_2 \,\overline{\mathrm{SWAP}}_{12}.
\]
This transversal Hadamard property is the key ingredient behind the code’s use in Hadamard-eigenstate distillation [1204.4221].

The later Iceberg literature emphasizes a broader family-wide gate structure. Logical single-qubit \(X\)-rotations are implemented as physical two-qubit rotations,
\[
e^{-i\theta \overline{X}_i} \mapsto e^{-i\theta X_t X_i},
\]
and many multi-logical operators also have two-body physical representatives. In particular, for the family one has identities such as
\[
\bigotimes_{j\in[k]} \overline X_j = X_t X_b,\qquad
\bigotimes_{j\in[k]} \overline Z_j = Z_t Z_b.
\]
For \(k=2\), these are simply the two-logical-qubit products of the four-qubit code [2211.06703]. The same hardware orientation appears in the QAOA co-compilation work, which uses
\[
\overline X_1 = X_tX_1 \sim X_bX_1,\qquad
\overline X_2 = X_tX_2 \sim X_bX_2,
\]
to reduce circuit depth by allowing logical mixer rotations to be routed through either the top or bottom hub qubit [2504.21172].

This low-weight logical structure directly affects compilation. In the four-qubit-patch compiler, targeted \(H\) is expensive—\(7\) one-qubit gates and \(4\) two-qubit gates, at depth \(8\)—whereas the patch-wise operation \(HH\) costs only \(4\) one-qubit gates at depth \(1\). Likewise, for logical CNOT the compiler distinguishes intra-patch, inter-patch, and transversal implementations with costs \((4\) two-qubit gates, depth \(4)\), \((4\) two-qubit gates, depth \(3)\), and \((4\) two-qubit gates, depth \(1)\), respectively [2604.09956]. This asymmetry makes Hadamard commutation, gate merging, and qubit-pair assignment central to practical use of the code.

## 4. Error-detecting behavior and fault-tolerant gadgets

The four-qubit Iceberg code has distance \(2\). It can detect any single-qubit error, but cannot in general correct an arbitrary single-qubit error, because distance \(2\) implies detect-and-discard rather than full correction-and-continue [2504.21172]. Concretely, any single-qubit Pauli error anticommutes with at least one stabilizer: a \(Z_q\) error anticommutes with \(S_x\), an \(X_q\) error anticommutes with \(S_z\), and a \(Y_q\) error anticommutes with both [2504.21172]. Conversely, some weight-2 operators commute with both stabilizers and act as logical operators, which is exactly why the code distance is \(2\) rather than \(3\) [1204.4221].

The operational mode is therefore postselection. Error detection is performed by measuring the global stabilizers \(S_z\) and \(S_x\), or by running a gadget that extracts their syndromes onto ancillas; on detection of an error, the circuit execution is discarded [2504.21172]. In the trapped-ion implementation, the initialization and syndrome-measurement circuits are fault tolerant in the sense that there is no single component whose failure produces an undetectable logical error. The syndrome-measurement circuit uses two ancillas to separately read out the two stabilizers, arranged so that the ancillas act as flag qubits to each other. At final readout, \(S_Z\) can be reconstructed from destructive computational-basis measurement of all physical qubits, while \(S_X\) is extracted immediately before final readout [2211.06703].

Later work refined these gadgets. For the \(k=2\) code, the new initialization, syndrome, and final-measurement gadgets reduce two-qubit depth from
\[
\text{init: } 5 \to 4,\qquad
\text{syndrome: } 8 \to 4,\qquad
\text{final measurement: } 6 \to 5.
\]
The improved syndrome gadget is valid only when \(n=k+2\) is a multiple of \(4\), and the four-qubit code is the smallest case satisfying that condition [2504.21172].

These features explain both the attractiveness and the limitation of the code. It satisfies the distance-2 fault-tolerance criterion used in the Iceberg literature—“no single component failure results in an undetectable logical error”—yet it remains an error-detecting code, so rejection rates can dominate if the physical circuit or the ancilla factory is poorly compiled or too deep [2504.21172][2605.15344].

## 5. Role in magic-state distillation

Before the “Iceberg” nomenclature, the four-qubit \([[4,2,2]]\) code was used as \(\mathcal C_4\) in a 10-to-2 routine for distilling the \(+1\) eigenstate of Hadamard,
\[
|H\rangle=\cos\!\left(\frac{\pi}{8}\right)|0\rangle+\sin\!\left(\frac{\pi}{8}\right)|1\rangle.
\]
Each round uses \(10\) input \(|H\rangle\)-type resource states: \(2\) data states to be distilled and \(8\) gate states consumed to implement four controlled-\(H\) gates [1204.4221].

Operationally, the protocol encodes two noisy \(H\)-type magic states into \(\mathcal C_4\), performs an encoded measurement of \(\bar H_1\bar H_2\), decodes and measures the syndrome, and accepts only if both the encoded measurement and the syndrome measurement indicate no error [1204.4221]. The transversal Hadamard property of the code, together with a circuit simplification using the logical SWAP relation, reduces the encoded measurement to four physical controlled-\(H\) gates rather than a larger naïve construction [1204.4221].

Under the Hadamard-basis-twirled noise model,
\[
\mathcal H(\rho)=\frac12 \rho+\frac12 H\rho H^\dagger
\]
with stochastic \(Y\) error probability \(p\), the exact acceptance probability is
\[
a(p)= 1 - 10 p + 58 p^2 - 192 p^3 + 400 p^4 - 544 p^5 + 480 p^6 - 256 p^7 + 64 p^8,
\]
the marginal undetected-error probability on one output is
\[
u(p)=9 p^2 - 56 p^3 + 160 p^4 - 256 p^5 + 240 p^6 - 128 p^7 + 32 p^8,
\]
and the conditional marginal output error rate is
\[
e(p)=\frac{u(p)}{a(p)}=9p^2+O(p^3).
\]
The threshold defined by \(p_t=e(p_t)\) is
\[
p_t=0.089.
\]
The paper explicitly contrasts this with the 15-to-1 Bravyi–Kitaev routine: the four-qubit-code routine has lower threshold but lower overhead, gives \(p\mapsto O(p^2)\) rather than \(O(p^3)\), and can reduce overhead by up to about an order of magnitude in practical combined-distillation regimes [1204.4221].

This distillation application is historically important because it shows the four-qubit code in a role that already exhibits the later Iceberg themes: strong \(X/Z\) symmetry, transversal Hadamard structure, single-fault detectability, and aggressive overhead optimization through postselection.

## 6. Concatenation, selective filtering, and higher-distance descendants

The four-qubit Iceberg code is not only a stand-alone detector; it is also an inner code in concatenated high-rate architectures. In the “Fire and ice” construction, if the outer code is an \([n,k,d]_4\) ququad code, then concatenation with the four-qubit Iceberg code gives
\[
[n,k,d]_4 \circ [4,2,2] \mapsto [4n,2k,2d].
\]
This is the central structural formula behind a family of compact self-dual CSS codes [2605.15344]. The flagship example takes the five-qubit Laflamme code \([5,1,3]\), maps it to a \([5,1,3]_4\) CSS code, and concatenates with the four-qubit Iceberg code to obtain a \([20,2,6]\) code [2605.15344].

The architectural motivation is explicit. Because a four-qubit Iceberg block encodes two logical qubits, ququad outer-code symbols are realized naturally as single inner blocks. This enables efficient encoded-state preparation through what the paper calls the “paired support” property, while preserving CSS structure and doubling distance under concatenation [2605.15344]. The resulting family includes \([20,2,6]\) and \([36,2,8]\), supports transversal Clifford structure, and uses selective filtering rather than full circuit-level fault tolerance.

The same paper is equally explicit about the limitation: the full scheme is “explicitly not fault tolerant,” and low-order malignant faults can produce undetected logical errors in ancilla-preparation networks [2605.15344]. For even-distance codes with postselection it states
\[
p_L \sim c\, p^{d/2+1},\qquad p_R \sim c' p^{d/2},
\]
where \(p_L\) is logical error conditioned on acceptance and \(p_R\) is rejection probability [2605.15344]. For the bare \([4,2,2]\) Iceberg code, the rejection overhead is particularly severe: at \(p=0.004\),
\[
p_R/p_L = 722^{+26}_{-25},
\]
and the ratio is even larger at smaller \(p\), which is why the code is mainly valuable there as an inner code rather than as the final computational code [2605.15344].

The Helios iceberg-QED/QEC work makes the same point in a different language. It defines \(I\{k\}\) as the \([[k+2,k,2]]\) iceberg family and shows that
\[
I\{2\}\circ I\{2\}=[[16,4,4]]
\]
is the concatenated distance-4 descendant of the four-qubit block [2602.22211]. For 4 logical qubits, increasing distance from 2 to 4 by concatenation raises average acceptance rate per cycle from
\[
0.945(2)\ \text{to}\ 0.972^{+1}_{-2},
\]
while the corresponding infidelities,
\[
<4\times10^{-5}\quad\text{and}\quad 2^{+8}_{-2}\times10^{-5},
\]
are statistically indistinguishable [2602.22211]. A plausible implication is that, in practical regimes, the four-qubit code’s most scalable role is as a primitive layer in higher-distance postselected architectures.

## 7. Compilation, hardware demonstrations, and practical scope

The Iceberg framework is tailored to trapped-ion hardware with all-to-all connectivity and native high-fidelity two-qubit entangling gates. The original Iceberg paper demonstrated protection of circuits of \(8\) logical qubits with up to \(256\) layers, saturated the logical quantum volume of \(2^8\), and argued that increasing the frequency of syndrome measurements within the circuit positively affects performance [2211.06703]. Although these are not four-qubit-only experiments, they establish the operational context in which the four-qubit code functions as the minimal building block.

The co-compilation work sharpened this hardware perspective by treating the entire \([[k+2,k,2]]\) Iceberg family as a flexible compilation object and specializing many of its claims to the four-qubit case. It showed that the fault-tolerant gadgets are not rigid, that their implicit qubit order can be permuted without breaking fault tolerance, and that co-optimizing QAOA circuits with Iceberg gadgets improves success probability from \(44\%\) to \(65\%\) and post-selection rate from \(4\%\) to \(33\%\) at \(22\) algorithmic qubits, while enabling better-than-unencoded performance up to \(34\) algorithmic qubits [2504.21172]. In that work, the four-qubit Iceberg code is presented as the smallest member that already contains the essential ingredients of the framework: two global stabilizers, weight-2 logical operators, ancilla-assisted syndrome extraction, postselection, and representative freedom.

Subsequent experimental work demonstrated “above break-even” error detection with the Iceberg family on trapped-ion hardware. For Bell-state circuits, which are especially natural for a two-logical-qubit \([[4,2,2]]\) block, encoded postselected fidelities exceeded baseline in several runs; for the “Transversal-\(H\) Bell State” circuit, the non-fault-tolerant encoded implementation reached \(99.24\%\) versus \(97.85\%\) in one run, while the fault-tolerant version reached \(98.70\%\) versus \(97.85\%\) in another, at the cost of substantial detected-error rates [2604.13219]. The same paper stresses that the practical success of small Iceberg codes depends not only on encoding but also on code-aware compilation, especially exploiting cheap transversal \(H\) where possible [2604.13219].

That compilation problem was then addressed directly for the four-qubit Iceberg patch. Across \(71\) benchmark circuits, logical compilation for \([[4,2,2]]\) patches reduced circuit depth by \(34\%\), one-qubit and two-qubit gate counts by up to \(31\%\) and \(17\%\), improved total variation distance by \(1.75\times\), and improved logical selection rate by an average of \(86\%\) relative to naïve compilation [2604.09956]. In that framework, the central optimization problem is pairing program qubits into two-logical-qubit patches so as to expose cheap patch-wise operations such as \(HH\), \(XX\), and \(ZZ\), while also allowing inter-patch or transversal implementations when they are cheaper [2604.09956].

Taken together, these results delimit the practical scope of the four-qubit Iceberg code. It is extremely small, structurally symmetric, and compilation-sensitive; it supports unusually compact logical operations and efficient postselected filtering; but by itself it is only a distance-2 detector, so rejection overhead can be high and long computations typically motivate concatenation or larger descendants [2211.06703][2605.15344][2604.09956]. In that sense, the Four-Qubit Iceberg Code is best understood both as a concrete \([[4,2,2]]\) stabilizer code and as the canonical elementary block of a wider high-rate, postselected, trapped-ion-oriented coding architecture.

Source: https://www.emergentmind.com/topics/four-qubit-iceberg-code