Skip to main content
U.S. flag

An official website of the United States government

Official websites use .gov
A .gov website belongs to an official government organization in the United States.

Secure .gov websites use HTTPS
A lock ( ) or https:// means you’ve safely connected to the .gov website. Share sensitive information only on official, secure websites.

Quantum Lego Expansion Pack: Enumerators from Tensor Networks



ChunJun Cao, Michael Gullans, Brad Lackey, Zitao Wang


We provide the first tensor network method for computing quantum weight enumerator polynomials in the most general form. As a corollary, if a quantum code has a known tensor network construction of its encoding map, our method produces an algorithm that computes its distance. For non-(Pauli)-stabilizer codes, this constitutes the current best algorithm for computing the code distance. For degenerate stabilizer codes, it can provide up to an exponential speed up compared to the current methods. We also introduce a few novel applications of different weight enumerators. In particular, for any code built from the quantum lego method, we use enumerators to construct its (optimal) decoders under any i.i.d. single qubit or qudit error channels and discuss their applications for computing exact logical error rates. As a proof of principle, we perform exact analyses of the deformed surface codes, the holographic pentagon code, and the 2d Bacon-Shor code under (biased) Pauli noise and limited instances of coherent error at sizes that are inaccessible by brute force.
Physical Review X


quantum error correction, quantum information science, tensor networks


Cao, C. , Gullans, M. , Lackey, B. and Wang, Z. (2023), Quantum Lego Expansion Pack: Enumerators from Tensor Networks, Physical Review X (Accessed June 16, 2024)


If you have any questions about this publication or are having problems accessing it, please contact

Created August 9, 2023, Updated September 25, 2023