目录Contents
速查回顾:五条随身事实Quick recap: five facts to carry
这一篇只依赖 Toric Code 教程里的五件事,全都和「两条泡利串在哪里相遇」有关。每一条都给出原处的链接。 This guide relies on five things from the toric-code guide, all about “where two Pauli strings meet”. Each comes with a link to where it was taught.
| # | 事实Fact | 原处Where it was taught |
|---|---|---|
| 1 | 一条泡利串每个比特一格,格里是 I、X、Y 或 Z。碰撞定理:两条串相乘时可以交换顺序,代价是 (−1)c,c = 同一格里两个都不是 I 且不同的字母相遇的位置数(纯 X 串对纯 Z 串时就是 X 遇上 Z)。c 为偶 ⇒ 对易;c 为奇 ⇒ 反对易。A Pauli string has one cell per qubit holding I, X, Y or Z. The collision theorem: two strings may be multiplied in either order at the price of (−1)c, c = the number of cells where the two strings carry two different non-identity letters (for X/Z-only strings: where an X meets a Z). Even c ⇒ commute; odd c ⇒ anticommute. | 4.2 节section 4.2 |
| 2 | 一个稳定子码是一份互相兼容的检查清单;逻辑算符 = 与所有检查对易、却不是检查乘积的泡利串。A stabilizer code is a list of mutually compatible checks; a logical operator is a Pauli string that commutes with every check yet is not a product of checks. | 4.4 节section 4.4 |
| 3 | L × L 环面码:2L² 条边各住一个比特,L² 条星检查(X 型)、L² 条面检查(Z 型),k = 2 个逻辑比特。L = 3 时 n = 18。The L × L toric code: one qubit on each of 2L² edges, L² star checks (X type), L² plaquette checks (Z type), k = 2 logical qubits. For L = 3, n = 18. | 5.3 节section 5.3 |
| 4 | 一串 Z 是一条链,报警的星是链的端点;没有端点的闭合圈不报警。可收缩的圈是面检查的乘积;绕环面一圈的圈是逻辑算符 Z̄。对偶地(X 住在穿过边的对偶路径上)得到 X̄。A run of Z is a chain; the stars that fire are its endpoints; a closed loop with no endpoints fires nothing. A contractible loop is a product of plaquettes; a loop that winds around the torus is a logical operator Z̄. Dually (X living on a path that crosses edges) one gets X̄. | 5.4 节section 5.4 · 5.6 节section 5.6 |
| 5 | 竖直的 X̄ 圈与水平的 Z̄ 圈在环面上恰好交叉一次——奇数,反对易;平行的两圈交叉 0 次——对易。于是 {X̄₁, Z̄₁} 与 {X̄₂, Z̄₂} 是两对逻辑比特算符。最短的缠绕圈长 L,所以 d = L。The vertical X̄ loop and the horizontal Z̄ loop cross exactly once on the torus: odd, anticommute; two parallel loops cross 0 times: commute. Hence {X̄₁, Z̄₁} and {X̄₂, Z̄₂} are two pairs of logical-qubit operators. The shortest winding loop has length L, so d = L. | 5.6 节section 5.6 · 5.8 节section 5.8 |
记号:n = 物理量子比特数,k = 逻辑量子比特数,d = 码距,L = 环面每行每列的格数,c = 两条泡利串中两个都不是 I 且不同的字母同格相遇的位置数(只有 X、Z 时就是 X 遇 Z)。X̄、Z̄(上面加横线)= 逻辑 X、逻辑 Z;下标 1、2 区分两个逻辑比特。
Notation: n = number of physical qubits, k = number of logical qubits, d = distance, L = cells per row and per column of the torus, c = number of cells where the two Pauli strings carry two different non-identity letters (for a pure-X and a pure-Z string: where an X meets a Z). X̄, Z̄ (with a bar) = logical X, logical Z; subscripts 1, 2 distinguish the two logical qubits.
这个问题用人话说是什么:两条圈交叉几次The problem in plain words: how many times do two loops cross
先在 3 × 3 环面码上数一个数:一条 Z 圈和一条 X 圈共用几条边。再把 Z 圈变形,重数一次。你会发现这个数会变,但它的奇偶不会。这一章从这个能手数的现象出发,一步步命名到「上积」,然后说清楚它和「门」有什么关系,最后逐字读 Wanted 板的原文。 First count one number on the 3 × 3 toric code: how many edges a Z loop and an X loop share. Then deform the Z loop and count again. The number changes; its parity does not. This chapter starts from that hand-countable phenomenon, names it step by step until we reach the “cup product”, explains what it has to do with “gates”, and finally reads the Wanted board word by word.
1.1玩具:3 × 3 环面上的两条圈The toy: two loops on a 3 × 3 torus
取 L = 3 的环面码,[[18, 2, 3]](QEC-Bank 标签 toric_L3)。第 0 章事实 4 给了两条逻辑算符。Z̄₁:沿第二行的 3 条横边各放一个 Z(蓝色)。X̄:沿第二列的 3 条横边各放一个 X——这 3 条横边被一条竖直的对偶路径dual path:不沿着边走、而是穿过边、从一块面走到相邻面的路径。X 型逻辑算符住在这种路径穿过的边上;它与每个星检查的字母都是 X,所以自然对易,不需要穿过偶数次。(橙色虚线)依次穿过,这条路径绕环面竖直一圈。两条算符各自与所有检查对易(Toric Code 教程 5.6 节已验)。现在只问一件事:它们共用几条边?
Take the toric code with L = 3, [[18, 2, 3]] (QEC-Bank label toric_L3). Fact 4 of Chapter 0 gave two logical operators. Z̄₁: a Z on each of the 3 horizontal edges of the second row (blue). X̄: an X on each of the 3 horizontal edges of the second column; these 3 edges are crossed in turn by a vertical dual pathA path that does not run along edges but crosses them, stepping from one plaquette to a neighbouring one. X-type logical operators live on the edges such a path crosses; it shares only X letters with every star check, hence commutes without any even-crossing condition. (amber, dashed) that winds once vertically around the torus. Each operator commutes with every check (verified in section 5.6 of the toric-code guide). Now ask one thing only: how many edges do they share?
答案是 1:第二行、第二列那条横边。在那一格里 Z 遇上 X,c = 1,奇数——按碰撞定理,Z̄₁ 与 X̄ 反对易。这就是第 0 章事实 5 的「恰好交叉一次」,只不过我们把「交叉」落实成了「共用一条边」。人话:两条圈相遇的次数,决定两个逻辑算符是对易还是反对易。下面的沙盘就是这个码。先自己做一遍:切到 Z,点亮第二行的 3 条横边;切到 X,点亮第二列的 3 条横边;数一数两种颜色重叠的边。
The answer is 1: the horizontal edge in the second row and second column. In that cell a Z meets an X, c = 1, odd; by the collision theorem Z̄₁ and X̄ anticommute. This is the “cross exactly once” of fact 5 in Chapter 0, with “crossing” made concrete as “sharing one edge”. In plain words: the number of times two loops meet decides whether two logical operators commute or anticommute. The sandbox below is this code. Do it yourself first: switch to Z and light the 3 horizontal edges of the second row; switch to X and light the 3 horizontal edges of the second column; count the edges carrying both colours.
1.2变形也改不了的奇偶The parity no deformation can change
现在把 Z̄₁ 变形。「变形」在稳定子码里只有一种合法方式:乘上一条检查。乘上一块面检查(4 条边各放 Z),已经有 Z 的边上 Z·Z = I 消掉,没有 Z 的边上多出一个 Z——圈的形状变了,但它仍与所有检查对易,仍不是面检查的乘积,仍是同一个逻辑算符 Z̄₁(Toric Code 教程 5.6 节说的「相差一个可收缩部分即视为相同」)。下图把 Z̄₁ 乘上标 ★ 的两块面检查。重数一次它和 X̄ 共用的边:
Now deform Z̄₁. In a stabilizer code “deforming” has only one legal form: multiply by a check. Multiplying by a plaquette (a Z on each of its 4 edges) cancels Z·Z = I on edges that already carried a Z and adds a Z on those that did not; the loop changes shape, yet still commutes with every check, is still not a product of plaquettes, and is still the same logical operator Z̄₁ (“loops differing by a contractible part count as the same”, section 5.6 of the toric-code guide). The figure below multiplies Z̄₁ by the two plaquettes marked ★. Count its shared edges with X̄ again:
3 条。数变了,奇偶没变。这不是巧合,而是可以在三行里证明的事实:X̄ 与每块面检查对易(事实 2、4),也就是说 X̄ 与任何一块面共用偶数条边(0 或 2 条);乘上一块面,共用边的条数就改变一个偶数;奇数加偶数还是奇数。对 X̄ 变形(乘星检查)同理。于是:
3. The number changed; its parity did not. That is no coincidence but a fact provable in three lines: X̄ commutes with every plaquette (facts 2 and 4), which is to say X̄ shares an even number of edges with any plaquette (0 or 2); multiplying by a plaquette therefore changes the number of shared edges by an even amount; odd plus even is odd. Deforming X̄ (multiplying by stars) works the same way. Hence:
记号:c(A, B) = 泡利串 A 与 B 中两个不同的非 I 字母相遇的格数(纯 X 串对纯 Z 串时就是 X 遇 Z;第 0 章事实 1),在这里就是两条圈共用的边数;「mod 2」读「模 2」,只看除以 2 的余数,即奇偶。
Notation: c(A, B) = the number of cells where A and B carry two different non-identity letters (an X meeting a Z, for a pure-X and a pure-Z string) (fact 1 of Chapter 0), here the number of edges the two loops share; “mod 2” means keep only the remainder on division by 2, the parity.
数学家给「怎么连续变形都不变的数」起的名字是拓扑不变量topological invariant:一个只依赖形状的「类」、不依赖具体画法的量。这里的「变形」= 乘检查,「类」= 同调类,「量」= 交叉数的奇偶。。这里的不变量是一个奇偶(0 或 1),叫两条圈的交叉数intersection number(mod 2):两条圈相遇次数的奇偶。foundations/pauli-symplectic 把碰撞定理的这一版叫「crossing-count picture」。。QEC-Bank 的基础页 foundations/pauli-symplectic/intuition.md 把碰撞定理的这个画法直接叫 “Crossing-count picture”:“Every crossing means one local anticommutation. The symplectic inner product is simply the parity of those crossings.” 人话:对易还是反对易,是一个拓扑问题;画法怎么变都不影响答案。
The mathematician's name for “a number that survives every continuous deformation” is a topological invariantA quantity that depends only on the shape “class”, not on the particular drawing. Here “deformation” = multiplying by checks, “class” = homology class, “quantity” = the parity of the crossing count.. The invariant here is a parity (0 or 1), the intersection numberThe parity of how many times two loops meet (mod 2). foundations/pauli-symplectic calls this version of the collision theorem the “crossing-count picture”. of the two loops. The QEC-Bank foundations page foundations/pauli-symplectic/intuition.md calls this drawing of the collision theorem the “Crossing-count picture” outright: “Every crossing means one local anticommutation. The symplectic inner product is simply the parity of those crossings.” In plain words: commuting or anticommuting is a topological question; however the drawing changes, the answer does not.
对。X̄ 与每块面检查对易,所以每块面与 X̄ 共用偶数条边(在这个 3 × 3 码上是 0 或 2)。乘一块面,共用数改变 −2、0 或 +2,奇偶不变。「分开两条圈」等于让 Z̄₁ 与 X̄ 对易,那会推翻它们是一对逻辑比特算符这件事,不可能。
Right. X̄ commutes with every plaquette, so each plaquette shares an even number of edges with X̄ (0 or 2 on this 3 × 3 code). Multiplying by one changes the shared count by −2, 0 or +2; the parity stays. “Separating the loops” would make Z̄₁ commute with X̄, contradicting that they are a pair of logical-qubit operators; impossible.
再想:一块面检查有 4 条边,X̄ 穿过第二列的 3 条横边。一块面要么不在第二列(共用 0 条),要么在第二列(上下两条横边都被穿过,共用 2 条)。变化量总是偶数。
Think again: a plaquette has 4 edges, and X̄ crosses the 3 horizontal edges of the second column. A plaquette is either not in the second column (0 shared) or in it (its top and bottom horizontal edges are both crossed: 2 shared). The change is always even.
1.3给圈贴标签:四个类,一张 4 × 4 表Labelling loops: four classes, one 4 × 4 table
既然只有奇偶要紧,就给每条闭合圈贴一个两位的标签 (h, v):h = 它绕环面水平方向的圈数的奇偶,v = 绕竖直方向的圈数的奇偶。可收缩的圈是 (0,0),Z̄₁(水平圈)是 (1,0),Z̄₂(竖直圈)是 (0,1),两者相乘是 (1,1)。乘检查不改变标签(1.2 节)。Toric Code 教程 5.6 节末尾说过:把「相差检查乘积即视为相同」的圈归类,恰好四类,学名同调类homology class:把「相差一个可收缩部分」的圈视为同一个类。环面上的一阶 ℤ₂ 同调恰有 4 个类,对应 4 个 Z 型逻辑算符 I、Z̄₁、Z̄₂、Z̄₁Z̄₂(相差检查乘积视为相同)。。同样给 X̄ 圈(对偶路径)贴标签 (h′, v′)。那么两条圈的交叉数只由标签决定:
Since only parity matters, give every closed loop a two-digit label (h, v): h = the parity of how many times it winds around the torus horizontally, v = the parity of how many times it winds vertically. A contractible loop is (0,0), Z̄₁ (horizontal) is (1,0), Z̄₂ (vertical) is (0,1), their product is (1,1). Multiplying by checks does not change the label (section 1.2). The end of section 5.6 of the toric-code guide said it: sorting loops by “differing by a product of checks counts as the same” gives exactly four classes, formally homology classesLoops differing by a contractible part are put in the same class. The first ℤ₂ homology of the torus has exactly 4 classes, matching the 4 Z-type logical operators I, Z̄₁, Z̄₂, Z̄₁Z̄₂ (up to products of checks).. Give X̄ loops (dual paths) labels (h′, v′) likewise. Then the crossing parity of two loops depends only on the labels:
记号:(h, v) = Z 圈的标签,(h′, v′) = X 对偶圈的标签,每个都是 0 或 1;「·」是普通乘法,「+ (mod 2)」是只看奇偶的加法(1 + 1 = 0)。
Notation: (h, v) = label of the Z loop, (h′, v′) = label of the X dual loop, each digit 0 or 1; “·” is ordinary multiplication, “+ (mod 2)” is addition keeping only parity (1 + 1 = 0).
为什么是这个式子:一条水平 Z 圈只会和竖直的 X 对偶路径相遇(h 配 v′),一条竖直 Z 圈只会和水平的 X 对偶路径相遇(v 配 h′),每次各贡献一个交叉;两项相加取奇偶。把 4 × 4 = 16 种组合填成表,就是环面码上「哪对逻辑算符反对易」的完整答案——它正是 Toric Code 教程 5.6 节那条 X̄iZ̄j = (−1)δij Z̄jX̄i 换了一件衣服:
Why this formula: a horizontal Z loop can only meet a vertical X dual path (h pairs with v′), a vertical Z loop only a horizontal one (v pairs with h′), each meeting contributing one crossing; add the two and keep the parity. Filling the 4 × 4 = 16 combinations into a table gives the complete answer to “which pairs of logical operators anticommute” on the toric code; it is the rule X̄iZ̄j = (−1)δij Z̄jX̄i of section 5.6 of the toric-code guide in different clothes:
| Z 圈 (h,v) \ X 圈 (h′,v′)Z loop (h,v) \ X loop (h′,v′) | (0,0) | (1,0) | (0,1) | (1,1) |
|---|---|---|---|---|
| (0,0) | 0 | 0 | 0 | 0 |
| (1,0) = Z̄₁ | 0 | 0 | 1 | 1 |
| (0,1) = Z̄₂ | 0 | 1 | 0 | 1 |
| (1,1) = Z̄₁Z̄₂ | 0 | 1 | 1 | 0 |
表里的每个 1 都可以在 1.1 节的沙盘上手数验证(画出两条圈,数重叠的边)。注意第一行第一列全是 0:可收缩的圈(检查的乘积)与谁都对易——这就是「稳定子与逻辑算符对易」在拓扑语言里的样子。人话:逻辑算符之间的全部对易关系,可以从圈的标签算出来,而不必逐格检查泡利串。这已经是「拓扑替我们算」的第一个例子,只是算出的是对易关系,不是门。
Every 1 in the table can be checked by hand on the sandbox of section 1.1 (draw the two loops, count overlapping edges). Note the first row and first column are all 0: a contractible loop (a product of checks) commutes with everything, which is “stabilizers commute with logicals” in topological language. In plain words: all commutation relations among logical operators can be computed from loop labels, without checking Pauli strings cell by cell. This is already a first instance of “topology computing for us”, except that what it computes is commutation, not gates.
1.4把两个标签乘成第三个:上积Multiplying two labels into a third: the cup product
先分清两件事。1.3 节那张表是一种配对:左边拿一条 Z 圈的标签,上边拿一条 X 串的标签,配出一个数 0 或 1。数学里还有一种乘法,两个输入是同一类东西,输出还是这一类东西,叫上积cup product,记作 ⌣:把一个 p 次上同调类和一个 q 次上同调类乘成一个 p + q 次上同调类。公式见本节。,记作 α ⌣ β。要说清它,先说清它的输入:上同调类。
First, two things must be kept apart. The table of 1.3 is a pairing: take the label of a Z loop on the left and the label of an X string on top, and get a number, 0 or 1. Mathematics also has a multiplication whose two inputs are the same kind of object and whose output is again that kind, the cup productWritten ⌣: it multiplies a degree-p cohomology class and a degree-q cohomology class into a degree-(p + q) cohomology class. Formula in this section., written α ⌣ β. To say what it does, first say what its inputs are: cohomology classes.
「上同调」听起来远,其实 1.3 节已经用过它最简单的一例。在环面码上,「给每条边分配一个 0 或 1」就是「在标 1 的边上各放一个 X」;「边界规则」要求每块面的边上 1 的个数为偶数,这正是这串 X 与每块面检查(Z 型)对易;两种分配若只差「把某个顶点周围的边全翻一次」,就算同一个类,这正是相差一条星检查。所以环面码上一个 1 次上同调类,就是一个 X 型逻辑算符(相差星检查视为相同),1.3 节给 X 串贴的标签 (h′, v′) 就是它的标签;Z 圈的标签 (h, v) 则是同调类。这里的「1 次」(degree 1)指数值分配在边这种 1 维的格子上;分配在顶点上的叫 0 次,分配在面(三角形)上的叫 2 次。
“Cohomology” sounds remote, but section 1.3 already used its simplest instance. On the toric code, “assign a 0 or 1 to every edge” means “put an X on every edge marked 1”; the “boundary rule” demands an even number of 1s on the edges of every face, which is exactly that this X string commutes with every face check (Z-type); two assignments that differ only by “flipping every edge around one vertex” count as the same class, which is exactly differing by a star check. So on the toric code a degree-1 cohomology class is an X-type logical operator (up to star checks), and the labels (h′, v′) that 1.3 gave to X strings are its labels, while the labels (h, v) of Z loops are homology classes. “Degree 1” means the numbers sit on 1-dimensional cells, the edges; numbers on vertices make degree 0, numbers on faces (triangles) degree 2.
次数不等于你在图上看到的形状的维数。一个 1 次类画在环面上是一条对偶圈:从面走到面、依次穿过那些标 1 的边的线(1.1 节的橙色虚线)。「标 1 的边 ↔ 穿过它们的对偶形状」这个对应叫庞加莱对偶Poincaré duality:在 n 维的闭空间里,一个 p 次上同调类对应一个 n − p 维的对偶形状(穿过那些标 1 的格子)。环面 n = 2:1 次类 ↔ 对偶圈;三维 n = 3:1 次类 ↔ 对偶膜。:在 n 维的空间里,一个 p 次类对应一个 n − p 维的形状。环面 n = 2,所以 1 次类对应 1 维的圈;在三维空间里 n = 3,1 次类对应的是 2 维的膜,不是圈——1.5 节的三维构造要用到这一点。
The degree is not the dimension of the shape you see in the picture. On the torus a degree-1 class is drawn as a dual loop: the line that runs from face to face crossing, one after another, the edges marked 1 (the amber dashed line of 1.1). This correspondence, “edges marked 1 ↔ the dual shape crossing them”, is called Poincaré dualityIn a closed n-dimensional space a degree-p cohomology class corresponds to an (n − p)-dimensional dual shape crossing the cells marked 1. Torus, n = 2: degree-1 class ↔ dual loop; three dimensions, n = 3: degree-1 class ↔ dual membrane.: in an n-dimensional space a degree-p class corresponds to an (n − p)-dimensional shape. The torus has n = 2, so a degree-1 class corresponds to a 1-dimensional loop; in three-dimensional space, n = 3, a degree-1 class corresponds to a 2-dimensional membrane, not a loop, which the three-dimensional construction of 1.5 needs.
上积的规则:p 次类乘 q 次类得 p + q 次类(次数相加,不是「高一维」)。两个 1 次类相乘得 2 次类,也就是给每个三角形一个 0/1。公式(Zhu,arXiv:2501.19375 第 II.1 节式 (14)、(18))要求每个三角形的三个顶点排好顺序 v₀ → v₁ → v₂,然后规定:
The rule: a degree-p class times a degree-q class gives a degree-(p + q) class (degrees add; it is not “one dimension higher”). Two degree-1 classes multiply into a degree-2 class, a 0/1 on every triangle. The formula (Zhu, arXiv:2501.19375, section II.1, eqs. (14) and (18)) needs the three corners of each triangle ordered v₀ → v₁ → v₂, and then says:
∫α ⌣ β = Σ三角形triangles (α ⌣ β)[v₀v₁v₂] (mod 2)
记号:α[v₀v₁] = α 在从 v₀ 到 v₁ 那条边上的值(0 或 1),β[v₁v₂] 同理;「·」是普通乘法;∫α ⌣ β 读「α 杯 β 的总值」,把所有三角形上的值加起来(Σ)只看奇偶。人话:α 看三角形的第一条边,β 看第二条边,两者都是 1 的三角形才算 1。
Notation: α[v₀v₁] = the value (0 or 1) of α on the edge from v₀ to v₁, β[v₁v₂] likewise; “·” is ordinary multiplication; ∫α ⌣ β, read “the total of alpha cup beta”, adds the values over all triangles (the Σ) and keeps the parity. In plain words: α looks at a triangle's first edge, β at its second; a triangle scores 1 only when both are 1.
手算一次(图 1.4)。把 3 × 3 环面的每个方格沿对角线切成两个三角形:9 个顶点、27 条边、18 个三角形;边的方向一律向右、向上、向右上,每个三角形的顶点就沿箭头排好了序。取 α = 1 在穿过列 0 与列 1 之间那条竖直对偶圈的 6 条边上(3 条横边、3 条对角边),β = 1 在穿过行 0 与行 1 之间那条水平对偶圈的 6 条边上(3 条竖边、3 条对角边)。每个三角形里 α 为 1 的边数是 0 或 2,β 也是,所以两者都满足边界规则。现在逐块算。阴影那块:v₀ = (列 0, 行 0),v₁ = (1, 0),v₂ = (1, 1);第一条边 v₀v₁ 是横边,在 α 里,值 1;第二条边 v₁v₂ 是竖边,在 β 里,值 1;乘积 1。它正上方同形状的那块 (0, 1)、(1, 1)、(1, 2):第一条边在 α 里(1),第二条边 (1, 1) → (1, 2) 不在 β 里(0),乘积 0。另一种三角形(v₀ 左下、v₁ 左上、v₂ 右上)的第一条边都是竖边,而 α 在竖边上全是 0,所以都得 0。18 块里只有阴影那一块得 1,∫α ⌣ β = 1。反过来 ∫β ⌣ α 也是 1(这回是 (0, 0)、(0, 1)、(1, 1) 那块得 1),∫α ⌣ α = 0。本篇脚本把 18 块逐一算过,又给 α、β 各自加上 2 000 组随机的「翻转某些顶点周围的所有边」(相差星检查)再算,总值始终不变:∫ 只看类,不看代表。
Compute one by hand (Fig. 1.4). Cut every square of the 3 × 3 torus along its diagonal into two triangles: 9 vertices, 27 edges, 18 triangles; orient every edge right, up or up-right, and the corners of each triangle are ordered along the arrows. Let α = 1 on the 6 edges crossed by the vertical dual loop between column 0 and column 1 (3 horizontal, 3 diagonal), and β = 1 on the 6 edges crossed by the horizontal dual loop between row 0 and row 1 (3 vertical, 3 diagonal). Every triangle has 0 or 2 edges with α = 1, and likewise for β, so both obey the boundary rule. Now triangle by triangle. The shaded one: v₀ = (col 0, row 0), v₁ = (1, 0), v₂ = (1, 1); the first edge v₀v₁ is horizontal and in α, value 1; the second edge v₁v₂ is vertical and in β, value 1; product 1. The same-shaped triangle just above it, (0, 1), (1, 1), (1, 2): the first edge is in α (1), the second edge (1, 1) → (1, 2) is not in β (0), product 0. In the other kind of triangle (v₀ bottom left, v₁ top left, v₂ top right) the first edge is vertical, and α is 0 on every vertical edge, so all of them score 0. Only the shaded triangle of the 18 scores 1: ∫α ⌣ β = 1. The other way round, ∫β ⌣ α is 1 as well (now the triangle (0, 0), (0, 1), (1, 1) scores), and ∫α ⌣ α = 0. This guide's script computed all 18 triangles, then added to α and β 2 000 random sets of “flip every edge around some vertices” (differing by star checks) and recomputed: the total never changed. ∫ sees the class, not the representative.
这个 1 与 1.3 节表里「Z̄₁ 对竖直 X 串」的那个 1 是同一个数,原因就是对偶:α 的对偶圈是竖直的,β 的是水平的,它们恰好交叉一次;论文式 (30) 写的正是「∫α ⌣ β = 两条对偶圈交叉次数的奇偶」。把 α、β 换成四个类(0、α、β、α + β)的所有组合,16 个总值排成的表与 1.3 节的表同形(本篇脚本核对)。所以在环面上,1.3 节的配对表可以读成上积表;但两件事仍要分开:配对吃一个同调类和一个上同调类,吐出一个数;上积吃两个上同调类,吐出一个更高次的类,数要到最后「求总值」那一步才出现。只有上积能接着再乘第三个类——1.5 节的非 Clifford 门正要用到这一步。
This 1 is the same number as the 1 of “Z̄₁ against the vertical X string” in the table of 1.3, and duality is the reason: the dual loop of α is vertical, that of β horizontal, and they cross exactly once; the paper's eq. (30) says precisely “∫α ⌣ β = parity of the number of crossings of the two dual loops”. Running α and β over all pairs of the four classes (0, α, β, α + β), the 16 totals form a table of the same shape as the table of 1.3 (checked by this guide's script). So on the torus the pairing table of 1.3 can be read as a cup-product table; yet the two things stay distinct: the pairing takes one homology class and one cohomology class and returns a number; the cup product takes two cohomology classes and returns a class of higher degree, and a number appears only in the final “take the total” step. Only the cup product can go on to multiply a third class, the step that the non-Clifford gates of 1.5 need.
本篇给出了上积的公式并手算了一例,没有证明「∫ 只看类」对一切代表都成立(这要用上积的莱布尼茨法则,论文第 II.1 节式 (25)–(27);本篇只在上面的例子上用脚本核对)。Wanted 板用的更大的词上同调运算cohomology operation:所有「把上同调类变成上同调类」的自然运算的总称,上积是其中最基本的一种;更高阶的还有 Steenrod 平方等,本篇不涉及。,指的是上积以及它的一族推广;推广部分本篇不涉及。
This guide gives the cup-product formula and works one example by hand; it does not prove that “∫ sees only the class” holds for every representative (that uses the Leibniz rule for the cup product, section II.1 of the paper, eqs. (25)–(27); here it was only checked by script on the example above). The Wanted board's larger term, cohomology operationThe collective name for all natural operations that turn cohomology classes into cohomology classes; the cup product is the most basic one, with higher ones such as Steenrod squares not touched here., means the cup product together with a family of its generalizations; the generalizations are not covered here.
1.5从标签到门,以及 Wanted 板的原文From labels to gates, and the board verbatim
最后一步是「门」。存住逻辑比特不等于计算;要计算就要对逻辑比特做门,而且最想要的是便宜的门——每个物理比特只参与少数几个小操作、深度为常数、不需要长时间的测量协议(表面码逻辑操作教程 1.1 节:需要哪些门)。上积怎样变成这样的门,Zhu 的论文(arXiv:2501.19375 第 II.1–II.2 节)给出了一个具体的构造。下面按它的条件陈述;门的层级(Clifford、第 3 级)见本节末的补课。
The last step is “gates”. Storing logical qubits is not computing; computing means applying gates to them, and the gates one wants most are the cheap ones: each physical qubit takes part in only a few small operations, constant depth, no long measurement protocol (surface-code operations guide 1.1: which gates are needed). How cup products become such gates is shown by a concrete construction in Zhu's paper (arXiv:2501.19375, sections II.1–II.2), stated below with its conditions; the levels of gates (Clifford, level 3) are explained in the catch-up at the end of this section.
二维:两份码,一张 CZ 电路。条件:一个 CSS 码放在一个二维的三角剖分triangulation:把曲面切成三角形,任意两个三角形要么不相碰、要么共用一条边或一个顶点。图 1.4 就是环面的一个三角剖分。上——比特在边上,X 检查在顶点上(星),Z 检查在三角形上——例如图 1.4 那块切成三角形的环面(环面码的三角形变体)。这个三角剖分还要是闭的:整张曲面没有边缘,每条边恰好挨着两个三角形(图 1.4 的环面是闭的;剪开成有边界的平面贴片就不是)。论文第 II.1 节的一般说法是:总值 ∫ 只在一组没有边缘的三角形 Σ 上求和,∂Σ = 0,意思是每条边被 Σ 里偶数个三角形挨着;闭曲面就取 Σ = 整张曲面。为什么要这一条:引理 1 的证明里,乘一颗星(X 检查)会让总值多出两项,一项因为另一份码满足 Z 检查而为 0,另一项按斯托克斯定理等于 Σ 边缘上的一个和;没有边缘,它才是 0,电路才不把态推出码空间。取这个码的两份拷贝 A、B。电路:对每个三角形 [v₀v₁v₂],在 A 的边 v₀v₁ 上的比特和 B 的边 v₁v₂ 上的比特之间做一个 CZcontrolled-Z:两个比特都是 1 时把态乘 −1,否则不变。它是 Clifford 门。——正是公式里「α 看第一条边、β 看第二条边」的样子。常深度的理由:闭曲面上每条边只挨两个三角形,所以每个比特最多进 2 个 CZ,每个 CZ 最多和另外 2 个 CZ 共用比特;把 CZ 逐个放进第一个没有冲突的层,最多 3 层就排完,码再大也不变。(在一般的复形上,一条边可以挨任意多个三角形;那时要另外要求「每个比特进的门数有一个与码大小无关的上界」,常深度才成立。)论文的引理 1 证明:这个电路保持码空间,而且对逻辑比特做的是:在 A 的逻辑比特 α 与 B 的逻辑比特 β 之间做一个逻辑 CZ,当且仅当 ∫α ⌣ β = 1。在图 1.4 的环面上,∫α ⌣ β = ∫β ⌣ α = 1,∫α ⌣ α = ∫β ⌣ β = 0,所以电路做的是两个逻辑 CZ:(A 的 α)–(B 的 β) 与 (A 的 β)–(B 的 α)。相位的小例子:A 的两个逻辑比特读作 (α, β) = (1, 0),B 读作 (0, 1):指数 = 1·1·∫α ⌣ β = 1,这个态乘上 −1;A、B 都读作 (1, 0):指数 = 1·1·∫α ⌣ α = 0,不变。16 种组合的指数表与 1.3 节的表同形(脚本核对)。CZ 是 Clifford 门,与二维的 Bravyi–König 天花板一致。
Two dimensions: two copies, one CZ circuit. Conditions: a CSS code on a two-dimensional triangulationCutting a surface into triangles such that two triangles either do not touch or share exactly one edge or one vertex. Fig. 1.4 is a triangulation of the torus., with qubits on edges, X checks on vertices (stars) and Z checks on triangles, for example the triangulated torus of Fig. 1.4 (a triangular variant of the toric code). The triangulation must also be closed: the surface has no edge, so every edge borders exactly two triangles (the torus of Fig. 1.4 is closed; a planar patch cut out of it is not). The general form in section II.1 of the paper: the total ∫ is summed over a set of triangles Σ without boundary, ∂Σ = 0, meaning that every edge borders an even number of triangles of Σ; on a closed surface Σ is the whole surface. Why this is needed: in the proof of Lemma 1, multiplying by a star (an X check) adds two terms to the total; one vanishes because the other copy passes its Z checks, and the other equals, by Stokes' theorem, a sum over the boundary of Σ. Only without a boundary is that term 0, so that the circuit does not push the state out of the code space. Take two copies A and B. The circuit: for every triangle [v₀v₁v₂], apply a CZcontrolled-Z: multiplies the state by −1 when both qubits are 1, otherwise does nothing. It is a Clifford gate. between the qubit on edge v₀v₁ of A and the qubit on edge v₁v₂ of B, the “α looks at the first edge, β at the second” of the formula. Why the depth is constant: on a closed surface each edge borders two triangles, so each qubit joins at most 2 CZs and each CZ shares a qubit with at most 2 others; placing the CZs one by one into the first layer without a conflict uses at most 3 layers, however large the code. (On a general complex an edge can border any number of triangles; constant depth then needs the extra condition that the number of gates per qubit has a bound independent of the code size.) Lemma 1 of the paper proves that this circuit preserves the code space and acts on the logical qubits as follows: a logical CZ between logical qubit α of A and logical qubit β of B exactly when ∫α ⌣ β = 1. On the torus of Fig. 1.4, ∫α ⌣ β = ∫β ⌣ α = 1 and ∫α ⌣ α = ∫β ⌣ β = 0, so the circuit performs two logical CZs: (α of A)–(β of B) and (β of A)–(α of B). A small phase example: A's two logical qubits read (α, β) = (1, 0) and B's read (0, 1): exponent = 1·1·∫α ⌣ β = 1, so this state is multiplied by −1; A and B both read (1, 0): exponent = 1·1·∫α ⌣ α = 0, unchanged. The table of exponents over all 16 combinations has the same shape as the table of 1.3 (checked by script). CZ is a Clifford gate, as the two-dimensional Bravyi–König ceiling requires.
三维:三份码,一张 CCZ 电路。条件:CSS 码放在三维的三角剖分上(比特在边上,X 检查在顶点上,Z 检查在三角形上),三份拷贝 A、B、C。三角剖分同样要是闭的(没有边缘,比如下面的三维环面),或者只在一组没有边缘的四面体 Σ 上求和(∂Σ = 0),理由与二维相同。电路:对每个四面体 [v₀v₁v₂v₃](用 Σ 的那种做法时,只对属于 Σ 的四面体;否则不能保证码空间不变),在 A 的边 v₀v₁、B 的边 v₁v₂、C 的边 v₂v₃ 上的三个比特做一个 CCZcontrolled-controlled-Z:三个比特都是 1 时把态乘 −1,否则不变。它在 Clifford 层级的第 3 级,不是 Clifford 门。。三维里一条边可以挨很多个四面体,所以常深度要一个额外的条件:每个比特进的 CCZ 个数有一个与码大小无关的上界 s。有了它,每个 CCZ 最多和 3(s − 1) 个别的 CCZ 共用比特,逐个放层最多要 3s − 2 层。下面 3 × 3 × 3 的例子里 s = 2,脚本实际排成 2 层。引理 2 证明:它保持码空间,并在 A 的 α、B 的 β、C 的 γ 之间实现逻辑 CCZ,当且仅当 ∫α ⌣ β ⌣ γ = 1。三维里 1 次类的对偶形状是膜(1.4 节),所以 ∫α ⌣ β ⌣ γ 数的是三张对偶膜共同交点个数的奇偶(论文式 (42)),不是「三条圈相遇」。例子:三维环面(一个立方体,三对相对的面各自粘起来)有三个 1 次类 x、y、z,对偶膜分别是垂直于三个坐标轴的平面;三张互相垂直的平面恰好交于一点,所以 ∫x ⌣ y ⌣ z = 1;只要有两个方向相同(比如 x、x、y),两张平行的膜不相交,总值为 0。本篇脚本在 3 × 3 × 3 的三维环面(27 个顶点、162 个四面体)上逐一核对了全部 27 种组合,并对 300 组随机的星检查变形复算,结果不变。相位:每份码有 3 个逻辑比特,记成 (x 位, y 位, z 位)。脚本算出 ∫ = 1 的组合 (A 的类, B 的类, C 的类) 正好是 x、y、z 的 6 种排列,所以这张电路是 6 个逻辑 CCZ 的乘积,相位指数 = 这 6 项「A 的位 · B 的位 · C 的位」之和 mod 2。例:A = (1, 0, 0)、B = (0, 1, 0)、C = (0, 0, 1),只有 (x, y, z) 一项是 1,态乘上 −1。反例:A = B = (1, 1, 0)、C = (0, 0, 1),(x, y, z) 与 (y, x, z) 两项都是 1,和为 2,态不变——虽然 A 的 x 位、B 的 y 位、C 的 z 位都是 1。所以只看三个指定的位不够,别的位要一起算。脚本对全部 512 种逻辑赋值(每份码取随机的代表)核对了这条公式。CCZ 在第 3 级,是非 Clifford 门——正是三维里 Bravyi–König 允许到的层级。
Three dimensions: three copies, one CCZ circuit. Conditions: a CSS code on a three-dimensional triangulation (qubits on edges, X checks on vertices, Z checks on triangles), three copies A, B, C. The triangulation must again be closed (no boundary, like the three-torus below), or the sum must run over a set of tetrahedra Σ without boundary (∂Σ = 0), for the same reason as in two dimensions. The circuit: for every tetrahedron [v₀v₁v₂v₃] (in the Σ variant, only for the tetrahedra belonging to Σ; otherwise the code space is not guaranteed to be preserved), apply a CCZcontrolled-controlled-Z: multiplies the state by −1 when all three qubits are 1, otherwise does nothing. It sits at level 3 of the Clifford hierarchy and is not a Clifford gate. to the qubits on edge v₀v₁ of A, edge v₁v₂ of B and edge v₂v₃ of C. In three dimensions an edge can border many tetrahedra, so constant depth needs an extra condition: the number of CCZs per qubit has a bound s independent of the code size. Then each CCZ shares a qubit with at most 3(s − 1) others, and placing them one by one needs at most 3s − 2 layers. In the 3 × 3 × 3 example below s = 2, and the script packs the circuit into 2 layers. Lemma 2 proves that it preserves the code space and performs a logical CCZ on α of A, β of B and γ of C exactly when ∫α ⌣ β ⌣ γ = 1. In three dimensions the dual shape of a degree-1 class is a membrane (1.4), so ∫α ⌣ β ⌣ γ counts, mod 2, the points common to three dual membranes (the paper's eq. (42)), not “three loops meeting”. Example: the three-dimensional torus (a cube with each pair of opposite faces glued) has three degree-1 classes x, y, z whose dual membranes are planes perpendicular to the three axes; three mutually perpendicular planes meet in exactly one point, so ∫x ⌣ y ⌣ z = 1; whenever two directions repeat (x, x, y, say), two parallel membranes never meet and the total is 0. This guide's script checked all 27 combinations on the 3 × 3 × 3 three-torus (27 vertices, 162 tetrahedra) and recomputed after 300 random star-check deformations, with the same results. Phase: each copy has 3 logical qubits, written (x bit, y bit, z bit). The script finds that the combinations (class of A, class of B, class of C) with ∫ = 1 are exactly the 6 orderings of x, y, z, so the circuit is a product of 6 logical CCZs and the phase exponent is the sum of the 6 terms “bit of A · bit of B · bit of C”, mod 2. Example: A = (1, 0, 0), B = (0, 1, 0), C = (0, 0, 1); only the (x, y, z) term is 1, so the state is multiplied by −1. Counterexample: A = B = (1, 1, 0), C = (0, 0, 1); both the (x, y, z) and the (y, x, z) terms are 1, the sum is 2, and the state is unchanged, even though A's x bit, B's y bit and C's z bit are all 1. So the three named bits alone do not decide the phase; the other bits count too. The script checked this formula on all 512 logical assignments (each copy in a random representative). CCZ is at level 3, a non-Clifford gate, which is exactly the level Bravyi–König allows in three dimensions.
这个构造说明了什么,没说明什么。它证明:满足这些条件的码带着这些具体的常深度电路作为逻辑门,门由上积的总值决定。它不说一个码只有这些门,也不能判定任意一个常深度操作做的是什么门;单看两两或三三重叠也不能给门分类。这就是标题那句话的范围:如果机器能在码的结构上算出上积,它就能为这样构造出来的门出具证书——而不是判定这个码所有的门,也不能取代 Bravyi–König 那样的禁止定理。QEC-Bank 设计文档 3.2 节把这一点写进了数据模型:“cohomology operations (cup products) — these are operations-facet inputs, since they certify native non-Clifford logicals on product codes (Zhu, arXiv:2501.19375).” 本篇读了这篇论文的第 II.1–II.2 节(上面两个构造的出处);第 VI.1–VI.2 节只读了检查与比特放在哪一维的格子上(4.4 节用到),没有读它怎样把一般的乘积码变成这样的复形的构造与证明(第 III–V 节及第 VI 节其余部分)。
What the construction shows, and what it does not. It proves that codes meeting these conditions carry these particular constant-depth circuits as logical gates, the gates being fixed by the totals of cup products. It does not say that a code has only these gates, it cannot decide which gate an arbitrary constant-depth operation performs, and pairwise or triple overlaps on their own do not classify gates. That is the scope of the title: if a machine can compute cup products on a code's structure, it can certify the gates built this way, not classify every gate a code might have, and not replace obstructions such as Bravyi–König. The QEC-Bank design document, section 3.2, wrote this into the data model: “cohomology operations (cup products) — these are operations-facet inputs, since they certify native non-Clifford logicals on product codes (Zhu, arXiv:2501.19375).” This guide read sections II.1–II.2 of that paper (the source of the two constructions above); of sections VI.1–VI.2 it read only which cell dimensions hold the checks and the qubits (used in 4.4), not the constructions and proofs that turn general product codes into such complexes (sections III–V and the rest of VI).
补课 · Clifford 层级:为什么 T 不是 Clifford 门Catch-up · The Clifford hierarchy: why T is not a Clifford gate
门按「它把泡利串变成什么」分级。记 U† 为撤销 U 的门,「U 把 P 变成 U P U†」。第 1 级 C₁:泡利串本身。第 2 级 C₂(Clifford 门):把每条泡利串变成另一条泡利串(可带 ± 或 ±i)。第 3 级 C₃:把每条泡利串变成一个第 2 级的门。低一级的门都属于高一级:C₁ ⊂ C₂ ⊂ C₃(泡利串把泡利串变成 ± 它自己,所以在 C₂ 里;Clifford 门把泡利串变成泡利串,而泡利串属于 C₂,所以 Clifford 门在 C₃ 里)。CZ 在 C₂,CCZ 和 T 在 C₃ 而不在 C₂。为什么非 Clifford 的东西不可少。Gottesman–Knill 定理说:从稳定子态出发(例如全 |0⟩)、只用 Clifford 门和泡利测量的电路,普通计算机能高效模拟。「从稳定子态出发」这个条件不能省:同样的 Clifford 电路,输入换成非稳定子的魔法态就不再好模拟——Yoganathan、Jozsa 与 Strelchuk(arXiv:1806.03200)证明,只以魔法态为输入的 Clifford 电路在标准的复杂性假设下难以经典模拟;配上魔法态注入,Clifford 操作还能做通用计算(2.1 节表面码的那条 T 就是这样得到的)。所以通用量子计算需要的是某种非 Clifford 的资源:一个非 Clifford 门(T 是最常用的一例,在第 3 级),或者非稳定子的输入态。Bravyi–König 的「一个空间维度一级」说的是:D 维拓扑码上局域常深度的操作最多到第 D 级;二维最多到第 2 级,即 Clifford。
Gates are graded by what they turn Pauli strings into. Write U† for the gate that undoes U, and “U turns P into U P U†”. Level 1, C₁: the Pauli strings themselves. Level 2, C₂ (Clifford gates): every Pauli string goes to another Pauli string (possibly with ± or ±i). Level 3, C₃: every Pauli string goes to a level-2 gate. Every gate of a lower level also belongs to the higher one: C₁ ⊂ C₂ ⊂ C₃ (a Pauli string turns Pauli strings into ± themselves, so it lies in C₂; a Clifford gate turns Pauli strings into Pauli strings, which lie in C₂, so it lies in C₃). CZ is in C₂; CCZ and T are in C₃ but not in C₂. Why something non-Clifford is indispensable. The Gottesman–Knill theorem says: circuits that start from stabilizer states (all |0⟩, say) and use only Clifford gates and Pauli measurements can be simulated efficiently on an ordinary computer. The condition “start from stabilizer states” cannot be dropped: the same Clifford circuits fed non-stabilizer magic states are no longer easy to simulate. Yoganathan, Jozsa and Strelchuk (arXiv:1806.03200) show that Clifford circuits with only magic-state inputs are hard to simulate classically under standard complexity assumptions, and with magic-state injection Clifford operations become universal (that is how the surface-code T of 2.1 is obtained). So universal quantum computation needs some non-Clifford resource: a non-Clifford gate (T is the most common example, at level 3), or non-stabilizer input states. Bravyi–König's “one level per spatial dimension” says: on a D-dimensional topological code, local constant-depth operations reach at most level D; in two dimensions at most level 2, the Clifford gates.
算两个例子(2 × 2 矩阵,X = [0 1 ; 1 0])Two worked examples (2 × 2 matrices, X = [0 1 ; 1 0])
S = [1 0 ; 0 i],S† = [1 0 ; 0 −i]。S·X = [0 1 ; i 0],再乘 S†:[0 −i ; i 0] = Y。泡利变成泡利(S 把 Z 变成 Z 自己),所以 S 是 Clifford 门。
S = [1 0 ; 0 i], S† = [1 0 ; 0 −i]. S·X = [0 1 ; i 0], then times S†: [0 −i ; i 0] = Y. A Pauli goes to a Pauli (and S turns Z into Z itself), so S is a Clifford gate.
T = [1 0 ; 0 w],w = eiπ/4 =(1 + i)/√2,T† = [1 0 ; 0 w̄],w̄ = e−iπ/4。T·X = [0 1 ; w 0],再乘 T†:[0 w̄ ; w 0]。它等于 (X + Y)/√2(把 X = [0 1 ; 1 0]、Y = [0 −i ; i 0] 代进去逐格核对:右上 (1 − i)/√2 = w̄,左下 (1 + i)/√2 = w),是两条泡利串的和,不是一条泡利串,所以 T 不是 Clifford 门。但 [0 w̄ ; w 0] = w̄ · [0 1 ; i 0] = w̄ · S·X(i·w̄ = w),是一个 Clifford 门乘一个相位;T 又把 Z 变成 Z。所以 T 在第 3 级。
T = [1 0 ; 0 w] with w = eiπ/4 = (1 + i)/√2, T† = [1 0 ; 0 w̄], w̄ = e−iπ/4. T·X = [0 1 ; w 0], then times T†: [0 w̄ ; w 0]. This equals (X + Y)/√2 (substitute X = [0 1 ; 1 0], Y = [0 −i ; i 0] and check entry by entry: top right (1 − i)/√2 = w̄, bottom left (1 + i)/√2 = w), a sum of two Pauli strings rather than one Pauli string, so T is not a Clifford gate. But [0 w̄ ; w 0] = w̄ · [0 1 ; i 0] = w̄ · S·X (since i·w̄ = w), a Clifford gate times a phase; and T turns Z into Z. So T sits at level 3.
cup-products · “Cohomology operations (cup products) on explicit complexes” · status: open · difficulty: open-research
“Compute cup products / cohomology operations on the chain complexes of product codes to certify native non-Clifford logicals (arXiv:2501.19375).”
cup-products · “Cohomology operations (cup products) on explicit complexes” · status: open · difficulty: open-research
“Compute cup products / cohomology operations on the chain complexes of product codes to certify native non-Clifford logicals (arXiv:2501.19375).”
逐词翻译。Compute:要机器算出来,不是从论文抄。cup products / cohomology operations:1.4 节那种「两个上同调类乘成第三个」的运算及其推广。chain complexes:链复形chain complex:QEC-Bank 存放 CSS 码的标准形式——几张 0/1 矩阵(谁是谁的边界)串成一列,相邻两张相乘为零。基础页一句话:“Two classical codes with H_X H_Z^T = 0 are one chain complex; homology counts logicals.”,QEC-Bank 存 CSS 码的标准形式:环面码的「顶点—边—面」三层,就是一个链复形(qLDPC 教程 1.2 节的两张稀疏矩阵加对易条件)。product codes:乘积码product code:把两个小的经典码或链复形「相乘」得到的量子码。表面码与环面码 = 重复码 × 重复码(超图积);BB 码是提升积。——用两个小零件「相乘」造出来的码:表面码和环面码是重复码 × 重复码(qLDPC 教程 3.1 节),BB 码是把 0/1 换成多项式的提升积(BB 教程 2.3 节)。这道题的 related 恰好是这两个条目:surface 与 bivariate_bicycle。certify:给出机器能核对的证明,不只是断言。native non-Clifford logicals:码自带的非 Clifford 逻辑门(第 3 级的门,如 T、CCZ),不靠外部注入的「魔法态」(表面码操作教程 1.3 节)。(arXiv:2501.19375):题目指向的论文(1.5 节的两个构造出自它的第 II 节),QEC-Bank 的参考文献登记表里尚无它的条目——据条目记载,登记待补。人话:让机器在 QEC-Bank 已有的乘积码结构上算出上积,从而证明「这个码天生带一个非 Clifford 门」(比如 1.5 节那种 CCZ)。
Word by word. Compute: the machine must work it out, not copy it from a paper. cup products / cohomology operations: the “two cohomology classes multiplied into a third” operation of 1.4 and its generalizations. chain complexes: the chain complexThe QEC-Bank's standard form for CSS codes: several 0/1 matrices (who is whose boundary) in a row, with adjacent ones multiplying to zero. The foundations one-liner: “Two classical codes with H_X H_Z^T = 0 are one chain complex; homology counts logicals.”, the QEC-Bank's standard form for CSS codes: the toric code's three layers vertices, edges, faces form one (the two sparse matrices plus commutation condition of qLDPC guide 1.2). product codes: product codesQuantum codes obtained by “multiplying” two small classical codes or chain complexes. Surface and toric codes = repetition × repetition (hypergraph product); BB codes are lifted products., codes built by “multiplying” two small parts: surface and toric codes are repetition × repetition (qLDPC guide 3.1), BB codes are lifted products with 0/1 replaced by polynomials (BB guide 2.3). This item's related list is exactly those two entries: surface and bivariate_bicycle. certify: produce a machine-checkable proof, not just an assertion. native non-Clifford logicals: non-Clifford logical gates (level-3 gates such as T or CCZ) the code has on its own, without externally injected “magic states” (surface operations guide 1.3). (arXiv:2501.19375): the paper the item points to (the two constructions of 1.5 come from its section II); the QEC-Bank reference registry has no entry for it yet: cited by the entry, registration pending. In plain words: have a machine compute cup products on the product-code structures the QEC-Bank already holds, and thereby prove “this code natively carries a non-Clifford gate” (a CCZ like that of 1.5, say).
QEC-Bank 现在是怎么凑合的:十四条记录,一个词How the QEC-Bank copes today: fourteen records, one word
没有能算上积的机器,QEC-Bank 的「逻辑操作」侧面对非 Clifford 门就只能做一件事:把论文里说的门抄下来,写清出处,标上 claimed。这一章把 related 的两个条目——surface 与 bivariate_bicycle——的全部操作记录逐字列出来,数一数其中有几条非 Clifford、几条是机器算的。答案分别是 1 和 0。 Without a machine that computes cup products, the QEC-Bank “Logical operations” facet can do only one thing about non-Clifford gates: copy the gates papers describe, cite the source, and mark them claimed. This chapter lists every operations record of the two related entries, surface and bivariate_bicycle, verbatim, and counts how many are non-Clifford and how many were computed by the machine. The answers are 1 and 0.
“Curated operations entries with refs.”
“Curated operations entries with refs.”
四个词。Curated:人工整理——由人读论文、挑出条目、写进卡片;QEC-Bank 的证据词表里,与它相对的是 derived(机器从数据算出)和 verified(机器算出并有证书核对)。operations entries:每个条目 card.yaml 里的 operations 字段,一条记录 = 一个门。with refs:每条附一个文献键。人话:今天「这个码有哪些门」这一栏,除了少数小码上 Pauli / Clifford 层面的 verified 记录(环面码的两块 CNOT、[[4,2,2]] 的 CZ),其余全是人抄的;非 Clifford 门一条也不是机器算的。
Four words. Curated: assembled by hand, a person read the papers, picked the items and wrote them into the card; in the QEC-Bank vocabulary its opposites are derived (computed by the machine from data) and verified (computed and checked against a certificate). operations entries: the operations field of each entry's card.yaml, one record = one gate. with refs: each carries a bibliography key. In plain words: today, apart from a few Pauli- or Clifford-level verified records on small entries (the toric two-block CNOT, the [[4,2,2]] CZ), the column “which gates does this code have” is copied by people, and no non-Clifford gate has been computed by the machine.
2.1surface:九条记录,八条 Clifford 级以下,一条 T——靠魔法态surface: nine records, eight at Clifford level or below, one T by magic state
下表逐字转录 codes/surface/card.yaml 的 operations 字段(九条断言 atlas-assertion:surface:operations:0…8),也就是 QEC-Bank 表面码条目「逻辑操作」页面上显示的内容。每条有 gate(门)、mechanism(机制)、level(层级)、cost(成本)与 origin(证据词 + 文献键)。
The table transcribes the operations field of codes/surface/card.yaml verbatim (the nine assertions atlas-assertion:surface:operations:0…8), which is what the QEC-Bank surface entry's “Logical operations” page displays. Each has gate, mechanism, level, cost and origin (evidence word + bibliography key).
| # | gate | mechanism | level | origin |
|---|---|---|---|---|
| 0 | CNOT | surgery | Clifford | claimed · horsman2012surface |
| 1 | CNOT | transversal | Clifford | claimed · bluvstein2024logical |
| 2 | CNOT | braiding | Clifford | claimed · fowler2012surface |
| 3 | single-qubit Clifford | braiding | Clifford | claimed · brown2017poking |
| 4 | H / S | fold-transversal | Clifford | claimed · moussa2016transversal |
| 5 | logical |0> / |+> initialization | measurement-based | stabilizer preparation | claimed · fowler2012surface |
| 6 | logical Z / X readout | measurement-based | stabilizer measurement | claimed · fowler2012surface |
| 7 | Pauli-frame update | measurement-based | Clifford bookkeeping | claimed · fowler2012surface |
| 8 | T | measurement-based | non-Clifford | claimed · bravyi2005magic |
mechanism 一栏的词(第 2.2 节的表也用到)。transversal(横向):每个物理比特上各做一个门,两块码之间则在位置对应的比特对上各做一个门;同一块码里的比特互不作用,所以一个故障最多坏掉每块里的一个比特。surgery(格点手术):暂时在两块码的边界之间加上新的检查,把它们「缝」成一块,重复测量若干轮再拆开;缝合时读出的检查值合起来,就是两块逻辑算符乘积(例如 Z̄⊗Z̄)的测量结果,CNOT 由几次这样的测量拼成。braiding(编织):在码里「挖洞」(关掉一片检查),随时间把一个洞沿闭合路径绕另一个洞一圈,绕法决定做了哪个门(例如 CNOT)。fold-transversal(折叠横向):利用码的一种把 X 检查换成 Z 检查的对称(例如表面码沿对角线的镜像),像把码沿对称轴对折一样:落在折痕上的比特各做一个单比特门,被折到一起的比特对各做一个双比特门。measurement-based(基于测量):门由测量、以及按测量结果做的泡利修正完成。automorphisms(自同构):把比特重新编号、使检查的集合整体不变的一种置换;它把码空间映到自己,因而给出逻辑门。
The words of the mechanism column (the table of 2.2 uses them too). transversal: one gate on each physical qubit, or, between two blocks, one gate on each pair of qubits in corresponding positions; qubits of the same block never interact, so one fault damages at most one qubit per block. surgery (lattice surgery): temporarily add new checks across the boundary between two blocks, “stitching” them into one, measure for several rounds, then cut them apart; the check values read while stitched combine into the measurement of a product of the two blocks' logical operators (Z̄⊗Z̄, say), and a CNOT is assembled from a few such measurements. braiding: cut “holes” in the code (switch off a patch of checks) and, over time, move one hole along a closed path around another; the path decides the gate (a CNOT, for example). fold-transversal: use a symmetry of the code that exchanges X checks with Z checks (the diagonal mirror of the surface code, for example), as if folding the code along that axis: qubits on the crease get one single-qubit gate each, and pairs folded onto each other get one two-qubit gate each. measurement-based: the gate is done by measurements plus Pauli corrections chosen from their outcomes. automorphisms: a relabelling of the qubits that maps the set of checks onto itself; it maps the code space to itself and so yields logical gates.
九条的 origin 全是 claimed。唯一一条 non-Clifford 是第 8 条 T 门,它的 cost 字段原文是:“inject and distill a magic state, then consume it by gate teleportation; factory spacetime dominates.” 也就是说,这个 T 不是表面码自带的:先在码外制备一个带噪的魔法态magic state:一个特殊的单比特量子态,配合 Clifford 操作与测量可以「传送」出一个 T 门。要用许多份带噪的蒸馏成一份高质量的,代价极大。,再蒸馏,再用门传送消耗掉,「工厂的时空体积占主导」。这不是 Wanted 板要的 native(自带的)非 Clifford 门。而且对二维表面码来说,自带的 T 门根本不可能:表面码操作教程 1.3 节讲过 Bravyi–König 定理——二维拓扑稳定子码上,局域、常深度的操作最多做到 Clifford 层级。QEC-Bank 的基础页 foundations/bounds/bravyi-koenig.md 把它压成一句口号:“A constant-depth local circuit gets one hierarchy level per spatial dimension.” 人话:表面码的 T 是买来的,不是天生的;而且二维平面上天生不了。
All nine origins are claimed. The only non-Clifford one is record 8, the T gate, whose cost field reads: “inject and distill a magic state, then consume it by gate teleportation; factory spacetime dominates.” That is, this T is not native to the surface code: a noisy magic stateA special single-qubit quantum state which, together with Clifford operations and measurements, can “teleport” a T gate into place. Many noisy copies must be distilled into one good one, at great cost. is prepared outside the code, distilled, then consumed by gate teleportation, with “factory spacetime dominating”. That is not the native non-Clifford gate the Wanted board asks for. And for the two-dimensional surface code a native T is impossible outright: section 1.3 of the surface operations guide covered the Bravyi–König theorem, that on a 2D topological stabilizer code, local constant-depth operations reach at most the Clifford level. The QEC-Bank foundations page foundations/bounds/bravyi-koenig.md compresses it into a slogan: “A constant-depth local circuit gets one hierarchy level per spatial dimension.” In plain words: the surface code's T is bought, not born; and in a 2D plane it cannot be born.
2.2bivariate_bicycle:五条记录,全部 Clifford,全部 claimedbivariate_bicycle: five records, all Clifford, all claimed
BB 条目的 operations 字段有五条(atlas-assertion:bivariate_bicycle:operations:0…4)。BB 逻辑操作教程 1.3 节已经逐字转录并逐条讲解,这里只列门、机制、层级与证据词:
The BB entry's operations field has five records (atlas-assertion:bivariate_bicycle:operations:0…4). Section 1.3 of the BB operations guide already transcribes and explains them one by one; here only gate, mechanism, level and evidence word:
| # | gate | mechanism | level | origin |
|---|---|---|---|---|
| 0 | CNOT between identical BB blocks | transversal | Clifford | claimed · yoder2025tour |
| 1 | selected logical Clifford generators | fold-transversal | Clifford | claimed · eberhardt2024fold |
| 2 | logical Clifford operations through automorphisms | fold-transversal | Clifford | claimed · sayginel2025automorphisms |
| 3 | inter-block Pauli measurements and Clifford surgery | surgery | Clifford | claimed · yoder2025tour |
| 4 | H / S / CNOT in the self-dual BB subfamily | transversal | Clifford | claimed · liang2025selfdual |
五条 level 全是 Clifford,origin 全是 claimed,而且 applies_to 全是 eczoo-entity:qcga#collection——说的是 BB 这一族,不是 gross 一块。BB 条目没有任何一条非 Clifford 记录:既没有自带的,也没有买来的。BB 操作教程 5.2 节给出的负面结论是「gross 没有普适的横向门集」,5.3 节说 T 仍要靠码外的魔法态。注意区别:BB 码不是二维局域的(BB 教程 1.2 节),Bravyi–König 定理不直接禁止它有自带的非 Clifford 门——所以「BB 卡片上没有」是没有记录,不是证明了没有。这正是这道 Wanted 题会改变的地方。
All five levels are Clifford, all origins claimed, and applies_to is eczoo-entity:qcga#collection throughout, the BB family rather than the single gross block. The BB entry has no non-Clifford record at all, native or bought. Section 5.2 of the BB operations guide states the negative conclusion “no universal transversal gate set for gross”, and 5.3 that T still relies on magic states from outside the code. Mind the distinction: BB codes are not 2D-local (BB guide 1.2), so the Bravyi–König theorem does not directly forbid a native non-Clifford gate for them; hence “none on the BB card” means no record, not proven absent. That is exactly what this Wanted item would change.
14 条操作记录(9 + 5),14 条 claimed,0 条 derived,0 条 verified;非 Clifford 记录 1 条(surface 的 T,靠魔法态),自带的非 Clifford 记录 0 条。另外一个事实:截至 2026-09-12,exports/site/entries/ 下没有任何页面链接到 Wanted 板的 cup-products 项(grep 结果为空)——这道题今天还没有从任何一个证据词旁边被「深链」出来,不像 fast-distance 从 bounded 旁边、fermionic-compiler 从 curated 旁边被链出。
14 operations records (9 + 5), 14 claimed, 0 derived, 0 verified; non-Clifford records 1 (the surface T, by magic state), native non-Clifford records 0. One more fact: as of 2026-09-12 no page under exports/site/entries/ links to the cup-products item on the Wanted board (the grep is empty); unlike fast-distance, deep-linked from beside a bounded badge, or fermionic-compiler from beside a curated one, this item is not yet reachable from any evidence word.
2.3一个 partial 的邻居:transversal-gate-certA partial neighbour: transversal-gate-cert
Wanted 板上还有一道题瞄准同一个目标,状态是 partial(部分完成),本系列不为它单开一篇。transversal-gate-cert「Transversal-gate certification library」的 statement 原文:“Given a code, enumerate/certify its transversal logical gates. Routes: triorthogonality checks (done, exact), automorphism-based logical Cliffords (Tanner-graph autos via nauty), brute force for small n.” 它的 why_it_matters:“Turns the operations facet from claimed(ref) into verified for the gates that matter; feeds fair comparison of computation, not just memory.” 两道题的区别:transversal-gate-cert 走代数路线——直接在检查矩阵上检验一种叫三正交性的条件(已完成、精确)、或枚举 Tanner 图的对称(待做)、或对小 n 穷举;cup-products 走拓扑路线——从链复形的形状算出门。目标一样:把 operations 的 claimed 变成 verified。
One more item on the Wanted board aims at the same target, with status partial; this series gives it no page of its own. The statement of transversal-gate-cert, “Transversal-gate certification library”, verbatim: “Given a code, enumerate/certify its transversal logical gates. Routes: triorthogonality checks (done, exact), automorphism-based logical Cliffords (Tanner-graph autos via nauty), brute force for small n.” Its why_it_matters: “Turns the operations facet from claimed(ref) into verified for the gates that matter; feeds fair comparison of computation, not just memory.” The difference: transversal-gate-cert takes the algebraic road, testing a condition called triorthogonality directly on the check matrices (done, exact), or enumerating Tanner-graph symmetries (to do), or brute force for small n; cup-products takes the topological road, computing gates from the shape of the chain complex. Same goal: turn claimed into verified in the operations facet.
这里有三个生词。三正交性(triorthogonality,Bravyi 与 Haah,arXiv:1209.2426):一个 0/1 矩阵,若任意两行的重叠(两行同时为 1 的位置个数)都是偶数,任意三行的重叠也都是偶数,就叫三正交的;他们证明,由三正交矩阵构造的稳定子码对全部逻辑比特有横向 T 门(可能再配上 Clifford 门)。手算一例:三行 11110000、11001100、10101010。两两重叠:第 1、2 行同时为 1 的是第 1、2 位,2 个;第 1、3 行是第 1、3 位,2 个;第 2、3 行是第 1、5 位,2 个——都是偶数。三行同时为 1 的只有第 1 位,1 个,奇数,所以这个矩阵不是三正交的。加长到 16 位就可以:四行 0000000011111111、0000111100001111、0011001100110011、0101010101010101(0 到 15 这 16 个数写成 4 位二进制,每行取其中一位),两两重叠都是 4,三三重叠都是 2(本篇脚本核对)。这项检查只数重叠,所以是精确的。Tanner 图:每个比特画一个点、每条检查画一个方块,检查碰到哪个比特就连一条线;它的自同构是保持所有连线不变的重新编号,也就是上面说的码的自同构。nauty:一个常用的程序,专门计算图的自同构。在 Wanted 板上查看 transversal-gate-cert →
Three new words here. Triorthogonality (Bravyi and Haah, arXiv:1209.2426): a 0/1 matrix is triorthogonal when the overlap of any two rows (the number of positions where both are 1) is even, and the overlap of any three rows is even as well; they prove that the stabilizer code built from a triorthogonal matrix has a transversal T gate on all its logical qubits (possibly together with Clifford gates). A worked example: the three rows 11110000, 11001100, 10101010. Pairwise overlaps: rows 1 and 2 are both 1 in positions 1 and 2, two positions; rows 1 and 3 in positions 1 and 3, two; rows 2 and 3 in positions 1 and 5, two; all even. All three rows are 1 only in position 1, one position, odd, so this matrix is not triorthogonal. Lengthened to 16 bits it works: the four rows 0000000011111111, 0000111100001111, 0011001100110011, 0101010101010101 (write the 16 numbers 0 to 15 in 4-bit binary and let each row take one of the digits) have all pairwise overlaps 4 and all triple overlaps 2 (checked by this guide's script). The test only counts overlaps, which is why it is exact. Tanner graph: draw a dot for every qubit and a square for every check, and join a check to every qubit it touches; its automorphisms are relabellings that keep every line, i.e. the automorphisms of the code mentioned above. nauty: a widely used program for computing the automorphisms of a graph. See transversal-gate-cert on the Wanted board →
为什么我们想要答案:让 R2 直接喂给「逻辑操作」Why we want the answer: let R2 feed “Logical operations” directly
QEC-Bank 给每个 CSS 码存了一份链复形,那是它算 k、算逻辑算符代表元的地方。今天这份结构和「逻辑操作」侧面之间没有任何机器连接——门那一栏靠人抄。这一章说清楚:有了上积计算器,哪些字会从哪个词翻成哪个词,哪些比较会变得可能,今天的 QEC-Bank 用户做不到什么。 The QEC-Bank stores a chain complex for every CSS code; that is where it computes k and representatives of the logical operators. Today nothing mechanical connects that structure to the “Logical operations” facet; the gate column is copied by hand. This chapter spells out which words would flip to which with a cup-product calculator, which comparisons would become possible, and what a QEC-Bank user cannot do today.
“Connects the homological representation directly to the LogicalOperation facet: the topology computes the gates.”
“Connects the homological representation directly to the LogicalOperation facet: the topology computes the gates.”
3.1「同调表示」是 QEC-Bank 里的哪一层Which rung the “homological representation” is
QEC-Bank 给每个码存一架「表示阶梯」,R1 到 R5。R1 是检查矩阵,R2 是结构。设计文档 3.2 节对 R2 的规定原文:“for all CSS-type entries the chain complex is the default canonical form — homology gives k and logical representatives, systolic data gives distance bounds.” 这就是 why_it_matters 里的 homological representation(同调表示):对每个 CSS 码,链复形是默认的标准形式,从它算出 k(第 0 章事实 3 的「2」正是环面的同调算出来的)和逻辑算符的代表元(1.3 节的四个类)。LogicalOperation facet 就是第 2 章那两张表所在的侧面。Connects … directly:今天两者之间没有箭头——R2 算出「有哪些逻辑算符」就停了,「对它们能做哪些门」另起一行由人填。上积计算器就是那个缺失的箭头。人话:QEC-Bank 已经存了圈的结构,只是还没有人教机器从圈的结构里读出门。
The QEC-Bank stores a “representation ladder” for every code, rungs R1 to R5. R1 is the check matrices, R2 the structure. The design document, section 3.2, on R2 verbatim: “for all CSS-type entries the chain complex is the default canonical form — homology gives k and logical representatives, systolic data gives distance bounds.” That is the homological representation of why_it_matters: for every CSS code the chain complex is the default canonical form, from which k is computed (the “2” of fact 3 in Chapter 0 is exactly the homology of the torus) along with representatives of the logical operators (the four classes of 1.3). The LogicalOperation facet is the facet holding the two tables of Chapter 2. Connects … directly: today there is no arrow between them; R2 stops at “which logical operators exist”, and “which gates act on them” is a separate line filled in by a person. A cup-product calculator is the missing arrow. In plain words: the QEC-Bank already stores the structure of the loops; nobody has yet taught the machine to read gates off that structure.
3.2哪些字会翻Which words would flip
具体到卡片上的字段:
Down to the fields on the card:
| # | 今天Today | 有了上积计算器之后With a cup-product calculator |
|---|---|---|
| 1 | operations[i].origin.kind: claimed,附一个文献键。operations[i].origin.kind: claimed, with a bibliography key. | derived(机器从链复形算出,附转换器名与版本,像 R1 记录那样写 converter/version);若再配一份可核对的证书,则 verified。derived (computed by the machine from the chain complex, with a converter name and version as R1 records carry in converter/version); with a checkable certificate on top, verified. |
| 2 | BB 卡片上没有非 Clifford 记录——「没有记录」。No non-Clifford record on the BB card: “no record”. | 要么多出一条 level: non-Clifford 的记录,写明机制(1.5 节那种上积构造的常深度电路)和它对哪些实例成立;要么多出一条明确的「这个构造没有给出可证的门」。后者不是「证明了没有自带的非 Clifford 门」:这个构造只是充分条件(4.1 节),别的构造仍可能给出门。两者都是信息,今天都没有。Either a new record with level: non-Clifford, naming the mechanism (a constant-depth circuit from the cup-product construction of 1.5) and the instances it holds for, or an explicit “no gate certified by this construction”. The latter is not “proven to have no native non-Clifford gate”: the construction is a sufficient condition only (4.1), and other constructions may still give gates. Both are information, and today neither exists. |
| 3 | surface 的 T:measurement-based,靠魔法态。The surface T: measurement-based, by magic state. | 不变:Bravyi–König 定理说,检查局域的二维拓扑稳定子码上,局域的常深度电路最多做到 Clifford 门,所以表面码不会有这样做出来的自带 T。上积表只能为「有」出具证书;「没有」仍要靠 Bravyi–König 这样的禁止定理,上积表给不出否定。Unchanged: by the Bravyi–König theorem, on a two-dimensional topological stabilizer code with local checks, local constant-depth circuits reach at most the Clifford gates, so the surface code has no native T made that way. A cup-product table can only certify a “yes”; the “no” still rests on an exclusion theorem such as Bravyi–König, which no cup-product table supplies. |
| 4 | 「逻辑操作」页面与「表示阶梯」页面互不引用。The “Logical operations” and “Representation ladder” pages do not reference each other. | 每条 derived 的门记录指回它来自的 R2 链复形与上积表;每个证据词旁边有深链。Every derived gate record points back to the R2 chain complex and cup-product table it came from; every evidence word gets a deep link. |
3.3今天的用户做不到什么What a user cannot do today
三件事。第一,问「gross 上有没有上积构造能证出的非 Clifford 门」并得到机器的回答。今天卡片给的是沉默——五条 Clifford 记录之外什么都没有——而沉默既不是「有」也不是「没有」。机器的「这个构造证不出」也只回答这个构造,不回答「gross 有没有自带的非 Clifford 门」。第二,公平地比较两个乘积码的「计算能力」。QEC-Bank 比较码的性价比用的是 k·d²/n 一类的存储指标(BB 教程 1.1 节);transversal-gate-cert 的 why_it_matters 说得直白:“feeds fair comparison of computation, not just memory”。没有机器算出的门表,「哪个码更适合算」这一栏根本不存在。第三,让新登记的乘积码的一部分门由机器算出。今天每新登记一个码,operations 就要有人去读论文再抄;有了上积计算器,上积构造能证出的那些门可以像 k 一样从登记的复形里算出来。其余的门(手术、编织、魔法态等机制)仍要有人登记并注明出处。人话:今天 QEC-Bank 能告诉你一个码存得多好,不能告诉你它算得多好。
Three things. First, ask “does the cup-product construction certify a non-Clifford gate on gross” and get an answer from the machine. Today the card offers silence, nothing beyond five Clifford records, and silence is neither “yes” nor “no”. A machine's “this construction certifies none” would also answer only for this construction, not the question “does gross have a native non-Clifford gate”. Second, compare the “computational power” of two product codes fairly. The QEC-Bank ranks codes by storage figures of merit such as k·d²/n (BB guide 1.1); the why_it_matters of transversal-gate-cert says it plainly: “feeds fair comparison of computation, not just memory”. Without machine-computed gate tables the column “which code computes better” does not exist. Third, have part of a newly registered product code's gates computed by the machine. Today every new code needs a person to read papers and copy its operations; with a cup-product calculator the gates the cup-product construction certifies could be computed from the registered complex, like k. The other gates (surgery, braiding, magic states and other mechanisms) would still be entered and cited by people. In plain words: today the QEC-Bank can tell you how well a code stores, not how well it computes.
合格的答案长什么样,为什么难What a qualifying answer looks like, and why it is hard
一个合格的答案是一台程序:输入 QEC-Bank 已经存着的链复形,输出一张上积表和从表里读出的、带证书的门清单。难度写的是 open-research——不是「知道怎么做但要做很多」,而是「连该怎么定义都还在研究」。这一章先说输入输出,再说三个诚实的难点,最后用玩具尺度对照一下:难的不是大小。 A qualifying answer is a program: input the chain complexes the QEC-Bank already stores, output a cup-product table and, read off it, a certified list of gates. The difficulty reads open-research: not “known how, much to do” but “even the right definition is still being researched”. This chapter gives input and output first, then three honest difficulties, then a toy-scale comparison: size is not the hard part.
4.1输入与输出Input and output
输入。一个乘积码的链复形。QEC-Bank 基础页 foundations/css-chain-complexes/intuition.md 的一句话定义:“Two classical codes with H_X H_Z^T = 0 are one chain complex; homology counts logicals.” 对环面码,这就是「顶点—边—面」三层和两张矩阵:哪些边碰哪个顶点(星检查),哪些边围哪块面(面检查)。但只有矩阵还不够:上积的公式(1.4 节)要用到复形的形状——哪些格子是三角形、每个三角形的顶点怎样排序。乘积码的矩阵本身不带这些,要从它是怎样乘出来的(两个零件各是什么、怎样配对)去造出这样的复形,这正是 arXiv:2501.19375 所做的事(4.3 节)。
Input. The chain complex of a product code. The one-line definition on the QEC-Bank foundations page foundations/css-chain-complexes/intuition.md: “Two classical codes with H_X H_Z^T = 0 are one chain complex; homology counts logicals.” For the toric code this is the three layers vertices, edges, faces and two matrices: which edges touch which vertex (star checks), which edges bound which face (plaquette checks). Matrices alone are not enough, though: the cup-product formula (1.4) needs the shape of the complex, which cells are triangles and how each triangle orders its corners. The matrices of a product code do not carry this, so such a complex must be built from how the code was multiplied together (what the two parts are and how they pair), which is what arXiv:2501.19375 does (4.3).
记号:HX = X 型检查的 0/1 矩阵(每行一条星检查,每列一个比特),HZ = Z 型检查的矩阵;上标 T = 转置(行列互换);乘积为 0 是「每条星检查与每条面检查共用偶数个比特」的矩阵写法,即第 0 章事实 1 的对易条件(qLDPC 教程 1.2 节)。
Notation: HX = the 0/1 matrix of X-type checks (one row per star check, one column per qubit), HZ = the matrix of Z-type checks; superscript T = transpose (swap rows and columns); the product being 0 is the matrix form of “every star and every plaquette share an even number of qubits”, the commutation condition of fact 1 in Chapter 0 (qLDPC guide 1.2).
输出。两样东西。(1) 一张上积表:对比特所在那一次的上同调类(X 型逻辑算符的类;环面码上是 1 次类,一般的次数 q 见 4.4 节)的每一对、每一个三元组,它们的上积是什么——环面码上就是图 1.4 算出的那些总值(再加上三元组一栏,在环面上全为零:三个 1 次类的上积是 3 次类,而二维的环面上没有 3 维的格子,也就没有非零的 3 次类)。(2) 从表里读出的门证书:对 1.5 节那样由上积构造出来的常深度电路,证明它保持码空间、实现哪个逻辑门、层级是 Clifford 还是非 Clifford,每条附一份机器能核对的证书——是「证明有这些门」,不是「判定全部门」。第 (2) 项就是能直接写进 operations 字段、origin 标 derived 或 verified 的东西。人话:进去的是 QEC-Bank 已经有的矩阵和乘法配方,出来的是门的清单和证书。
Output. Two things. (1) A cup-product table: for every pair and every triple of cohomology classes of the qubits' degree (classes of X-type logicals; degree 1 on the toric code, the general degree q in 4.4), their cup product; on the toric code these are the totals computed with Fig. 1.4 (plus a triples column, all zero on the torus: the product of three degree-1 classes has degree 3, and a two-dimensional torus has no 3-dimensional cells, hence no nonzero degree-3 class). (2) Gate certificates read off the table: for constant-depth circuits built from cup products as in 1.5, a proof that each preserves the code space, which logical gate it performs and whether it is Clifford or non-Clifford, each with a machine-checkable certificate — “these gates exist”, not “all gates decided”. Item (2) is what could be written straight into the operations field with origin derived or verified. In plain words: what goes in is matrices and a multiplication recipe the QEC-Bank already has; what comes out is a list of gates with certificates.
4.2difficulty:open-researchdifficulty: open-research
Wanted 板给难度只有两个词。hard-engineering = 「知道怎么做,但要做很多」;open-research = 「没人知道怎么做」。这道题是 open-research。对照 2.3 节:transversal-gate-cert 是 hard-engineering,因为三正交性检查、图自同构枚举、小 n 穷举都是已知算法,缺的是把它们做完;cup-products 是 open-research:理论构造已经有了(arXiv:2501.19375),但它能不能用在 QEC-Bank 关心的码上、怎样变成可运行的程序,还没有答案(4.3 节)。设计文档 4.1 节的对照表也这样写:“Recent theory (arXiv:2501.19375; Freedman–Hastings lineage); no computational library” —— 有理论,没有可运行的库。
The Wanted board grades difficulty with two words only. hard-engineering = “known how, but much to do”; open-research = “nobody knows how”. This item is open-research. Compare 2.3: transversal-gate-cert is hard-engineering because triorthogonality checks, graph-automorphism enumeration and small-n brute force are known algorithms awaiting completion; cup-products is open-research: a theoretical construction exists (arXiv:2501.19375), but whether it applies to the codes the QEC-Bank cares about, and how it becomes a runnable program, is unanswered (4.3). The design document's comparison table in section 4.1 says the same: “Recent theory (arXiv:2501.19375; Freedman–Hastings lineage); no computational library”, theory exists, a runnable library does not.
4.3三个诚实的难点Three honest difficulties
一、QEC-Bank 存的链复形没有几何。上积的教科书定义依赖「哪块面的哪个角是哪个顶点」这类形状信息,而 QEC-Bank 的链复形库只有矩阵。Wanted 板上另一道 partial 的题 chain-complex-lib 的 statement 原文说得清楚:“Extend the minimal ChainComplex (length-3, no geometry) to cell complexes with boundaries, higher dimensions, and coordinate embeddings.” 它的 current_proxy 是 “qeclib.chain (length-3, matrix-only) + hand-coded lattice dicts.” 也就是说,上积计算器的输入格式本身还没有建好:只有 3 项(顶点、边、面这种三层)的矩阵,没有形状,也没有更高维的层。
One: the chain complexes the QEC-Bank stores have no geometry. The textbook definition of the cup product relies on shape information such as “which corner of which face is which vertex”, while the QEC-Bank chain-complex library holds only matrices. The statement of another partial item on the board, chain-complex-lib, says so verbatim: “Extend the minimal ChainComplex (length-3, no geometry) to cell complexes with boundaries, higher dimensions, and coordinate embeddings.” Its current_proxy is “qeclib.chain (length-3, matrix-only) + hand-coded lattice dicts.” In other words, the input format for a cup-product calculator does not exist yet: 3-term matrices only (three layers, like vertices, edges, faces), no shape and no higher layers.
二、乘积码不一定是「形状」,要先给它造一个。环面码画得出来,因为它真的是一个甜甜圈的表面:比特正好在曲面剖分的边上,检查正好是剖分的星和面。BB 码不是这样的码。它的检查要连到隔几格、绕过环面的比特(BB 教程 1.2 节),所以它不是「比特平铺在平面上、每条检查只碰距离有限的比特、单位面积比特数有界」这种二维局域布局上的码;对这种布局,Bravyi–Poulin–Terhal 定理限定 k·d² ≤ c·n(BB 教程 1.1 节)。注意这和「连线画不画得上曲面」是两回事:任何有限的图都能画在洞足够多(亏格足够高)的曲面上而不交叉;而表面码意义下的「曲面上的码」要求检查恰好是一个剖分的星和面,这比「图能画上去」严格得多。一般的超图积(qLDPC 教程第 2 章)同样不是现成的曲面。arXiv:2501.19375 正是为这件事而写:它的摘要说,从乘积构造得到的 qLDPC 码与 CSS 码都带着「隐藏的」单纯复形或 CW 复形结构——把零件码的 Tanner 图「加厚」成流形,再三角剖分(或收缩回一个 CW 复形),上积就定义在这个结构上,并能诱导非 Clifford 门;论文对两类三维乘积码给出了常深度的逻辑 CCZ。所以缺的不是「没人知道怎样定义」,而是两段具体的空白。其一是适用范围:论文引言写明,要得到第 3 级的非 Clifford 门,码要定义在三维(4 项)链复形上,而 gross 这样的 BB 码是 3 项的;论文的例子也是它自己构造的三维乘积码,不是 QEC-Bank 里现成的 surface 或 gross。能不能、怎样用在 QEC-Bank 的条目上,要有人去做。其二是实现:把论文的构造写成程序、在具体复形上算出上积、再把结果写成证书,今天没有这样的库(4.2 节)。
Two: a product code need not be a “shape”; one has to be built for it. The toric code can be drawn because it really is the surface of a doughnut: its qubits sit exactly on the edges of a cellulation of the surface and its checks are exactly the stars and faces. BB codes are not codes of that kind. Their checks reach qubits a few sites away and around the torus (BB guide 1.2), so they are not codes on a two-dimensional local layout, “qubits tiled in the plane, every check touching only qubits within a bounded distance, a bounded number of qubits per unit area”; for such layouts the Bravyi–Poulin–Terhal theorem caps k·d² ≤ c·n (BB guide 1.1). Note that this is a different matter from whether the connections can be drawn on a surface: every finite graph can be drawn without crossings on a surface with enough holes (high enough genus), while a “code on a surface” in the surface-code sense requires the checks to be exactly the stars and faces of a cellulation, far stricter than “the graph can be drawn”. General hypergraph products (qLDPC guide, Chapter 2) are not ready-made surfaces either. arXiv:2501.19375 is written for exactly this: its abstract states that qLDPC and CSS codes obtained from product constructions carry “hidden” simplicial or CW complex structures, obtained by thickening the Tanner graphs of the component codes into manifolds and triangulating them (or retracting to a CW complex); cup products are defined on that structure and can induce non-Clifford gates, and the paper gives constant-depth logical CCZ gates for two kinds of three-dimensional product codes. So what is missing is not “nobody knows how to define it” but two concrete gaps. One is applicability: the paper's introduction says that a gate at level 3 needs a code defined on a three-dimensional (4-term) chain complex, while BB codes such as gross are 3-term; the paper's examples are three-dimensional product codes it constructs itself, not the QEC-Bank's existing surface or gross. Whether and how it applies to QEC-Bank entries remains to be worked out. The other is implementation: turning the construction into a program, computing cup products on concrete complexes and writing the results as certificates; no such library exists today (4.2).
三、从上积表到「门」还有一段路。即使算出了表,「这个常深度电路在 gross 上实现某个逻辑 CCZ」还要在这个具体的复形上核对论文引理的条件(这样才能保证它保持码空间)、算出它对全部逻辑比特的作用(gross 有 k = 12 个逻辑比特,BB 操作教程 3.2 节列了认证一个门的五步),再写成证书。这一段与 transversal-gate-cert 重叠,是 hard-engineering 而非 open-research,但它今天也没有做。
Three: from the cup-product table to a “gate” there is still a road. Even with the table computed, “this constant-depth circuit implements some logical CCZ on gross” still needs the conditions of the paper's lemmas checked on that concrete complex (which is what guarantees it preserves the code space), its action on all logical qubits computed (gross has k = 12, and BB operations guide 3.2 lists the five steps to certify a gate), and the result written as a certificate. This stretch overlaps with transversal-gate-cert and is hard-engineering rather than open-research, but it too is undone today.
4.4玩具尺度的对照:难的不是大小Toy-scale comparison: size is not the hard part
和 《大码的码距》那道题不同,这道题的难点不是组合爆炸。先说清要数的是什么。上积的输入是比特所在那一层的上同调类:比特放在 q 维的格子上,输入就是 q 次上同调类,对 CSS 码就是 X 型逻辑算符的类(相差 X 检查视为相同);Z 型逻辑算符是同调类,配对时才用,不是这里的输入。两两上积落在 2q 次,三三落在 3q 次。环面码与 1.5 节的例子里比特在边上,q = 1,所以前面一直说「1 次类」。q 不一定是 1:Zhu 把一般的量子码搬到 CW 复形上时(第 VI.1–VI.2 节,沿用 Freedman–Hastings 的映射),X 检查、比特、Z 检查分别放在 3 维、4 维、5 维的格子上,码空间的一组基由第 4 层的同调群 H₄ 标记(dim H₄ = k 时,量子码空间是 2k 维;同调群本身是 0/1 系数的空间,不是量子态的希尔伯特空间),输入就是 4 次类,两两乘积在 8 次、三三在 12 次;它的加厚三维超图积码把比特放在 12 维流形三角剖分的 4 维单形上,三个 4 次类的上积正好是 12 次,在整个流形上求和(引言与定理 4)。一份码的 q 次上同调类组成一个 k 维的空间:每个类由 k 个 0/1 的「位」决定,所以取 k 个基类就够。又因为上积对每个输入都是线性的((α + α′) ⌣ β = α ⌣ β + α′ ⌣ β,论文式 (13) 的「双线性」),只要算基类之间的乘积,其余的都由加法得到。环面码 k = 2,基类就是图 1.4 的 α、β:两两上积 2 × 2 = 4 个,每个输出是 2 次类;环面上 2 次类只有一个维度(「整张曲面」),所以每个输出就是一个数,即图 1.4 下算出的 ∫ 值。gross k = 12:如果先给它造出一个带上积的复形,并在其中认出一个 12 维的逻辑输入空间(q 次上同调里对应 gross 那 12 个逻辑比特的部分),两两才有 12 × 12 = 144 个输出,三三 12³ = 1 728 个;造出的复形若让输入空间更大或更小,这两个数随之改变。每个输出写成多少个数,取决于那个复形的 2q 次、3q 次上同调各有多少维,这同样要等复形造出来才知道(4.3 节)。QEC-Bank 存的 3 项复形本身只有三层(q = 1,没有 3 次的格子),即使在它上面定义了上积,三三乘积也只能全为零。这些计数都不大,但表的格数说明不了计算要花多久:那取决于复形有多大、用什么算法,本篇没有估算。难的是第 4.3 节的前两条:在什么复形上算(要先造出来,而且要有足够的维数)和拿什么算(输入格式和程序都还不存在)。人话:这不是一道「表太大算不完」的题,而是一道「要算的那个复形和程序都还没有」的题。
Unlike the “Distance for large codes” item, the difficulty here is not combinatorial explosion. First, what is to be counted. The inputs of the cup product are cohomology classes of the layer that holds the qubits: with qubits on q-dimensional cells, the inputs are degree-q cohomology classes, which for a CSS code are the classes of X-type logical operators (up to X checks); Z-type logicals are homology classes, used in the pairing, and are not inputs here. Pairwise products land in degree 2q, triple products in degree 3q. On the toric code and in the examples of 1.5 the qubits sit on edges, q = 1, which is why the text so far said “degree-1 classes”. q need not be 1: when Zhu carries a general quantum code over to a CW complex (sections VI.1–VI.2, following the Freedman–Hastings mapping), X checks, qubits and Z checks sit on 3-, 4- and 5-dimensional cells, a basis of the code space is indexed by the layer-4 homology H₄ (when dim H₄ = k the quantum code space has dimension 2k; the homology itself is a space with 0/1 coefficients, not the Hilbert space of quantum states), and the inputs are degree-4 classes, with pairwise products in degree 8 and triple ones in degree 12; its thickened 3D hypergraph product codes put the qubits on the 4-simplices of a triangulated 12-manifold, where the product of three degree-4 classes has degree exactly 12 and is summed over the whole manifold (introduction and Theorem 4). The degree-q cohomology classes of one code form a k-dimensional space: each class is fixed by k bits of 0/1, so a basis of k classes suffices. And since the cup product is linear in each input ((α + α′) ⌣ β = α ⌣ β + α′ ⌣ β, the “bilinear” of the paper's eq. (13)), only products of basis classes need computing; the rest follow by addition. The toric code has k = 2, with basis classes the α and β of Fig. 1.4: 2 × 2 = 4 pairwise products, each output a degree-2 class; on the torus the degree-2 classes form a single dimension (“the whole surface”), so each output is one number, the ∫ values computed with Fig. 1.4. gross has k = 12: if one first builds a complex with cup products for it and identifies in it a 12-dimensional logical input space (the part of degree-q cohomology that corresponds to the 12 logical qubits of gross), there are 12 × 12 = 144 pairwise outputs and 12³ = 1 728 triple ones; a complex whose input space is larger or smaller changes both numbers. How many numbers each output takes depends on how many dimensions the degree-2q and degree-3q cohomology of that complex has, which is likewise known only once the complex is built (4.3). The QEC-Bank's stored 3-term complex has only three layers (q = 1, no degree-3 cells), so even if a cup product were defined on it, every triple product would be zero. These counts are small, but a table's cell count says nothing about how long the computation takes: that depends on the size of the complex and on the algorithm, and this guide makes no estimate. The hard part is the first two points of 4.3: on which complex to compute (it must first be built, with enough dimensions) and with what (neither the input format nor the program exists yet). In plain words: this is not a problem whose table is too big to finish; it is one where the complex to compute on and the program to compute with do not exist yet.
记号:q = 比特所在格子的维数,也就是上积输入的次数;k = 逻辑比特数,也就是 q 次上同调类空间的维数;12 × 12 与 12³ 是本篇自己算的个数,前提是认出了 12 维的逻辑输入空间,不是 QEC-Bank 页面上的数。
Notation: q = the dimension of the cells that hold the qubits, which is the degree of the cup-product inputs; k = the number of logical qubits, which is the dimension of the space of degree-q cohomology classes; 12 × 12 and 12³ are counts computed for this guide, assuming a 12-dimensional logical input space has been identified, not numbers from QEC-Bank pages.
从这里出发能做什么:手填一张表,再看两条圈怎么变形What you can do from here: fill in a table by hand, then watch two loops deform
两个练习,都在高中水平之内。第一个把 1.3 节那张 4 × 4 表的每个格子都用「共用几条边」亲手验证一遍。第二个在环面圈实验室里把圈揉捏变形,确认缠绕与否、交叉奇偶都不会变。最后是往哪里走。 Two exercises, both within high-school reach. The first verifies every cell of the 4 × 4 table of 1.3 by hand, counting shared edges. The second kneads loops in the torus loop lab and confirms that winding and crossing parity never change. Then, where to go next.
5.1手算:填满 4 × 4 表By hand: fill the 4 × 4 table
回到 1.1 节的沙盘(或纸上的 3 × 3 环面)。四条基本圈:Z̄₁ = 某一行的 3 条横边,Z̄₂ = 某一列的 3 条竖边,X̄竖 = 某一列的 3 条横边(竖直对偶路径穿过它们),X̄横 = 某一行的 3 条竖边(水平对偶路径穿过它们)。对每一对 (Z 圈, X 圈) 数共用的边:
Return to the sandbox of 1.1 (or a 3 × 3 torus on paper). Four basic loops: Z̄₁ = the 3 horizontal edges of some row, Z̄₂ = the 3 vertical edges of some column, X̄vert = the 3 horizontal edges of some column (a vertical dual path crosses them), X̄horiz = the 3 vertical edges of some row (a horizontal dual path crosses them). For each pair (Z loop, X loop) count shared edges:
| X̄vert (0,1) | X̄horiz (1,0) | X̄vertX̄horiz (1,1) | |
|---|---|---|---|
| Z̄₁ (1,0) | 1 条横边(行 ∩ 列)→ 11 horizontal edge (row ∩ column) → 1 | 横边与竖边永不相同 → 0a horizontal edge is never a vertical one → 0 | 1 + 0 → 11 + 0 → 1 |
| Z̄₂ (0,1) | 竖边与横边永不相同 → 0a vertical edge is never a horizontal one → 0 | 1 条竖边(列 ∩ 行)→ 11 vertical edge (column ∩ row) → 1 | 0 + 1 → 10 + 1 → 1 |
| Z̄₁Z̄₂ (1,1) | 1 + 0 → 11 + 0 → 1 | 0 + 1 → 10 + 1 → 1 | 1 + 1 = 2 → 01 + 1 = 2 → 0 |
与 1.3 节的公式 h·v′ + v·h′ 逐格相符。最后一格值得停一下:Z̄₁Z̄₂ 与 X̄竖X̄横 共用 2 条边,偶数,对易——两条都「双绕」的圈互相不反对易。这在 Toric Code 教程 5.6 节的 δij 公式里对应 X̄₁X̄₂ 与 Z̄₁Z̄₂ 交换时出现两个 −1 相乘为 +1。你刚刚用 9 次「数边」重建了环面码全部逻辑算符的对易表——这就是「拓扑替我们算」在最小尺度上的样子。
Cell by cell this matches the formula h·v′ + v·h′ of 1.3. The last cell deserves a pause: Z̄₁Z̄₂ and X̄vertX̄horiz share 2 edges, even, so they commute; two “doubly winding” loops do not anticommute. In the δij rule of section 5.6 of the toric-code guide this is two factors of −1 multiplying to +1 when X̄₁X̄₂ and Z̄₁Z̄₂ are swapped. With 9 edge counts you have just rebuilt the full commutation table of the toric code's logical operators, which is “topology computing for us” at the smallest scale.
5.2实验:揉捏一条圈,看什么不变Experiment: knead a loop and watch what stays
下面的圈实验室是一个 5 × 5 的环面。画一条可收缩的小圈,再画一条绕环面一圈的圈,然后给 Z 圈乘上几块面(点击相邻的边把圈推过去)。观察两件事:可收缩的圈不管怎么变都还是可收缩的(能被面检查乘掉),缠绕的圈不管怎么变都还缠绕(1.3 节的标签 (h, v) 不变)。这就是 1.2 节「变形不改变标签」的动手版。再试交叉奇偶:画好一条缠绕的 Z 圈后,切到「画 X 串」,画一条沿另一个方向缠绕的 X 串(沿一列横边);两种串会同时留在画面上,读数对 Z 串和 X 串各给一句判断。实验台不会替你数两者的交叉:自己数两种颜色同时占着的边,记下奇偶;然后把 Z 圈推过一块面(或给 X 串乘一颗星:把一个顶点周围的四条边各点一次,每条都切换——没选的选上,已经选着的熄掉),再数一次。数目可能变,奇偶不变。
The loop lab below is a 5 × 5 torus. Draw a small contractible loop, then a loop that winds around the torus, then multiply the Z loop by a few plaquettes (click neighbouring edges to push the loop over). Watch two things: a contractible loop stays contractible however it changes (it can be multiplied away by plaquettes), and a winding loop stays winding (the label (h, v) of 1.3 is unchanged). This is the hands-on version of “deformation does not change the label” from 1.2. Then try the crossing parity: with a winding Z loop drawn, switch to “draw X string” and draw an X string winding the other way (along the horizontal edges of one column); both strings stay on the canvas, and the readout gives one verdict for the Z string and one for the X string. The lab does not count their crossings for you: count the edges held by both colours yourself and note the parity; then push the Z loop over one plaquette (or multiply the X string by a star: click each of the four edges around one vertex once, which toggles each of them, so unselected edges turn on and edges already selected turn off) and count again. The number may change; its parity does not.
平面版本也值得看一眼。把环面剪开成有边界的平面贴片(表面码),缠绕圈变成「从一条边界跨到对面边界」的串;逻辑 X 串与逻辑 Z 串仍然恰好交叉一次。下面的逻辑算符实验室画的就是这种串,并当场检验它与所有检查对易——同一个奇偶不变量,换了一个舞台。
The planar version is worth a look too. Cut the torus open into a planar patch with boundaries (the surface code) and a winding loop becomes a string “from one boundary to the opposite one”; the logical X string and logical Z string still cross exactly once. The logical-operator lab below draws such strings and checks on the spot that they commute with every check: the same parity invariant on a different stage.
5.3往哪里走Where to go next
相关条目。yaml 的 related 列出 surface 与 bivariate_bicycle。两个条目的「逻辑操作」教程逐条讲了第 2 章那 14 条记录:表面码逻辑操作教程第 1 章(需要哪些门、三条路、Bravyi–König 天花板)与 BB 逻辑操作教程第 1 章(五条记录一览)、第 5 章(自对偶子族与非 Clifford 的边界)。乘积码的结构在 qLDPC 教程第 2 章(超图积)与 BB 教程第 2 章(多项式即稀疏矩阵)。
Related entries. The yaml's related list names surface and bivariate_bicycle. Their operations guides explain the 14 records of Chapter 2 one by one: surface operations guide, Chapter 1 (which gates are needed, three roads, the Bravyi–König ceiling) and BB operations guide, Chapter 1 (the five records at a glance), Chapter 5 (the self-dual subfamily and the non-Clifford boundary). The structure of product codes is in qLDPC guide, Chapter 2 (hypergraph product) and BB guide, Chapter 2 (polynomials as sparse matrices).
这道题的两个邻居。同一个目标的代数路线是 partial 的 transversal-gate-cert(2.3 节,Wanted 板);它需要的输入格式是 partial 的 chain-complex-lib(4.3 节,Wanted 板)。这道题的 yaml 没有登记 working_repo。
The item's two neighbours. The algebraic road to the same goal is the partial transversal-gate-cert (2.3, Wanted board); the input format it needs is the partial chain-complex-lib (4.3, Wanted board). The item's yaml registers no working_repo.
同一系列。「从形状读出代数」的反面——「两个不同形状是不是同一个码」——是 《同一个码穿不同的衣服》;「把结论写成机器能核对的证书」是 《一张机器能核对的「没有更轻逻辑算符」证书》。
In this series. The converse of “reading algebra off a shape”, namely “are two different shapes the same code”, is “The same code in different clothes”; “writing the conclusion as a machine-checkable certificate” is “A machine-checkable certificate that nothing lighter exists”.
一个奇偶、一张表、十四个 claimedOne parity, one table, fourteen claimed
回放一遍。环面码上一条 Z 圈与一条 X 圈共用的边数,随变形而变,奇偶不变;这个奇偶就是两个逻辑算符对易与否,四个圈类之间的全部答案是一张 4 × 4 表,公式 h·v′ + v·h′。上积把两个上同调类乘成一个更高次的类,次数相加;在切成三角形的环面上,它的总值就是两条对偶圈交叉的奇偶,所以那张表也能读成上积表。它能再乘第三个类:在三维的复形上,三个 1 次类的总值数的是三张对偶膜共同交点的奇偶。Zhu 的构造把这些总值变成门:二维上两份码之间的一张 CZ 电路(Clifford),三维上三份码之间的一张 CCZ 电路(第 3 级,非 Clifford)——它证出这些门,不判定一个码的全部门。QEC-Bank 今天在 surface 与 bivariate_bicycle 的「逻辑操作」侧面存了 9 + 5 = 14 条记录,全部 claimed,唯一的非 Clifford 是靠魔法态买来的 T,自带的一条也没有——「没有记录」而非「证明没有」。一台能在乘积码的链复形上算上积的机器,能为上积构造证出的那些门(1.5 节)写出 derived 或 verified 的记录,让「哪个码更适合算」多出一栏可以比较的内容;这 14 条里靠魔法态的 T 以及手术、编织等其余机制的记录不在此列,仍要有人登记并注明出处(3.3 节)。难度 open-research:论文已经给乘积码造出了带上积的复形(arXiv:2501.19375,登记待补),但它要 4 项的复形、例子是论文自己构造的码,用到 QEC-Bank 的条目上还没人做;输入格式(chain-complex-lib 是 partial)和程序也都还没有。难的不是表的大小:即使在造出的复形里认出了 gross 的 12 维逻辑输入空间,两两上积也只有 12 × 12 = 144 个输出。
Replay. On the toric code the number of edges a Z loop and an X loop share changes under deformation; its parity does not. That parity is whether the two logical operators commute, and the full answer among the four loop classes is one 4 × 4 table, formula h·v′ + v·h′. The cup product multiplies two cohomology classes into a class of higher degree, the degrees adding; on the torus cut into triangles its total is the crossing parity of two dual loops, so the table can also be read as a cup-product table. It can multiply a third class: on a three-dimensional complex the total of three degree-1 classes counts, mod 2, the points common to three dual membranes. Zhu's construction turns these totals into gates: a CZ circuit between two copies in two dimensions (Clifford), a CCZ circuit between three copies in three dimensions (level 3, non-Clifford); it certifies these gates and does not decide all the gates of a code. Today the QEC-Bank holds 9 + 5 = 14 records in the “Logical operations” facets of surface and bivariate_bicycle, all claimed; the only non-Clifford one is a T bought with magic states, and native ones number zero, “no record” rather than “proven absent”. A machine computing cup products on the chain complexes of product codes could write derived or verified records for the gates the cup-product construction certifies (1.5), giving “which code computes better” some content that can be compared; the T by magic states and the other records among the 14 (surgery, braiding and other mechanisms) are outside its reach and still have to be entered by people with their sources (3.3). Difficulty open-research: the paper has built complexes with cup products for product codes (arXiv:2501.19375, registration pending), but it needs 4-term complexes and its examples are codes it constructs itself; nobody has yet carried it over to QEC-Bank entries, and neither the input format (chain-complex-lib is partial) nor a program exists. Table size is not the issue: even once a 12-dimensional logical input space for gross is identified in a built complex, its pairwise cup products have only 12 × 12 = 144 outputs.
符号与读法Symbols & how to read them
| 符号Symbol | 名称与读法Name & how to read it | 在本篇中的含义Meaning in this guide |
|---|---|---|
| [[n, k, d]] | 双方括号,读「n k d 码」Double brackets, read “an n k d code” | n 个物理比特、k 个逻辑比特、码距 d;toric_L3 是 [[18,2,3]],gross 是 [[144,12,12]]。n physical qubits, k logical qubits, distance d; toric_L3 is [[18,2,3]], gross is [[144,12,12]]. |
| L | 读「L」Read “L” | 环面码每行每列的格数;n = 2L²,d = L。本篇 L = 3。Cells per row and column of the toric code; n = 2L², d = L. Here L = 3. |
| X̄, Z̄, X̄i, Z̄j | 读「X 杠、Z 杠」Read “X bar, Z bar” | 逻辑 X、逻辑 Z;下标标第几个逻辑比特。环面码上是缠绕圈。Logical X, logical Z; the subscript names the logical qubit. On the toric code they are winding loops. |
| c, c(A, B) | 读「碰撞数」Read “collision count” | 两条泡利串中两个不同的非 I 字母相遇的格数(纯 X 串对纯 Z 串时就是 X 遇 Z);对两条圈就是共用边数。PQ = (−1)c QP。Cells where the two Pauli strings carry two different non-identity letters (an X meeting a Z for a pure-X and a pure-Z string); for two loops the number of shared edges. PQ = (−1)c QP. |
| mod 2 | 读「模 2」Read “mod 2” | 只看除以 2 的余数,即奇偶;1 + 1 = 0。Keep only the remainder on division by 2, the parity; 1 + 1 = 0. |
| (h, v), (h′, v′) | 读「h v 标签」Read “the h v label” | 一条圈的同调类:h = 水平绕数的奇偶,v = 竖直绕数的奇偶;带撇的是 X 圈的标签。交叉奇偶 = h·v′ + v·h′。A loop's homology class: h = parity of horizontal windings, v = of vertical windings; primed for the X loop. Crossing parity = h·v′ + v·h′. |
| δij | 希腊字母,读「德尔塔」Greek letter, read “delta” | i = j 时为 1,否则 0;Toric Code 教程 5.6 节的对易规则 X̄iZ̄j = (−1)δij Z̄jX̄i。1 when i = j, else 0; the commutation rule X̄iZ̄j = (−1)δij Z̄jX̄i of section 5.6 of the toric-code guide. |
| α ⌣ β, α ⌣ β ⌣ γ | 读「阿尔法杯贝塔」Read “alpha cup beta” | 上积:两个(三个)上同调类乘成一个次数相加的类;三角形上 (α ⌣ β)[v₀v₁v₂] = α[v₀v₁]·β[v₁v₂](1.4 节)。∫ = 所有三角形(四面体)上的值加起来取奇偶。Cup product: two (three) cohomology classes multiplied into a class whose degree is the sum; on a triangle (α ⌣ β)[v₀v₁v₂] = α[v₀v₁]·β[v₁v₂] (1.4). ∫ = the values summed over all triangles (tetrahedra), mod 2. |
| HX, HZ, HXHZT = 0 | 读「H X、H Z」;上标 T 读「转置」Read “H X, H Z”; superscript T “transpose” | X 型、Z 型检查的 0/1 矩阵;乘积为零 = 每对检查共用偶数比特 = 链复形的定义条件。The 0/1 matrices of X- and Z-type checks; product zero = every pair shares an even number of qubits = the defining condition of a chain complex. |
| H, S, CNOT, T | 读字母名Read as letters | 四个标准门。H、S、CNOT 是 Clifford 门(泡利串映成泡利串);T 是非 Clifford 门;通用计算需要某种非 Clifford 资源,T 门(或魔法态)是最常用的一种。Four standard gates. H, S, CNOT are Clifford (Pauli strings to Pauli strings); T is non-Clifford; universality needs some non-Clifford resource, and a T gate (or magic states) is the most common one. |
| k × k, k³ | 读「k 乘 k」「k 的三次方」Read “k by k”, “k cubed” | 一份码的 k 个基类之间两两、三三上积的个数(gross k = 12:144、1 728,本篇自算,前提是在造出的复形里认出 12 维的逻辑输入空间,4.4 节)。The number of pairwise and triple cup products among the k basis classes of a code (gross, k = 12: 144 and 1 728, computed here, assuming a 12-dimensional logical input space is identified in the built complex, 4.4). |
| R1 … R5 | 读「表示阶梯第 1 到 5 层」Read “ladder rungs 1 to 5” | QEC-Bank 的表示阶梯:R1 检查矩阵,R2 结构(链复形),R3 时间表,R4 电路,R5 跨模型视图。The QEC-Bank representation ladder: R1 checks, R2 structure (chain complex), R3 schedules, R4 circuits, R5 cross-model views. |
本篇新增词汇New terms in this guide
| 术语Term | 白话定义Plain definition |
|---|---|
| 交叉数(mod 2)intersection number (mod 2) | 两条圈相遇次数的奇偶;决定两个逻辑算符对易与否;变形不变。The parity of how many times two loops meet; decides whether two logicals commute; unchanged by deformation. |
| 拓扑不变量topological invariant | 只依赖形状的类、不依赖具体画法的量。A quantity depending only on the shape class, not on the particular drawing. |
| 同调类homology class | 把「相差检查乘积」的圈视为同一个;环面上有 4 个。Loops differing by a product of checks counted as one; the torus has 4. |
| 对偶路径dual path | 穿过边、从面走到面的路径;X 型逻辑算符住在它穿过的边上。A path crossing edges from face to face; X-type logicals live on the edges it crosses. |
| 上同调类cohomology class | 在环面码上:一个 X 型逻辑算符,相差星检查视为相同;X 圈的标签 (h′, v′) 就是它。On the toric code: an X-type logical operator up to star checks; the X-loop label (h′, v′) is it. |
| 上积 / 上同调运算cup product / cohomology operation | 把一个 p 次、一个 q 次上同调类乘成一个 p + q 次类的运算(公式与手算见 1.4 节),及其推广(本篇不涉及)。The operation multiplying a degree-p and a degree-q cohomology class into a degree-(p + q) class (formula and worked example in 1.4), and its generalizations (not covered here). |
| 链复形chain complex | QEC-Bank 存 CSS 码的标准形式:几张 0/1 矩阵串成一列,相邻相乘为零。The QEC-Bank standard form for CSS codes: 0/1 matrices in a row, adjacent products zero. |
| 乘积码product code | 用两个小零件「相乘」得到的码:表面码/环面码(超图积)、BB 码(提升积)。A code obtained by “multiplying” two small parts: surface/toric (hypergraph product), BB (lifted product). |
| Clifford 门 / 非 Clifford 门Clifford / non-Clifford gate | 把泡利串映成泡利串的门(H、S、CNOT)/ 不这样的门(T、CCZ);通用计算需要某种非 Clifford 资源(这样的门,或魔法态),而它们也最贵。Gates mapping Pauli strings to Pauli strings (H, S, CNOT) / gates that do not (T, CCZ); universality needs some non-Clifford resource (such a gate, or magic states), and these cost the most. |
| Clifford 层级Clifford hierarchy | 第 1 级泡利串;第 2 级把泡利串变成泡利串(Clifford);第 3 级把泡利串变成 Clifford 门(T、CCZ 在这一级);C₁ ⊂ C₂ ⊂ C₃。Level 1 Pauli strings; level 2 maps Pauli strings to Pauli strings (Clifford); level 3 maps Pauli strings to Clifford gates (T and CCZ are here); C₁ ⊂ C₂ ⊂ C₃. |
| 自带的(native)门native gate | 由常深度物理操作直接实现、不靠码外注入魔法态的逻辑门。A logical gate implemented directly by a constant-depth physical operation, without magic states injected from outside. |
| 魔法态magic state | 配合 Clifford 操作可「传送」出 T 门的特殊态;须蒸馏,代价大。A special state that, with Clifford operations, “teleports” a T gate; must be distilled, at great cost. |
| Bravyi–König 天花板Bravyi–König ceiling | 二维拓扑稳定子码上,局域常深度操作最多到 Clifford 层级;每多一维多一级。On 2D topological stabilizer codes, local constant-depth operations reach at most the Clifford level; one level more per dimension. |
| 证据词evidence word | claimed(从文献抄)、curated(人工整理)、derived(机器算出)、verified(机器算出并有证书)。claimed (copied from literature), curated (assembled by hand), derived (machine-computed), verified (machine-computed with a certificate). |
| open-research / hard-engineeringopen-research / hard-engineering | Wanted 板的两种难度:没人知道怎么做 / 知道怎么做但要做很多。The board's two difficulty grades: nobody knows how / known how but much to do. |
延伸阅读Further reading
- arXiv:2501.19375
Wanted 板 statement 指向的论文;设计文档 3.2 节写作 “(Zhu, arXiv:2501.19375)”。QEC-Bank 参考文献登记表里尚无条目——据条目记载,登记待补。本篇没有阅读它。The paper the Wanted statement points to; the design document, section 3.2, writes “(Zhu, arXiv:2501.19375)”. No entry in the QEC-Bank reference registry yet: cited by the entry, registration pending. This guide did not read it. - S. Bravyi, R. König, “Classification of topologically protected gates for local stabilizer codes” (2013)
bravyi2013classification(QEC-Bank 已登记,arXiv 1206.1609)。二维天花板的出处;QEC-Bank 基础页 foundations/bounds/bravyi-koenig.md 有完整的二级推导,本篇只引了它的口号。bravyi2013classification (registered in the QEC-Bank, arXiv 1206.1609). The source of the 2D ceiling; the QEC-Bank foundations page foundations/bounds/bravyi-koenig.md carries a full level-2 derivation, of which this guide quoted only the slogan. - QEC-Bank: the Wanted item and its data
wanted/cup-products.yaml(六个字段原文)、wanted/transversal-gate-cert.yaml 与 wanted/chain-complex-lib.yaml(两个 partial 邻居)、codes/surface/card.yaml 与 codes/bivariate_bicycle/card.yaml 的 operations 字段(第 2 章的 14 条记录)、foundations/css-chain-complexes/intuition.md(存根,一句话定义)、foundations/pauli-symplectic/intuition.md(crossing-count picture)、docs/superpowers/specs/2026-07-04-qec-atlas-design.md 3.2 节(R2 与上积的设计决定)。wanted/cup-products.yaml (the six fields verbatim), wanted/transversal-gate-cert.yaml and wanted/chain-complex-lib.yaml (the two partial neighbours), the operations fields of codes/surface/card.yaml and codes/bivariate_bicycle/card.yaml (the 14 records of Chapter 2), foundations/css-chain-complexes/intuition.md (a stub with the one-line definition), foundations/pauli-symplectic/intuition.md (the crossing-count picture), docs/superpowers/specs/2026-07-04-qec-atlas-design.md section 3.2 (the R2 and cup-product design decision).
状态原文:open;难度原文:open-research。逐字引用的:statement、why_it_matters、current_proxy(第 1、2、3 章的框),surface 九条与 BB 五条操作记录的 gate / mechanism / level / origin 与 T 门的 cost 原文,transversal-gate-cert 与 chain-complex-lib 的 statement / why_it_matters / current_proxy,两条基础页的一句话,设计文档 3.2 节与对照表的两句。本篇自己算的、QEC-Bank 页面上没有的数:1 与 3(两图的共用边数,由生成图的脚本同时校验)、4 × 4 表的 16 格与 5.1 节的 9 格、14 = 9 + 5、12 × 12 = 144、12³ = 1 728;图 1.4 的上积总值(∫α ⌣ β = ∫β ⌣ α = 1、∫α ⌣ α = 0,及其在星检查变形下不变)、三维环面上 27 种三重上积、三维 CCZ 电路在全部 512 种逻辑赋值上的相位(6 个逻辑 CCZ 因子)与它的层数,以及 2.3 节三正交例子的重叠数,都由 notes 里的脚本核对。本篇自己证的:1.2 节「乘一块面改变偶数条共用边」的三行论证与 1.3 节公式在四条基本圈上的验证(高中水平),以及图 1.4 的逐块手算。引而未证的:上积只依赖类(论文式 (25)–(27))、1.5 节的引理 1 与引理 2(arXiv:2501.19375 第 II.1–II.2 节,本篇读过这两节;第 VI.1–VI.2 节只读了格子的摆放,其余部分未读)、Gottesman–Knill 定理与 arXiv:1806.03200 的结论、Bravyi–Haah 的三正交定理、Bravyi–König 定理的证明(只引口号)。没有运行 QEC-Bank 的任何验证器;「没有页面链接到 cup-products」是一次 grep 的结果(2026-09-12)。
Status verbatim: open; difficulty verbatim: open-research. Quoted word for word: statement, why_it_matters, current_proxy (the boxes of Chapters 1, 2, 3), gate / mechanism / level / origin of the nine surface and five BB operations records and the cost text of the T gate, statement / why_it_matters / current_proxy of transversal-gate-cert and chain-complex-lib, one sentence each from two foundations pages, two sentences from design-document section 3.2 and its comparison table. Computed for this guide and absent from QEC-Bank pages: 1 and 3 (shared-edge counts of the two figures, checked by the script that drew them), the 16 cells of the 4 × 4 table and the 9 cells of 5.1, 14 = 9 + 5, 12 × 12 = 144, 12³ = 1 728; the cup-product totals of Fig. 1.4 (∫α ⌣ β = ∫β ⌣ α = 1, ∫α ⌣ α = 0, and their invariance under star-check deformations), the 27 triple cup products on the three-torus, the phase of the three-dimensional CCZ circuit on all 512 logical assignments (6 logical CCZ factors) and its layer count, and the overlap counts of the triorthogonality example of 2.3 are checked by scripts in the notes. Proved in this guide: the three-line argument of 1.2 that one plaquette changes the shared count by an even number, the check of the 1.3 formula on the four basic loops (high-school level), and the triangle-by-triangle computation of Fig. 1.4. Cited, not proved: that the cup product depends only on classes (the paper's eqs. (25)–(27)), Lemmas 1 and 2 of 1.5 (arXiv:2501.19375, sections II.1–II.2, which this guide read; of sections VI.1–VI.2 only the placement of cells was read, and the rest of the paper was not), the Gottesman–Knill theorem and the result of arXiv:1806.03200, the triorthogonality theorem of Bravyi–Haah, and the proof of the Bravyi–König theorem (slogan only). No QEC-Bank verifier was run; “no page links to cup-products” is the result of one grep (2026-09-12).
开放问题总览 · 大码的码距:便宜的上界,昂贵的下界 · 一张机器能核对的「没有更轻逻辑算符」证书 · 同一个码穿不同的衣服 · 拓扑替我们算出门(本篇) · 有些码还没有「标准译码器」 · 用费米子的语言写电路 · 检查每一轮都在变,码距该怎么数 · 从理想症状到真实电路 · 两张测量时间表是不是同一回事 · 不在乎的比特,与穿了衣服的码距 · 在 Wanted 板上查看 →
All open problems · Distance for large codes: cheap upper bounds, expensive lower bounds · A machine-checkable certificate that nothing lighter exists · The same code in different clothes · Topology computes the gates (this guide) · Some codes still have no standard decoder · Writing circuits in the language of fermions · When the checks change every round, how do you count distance? · From ideal syndromes to real circuits · Are two measurement schedules the same thing? · Don't-care qubits and the dressed distance · See it on the Wanted board →
Surface Code · 条目总览(逻辑操作 1.1:需要哪些门 · 1.3:Bravyi–König 天花板) · BB 码 · 条目总览(逻辑操作 1.3:五条记录,全部 claimed · 5.2:gross 没有普适的横向门集 · 5.3:魔法态 · 直觉 6.5:逻辑门,什么已经有、什么还没有) · 《从高考数学到 Toric Code》5.6:缠绕圈与交叉一次 · 《qLDPC 码 · 高中数学版》第 2 章:超图积
Surface Code · Entry overview (operations 1.1: which gates are needed · 1.3: the Bravyi–König ceiling) · BB codes · Entry overview (operations 1.3: five records, all claimed · 5.2: no universal transversal gate set for gross · 5.3: magic states · intuition 6.5: logical gates, what exists and what does not) · “From Exam Maths to the Toric Code” 5.6: winding loops and crossing once · “qLDPC Codes · High-School Edition”, Chapter 2: hypergraph product