Heavy-hexagon code[1] 


Subsystem stabilizer code on the heavy-hexagonal lattice that combines Bacon-Shor and surface-code stabilizers. Encodes one logical qubit into \(n=(5d^2-2d-1)/2\) physical qubits with distance \(d\). The heavy-hexagonal lattice allows for low degree (at most 3) connectivity between all the data and ancilla qubits, which is suitable for fixed-frequency transom qubits subject to frequency collision errors.

Data qubits and ancillas of the code are placed on a heavy-hexagonal lattice (vertices and edges of a tilling of hexagons). A subset of the ancilla qubits are flag qubits used for detecting high-weight errors arising from fewer faults. The code stabilizers for detecting \(X\)-type errors are measured by measuring weight-two \(Z\)-type gauge operators whose product produces stabilizers of the surface code. \(X\)-type stabilizers are column operators corresponding to stabilizers of the Bacon-Shor code, which are measured by taking products of weight-four and weight-two \(X\)-type gauge operators.


Protects against Pauli noise. The code has no threshold for \(Z\)-type Pauli errors since they are detected by Bacon-Shor-type stabilizers.


\(1/n\) for a distance-\(d\) heavy-hexagon code on \(n = (5d^2-2d-1)/2\) qubits.


For a logical-zero state, prepare all data qubits in the physical-zero state and then measure the \(X\)-type Bacon-Shor stabilizers. For logical-plus state, prepare all data qubits in the physical-plus state and then measure \(Z\)-type surface code stabilizers.Stabilizer measurement encoding circuits have a constant depth of 10 time steps (excluding ancilla state preparation and measurement).

Transversal Gates

CNOT gates are transveral for this code. However, for most architectures, all logical gates would be implemented using lattice surgery methods.


Universal gate set achieved with magic state injection and lattice surgery.


Any graph-based decoder can be used, such as MWPM and Union Find. However, edge weights must be dynamically renormalized using flag-qubit measurement outcomes after each syndrome measurement round.Machine-learning [2] and neural-network [3] decoders.

Fault Tolerance

All logical gates can be fault-tolerantly implemented using lattice surgery and magic state injection.Stabilizer measurements are measured fault-tolerantly using one-flag circuits since some single-fault events can result in weight-two data qubit errors which are parallel to the code's logical operators. Hence, using information from the flag-qubit measurements is crucial to fault-tolerantly measure the code stabilizers.


\(0.45\%\) for \(X\) errors under a full circuit-level depolarizing noise model (obtained from Monte Carlo simulations).\(Z\)-errors have no threshold given the \(X\)-type Bacon-Shor stabilizers.


Logical state preparation and flag-qubit error correction realized in superconducting-circuit devices (specifically, fixed-frequency transmon qubit architectures) by IBM for \(d=2\) [4,5] and \(d=3\) [6].



  • Kitaev surface code — Surface code stabilizers are used to measure the Z-type stabilizers of the code. There are various ways to embed the surface code into the heavy-hex lattice [7].
  • Bacon-Shor code — Bacon-Shor stabilizers are used to measure the X-type stabilizers of the code.
  • \([[4,2,2]]\) CSS code — The \(d=2\) heavy-hexagonal code is closely related to the \([[4,1,2]]\) subcode.
  • \([[4,2,2]]\) CSS code — Magic states prepared using the \([[4,1,2]]\) subcode can be injected into the heavy-hex code [5,8].
  • Rotated surface code — A rotated surface code can be mapped onto a heavy square lattice, resulting in a code similar to the heavy-hexagon code [1].
  • XY surface code — XY surface code can be adapted for a heavy-hexagonal lattice [9].
  • XZZX surface code — XZZX surface code can be adapted for a heavy-hexagonal lattice [9].


C. Chamberland et al., “Topological and Subsystem Codes on Low-Degree Graphs with Flag Qubits”, Physical Review X 10, (2020) arXiv:1907.09528 DOI
D. Bhoumik et al., “Efficient Machine-Learning-based decoder for Heavy Hexagonal QECC”, (2022) arXiv:2210.09730
B. Hall, S. Gicev, and M. Usman, “Artificial Neural Network Syndrome Decoding on IBM Quantum Processors”, (2023) arXiv:2311.15146
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
N. Sundaresan et al., “Demonstrating multi-round subsystem quantum error correction using matching and maximum likelihood decoders”, Nature Communications 14, (2023) arXiv:2203.07205 DOI
C. Benito et al., “Comparative study of quantum error correction strategies for the heavy-hexagonal lattice”, (2024) arXiv:2402.02185
R. S. Gupta et al., “Encoding a magic state with beyond break-even fidelity”, Nature 625, 259 (2024) arXiv:2305.13581 DOI
Y. Kim, J. Kang, and Y. Kwon, “Design of Quantum error correcting code for biased error on heavy-hexagon structure”, (2022) arXiv:2211.14038
Page edit log

Your contribution is welcome!

on github.com (edit & pull request)— see instructions

edit on this site

Zoo Code ID: heavy_hex

Cite as:
“Heavy-hexagon code”, The Error Correction Zoo (V. V. Albert & P. Faist, eds.), 2022. https://errorcorrectionzoo.org/c/heavy_hex
@incollection{eczoo_heavy_hex, title={Heavy-hexagon code}, booktitle={The Error Correction Zoo}, year={2022}, editor={Albert, Victor V. and Faist, Philippe}, url={https://errorcorrectionzoo.org/c/heavy_hex} }
Share via:
Twitter | Mastodon |  | E-mail
Permanent link:

Cite as:

“Heavy-hexagon code”, The Error Correction Zoo (V. V. Albert & P. Faist, eds.), 2022. https://errorcorrectionzoo.org/c/heavy_hex

Github: https://github.com/errorcorrectionzoo/eczoo_data/edit/main/codes/quantum/qubits/subsystem/topological/compass/heavy_hex.yml.