\([[4,2,2]]\) CSS code[1,2] 

Also known as \(C_4\) code.


Four-qubit CSS stabilizer code is the smallest qubit stabilizer code to detect a single-qubit error. Admits generators \(\{XXXX, ZZZZ\} \) and codewords \begin{align} \begin{split} |\overline{00}\rangle = (|0000\rangle + |1111\rangle)/\sqrt{2}~{\phantom{.}}\\ |\overline{01}\rangle = (|0011\rangle + |1100\rangle)/\sqrt{2}~{\phantom{.}}\\ |\overline{10}\rangle = (|0101\rangle + |1010\rangle)/\sqrt{2}~{\phantom{.}}\\ |\overline{11}\rangle = (|0110\rangle + |1001\rangle)/\sqrt{2}~. \end{split} \tag*{(1)}\end{align} This code is the smallest instance of the toric code, and its various single-qubit subcodes are small planar surface codes.

The subcode \(\{|\overline{00}\rangle,|\overline{01}\rangle\}\) is a \([[4,1,2]]\) code [3], whose \(\pm\)-basis codewords can be written as \begin{align} |\overline{\pm}\rangle = \frac{1}{2}(|00\rangle \pm |11\rangle)^{\otimes 2}~.\tag*{(2)}\\ \end{align} This code can be thought of as a concatenation of a two-qubit bit-flip with a two-qubit phase-flip code. The subcode \(\{|\overline{10}\rangle,|\overline{11}\rangle\}\) [4] has also been studied against amplitude-damping noise. This subcode [5] and the subcodes \(\{|\overline{00}\rangle,|\overline{10}\rangle\}\) [6], \(\{|\overline{00}\rangle,|\overline{01}\rangle\}\) [7], and \(\{|\overline{00}\rangle,|\overline{11}\rangle\}\) [8] are small planar surface codes.


Detects a single-qubit error [1] or single erasure [2]. Not able to correct arbitrary single-qubit errors because \( \lfloor \frac{d-1}{2} \rfloor =0 \). Approximately corrects a single amplitude damping error [3].

Transversal Gates

Transversal Pauli, Hadamard, and two-qubit \(R\) [9]. A transversal \(CZ\) gate is realized by the rotation \(\sqrt{Z}\otimes\sqrt{Z}^{\dagger}\otimes\sqrt{Z}^{\dagger}\otimes\sqrt{Z}\).

Fault Tolerance

Preparation of certain states, both magic and non-magic, along with transversal gates can be performed fault-tolerantly, but requires post-selection because the code cannot correct errors [9].


\([[4,1,2]]\) subcode implemented using four-qubit graph state of photons [10].Trapped-ion device by IonQ [11].Logical state preparation and flag-qubit error correction realized in superconducting-circuit devices by IBM [12,13].The subcode \(\{|\overline{00}\rangle,|\overline{10}\rangle\}\) [6] and \(\{|\overline{00}\rangle,|\overline{01}\rangle\}\) [7], treated as a planar surface code, has been realized in superconducting-circuit devices.Logical gates between two copies of the subcode \(\{|\overline{10}\rangle,|\overline{11}\rangle\}\), interpreted as lattice surgery between planar surface codes, realized in superconducting circuits [5].Logical gates for the \(\{|\overline{00}\rangle,|\overline{11}\rangle\}\) subcode, treated as a planar code, realized in superconducting circuits [8].The CZ magic state has been realized on an IBM heavy-hex superconducting circuit device [14].


Concatenating \([[4,2,2]]\) code with surface code can generate 2D topological code with a reasonable circuit-based threshold [15].



  • Rotated surface code — Various \([[4,1,2]]\) subcodes are small rotated planar codes [58].
  • Bacon-Shor code — The error-detecting \([[4,1,2]]\) Bacon-Shor code, which reduces to a subcode of the \([[4,2,2]]\) code for a particular gauge configuration, has gauge operators \(\{XXII,IIXX,ZIZI,IZIZ\}\).
  • Quantum parity code (QPC) — \([[4,1,2]]\) subcode \(\{|\overline{00}\rangle,|\overline{01}\rangle\}\) is the smallest member of the sub-family of \([[m^2,1,m]]\) QPC codes.
  • Five-qubit perfect code — \([[4,2,2]]\) can be derived from the five-qubit code using a protocol that converts an \([[n,k,d]]\) code into an \([[n-1, k+1, d-1]]\) code; see Sec. 3.5 in Gottesman [16].
  • Quantum polar code — \([[4,2,2]]\) code is a small quantum polar code [17].
  • Approximate quantum error-correcting code (AQECC) — \([[4,1,2]]\) subcodes \(\{|\overline{00}\rangle,|\overline{10}\rangle\}\) [3] and \(\{|\overline{01}\rangle,|\overline{11}\rangle\}\) [4] approximately correct a single amplitude damping error.
  • Binomial code — \([[4,1,2]]\) subcode consisting of \(\{|\overline{00}\rangle\) and any other codeword reduces to the \(0,2,4\) binomial code when the basis labels in each codeword are written as in base-ten. Such a mapping can be generalized [18].
  • \([[8,3,2]]\) code — The \([[4,2,2]]\) (\([[8,3,2]]\)) code's physical qubits correspond to vertices of a square (cube). Similar constructions exist on \(d\)-dimensional hypercubes and are called hyperoctahedron \([[2^d,d,2]]\) codes [19].
  • Heavy-hexagon code — The \(d=2\) heavy-hexagonal code is closely related to the \([[4,1,2]]\) subcode.


L. Vaidman, L. Goldenberg, and S. Wiesner, “Error prevention scheme with four particles”, Physical Review A 54, R1745 (1996) arXiv:quant-ph/9603031 DOI
M. Grassl, Th. Beth, and T. Pellizzari, “Codes for the quantum erasure channel”, Physical Review A 56, 33 (1997) arXiv:quant-ph/9610042 DOI
D. W. Leung et al., “Approximate quantum error correction can lead to better codes”, Physical Review A 56, 2567 (1997) arXiv:quant-ph/9704002 DOI
G. Alber et al., “Stabilizing Distinguishable Qubits against Spontaneous Decay by Detected-Jump Correcting Quantum Codes”, Physical Review Letters 86, 4402 (2001) arXiv:quant-ph/0103042 DOI
A. Erhard et al., “Entangling logical qubits with lattice surgery”, Nature 589, 220 (2021) arXiv:2006.03071 DOI
C. K. Andersen et al., “Repeated quantum error detection in a surface code”, Nature Physics 16, 875 (2020) arXiv:1912.09410 DOI
“Exponential suppression of bit or phase errors with cyclic error correction”, Nature 595, 383 (2021) arXiv:2102.06132 DOI
J. F. Marques et al., “Logical-qubit operations in an error-detecting surface code”, Nature Physics 18, 80 (2021) arXiv:2102.13071 DOI
D. Gottesman, “Quantum fault tolerance in small experiments”, (2016) arXiv:1610.03507
B. A. Bell et al., “Experimental demonstration of a graph state quantum error-correction code”, Nature Communications 5, (2014) arXiv:1404.5498 DOI
N. M. Linke et al., “Fault-tolerant quantum error detection”, Science Advances 3, (2017) arXiv:1611.06946 DOI
M. Takita et al., “Experimental Demonstration of Fault-Tolerant State Preparation with Superconducting Qubits”, Physical Review Letters 119, (2017) arXiv:1705.09259 DOI
E. H. Chen et al., “Calibrated Decoders for Experimental Quantum Error Correction”, Physical Review Letters 128, (2022) arXiv:2110.04285 DOI
R. S. Gupta et al., “Encoding a magic state with beyond break-even fidelity”, (2023) arXiv:2305.13581
B. Criger and B. Terhal, “Noise thresholds for the [4,2,2]-concatenated toric code”, Quantum Information and Computation 16, 1261 (2016) DOI
D. Gottesman, “Stabilizer Codes and Quantum Error Correction”, (1997) arXiv:quant-ph/9705052
Kyungjoo Noh, Leung code as quantum polar code, 2017.
Linshu Li, private communication, 2018
M. Vasmer and A. Kubica, “Morphing Quantum Codes”, PRX Quantum 3, (2022) arXiv:2112.01446 DOI
Page edit log

Your contribution is welcome!

on github.com (edit & pull request)

edit on this site

Zoo Code ID: stab_4_2_2

Cite as:
\([[4,2,2]]\) CSS code”, The Error Correction Zoo (V. V. Albert & P. Faist, eds.), 2022. https://errorcorrectionzoo.org/c/stab_4_2_2
  title={\([[4,2,2]]\) CSS code},
  booktitle={The Error Correction Zoo},
  editor={Albert, Victor V. and Faist, Philippe},
Share via:
Twitter | Mastodon |  | E-mail
Permanent link:

Cite as:

\([[4,2,2]]\) CSS code”, The Error Correction Zoo (V. V. Albert & P. Faist, eds.), 2022. https://errorcorrectionzoo.org/c/stab_4_2_2

Github: https://github.com/errorcorrectionzoo/eczoo_data/tree/main/codes/quantum/qubits/small_distance/small/stab_4_2_2.yml.