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.

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\) [2][3] and \(d=3\) [4].



  • Kitaev surface code — Surface code stabilizers are used to measure the Z-type stabilizers of the code.
  • 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]]\) code.

Zoo code information

Internal code ID: heavy_hex

Your contribution is welcome!

on github.com (edit & pull request)

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} }
Permanent link:


C. Chamberland et al., “Topological and Subsystem Codes on Low-Degree Graphs with Flag Qubits”, Physical Review X 10, (2020). DOI; 1907.09528
M. Takita et al., “Experimental Demonstration of Fault-Tolerant State Preparation with Superconducting Qubits”, Physical Review Letters 119, (2017). DOI; 1705.09259
Edward H. Chen et al., “Calibrated decoders for experimental quantum error correction”. 2110.04285
Neereja Sundaresan et al., “Matching and maximum likelihood decoding of a multi-round subsystem quantum error correction experiment”. 2203.07205

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/tree/main/codes/quantum/qubits/subsystem/heavy_hex.yml.