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


Holographic code constructed out of a network of 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. The construction below is described for qubits, but straightforward generalizations exist to modular qudits, oscillators, and rotors [2].

Encoding is accomplished using a tensor network of \([[5,1,3]]\) 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 \([[5,1,3]]\) 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.


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, with alternating layers of pentagons and hexagons in the tiling, 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 [3].


Greedy algorithm for decoding specified in Ref. [1].


\(26\%\) for boundary erasure errors on the the pentagon/hexagon HaPPY code, which has alternating layers of pentagons and hexagons in the tiling.\(\sim 50\%\) for boundary erasure errors on the single-qubit HaPPY code, which has a central pentagon encoding one bulk operator and hexagons tiling all other layers\(16.3\%\) for boundary Pauli errors on the single-qubit HaPPY code with 3 layers [4].There is no threshold for the pentagon HaPPY code as a constant number of errors (two) can make bulk recovery impossible.



  • \([[5,1,3]]\) perfect code — The \([[5,1,3]]\) encoding isometry tiles various holographic codes because its corresponding tensor is perfect [1].

Zoo code information

Internal code ID: happy

Your contribution is welcome!

on (edit & pull request)

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


F. Pastawski et al., “Holographic quantum error-correcting codes: toy models for the bulk/boundary correspondence”, Journal of High Energy Physics 2015, (2015). DOI; 1503.06237
P. Faist et al., “Continuous Symmetries and Approximate Quantum Error Correction”, Physical Review X 10, (2020). DOI; 1902.07714
S. Cree et al., “Fault-Tolerant Logical Gates in Holographic Stabilizer Codes Are Severely Restricted”, PRX Quantum 2, (2021). DOI; 2103.13404
R. J. Harris et al., “Decoding holographic codes with an integer optimization decoder”, Physical Review A 102, (2020). DOI; 2008.10206

Cite as:

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