Video introduction
Factories
A factory is a binary matrix. Each column is a \pi/4 parity rotation, which consumes one noisy T state. Each row is a wire. The first k rows are outputs. The other r rows are checks, which are measured and postselected. The gate the factory applies to its outputs is read off the overlaps between rows.
The numbers
- n
- Noisy T states consumed per run.
- k
- Output qubits.
- d
- Distance. Input errors of rate p leave an output error of order p^d.
- N,\ r
- Wires in total, and the r = N - k checks.
- V_{\mathrm{ex}}
- T states one run yields. T and CS count one, CCZ counts two. It is undefined when the gate's terms share an output.
- \gamma
- \log(n/k)/\log d. Overhead per output qubit.
- \gamma_T
- \log(n/T)/\log d, with T the T-count of the output gate.
- \gamma_\rho
- \log(n/V_{\mathrm{ex}})/\log d. Overhead per extractable T state. Rankings use this one.
Lower is better for all three exponents, and for a pure T^{\otimes k} gate they agree. They differ for CS and CCZ gates, where counting output qubits can flatter a factory.
Distances
The catalogue holds distance 2 and up. A distance-2 factory detects every single faulty T state and suppresses errors to order p^2.
Every distance is re-checked from the circuit. An exact distance is proved (no undetectable damaging fault is lighter) and witnessed (one of that weight is shown). Otherwise the catalogue gives a proved lower bound.
A few sources certify a larger distance than could be re-checked here. Tables show both. Rankings and exponents use the certified one and mark it †. Where a source certifies a lower bound and a damaging fault of that weight is shown here, the two together give the distance, and the tag shows it without the ≥.
Where the distance is exact, each factory page also gives the error coefficient A_d: the number of faults of weight d that pass every check and damage the output. If each T state is faulty with probability p, an accepted run has a damaged output with probability A_d\,p^d to leading order. The 15-to-1 factory has A_3=35, and the 8-T CCZ factory has A_2=28. The count belongs to the circuit stored for the row. Another circuit in the same class can have a different one: the stored [[20,4,2]] circuit has A_2=22, and Bravyi and Haah's code with the same parameters has 13.
Clifford corrections
The output gate names only the non-Clifford part of what the rotations deposit. With every rotation a T=\mathrm{diag}(1,e^{i\pi/4}), the rest is a diagonal Clifford: S, Z and CZ gates on the wires. The factory undoes it after the rotations and before it measures the checks. Then its action is exactly the gate shown, and an error-free run passes every check. Each factory page lists this correction, derived as Bravyi and Haah do for triorthogonal codes.
Running some rotations as T^3, T^5 or T^\dagger instead of T costs the same magic states and can remove the correction altogether. For a code this is a transversal T gate, as in Jain and Albert. The search page can show only the factories that need no S or CZ gate, or only those that do.
How each number is obtained
Every row is re-derived from its circuit by
verify_catalog.py
when it enters the catalogue, and the whole file can be re-checked the same way at
any time.
| field | how | status |
|---|---|---|
| n,\ k,\ N | Read off the circuit. | exact |
| output gate | Recomputed from the row overlaps of the circuit. | exact |
| valid factory | Every parity that touches a check row is checked to be even. | exact |
| distance | Every fault below d is enumerated. An explicit damaging fault of weight d makes it exact. Without one it is a lower bound, and an explicit fault of larger weight gives an upper bound. | proved |
| error coefficient A_d | Counted exactly, as the faults the checks accept less those that leave the output intact. Each part is counted with the MacWilliams identity or by enumerating faults. Where enumerating the damaging faults directly also finishes, the two counts must agree. Left blank where neither method reaches, and on a lower bound. | exact or blank |
| certified distance | Taken from the factory's source where the search above was out of reach. Not re-checked. | from source |
| Clifford correction | Derived from the circuit, then checked by evaluating the corrected circuit's phase on every input that matters, and by simulating small circuits gate by gate. That no choice of powers of T removes it is proved by solving a linear system over \mathbb{Z}_4. | exact |
| T-count, degree | Exact minimisation where it is feasible, about k\le 6. Left blank above that, never estimated. | exact or blank |
| V_{\mathrm{ex}}, \gamma, \gamma_T, \gamma_\rho | Formulas in the numbers above. | exact |
| one row per class | Every pair of rows with the same n,k,d is decided by a search for a change of output basis. A pair the search could not decide carries a note saying so. | proved, or noted |
| origin, source | Recorded when a factory is added. | curated |
One row per magic state
Two circuits with the same n, k and d share a row when a CNOT circuit and S, Z and CZ gates on the outputs turn one gate into the other. Such gates prepare the same magic state. For example, \mathrm{T}_0\cdot\mathrm{T}_1 and \mathrm{T}_0\cdot\mathrm{CS}_{01} are one class. Each factory page has a tool that checks this for any target gate and builds the circuit.
Citing
Each factory page names its original source, the paper that found it or the person who contributed it. All of them are listed under References. For the catalogue as a whole, cite
and the repository, github.com/shubhamj810/magic-state-factory-repo. GitHub's "Cite this repository" button gives the same in several formats.
Most distance-2 factories come from the borrowed-identity searches of S. Singh, C. Gidney and C. Jones. If you use them, cite their paper, arXiv:2606.28518, and their code and catalogue, github.com/shraggy/Magic_state_factory_search.
The factories of distance 9 to 31 are codes of S. P. Jain and V. V. Albert. If you use them, cite their paper, arXiv:2408.12752.
Data
- factories.csv, one row per factory.
- index.json, the same with the reference table.
- master_catalog.json, the database, and master_catalog_large.json, which keeps the longest circuits as the rule that builds them.
The site is rebuilt from master_catalog.json and master_catalog_large.json on every change.
index.json records the commit it was built from.
Contributing
The catalogue is a community effort. Send a factory in any format, such as a paper,
matrices, code or a notebook. Open a pull request with a folder in
community_contributions/submissions, or attach it to an issue. Each
submission is verified like any other row and credited to you on every class it adds.
How to contribute Open an issue
Sources
- AI-assisted and SAT searches (Jain, Wills and Singh, arXiv:2610.06535).
- An exhaustive classification of generalised triorthogonal codes with up to 54 inputs and distance at least 3 (Wills, Jain and Singh).
- Distance-2 factories from the borrowed-identity searches (Singh, Gidney and Jones, arXiv:2606.28518), rebuilt from their code and catalogue.
- One-qubit codes with a transversal T gate up to distance 31 (Jain and Albert, IEEE JSAIT 6, 127 (2025), arXiv:2408.12752), rebuilt from the paper's doubling construction.
- Shorter triply even codes of distance 9 to 15, doubled from two self-dual codes of A. Gong (note and code), and codes of distance 17 to 31 built here by doubling her codes further with the method of Jain and Albert.
- Published constructions, credited to their papers.
- Community submissions, verified to the same standard.