The circuit
The 73\times279 matrix. Rows are wires and columns are rotations. A 1 means the wire takes part in the rotation, and the number beside each wire is its row weight. Scroll sideways to see every column.
| wire | 0 10 20 30 40 50 60 70 80 90 100 110 120 130 140 150 160 170 180 190 200 210 220 230 240 250 260 270 |
|---|---|
| out 0 (279) | 111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 |
| check 1 (24) | 1···11··11·11··1··1·1··11······················1···11··11·11··1··1·1··11··············································································································································································································· |
| check 2 (32) | 11··1·1·1·11·1·11·1111·1·1·····················11··1·1·1·11·1·11·1111·1·1·············································································································································································································· |
| check 3 (32) | 111·1··11·····111111·111··1····················111·1··11·····111111·111··1············································································································································································································· |
| check 4 (24) | 11111······11···11·1··1····1···················11111······11···11·1··1····1············································································································································································································ |
| check 5 (24) | ·11111······11···11·1··1····1···················11111······11···11·1··1····1··········································································································································································································· |
| check 6 (32) | 1·11··1·11·11111···111·1·····1·················1·11··1·11·11111···111·1·····1·········································································································································································································· |
| check 7 (32) | 11·1·1·11·11·11·1·1··111······1················11·1·1·11·11·11·1·1··111······1········································································································································································································· |
| check 8 (24) | 111··11·······1··1111·1········1···············111··11·······1··1111·1········1········································································································································································································ |
| check 9 (24) | ·111··11·······1··1111·1········1···············111··11·······1··1111·1········1······································································································································································································· |
| check 10 (32) | 1·11·1·1·1·11··11·11·111·········1·············1·11·1·1·1·11··11·11·111·········1······································································································································································································ |
| check 11 (32) | 11·1·11··111·1·11111··1···········1············11·1·11··111·1·11111··1···········1····································································································································································································· |
| check 12 (32) | ·11·1·11··111·1·11111··1···········1············11·1·11··111·1·11111··1···········1···································································································································································································· |
| check 13 (24) | 1·111··1·1···1···1·1·1·1············1··········1·111··1·1···1···1·1·1·1············1··································································································································································································· |
| check 14 (24) | 11·1·····1111·11······11·············1·········11·1·····1111·11······11·············1·································································································································································································· |
| check 15 (24) | 111··1··111··1··1·1·1·················1········111··1··111··1··1·1·1·················1································································································································································································· |
| check 16 (24) | ·111··1··111··1··1·1·1·················1········111··1··111··1··1·1·1·················1································································································································································································ |
| check 17 (24) | ··111··1··111··1··1·1·1·················1········111··1··111··1··1·1·1·················1······························································································································································································· |
| check 18 (24) | ···111··1··111··1··1·1·1·················1········111··1··111··1··1·1·1·················1······························································································································································································ |
| check 19 (24) | 1·····1·1··1·111·11···11··················1····1·····1·1··1·111·11···11··················1····························································································································································································· |
| check 20 (24) | 11··11·11··1··1·1··11······················1···11··11·11··1··1·1··11······················1···························································································································································································· |
| check 21 (24) | ·11··11·11··1··1·1··11······················1···11··11·11··1··1·1··11······················1··························································································································································································· |
| check 22 (24) | ··11··11·11··1··1·1··11······················1···11··11·11··1··1·1··11······················1·························································································································································································· |
| check 23 (24) | ···11··11·11··1··1·1··11······················1···11··11·11··1··1·1··11······················1························································································································································································· |
| check 24 (28) | ······························································································111·111·11·111···11···1······················111·111·11·111···11···1····················································································································· |
| check 25 (24) | ······························································································1···11··11·11··1··1·1··11····················1···11··11·11··1··1·1··11··················································································································· |
| check 26 (32) | ······························································································11··1·1·1·11·1·11·1111·1·1···················11··1·1·1·11·1·11·1111·1·1·················································································································· |
| check 27 (28) | ···································································································111·1·111111··1·1·1··1·······················111·1·111111··1·1·1··1················································································································· |
| check 28 (20) | ·································································································1·11·11···1··1·11·······1····················1·11·11···1··1·11·······1················································································································ |
| check 29 (24) | ·······························································································11111······11···11·1··1····1·················11111······11···11·1··1····1··············································································································· |
| check 30 (32) | ······························································································1·11··1·11·11111···111·1·····1···············1·11··1·11·11111···111·1·····1·············································································································· |
| check 31 (28) | ································································································111·11·11·1·1·11···1·1······1················111·11·11·1·1·11···1·1······1············································································································· |
| check 32 (20) | ··································································································1···11·1111····11··········1·················1···11·1111····11··········1············································································································ |
| check 33 (24) | ·······························································································111··11·······1··1111·1········1·············111··11·······1··1111·1········1··········································································································· |
| check 34 (28) | ·······························································································1·11·111····1·111·1·1·1·········1············1·11·111····1·111·1·1·1·········1·········································································································· |
| check 35 (20) | ································································································111···1·1·1··11··1··············1············111···1·1·1··11··1··············1········································································································· |
| check 36 (32) | ·······························································································11·1·11··111·1·11111··1···········1··········11·1·11··111·1·11111··1···········1········································································································ |
| check 37 (24) | ······························································································1·111··1·1···1···1·1·1·1············1········1·111··1·1···1···1·1·1·1············1······································································································· |
| check 38 (28) | ································································································11111·1·1··111·11····1·············1·········11111·1·1··111·11····1·············1······································································································ |
| check 39 (24) | ······························································································111··1··111··1··1·1·1·················1······111··1··111··1··1·1·1·················1····································································································· |
| check 40 (24) | ·······························································································111··1··111··1··1·1·1·················1······111··1··111··1··1·1·1·················1···································································································· |
| check 41 (28) | ······························································································11·1·111111··1·1·1··1···················1····11·1·111111··1·1·1··1···················1··································································································· |
| check 42 (24) | ·································································································111··1··111··1··1·1·1·················1······111··1··111··1··1·1·1·················1·································································································· |
| check 43 (20) | ·······························································································11·11···1··1·11·······1··················1···11·11···1··1·11·······1··················1································································································· |
| check 44 (24) | ······························································································11··11·11··1··1·1··11······················1·11··11·11··1··1·1··11······················1································································································ |
| check 45 (24) | ·······························································································11··11·11··1··1·1··11······················1·11··11·11··1··1·1··11······················1······························································································· |
| check 46 (16) | ························································································································································································1·1··1··11111··········1·1··1··11111··························································· |
| check 47 (16) | ························································································································································································1111·11·1····1·········1111·11·1····1·························································· |
| check 48 (16) | ·························································································································································································1111·11·1····1·········1111·11·1····1························································· |
| check 49 (16) | ··························································································································································································1111·11·1····1·········1111·11·1····1························································ |
| check 50 (16) | ···························································································································································································1111·11·1····1·········1111·11·1····1······················································· |
| check 51 (16) | ························································································································································································1·1·1·111··1·····1·····1·1·1·111··1·····1······················································ |
| check 52 (16) | ························································································································································································1111···1··11······1····1111···1··11······1····················································· |
| check 53 (16) | ························································································································································································11·111···11········1···11·111···11········1···················································· |
| check 54 (16) | ·························································································································································································11·111···11········1···11·111···11········1··················································· |
| check 55 (16) | ························································································································································································1··1··11111··········1·1··1··11111··········1·················································· |
| check 56 (16) | ·························································································································································································1··1··11111··········1·1··1··11111··········1················································· |
| check 57 (8) | ·······································································································································································································································11····11·········11····11······················· |
| check 58 (8) | ······································································································································································································································1···1········1··11···1········1··1··············· |
| check 59 (8) | ··········································································································································································································································1····11··1·······1····11··1·················· |
| check 60 (8) | ············································································································································································································································111·····1········111·····1················· |
| check 61 (8) | ··········································································································································································································································1····1·····11····1····1·····11··············· |
| check 62 (8) | ·········································································································································································································································1·1·····11·······1·1·····11··················· |
| check 63 (8) | ·······································································································································································································································11··1······1·····11··1······1··················· |
| check 64 (16) | ······································································································································································································································11·1··11····1··1111·1··11····1··11··············· |
| check 65 (8) | ········································································································································································································································································1·111··1·111··· |
| check 66 (8) | ········································································································································································································································································111··1·111··1·· |
| check 67 (8) | ·········································································································································································································································································111··1·111··1· |
| check 68 (8) | ···············································································································································································································································································11111111 |
| check 69 (32) | ·······················································································································································································································································11111111111111111111111111111111 |
| check 70 (72) | ···············································································································································································································111111111111111111111111111111111111111111111111111111111111111111111111 |
| check 71 (140) | ···········································································································································11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 |
| check 72 (232) | ···············································1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 |
The gate is read off the output rows. An output row of odd weight gives a T, a pair of output rows with odd overlap gives a CS, and an odd triple overlap gives a CCZ. The circuit is a valid factory because every such parity that touches a check row is even.
Figures of merit
Output gate
As gates: \mathrm{T}_{0}
As monomials: 0 (output wires per term, separated by +)
This row stands for every gate that a CNOT circuit and S, Z and CZ gates on the outputs can reach from this one. They all prepare the same magic state. The wires are shown in the S_k-canonical frame.
Clifford correction
With every rotation a \mathrm{T}=\mathrm{diag}(1,e^{i\pi/4}), the rotations deposit the gate above times a diagonal Clifford. Undo it after the rotations and before the checks are measured, with 12 single-wire gates and 10 \mathrm{CZ} gates: \mathrm{S} on output 0, \mathrm{Z} on check 24, \mathrm{Z} on check 27, \mathrm{Z} on check 28, \mathrm{Z} on check 31, \mathrm{Z} on check 32, \mathrm{Z} on check 34, \mathrm{Z} on check 35, \mathrm{Z} on check 38, \mathrm{Z} on check 41, \mathrm{Z} on check 43, \mathrm{Z} on check 71, \mathrm{CZ} on check 24, check 71, \mathrm{CZ} on check 27, check 71, \mathrm{CZ} on check 28, check 71, \mathrm{CZ} on check 31, check 71, \mathrm{CZ} on check 32, check 71, \mathrm{CZ} on check 34, check 71, \mathrm{CZ} on check 35, check 71, \mathrm{CZ} on check 38, check 71, \mathrm{CZ} on check 41, check 71, \mathrm{CZ} on check 43, check 71. The circuit's action is then exactly the gate above, and an error-free run passes every check with certainty.
Or no Clifford gate at all: run \mathrm{T}^3 on rotations 51, 55, 58, 62, 63, 64, 67, 68, 69, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85 and 84 more (listed below); \mathrm{T}^\dagger on rotations 0, 1, 2, 3, 5, 6, 7, 9, 10, 12, 13, 14, 18, 19, 23, and \mathrm{T} on the rest. A power of \mathrm{T} costs one magic state, like \mathrm{T} itself. For a code this is a transversal \mathrm{T} gate, \mathrm{T}^j on each qubit.
All 108 rotations at T³
51, 55, 58, 62, 63, 64, 67, 68, 69, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 95, 98, 99, 105, 106, 107, 108, 109, 110, 112, 113, 114, 117, 138, 139, 141, 142, 145, 146, 147, 148, 149, 156, 160, 161, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 184, 188, 189, 190, 192, 194, 206, 207, 211, 212, 213, 215, 217, 229, 231, 232, 234, 240, 246, 247, 250, 252, 253, 254, 255, 256, 258, 259, 260, 261, 262
Rotations are numbered by matrix column, from 0. The correction comes from the columns by the weight expansion of Bravyi and Haah (2012). verify_catalog.py re-derives it, checks the corrected circuit's phase input by input against the gate, and on small circuits simulates it gate by gate.
Convert the output with CNOT and S
A CNOT circuit on the outputs, followed by S, Z and CZ gates, turns this factory's gate into other gates that prepare the same magic state. Type a target gate to check whether it is reachable. If it is, you get the circuit, checked on every basis state.
Or list every gate it reaches. The list is built in your browser and saved as a text file, one gate per line.
Python code that writes the same list
import json, urllib.request
NAMES = {1: "T", 2: "CS", 3: "CCZ"}
def equivalent_gates(k, terms, limit=1_000_000):
"""Every gate a CNOT circuit and S, Z, CZ gates reach from this one.
A gate is its set of terms mod Clifford: {a} is T, {a,b} is CS and
{a,b,c} is CCZ on those outputs. CNOT c->t sends x_t to
x_c + x_t - 2 x_c x_t, so a term on t but not c adds the term with t
replaced by c, and, below CCZ, the term with c added.
"""
start = frozenset(frozenset(m) for m in terms)
seen, queue = {start}, [start]
for gate in queue:
for c in range(k):
for t in range(k):
if c == t:
continue
new = set(gate)
for m in gate:
if t in m and c not in m:
new ^= {(m - {t}) | {c}}
if len(m) < 3:
new ^= {m | {c}}
new = frozenset(new)
if new not in seen:
seen.add(new)
queue.append(new)
if len(seen) > limit:
raise RuntimeError(f"more than {limit} equivalent gates")
return seen
def name(gate, k):
sep = "," if k > 10 else ""
terms = sorted((sorted(m) for m in gate), key=lambda m: (len(m), m))
return "·".join(NAMES[len(m)] + sep.join(map(str, m)) for m in terms) or "I"
url = "https://shubhamj810.github.io/magic-state-factory-repo/data/factories/279.1.7.a.json"
record = json.load(urllib.request.urlopen(url))
k = record["parameters"]["k"]
gates = equivalent_gates(k, record["gate"]["monomials"])
lines = sorted(name(g, k) for g in gates)
print(len(lines), "equivalent gates")
with open("equivalent-gates-279.1.7.a.txt", "w") as out:
out.write("\n".join(lines) + "\n")
Distance
7\le d\le 11. No fault of weight below 7 is both undetectable and damaging. None of weight 7 has been found, and one of weight 11 is, so the distance lies between the two.
A damaging fault of weight 11 sits on columns [0,47,94,139,184,207,230,247,264,271,278].
Its source certifies d\ge 11, as a lower bound. That certificate is not re-checked here, but rankings on this site may use it. With the damaging fault of weight 11 above, it makes the distance exactly d=11. Source: Jain and Albert (arXiv:2408.12752), Table I: [[47,1,11]] quantum QR code (extended QR [48,24,12]) doubled onto [[185,1,9]]; the doubling theorem of their Sec. III gives d >= min(d_sd, d_tri + 2) = 11, with d_sd at least the classical distance less one (their Lemma 2.4).
A fault is a set of faulty columns. It is undetectable when their check parts cancel, and damaging when their output parts do not.
Original source
S. P. Jain and V. V. Albert, "Transversal Clifford and T-gate codes of short length and high distance," IEEE J. Sel. Areas Inf. Theory 6, 127-137 (2025); arXiv:2408.12752. doi.org/10.1109/JSAIT.2025.3570832
Provenance
a code of the triorthogonal family of Jain and Albert (arXiv:2408.12752, Table I; transversal_t_codes/), self-dual CSS codes doubled onto [[95,1,7]], rebuilt here from the paper's construction; a verified witness, not a maximum
Found by: Jain-Albert doubling: triorthogonal family
Discovery: pre-existing
1 recorded source
[
{
"regime": "Jain-Albert doubling: triorthogonal family",
"file": "transversal_t_codes/factories.json",
"label": "JA-279",
"N": 73,
"d": 7,
"d_is_exact": false,
"origin": "S. P. Jain and V. V. Albert, \"Transversal Clifford and T-gate codes of short length and high distance\", IEEE J. Sel. Areas Inf. Theory 6, 127 (2025), arXiv:2408.12752",
"provenance": "[[47,1,11]] quantum QR code (extended QR [48,24,12]) doubled onto [[185,1,9]] (Table I)"
}
]Use it in code
Load this factory and re-derive every number from its circuit with the catalogue's own verifier.
# git clone https://github.com/shubhamj810/magic-state-factory-repo
# cd magic-state-factory-repo/master_catalog
import json, urllib.request
import verify_catalog as VC
url = "https://shubhamj810.github.io/magic-state-factory-repo/data/factories/279.1.7.a.json"
record = json.load(urllib.request.urlopen(url))
columns = record["circuit"]["columns"]
k, N = record["parameters"]["k"], record["parameters"]["N"]
facts, problems = VC.derive(columns, k, N) # gate, T-count, degree, ...
distance = VC.measure_distance(columns, k, N) # exhaustive fault search
print(facts["gate_human"], distance["d_exact"] or distance["d_at_least"],
problems or "verified")
Raw record
Show the JSON this page is built from
Source: master_catalog.json, factories[940].