目录Contents
速查回顾:五条随身事实Quick recap: five facts to carry
这一篇只依赖 Toric Code 教程里的五件事。每一条都给出原处的链接;记不清就点回去,读完再回来。 This guide relies on five things from the toric-code guide. Each comes with a link to where it was taught; if one is hazy, follow the link and come back.
| # | 事实Fact | 原处Where it was taught |
|---|---|---|
| 1 | 一条奇偶检查只问「这几个比特里 1 的个数是偶数吗」(只碰两个比特时就是「这两位一样吗」);一份检查清单可以写成一张 0/1 矩阵 H,每行一条检查,每列一个比特,1 表示「这条检查碰这个比特」。A parity check only asks “is the number of 1s among these bits even?” (for two bits: “are they the same?”); a list of checks can be written as a 0/1 matrix H, one row per check, one column per bit, a 1 meaning “this check touches this bit”. | 2.3 节section 2.3 |
| 2 | 量子比特上的三个基本操作是泡利矩阵 X、Y、Z;泡利串是每个比特上放一个字母(或不放)。The three basic operations on a qubit are the Pauli matrices X, Y, Z; a Pauli string puts one letter (or none) on each qubit. | 3.2 节section 3.2 · 4.2 节section 4.2 |
| 3 | 一个稳定子码就是一份互相兼容(两两对易)的泡利串检查清单;清单里任意几条的乘积也算检查。A stabilizer code is a list of mutually compatible (pairwise commuting) Pauli-string checks; the product of any few list entries counts as a check too. | 4.4 节section 4.4 |
| 4 | L × L 环面码:2L² 个比特,L² 条星检查(X 型)、L² 条面检查(Z 型),独立的只有 2L² − 2 条,所以 k = n − (2L² − 2) = 2。这个减法要求检查彼此相容、没有哪几条的乘积等于 −I;每条检查都是全 X 或全 Z 时这一条自动成立。L = 3 时 n = 18。The L × L toric code: 2L² qubits, L² star checks (X type) and L² plaquette checks (Z type), of which only 2L² − 2 are independent, so k = n − (2L² − 2) = 2. The subtraction needs the checks to be consistent, no product of them equal to −I; this holds automatically when every check is all-X or all-Z. For L = 3, n = 18. | 5.3 节section 5.3 |
| 5 | 码距 d 是最轻的逻辑算符的重量;环面码 d = L。The distance d is the weight of the lightest logical operator; for the toric code d = L. | 5.8 节section 5.8 |
记号:n = 物理比特数,k = 逻辑比特数,d = 码距,L = 环面边长,H = 检查矩阵(每行一条检查)。「重量」= 一条泡利串触碰的比特数。
Notation: n = number of physical qubits, k = number of logical qubits, d = distance, L = side length of the torus, H = check matrix (one row per check). “Weight” = the number of qubits a Pauli string touches.
这个问题用人话说是什么:换衣服的三种方式The problem in plain words: three ways of changing clothes
先在一个 3 比特的经典码上亲手做三件事:换编号、换一组检查来写清单、再到环面码上把 X 和 Z 对调。每一件都让清单面目全非,却都没有改变码。把这三件事合起来命名,就是「局部等价」;问「两份清单是不是局部等价」,就是这道开放问题。 First do three things by hand on a 3-bit classical code: renumber the bits, write the list with a different set of checks, then go to the toric code and swap X with Z. Each one makes the list unrecognisable, and none of them changes the code. Naming the three together gives “local equivalence”; asking “are these two lists locally equivalent?” is this open problem.
1.1玩具一:3 比特重复码,换编号、换检查Toy one: the 3-bit repetition code, renumbered and rewritten
取 Toric Code 教程 2.2 节的 3 比特重复码:合法的码字只有 000 和 111。它的检查清单可以写成两条:「第 1 位 = 第 2 位吗」「第 2 位 = 第 3 位吗」。按第 0 章事实 1 写成矩阵,每行一条检查、每列一个比特:
Take the 3-bit repetition code of section 2.2 of the toric-code guide: the only legal codewords are 000 and 111. Its check list can be written as two lines: “is bit 1 = bit 2?” and “is bit 2 = bit 3?”. As a matrix per fact 1 of Chapter 0, one row per check and one column per bit:
记号:H1 = 第一套写法的检查矩阵;分号隔开两行;每行三个数对应比特 1、2、3。
Notation: H1 = the check matrix of the first way of writing; the semicolon separates the two rows; the three numbers in a row belong to bits 1, 2, 3.
第一件事:换编号。把比特 1 和比特 3 的名字对调。第一条检查变成「第 3 位 = 第 2 位吗」,第二条变成「第 2 位 = 第 1 位吗」;矩阵变成 [ 0 1 1 ; 1 1 0 ]——两行掉了个头,两列也掉了个头。码字 000 和 111 对调编号之后还是 000 和 111。清单换了样子,码没变。
First: renumber. Swap the names of bit 1 and bit 3. The first check becomes “is bit 3 = bit 2?”, the second “is bit 2 = bit 1?”; the matrix becomes [ 0 1 1 ; 1 1 0 ], the two rows turned around and the two columns turned around. The codewords 000 and 111 are still 000 and 111 after the renaming. The list changed its look; the code did not.
第二件事:换一组检查。还是原来的编号,但这次写「第 1 位 = 第 2 位吗」和「第 1 位 = 第 3 位吗」:
Second: pick a different set of checks. Keep the original numbering, but this time write “is bit 1 = bit 2?” and “is bit 1 = bit 3?”:
H2 和 H1 只有一行相同。它们是同一个码吗?是:一个串通过 H2 的两条检查,就是「1 = 2 且 1 = 3」,于是三位全等,只剩 000 和 111;反过来也一样。更机械的看法:H1 的第二行 0 1 1 等于 H2 两行按位相加(1+1 = 0,不进位):1 1 0 + 1 0 1 = 0 1 1。第 0 章事实 3 说过,清单里几条检查的乘积(这里是按位相加)也算检查;所以两份清单生成的是同一组检查,只是各挑了两条当代表。人话:一个码不是它的检查清单,而是清单能生成的全部检查。
H2 and H1 share only one row. Are they the same code? Yes: a string passing both checks of H2 satisfies “1 = 2 and 1 = 3”, so all three bits agree and only 000 and 111 remain; and conversely. More mechanically: the second row of H1, 0 1 1, equals the bitwise sum of the two rows of H2 (1+1 = 0, no carry): 1 1 0 + 1 0 1 = 0 1 1. Fact 3 of Chapter 0 said that products of list entries (bitwise sums here) count as checks; so the two lists generate the same set of checks and merely picked two different representatives each. In plain words: a code is not its check list but everything the list generates.
1.2玩具二:环面码里把 X 和 Z 对调Toy two: swap X and Z in the toric code
现在到量子码。下面的沙盘是 L = 3 的环面码:18 个比特住在边上,9 个顶点各一条 X 型星检查(碰周围 4 条边),9 块面各一条 Z 型面检查(碰四周 4 条边)。点一条边放一个 Z 错误,看是哪两颗星报警。
Now a quantum code. The sandbox below is the toric code with L = 3: 18 qubits on the edges, an X-type star check at each of 9 vertices (touching its 4 edges), a Z-type plaquette check on each of 9 faces (touching its 4 sides). Click an edge to place a Z error and see which two stars fire.
第三件事:在每个比特上把 X 和 Z 对调。有一个 2 × 2 矩阵专门做这件事(怎么乘见本节末的补课),叫阿达马矩阵 HHadamard:H = (1/√2)·[1 1 ; 1 −1]。用高中矩阵乘法可以验证 H·X·H = Z,H·Z·H = X(H 自己乘自己是单位矩阵)。它是一个「单比特换基」:换一种坐标看同一个比特,X 和 Z 的角色互换。——注意它和检查矩阵 H 撞了名字,本篇之后写 Had。在全部 18 个比特上各做一次 Had,每条 X 型星检查变成 Z 型,每条 Z 型面检查变成 X 型。新清单:顶点上是 Z 型 4 腿检查,面上是 X 型 4 腿检查。它和原来的清单一个字母都对不上。
Third: swap X and Z on every qubit. A 2 × 2 matrix does exactly this (the catch-up at the end of this section shows how to multiply it out), the Hadamard matrix HH = (1/√2)·[1 1 ; 1 −1]. High-school matrix multiplication verifies H·X·H = Z and H·Z·H = X (H times itself is the identity). It is a “single-qubit change of basis”: look at the same qubit in different coordinates and the roles of X and Z swap.; it clashes in name with the check matrix H, so from here on it is written Had. Apply Had once on each of the 18 qubits: every X-type star check becomes Z type, every Z-type plaquette check becomes X type. The new list: Z-type 4-leg checks at vertices, X-type 4-leg checks on faces. Not one letter matches the old list.
它是同一个码吗?先数不变的东西:n 还是 18;检查还是 9 + 9 条、各 4 腿、独立的还是 16 条,所以 k 还是 2;最轻的逻辑算符还是绕一圈的 3 条边,d 还是 3。再看几何:在环面上,把每个顶点换成一块面、每块面换成一个顶点(每条边换成穿过它的那条边),得到的还是一张 3 × 3 的正方形网格。所以答案是「是」,而且比「换了基」还多一点:把新清单里每个比特改记在穿过它的那条对偶边上(图 1.1 ③),面上的 X 型检查正好变成对偶格的一颗 X 型星,顶点上的 Z 型检查变成对偶格的一块 Z 型面。对偶格还是 3 × 3 方格,于是「Z 型星、X 型面」这份清单只换编号就变回原来的「X 型星、Z 型面」。在环面码上,「全体换基」这件衣服恰好也能用「换编号」这件衣服穿出来。
Is it the same code? Count what did not change first: n is still 18; there are still 9 + 9 checks with 4 legs each, still 16 independent ones, so k is still 2; the lightest logical is still a loop of 3 edges, so d is still 3. Then the geometry: on the torus, replacing every vertex by a face and every face by a vertex (every edge by the edge crossing it) yields again a 3 × 3 square grid. So the answer is yes, and slightly more than “it was re-based”: record every qubit of the new list on the dual edge crossing it (Fig. 1.1 ③); the X-type plaquette checks become X-type stars of the dual grid and the Z-type star checks become its Z-type plaquettes. The dual grid is again a 3 × 3 square grid, so the list “Z-type stars, X-type plaquettes” returns to the original “X-type stars, Z-type plaquettes” by renumbering alone. On the toric code the outfit “re-base every qubit” can also be worn as the outfit “renumber”.
补课 · 2 × 2 矩阵相乘,亲手验证 Had·X·Had = ZCatch-up · Multiplying 2 × 2 matrices, and checking Had·X·Had = Z by hand
一个比特上的 X、Z 可以写成 2 × 2 的数表(矩阵):X = [0 1 ; 1 0](把两个状态对调,即「翻转」),Z = [1 0 ; 0 −1](第二个状态添一个负号)。两个 2 × 2 矩阵相乘的规则:结果第 i 行第 j 列的数 = 左边第 i 行与右边第 j 列逐项相乘再相加。例如 [a b ; c d]·[e f ; g h] = [ae + bg af + bh ; ce + dg cf + dh]。
X and Z on one qubit can be written as 2 × 2 tables of numbers (matrices): X = [0 1 ; 1 0] (swap the two states, the “flip”), Z = [1 0 ; 0 −1] (put a minus sign on the second state). The rule for multiplying two 2 × 2 matrices: the entry in row i, column j of the result = row i of the left one times column j of the right one, entry by entry, added up. For example [a b ; c d]·[e f ; g h] = [ae + bg af + bh ; ce + dg cf + dh].
算一遍Do it once
Had = (1/√2)·[1 1 ; 1 −1]。先算 Had·X = (1/√2)·[1·0 + 1·1 1·1 + 1·0 ; 1·0 + (−1)·1 1·1 + (−1)·0] = (1/√2)·[1 1 ; −1 1]。再右乘 Had:(1/√2)(1/√2)·[1·1 + 1·1 1·1 + 1·(−1) ; (−1)·1 + 1·1 (−1)·1 + 1·(−1)] = ½·[2 0 ; 0 −2] = [1 0 ; 0 −1] = Z。同样的算法给出 Had·Z·Had = X,以及 Had·Had = ½·[2 0 ; 0 2] = 单位矩阵(什么也不做)。
Had = (1/√2)·[1 1 ; 1 −1]. First Had·X = (1/√2)·[1·0 + 1·1 1·1 + 1·0 ; 1·0 + (−1)·1 1·1 + (−1)·0] = (1/√2)·[1 1 ; −1 1]. Then multiply by Had on the right: (1/√2)(1/√2)·[1·1 + 1·1 1·1 + 1·(−1) ; (−1)·1 + 1·1 (−1)·1 + 1·(−1)] = ½·[2 0 ; 0 −2] = [1 0 ; 0 −1] = Z. The same arithmetic gives Had·Z·Had = X, and Had·Had = ½·[2 0 ; 0 2] = the identity (do nothing).
为什么这叫「改名」:一条检查若在某个比特上是 X,对那个比特做 Had 之后,同一条检查在新坐标里读作 Z;X、Z 之外的第三个字母 Y 保持为 Y(只差一个 ± 号,本篇不追究)。三个字母的 6 种排列都能用这样的单比特操作做到,这就是 1.3 节表里「每个比特 6 种改名法」。
Why this counts as “renaming”: if a check has an X on some qubit, after Had on that qubit the same check reads Z in the new coordinates; the third letter Y stays Y (up to a ± sign, which this guide ignores). All 6 permutations of the three letters can be achieved by single-qubit operations of this kind: these are the “6 renamings per qubit” in the table of 1.3.
1.3给这三件事起名:局部等价Naming the three moves: local equivalence
三种换衣服的方式,合起来叫局部等价local equivalence:两份检查清单,若能通过「重新给比特编号」「在单个比特上换基(把 X、Y、Z 三个字母重新命名)」「换一组生成同样检查的代表」这三种操作互相变到,就说它们是同一个码的两种写法。「局部」指的是每一步只碰一个比特。。说人话:
The three ways of changing clothes together are called local equivalenceTwo check lists are two ways of writing the same code if one can be turned into the other by “renumbering the qubits”, “changing basis on single qubits (renaming the three letters X, Y, Z)”, and “choosing a different set of representatives generating the same checks”. “Local” means every step touches only one qubit.. In plain words:
| 操作Move | 玩具里的样子What it looked like in the toys | 改变了什么 / 没改变什么Changes / preserves |
|---|---|---|
| ① 重新编号比特① Renumber qubits | 1.1 节把比特 1、3 对调;1.2 节把每条边改叫穿过它的边1.1 swapped bits 1 and 3; 1.2 renamed every edge after the edge crossing it | 矩阵的列换了顺序;每条检查的重量、n、k、d 不变The matrix columns are reordered; the weight of every check, n, k, d unchanged |
| ② 单比特换基② Single-qubit change of basis | 1.2 节在每个比特上做 Had,X ↔ Z1.2 applied Had on every qubit, X ↔ Z | 字母改名;每条检查碰哪些比特、碰几个,不变。每个比特有 6 种改名法(X、Y、Z 三个字母的 6 种排列)Letters renamed; which and how many qubits each check touches, unchanged. Each qubit has 6 renamings (the 6 orderings of X, Y, Z) |
| ③ 换一组代表③ Change of generators | 1.1 节 H1 → H2:一行换成两行之和1.1, H1 → H2: one row replaced by the sum of two | 清单的行全可以变,连单条检查的重量都会变;清单生成的全部检查不变,n、k、d 不变Every row may change, even individual check weights; the full set of generated checks, n, k, d unchanged |
为什么只允许这三种?因为它们都不会改变任何逻辑算符的重量:编号和改名只是换名字,换代表根本没动码本身。一旦允许同时碰两个比特的操作(比如把比特 1 的错误「传」到比特 2 上),一条重量 1 的错误可以变成重量 2,码距就会变,那就不是换衣服而是换人了。QEC-Bank 登记检查时不记符号(sign-free),所以本篇也不追究 ± 号。
Why only these three? Because none of them changes the weight of any logical operator: renumbering and renaming are just names, and changing generators does not touch the code at all. Once operations acting on two qubits at once are allowed (say, “copying” an error from qubit 1 onto qubit 2), a weight-1 error can become weight 2 and the distance can change; that is no longer new clothes but a new person. The QEC-Bank records checks without signs (sign-free), so this guide does not track ± signs either.
1.4问题:谁来判定,用什么判定The problem: who decides, and by what
现在可以说出这道开放问题了。给两份检查清单,判定它们是否局部等价;更好的是给每个码算出一个典范指纹canonical fingerprint:由码算出来的一串数或字符,满足两条:(i) 换任何衣服它都不变;(ii) 真正不同的两个码,它必然不同。有了它,「是不是同一个码」就变成「两串指纹相等吗」。——换衣服不变、不同的码必不同。高中里最熟的典范形是分数约分:2/4 和 3/6 长得不一样,约成最简分数都是 1/2,于是一比就知道相等;「最简分数」就是分数的典范形。Wanted 板的原文是:
Now the open problem can be stated. Given two check lists, decide whether they are locally equivalent; better still, compute for every code a canonical fingerprintA string of numbers or characters computed from the code with two properties: (i) it does not change under any change of clothes; (ii) two genuinely different codes must get different fingerprints. With it, “same code?” becomes “equal fingerprints?”., unchanged by clothes and different for different codes. The most familiar canonical form from school is reducing fractions: 2/4 and 3/6 look different, both reduce to 1/2, and equality is read off at a glance; “lowest terms” is the canonical form of a fraction. The Wanted board's wording:
code-equivalence · “Code equivalence / canonical forms” · status: open · difficulty: open-research
“Decide when two entries are the same code up to local equivalence; canonical fingerprints beyond (n, k, d-bounds, weight histograms).”
code-equivalence · “Code equivalence / canonical forms” · status: open · difficulty: open-research
“Decide when two entries are the same code up to local equivalence; canonical fingerprints beyond (n, k, d-bounds, weight histograms).”
逐词翻译。「two entries」= QEC-Bank 的两张卡片;「the same code up to local equivalence」= 1.3 节的三种换衣服之下是同一个码;「canonical fingerprints」= 上面说的典范指纹;「beyond (n, k, d-bounds, weight histograms)」= 要比这四样更细:n、k 是两个整数,d-bounds 是码距的上下界(《大码的码距》讲为什么大码只有界没有精确值),重量直方图weight histogram:数一数码里有多少条重量 1、多少条重量 2、……的检查(或码字),排成一张表。换衣服不改变任何一条的重量,所以直方图是不变量。是「各种重量的检查各有几条」的一张表。n、k、真正的 d 和直方图换衣服都不变,所以都是不变量invariant:换衣服前后不变的量。不变量不同 ⇒ 码不同;不变量相同 ⇒ 什么都推不出(第 2 章有反例)。(登记的「d 的上下界」本身只是一个装着 d 的区间,两张卡的区间可以不一样;只有两个区间不相交时才能否决);但第 2 章会看到,四样全相同的两个码,仍可能不是同一个。
Word by word. “Two entries” = two QEC-Bank cards; “the same code up to local equivalence” = the same code beneath the three changes of clothes of 1.3; “canonical fingerprints” = as above; “beyond (n, k, d-bounds, weight histograms)” = finer than these four: n and k are two integers, d-bounds are lower and upper bounds on the distance (“Distance for large codes” explains why large codes have bounds rather than exact values), and the weight histogramCount how many checks (or codewords) of weight 1, of weight 2, … the code has, in a table. Changing clothes changes no weight, so the histogram is an invariant. is a table of “how many checks of each weight”. n, k, the true d and the histogram do not change with clothes, so they are invariantsQuantities unchanged by a change of clothes. Different invariants ⇒ different codes; equal invariants ⇒ nothing follows (Chapter 2 has a counterexample). (the recorded “bounds on d” are merely an interval containing d, and two cards may record different intervals; only disjoint intervals veto); but Chapter 2 will show two codes agreeing on all four that are still not the same.
对。前两项是 1.3 节的操作 ①、②,最后一项是操作 ③,都不改变码。「把字母从一个比特搬到另一个」同时碰了两个比特,会改变检查碰哪些比特、可能改变码距——那是换人,不是换衣服。
Right. The first two are moves ① and ② of 1.3, the last is move ③; none changes the code. “Moving a letter from one qubit to another” touches two qubits at once, changes which qubits the check touches and may change the distance: a new person, not new clothes.
再想:1.3 节的三种操作分别是换编号、单比特改名、换一组代表。你选的那一项属于其中之一,所以它是换衣服。找那个同时碰两个比特的。
Think again: the three moves of 1.3 are renumbering, renaming letters on one qubit, and changing representatives. Your choice is one of them, hence a change of clothes. Look for the one touching two qubits at once.
QEC-Bank 现在是怎么凑合的:一个字节指纹,几条手画的边How the QEC-Bank copes today: one byte-level fingerprint, a few hand-drawn edges
没有判定程序的时候,QEC-Bank 做两件事:给每张检查矩阵算一个只认字节的指纹,用来发现「完全一样」的复制品;再由人手在卡片之间画有类型的边,写下「这两个其实是一回事」。先看板上的原文,再把每样工具对到真实的源文件上,并看清它们各自看不见什么。 Without a decision procedure, the QEC-Bank does two things: it computes for every check matrix a fingerprint that recognises bytes only, to spot exact copies; and people draw typed edges between cards saying “these two are really the same”. Read the board's wording first, then match each tool to a real source file and see what each one cannot see.
“Invariant fingerprint + curated identity edges.”
“Invariant fingerprint + curated identity edges.”
2.1工具一:checkmatrix_fingerprint,只认字节Tool one: checkmatrix_fingerprint, bytes only
QEC-Bank 的 Python 代码库 qeclib 里,真正给一个码算「指纹」的函数只有一个:qeclib/benchmarks.py 里的 checkmatrix_fingerprint(cm)。它的注释原文是 “Fingerprint exact stabilizer/gauge values, shapes, rows, and qubits.” 它做的事,逐行读是这样的:先写下一个版本标签 stab-gauge-uint8-v1;再写下检查矩阵的形状(几行乘几列,比如 toric_L3 是 18 行 × 36 列——每个比特占两列,一列记 X、一列记 Z);再把矩阵的全部 0/1 按原来的顺序逐字节写下;如果这个码另有一组「不在乎」的检查(gauge,《不在乎的比特》专讲),也写下,否则写 no-gauge;最后把这一长串字节交给 SHA-256一种哈希函数:把任意长的一串字节压成固定的 64 个十六进制字符。同样的输入永远得到同样的输出;输入改一个比特,输出面目全非;从输出反推输入被认为不可行。不同的输入也可能得到同一个输出(叫「碰撞」),设计要求只是这样的一对在计算上找不到。,得到 64 个字符。
In the QEC-Bank Python library qeclib exactly one function computes a “fingerprint” of a code: checkmatrix_fingerprint(cm) in qeclib/benchmarks.py. Its docstring reads “Fingerprint exact stabilizer/gauge values, shapes, rows, and qubits.” Line by line, this is what it does: write a version tag stab-gauge-uint8-v1; write the shape of the check matrix (rows × columns; toric_L3 is 18 rows × 36 columns, two columns per qubit, one for X and one for Z); write every 0/1 of the matrix in its original order, byte by byte; if the code has a second list of “don't-care” checks (gauge, the subject of “Don't-care qubits”) write it too, otherwise write no-gauge; finally hand the whole byte string to SHA-256A hash function: it compresses a byte string of any length into a fixed 64 hexadecimal characters. Same input, same output, always; change one bit of input and the output is unrecognisable; recovering the input from the output is believed infeasible. Two different inputs can give the same output (a “collision”); the design requirement is only that no one can compute such a pair. and get 64 characters.
记号:‖ 读「接上」,把两串字节首尾相连;标签 = 版本标签 stab-gauge-uint8-v1;矩阵字节按原顺序写入;gauge 一项没有时写 no-gauge。「按原顺序」是下面这段话的全部要点。
Notation: ‖ reads “concatenated with”, joining two byte strings end to end; tag = the version tag stab-gauge-uint8-v1; the matrix bytes are written in their original order; the gauge item reads no-gauge when absent. “In order” is the whole point of the next paragraph.
用第 1 章的三件事去试它。操作 ①,把两个比特换编号:矩阵的两列对调,字节顺序变了,SHA-256 给出完全不同的 64 个字符。操作 ②,在一个比特上 X ↔ Z:那个比特的两列互换,同样变。操作 ③,H1 换成 H2:一行的内容变了,同样变。也就是说,这枚指纹对三种换衣服全都敏感——它是衣服的指纹,不是人的指纹。它认得出的只有「字节完全一致的复制品」。QEC-Bank 也正是这样用它的:每张卡片的构造记录里写着 match: exact-checkmatrix-v1,复现契约里写着期望的比对结果是 “byte-and-semantic-identical”——机器重新构造一次,和登记的矩阵逐字节相同才算通过。这里有一个细节:两枚指纹相同,逻辑上并不等于两串字节相同。输入有无穷多种,64 个十六进制字符只有 1664 = 2256 种,所以必然有不同的输入撞上同一个输出。SHA-256 的设计目标是让这样的一对「在计算上找不到」(NIST 对抗碰撞性的定义:“computationally infeasible to find two different inputs to the hash function that have the same hash value”),因此把「指纹相同」当作「字节相同」,实际风险可以忽略;但要把「完全一致」写成一张证书,指纹对上之后还应把两份矩阵逐字节再比一遍,这一步很便宜。这枚指纹对「同一台构造器有没有被改动」很合用;对「两台不同的构造器造出的是不是同一个码」则一个字也说不了。
Try the three moves of Chapter 1 on it. Move ①, renumber two qubits: two columns of the matrix swap, the byte order changes, SHA-256 returns 64 entirely different characters. Move ②, X ↔ Z on one qubit: that qubit's two columns swap; changes again. Move ③, H1 to H2: one row's content changes; changes again. So this fingerprint is sensitive to all three changes of clothes: it is a fingerprint of the clothes, not of the person. All it recognises is “a byte-for-byte identical copy”. And that is exactly how the QEC-Bank uses it: every card's construction record says match: exact-checkmatrix-v1, and the reproduction contract expects the comparison result “byte-and-semantic-identical”; the machine rebuilds the code and passes only if the result matches the registered matrix byte for byte. One detail: two equal fingerprints do not logically imply two equal byte strings. There are infinitely many inputs and only 1664 = 2256 strings of 64 hexadecimal characters, so different inputs must share an output. What SHA-256 is designed for is that no one can compute such a pair (NIST's definition of collision resistance: “computationally infeasible to find two different inputs to the hash function that have the same hash value”), so treating “equal fingerprints” as “equal bytes” carries a negligible practical risk; but to write “identical” into a certificate, compare the two matrices byte by byte once the fingerprints match, which is cheap. For “has the same constructor been tampered with?” this fingerprint serves well; for “do two different constructors build the same code?” it says nothing at all.
板上写的 “(n, k, d-bounds, weight histograms)” 是不变量式指纹应有的样子。今天 qeclib 里可执行的指纹函数只有上面这枚字节指纹;n、k 与 d 的证据词按实例登记在各条目的 instances.yaml 里(例如 toric_L3 三项 verified),并没有一个把「重量直方图」算出来存起来的函数。本篇在 2.2 节自己算了两张直方图,为的是说明它们能分开什么。
The board's “(n, k, d-bounds, weight histograms)” is what an invariant-style fingerprint should look like. Today the only executable fingerprint function in qeclib is the byte fingerprint above; n, k and the evidence word for d are registered per instance in each entry's instances.yaml (toric_L3: all three verified), and no function computes and stores a “weight histogram”. Section 2.2 computes two histograms for this guide to show what they can and cannot separate.
2.2不变量能分开什么:一对分不开的码What invariants can separate: a pair they cannot
换个方向:不看字节,只看换衣服不变的量。n、k、d、重量直方图,四样若有一样不同,两个码就一定不同——这是不变量的正用。反过来,四样全同能不能断定「同一个码」?不能。下面是本篇自己找的最小反例(用 notes/wanted-code-equivalence/check_pair.py 穷举全部 6 比特 3 位信息的经典码,按直方图分组、再按换编号判等价;本篇另把 n ≤ 5 的全部经典码穷举了一遍,没有这样的一对,所以 6 比特是最短的),它是经典码,8 个码字都能手写出来:
Change direction: ignore the bytes and look only at quantities unchanged by clothes. n, k, d, weight histogram: if any of the four differs, the two codes certainly differ. That is the proper use of an invariant. Conversely, does agreement on all four prove “the same code”? No. Below is the smallest counterexample this guide found itself (the script notes/wanted-code-equivalence/check_pair.py exhausts every classical code with 6 bits and 3 information bits, groups them by histogram, then tests equivalence under renumbering; this guide also exhausted every classical code with n ≤ 5 and found no such pair, so 6 bits is the shortest); it is a classical code, and all 8 codewords can be written by hand:
| 码 甲Code A | 码 乙Code B | |
|---|---|---|
| 生成它的三行(生成行)Three generating rows | 000011 · 000101 · 111001 | 000011 · 001100 · 110000 |
| 全部 8 个码字All 8 codewords | 000000 000011 000101 000110 111001 111010 111100 111111 | 000000 000011 001100 001111 110000 110011 111100 111111 |
| n, k | 6, 3 | 6, 3 |
| 重量直方图(重量 0/2/4/6 各几个)Weight histogram (how many of weight 0/2/4/6) | 1 · 3 · 3 · 1 | 1 · 3 · 3 · 1 |
| 最轻非零码字的重量 dWeight d of the lightest nonzero codeword | 2 | 2 |
| 三个重量 2 的码字有没有共用的比特Do the three weight-2 codewords share bits? | 有:000011、000101、000110 两两共用一位Yes: 000011, 000101, 000110 share one bit pairwise | 没有:000011、001100、110000 互不相交No: 000011, 001100, 110000 are disjoint |
记号:码字 = 码里合法的 0/1 串。这里的「码」用生成行写:三行的所有按位和(含全零)就是全部 8 个码字。同一个码也可以改用一份检查清单来写(列出所有码字都通过的检查),两种写法描述的是同一组码字,本篇不区分。「甲」「乙」只是名字。
Notation: a codeword = a legal 0/1 string of the code. The codes here are written by generator rows: all bitwise sums of the three rows (including all-zero) are the 8 codewords. The same code can instead be written as a check list (the checks every codeword passes); both writings describe the same set of codewords, and this guide does not distinguish them. “A” and “B” are just names.
前四行完全一样:n、k、d、直方图都分不开甲和乙。最后一行分开了它们,而且分得很牢:「两个码字有没有共用的比特」在换编号之后不会变(名字变了,共用还是共用),所以甲不可能是乙换了编号。人话:不变量相同只说明「还没找到区别」,不说明「没有区别」;而找到一个不同的不变量,就一票否决。Wanted 板要的「beyond (n, k, d-bounds, weight histograms)」,就是要一套足够细、细到「全相同 ⇒ 必是同一个码」的不变量——这就是典范指纹。上面这一对是经典码,但同样的盲区在量子码里也有。做法:甲的「检查」是那些与甲的每个码字都有偶数个共同 1 的 0/1 串(共 8 个,含全零);把每条检查写成泡利串,1 的位置放 Z、0 的位置放 I,就得到一个全 Z 型的量子码。乙同样处理。下表是本篇用脚本算出的生成元,其余检查都是它们的乘积:
The first four rows agree completely: n, k, d and the histogram cannot tell A from B. The last row separates them, and firmly: “do two codewords share a bit?” cannot change under renumbering (names change, sharing does not), so A cannot be B renumbered. In plain words: equal invariants only mean “no difference found yet”, not “no difference”; whereas one differing invariant is a veto. What the board wants with “beyond (n, k, d-bounds, weight histograms)” is a set of invariants fine enough that “all equal ⇒ the same code”, which is precisely a canonical fingerprint. The pair above is classical, but the same blind spot exists for quantum codes. The recipe: the “checks” of A are the 0/1 strings that share an even number of 1s with every codeword of A (8 of them, including all-zero); write each as a Pauli string with Z where it has a 1 and I where it has a 0, and you get an all-Z quantum code. Do the same for B. The table gives the generators computed by script for this guide; every other check is a product of them:
| 量子版 甲Quantum A | 量子版 乙Quantum B | |
|---|---|---|
| 三条 Z 型生成元Three Z-type generators | ZZIIII · ZIZIII · ZIIZZZ | ZZIIII · IIZZII · IIIIZZ |
| 检查组的全部 8 个元素按重量 0/2/4/6 计数All 8 elements of the check group counted by weight 0/2/4/6 | 1 · 3 · 3 · 1 | 1 · 3 · 3 · 1 |
| [[n, k, d]] | [[6, 3, 1]] | [[6, 3, 1]] |
手核一条:ZIIZZZ 碰第 1、4、5、6 位,甲的码字 111001 在这四位上是 1、0、0、1,共同的 1 有两个,偶数,所以通过。k:每边 3 条独立的检查、6 个比特;检查全是 Z,乘不出 −I,所以 k = 6 − 3 = 3。d:一条 X 串通过全部 Z 检查,当且仅当它的 1 的位置组成一个码字,所以最轻的 X 型逻辑算符重 2;而任何一个比特上的单个 Z 与所有检查对易(Z 与 Z 对易),却不在检查组的 8 个元素里(它们的重量只有 0、2、4、6),所以它通过全部检查、本身又不是检查,是一个重量 1 的逻辑算符:d = 1。表中第二行数的是检查组的全部 8 个元素(三条生成元任取几条相乘,一条也不取就是 I)。最后,能把一份全 Z 清单变成另一份全 Z 清单的单比特改名,只能在每个比特上保持 Z 不变(ZZZZZZ 在检查组里,每个比特都被碰到),所以这两个量子码是否局部等价,就等于甲、乙能否换编号互变:不能。n、k、d、检查的重量直方图全同,码却不同。(脚本:notes/wanted-code-equivalence/quantum_pair.py。)
Check one by hand: ZIIZZZ touches bits 1, 4, 5, 6; the codeword 111001 of A reads 1, 0, 0, 1 there, two shared 1s, even, so it passes. k: 3 independent checks on 6 qubits on each side; all checks are Z, so no product gives −I, and k = 6 − 3 = 3. d: an X string passes every Z check exactly when the positions of its 1s form a codeword, so the lightest X-type logical operator has weight 2; but a single Z on any qubit commutes with every check (Z commutes with Z) and is not among the 8 elements of the check group (their weights are only 0, 2, 4, 6), so it passes every check without being a check: a logical operator of weight 1, and d = 1. The table's second row counts all 8 elements of the check group (products of any choice of the three generators; choosing none gives I). Finally, a single-qubit renaming that turns one all-Z list into another all-Z list must keep Z as Z on every qubit (ZZZZZZ is in the check group, so every qubit is touched), so whether the two quantum codes are locally equivalent is exactly whether A and B are renumberings of each other: they are not. Same n, k, d and check weight histogram, different codes. (Script: notes/wanted-code-equivalence/quantum_pair.py.)
2.3工具二:人手画的「同一」边Tool two: identity edges drawn by hand
机器只认字节,所以「这两张卡其实是一回事」这类话今天全部由人来写,写成卡片上有类型的关系relation:card.yaml 里 relations 列表下的一条记录,四个字段:type(受控词表里的类型)、target(另一张卡的 id)、how(一句话说怎么回事)、refs(文献键)。origin 标 curated,即人手登记。。受控词表里与「同一」有关的类型有 same_bulk_phase_as(内部是同一种物相:「内部」指远离边界的地方,「同一种物相」指在那里看是同一种东西,比如都由同样的星和面检查拼成)、special_case_of(是……的特例)、product_of(是……的乘积)等;这类边的 origin 一律是 curated——「人手登记的」,不是机器算出的。看两条真实的边怎么写「同一」,又怎么小心地不写满:
Since the machine recognises only bytes, every sentence of the form “these two cards are really the same” is written by people today, as a typed relationA record under the relations list of card.yaml with four fields: type (from a controlled vocabulary), target (another card's id), how (one sentence), refs (bibkeys). Its origin is curated, i.e. registered by hand. on the card. The controlled vocabulary's identity-flavoured types include same_bulk_phase_as (the same phase inside: “inside”, the bulk, means away from any boundary, and “the same phase” means that there it looks like the same thing, for instance built from the same star and plaquette checks), special_case_of and product_of; the origin of such edges is always curated, “registered by hand”, never machine-derived. Two real edges show how “the same” is written, and how carefully it is not over-written:
| 边Edge | how 字段原文The how field, verbatim | 出处Source |
|---|---|---|
| toric → surface same_bulk_phase_as | “Both use the square-lattice star and plaquette bulk. Cutting the torus creates rough and smooth boundaries and changes absolute cycles into relative strings; closing those boundaries restores two periodic homology directions. Bulk equivalence is not code-space identity.” | codes/toric/card.yaml |
| honeycomb → toric same_bulk_phase_as | “After each round, contracting the just-measured matching and applying a depth-one local Clifford change of basis maps the instantaneous stabilizer group to toric-code stabilizers on a coarser lattice. The equivalence is frame-by-frame; the full protocol still has spacetime detectors and a nontrivial anyon automorphism.” | codes/honeycomb/card.yaml |
两句都在说「像」,也都在最后一句划清「不是同一个码」:环面码有 k = 2、表面码有 k = 1,内部一样但码空间(能通过全部检查的量子态的全体)不同;蜂窝码的每一帧要先「把刚测过的每对比特合成一个比特」(原文 contracting,比特数减半——这已经超出 1.3 节三种换衣服的范围),再做单比特换基(原文 “local Clifford change of basis”,即操作 ②),才像环面码,而整部电影不是。这正是人写边的好处——能写下细微的限定;也是坏处——只有人想到了、写了,边才存在。下表前两行各是同一个码穿着两套衣服:第一行有一条人画的边和一个机器算出的视图(恰好是字节完全一致的情形),第二行机器不认,人也还没画。第三行只在格子和边界都对得上时才是同一个码,每个条目都要单独写出那件衣服:
Both say “alike”, and both end by drawing the line “not the same code”: the toric code has k = 2, the surface code k = 1, same bulk but different code spaces (the code space is the set of all quantum states passing every check); every frame of the honeycomb code first has “each just-measured pair of qubits merged into one” (the card's “contracting”, halving the qubit count, which already lies outside the three changes of clothes of 1.3) and then a single-qubit change of basis (the card's “local Clifford change of basis”, move ②) before it looks like a toric code, and the whole movie is not one. That is the virtue of hand-written edges, they can carry fine print; and their vice, an edge exists only when someone thought of it and wrote it. The first two rows of the table are each one code in two outfits: the first has a hand-drawn edge and a machine-derived view (precisely the byte-identical case), the second is unrecognised by the machine and not yet drawn by hand. The third row is one code only when the lattice and the boundaries match, and each entry needs its own explicit change of clothes:
| 同一个码One code | 两套衣服Two outfits | 今天的边Edge today | 出处Source |
|---|---|---|---|
| 环面码 [[18,2,3]]Toric code [[18,2,3]] | 三台构造器:toric 条目自己的构造器;toric 卡片上的超图积视图 HGP(C_L, C_Lᵀ)(超图积:把两个经典码按固定配方拼成一个量子码;这里是两条 L 比特周期重复码——L 个比特排成一圈、相邻两位各一条检查——相乘,origin derived,原文 “reproduces the constructor's ordered star and plaquette matrices exactly”);BB 条目的实例 toric_L3(多项式 A = 1 + x、B = 1 + y、l = m = 3;BB 关系导读 2.3 节指出它与前两者是同一个码,只差行列顺序)。Three constructors: the toric entry's own; the hypergraph-product view HGP(C_L, C_Lᵀ) on the toric card (a hypergraph product, a fixed recipe that assembles a quantum code from two classical codes; here two periodic L-bit repetition codes, L bits in a ring with one check per neighbouring pair, multiplied, origin derived, verbatim “reproduces the constructor's ordered star and plaquette matrices exactly”); the BB entry's instance toric_L3 (polynomials A = 1 + x, B = 1 + y, l = m = 3; §2.3 of the BB relations guide notes it is the same code as the other two up to row and column order). | toric → hgp:一条 curated 边 product_of,加一个 derived 视图(矩阵逐字节相同,字节指纹够用)。BB 卡到 toric、到 hgp:没有边,也没有任何机器比对toric → hgp: one curated edge product_of plus a derived view (matrices identical byte for byte, so the byte fingerprint suffices). BB card to toric, to hgp: no edge, no machine comparison | toric/ card.yaml bivariate_bicycle/ instances.yaml |
| gross 码 [[144,12,12]]gross code [[144,12,12]] | 家族卡 bivariate_bicycle 的实例 gross:n = 144 verified、k = 12 verified、d = 12 bounded;成员卡 gross(T1):n = 144 verified、k = 12 verified、d = ?。同一张 144 比特的矩阵(BB 关系导读 3.3 节)。Instance gross of the family card bivariate_bicycle: n = 144 verified, k = 12 verified, d = 12 bounded; member card gross (T1): n = 144 verified, k = 12 verified, d = ?. The same 144-qubit matrix (BB relations guide, §3.3). | 两张卡之间:没有边Between the two cards: no edge | entries/ gross.html bivariate_bicycle/ instances.yaml |
| 表面码与它的「换眼镜」亲戚The surface code and its “change of glasses” relatives | 在同一块格子、同样的边界上,XZZX 表面码 = 在交错的数据比特上各做一次 Had(操作 ②)的 CSS 表面码(CSS:每条检查全是 X 或全是 Z)。Bonilla Ataides 等人(arXiv:2009.07851)的原话是 “locally equivalent to the conventional surface code, differing by a Hadamard rotation on alternate qubits”。两个码空间不是同一个子空间,而是被这组 Had 一一映过去,Surface Code 关系导读 4.2 节把它叫作换一副眼镜。「交错」要求能把比特像棋盘一样涂成两色;周期边界带错位(twisted)时,这种涂法可能不存在。Kovalev、Dumer、Pryadko(arXiv:1108.5490 v1,例 11)在错位的周期方格上给出一族码,其中最小的一个是 [[5,1,3]],它的检查是 ZXIXZ 的循环移位(其中一条就是 XZZXI);更大的成员用的是别的检查串。本篇用脚本穷举过:5 个比特上没有 k = 1、d = 3 的 CSS 码,而操作 ①② 不改 n、k、d,所以这个 [[5,1,3]] 不是任何 CSS 码换了衣服(脚本 notes/wanted-code-equivalence/twisted_513.py)。QEC-Bank 有 xzzx、xzzx_7_1_3、twisted_xzzx 等条目;本篇没有逐条核对它们的格子与边界,哪一条是某个 CSS 表面码换了衣服,要对那一条写出具体的一组 Had 才算数。On the same lattice with the same boundaries, the XZZX surface code = the CSS surface code (CSS: every check is all X or all Z) with one Had on alternating data qubits (move ②). Bonilla Ataides et al. (arXiv:2009.07851) put it as “locally equivalent to the conventional surface code, differing by a Hadamard rotation on alternate qubits”. The two code spaces are not the same subspace; these Hads map one onto the other, which §4.2 of the Surface Code relations guide calls a change of glasses. “Alternating” needs the qubits to be two-coloured like a chessboard; with shifted (twisted) periodic boundaries such a colouring may not exist. Kovalev, Dumer and Pryadko (arXiv:1108.5490 v1, Example 11) give a family on a twisted periodic square lattice; its smallest member is [[5,1,3]], whose checks are the cyclic shifts of ZXIXZ (one of them is XZZXI), while larger members use other check strings. This guide checked by exhaustive search that no CSS code on 5 qubits has k = 1 and d = 3, and moves ① and ② do not change n, k, d, so this [[5,1,3]] is no CSS code in other clothes (script notes/wanted-code-equivalence/twisted_513.py). The QEC-Bank has entries xzzx, xzzx_7_1_3, twisted_xzzx and others; this guide has not checked their lattices and boundaries one by one, and an entry counts as a CSS surface code in other clothes only once its explicit set of Hads is written down. | 各有条目,没有边Separate entries, no edge | surface/ card.yaml |
第二行最值得停一下。gross 的两张卡登记的是同一张矩阵,一张写 d = 12 bounded,一张写 d = ?。两个字都是诚实的:家族卡的实例有两份证书(文献下界 + 随机搜索找到的重量 12 见证,《大码的码距》第 2 章),成员卡是 T1 层级、只重算了秩。但一个读 QEC-Bank 的人看到「d = ?」,无法从卡片上得知隔壁就有 bounded 的答案——因为没有任何机器认得出这两张矩阵是一回事,也没有人画那条边。
The second row deserves a pause. The two gross cards register the same matrix; one says d = 12 bounded, the other d = ?. Both words are honest: the family card's instance has two certificates (a literature lower bound plus a weight-12 witness found by random search, “Distance for large codes”, Chapter 2), the member card is tier T1 and recomputed ranks only. But a reader of the QEC-Bank who sees “d = ?” cannot learn from the card that a bounded answer sits next door, because no machine recognises the two matrices as one, and nobody has drawn that edge.
为什么我们想要答案:去重,和统一三种语言Why we want the answer: deduplication, and unifying three languages
板上给了两个理由。第一个是图书管理员的理由:卡片越多,重复越多,而重复的卡片会各自记下不同的数字。第二个是翻译家的理由:同一个对象在文献里有三种「方言」,今天 QEC-Bank 只能把三段话并排放着。先看原文,再对到具体的卡片和字段。 The board gives two reasons. The first is a librarian's: the more cards, the more duplicates, and duplicates record different numbers each. The second is a translator's: the same object speaks three “dialects” in the literature, and today the QEC-Bank can only set three paragraphs side by side. Read the wording first, then match it to specific cards and fields.
“Dedup as the zoo grows past hundreds of entries; unify quon/parton/majorana presentations of the same object.”
“Dedup as the zoo grows past hundreds of entries; unify quon/parton/majorana presentations of the same object.”
3.1去重:184 张卡片,几个字会翻Deduplication: 184 cards, and which words would flip
「the zoo」指 Error Correction Zoo,QEC-Bank 把自己的条目映射到它的实体上;今天 codes/ 目录下有 184 张 card.yaml(本篇数的)。「Dedup」= 去重。有了判定程序,第 2 章那三处「没有边」会发生什么?
“The zoo” is the Error Correction Zoo, onto whose entities the QEC-Bank maps its own entries; today the codes/ directory holds 184 card.yaml files (counted for this guide). “Dedup” = deduplicate. With a decision procedure, what happens at the three “no edge” places of Chapter 2?
| 地方Place | 今天Today | 有了答案之后With the answer |
|---|---|---|
| gross 成员卡的 dd on the gross member card | d = ? | 机器证明两张矩阵局部等价 ⇒ 码距相同 ⇒ 成员卡可以继承家族卡的 d = 12, bounded,并注明「经等价继承」。反过来,若两张卡日后有人改了一张,机器会立刻发现它们不再等价。The machine proves the two matrices locally equivalent ⇒ equal distance ⇒ the member card can inherit the family card's d = 12, bounded, marked “inherited via equivalence”. Conversely, if someone later edits one card, the machine notices at once that they are no longer equivalent. |
| toric_L3 / toric / HGP(C₃,C₃)toric_L3 / toric / HGP(C₃,C₃) | toric ↔ HGP 有一条 curated 边和一个 derived 视图,因为两台构造器恰好逐字节一致;BB 的 toric_L3 只差行列顺序,字节不同,没有任何比对toric ↔ HGP has a curated edge and a derived view because the two constructors happen to agree byte for byte; BB's toric_L3 differs only in row and column order, so the bytes differ and nothing compares them | BB 实例与 toric 之间也出现一条机器推出的边(origin derived 或 verified),三处证书互相可引用;比较表里不再把同一个码数三遍。A machine-derived edge (origin derived or verified) appears between the BB instance and toric as well; the three certificates become mutually citable; comparison tables stop counting one code three times. |
| 新提交的一张卡A newly submitted card | 只能查「字节是否与已有的某张完全一致」Only “are the bytes identical to some existing card?” can be asked | 提交时算典范指纹,和 184 张已有指纹比对,一秒钟回答「已有 / 新的」。Compute the canonical fingerprint on submission, compare with the 184 existing ones, answer “already present / new” in a second. |
注意会翻的是哪个词:不是 d 的数值(那是另一道开放问题),而是关系边的 origin——从 curated(人说的)变成 derived / verified(机器算的)——以及本来空着的字段能否安全地继承。「安全」两个字有分量:码距在局部等价下不变(1.3 节说明了为什么),所以继承 d 是合法的;而阈值、译码器表现这类依赖具体电路的数字不能跟着边走:Surface Code 关系导读 4.2 节正好给了例子:同一块格子、同样边界上的 XZZX 与 CSS 表面码,码空间被交错比特上的 Had 一一映过去(2.3 节),码距相同;但同一种噪声打在换过基的比特上,「在检查眼里」变了样,所以阈值物理错误率低于它时,码做得越大,逻辑错误越少。要看噪声和译码器。X、Y、Z 三种错误一样常见的噪声(去极化噪声)在 Had 下不变(Had 只把 X、Z 对调,Y 仍是 Y),配上相应换过基的译码器,两个码面对的是同一道题;而只有 Z 错误的噪声下,Bonilla Ataides 等人(arXiv:2009.07851;检查结果不出错的 code-capacity 设定,近似最大似然的张量网络译码器,开边界)报告 XZZX 的阈值约 50%,CSS 表面码只有 10.8(1)%;BB 关系导读 4.4 节也讲过哪些数字不能跨轴照抄。
Note which word flips: not the value of d (that is another open problem) but the origin of relation edges, from curated (said by a person) to derived / verified (computed by a machine), and whether empty fields can be safely inherited. “Safely” carries weight: the distance is unchanged under local equivalence (1.3 explained why), so inheriting d is legitimate; whereas circuit-dependent numbers such as thresholds and decoder performance must not travel along the edge: §4.2 of the Surface Code relations guide gives exactly such an example: on the same lattice with the same boundaries, the code spaces of the XZZX and the CSS surface code are mapped onto each other by Had on alternating qubits (2.3), and the distance is the same; but the same noise landing on re-based qubits “looks different to the checks”, so the thresholdThe physical error rate below which making the code larger makes logical errors rarer. depends on the noise and the decoder. Noise in which X, Y and Z errors are equally likely (depolarizing noise) is unchanged by Had (it only swaps X and Z; Y stays Y), so with a decoder re-based the same way both codes face the same problem; under pure Z noise, Bonilla Ataides et al. (arXiv:2009.07851; code-capacity setting with error-free check outcomes, an approximate maximum-likelihood tensor-network decoder, open boundaries) report a threshold of about 50% for XZZX against 10.8(1)% for the CSS surface code; §4.4 of the BB relations guide likewise lists numbers that must not be copied across axes.
3.2三种方言:quon、parton、majoranaThree dialects: quon, parton, majorana
第二个理由里的三个词,在 QEC-Bank 卡片上都有出处。它们不是三个码,而是描述码的三种语言,本篇只能说清它们是什么类型的东西、QEC-Bank 怎么登记它们,不推导内容——这三种语言都远超高中范围。
The three words in the second reason all have a home on QEC-Bank cards. They are not three codes but three languages for describing codes; this guide can only say what kind of thing each is and how the QEC-Bank records it, without deriving content, since all three lie far beyond high-school level.
| 方言Dialect | QEC-Bank 卡片上的登记(原文节选)How the QEC-Bank records it (excerpt, verbatim) | 人话In plain words |
|---|---|---|
| quon | 表面码卡片,视图 type: fermionic, dialect: quon,origin curated,refs liu2017quon、liu2019quantized:“The toric bulk underlying the planar patch becomes a quantized graph: star and plaquette checks are unified as cycle operators…”;并标 gap: wanted:fermionic-compiler。Surface card, view type: fermionic, dialect: quon, origin curated, refs liu2017quon, liu2019quantized: “The toric bulk underlying the planar patch becomes a quantized graph: star and plaquette checks are unified as cycle operators…”; flagged gap: wanted:fermionic-compiler. | 一种画图的语言:把星和面两种检查画成同一种「圈」。A pictorial language that draws star and plaquette checks as one kind of “cycle”. |
| parton | 蜂窝码卡片,视图 type: fermionic, dialect: parton,origin curated,refs kitaev2006anyons:“Kitaev's four-Majorana representation factors each directional Pauli edge into a Z2 gauge variable and a matter-fermion pairing…”;同样标 gap: wanted:fermionic-compiler。Honeycomb card, view type: fermionic, dialect: parton, origin curated, refs kitaev2006anyons: “Kitaev's four-Majorana representation factors each directional Pauli edge into a Z2 gauge variable and a matter-fermion pairing…”; likewise flagged gap: wanted:fermionic-compiler. | 把每个比特拆成四个「半粒子」(Majorana)来写检查的语言。A language that splits every qubit into four “half-particles” (Majoranas) to write the checks. |
| majorana | 上一行的基本词汇;《用费米子的语言写电路》从「座位与符号」的玩具讲起。The basic vocabulary of the previous row; “Writing circuits in the language of fermions” starts from a toy of seats and signs. | 费米子语言的字母表。The alphabet of the fermionic language. |
三段话今天都是 curated 的视图:一段英文描述、几个文献键,没有任何机器检查「这段话描述的和检查矩阵里存的是同一个码」。「unify」要的就是这台机器:把 quon 图、parton 表达式、Majorana 表达式各翻译回一份检查清单,再用局部等价判定它们是不是同一个码。翻译那一步是费米子编译器那道问题;判定这一步是本篇这道。两道题一起解,三段并排的话才变成一句被核对过的话。
All three are curated views today: an English description and a few bibkeys, with no machine checking “what this paragraph describes is the same code as the stored check matrix”. “Unify” asks for exactly that machine: translate the quon picture, the parton expression and the Majorana expression each back into a check list, then decide by local equivalence whether they are one code. The translation step is the fermionic-compiler problem; the decision step is this one. Only with both solved do three paragraphs side by side become one checked sentence.
3.3今天一个 QEC-Bank 用户做不到的事What a user of the QEC-Bank cannot do today
合起来说三件。一,问「我手里这份检查清单,QEC-Bank 里有没有」:今天只能得到「字节一致 / 不一致」的回答,换过编号就查不到。二,问「这两张卡是不是同一个码」:只能看有没有人画过边,没画不代表不是(BB 关系导读用的说法是「尚未调研,不是负结论」)。三,把一张卡上的 verified / bounded 借给另一张:没有等价证明,借了就是抄。这三件事都不需要新的物理,只需要一台判定局部等价的机器——QEC-Bank 今天没有。
Three things in all. One, ask “is this check list in my hand already in the QEC-Bank?”: today the answer is only “bytes identical / not”, and a renumbered copy is invisible. Two, ask “are these two cards the same code?”: only whether someone drew an edge can be seen, and no edge does not mean no (the BB relations guide's phrase is “not yet surveyed, not a negative conclusion”). Three, lend one card's verified / bounded to another: without an equivalence proof, lending is copying. None of the three needs new physics, only a machine deciding local equivalence, and the QEC-Bank has none today.
合格的答案长什么样,为什么难What a qualifying answer looks like, and why it is hard
板上把难度标为 open-research。这一章先说清什么算解决(一台判定机,或一枚典范指纹),再用高中的计数说明为什么「把所有衣服都试一遍」不可行,最后说明「找一套足够细的不变量」为什么不是工程量的问题。 The board rates the difficulty open-research. This chapter first says what counts as solved (a decision machine, or a canonical fingerprint), then uses high-school counting to show why “try every outfit” is infeasible, and finally why “find a fine enough set of invariants” is not a matter of effort.
4.1什么算解决:一台判定机,或一枚典范指纹What counts as solved: a decision machine, or a canonical fingerprint
statement 里有两个「或」着的目标。弱的:一台判定机——输入两份检查清单,输出「局部等价 / 不等价」,并且答「等价」时附上那件衣服(编号对应表、每个比特的改名、代表的换法),让任何人能一步步核对。强的:一枚典范指纹——输入一份清单,输出一串字符,满足 1.4 节的两条性质;有了它,判定机就是「比较两串字符」,而且 184 张卡片只需各算一次、两两比较。分数约分是强的那种;「两个分数交叉相乘看是否相等」是弱的那种。两种都算完整解决;只给出更多不变量(比如第 2 章末那个「共用比特」的问题)算进展,不算解决,因为不变量相同仍推不出等价。
The statement holds two targets joined by “or”. The weak one: a decision machine that takes two check lists and outputs “locally equivalent / not”, attaching, when it says “equivalent”, the outfit itself (the renumbering table, the renaming on each qubit, the change of representatives) so anyone can verify step by step. The strong one: a canonical fingerprint that takes one list and outputs a string with the two properties of 1.4; with it, the decision machine is “compare two strings”, and the 184 cards need one computation each and pairwise comparison. Reducing fractions is the strong kind; “cross-multiply two fractions and compare” is the weak kind. Either counts as a full solution; merely adding more invariants (such as the “shared bits” question at the end of Chapter 2) counts as progress, not as a solution, because equal invariants still do not imply equivalence.
4.2为什么不能把衣服全试一遍Why every outfit cannot be tried
最笨的判定机:把甲的所有衣服都穿一遍,看有没有一件和乙字节一致。衣服有多少件?操作 ① 换编号:n 个比特的排法有 n! 种(n 的阶乘,n × (n−1) × … × 1)。操作 ② 改名:每个比特 6 种,共 6n 种。两者相乘:
The dumbest decision machine: put every outfit on A and see whether one matches B byte for byte. How many outfits? Move ① renumbering: n qubits can be ordered in n! ways (n factorial, n × (n−1) × … × 1). Move ② renaming: 6 per qubit, 6n in all. Multiply:
记号:n! 读「n 的阶乘」;6n 读「6 的 n 次方」;≈ 读「约等于」。这几个数是本篇自己算的。操作 ③(换代表)还没算进去,它另有一大堆。
Notation: n! reads “n factorial”; 6n reads “6 to the n”; ≈ reads “approximately”. These numbers were computed for this guide. Move ③ (changing representatives) is not yet included and adds a large multitude of its own.
对比《大码的码距》1.4 节的 218 = 262 144:码距那道题在 18 比特上一下午能穷举,这道题在 18 比特上就已经是 1029,比宇宙年龄的秒数还多 12 个数量级。换句话说,「换衣服」的自由度比「放错误」的自由度大得多,穷举在玩具尺寸就已经失效。判定机必须绕开枚举,直接看穿衣服——这就回到了不变量。
Compare 218 = 262 144 from §1.4 of “Distance for large codes”: the distance problem can be exhausted in an afternoon at 18 qubits, while this problem is already 1029 at 18 qubits, twelve orders of magnitude more than the age of the universe in seconds. In other words, the freedom of “changing clothes” is far larger than the freedom of “placing errors”, and exhaustion fails already at toy size. A decision machine must bypass enumeration and see through the clothes directly, which brings us back to invariants.
4.3为什么「够细的不变量」不是工程量问题Why “fine enough invariants” is not a matter of effort
Wanted 板给每道题两种难度。hard-engineering = 「知道怎么做,但要做很多」,比如把一个已有算法接进 QEC-Bank 的验证器;open-research = 「没人知道怎么做」。这道题标的是 open-research。诚实地说难在哪里:
The board grades every problem one of two ways. hard-engineering = “we know how, but there is a lot to do”, such as wiring an existing algorithm into the QEC-Bank verifier; open-research = “nobody knows how”. This problem is rated open-research. Honestly, where the difficulty lies:
| 难点Difficulty | 在玩具上是什么样What it looks like on the toy |
|---|---|
| 不变量要「完备」Invariants must be “complete” | 2.2 节的「共用比特」问题分开了甲和乙,但你怎么知道再没有一对码,连这个问题也答一样却仍不同?每加一个不变量只能堵一个洞,「没有洞了」需要一个证明,而不是更多例子。The “shared bits” question of 2.2 separated A from B, but how do you know there is no further pair answering even that question alike while still differing? Each added invariant plugs one hole; “no holes left” needs a proof, not more examples. |
| 量子比经典多一种衣服Quantum has one more kind of outfit than classical | 经典码只有操作 ①、③;量子码多了操作 ②(每个比特 6 种改名)。1.2 节里 X ↔ Z 之后连「星」和「面」都互换了,不变量必须对这种整体翻转也视而不见。Classical codes have only moves ① and ③; quantum codes add move ② (6 renamings per qubit). After X ↔ Z in 1.2 even “stars” and “plaquettes” swapped roles; the invariants must be blind to such wholesale flips too. |
| 「等价」的边界本身要定The boundary of “equivalent” must itself be fixed | 2.3 节两条边都在说「像但不是」:环面码与表面码内部相同、码空间不同;蜂窝码每一帧像环面码、整部电影不像。判定机先要被告知,哪些差别算衣服、哪些算人——对有「不在乎比特」的码(《不在乎的比特》)和随时间变的码(《两张测量时间表》),这条线今天都还没画好。Both edges of 2.3 say “alike but not the same”: toric and surface share a bulk but not a code space; every honeycomb frame resembles a toric code, the whole movie does not. A decision machine must first be told which differences are clothes and which are a person; for codes with don't-care qubits (“Don't-care qubits”) and codes that change in time (“Two measurement schedules”) that line is not yet drawn today. |
所以这不是「写更多代码」的问题。原则上问题是可判定的——4.2 节的穷举总会停下——缺的是一套算得快、又完备的不变量:「这一套不变量相同 ⇔ 局部等价」这句话,连同算它的方法。在它出现之前,每一样工具都只有一头可信:字节指纹说「相同」时可信(指纹相同 ⇒ 字节几乎必然一致,再逐字节比一遍就成了证明;字节一致 ⇒ 同一份清单),说「不同」时不可信(H1、H2 字节不同却是同一个码);不变量说「不同」时可信,说「相同」时不可信。本篇不假装知道那套完备的不变量长什么样;也没有查证研究文献里针对经典码(只有操作 ①、③)的判定算法已经走到哪一步。这里说的「缺」,是 QEC-Bank 的缺,以及 Wanted 板对量子情形的判断。
So this is not a “write more code” problem. In principle the question is decidable, the exhaustion of 4.2 always terminates; what is missing is a set of invariants that is fast to compute and complete: the sentence “this set of invariants agrees ⇔ locally equivalent”, together with a way to compute it. Until it exists, every tool is trustworthy at one end only: the byte fingerprint when it says “same” (equal fingerprints ⇒ almost certainly equal bytes, and a byte comparison turns that into a proof; identical bytes ⇒ the same list) but not when it says “different” (H1 and H2 differ in bytes yet are one code); invariants when they say “different” but not when they say “same”. This guide does not pretend to know what that complete set looks like, nor has it checked how far the research literature has come with deciding equivalence for classical codes (moves ① and ③ only). The “missing” here is what the QEC-Bank lacks, together with the board's judgement on the quantum case.
从这里出发能做什么:手证一对不等价,再看两台机器造同一个码What you can do from here: prove one pair inequivalent by hand, then watch two machines build one code
两个练习。第一个用一句话替 2.2 节的甲、乙证明「不是换编号能变到的」——这是不变量的正用,也是今天唯一可靠的方向。第二个在 BB 实验台上用多项式造出环面码 [[18,2,3]],亲眼看第 2 章那张「没有边」的表里第一行。最后是往哪里走。 Two exercises. The first proves in one sentence that A and B of 2.2 are “not reachable by renumbering”, the proper use of an invariant and the only reliable direction today. The second builds the toric code [[18,2,3]] from polynomials on the BB bench, to see with your own eyes the first row of Chapter 2's “no edge” table. Then, where to go next.
5.1手证:甲、乙不等价,且再算一个不变量By hand: A and B are inequivalent, plus one more invariant
第一步,确认它们的四个不变量确实相同(表已给出;重量直方图请自己数一遍 8 个码字)。第二步,找一个换编号不变的量并算出不同的值:数「重量 2 的码字对中,共用比特的对数」。甲:000011 与 000101 共用第 6 位,000011 与 000110 共用第 5 位,000101 与 000110 共用第 4 位——3 对。乙:三个重量 2 码字互不相交——0 对。换编号只改名字不改「共用」,所以 3 ≠ 0 一票否决:甲不是乙的换编号版本。第三步(可选),验证甲、乙各自的三行确实生成表里的 8 个码字:把三行两两相加、三行全加,再加上全零串。
Step one, confirm the four invariants really agree (the table gives them; count the weight histogram yourself over the 8 codewords). Step two, find a quantity unchanged by renumbering and compute different values: count “pairs of weight-2 codewords that share a bit”. A: 000011 and 000101 share bit 6, 000011 and 000110 share bit 5, 000101 and 000110 share bit 4: 3 pairs. B: the three weight-2 codewords are pairwise disjoint: 0 pairs. Renumbering changes names, not sharing, so 3 ≠ 0 is a veto: A is not a renumbered B. Step three (optional), verify that the three rows of A and of B generate the 8 codewords in the table: add the rows pairwise, add all three, and include the all-zero string.
若你换一对码来练,算出的所有不变量都相同,你没有证明它们等价——只是没找到区别。要证等价,必须交出那件衣服:一张编号对应表(和量子情形下每个比特的改名),让对方逐位核对。
If you practise on another pair and every invariant you compute agrees, you have not proved them equivalent; you have merely found no difference. To prove equivalence you must hand over the outfit: a renumbering table (and, in the quantum case, each qubit's renaming) that the other side can verify bit by bit.
5.2实验台:用多项式 1 + x、1 + y 造出环面码On the bench: build the toric code from the polynomials 1 + x, 1 + y
下面的 BB 实验台预设为 toric3:A = 1 + x、B = 1 + y、l = m = 3。它按 BB 的配方(BB 直觉教程 3.1 节)从两个多项式造出一张 18 比特的检查矩阵,读数里两块矩阵的秩各 8,k = 18 − 16 = 2(检查全是纯 X 或纯 Z,这个减法成立)。点一条检查,数它的 4 条腿:这就是环面码的星与面。构造器把比特分成「左层 9 个、右层 9 个」:对这组 A、B,左层就是横边,右层就是竖边;和 1.2 节沙盘相比,只是比特排列的先后次序不同,也就是只差操作 ①(换编号)。同一个码还可以由第三台机器造出:超图积 HGP(C₃, C₃)(qLDPC 教程 3.1 节)。三台机器、一个码:toric 卡片与超图积之间有一条人画的边和一个机器 derived 的视图(2.3 节;两台构造器恰好逐字节一致),而 BB 的 toric_L3 与它们之间没有任何边、任何比对。
The BB bench below is preset to toric3: A = 1 + x, B = 1 + y, l = m = 3. Following the BB recipe (BB intuition guide, §3.1) it builds an 18-qubit check matrix from the two polynomials; the readout shows both blocks with rank 8, k = 18 − 16 = 2 (every check is pure X or pure Z, so the subtraction holds). Click a check and count its 4 legs: these are the toric code's stars and plaquettes. The builder splits the qubits into “9 in the left layer, 9 in the right”; for this A and B the left layer is exactly the horizontal edges and the right layer the vertical edges, and compared with the sandbox of 1.2 only the order in which the qubits are listed differs, i.e. move ① (renumbering) alone. The same code is built by a third machine as well, the hypergraph product HGP(C₃, C₃) (qLDPC guide, §3.1). Three machines, one code: between the toric card and the hypergraph product there is a hand-drawn edge and a machine-derived view (2.3; the two constructors happen to agree byte for byte), while between BB's toric_L3 and either of them there is no edge and no comparison at all.
先用一条检查把配方从头走一遍,这样读数里的每个记号都有着落。每个比特有一个名字 L(i, j) 或 R(i, j):L = 左层,R = 右层;(i, j) = 它所在的格点,i 向右数、j 向上数,都从 0 开始,按 l、m 取余(在环面上走出右边就回到左边)。多项式的每一项是一步平移:1 = 原地不动,x = 向右一格,y = 向上一格,xayb = 向右 a 格、向上 b 格。配方只有两句:
First walk the recipe through for one check, so that every symbol in the readout has something to stand on. Each qubit has a name L(i, j) or R(i, j): L = left layer, R = right layer; (i, j) = its site, i counted to the right and j upwards, both from 0 and taken modulo l and m (on the torus, walking off the right edge brings you back on the left). Each term of a polynomial is one translation: 1 = stay, x = one cell right, y = one cell up, xayb = a cells right and b cells up. The recipe is two sentences:
- 格点 (i, j) 上的 X 检查:A 的每一项从 (i, j) 出发向前走一步,落到左层的一个比特;B 的每一项同样向前走,落到右层的一个比特。
- 格点 (i, j) 上的 Z 检查:B 的每一项倒着走一步(x 变成向左、y 变成向下),落到左层;A 的每一项倒着走,落到右层。
- The X check at site (i, j): each term of A takes one step forward from (i, j) and lands on a left-layer qubit; each term of B steps forward the same way and lands on a right-layer qubit.
- The Z check at site (i, j): each term of B takes one step backwards (x becomes one cell left, y one cell down) and lands on the left layer; each term of A steps backwards onto the right layer.
对 toric3、格点 (0, 0),四条腿是这样来的(3 取余:−1 就是 2):
For toric3 at site (0, 0) the four legs come out like this (modulo 3, −1 is 2):
| 检查Check | 哪个多项式的哪一项Which term of which polynomial | 怎么走The step | 落到的比特Qubit reached |
|---|---|---|---|
| X 检查 (0, 0)check (0, 0) | A 的 11 of A | 不动stay | L(0,0) |
| X 检查 (0, 0)check (0, 0) | A 的 xx of A | 向右一格one right | L(1,0) |
| X 检查 (0, 0)check (0, 0) | B 的 11 of B | 不动stay | R(0,0) |
| X 检查 (0, 0)check (0, 0) | B 的 yy of B | 向上一格one up | R(0,1) |
| Z 检查 (0, 0)check (0, 0) | B 的 11 of B | 不动stay | L(0,0) |
| Z 检查 (0, 0)check (0, 0) | B 的 yy of B | 倒着走:向下一格,(0, −1) = (0, 2)backwards: one down, (0, −1) = (0, 2) | L(0,2) |
| Z 检查 (0, 0)check (0, 0) | A 的 11 of A | 不动stay | R(0,0) |
| Z 检查 (0, 0)check (0, 0) | A 的 xx of A | 倒着走:向左一格,(−1, 0) = (2, 0)backwards: one left, (−1, 0) = (2, 0) | R(2,0) |
为什么 Z 检查要倒着走:这两条检查共用 L(0,0) 和 R(0,0) 两个比特,偶数个,所以对易(每个共用比特上 X 与 Z 反对易一次,两次抵消);配方保证任何一条 X 检查和任何一条 Z 检查都共用偶数个比特,理由见 BB 直觉教程 3.2 节(一行证明:AB = BA,再用 1 + 1 = 0)。实验台打开时选中的就是 X 检查 (0, 0),四个被碰到的比特旁标着它们的名字,读数里写着每条腿来自哪一项;点它左下方半格处的小方块,就看到 Z 检查 (0, 0)。(这张表由 notes/wanted-code-equivalence/check00.py 按构造器同样的规则复算。)
Why the Z check steps backwards: these two checks share the two qubits L(0,0) and R(0,0), an even number, so they commute (on each shared qubit X and Z anticommute once, and two such signs cancel); the recipe makes every X check share an even number of qubits with every Z check, for the reason given in the BB intuition guide, §3.2 (a one-line proof: AB = BA, then 1 + 1 = 0). When the bench opens, the selected check is the X check (0, 0); its four qubits are labelled with their names, and the readout says which term each leg comes from. Click the small square half a cell below and to the left of it to see the Z check (0, 0). (The table was recomputed by notes/wanted-code-equivalence/check00.py with the constructor's own rules.)
怎么用:输入框「A 的项」「B 的项」里,每一项写成两个用逗号隔开的整数 a,b,代表 xayb;项与项之间用空格隔开。toric3 的 A = 1 + x 写成 0,0 1,0,B = 1 + y 写成 0,0 0,1。滑块改 l、m。
读数里的记号:x、y = 两个平移方向(向右、向上一格);l、m = 环面在这两个方向的格数;A、B = 两个多项式。HX = 全部 X 检查排成的 0/1 矩阵,每行一条检查、每列一个比特,前 l·m 列是左层、后 l·m 列是右层;HX = [A | B] 说的是左半块按 A 的项填、右半块按 B 的项填。HZ = [Bᵀ | Aᵀ] 同理,ᵀ = 转置(行列互换),在这里就是「倒着走」。HXHZᵀ = 0 = 每条 X 检查与每条 Z 检查共用偶数个比特,即两两对易。rank = 一组检查里独立的条数。列号 = 比特在矩阵里的列:L(i, j) 是 i·m + j,R(i, j) 是 l·m + i·m + j(例如 R(0,1) 是 9 + 0 + 1 = 10)。dX = 最轻的 X 型逻辑算符的重量;「见证」= 搜索找到的那条 X 逻辑算符本身。C₃ = 3 比特周期重复码。
How to use it: in the boxes “A terms” and “B terms” write each term as two integers separated by a comma, a,b, meaning xayb, with a space between terms. toric3's A = 1 + x is 0,0 1,0 and B = 1 + y is 0,0 0,1. The sliders change l and m.
Symbols in the readout: x, y = the two translation directions (one cell right, one cell up); l, m = the torus size in those directions; A, B = the two polynomials. HX = the 0/1 matrix of all X checks, one row per check and one column per qubit, the first l·m columns for the left layer and the last l·m for the right; HX = [A | B] says the left half is filled from the terms of A and the right half from B. HZ = [Bᵀ | Aᵀ] likewise, with ᵀ = transpose (rows and columns swapped), which here means “step backwards”. HXHZᵀ = 0 = every X check shares an even number of qubits with every Z check, i.e. they all commute. rank = the number of independent checks in a list. Column number = the qubit's column in the matrix: L(i, j) is i·m + j, R(i, j) is l·m + i·m + j (R(0,1), for example, is 9 + 0 + 1 = 10). dX = the weight of the lightest X-type logical operator; the “witness” = that X logical operator itself, as found by the search. C₃ = the periodic 3-bit repetition code.
5.3往哪里走Where to go next
两道相邻的开放问题。板上 subsystem-dressed-distance 的 related 字段列出了本篇(related: [code-equivalence, certified-lower-bounds]),它的 statement 里要的 “equivalence-safe subsystem presentations”,以及 why_it_matters 里的 “proof that gauge-equivalent presentations preserve the claimed quantity”,就是本篇的问题在「有不在乎比特的码」上的版本:《不在乎的比特,与穿了衣服的码距》。而对随时间变化的码,「衣服」变成了「测量的先后次序」:《两张测量时间表是不是同一回事》。本篇的 yaml 自己的 related 是空的(related: []),没有 working_repo。QEC-Bank 里的实物。BB 关系导读(2.3 节相切的那一点、3.3 节两张 gross 卡)、Surface Code 关系导读(1.2 节两条边的格式、4.2 节 XZZX 的换基)、qLDPC 教程 3.1 节(HGP 造出表面码与环面码)。
Two neighbouring open problems. The related field of the board item subsystem-dressed-distance lists this one (related: [code-equivalence, certified-lower-bounds]); the “equivalence-safe subsystem presentations” in its statement and the “proof that gauge-equivalent presentations preserve the claimed quantity” in its why_it_matters are this guide's problem for codes with don't-care qubits: “Don't-care qubits and the dressed distance”. For codes that change in time, the “clothes” become “the order of measurements”: “Are two measurement schedules the same thing?”. This item's own yaml has an empty related (related: []) and no working_repo. The real objects in the QEC-Bank. BB relations guide (§2.3 the point of tangency, §3.3 the two gross cards), Surface Code relations guide (§1.2 the format of its two edges, §4.2 the XZZX change of basis), qLDPC guide §3.1 (HGP building the surface and toric codes).
三件衣服、一枚字节指纹、一对分不开的码Three outfits, one byte fingerprint, one inseparable pair
回放一遍。一个码不是它的检查清单,而是清单生成的全部检查;换编号、单比特改名、换一组代表,三种操作都不改变码,合称局部等价。QEC-Bank 今天有 184 张卡,判定「同一个码」的工具只有两样:checkmatrix_fingerprint——把矩阵字节按原顺序交给 SHA-256,三种换衣服都会让它改变,所以它只认字节一致的复制品;以及人手登记的 curated 边,写得细,但没人写就没有。环面码 [[18,2,3]] 以 toric_L3、HGP(C₃,C₃)、toric 三副面孔出现,只有 toric 与 HGP 之间有边(因为字节恰好一致);gross 的同一张矩阵在两张卡上分别写 d = 12 bounded 与 d = ?,中间没有边。n、k、d、重量直方图这四样不变量能一票否决、不能一票通过:一对 6 比特经典码四样全同却不是换编号能变到的。合格的答案是一台判定机或一枚典范指纹;问题原则上可判定,但穷举衣服在 18 比特上已是 1029,而 QEC-Bank 手里没有「算得快又完备的不变量」,Wanted 板把它标为 open-research。
Replay. A code is not its check list but everything the list generates; renumbering, renaming letters on single qubits and changing representatives leave the code unchanged and together are called local equivalence. The QEC-Bank holds 184 cards today and has two tools for “the same code”: checkmatrix_fingerprint, which feeds the matrix bytes in their original order to SHA-256 and changes under all three changes of clothes, so it recognises only byte-identical copies; and hand-registered curated edges, precise in their fine print but absent unless someone writes them. The toric code [[18,2,3]] appears with three faces, toric_L3, HGP(C₃,C₃) and toric, and only toric and HGP are joined by an edge (their bytes happen to agree); gross's one matrix reads d = 12 bounded on one card and d = ? on another, with no edge in between. The four invariants n, k, d and weight histogram can veto but never approve: a pair of 6-bit classical codes agrees on all four yet is not reachable by renumbering. A qualifying answer is a decision machine or a canonical fingerprint; the question is decidable in principle, but exhausting outfits is already 1029 at 18 qubits, and the QEC-Bank has no “fast, complete invariants”; the board rates it open-research.
符号与读法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]]. All three are invariant under local equivalence. |
| H, H1, H2 | 读「检查矩阵」Read “check matrix” | 每行一条检查、每列一个比特的 0/1 矩阵;H1、H2 是 3 比特重复码的两种写法。A 0/1 matrix with one row per check and one column per bit; H1, H2 are two ways of writing the 3-bit repetition code. |
| Had | 读「阿达马矩阵」Read “Hadamard matrix” | (1/√2)·[1 1 ; 1 −1];单比特换基,X ↔ Z。为避免与检查矩阵 H 混淆而加下标。(1/√2)·[1 1 ; 1 −1]; a single-qubit change of basis, X ↔ Z. Subscripted to avoid clashing with the check matrix H. |
| X, Y, Z | 读「泡利 X、Y、Z」Read “Pauli X, Y, Z” | 单比特的三个基本操作;操作 ② 是把这三个字母在一个比特上重新命名,共 6 种。The three basic single-qubit operations; move ② renames these three letters on one qubit, 6 ways. |
| L | 读「L」Read “L” | 环面码边长;n = 2L²,d = L。本篇 L = 3。Toric-code side length; n = 2L², d = L. Here L = 3. |
| n!, 6n | 读「n 的阶乘、6 的 n 次方」Read “n factorial, 6 to the n” | n 个比特的编号方式数、改名方式数;n = 18 时乘积约 6.5 × 1029。Number of numberings and of renamings of n qubits; their product for n = 18 is about 6.5 × 1029. |
| ‖ | 读「接上」Read “concatenated with” | 把两串字节首尾相连;2.1 节指纹公式。Join two byte strings end to end; the fingerprint formula of 2.1. |
| SHA-256 | 读「SHA 二五六」Read “SHA two-five-six” | 哈希函数:任意字节串 → 64 个十六进制字符;输入改一位则输出全变;不同输入撞上同一输出(碰撞)可能存在,但在计算上找不到。Hash function: any byte string → 64 hexadecimal characters; one changed input bit changes the whole output; two inputs with the same output (a collision) exist but cannot be computed in practice. |
| ⇒, ⇔ | 读「推出 / 当且仅当」Read “implies / if and only if” | 不变量不同 ⇒ 码不同;典范指纹要的是「指纹相同 ⇔ 局部等价」。Different invariants ⇒ different codes; a canonical fingerprint needs “equal fingerprints ⇔ locally equivalent”. |
| x, y, l, m, A, B, C₃ | 读「BB 码的记号」Read “BB notation” | 两个平移方向、环面两向格数、两个多项式(稀疏矩阵)、3 比特周期重复码;toric_L3 = A = 1 + x、B = 1 + y、l = m = 3 = HGP(C₃, C₃)。Two translation directions, torus sizes, two polynomials (sparse matrices), the periodic 3-bit repetition code; toric_L3 = A = 1 + x, B = 1 + y, l = m = 3 = HGP(C₃, C₃). |
本篇新增词汇New terms in this guide
| 术语Term | 白话定义Plain definition |
|---|---|
| 局部等价local equivalence | 两份清单能通过换编号、单比特改名、换一组代表互相变到;「局部」= 每步只碰一个比特。Two lists reachable from each other by renumbering, single-qubit renaming and changing representatives; “local” = each step touches one qubit. |
| 不变量invariant | 换衣服不变的量:n、k、d、重量直方图、「共用比特的对数」……不同 ⇒ 码不同;相同 ⇒ 无结论。A quantity unchanged by clothes: n, k, d, weight histogram, “number of bit-sharing pairs”… Different ⇒ different codes; equal ⇒ no conclusion. |
| 典范指纹 / 典范形canonical fingerprint / canonical form | 换衣服不变、不同码必不同的一串字符;分数的最简形式是高中里的例子。A string unchanged by clothes and different for different codes; a fraction in lowest terms is the school example. |
| 重量直方图weight histogram | 各种重量的检查(或码字)各有几条的表。A table of how many checks (or codewords) there are of each weight. |
| 哈希 / SHA-256hash / SHA-256 | 把任意长的字节串压成固定长度摘要的函数;只认字节。摘要相同几乎必然字节相同,但不是证明,要证明就逐字节比。A function compressing any byte string into a fixed-length digest; recognises bytes only. Equal digests almost certainly mean equal bytes but do not prove it; for a proof compare the bytes. |
| checkmatrix_fingerprintcheckmatrix_fingerprint | QEC-Bank 的字节指纹(qeclib/benchmarks.py):版本标签 + 形状 + 矩阵字节 + gauge,交给 SHA-256。The QEC-Bank byte fingerprint (qeclib/benchmarks.py): version tag + shape + matrix bytes + gauge, fed to SHA-256. |
| curated 边 / 关系curated edge / relation | 人手登记的有类型关系(type、target、how、refs);origin 写 curated。A hand-registered typed relation (type, target, how, refs); origin says curated. |
| same_bulk_phase_assame_bulk_phase_as | 「内部是同一种物相」的关系类型;卡片原文强调它「不是码空间的同一」。The relation type “same bulk phase”; the cards stress it “is not code-space identity”. |
| quon / parton / majoranaquon / parton / majorana | 描述码的三种语言(方言),分别登记在表面码卡与蜂窝码卡的 fermionic 视图里;本篇只描述、不推导。Three languages (dialects) for describing codes, recorded in the fermionic views of the surface and honeycomb cards; described here, not derived. |
| open-research / hard-engineeringopen-research / hard-engineering | Wanted 板的两种难度:没人知道怎么做 / 知道怎么做但要做很多。The board's two difficulty grades: nobody knows how / known how but much to do. |
| 码空间code space | 能通过全部检查的量子态的全体;k 个逻辑比特就住在这里。The set of all quantum states that pass every check; the k logical qubits live there. |
| 对偶格dual lattice | 在每块面的中心放一个顶点、让每条新边穿过一条旧边得到的格子;方格的对偶格还是方格(图 1.1)。The grid obtained by putting a vertex at the centre of every face and letting every new edge cross one old edge; the dual of a square grid is again a square grid (Fig. 1.1). |
| 超图积 HGPhypergraph product HGP | 把两个经典码按固定配方拼成一个量子码;两条周期重复码的超图积就是环面码。A fixed recipe that assembles a quantum code from two classical codes; the hypergraph product of two periodic repetition codes is the toric code. |
| 内部(bulk)/ 物相bulk / phase | 远离边界的部分 / 在那里看起来是同一种东西(例如由同样的星和面检查拼成)。The part away from any boundary / looking like the same thing there (for instance built from the same star and plaquette checks). |
延伸阅读Further reading
- Zhengwei Liu, Alex Wozniakowski, Arthur M. Jaffe, “Quon 3D language for quantum information” (2017)
liu2017quon(QEC-Bank 已登记,arXiv 1612.02630)。表面码卡片 quon 视图的出处;本篇未读其内容,只引用卡片上的登记。liu2017quon (registered in the QEC-Bank, arXiv 1612.02630). Source of the surface card's quon view; this guide did not read it and cites only the card's record. - Zhengwei Liu, “Quantized Graphs and Quantum Error Correction” (2019)
liu2019quantized(已登记,arXiv 1910.12065)。同一视图的第二条引文,也是 fermionic-compiler 那道题的引文之一。liu2019quantized (registered, arXiv 1910.12065). The same view's second citation, and one of the fermionic-compiler item's citations. - QEC-Bank: the Wanted item and its data
wanted/code-equivalence.yaml(六个字段的原文)、wanted/subsystem-dressed-distance.yaml(把本篇列为 related 的条目)、qeclib/benchmarks.py(checkmatrix_fingerprint)、qeclib/checkmatrix.py(from_css:X 行与 Z 行上下叠放,toric_L3 为 18 × 36)、codes/bivariate_bicycle/instances.yaml(toric_L3、gross 的登记)、exports/site/entries/gross.html(成员卡 d = ?)、codes/toric/card.yaml 与 codes/honeycomb/card.yaml(两条 same_bulk_phase_as 边)、codes/surface/card.yaml(quon 视图)、codes/bivariate_bicycle/pedagogy/variant-boundary-map.md(哪些数字不能跨变体照抄)。wanted/code-equivalence.yaml (the six fields verbatim), wanted/subsystem-dressed-distance.yaml (the item listing this one as related), qeclib/benchmarks.py (checkmatrix_fingerprint), qeclib/checkmatrix.py (from_css: X rows stacked over Z rows, 18 × 36 for toric_L3), codes/bivariate_bicycle/instances.yaml (the toric_L3 and gross records), exports/site/entries/gross.html (member card d = ?), codes/toric/card.yaml and codes/honeycomb/card.yaml (the two same_bulk_phase_as edges), codes/surface/card.yaml (the quon view), codes/bivariate_bicycle/pedagogy/variant-boundary-map.md (which numbers must not be copied across variants).
状态原文:open;难度原文:open-research。逐字引用的:statement、current_proxy、why_it_matters(第 1、2、3 章的框),checkmatrix_fingerprint 的注释与步骤,toric 卡的两个 how 字段(same_bulk_phase_as → surface、product_of → hgp)与 cyclic-hypergraph-product 视图的一句、honeycomb 卡的 how 字段,表面码卡与蜂窝码卡的 fermionic 视图节选,subsystem-dressed-distance.yaml 的 related 与两句原文。本篇自己算的、QEC-Bank 页面上没有的:184 张卡的计数;2.2 节的甲、乙两码(脚本 notes/wanted-code-equivalence/check_pair.py 穷举 6 比特、3 信息位的经典码得到)及其直方图与「共用比特对数」3 与 0;18!、618、144!、6144 及其乘积;toric_L3 的矩阵形状 18 × 36(由 from_css 的叠放规则推出,未运行)。本篇自己证的:1.1 节 H1、H2 生成同一个码;1.2 节 X ↔ Z 后仍是同一环面码(用环面对偶格仍是方格);5.1 节甲、乙不等价。只描述、未推导的:quon、parton、Majorana 三种语言的内容;「够细的不变量」应是什么样。「同一个码码距相同」在 1.3 节只说明了理由(三种操作不改变任何逻辑算符的重量),未形式化。本篇没有运行 checkmatrix_fingerprint 或任何 QEC-Bank 验证器;没有读 liu2017quon、liu2019quantized、kitaev2006anyons 的内容。
Status verbatim: open; difficulty verbatim: open-research. Quoted word for word: statement, current_proxy, why_it_matters (the boxes of Chapters 1, 2, 3), the docstring and steps of checkmatrix_fingerprint, the toric card's two how fields (same_bulk_phase_as → surface, product_of → hgp) and one sentence of its cyclic-hypergraph-product view, the honeycomb card's how field, excerpts of the fermionic views of the surface and honeycomb cards, the related field and two sentences of subsystem-dressed-distance.yaml. Computed for this guide and absent from QEC-Bank pages: the count of 184 cards; codes A and B of 2.2 (found by the script notes/wanted-code-equivalence/check_pair.py exhausting classical codes with 6 bits and 3 information bits), their histograms and the “bit-sharing pairs” 3 and 0; 18!, 618, 144!, 6144 and their products; toric_L3's matrix shape 18 × 36 (deduced from from_css's stacking rule, not run). Proved in this guide: H1 and H2 generate the same code (1.1); the code after X ↔ Z is still the same toric code (1.2, via the dual of the square torus grid being a square grid); A and B inequivalent (5.1). Described only, not derived: the content of the quon, parton and Majorana languages; what “fine enough invariants” should look like. “Equivalent codes have equal distance” was justified in 1.3 (the three moves change no logical operator's weight) but not formalised. Neither checkmatrix_fingerprint nor any QEC-Bank verifier was run for this guide; liu2017quon, liu2019quantized and kitaev2006anyons were not read.
开放问题总览 · 一张机器能核对的「没有更轻逻辑算符」证书 · 同一个码穿不同的衣服(本篇) · 拓扑替我们算出门 · 有些码还没有「标准译码器」 · 大码的码距:便宜的上界,昂贵的下界 · 用费米子的语言写电路 · 检查每一轮都在变,码距该怎么数 · 从理想症状到真实电路 · 两张测量时间表是不是同一回事 · 不在乎的比特,与穿了衣服的码距 · 在 Wanted 板上查看 →
All open problems · A machine-checkable certificate that nothing lighter exists · The same code in different clothes (this guide) · Topology computes the gates · Some codes still have no standard decoder · Distance for large codes: cheap upper bounds, expensive lower bounds · 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 →
BB 码 · 条目总览(关系 2.3:BB 与环面码相切的那一点 · 关系 3.3:gross 为什么有两张卡 · 直觉 3.1:两层比特,一张配方) · Surface Code · 条目总览(关系 1.2:表面码的两条关系 · 关系 4.2:XZZX 与 Clifford 形变) · 《从高考数学到 Toric Code》4.4:稳定子 · 《qLDPC 码 · 高中数学版》3.1:表面码与环面码 = rep × rep
BB codes · Entry overview (relations 2.3: where BB touches the toric code · relations 3.3: why gross has two cards · intuition 3.1: two layers, one recipe) · Surface Code · Entry overview (relations 1.2: the surface code's two relations · relations 4.2: XZZX and Clifford deformation) · “From Exam Maths to the Toric Code” 4.4: stabilizers · “qLDPC Codes · High-School Edition” 3.1: surface and toric = rep × rep