Pastawski-Yoshida-Harlow-Preskill (HaPPY) code[1] 


Also known as a hyperbolic pentagon code (HyPeC). Holographic code constructed out of a network of hexagonal perfect tensors that tesselates hyperbolic space. Physical qubits are associated with uncontracted tensor legs at the boundary of the tesselation, while logical qubits are associated with uncontracted legs in the bulk. The code serves as a minimal model for several aspects of the AdS/CFT holographic duality and potentially a dF/CFT duality [2].

The construction below is described for qubits, but straightforward generalizations exist to modular qudits, oscillators, and rotors [3]. Encoding is accomplished using a tensor network of five-qubit encoding isometries, which are six-legged perfect tensors (with five legs corresponding to the physical qubits and one for the encoded logical qubit). A \(2n\)-legged perfect tensor is proportional to an isometry for any bipartition of its indices into a set \(A\) and a complementary set \(A^{\perp}\) such that \(|A|\leq|A^{\perp}|\).

To construct the encoding, one first uniformly tiles the hyperbolic AdS/CFT disc using pentagons and hexagons. Then, one places a 6-legged five-qubit encoding tensor at each hexagon and pentagon, contracting legs between neighboring shapes and leaving one leg uncontracted at each pentagon. This construction forms an encoding isometry from the uncontracted legs in the bulk to the uncontracted legs at the boundary.

The single-qubit HaPPY code has a central pentagon encoding one bulk operator and hexagons tiling all other layers. The pentagon-hexagon HaPPY code has alternating layers of pentagons and hexagons in the tiling. The pentagon HaPPY code consists of a purely pentagonal tiling.


Protects against erasure errors and Pauli errors on the boundary qubits.


The pentagon HaPPY code has an asymptotic rate \(\frac{1}{\sqrt{5}} \approx 0.447\). The pentagon-hexagon HaPPY code has a rate of \(0.299\) if the last layer is a pentagon layer and a rate of \(0.088\) if the last layer is a hexagon layer.


Heisenberg-picture encoding is done through tensor pushing. Each bulk operator (logical) is pushed to an operator supported on a portion of the boundary region (physical). Pushing all the bulk operators through results in reconstruction of the boundary.

Transversal Gates

For locality-preserving physical gates on the boundary, the set of transversally implementable logical operations in the bulk is strictly contained in the Clifford group [4].


Hierarchical recovery model [1].Greedy decoder [1].


\(26\%\) for boundary erasure errors on the pentagon-hexagon HaPPY code under the greedy decoder [1].Lower bound of \(1/12 \approx 8.3\%\) for boundary erasure errors on the single-qubit HaPPY code under hierarchical recovery [1]. Numerical evidence indicates the threshold may be closer to \(50\%\).There is no threshold for the pentagon HaPPY code as a constant number of errors (four) can make bulk recovery impossible [1].\(16.3\%\) for boundary Pauli errors on the single-qubit HaPPY code with 3 layers [5].A single-qubit HaPPY code has a measurement threshold of one [6] (see also [7]).


Reference [2] discusses the HaPPY code for an AdS_3 space and its relation to a dS_2 braneworld with a conformal boundary.



  • Five-qubit perfect code — The five-qubit encoding isometry tiles various holographic codes because its corresponding tensor is perfect [1].
  • Majorana stabilizer code — HaPPY code Hamiltonian can be expressed in terms of mutually commuting two-body Majorana operators [8].


F. Pastawski et al., “Holographic quantum error-correcting codes: toy models for the bulk/boundary correspondence”, Journal of High Energy Physics 2015, (2015) arXiv:1503.06237 DOI
J. Cotler and A. Strominger, “The Universe as a Quantum Encoder”, (2022) arXiv:2201.11658
P. Faist et al., “Continuous Symmetries and Approximate Quantum Error Correction”, Physical Review X 10, (2020) arXiv:1902.07714 DOI
S. Cree et al., “Fault-Tolerant Logical Gates in Holographic Stabilizer Codes Are Severely Restricted”, PRX Quantum 2, (2021) arXiv:2103.13404 DOI
R. J. Harris et al., “Decoding holographic codes with an integer optimization decoder”, Physical Review A 102, (2020) arXiv:2008.10206 DOI
D. Lee and B. Yoshida, “Randomly Monitored Quantum Codes”, (2024) arXiv:2402.00145
S. Antonini et al., “Holographic measurement and bulk teleportation”, Journal of High Energy Physics 2022, (2022) arXiv:2209.12903 DOI
A. Jahn et al., “Majorana dimers and holographic quantum error-correcting codes”, Physical Review Research 1, (2019) arXiv:1905.03268 DOI
Page edit log

Your contribution is welcome!

on (edit & pull request)— see instructions

edit on this site

Zoo Code ID: happy

Cite as:
“Pastawski-Yoshida-Harlow-Preskill (HaPPY) code”, The Error Correction Zoo (V. V. Albert & P. Faist, eds.), 2022.
@incollection{eczoo_happy, title={Pastawski-Yoshida-Harlow-Preskill (HaPPY) 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:

“Pastawski-Yoshida-Harlow-Preskill (HaPPY) code”, The Error Correction Zoo (V. V. Albert & P. Faist, eds.), 2022.