# Quantum Lego code[1]

## Description

Code constructed using a tensor-network-based graphical framework from quantum lego blocks, which are smaller quantum codes over qubits or qudits. The class of codes constructed using the framework depends on the choice of atomic lego blocks.

For example, any stabilizer code can be built out of atomic blocks like the 2-site repetition code, single-site trivial stabilizer codes, and tensor products of the \(|0\rangle\) state. Specifically, the HaPPY code is a quantum Lego code whose atomic Lego block is the five-qubit perfect code.

The individual lego blocks and resulting quantum lego codes can be stabilizer or non-stabilizer. However, both the logical and physical degrees of freedom must have the same local dimension.

To construct a Lego code, the encoding map \(V\) for each code that is to be used in the construction is converted to a tensor by decomposing it using the formula \begin{align} V = \sum_{i_j} V_{i_1 \ldots i_{n+k}} | i_{k+1} \ldots i_{k+n} \rangle \langle i_1 \ldots i_k |~. \tag*{(1)}\end{align} We then look at the codes graphically, treating each \(i_j\) as an edge dangling out of the tensor vertex \(V_{i_1 \ldots i_{n+k}}\). These edges are either connected to another tensor vertex's edges or left dangling. If the block codes are stabilizer, then each local tensor has unitary product stabilizers (UPS). The goal is to push each UPS through the tensor network until each dangling edge has only trivial support. Otherwise, a matching value is pushed through the edge and the process is repeated on the next tensor. If a UPS can be pushed through the whole network, then a UPS for the larger network has been found. The dangling legs (edges) and UPS of the whole network can then be converted to physical/logical elements and stabilizers/logical operators for a new quantum code.

## Encoding

## Decoding

## Notes

## Parent

## Children

- Concatenated quantum code
- Qubit stabilizer code — Qubit stabilizer codes are quantum Lego codes built out of atomic blocks such as the 2-qubit repetition code, single-qubit trivial stabilizer codes, and tensor-products of the \(|0\rangle\) state.
- Modular-qudit stabilizer code — Modular-qudit stabilizer codes are quantum Lego codes built out of atomic blocks such as the 2-qudit repetition code, single-qudit trivial stabilizer codes, and tensor-products of the \(|0\rangle\) state.

## Cousin

- Holographic code — Holographic codes whose encoders are tensor networks discretizing hyperbolic space are quantum Lego codes.

## References

- [1]
- C. Cao and B. Lackey, “Quantum Lego: Building Quantum Error Correction Codes from Tensor Networks”, PRX Quantum 3, (2022) arXiv:2109.08158 DOI
- [2]
- T. Farrelly et al., “Tensor-Network Codes”, Physical Review Letters 127, (2021) arXiv:2009.10329 DOI
- [3]
- A. J. Ferris and D. Poulin, “Tensor Networks and Quantum Error Correction”, Physical Review Letters 113, (2014) arXiv:1312.4578 DOI

## Page edit log

- Victor V. Albert (2022-05-25) — most recent
- Thomas Wrona (2022-05-18)

## Cite as:

“Quantum Lego code”, The Error Correction Zoo (V. V. Albert & P. Faist, eds.), 2022. https://errorcorrectionzoo.org/c/quantum_lego

Github: https://github.com/errorcorrectionzoo/eczoo_data/tree/main/codes/quantum/properties/quantum_lego.yml.