Bacon-Shor code[1,2] 


Subsystem CSS code defined on an \(m_1 \times m_2\) lattice of qubits that generalizes the \([[9,1,3]]\) (subspace) Shor code. It is said to be symmetric when \(m_1=m_2\), and asymmetric otherwise.

The \(X\)-type and \(Z\)-type stabilizers defined as \(X\) and \(Z\) operators acting on all qubits on adjacent columns and rows, respectively. Let \(O_{i,j}\) denote an operator acting on the qubit at a position \((i,j)\) on the lattice, with \(i\in\{0,1,\ldots ,m_1-1\}\) and \(j\in\{0,1,\ldots,m_2-1\}\). The code's stabilizer group is \begin{align} \mathsf{S}=\langle X_{i,*}X_{i+1,*},Z_{*,j}Z_{*,j+1}\rangle~, \tag*{(1)}\end{align} with generators expressed as products of nearest-neightbour 2-qubit gauge operators, \begin{align} \begin{split} X_{i,*}X_{i+1,*}= \bigotimes_{k=0}^{m_2-1} X_{i,k}X_{i+1,k} \\ Z_{*,j}Z_{*,j+1}=\bigotimes_{k=0}^{m_1-1} Z_{k,j}Z_{k,j+1}~. \end{split} \tag*{(2)}\end{align} Syndrome extraction can be done by measuring these gauge operators, which are on fewer qubits and local.

The shortest error-correcting Bacon-Shor code is \([[9,1,3,3]]\), with four stabilizer generators \begin{align} \begin{array}{ccccccccc} X & X & X & X & X & X & I & I & I\\ I & I & I & X & X & X & X & X & X\\ Z & Z & I & Z & Z & I & Z & Z & I\\ I & Z & Z & I & Z & Z & I & Z & Z \end{array}~, \tag*{(3)}\end{align} which generate the gauge group with the help of eight additional generators \begin{align} \begin{array}{ccccccccc} X & I & I & X & I & I & I & I & I\\ I & X & I & I & X & I & I & I & I\\ I & I & I & X & I & I & X & I & I\\ I & I & I & I & X & I & I & X & I\\ Z & Z & I & I & I & I & I & I & I\\ I & I & I & Z & Z & I & I & I & I\\ I & Z & Z & I & I & I & I & I & I\\ I & I & I & I & Z & Z & I & I & I \end{array}~. \tag*{(4)}\end{align} If the physical qubits are arranged in a three-by-three square, the \(Z\)-type (\(X\)-type) gauge operators are supported on qubits in the same row (column). The code reduces to the Shor code for a particular gauge configuration.


The \([[m_1 m_2,1,min(m_1,m_2)]]\) variant has distance \(d=min(m_1,m_2)\). In a symmetric 3-dimensional case (defined on a cubic lattice) with \(L^3\) qubits, the code has the parameters \([[L^3,1,L]]\). Bacon-Shor code parameteres can be optimized by changing the block geometry, yielding good performance against biased noise [3].


A non-LDPC family of Bacon-Shor codes achieves a distance of \(\Omega(n^{1-\epsilon})\) with sparse gauge operators.

Transversal Gates

Logical Hadamard is transversal in symmetric Bacon-Shor codes up to a qubit permutation [4] and can be implemented with teleportation [5].Bacon-Shor codes on an \(m \times mk\) lattice admit transversal \(k\)-qubit-controlled \(Z\) gates [6].


Piecably fault-tolerant circuits can be employed to construct non-transversal gates effectively [7].Subsystem lattice surgery [8].


Both Steane error correction and Shor error correction can be used for syndrome extraction, with the former outperforming the latter [9].Utilizing the mapping of the effect of the noise to a statistical mechanical model [10,11] yields several copies of the 1D Ising model [12; Sec. V.B].While check operators are few-body, stabilizer weights scale with the number of qubits, and stabilizer expectation values are obtained by taking products of gauge-operator expectation values. It is thus not clear how to extract stabilizer values in a fault-tolerant manner [13,14].

Fault Tolerance

Fault-tolerant teleportation-based computation scheme for asymmetric Bacon-Shor codes that is effective against highly biased noise [15].Pieceably fault-tolerant circuits can be employed to construct non-transversal gates effectively [7].

Code Capacity Threshold

The number of check operators scales sublinearly with system size, so the Bacon-Shor codes alone do not exhibit a topological threshold in the \(m_1,m_2 \to \infty\) limit [16]. However, a threshold can be obtained from concatenated Bacon-Shor codes that are further restricted to planar geometries, whose recovery circuit is a subset of a circuit used by a larger bona-fide Bacon-Shor code [17]. This threshold differs from a concatenated threshold in that there are no long-range connectivity requirements.Lower bounds for the concatenated threshold of various small Bacon-Shor codes are tabulated in [4; Table I].\(2.02 \times 10^{-5}\) concatenated threshold for the concatenated \([[9,1,1,3]]\) Bacon-Shor code [18].


Numerical study of concatenated thresholds of logical CNOT gates for various codes against depolarizing noise [19].The Bacon-Shor code has a measurement threshold of zero [20].


Trapped-ion qubits: state preparation, logical measurement, and syndrome extraction (deferred to the end) for nine-qubit Bacon-Shor code demonstrated on a 13-qubit device by M. Cetina and C. Monroe groups [21].


See [22; Sec. III.C1] for an exposition.



  • Hamiltonian-based code — The 2D Bacon-Shor gauge-group Hamiltonian is the compass model [2325]. Bacon-Show code Hamiltonians can be used to suppress errors in adiabatic quantum computation [26], while subspace-code two-local Hamiltonians cannot [27].
  • Hastings-Haah Floquet code — The Bacon-Shor code admits a Floquet version with a particular stabilizer measurement schedule [28].
  • Asymmetric quantum code — Bacon-Shor code parameters against bit- and phase-noise can be optimized by changing the block geometry, yielding good performance against biased noise [3]. A fault-tolerant teleportation-based computation scheme for asymmetric Bacon-Shor codes is effective against highly biased noise [15].
  • Self-correcting quantum code — 3D Bacon-Shor codes were conjectured to be self-correcting [2], but there remain issues to be resolved in order to validate this conjecture (see [29; Sec. IX.B]).
  • GNU PI code — GNU codes of length \((2t+1)^2\) result from projecting Bacon-Shor codes into the PI qubit subspace [30].
  • \([[9,1,3]]\) Shor code — The \([[9,1,3,3]]\) Bacon-Shor code reduces to the Shor code for a particular gauge configuration.
  • \([[4,2,2]]\) CSS code — The error-detecting \([[4,1,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) — Bacon-Shor codes reduce to QPCs when all \(X\)-type gauge generators are fixed [31; pg. 6].
  • Heavy-hexagon code — Bacon-Shor stabilizers are used to measure the X-type stabilizers of the code.


P. W. Shor, “Scheme for reducing decoherence in quantum computer memory”, Physical Review A 52, R2493 (1995) DOI
D. Bacon, “Operator quantum error-correcting subsystems for self-correcting quantum memories”, Physical Review A 73, (2006) arXiv:quant-ph/0506023 DOI
J. Napp and J. Preskill, “Optimal Bacon-Shor codes”, (2012) arXiv:1209.0794
P. Aliferis and A. W. Cross, “Subsystem Fault Tolerance with the Bacon-Shor Code”, Physical Review Letters 98, (2007) arXiv:quant-ph/0610063 DOI
X. Zhou, D. W. Leung, and I. L. Chuang, “Methodology for quantum logic gate construction”, Physical Review A 62, (2000) arXiv:quant-ph/0002039 DOI
T. J. Yoder, “Universal fault-tolerant quantum computation with Bacon-Shor codes”, (2017) arXiv:1705.01686
Yoder, Theodore., DSpace@MIT Practical Fault-Tolerant Quantum Computation (2018)
H. Poulsen Nautrup, N. Friis, and H. J. Briegel, “Fault-tolerant interface between quantum memories and quantum processors”, Nature Communications 8, (2017) arXiv:1609.08062 DOI
G. Escobar-Arrieta and M. Gutiérrez, “Improved performance of the Bacon-Shor code with Steane’s syndrome extraction method”, (2024) arXiv:2403.01659
E. Dennis et al., “Topological quantum memory”, Journal of Mathematical Physics 43, 4452 (2002) arXiv:quant-ph/0110143 DOI
A. T. Schmitz, “Thermal Stability of Dynamical Phase Transitions in Higher Dimensional Stabilizer Codes”, (2020) arXiv:2002.11733
H. Bombin, “Topological subsystem codes”, Physical Review A 81, (2010) arXiv:0908.4246 DOI
M. B. Hastings, J. Haah, and R. O’Donnell, “Fiber Bundle Codes: Breaking the \(N^{1/2} \operatorname{polylog}(N)\) Barrier for Quantum LDPC Codes”, (2020) arXiv:2009.03921
M. B. Hastings and J. Haah, “Dynamically Generated Logical Qubits”, Quantum 5, 564 (2021) arXiv:2107.02194 DOI
P. Brooks and J. Preskill, “Fault-tolerant quantum computation with asymmetric Bacon-Shor codes”, Physical Review A 87, (2013) arXiv:1211.1400 DOI
N. C. Brown, M. Newman, and K. R. Brown, “Handling leakage with subsystem codes”, New Journal of Physics 21, 073055 (2019) arXiv:1903.03937 DOI
C. Gidney and D. Bacon, “Less Bacon More Threshold”, (2023) arXiv:2305.12046
F. M. Spedalieri and V. P. Roychowdhury, “Latency in local, two-dimensional, fault-tolerant quantum computing”, (2008) arXiv:0805.4213
A. W. Cross, D. P. DiVincenzo, and B. M. Terhal, “A comparative code study for quantum fault-tolerance”, (2009) arXiv:0711.1556
D. Lee and B. Yoshida, “Randomly Monitored Quantum Codes”, (2024) arXiv:2402.00145
L. Egan et al., “Fault-Tolerant Operation of a Quantum Error-Correction Code”, (2021) arXiv:2009.11482
B. M. Terhal, “Quantum error correction for quantum memories”, Reviews of Modern Physics 87, 307 (2015) arXiv:1302.3428 DOI
K. I. Kugel’ and D. I. Khomskiĭ, “The Jahn-Teller effect and magnetism: transition metal compounds”, Soviet Physics Uspekhi 25, 231 (1982) DOI
J. Dorier, F. Becca, and F. Mila, “Quantum compass model on the square lattice”, Physical Review B 72, (2005) arXiv:cond-mat/0501708 DOI
Z. Nussinov and J. van den Brink, “Compass and Kitaev models -- Theory and Physical Motivations”, (2013) arXiv:1303.5922
Z. Jiang and E. G. Rieffel, “Non-commuting two-local Hamiltonians for quantum error suppression”, Quantum Information Processing 16, (2017) arXiv:1511.01997 DOI
I. Marvian and D. A. Lidar, “Quantum Error Suppression with Commuting Hamiltonians: Two Local is Too Local”, Physical Review Letters 113, (2014) arXiv:1410.5487 DOI
M. S. Alam and E. Rieffel, “Dynamical Logical Qubits in the Bacon-Shor Code”, (2024) arXiv:2403.03291
B. J. Brown et al., “Quantum memories at finite temperature”, Reviews of Modern Physics 88, (2016) arXiv:1411.6643 DOI
Y. Ouyang, “Permutation-invariant quantum codes”, Physical Review A 90, (2014) arXiv:1302.3247 DOI
M. Li et al., “2D Compass Codes”, Physical Review X 9, (2019) arXiv:1809.01193 DOI
Page edit log

Your contribution is welcome!

on (edit & pull request)— see instructions

edit on this site

Zoo Code ID: bacon_shor

Cite as:
“Bacon-Shor code”, The Error Correction Zoo (V. V. Albert & P. Faist, eds.), 2022.
@incollection{eczoo_bacon_shor, title={Bacon-Shor code}, booktitle={The Error Correction Zoo}, year={2022}, editor={Albert, Victor V. and Faist, Philippe}, url={} }
Share via:
Twitter | Mastodon |  | E-mail
Permanent link:

Cite as:

“Bacon-Shor code”, The Error Correction Zoo (V. V. Albert & P. Faist, eds.), 2022.