目录Contents
导读与装备清单Orientation & the kit list
一分钟对表:哪些默认你会,哪些由教程现教,页面怎么用。 One minute to synchronize: what's assumed, what's taught here, how the page works.
默认你已具备(高三平均水平即可,不需要竞赛背景):
Assumed (average final-year level, no olympiad background needed):
教程现场建造(超出大纲,但每件都只需十分钟):2×2 矩阵与矩阵乘法(第 1 章)、张量积(第 4 章)、本征值与本征态、投影测量(第 3–4 章)。承诺不变:凡超出高中大纲的概念,绝不在未定义时使用。
Built on site (beyond the syllabus, ten minutes each): 2×2 matrices and matrix multiplication (Ch. 1), tensor products (Ch. 4), eigenvalues/eigenstates and projective measurement (Ch. 3–4). The standing promise: nothing beyond the syllabus is ever used before it is defined.
页面用法:带 试一试 标签的面板是真实运行的模拟器,不是插图;蓝边盒子存放关键结论;橙边盒子交代简化与完整版的差距;可展开的「为什么?」盒子装选读证明——这一版里,多数证明就在那里,建议都打开。正文里引用前文结论的橙色虚线(如「按 4.3 的投影算符」),点一下会原地弹出该定义的小卡片,免去来回翻页;希腊字母与新符号(ψ、λ、⊗ 这类浅灰点线)点一下则会告诉你它怎么读、什么意思,页尾附完整符号读音表。右上角可切换中/EN。若中途觉得节奏太快,同一套内容备有零基础版:《从 1+1 到 Toric Code》(零基础版)→
Using the page: panels tagged Try it are live simulators, not pictures; blue-edged boxes hold key conclusions; amber boxes disclose simplifications; fold-out “why?” boxes carry the optional proofs — in this edition most proofs live there, and opening them is recommended. Amber dashed citations of earlier results (like “by §4.3's projectors”) pop up a small card restating that definition in place — one click, no scrolling back; Greek letters and novel symbols (ψ, λ, ⊗ — faint grey dotted) click to reveal how they are read and what they mean, with a full pronunciation table at the end. The 中/EN switch sits top-right. If the pace ever feels steep, the same material exists in a no-prerequisites edition: “From 1+1 to the Toric Code” (no-prerequisites edition) →
补件工坊:矩阵、复数、二项分布The parts shop: matrices, ℂ, binomial
三样零件一次备齐:一件全新的(矩阵),两件回炉打磨的(复数、二项分布)。全教程的其余部分都用它们组装。 Three parts stocked at once: one brand-new (matrices), two re-polished (complex numbers, the binomial distribution). Everything else in this tutorial is assembled from these.
1.1矩阵:给「对向量的操作」记账Matrices: bookkeeping for operations on vectors
你熟悉平面向量 v = (x, y)。现在我们需要描述对向量的操作——把一个向量变成另一个向量的规则。最有用的一类操作是「线性」的:新坐标是旧坐标的固定组合。这样的操作只需 4 个数就能完全记录,把它们排成 2×2 的方阵,称为矩阵,并规定它作用在(竖着写的)向量上的方式:
You know plane vectors v = (x, y). We now need to describe operations on vectors — rules turning one vector into another. The most useful ones are “linear”: each new coordinate is a fixed mix of the old ones. Four numbers record such a rule completely; arrange them in a 2×2 array, call it a matrix, and define how it acts on a (column-written) vector:
立刻认识两位主角。交换矩阵 S 与变号矩阵 D:
Meet the two protagonists at once: the swap matrix S and the re-sign matrix D:
连续做两个操作呢?「先 B 后 A」把 v 变成 A(B·v)。存在唯一的矩阵把这两步并成一步,记作 AB,叫矩阵乘法:AB 的第 i 行第 j 列元素 = A 的第 i 行与 B 的第 j 列对应相乘再相加(和上面「行点乘向量」同一动作,逐列做一遍)。「什么都不做」也有矩阵:单位矩阵 I(对角线 1,其余 0),满足 I·v = v,且 S² = D² = I(交换两次、变号两次都回到原样)。
Two operations in a row? “B then A” sends v to A(B·v). A unique matrix does both in one step; write it AB and call the recipe matrix multiplication: entry (i, j) of AB = row i of A dotted with column j of B (the same row-dot move as above, done column by column). “Do nothing” has a matrix too: the identity I (ones on the diagonal), with I·v = v and S² = D² = I (swapping twice or re-signing twice restores everything).
现在做一道全教程最重要的计算题。请亲手算 SD 与 DS(把 D 的每一列喂给 S 的每一行;再反过来):
Now the most important exercise in this tutorial. Compute SD and DS by hand (feed D's columns to S's rows; then the reverse):
矩阵乘法在乎顺序。S 和 D 交换顺序后恰好差一个整体负号——这个看似无关痛痒的 −1,将成为整座量子纠错大厦的承重梁。(顺带记下两条平安无事的性质:结合律 A(BC)=(AB)C 恒成立;只是交换律没了。)
Matrix multiplication cares about order. Swapping S and D costs exactly one overall minus sign — and this innocuous-looking −1 will carry the weight of the entire edifice of quantum error correction. (For the record, associativity A(BC)=(AB)C always holds; only commutativity is lost.)
1.2复数一页通Complex numbers, one page
回炉三件事:z = a + bi(i² = −1);模 |z| = √(a²+b²);共轭 z̄ = a − bi,且 z·z̄ = |z|²。量子力学的「配比数字」(振幅)一般是复数,概率永远等于模的平方 |z|²——本教程的公式将一律写成 |·|² 以保持通用,但主线的所有例子里振幅都是实数(此时 |a|² 就是 a²),你不会在任何一步真的被复数拦住。
Three re-polished facts: z = a + bi (i² = −1); modulus |z| = √(a²+b²); conjugate z̄ = a − bi with z·z̄ = |z|². Quantum “blend numbers” (amplitudes) are complex in general, and probability is always the modulus squared |z|² — our formulas will be written with |·|² for full generality, though in every worked example of the main path the amplitudes are real (where |a|² is just a²), so no step will ever actually strand you in ℂ.
为什么大自然坚持用复数?Why does nature insist on ℂ?
这个问题比看上去深,本页不回答它。一个常见的说法是「量子演化要转动状态、又要保持长度,所以需要复数」,但这不够:实数的 2×2 旋转矩阵 [[cos θ, −sin θ], [sin θ, cos θ]] 同样能连续转动、保持长度。本页真正用到复数的地方只有两处:泡利矩阵 Y 含 i(第 3 章),以及 3.4 诚实说明里的整体相位 eiθ。主线用到的两种操作(交换、变号)都是实矩阵,所以其余部分都可以待在实数里。
The question is deeper than it looks, and this page does not answer it. A common line is “quantum evolution must rotate states while preserving length, hence complex numbers”, but that is not enough: the real 2×2 rotation matrix [[cos θ, −sin θ], [sin θ, cos θ]] also rotates continuously and preserves length. This page actually needs ℂ in only two places: the Pauli matrix Y contains i (Chapter 3), and the global phase eiθ in the honesty note of §3.4. The two operations the main path uses (swap, re-sign) are real matrices, so everything else can stay in ℝ.
1.3概率与二项分布:回炉即用Probability & binomial: re-polish and use
要用的只有三件:独立事件的概率相乘;「n 次独立试验中恰好 k 次命中」的二项分布公式;以及「频率随试验次数趋稳于概率」的大数直觉——最后这条抽象,亲手抛一抛最踏实:
Only three items get used: probabilities of independent events multiply; the binomial formula for “exactly k hits in n independent trials”; and the law-of-large-numbers intuition that frequencies settle toward probabilities — best re-earned by flipping for yourself:
1.4最后一颗螺丝:(−1) 的奇偶律The last screw: parity of (−1)s
平凡,但请高看它一眼:后文所有「检查是否报警」的判定,最终都会归结为数一个整数的奇偶。
Trivial — yet give it a second look: every “does this check alarm?” verdict ahead reduces, in the end, to the parity of one integer.
对。它把每个向量逆时针转 90°——「先变号再交换」合成的效果。而 DS 给 (y, −x)ᵀ:顺时针 90°。转的方向相反,正是那个 −1 的几何长相。
Right. It rotates every vector 90° counterclockwise — the combined effect of “re-sign then swap”. DS gives (y, −x)ᵀ: 90° clockwise. Opposite senses of rotation — the geometric face of that −1.
把 SD = [[0,−1],[1,0]] 的每一行分别与 (x,y) 点乘。
Dot each row of SD = [[0,−1],[1,0]] with (x, y).
经典纠错热身Classical warm-up
量子纠错的每个动作都是经典动作的升级。先在普通比特的世界里,把「出错—检查—修复」全套流程与两条中心思想(冗余、只查奇偶不读内容)拿到手。 Every quantum move upgrades a classical one. First, in the world of ordinary bits, collect the full fail–check–repair routine and its two central ideas: redundancy, and parity-only checks that never read content.
2.1噪声模型The noise model
一个比特取 0 或 1。存储与传输不完美:设每个比特独立地以概率 p 被翻转(0↔1)。先感受 p 的威力:
A bit is 0 or 1. Storage and transmission are imperfect: let each bit be independently flipped (0↔1) with probability p. Feel what p does:
2.2重复码与二项分布Repetition & the binomial
最老的对策:发 0 记作 000、发 1 记作 111(编码:1 个「逻辑比特」写进 3 个「物理比特」),接收后多数表决。至少 2 个比特同时翻转才会译错,用 1.3 的二项分布立刻写出失败概率:
The oldest countermeasure: send 0 as 000, 1 as 111 (encoding: one “logical bit” written into three “physical bits”), then decode by majority vote. It fails only when ≥2 bits flip, so §1.3's binomial delivers the failure probability at once:
什么时候划算?解不等式 3p² − 2p³ < p:除以 p(p>0),得 2p² − 3p + 1 > 0,因式分解 (2p−1)(p−1) > 0,而 p < 1 使第二个因子为负,故需 2p−1 < 0,即 p < 1/2。结论:只要信道「好过抛硬币」,重复就有利可图,且 p 越小、pL ≈ 3p² 的压缩越悬殊——p = 1% 时失败率降到约 0.03%。这种「错误率从 p 降到 ~p² 量级」的交易是一切纠错码的心脏。模拟对照理论:
When does it pay? Solve 3p² − 2p³ < p: divide by p (p>0) to get 2p² − 3p + 1 > 0, factor as (2p−1)(p−1) > 0; since p < 1 makes the second factor negative, we need 2p − 1 < 0, i.e. p < 1/2. Whenever the channel beats a coin flip, repetition pays — and the smaller p, the more lopsided the pL ≈ 3p² compression: at p = 1% the failure rate drops to ≈0.03%. This “p down to ~p²” trade is the heart of all error correction. Simulation vs theory:
2.3奇偶检查:只问「一样吗」,得到症状Parity checks: ask only “equal?”, obtain the syndrome
多数表决有个隐藏动作——它读出了全部三个比特。经典世界无所谓;但第 3 章会证明,量子信息一被读取就受损。所以现在改练一种永不读内容的检修法:只测两个奇偶量 s₁ = b₁⊕b₂、s₂ = b₂⊕b₃(⊕ 表示模 2 加法:相同得 0,不同得 1)。读数 (s₁, s₂) 称为症状,四种取值恰好区分「无错 / 翻了 b₁ / 翻了 b₂ / 翻了 b₃」,而对内容 000 还是 111 一无所知:
Majority voting hides a step — it reads all three bits. Harmless classically; but Chapter 3 will prove that reading damages quantum information. So we now train a repair method that never reads content: measure only the two parities s₁ = b₁⊕b₂, s₂ = b₂⊕b₃ (⊕ is addition mod 2: equal gives 0, different gives 1). The reading (s₁, s₂) is called the syndrome; its four values exactly separate “no error / b₁ flipped / b₂ / b₃”, while revealing nothing about whether 000 or 111 is stored:
症状指认错误而不泄露内容——「知错而不知情」。量子世界只允许这一种体检;toric code 就是把这个想法放大成一整张网格。
The syndrome names the error without betraying the content — “know the fault, not the secret”. It is the only physical exam the quantum world permits; the toric code is this idea scaled to a whole grid.
对,≈ 10p³(p 小时)。对比三倍的 ≈ 3p²:多花两个比特,把错误率又压低一个数量级——「冗余换质量」可以持续加码,这正是后文「码距」概念的雏形。
Right — ≈ 10p³ for small p. Against threefold's ≈ 3p²: two more bits buy another order of magnitude. “Redundancy for quality” keeps scaling — the embryo of the coming notion of code distance.
多数表决在 5 票里需要至少 3 票出错才翻车;把 k=3,4,5 三项都加上(各带 (1−p) 的补齐次幂)。
Majority in 5 fails only with ≥3 flips; sum the k = 3, 4, 5 binomial terms with their (1−p) powers.
量子比特:ℂ² 里的单位向量The qubit: a unit vector in ℂ²
量子力学对一个两状态系统的全部规定,用三条公设就能写完:状态是单位向量、操作是矩阵、测量按模方掷骰子并坍缩。这一章把三条全部立起来,并让第 1 章那对矩阵 S、D 亮出真名。 Quantum mechanics legislates a two-state system in three postulates: states are unit vectors, operations are matrices, measurement rolls dice by modulus-squared and collapses. This chapter erects all three — and lets Chapter 1's matrices S, D reveal their true names.
3.1公设一与公设三:状态与测量Postulates one & three: states and measurement
一个量子比特遵循量子力学的两状态系统(原子的两个能级、超导电路……)。英文 qubit。的两个「纯读数」记作 |0⟩ 与 |1⟩(读 ket 0 / ket 1——就是给基向量起的名字),并规定它们是二维空间的标准基:
A qubitAny two-state system obeying quantum mechanics (two atomic levels, a superconducting circuit…).'s two “pure readings” are written |0⟩ and |1⟩ (read “ket 0 / ket 1” — names for basis vectors), declared to be the standard basis of a two-dimensional space:
先认三个记号:状态惯例命名为 ψ(希腊字母,读「普西」);ℂ 是双线体大写 C,读「复数集」,ℂ² 即两个复数组成的向量全体;∈ 读「属于」。公设一(状态):系统的状态是一个长度为 1 的向量(分量叫振幅状态向量的分量,一般为复数;测得对应结果的概率 = 振幅的模方。,可以为负、甚至为复数)。公设三(测量):在 0/1 基上测量,得 0 的概率是 |a|²、得 1 的概率是 |b|²(模方规则,因此要求长度 1:|a|²+|b|²=1 就是概率归一);测量后状态坍缩为所得的那个基向量,原振幅信息即刻消失。在实振幅的切片上亲手体会(拖动箭头就是在改 a、b):
Three notations first: states are customarily named ψ (Greek, read “psy”); ℂ, the double-struck C, reads “the complex numbers”, so ℂ² is the set of two-complex-entry vectors; ∈ reads “belongs to”. Postulate one (states): the system's state is a length-1 vector (components called amplitudesThe state vector's components, complex in general; the probability of an outcome is the amplitude's modulus squared., possibly negative or complex). Postulate three (measurement): measuring in the 0/1 basis gives 0 with probability |a|² and 1 with |b|² (the modulus-squared rule — whence length 1: |a|²+|b|²=1 is exactly normalization); afterwards the state collapses onto the basis vector obtained, the old amplitudes gone. Explore the real-amplitude slice by hand (dragging the arrow edits a and b):
3.2公设二:操作是矩阵——泡利三人组登场Postulate two: operations are matrices — enter the Paulis
公设二(操作):一个孤立系统(不与外界交换任何东西)在不被测量时,状态的变化是「线性保长度」的,即由矩阵实现。第 1 章的两位主角现在亮明身份——交换矩阵 S 与变号矩阵 D 正是量子比特最基本的两种「拨动」,行话记作 X 与 Z;连同含 i 的第三位成员,合称泡利矩阵:
Postulate two (operations): while an isolated system (one that exchanges nothing with its surroundings) is not being measured, its state changes in a “linear and length-preserving” way, i.e. by a matrix. Chapter 1's protagonists now show their badges — the swap matrix S and re-sign matrix D are precisely the qubit's two elementary nudges, written X and Z; together with a third member containing i they form the Pauli matrices:
X 交换振幅(量子版比特翻转):X(a,b)ᵀ=(b,a)ᵀ;Z 给 |1⟩-分量变号:Z(a,b)ᵀ=(a,−b)ᵀ。噪声施加 X 称为 X 错误,施加 Z 称为 Z 错误——注意 Z 完全不改动 |a|²、|b|²,在 0/1 测量里彻底隐形。它究竟动了什么?回答这个问题需要一个新词。
X swaps amplitudes (the quantum bit-flip): X(a,b)ᵀ=(b,a)ᵀ; Z re-signs the |1⟩ component: Z(a,b)ᵀ=(a,−b)ᵀ. Noise applying X is an X error; applying Z, a Z error — and note Z leaves |a|², |b|² untouched, utterly invisible to 0/1 measurement. What, then, did it change? Answering needs one new word.
本教程的噪声模型(一个选择,不是公设的推论)。真实的比特并不孤立:它会和周围环境交换能量,所以公设二管不到它挨的噪声。例:处在 |1⟩ 的比特会自发落回 |0⟩,把能量交给环境(称为振幅阻尼amplitude damping:比特自发从 |1⟩ 落回 |0⟩、把能量交给环境的噪声。没有人测量它,但它也不是一个保长度的矩阵。)。看最极端的情形:|0⟩ 不动,|1⟩ 必然变成 |0⟩。若这是一个矩阵 M,那么 M(1,0)ᵀ = (1,0)ᵀ、M(0,1)ᵀ = (1,0)ᵀ,按线性 M(1/√2, 1/√2)ᵀ = (2/√2, 0)ᵀ = (√2, 0)ᵀ,平方和是 2 而不是 1:长度没有保住,所以它不是公设二说的那种操作。本教程(以及本系列)选定一种简化的模型:噪声偶尔对某个比特施加一个 X 或 Z,其余时候不打扰它。这样错误就只有 X 错误、Z 错误两种(以及二者同时发生),后面的全部机制都在这个模型里讲。
This tutorial's noise model (a choice, not a consequence of the postulates). Real qubits are not isolated: they exchange energy with their surroundings, so Postulate two does not cover the noise they suffer. Example: a qubit in |1⟩ can fall back to |0⟩ on its own, handing its energy to the environment (called amplitude dampingNoise in which a qubit falls from |1⟩ back to |0⟩ on its own, giving its energy to the environment. Nobody measures it, yet it is not a length-preserving matrix either.). Take the extreme case: |0⟩ stays put and |1⟩ always becomes |0⟩. If this were a matrix M, then M(1,0)ᵀ = (1,0)ᵀ and M(0,1)ᵀ = (1,0)ᵀ, so by linearity M(1/√2, 1/√2)ᵀ = (2/√2, 0)ᵀ = (√2, 0)ᵀ, whose squares add to 2, not 1: length is not preserved, so this is not an operation of the kind Postulate two describes. This tutorial (and this series) chooses a simplified model: now and then noise applies an X or a Z to some qubit, and otherwise leaves it alone. Errors then come in just two kinds, X errors and Z errors (and both at once), and every mechanism from here on is explained within this model.
3.3本征值、本征态与「测一个算符」Eigenvalues, eigenstates, and “measuring an operator”
对矩阵 M,若非零向量 v 满足 M·v = λ·v(M 不改变 v 的方向,只整体乘上常数 λ),(λ 是希腊字母,读「拉姆达」,惯用来当这个倍数的名字),就称 v 是 M 的本征态Mv = λv 中的 v(eigenvector/eigenstate);λ 叫本征值(eigenvalue)。高中未学,此处即学即用。、λ 是对应的本征值。Z 的本征态一眼可见就是 |0⟩ 与 |1⟩;要说 X 的本征态,得先给两个新向量起名字:
For a matrix M, a nonzero vector v with M·v = λ·v (M keeps v's direction, only scaling it by λ) (λ — Greek, read “LAM-da” — is the customary name for that factor) is called an eigenstateThe v in Mv = λv; λ is its eigenvalue. Not in the syllabus — taught here, used immediately. of M with eigenvalue λ. Z's eigenstates are visibly |0⟩ and |1⟩; to name X's we first need two new vectors:
读 ket plus / ket minus。它们是3.1 节意义下合法的状态:长度都是 1((1/√2)² + (1/√2)² = 1),在 0/1 基上测量各以 1/2 的概率得 0 或 1——两者的读数概率完全相同,唯一的差别是两个振幅之间的相对符号。在 0/1 基上测量看不见这个符号,但它是真实的——本节末尾会用另一种测量把它测出来。现在逐一验证四个例子(每个都是一次矩阵乘向量的口算):
Read “ket plus” and “ket minus”. Both are legitimate states in the sense of §3.1: length 1 ((1/√2)² + (1/√2)² = 1), and a 0/1 measurement gives 0 or 1 with probability 1/2 each — identical readout probabilities, the only difference being the relative sign between the two amplitudes. A 0/1 measurement cannot see that sign, but it is real — by the end of this section a different measurement will detect it. Now verify four examples (each a one-line matrix-times-vector mental calculation):
于是 Z 的本征态是 |0⟩、|1⟩(本征值 +1、−1),X 的本征态是 |±⟩(同样 ±1)。测量的推广:物理上「测量算符 O」意为提问「你处于 O 的哪个本征值?」——答案只会是本征值之一,概率由状态在各本征态上的分量模方给出,测后坍缩到对应本征态。「在 0/1 基测量」就是「测 Z」;同理「测 X」问的是 ±。把 |ψ⟩=(a,b)ᵀ 分解到 |±⟩ 上,用向量点乘即可求分量(实数情形;复数时点乘需带共轭,见折叠盒):
So Z's eigenstates are |0⟩, |1⟩ (eigenvalues +1, −1) and X's are |±⟩ (again ±1). Measurement, generalized: physically, “measuring an operator O” asks “which eigenvalue of O are you at?” — the answer is always an eigenvalue, with probability the modulus-squared of the state's component along each eigenstate, followed by collapse onto it. “Measuring in the 0/1 basis” is exactly “measuring Z”; likewise “measuring X” asks ±. Decomposing |ψ⟩=(a,b)ᵀ along |±⟩ takes one dot product each (real case; the complex case conjugates one factor — see the fold):
复数情形的内积;以及为什么概率总和总是 1The complex inner product; and why probabilities always total 1
复振幅时,两向量 u、v 的内积定义为 ⟨u|v⟩ = ū₁v₁ + ū₂v₂(第一个向量取共轭),分量为 c = ⟨本征态|ψ⟩,概率 |c|²。「概率总和为 1」在任何本征基下都成立,因为泡利矩阵的本征态互相垂直且各自长度 1(正交归一基),分解不多不少恰好用尽整个向量——(a+b)²/2 + (a−b)²/2 = a²+b² 的展开就是它的实数版。
With complex amplitudes the inner product is ⟨u|v⟩ = ū₁v₁ + ū₂v₂ (first vector conjugated); components are c = ⟨eigenstate|ψ⟩ and probabilities |c|². “Probabilities total 1” holds in any eigenbasis because Pauli eigenstates are mutually perpendicular unit vectors (an orthonormal basis), so the decomposition spends the vector exactly — (a+b)²/2 + (a−b)²/2 = a²+b² is the real-number instance.
现在回答 3.2 的悬案:Z 交换 |+⟩ 与 |−⟩(口算:Z(1,1)ᵀ/√2 = (1,−1)ᵀ/√2 ✓)。所以 Z 错误是 ± 基里的翻转——0/1 眼镜里隐形,± 眼镜里现形;X 错误恰好相反。一个量子比特有两副眼镜、两种翻转,两副眼镜必须同时设防。左右对照:
Now the §3.2 mystery resolves: Z swaps |+⟩ and |−⟩ (mental math: Z(1,1)ᵀ/√2 = (1,−1)ᵀ/√2 ✓). So a Z error is a flip in the ± basis — invisible through the 0/1 lens, glaring through the ± lens; X errors are the mirror image. One qubit, two lenses, two flips — and both lenses need guarding. Compare side by side:
3.4反对易:第 1 章那个 −1 的正式册封Anticommutation: knighting Chapter 1's −1
你在 1.1 已经亲手算过 SD = −DS。换上真名就是:
You already computed SD = −DS in §1.1. Under their true names:
术语:AB = BA 称 A、B 对易commute:AB = BA,先后顺序无关。;AB = −BA 称反对易anticommute:AB = −BA,交换顺序付出整体 −1。同一比特上的 X 与 Z 反对易。。作用在不同比特上的操作互不干涉、必定对易。这一对词是全教程的中枢神经:往后每次判断「检查报不报警」,都是在判断「对易还是反对易」。分步动画复习一遍:
Terminology: AB = BA means A and B commuteAB = BA: order irrelevant.; AB = −BA means they anticommuteAB = −BA: swapping order costs a global −1. X and Z on one qubit anticommute.. Operations on different qubits never interfere and always commute. This word-pair is this tutorial's central nervous system: every future “will this check alarm?” is an is-it-commuting question. Replay stepwise:
两点备案。① 全局相位:|ψ⟩ 与 −|ψ⟩(更一般地 eiθ|ψ⟩,其中 θ 读「西塔」,表示任意角度;eiθe 是自然对数的底;欧拉公式 eiθ = cos θ + i sin θ 给出一个模为 1 的复数,乘它只转动相位、不改变长度。 是模为 1 的复数)在一切测量中给出完全相同的模方,物理上视为同一状态;反对易的 −1 之所以有物理后果,是因为它出现在算符之间的相对关系里,而非孤立状态上。② Y 呢?直接验证 Y = iXZ:一个 Y 错误等于「X 和 Z 同时发生」(差一个无关紧要的相位 i),因此凡能分别捉住 X 与 Z 的体系,顺手就能捉住 Y。这就是主线只讲 X、Z 的底气。
Two filings. ① Global phase: |ψ⟩ and −|ψ⟩ (more generally eiθ|ψ⟩, where θ — “THAY-ta” — is any angle and eiθe is the base of natural logarithms; Euler's formula eiθ = cos θ + i sin θ gives a complex number of modulus 1, so multiplying by it rotates the phase without changing any length. is a complex number of modulus 1) give identical modulus-squares in every measurement and count as the same physical state; the anticommutation −1 has consequences because it lives in the relation between operators, not on a lone state. ② What about Y? Verify Y = iXZ directly: a Y error is “X and Z at once” (up to a harmless phase i), so any system that catches X and Z separately catches Y for free. That is the warrant for a main path built on X and Z alone.
3.5危机:不可复制,不可偷看The crisis: no copying, no peeking
把第 2 章的重复码平移过来,立刻撞上两堵墙。墙一:编码第一步「把状态复印三份」被不可克隆定理禁止——不存在能把任意未知态 |ψ⟩ 复制成两份的操作。证明只有三行,但用到「两个系统合起来怎么写」,即下一章的张量积;届时在折叠盒里兑现。墙二:多数表决要读取比特,而公设三说读取即坍缩。出路在 2.3 早已排练:奇偶检查从不读内容。下一章就把它量子化。
Port Chapter 2's repetition code over and hit two walls at once. Wall one: the first step, “photocopy the state in triplicate”, is banned by the no-cloning theorem — no operation copies an arbitrary unknown |ψ⟩. The proof is three lines but needs “how two systems combine”, i.e. next chapter's tensor product; it will be honoured there in a fold. Wall two: majority voting reads bits, and postulate three says reading collapses. The way out was rehearsed in §2.3: parity checks never read content. Next chapter quantizes them.
对。0.98 + c₋² = 0.98 + 0.02 = 1 ✓。这个状态几乎就是 |+⟩ 本身——若噪声来一个 Z,c₊ 与 c₋ 立即互换(0.98 → 0.02),Z 错误在 ± 测量里响亮无比。
Right — and 0.98 + c₋² = 1 ✓. This state is nearly |+⟩ itself; one Z error would swap c₊ and c₋ (0.98 → 0.02) — deafening in a ± measurement.
测 X 要先换到 ± 基:c₊ = (a+b)/√2(3.3 节),概率是它的平方。
Measuring X means the ± basis first: c₊ = (a+b)/√2 (§3.3); the probability is its square.
多比特、投影测量与稳定子Registers, projective measurement, stabilizers
本章交付四件重器:张量积(多系统的合并规则)、泡利串的碰撞定理、投影测量 P± = (I±S)/2,以及用「检查清单」圈定编码空间的稳定子方法。装配完毕即得第一个量子纠错码——并看清它为何必然倒下。 Four heavy tools are delivered: the tensor product (how systems combine), the collision theorem for Pauli strings, projective measurement P± = (I±S)/2, and the stabilizer method of fencing a code space with a checklist. Assembled, they yield our first quantum code — and expose exactly why it must fall.
4.1张量积:把两个系统写成一个The tensor product: two systems as one
两个量子比特合起来有四个基本读数,基向量记作 |00⟩、|01⟩、|10⟩、|11⟩(第一位是 1 号比特),一般状态是四维单位向量 |ψ⟩ = a₀₀|00⟩ + a₀₁|01⟩ + a₁₀|10⟩ + a₁₁|11⟩。若两个比特各自独立处于 (a₁, b₁)ᵀ 与 (a₂, b₂)ᵀ,合并态的振幅就是逐对相乘(这个合并操作记作 ⊗,读「张量积」):
Two qubits jointly have four basic readings, with basis kets |00⟩, |01⟩, |10⟩, |11⟩ (first slot = qubit 1); a general state is a four-dimensional unit vector |ψ⟩ = a₀₀|00⟩ + a₀₁|01⟩ + a₁₀|10⟩ + a₁₁|11⟩. If the two qubits are independently in (a₁, b₁)ᵀ and (a₂, b₂)ᵀ, the joint amplitudes are the pairwise products (an operation written ⊗, read “tensor product”):
关键在反面:不是所有四维态都能这样拆开。试拆 贝尔态(|00⟩+|11⟩)/√2:最著名的纠缠态。单看任何一个比特都是纯随机,合看却完全相关。 (|00⟩+|11⟩)/√2 = (1/√2, 0, 0, 1/√2)ᵀ:需要 a₁b₂ = 0,于是 a₁ = 0(与 a₁a₂ = 1/√2 矛盾)或 b₂ = 0(与 b₁b₂ = 1/√2 矛盾)——三行反证,无解。拆不开的状态称为纠缠态。贝尔态是最彻底的一种:单看任何一个比特,测 0/1 各得一半,这个比特自己什么也不透露;合看两个,结果永远相同。信息全在关联里。但「拆不开」本身并不保证这一点。例:√0.8|00⟩ + √0.2|11⟩ 用同样的三行反证也拆不开,可单测第一个比特,就以 0.8 的概率得 0、0.2 的概率得 1,状态的一部分信息露在单个比特上。纠错需要的是更强的性质:要保护的信息在单个比特(以及少数几个比特)上完全看不出来,像贝尔态那样。这才是我们要用来藏匿逻辑比特的口袋,第 5 章的环面码就把逻辑比特藏在这种遍布全局的关联里。操作也升级到寄存器上:X₁ 表示「对 1 号比特做 X、对 2 号什么都不做」,即 X⊗I——作用规则是翻转基标签的第一位;Z₂ 给第二位为 1 的分量变号,依此类推。
The reverse direction is the point: not every four-dimensional state factors this way. Try the Bell state(|00⟩+|11⟩)/√2: the most famous entangled state. Each qubit alone is pure noise; together, perfect correlation. (|00⟩+|11⟩)/√2 = (1/√2, 0, 0, 1/√2)ᵀ: we'd need a₁b₂ = 0, so a₁ = 0 (contradicting a₁a₂ = 1/√2) or b₂ = 0 (contradicting b₁b₂ = 1/√2) — a three-line contradiction, no solution. Unfactorable states are entangled. The Bell state is the most thorough kind: look at either qubit alone and a 0/1 measurement gives each outcome half the time, so that qubit reveals nothing by itself; look at both and the results always agree. All the information sits in the correlation. Being unfactorable does not guarantee this, though. Example: √0.8|00⟩ + √0.2|11⟩ is unfactorable by the same three-line contradiction, yet measuring the first qubit alone gives 0 with probability 0.8 and 1 with probability 0.2, so part of the state's information shows on a single qubit. Error correction needs the stronger property: the protected information cannot be seen at all on a single qubit (or on a few qubits), as in the Bell state. That is the pocket where we will hide logical qubits; the toric code of Chapter 5 hides them in correlations of exactly this spread-out kind. Operations upgrade to registers too: X₁ means “X on qubit 1, nothing on qubit 2”, i.e. X⊗I — flip the first slot of each basis label; Z₂ re-signs components whose second slot is 1; and so on.
兑现承诺:不可克隆定理的三行证明Promise honoured: the three-line no-cloning proof
设有克隆操作 U(按公设二它必须是线性的)使 U(|ψ⟩⊗|0⟩) = |ψ⟩⊗|ψ⟩ 对一切 |ψ⟩ 成立。对 |0⟩ 与 |1⟩ 分别给出 U|00⟩ = |00⟩、U|10⟩ = |11⟩。现取 |ψ⟩ = (|0⟩+|1⟩)/√2:线性要求 U(|00⟩+|10⟩)/√2 = (|00⟩+|11⟩)/√2;而克隆要求它等于 |ψ⟩⊗|ψ⟩ = (|00⟩+|01⟩+|10⟩+|11⟩)/2。两者不等(左边 a₀₁ = 0,右边 = 1/2)。矛盾,故 U 不存在。∎ 值得回味:杀死克隆机的正是「线性」本身。
Suppose a cloner U (linear, by postulate two) satisfies U(|ψ⟩⊗|0⟩) = |ψ⟩⊗|ψ⟩ for all |ψ⟩. On |0⟩ and |1⟩ it gives U|00⟩ = |00⟩, U|10⟩ = |11⟩. Now take |ψ⟩ = (|0⟩+|1⟩)/√2: linearity forces U(|00⟩+|10⟩)/√2 = (|00⟩+|11⟩)/√2, while cloning demands |ψ⟩⊗|ψ⟩ = (|00⟩+|01⟩+|10⟩+|11⟩)/2. These differ (a₀₁ is 0 on the left, 1/2 on the right). Contradiction; no U exists. ∎ Savour it: linearity itself is what kills the copier.
4.2泡利串与碰撞定理Pauli strings and the collision theorem
形如 X₁Z₃(= X⊗I⊗Z)的多比特操作叫泡利串每个比特一格、格中为 I/X/Z(完整版还有 Y)的多比特算符,如 X·I·Z。:每比特一格,格里是 I、X 或 Z。两串相乘时能否交换顺序?逐格搬运即可。不同格互不干涉:按 4.1 的规则,X₁ 只翻转基标签的第 1 位,Z₂ 只按第 2 位决定是否变号,谁也不改对方看的那一位,所以对任何基向量,先 X₁ 后 Z₂ 与先 Z₂ 后 X₁ 结果相同。例:|01⟩ 先 X₁ 得 |11⟩、再 Z₂ 得 −|11⟩;先 Z₂ 得 −|01⟩、再 X₁ 得 −|11⟩。同一格里只有「X 遇 Z」按 3.4 节付出一个 −1。例如 X₁X₂·Z₁Z₂ = (X₁Z₁)(X₂Z₂) = (−Z₁X₁)(−Z₂X₂) = +Z₁Z₂·X₁X₂:两格各付一个 −1,合起来对易。于是:
Multi-qubit operations like X₁Z₃ (= X⊗I⊗Z) are called Pauli stringsOne cell per qubit, each I/X/Z (plus Y in the full story), e.g. X·I·Z.. When two strings multiply, may we swap their order? Carry them past each other cell by cell. Different cells never interfere: by §4.1's rules, X₁ only flips label slot 1 and Z₂ only decides its sign by slot 2, so neither changes the slot the other reads, and on every basis vector X₁-then-Z₂ equals Z₂-then-X₁. Example: |01⟩ becomes |11⟩ under X₁ and then −|11⟩ under Z₂; Z₂ first gives −|01⟩, then X₁ gives −|11⟩. Within one cell, only “X meets Z” costs a −1 by §3.4. For instance X₁X₂·Z₁Z₂ = (X₁Z₁)(X₂Z₂) = (−Z₁X₁)(−Z₂X₂) = +Z₁Z₂·X₁X₂: each of the two cells costs a −1, and together they commute. Hence:
4.3测量一条泡利串:投影算符Measuring a Pauli string: projectors
任何泡利串 S 都满足 S² = I(每格自乘:X²=Z²=I²=I)。于是它的本征值 λ 满足 λ² = 1(由 Sv=λv 得 v = S²v = λ²v),只能是 ±1——每条检查都是一道「±1 问答题」。测量的机器由一对投影算符实现:
Every Pauli string S obeys S² = I (cell-wise: X²=Z²=I²=I). Its eigenvalues therefore satisfy λ² = 1 (from Sv=λv, v = S²v = λ²v), so they can only be ±1 — each check is a ±1 quiz. The measuring machine is a pair of projectors:
四条性质,每条一行(建议亲手验证)Four properties, one line each (verify by hand)
P₊+P₋ = (I+S+I−S)/2 = I。P±² = (I±S)²/4 = (I±2S+S²)/4 = (2I±2S)/4 = P±(用了 S²=I)。P₊P₋ = (I+S)(I−S)/4 = (I−S²)/4 = 0。SP± = (S±S²)/2 = (S±I)/2 = ±P±——所以 P± 作用在任何向量上,得到的都是 S 的本征值 ±1 的本征向量:P± 就是「把状态里 ±1 的成分捞出来」的漏勺。
P₊+P₋ = (I+S+I−S)/2 = I. P±² = (I±S)²/4 = (I±2S+S²)/4 = (2I±2S)/4 = P± (using S²=I). P₊P₋ = (I+S)(I−S)/4 = (I−S²)/4 = 0. SP± = (S±S²)/2 = (S±I)/2 = ±P± — so everything P± outputs is a ±1 eigenvector: P± is the sieve that strains out the ±1 component.
测量规则(公设三的完整版):测 S 得 ±1 的概率是 p± = |P±ψ|²(分量的长度平方),测后状态是 P±ψ 重新拉伸回单位长度。两个成分互相垂直(P₊P₋=0),勾股定理保证 p₊+p₋ = |ψ|² = 1。两道例题把它算透:
The measurement rule (postulate three, full version): measuring S returns ±1 with probability p± = |P±ψ|² (the component's squared length); the post-state is P±ψ rescaled to unit length. The two components are perpendicular (P₊P₋=0), so Pythagoras gives p₊+p₋ = |ψ|² = 1. Two worked examples settle it:
例二Ex. 2: S = Z₁Z₂, |ψ⟩ = |++⟩ = ½(1,1,1,1)ᵀ: P₊ψ = ½(1,0,0,1)ᵀ, p₊ = ¼+¼ = ½, 测得 +1 后坍缩为贝尔态on +1 it collapses to Bell
测 Z₁Z₂ 只问「两比特的联合奇偶」,绝不触碰单个比特的身份:贝尔态整个存活(例一),|++⟩ 甚至被这次提问织成纠缠态(例二)。这就是量子版的奇偶检查——2.3 节的两盏灯,如今有了矩阵证书。去实验台复算这两道例题(按「测 Z₁Z₂」按钮)。
Measuring Z₁Z₂ asks only the joint parity, never touching either qubit's identity: the Bell state survives whole (Ex. 1), and |++⟩ is actually woven into entanglement by the question (Ex. 2). This is the quantum parity check — §2.3's two lamps, now bearing a matrix certificate. Re-run both examples on the bench above (the “measure Z₁Z₂” button).
4.4稳定子:一份互相兼容的检查清单Stabilizers: a mutually compatible checklist
现在批量提问。一份清单上的检查必须两两对易——否则无法同时都「必然 +1」:若 ST = −TS 而 Sψ = ψ、Tψ = ψ,则 ψ = STψ = −TSψ = −ψ,只能 ψ = 0,不是合法状态。互相对易、要求全部「必然 +1」的泡利串清单称为稳定子stabilizer:一组两两对易的泡利串检查;编码态被要求是它们全体的 +1 本征态。,通过全部检查的状态构成编码空间。它有多大?
先说清哪些检查算数。一条检查若等于清单上另外几条的乘积,就不独立:它的读数总能由那几条的读数乘出来,测它不提供新信息。例:三个比特上的 Z₁Z₂、Z₂Z₃、Z₁Z₃,因 Z₂² = I,(Z₁Z₂)(Z₂Z₃) = Z₁Z₃,第三条不独立;八个基向量里通过前两条的只有 |000⟩、|111⟩,它们也自动通过第三条。记 r = 独立检查的条数(上例 r = 2,而不是 3)。判断独立时不计正负号:若 T 等于另外几条的乘积再乘 −1,T 同样不独立,它的读数也被那几条的读数定死,只是等于它们乘积的相反数。这种情形更糟:那几条都读 +1 时,T 必然读 −1,再要求 T 也读 +1 就自相矛盾;换个说法,这几条连同 T 乘起来等于 −I,而 −I 作用在任何状态上都给出 −ψ,没有状态能对它「必然 +1」。所以清单还得满足一条:没有哪几条检查乘起来等于 −I。两两对易的检查也可能违反它(下面第二个折叠盒给出一份这样的清单);本页用到的检查每条只含 X 或只含 Z,自动满足(同一个折叠盒里有理由)。满足时,每条独立检查把空间维数砍掉一半(下面第一个折叠盒证明),于是:
Now ask in bulk. Checks on one list must pairwise commute — else they cannot all be “+1 surely”: if ST = −TS with Sψ = ψ and Tψ = ψ, then ψ = STψ = −TSψ = −ψ, forcing ψ = 0, which is not a legal state. A list of mutually commuting Pauli strings, all required to read “+1 surely”, is called the stabilizerA set of pairwise-commuting Pauli-string checks; encoded states are common +1 eigenstates of all of them., and the states passing every check form the code space. How big is it?
First, which checks count. A check that equals the product of some other checks on the list is not independent: its reading can always be multiplied together from theirs, so measuring it brings no new information. Example: on three qubits take Z₁Z₂, Z₂Z₃, Z₁Z₃; since Z₂² = I, (Z₁Z₂)(Z₂Z₃) = Z₁Z₃, so the third is not independent; of the eight basis vectors only |000⟩ and |111⟩ pass the first two, and they pass the third automatically. Write r = the number of independent checks (r = 2 above, not 3). Independence ignores signs: if T equals a product of some other checks times −1, T is not independent either, since its reading is again fixed by theirs, only as the negative of their product. That case is worse: when those checks all read +1, T must read −1, so demanding +1 from T as well is a contradiction; put differently, those checks together with T multiply to −I, and −I turns every state into −ψ, so no state can answer “+1 surely” to it. Hence the list must satisfy one more condition: no selection of checks multiplies to −I. Pairwise-commuting checks can still violate it (the second fold-out below gives such a list); the checks on this page each contain only X’s or only Z’s and satisfy it automatically (the same fold-out says why). When it holds, each independent check cuts the dimension in half (proved in the first fold-out below), so:
记号说明:k 数的是逻辑量子比特(2k 维的空间恰好装下 k 个量子比特,4.1),r 数的是独立检查。这与编码论的通用写法 [[n, k, d]] 一致(d 在 4.5 出场),本系列后面各篇都这样用。
A note on notation: k counts logical qubits (a 2k-dimensional space holds exactly k qubits, §4.1) and r counts independent checks. This matches the standard coding-theory label [[n, k, d]] (d appears in §4.5), and every later tutorial in this series uses it the same way.
为什么每条检查恰好砍半?(对半定理)Why does each check cut exactly in half? (the halving theorem)
对任何非平凡泡利串 S,总能找到与它反对易的泡利串 E(在 S 有 X 的某格放一个 Z 即可,反之亦然)。E 把 S 的 +1 本征空间映到 −1 本征空间:若 Sv = v,则 S(Ev) = −E(Sv) = −Ev。E 又可逆(E² = I),所以这两个子空间维数相等——各占一半。
第二条、第三条……检查要在已有的编码空间里再砍一半,需要的 E 多一个条件:与新检查 T 反对易,同时与已有的检查全都对易。这样 E 不会把状态带出已有的编码空间(对已有的每条 S,S(Ev) = E(Sv) = Ev),又在其中把 T 的 +1 部分和 −1 部分一一对应。例:已有 Z₁Z₂,新检查 Z₂Z₃,取 E = X₃:它只和 Z₂Z₃ 在第 3 格碰撞,与 Z₁Z₂ 不碰撞,于是在 {|000⟩, |001⟩, |110⟩, |111⟩} 张成的 4 维空间里把 |000⟩ ↔ |001⟩、|111⟩ ↔ |110⟩ 配对,砍成 2 维。这样的 E 存在的条件恰好就是「T 独立于已有检查(不计正负号)」:若 T = ±(几条已有检查的乘积),与那几条都对易的 E 也与 T 对易,找不到所需的 E(取 + 时 T 不砍任何东西,取 − 时 T 把剩下的全部砍掉,即上面的 −I 情形);对一般清单,这一步要用 GF(2) 上的线性代数(高斯消元)来保证,本页不展开,《BB 码》补课 0.D 对本系列用到的这类码(X 检查与 Z 检查分开的码)完整做了一遍。r 条独立检查依次砍半:2ⁿ → 2ⁿ⁻ʳ。
For any nontrivial Pauli string S there is a string E anticommuting with it (put a Z where S has an X, or vice versa). E maps S's +1 eigenspace into the −1 eigenspace: if Sv = v then S(Ev) = −E(Sv) = −Ev. And E is invertible (E² = I), so the two subspaces have equal dimension — half each.
For the second, third, … check to halve again inside the code space built so far, E needs one more property: anticommute with the new check T while commuting with every existing check. Then E never carries a state out of the existing code space (for each existing S, S(Ev) = E(Sv) = Ev), and inside it pairs T's +1 part one to one with its −1 part. Example: existing Z₁Z₂, new check Z₂Z₃, take E = X₃: it collides only with Z₂Z₃ (cell 3), not with Z₁Z₂, so in the 4-dimensional space spanned by {|000⟩, |001⟩, |110⟩, |111⟩} it pairs |000⟩ ↔ |001⟩ and |111⟩ ↔ |110⟩, cutting it to 2 dimensions. Such an E exists exactly when T is independent of the existing checks (ignoring signs): if T = ±(a product of existing checks), any E commuting with those checks also commutes with T, so the needed E does not exist (with + T cuts nothing away, with − it cuts away everything that is left, the −I case above); for a general list this step is guaranteed by linear algebra over GF(2) (Gaussian elimination), which this page does not develop; Catch-up 0.D of the BB-code tutorial works it out completely for the kind of code used in this series (X checks and Z checks kept separate). r independent checks halve r times: 2ⁿ → 2ⁿ⁻ʳ.
补课 · 两两对易,却一个通过者也没有:XZZ、ZXZ、ZZX、XXXCatch-up · Pairwise commuting, yet nothing passes: XZZ, ZXZ, ZZX, XXX
看三个比特上的四条检查 XZZ、ZXZ、ZZX、XXX(XZZ 是 X₁Z₂Z₃ 的简写:第几个字母就作用在第几个比特上)。用 4.2 的碰撞定理两两数碰撞(同一格里一个是 X、另一个是 Z,算一次碰撞):XZZ 与 ZXZ 在第 1、2 格,XZZ 与 ZZX 在第 1、3 格,XZZ 与 XXX 在第 2、3 格,ZXZ 与 ZZX 在第 2、3 格,ZXZ 与 XXX 在第 1、3 格,ZZX 与 XXX 在第 1、2 格。六对都恰好碰撞 2 次,偶数,全部对易。现在按 XZZ、ZXZ、ZZX、XXX 的顺序把四条逐格乘起来:
Take four checks on three qubits: XZZ, ZXZ, ZZX, XXX (XZZ is short for X₁Z₂Z₃: the k-th letter acts on qubit k). Count collisions pair by pair with §4.2's collision theorem (one collision per cell where one string has X and the other has Z): XZZ and ZXZ collide in cells 1 and 2, XZZ and ZZX in cells 1 and 3, XZZ and XXX in cells 2 and 3, ZXZ and ZZX in cells 2 and 3, ZXZ and XXX in cells 1 and 3, ZZX and XXX in cells 1 and 2. All six pairs collide exactly twice, an even number, so all commute. Now multiply the four cell by cell, in the order XZZ, ZXZ, ZZX, XXX:
第 2 格里用了 3.4 节的 XZ = −ZX 把中间两个换位。所以四条的乘积是 −I。假如某个状态 ψ 通过全部四条,依次施加四条检查时它每一步都原样不变,于是 ψ = (−I)ψ = −ψ,只能是零向量,不是合法状态。这份清单一个通过者也没有,「每条砍一半」的账不能照算(照算会得出 k = 3 − 4 = −1,毫无意义)。用正文的说法:前三条的乘积是 −XXX,所以第四条 XXX 按「不计正负号」不独立,而且正是带负号的那种;前三条都读 +1 时,XXX 必然读 −1。去掉 XXX,前三条是独立的,r = 3,剩 2³⁻³ = 1 维:恰好一个通过者,k = 0。
In cell 2, the rule XZ = −ZX of §3.4 swapped the middle pair. So the product of the four is −I. If some state ψ passed all four, it would stay unchanged at every step as we apply the four checks one after another, so ψ = (−I)ψ = −ψ, forcing the zero vector, which is not a legal state. This list has no passing state at all, and the “each check halves” count cannot be applied (it would give k = 3 − 4 = −1, which means nothing). In the main text's terms: the first three multiply to −XXX, so the fourth, XXX, is not independent once signs are ignored, and it is the kind with the minus sign; when the first three read +1, XXX must read −1. Drop XXX and the first three are independent, r = 3, leaving 2³⁻³ = 1 dimension: exactly one passing state, k = 0.
什么时候不必担心?每条检查若只含 X 或只含 Z(再加上 I),就不会出现这种矛盾;本页的所有检查(三比特码、环面码)都是这样。理由:检查两两对易,乘积里可以随意调换顺序,于是把只含 X 的检查排在前面、只含 Z 的排在后面。几条只含 X 的串相乘,每一格只是若干个 X 相乘,X·X = I,不会冒出负号,结果是一条只含 X 的串;只含 Z 的同理。一条只含 X 的串乘一条只含 Z 的串要等于 ±I,两者都只能是 I 本身,所以乘积是 +I,不会是 −I。
When is there nothing to worry about? If every check contains only X's or only Z's (plus I's), this contradiction cannot happen; every check on this page (the three-qubit code, the toric code) is of that kind. The reason: the checks commute pairwise, so the factors of a product may be reordered freely; put the X-only checks first and the Z-only checks after them. Multiplying X-only strings just multiplies X's within each cell, and X·X = I produces no minus sign, so the result is again an X-only string; likewise for Z-only strings. For an X-only string times a Z-only string to equal ±I, both must be I itself, so the product is +I, never −I.
还差一个角色:逻辑算符——与全部检查对易(不触发警报)、又不能写成检查乘积(不是「白干」)的泡利串。它不把状态带出编码空间(与每条检查对易,理由同折叠盒),却在编码空间内部真的改写了状态:改写的正是逻辑比特。「真的改写」要靠一个反对易的搭档来证明,4.5 和 5.6 各给一例。
One cast member remains: logical operators — Pauli strings commuting with every check (no alarms) yet not products of checks (not “doing nothing”). They never carry a state out of the code space (they commute with every check, for the reason in the fold-out), yet they really do change states inside it: what they change is the logical qubit. “Really do change” is proved with an anticommuting partner; §4.5 and §5.6 give one example each.
4.5第一个量子码,与它的判决书A first quantum code, and its verdict
取 n = 3、清单 {Z₁Z₂, Z₂Z₃}(对易:Z 遇 Z 无碰撞)。同时「必然 +1」要求相邻位标签相同,八个基向量只剩 |000⟩ 与 |111⟩:编码空间 = {α|000⟩ + β|111⟩},恰好 2³⁻² = 2 维(n = 3、r = 2),存 k = 1 个逻辑比特 ✓。这不违反 4.1 的不可克隆定理:编码只是用两次「受控翻转」(CNOT:第 1 位是 1 时翻转目标位)把第 1 位的标签抄到第 2、3 位,α|000⟩ + β|100⟩ → α|000⟩ + β|110⟩ → α|000⟩ + β|111⟩;配比数字 α、β 只出现一次。真正的三份副本 |ψ⟩⊗|ψ⟩⊗|ψ⟩ 会有 α³|000⟩ + α²β|001⟩ + … 共 8 项。逻辑算符(字母头上一横读「bar」,标记「逻辑版」)可取 X̄ = X₁X₂X₃(与每条检查碰撞 2 次,对易 ✓;交换 |000⟩↔|111⟩,即逻辑翻转)与 Z̄ = Z₁(零碰撞 ✓;给 |111⟩ 变号)。X̄ 与 Z̄ 在 1 号格碰撞 1 次——反对易 ✓,一对合格的逻辑 X/Z。Z̄ 真的改写了编码态:Z̄(α|000⟩ + β|111⟩) = α|000⟩ − β|111⟩。
Take n = 3 with checklist {Z₁Z₂, Z₂Z₃} (commuting: Z meets Z, no collisions). Demanding both “+1 surely” forces neighbouring label slots equal, leaving only |000⟩ and |111⟩ of the eight basis kets: code space = {α|000⟩ + β|111⟩}, dimension 2³⁻² = 2 (n = 3, r = 2) — k = 1 logical qubit ✓. This does not violate §4.1's no-cloning theorem: encoding just uses two “controlled flips” (CNOT: flip the target slot if slot 1 is 1) to copy the label of slot 1 onto slots 2 and 3, α|000⟩ + β|100⟩ → α|000⟩ + β|110⟩ → α|000⟩ + β|111⟩; the mixing numbers α, β still appear only once. Three genuine copies |ψ⟩⊗|ψ⟩⊗|ψ⟩ would have 8 terms, α³|000⟩ + α²β|001⟩ + …. As logical operators (the overbar reads “bar” and marks the logical edition) take X̄ = X₁X₂X₃ (two collisions with each check: commutes ✓; swaps |000⟩↔|111⟩ — the logical flip) and Z̄ = Z₁ (zero collisions ✓; re-signs |111⟩). X̄ and Z̄ collide once, in cell 1 — anticommute ✓: a proper logical X/Z pair. Z̄ really does change encoded states: Z̄(α|000⟩ + β|111⟩) = α|000⟩ − β|111⟩.
侦错机制一句话:编码态满足 Sψ = ψ;错误 E 落下后状态为 Eψ;若 E 与 S 反对易,则 S(Eψ) = −E(Sψ) = −Eψ——检查 S 必然读出 −1。警报=反对易,隐身=对易。X₂ 与两条检查各撞一次 → 症状 (−1, −1),唯一指认 2 号比特,再补一个 X₂ 即痊愈。但 Z₂ 与两条检查都零碰撞——毫无警报;而 Z₂ 在编码空间上与 Z̄ 作用完全相同(都只给 |111⟩ 变号)——一次无声的逻辑错误。在实验台上把两种命运都走一遍:
Error detection in one sentence: encoded states satisfy Sψ = ψ; after an error E the state is Eψ; if E anticommutes with S, then S(Eψ) = −E(Sψ) = −Eψ — check S reads −1 with certainty. Alarm = anticommute; invisibility = commute. X₂ collides once with each check → syndrome (−1, −1), uniquely naming qubit 2; one more X₂ heals it. But Z₂ has zero collisions with both checks — no alarm at all; and on the code space Z₂ acts identically to Z̄ (each re-signs |111⟩ only) — a silent logical error. Walk both fates on the bench:
泡利串的重量是它不为 I 的格数:X₁X₂X₃ 重 3,Z₁ 重 1。对 X 错误,最轻的逻辑算符是 X₁X₂X₃,dX = 3;对 Z 错误,一个 Z₁ 就够,dZ = 1。码距 d 的码保证纠正任意 (d − 1)/2 个错误(取整数部分):少于一半时,离原码字比离另一个码字近,按「离谁近」修复不会修错。编码论把三项指标并排写成 [[n, k, d]],d 取各类错误中最小的一个:三比特码是 [[3, 1, 1]]。
The weight of a Pauli string is its number of non-I cells: X₁X₂X₃ has weight 3, Z₁ weight 1. Against X errors the lightest logical operator is X₁X₂X₃, so dX = 3; against Z errors a single Z₁ suffices, dZ = 1. A code of distance d is guaranteed to correct any (d − 1)/2 errors (whole-number part): with fewer than half, the state is closer to the original code word than to any other, so “repair towards the nearest” never goes wrong. Coding theory writes the three numbers side by side as [[n, k, d]], with d the smallest over all kinds of error: the 3-qubit code is [[3, 1, 1]].
把清单换成 {X₁X₂, X₂X₃} 只是镜像:捉得住 Z、放得过 X。设计任务书就此写定:需要一族 Z-型检查与一族 X-型检查共存;任意 X-串检查与任意 Z-串检查的碰撞数必须恒为偶数(碰撞定理);两种码距对称且可任意加大;每条检查只碰少数几个近邻比特。1997 年,Kitaev 的回答是把这一切交给几何:画在网格上,让「偶数」成为定理而非巧合。
Swapping in {X₁X₂, X₂X₃} merely mirrors the failure: catches Z, misses X. The design brief is now fixed: a Z-type family and an X-type family must coexist; every X-string check must meet every Z-string check in an even number of cells (collision theorem); both distances symmetric and freely growable; each check touching only a few neighbours. Kitaev's 1997 answer hands it all to geometry: draw it on a grid, and make “even” a theorem instead of a coincidence.
对。P₊|00⟩ = (|00⟩+|11⟩)/2,长度平方 = ¼+¼ = ½;归一后正是贝尔态。一次不读任何比特的提问,把乘积态织成了最大纠缠态——你刚刚手算了纠缠的诞生。
Right. P₊|00⟩ = (|00⟩+|11⟩)/2 with squared length ¼+¼ = ½; renormalized, the Bell state. A question that reads neither qubit just wove a product state into maximal entanglement — you hand-computed entanglement's birth.
套公式:P₊ψ = (ψ + Sψ)/2 = (|00⟩+|11⟩)/2,再算长度平方。「通过检查」要求的是本征值 +1,而 |00⟩ 并非 X₁X₂ 的本征态。
Apply the formula: P₊ψ = (ψ + Sψ)/2 = (|00⟩+|11⟩)/2, then its squared length. “Passing” requires being a +1 eigenstate, and |00⟩ is no eigenstate of X₁X₂ at all.
Toric CodeThe toric code
把第 4 章的任务书交给一张环面网格:对易性变成几何定理,错误变成可见的链,逻辑比特变成绕不回来的圈。每一步都可以在沙盘里亲手复核。 Hand Chapter 4's brief to a torus grid: commutation becomes a theorem of geometry, errors become visible chains, logical qubits become loops that cannot unwind. Every step can be re-checked by hand in the sandboxes.
5.1构造与对易定理The construction and the commutation theorem
取方格网。三种部件各派其职:边上住量子比特;每个顶点 v 配一条 X-型检查(星形检查),每块面 p 配一条 Z-型检查(面检查):
Take a square grid and assign its three parts: qubits live on edges; each vertex v carries an X-type check (the star), each face p a Z-type check (the plaquette):
定理(对易性):任意 Av 与任意 Bp 对易。证明即碰撞定理加一条几何观察:碰撞只能发生在共享边上,而一个顶点与一个方形面,要么不相干(0 条共享边),要么顶点是该面的一个角——而每个角恰好连着面的两条边(一横一竖)。共享数 ∈ {0, 2},恒为偶数。∎ 不必信文字,亲手清点:
Theorem (commutation): every Av commutes with every Bp. Proof: the collision theorem plus one geometric observation — collisions occur only on shared edges, and a vertex either ignores a square face (0 shared edges) or sits at one of its corners, where it touches exactly two of the face's sides (one horizontal, one vertical). The overlap is always 0 or 2 — even. ∎ Don't take prose's word; tally it:
5.2为什么在环面上Why on a torus
普通网格有边缘,边缘顶点凑不满 4 条边,规则破碎。最干净的修补是取周期边界:右边出去左边回来、上边出去下边回来。这样的曲面就是环面左右一对边粘合、上下一对边粘合得到的闭曲面;甜甜圈的表面。torus。——甜甜圈的表面,toric code 因此得名。此时每个顶点严格 4 条边、每个面严格 4 条边,无一例外。到绕回世界里走两步:
An ordinary grid has a rim; rim vertices can't muster 4 edges and the rules crumble. The cleanest patch is periodic boundary conditions: exit right, re-enter left; exit top, re-enter bottom. The resulting surface is the torusThe closed surface from gluing left↔right and top↔bottom; a donut's skin. — a donut's skin, whence the name. Now every vertex has exactly 4 edges and every face exactly 4 sides, no exceptions. Take a stroll in the wrap-around world:
画在纸上时,环面通常被摊平成 L × L 的方格图,并约定右边缘与左边缘是同一条线、下边缘与上边缘是同一条线。下面是 L = 3 的完整蓝图:18 个比特全部编号(1–9 在横边,10–18 在竖边),最右一列与最下一行的边用虚线再画一遍,编号与它们真正所在的左列、上行相同。点顶点看星形检查 Av 碰哪 4 个比特,点方块看面检查 Bp;角上的顶点会把腿伸到图的对侧,但共享比特数照样是 0 或 2。
On paper the torus is usually drawn flattened into an L × L grid, with the agreement that the right rim equals the left rim and the bottom rim equals the top rim. Below is the complete blueprint for L = 3: all 18 qubits numbered (1–9 on horizontal edges, 10–18 on vertical ones), with the edges of the rightmost column and bottom row drawn again, dashed, carrying the numbers of the left column and top row where they really live. Click a vertex to see which 4 qubits its star Av touches, a square for its face check Bp; a corner vertex reaches to the opposite side, yet the number of shared qubits is still 0 or 2.
5.3记账:k = 2The ledger: k = 2
L×L 环面:横边 L² + 竖边 L² = 2L² 个比特;星、面各 L² 条。若全部独立,4.4 的公式 k = n − r 给 k = 2L² − 2L² = 0——但独立性恰恰不成立。每条边连两个顶点,于是把全部星相乘时每个比特吃到两个 X,而 X² = I:
The L×L torus: L² horizontal + L² vertical = 2L² qubits; L² stars and L² plaquettes. If all were independent, §4.4's k = n − r would give k = 2L² − 2L² = 0 — but independence is precisely what fails. Every edge meets two vertices, so multiplying all stars feeds every qubit two X's, and X² = I:
「恰为」的另一半,即除这两条外再无其他依赖,由下面的补课 5.A 直接数出来;它只用到「每条边连两个顶点、挨两个面」和网格连成一片。看动画数账,并看「全体星相乘」如何逐边抵消:
The other half of “exactly”, that there is no further dependency, is counted directly in Catch-up 5.A below; it uses only “every edge joins two vertices and borders two faces” and the fact that the grid is in one piece. Watch the ledger, and the all-stars product cancel edge by edge:
补课 · 除了 ∏Av = I 与 ∏Bp = I,为什么再没有别的依赖Catch-up · Why there is no dependency besides ∏Av = I and ∏Bp = I
要找的是:哪些检查乘起来等于 I?只挑星。挑出一批顶点 S,把它们的星相乘。边 e 上 X 的个数 = e 的两个端点中属于 S 的个数;0 或 2 时抵消,1 时留下。乘积为 I ⇔ 每条边的两端「同进同出」S。于是挑中一个顶点就必须挑中它的邻居、邻居的邻居……网格连通,结果只有 S = ∅ 或 S = 全体。只挑面同理:相邻两面共享一条边,挑中一个就得挑中全部。星面混挑:星的乘积全是 X,面的乘积全是 Z,同一条边上剩下的 X 与 Z 不会抵消(XZ 不是 I 的倍数),所以 X 部分与 Z 部分必须各自为 I,回到前两种情形。
We want: which sets of checks multiply to I? Stars only. Pick a set S of vertices and multiply their stars. The number of X's on edge e equals how many of e's two endpoints lie in S; 0 or 2 cancel, 1 survives. The product is I ⇔ every edge has both ends in S or both out. So picking one vertex forces its neighbours, their neighbours, …; the grid is connected, so S = ∅ or S = everything. Faces only, likewise: neighbouring faces share an edge, so picking one forces all. Stars and faces mixed: a product of stars is all X, a product of faces all Z, and an X and a Z left on the same edge do not cancel (XZ is not a multiple of I), so the X part and the Z part must each be I, which is one of the first two cases.
记账:V 个顶点的星恰有一条多余,F 个面也恰有一条多余,r = (V − 1) + (F − 1)。环面上 V = F = L²,r = 2L² − 2。这个论证对画在任何连通(只有一整块)闭曲面上的网格都成立(它用到的只是「网格连通」和「每条边恰有两个端点、恰好挨着两个面」),于是 k = E − (V − 1) − (F − 1) = 2 − (V − E + F)。括号里的数正是下一个折叠盒的主角。
Tally: the V stars have exactly one redundancy and the F faces exactly one, so r = (V − 1) + (F − 1). On the torus V = F = L², r = 2L² − 2. The argument works for a grid drawn on any connected (all in one piece) closed surface (all it uses is that the grid is connected and that every edge has exactly two endpoints and borders exactly two faces), so k = E − (V − 1) − (F − 1) = 2 − (V − E + F). The number in brackets is the star of the next fold-out.
为什么偏偏是 2?欧拉示性数把它算出来Why exactly 2? The Euler characteristic computes it
对任何画在曲面上的网格,数 χ = V − E + F(χ 是希腊字母,读「凯」;V、E、F 分别是顶点数、边数、面数)。环面网格:χ = L² − 2L² + L² = 0。补课 5.A 末尾已经算出 k = 2 − χ,所以环面上 k = 2。拓扑学的曲面分类定理(大学课程内容,本页不证)说:χ 只由曲面本身决定,不管网格怎么画,对连通、闭合、可定向的曲面,χ = 2 − 2g,g 是曲面上「把手」的个数(称为亏格;甜甜圈那样的一个洞算一个把手)。三个条件各有含义:连通 = 只有一整块;闭合 = 没有边缘,处处都能继续往前走(环面是,一张有边的纸不是);可定向 = 分得出正反两面(球面、环面都是;把纸条扭半圈再粘成的莫比乌斯带只有一面,不是)。不可定向的闭曲面(例如克莱因瓶)有另一个公式,本页不讨论。代入得 k = 2g:甜甜圈 g = 1,k = 2 ✓;球面 g = 0,k = 0,一个逻辑比特也存不了。每个洞贡献两个「绕不回来的方向」。这就是「拓扑码」一词的完整由来:存储容量由曲面的拓扑决定,与网格多细无关。
For any grid drawn on a surface, count χ = V − E + F (χ — Greek, read “kai”; V, E, F count vertices, edges, faces). On the torus: χ = L² − 2L² + L² = 0. The end of Catch-up 5.A already showed k = 2 − χ, so k = 2 on the torus. The classification theorem of surfaces in topology (university material, not proved here) says that χ depends only on the surface, however the grid is drawn: for a connected, closed, orientable surface, χ = 2 − 2g, where g is the number of “handles” on the surface (called the genus; one donut hole counts as one handle). Each condition means something: connected = all in one piece; closed = no edge anywhere, you can always keep walking (the torus is closed, a sheet of paper with a rim is not); orientable = it has two distinguishable sides (the sphere and the torus do; a Möbius strip, a paper strip given a half twist and glued, has only one side and is not orientable). Non-orientable closed surfaces (the Klein bottle, for example) follow a different formula, not treated here. Substituting gives k = 2g: a donut has g = 1 and k = 2 ✓; a sphere has g = 0 and k = 0, storing nothing at all. Each hole contributes two “can't-unwind directions”. That is the full meaning of the word topological: storage capacity set by the surface's topology, indifferent to how fine the grid is.
5.4错误链与症状Error chains and syndromes
设一批边挨了 Z 错误,把这些边涂蓝:它们连成链。哪些星报警?由 4.5 的判决(警报 ⇔ 反对易)加碰撞定理:Av 与链的碰撞数 = 链中碰到 v 的边数。链内部的顶点被两条链边穿过——偶数,安静;只有链的端点被奇数条链边碰到——报警。X 错误的链画在对偶方向(连接相邻面心),报警的是端点处的面:边 e 上的 X 与挨着 e 的两个面检查各碰撞一次,所以从一个面心跨过出错的边走到隔壁面心,恰好沿着 X 链走。一整条链无论多长,只点亮两处:
Say a batch of edges takes Z errors; paint them blue — they form chains. Which stars alarm? By §4.5's verdict (alarm ⇔ anticommute) plus the collision theorem: Av's collision count with the chain = the number of chain edges touching v. Interior vertices are crossed by two chain edges — even, silent; only the chain's endpoints are touched by an odd number — alarm. X-error chains run in the dual direction (joining adjacent face centres), alarming the faces at their ends: an X on edge e collides once with each of the two face checks beside e, so stepping from a face centre across an erring edge into the next face centre follows the X chain exactly. A chain of any length lights exactly two spots:
5.5闭合且可收缩 ⇒ 等于检查的乘积 ⇒ 无事发生Closed & contractible ⇒ a product of checks ⇒ nothing happened
闭合圈没有端点,症状为空。但「没警报」不代表「没动过」——除非那个操作根本等于「白干」。对可收缩的圈(围出一块区域 R 的圈),确有此事:把 R 内所有面检查相乘,内部共享边上 Z·Z = I 逐对抵消,只幸存区域的外圈:
A closed loop has no endpoints, hence an empty syndrome. But “no alarm” isn't “nothing done” — unless the operation literally equals “doing nothing”. For contractible loops (those enclosing a region R), it does: multiply all face checks inside R; on interior shared edges Z·Z = I cancels pairwise, and only the region's rim survives:
5.6缠绕圈:逻辑算符现身Winding loops: the logical operators appear
环面上另有一种闭合圈:横贯一整行、从右边绕回左边接上自己。它不围任何区域——像箍在甜甜圈上的橡皮筋,收缩不掉。上面实验台的第二个示范画的正是它。它通过全部检查(圈上每个顶点恰好占两条圈边,与每颗星碰撞 0 或 2 次),却写不成面检查的乘积,而且真的改写编码态(这两点的理由见下面的补课 5.B)——按 4.4 的定义,这是一条逻辑算符。环面有两个独立绕向,给出 Z̄₁(水平 Z-圈)与 Z̄₂(竖直 Z-圈);对偶方向同理给出 X̄₁、X̄₂。配对验收用碰撞定理:竖直的 X̄-圈与水平的 Z̄-圈在环面上恰好交叉一次——奇数,反对易 ✓;平行的两圈交叉 0 次——对易 ✓。于是 {X̄₁,Z̄₁} 与 {X̄₂,Z̄₂} 构成两对标准逻辑比特算符——与 5.3 的 k = 2 严丝合缝。
The torus hosts a second kind of closed loop: straight across a row, wrapping from the right edge back to the left. It encloses no region — a rubber band around the donut, impossible to shrink. The second demo above draws exactly this. It passes every check (each vertex on the loop owns exactly two loop edges, so it collides 0 or 2 times with every star), yet it cannot be written as a product of plaquettes and it really changes encoded states (the reasons for both are in Catch-up 5.B below) — by §4.4's definition, a logical operator. Two independent winding directions give Z̄₁ (horizontal Z-loop) and Z̄₂ (vertical); the dual directions give X̄₁, X̄₂. Certify the pairing by the collision theorem: a vertical X̄-loop crosses a horizontal Z̄-loop exactly once on a torus — odd, anticommute ✓; parallel loops cross 0 times — commute ✓. So {X̄₁,Z̄₁} and {X̄₂,Z̄₂} are two standard logical pairs — dovetailing with §5.3's k = 2.
四条圈画在同一个 4 × 4 环面上如下(比特编号规则同 5.2 的蓝图)。切换组合,看每一对共享几个比特:
Here are the four loops on one 4 × 4 torus (qubits numbered as in the blueprint of §5.2). Switch between the combinations and see how many qubits each pair shares:
补课 · 缠绕圈为什么不是面检查的乘积,又为什么真的改写编码态Catch-up · Why a winding loop is not a product of face checks, and why it really changes encoded states
① 不是面检查的乘积① Not a product of face checks
任取一批面 R,把它们的面检查相乘:挨着 R 中两个面的边上 Z 抵消,只挨着一个面的边上留下 Z,所以乘积 = Z(∂R),∂R 是「一侧在 R 里、另一侧不在」的边(5.5 的公式)。现在沿一列面竖直向下走,绕环面一周回到出发的面。每跨过一条横边:它若属于 ∂R,就从 R 里走到 R 外(或反过来);否则留在原侧。回到起点时「在不在 R 里」必须与出发时相同,所以跨过 ∂R 的次数必为偶数。而这条竖直的路只跨过水平圈 Z̄₁ 一次。因此 Z̄₁ ≠ Z(∂R) 对任何 R 都成立。
Take any set R of faces and multiply their face checks: on edges bordering two faces of R the Z's cancel, on edges bordering just one a Z remains, so the product is Z(∂R), with ∂R the edges having R on one side only (the formula of §5.5). Now walk straight down a column of faces, once around the torus, back to the starting face. Each horizontal edge crossed either belongs to ∂R, taking you from inside R to outside (or back), or does not, keeping you on the same side. Back at the start, “inside R or not” must be as it was, so the walk crosses ∂R an even number of times. But this vertical walk crosses the horizontal loop Z̄₁ exactly once. Hence Z̄₁ ≠ Z(∂R) for every R.
② 真的改写编码态② It really changes encoded states
「什么都不做」要说得小心:3.4 节说过,ψ 与 eiθψ 是同一个物理状态,所以一个算符即使给状态乘上一个模为 1 的数,也等于没改写它。于是反证的假设应当是:存在一个固定的角度 θ,使 Z̄₁ψ = eiθψ 对一切编码态 ψ 成立,即 Z̄₁ 在编码空间里等于 eiθ·I。(各个编码态各乘各的数也不行:若 Z̄₁ψ₁ = c₁ψ₁、Z̄₁ψ₂ = c₂ψ₂,且 ψ₁、ψ₂ 不成比例,把 Z̄₁ 作用在 ψ₁ + ψ₂ 上,按线性得 c₁ψ₁ + c₂ψ₂;它要等于某个 c 乘 (ψ₁ + ψ₂),只能 c₁ = c = c₂。所以「不改写任何编码态」确实就是这条假设。)现在推出矛盾。X̄₁ 也与全部检查对易,所以对编码态 ψ,X̄₁ψ 仍是编码态,假设对它也成立:Z̄₁X̄₁ψ = eiθX̄₁ψ。另一方面 X̄₁、Z̄₁ 只共享一个比特、反对易:Z̄₁X̄₁ψ = −X̄₁Z̄₁ψ = −eiθX̄₁ψ。两式相减得 2eiθX̄₁ψ = 0;eiθ 不为零,所以 X̄₁ψ = 0;再两边作用 X̄₁(X̄₁X̄₁ = I)得 ψ = 0,不是合法状态,矛盾。所以 Z̄₁ 至少把某个编码态变成了另一个状态。可收缩圈找不到这样的反对易搭档:它是面检查的乘积,而面检查与所有检查都对易;它在编码空间里恰好等于 I(θ = 0)。
“Doing nothing” needs care: §3.4 noted that ψ and eiθψ are the same physical state, so an operator that multiplies a state by a number of modulus 1 has not changed it either. The assumption to refute is therefore: there is a fixed angle θ with Z̄₁ψ = eiθψ for every encoded state ψ, that is, Z̄₁ equals eiθ·I on the code space. (A different number for each encoded state is not possible: if Z̄₁ψ₁ = c₁ψ₁ and Z̄₁ψ₂ = c₂ψ₂ with ψ₁, ψ₂ not proportional, apply Z̄₁ to ψ₁ + ψ₂; linearity gives c₁ψ₁ + c₂ψ₂, and for this to be some c times (ψ₁ + ψ₂) we need c₁ = c = c₂. So “changes no encoded state” is exactly this assumption.) Now the contradiction. X̄₁ also commutes with every check, so for an encoded state ψ, X̄₁ψ is still encoded, and the assumption applies to it: Z̄₁X̄₁ψ = eiθX̄₁ψ. On the other hand X̄₁ and Z̄₁ share one qubit and anticommute: Z̄₁X̄₁ψ = −X̄₁Z̄₁ψ = −eiθX̄₁ψ. Subtracting, 2eiθX̄₁ψ = 0; eiθ is not zero, so X̄₁ψ = 0; applying X̄₁ to both sides (X̄₁X̄₁ = I) gives ψ = 0, which is not a legal state: a contradiction. So Z̄₁ turns at least one encoded state into a different state. A contractible loop has no such anticommuting partner: it is a product of face checks, face checks commute with every check, and on the code space it equals I exactly (θ = 0).
这一切的学名:ℤ₂ 同调The scholarly name for all this: ℤ₂ homology
把闭合圈(可以是好几条)按「相差若干面检查的乘积,即相差某批面 R 的边界 ∂R,就视为相同」归类,类别只由两个方向缠绕数的奇偶决定(5.7 节),所以恰有四类:{平凡(偶, 偶), 绕横向, 绕纵向, 双绕}。两条平行的缠绕圈合起来是一条带子的边界,属于平凡类。数学家称之为环面的一阶 ℤ₂ 同调群 H₁(T²环面(torus)的记号:T 取自 torus,上标 2 表示它是二维曲面。, ℤ₂) = ℤ₂ × ℤ₂——四个元素对应编码空间的 2² = 4 维。「错误链只定义到相差检查乘积」与「逻辑类由缠绕决定」正是同调语言的物理翻译。无需深究,但若你日后读论文,遇见 homology 时会认出老朋友。
Classify closed loops (possibly several at once) as “the same if they differ by a product of face checks, i.e. by the boundary ∂R of some set of faces R”; the class depends only on whether each of the two winding numbers is even or odd (§5.7), so exactly four classes appear: {trivial (even, even), horizontal winding, vertical winding, both}. Two parallel winding loops together are the boundary of a strip and belong to the trivial class. Mathematicians call this the torus's first ℤ₂ homology group, H₁(T²The symbol for the torus: T from “torus”, superscript 2 because it is a two-dimensional surface., ℤ₂) = ℤ₂ × ℤ₂ — four elements matching the code space's 2² = 4 dimensions. “Errors defined only up to products of checks” and “logical class set by winding” are physics translations of homology. No need to go deeper — but when papers say homology, you'll recognize an old friend.
5.7纠错 = 给症状配对Correction = matching the syndrome
运行时我们看不见链,只看得见端点(症状)。译码器decoder:读取全部症状、推断修复操作的经典算法。常用最小重量完美匹配(MWPM:在所有两两配对方式中挑修复链总长度最短的一种)或 Union-Find(让每个警报周围的簇逐步长大、相遇就合并的快速近似算法)。的策略:把报警点两两配对、沿路径施加 Z 补链。真实链 ⊕ 修复链(⊕:合并两组边、成对相消,因为 Z·Z = I)没有端点,是一条或几条闭合圈。剩下的问题只有一个:这些圈合起来是不是面检查的乘积(5.5 节:是,就什么都没发生;5.6 节:不是,就是逻辑算符)?判据是数缠绕数一条绕环面一周的测试路径跨过残留边的次数。竖直、水平各数一次;只有奇偶有意义。:沿 X̄₁ 那条竖直的路(穿过一列方块中心,绕环面一周)走一遍,数它跨过几条残留的 Z 边;再沿 X̄₂ 那条水平的路数一次。只看奇偶:
At runtime we see no chains, only endpoints (the syndrome). The decoderThe classical algorithm reading all syndromes and inferring repairs. Standard choices: minimum-weight perfect matching (MWPM: among all ways of pairing the alarms, pick the one with shortest total repair length) or Union-Find (a fast approximate method that grows a cluster around each alarm and merges clusters when they meet).'s strategy: pair up the alarms and apply Z along connecting paths. True chain ⊕ repair chain (⊕: merge edge sets with pairwise cancellation, since Z·Z = I) has no endpoints: it is one or more closed loops. Only one question remains: are these loops, taken together, a product of face checks (§5.5: if so, nothing happened; §5.6: if not, they form a logical operator)? The test is to count winding numbersHow many times a test path going once around the torus crosses the leftover edges. Count once vertically and once horizontally; only even or odd matters.: walk the vertical path of X̄₁ (through the centres of one column of squares, once around the torus) and count how many leftover Z edges it crosses; then count again along the horizontal path of X̄₂. Only even or odd matters:
为什么数奇偶,而不是看「有没有缠绕圈」?下面的实验台画了三种残留,都在 4 × 4 环面上,比特编号同 5.2 的蓝图。一条水平缠绕圈就是 Z̄₁:竖直测试路径跨过它 1 次,奇数,逻辑错误。两条平行的水平缠绕圈,每一条单独都是 Z̄₁,合起来却夹出一条带子(图中着色的 8 块面)。按 5.5 的公式把带子里的 8 条面检查乘起来:带子内部的每条边都挨着带子里的两块面(左右两端绕回相接,那里的竖边也一样),Z·Z 抵消;只剩带子的上下两条边框,正好是这两条圈。所以两条圈合起来是面检查的乘积,对编码态什么都不做;换个说法,Z̄₁ 做了两次,Z̄₁·Z̄₁ = I。竖直测试路径跨过它们 2 次,偶数。一条水平、一条竖直:两个方向各跨 1 次,残留是 Z̄₁Z̄₂,两个逻辑比特都被改写。
Why count even or odd, instead of asking “is there a winding loop”? The bench below draws three leftovers, all on a 4 × 4 torus with qubits numbered as in §5.2's blueprint. One horizontal winding loop is Z̄₁: the vertical test path crosses it once, odd, a logical error. Two parallel horizontal winding loops: each one alone is Z̄₁, but together they enclose a strip (the 8 shaded squares). Multiply the 8 face checks of the strip with §5.5's formula: every edge inside the strip borders two squares of the strip (the two ends wrap around and meet, and the vertical edges there behave the same way), so Z·Z cancels; only the strip's top and bottom rims remain, and they are exactly the two loops. So the two loops together are a product of face checks and do nothing to encoded states; put differently, Z̄₁ was applied twice, and Z̄₁·Z̄₁ = I. The vertical test path crosses them twice, even. One horizontal and one vertical: each direction is crossed once, the leftover is Z̄₁Z̄₂, and both logical qubits are rewritten.
判据的两半各有来历。奇数 ⇒ 逻辑错误:补课 5.B ① 的走路论证说明,任何一批面检查的乘积 Z(∂R) 都被绕环面一周的路跨过偶数次,所以跨奇数次的残留不是面检查的乘积;它与这条路上的 X̄ 共享奇数个比特,按碰撞定理反对易,于是补课 5.B ② 的论证原样适用:它改写了编码态。偶数 ⇒ 无害:两个方向都跨偶数次的闭合圈一定是面检查的乘积。这一半的一般证明要用拓扑学里的同调论,超出本页(5.6 节末尾的折叠盒给出它的名字);两条平行圈是它最简单的例子。X 错误的残留同理,只是测试路径换成沿边走的 Z̄₁、Z̄₂。
Each half of the test has its own reason. Odd ⇒ logical error: the walking argument of Catch-up 5.B ① shows that any product of face checks Z(∂R) is crossed an even number of times by a path going once around the torus, so a leftover crossed an odd number of times is not a product of face checks; it shares an odd number of qubits with the X̄ on that path, so by the collision theorem they anticommute, and the argument of Catch-up 5.B ② applies word for word: it changes encoded states. Even ⇒ harmless: closed loops crossed an even number of times in both directions are always a product of face checks. The general proof of this half uses homology from topology and is beyond this page (the fold-out at the end of §5.6 gives its name); the two parallel loops are its simplest example. Leftovers of X errors work the same way, with the along-edge loops Z̄₁ and Z̄₂ as the test paths.
所以修复不必猜中原链:只要合成的圈两个方向的缠绕数都是偶数就全胜,最常见的情形是它们根本不绕,只是可收缩的小圈。这正是「错误只定义到同调类」的实战含义。下面实验台的「自动译码」在警报不超过 14 个时逐一比较所有配对方式、取总长度最短的一种(即 MWPM),更多时退为每次先配最近两个的贪心配对。每回合结束时,游戏按上面的判据判胜负,并在读数里写出竖直、水平两条测试路径各跨过残留(蓝 ⊕ 绿)几次。上场当一回译码器:
So the repair need not guess the original chain: it wins as long as the combined loops have even winding numbers in both directions, and most often they do not wind at all and are small contractible loops. That is the practical meaning of “errors defined only up to homology class”. The bench's “auto-decode” compares every pairing and takes the shortest (that is, MWPM) when there are at most 14 alarms, and falls back to greedy closest-pair matching beyond that. At the end of each round the game judges by the test above and writes in the readout how many times the vertical and the horizontal test path cross the leftover (blue ⊕ green). Take the decoder's chair:
5.8码距 d = L,与一个悬念Distance d = L, and a cliffhanger
最轻的逻辑算符是最短的缠绕圈:水平缠绕的圈每经过一列至少用一条横边,所以至少 L 条边,直线圈恰好 L 条。故码距 d = L,环面码是 [[2L², 2, L]](L = 3 时 [[18, 2, 3]]),且对 X、Z 完全对称——任务书四项全部交付(两族检查 ✓ 对易定理 ✓ 对称可增长的 d ✓ 四近邻局部性 ✓)。按 4.5 的规则它保证纠正任意 (L − 1)/2 个错误;要压垮最短配对译码器,约 L/2 个错误恰好排在一条缠绕线上就够(修复会补齐另一半)。这个事件的概率随 L 怎样衰减?多小的 p 才「越大越好」?定量答案是量子计算最著名的曲线之一——阈值,我们留作《Surface Code · 高中数学版》第 6 章的压轴,在那里你会先用排列组合与等比数列亲手证出一个下界,再用蒙特卡洛模拟当场测出那一页简化译码器的阈值估计。
The lightest logical operator is the shortest winding loop: a horizontally winding loop uses at least one horizontal edge per column, so at least L edges, and the straight loop has exactly L. Hence d = L, the toric code is [[2L², 2, L]] ([[18, 2, 3]] for L = 3), fully symmetric in X and Z — all four items of the brief delivered (two families ✓ commutation theorem ✓ symmetric growable d ✓ four-neighbour locality ✓). By §4.5's rule it is guaranteed to correct any (L − 1)/2 errors; to defeat a shortest-pairing decoder, about L/2 errors lined up on one winding line suffice (the repair completes the other half). How fast does that probability shrink with L? Below what p does bigger become better? The quantitative answer is one of quantum computing's most famous curves — the threshold — saved as the finale of “The Surface Code · High-School Edition”, Chapter 6, where you will first prove a lower bound by counting and geometric series, then estimate by live Monte-Carlo simulation the threshold of that page's simplified decoder.
对。码距 d = 10:200 个物理比特只存两个逻辑比特,但要改写它们,错误必须连成一条绕环面一整圈的链,至少 10 条边。逻辑比特数固定为 2,保护(码距 d = L)却随 L 增长:这就是拓扑码的取舍。
Right, and the distance is d = 10: 200 physical qubits store only two logical qubits, but to rewrite them the errors must join into a chain winding once around the torus, at least 10 edges long. The number of logical qubits stays at 2 while the protection (distance d = L) grows with L: that is the trade-off of a topological code.
边数 = 横 L² + 竖 L²;星、面各 L² 但各含一条 ∏ = I 的冗余。
Edges = L² horizontal + L² vertical; L² stars and faces each, each family carrying one ∏ = I redundancy.
对。类别由两个交叉数各自的奇偶决定(碰撞定理逐条应用),而非它们之和。交叉 3 次 = 绕行时多拐了几个来回,同调上与交叉 1 次等价。
Right. The class is set by each crossing count's parity separately (collision theorem, applied per logical), never their sum. Crossing thrice = a once-winding loop with extra back-and-forth, homologically the same as crossing once.
对每条 X̄ 分别用碰撞定理:奇数交叉 ⇔ 反对易 ⇔ 含对应的 Z̄ 成分。
Apply the collision theorem to each X̄ separately: odd crossings ⇔ anticommute ⇔ carries that Z̄ component.
收官与去处Wrap-up & onward
复盘整条推理链:矩阵与那个不肯交换的 −1(第 1 章)→ 冗余与只查奇偶的症状(第 2 章)→ 三条公设、泡利矩阵、本征值语言(第 3 章)→ 张量积、投影测量 P±=(I±S)/2、稳定子清单与对半定理、三比特码的判决书(第 4 章)→ 环面网格上的对易定理、∏=I 与 k=2、症状=∂链、同调类与逻辑圈、配对译码、d=L(第 5 章)。你没有「了解」toric code——你构造并检验了它的每一个零件。
The full chain, replayed: matrices and the −1 that refuses to commute (Ch. 1) → redundancy and parity-only syndromes (Ch. 2) → three postulates, Pauli matrices, eigenvalue language (Ch. 3) → tensor products, projective measurement P±=(I±S)/2, stabilizer checklists with the halving theorem, the 3-qubit code's verdict (Ch. 4) → the commutation theorem on the torus grid, ∏=I and k=2, syndrome = ∂chain, homology classes and logical loops, matching decoders, d = L (Ch. 5). You did not “learn about” the toric code — you constructed and certified each of its parts.
只欠一个现实问题:芯片是平的。《Surface Code · 高中数学版》把环面剪开:两种边界的分工、贴边溜走的错误链、完整的纠错循环与译码游戏,以及压轴的阈值——先用排列组合与等比数列证下界,再用蒙特卡洛当场实测。
One practical matter remains: chips are flat. “The Surface Code · High-School Edition” cuts the torus open: the two boundaries' division of labour, error chains slipping off the edge, the full correction cycle and decoding game, and the threshold finale — first a lower bound proved with counting and geometric series, then the true value measured live by Monte-Carlo.
符号与读法Symbols & how to read them
| 符号Symbol | 名称与读法Name & how to read it | 在本教程中的含义Meaning in this tutorial |
|---|---|---|
| ψ | 希腊字母,读「普西」(psai)Greek letter, read “psy” (rhymes with “sigh”) | 物理学的百年老习惯:用 ψ 给一个量子状态起名。|ψ⟩ 就是「名叫 ψ 的那个状态」——它不是未知数,只是个名字,相当于「小明」。A century-old physics habit: ψ names a quantum state. |ψ⟩ is “the state called ψ” — not an unknown, just a name. |
| α | 希腊字母,读「阿尔法」(alpha)Greek letter, read “AL-fa” | 希腊字母表的第一个,惯用作第一个系数。这里:逻辑 0̄ 成分的振幅。First letter of the Greek alphabet, customary for a first coefficient. Here: the amplitude of the logical-0̄ part. |
| β | 希腊字母,读「贝塔」(beta)Greek letter, read “BAY-ta” | 希腊字母表的第二个,惯用作第二个系数。这里:逻辑 1̄ 成分的振幅。注意 α²+β²=1。Second Greek letter, customary for a second coefficient. Here: the amplitude of the logical-1̄ part, with α²+β²=1. |
| δ | 希腊字母,读「德尔塔」(delta)Greek letter, read “DEL-ta” | 这里只用它组成 δij(克罗内克 δ):一个「同或不同」的开关——i = j 时取 1,否则取 0。Used here only inside δij (the Kronecker delta): a same-or-different switch — 1 when i = j, else 0. |
| λ | 希腊字母,读「拉姆达」(lambda)Greek letter, read “LAM-da” | 本征值的惯用名:Mv = λv 里那个「整体伸缩的倍数」。这里的本征值只有 +1 与 −1。The customary name for an eigenvalue: the stretch factor in Mv = λv. Here eigenvalues are only ±1. |
| χ | 希腊字母,读「凯」(kai)——不是英文 xGreek letter, read “kai” — not the letter x | 欧拉示性数的专用名:χ = V − E + F,只由曲面本身决定(环面 χ = 0)。Reserved for the Euler characteristic: χ = V − E + F, fixed by the surface alone (torus: χ = 0). |
| θ | 希腊字母,读「西塔」(theta)Greek letter, read “THAY-ta” | 惯用来表示一个角度;eiθ 是「转过 θ 角」的相位因子。Customary for an angle; eiθ is the phase factor “rotated by θ”. |
| ∏ | 大写希腊字母 π,读「派」(pi)Capital Greek π, read “pie” | 连乘记号:把后面的东西全部乘起来——∑ 的乘法版。∏v Av 即「所有星形检查的乘积」。The product sign: multiply everything that follows — the multiplicative sibling of ∑. ∏v Av = “the product of all star checks”. |
| ∂ | 弯体 d,读「偏」(英文 partial 或 round-d)A curly d, read “partial” (or “round-d”) | 这里它表示「取边界」:∂p = 围住面 p 的那 4 条边;∂链 = 链的端点集。Here it means “take the boundary”: ∂p = the 4 edges rimming face p; ∂chain = the chain's endpoint set. |
| ⊕ | 圆圈加,读「异或」或「圆圈加」A circled plus, read “X-OR” or “o-plus” | 合并两组东西、成对相消:同一条边出现两次就抵消(因为 Z·Z = I);对 0/1 就是「模 2 加法」。Merge two collections with pairwise cancellation: anything appearing twice cancels (since Z·Z = I); on 0/1 it is addition mod 2. |
| ⊗ | 圆圈乘,读「张量积」(tensor)A circled times, read “tensor” | 把两个系统并成一个的记号:基标签并排写、振幅相乘、维数相乘。The glue joining two systems into one: labels concatenate, amplitudes multiply, dimensions multiply. |
| ℂ | 双线体大写 C,读「复数集」Double-struck C, read “the complex numbers” | 全体复数组成的集合。ℂ² 读「C 二」:由两个复数组成的向量的全体——量子比特状态的家。The set of all complex numbers. ℂ² (“C-two”) is the set of vectors with two complex entries — where qubit states live. |
| ℝ | 双线体大写 R,读「实数集」Double-struck R, read “the real numbers” | 全体实数组成的集合。The set of all real numbers. |
| ℤ | 双线体大写 Z,读「整数集」Double-struck Z, read “the integers” | 全体整数。ℤ₂ 读「Z 二」:只剩 0 和 1 的「模 2 / 奇偶」算术——1+1=0 的世界。All whole numbers. ℤ₂ (“Z-two”) is arithmetic mod 2 — the 0/1 world where 1+1=0. |
| ᵀ | 上标 T,读「转置」(transpose)A superscript T, read “transpose” | 「把横着写的竖起来」:(a, b)ᵀ 表示列向量——为了排版省地方的写法,含义不变。“Stand the row up”: (a, b)ᵀ denotes the column vector — a space-saving notation, same object. |
| ∈ ∋ | 读「属于」Read “belongs to / element of” | e ∈ S:e 是集合 S 的一员。反着写的 e ∋ v 用在 ∏e∋v 里:「所有碰到顶点 v 的边 e」。e ∈ S: e is a member of the set S. The mirrored e ∋ v in ∏e∋v reads “all edges e touching vertex v”. |
| ∎ | 实心小方块,读「证毕」(Q.E.D.)A filled square, read “Q.E.D.” | 数学家在证明末尾盖的小方章:到此证完,无需再言。The mathematician's end-of-proof stamp: done, nothing more to say. |
| ↦ | 带竖杠的箭头,读「映到」A barred arrow, read “maps to” | (x, y) ↦ (y, x):左边的向量被操作送到右边的向量;描述一个操作「把什么变成什么」。(x, y) ↦ (y, x): the vector on the left is sent to the one on the right — how an operation is described by what it does. |
| #{…} | 井号,读「个数」The hash sign, read “the number of” | #{…} = 花括号里集合的元素个数。碰撞定理里 c = #{X 与 Z 同格相遇的位置}。#{…} = how many elements the set in braces has. In the collision theorem, c = #{cells where X meets Z}. |
| eiθ | 读「e 的 i θ 次方」Read “e to the i-theta” | 欧拉公式 eiθ = cos θ + i sin θ:模为 1 的复数,乘它只转动相位、不改变任何模方;量子态整体乘上它,物理上视为同一状态。Euler's formula eiθ = cos θ + i sin θ: a complex number of modulus 1; multiplying by it rotates the phase and changes no modulus-square — a state times eiθ is the same physical state. |
| T² | 读「T 二」Read “T-two” | 环面(torus)的记号;上标 2 表示二维曲面。H₁(T², ℤ₂) 即「环面的一阶 ℤ₂ 同调群」。The symbol for the torus; superscript 2 because it is a two-dimensional surface. H₁(T², ℤ₂) reads “the first ℤ₂ homology group of the torus”. |
| ⇒ | 双线箭头,读「推出 / 则」A double arrow, read “implies” | A ⇒ B:由 A 可以得出 B。A ⇒ B: from A one may conclude B. |
| ⇔ | 双向双线箭头,读「当且仅当」A two-way double arrow, read “if and only if” | A ⇔ B:A 与 B 同真同假,互为充要条件——是一条双向的「推出」。A ⇔ B: A and B stand or fall together — an implication running both ways. |
| ⟨·|·⟩ | 左尖括号(bra-ket 记号)The left angle bracket (bra-ket notation) | ⟨u|v⟩ 读「u 内积 v」:两个向量的点乘(复数情形第一个向量先取共轭)。⟨u|v⟩ reads “u inner-product v”: the dot product of two vectors (conjugating the first in the complex case). |
| X̄ Z̄ | 字母头上一横,读「X bar / Z bar」An overbar, read “X-bar / Z-bar” | 一横 = 「逻辑版」:X̄ 是作用在被保护的逻辑比特上的 X,由许多物理操作组成(这里 = 缠绕圈 / 横跨串)。The bar means “logical edition”: X̄ is the X acting on the protected logical qubit, built from many physical operations (here: winding loops / spanning strings). |
| ± | 读「正负」Read “plus-minus” | ±1 = 「+1 或 −1」两个可能取值;这里每条检查的答案都是这两个之一。±1 = the two possible values “+1 or −1”; every check here answers with one of them. |
| √ | 读「根号」Read “square root” | √A = 面积为 A 的正方形的边长;(√A)² = A;常客:1/√2 ≈ 0.71。√A = the side of a square of area A; (√A)² = A; frequent guest: 1/√2 ≈ 0.71. |
| |·⟩ | 竖线加右尖括号,读「刻特」(ket)A bar with a right angle bracket, read “ket” | |0⟩ = 「贴着标签 0 的状态」:给量子状态套的礼盒括号,本质是基向量的名字。|0⟩ = “the state labelled 0”: gift-wrap for quantum states — really just a basis vector's name. |
| ≈ | 读「约等于」Read “approximately equals” | 两边近似相等。The two sides are nearly equal. |
| ≠ | 读「不等于」Read “not equal” | 两边不相等。The two sides differ. |
| ≤ ≥ | 读「小于等于 / 大于等于」Read “at most / at least” | 不超过 / 不少于。No more than / no less than. |
| n k r | 三个字母Three letters | n = 物理比特数;r = 独立检查条数;k = n − r = 逻辑比特数(4.4)。n = physical qubits; r = independent checks; k = n − r = logical qubits (§4.4). |
| [[n, k, d]] | 读「n k d 码」(双层方括号)Read “n, k, d code” (double brackets) | 量子码的三项指标:物理比特数、逻辑比特数、码距。A quantum code's three numbers: physical qubits, logical qubits, distance. |
词汇表Glossary
| 术语Term | 定义Definition |
|---|---|
| 量子比特 / 振幅qubit / amplitude | 状态 = ℂ² 中单位向量 (a,b)ᵀ;分量即振幅,概率 = 模方。State = a unit vector (a,b)ᵀ in ℂ²; components are amplitudes, probabilities their modulus-squares. |
| 泡利矩阵 X, Z, YPauli matrices | X 交换分量、Z 变号第二分量、Y = iXZ;两两反对易,自乘为 I。X swaps components, Z re-signs the second, Y = iXZ; pairwise anticommuting, each squaring to I. |
| 本征值 / 本征态eigenvalue / eigenstate | Mv = λv;测量算符即询问其本征值,测后坍缩到本征态。Mv = λv; measuring an operator asks for an eigenvalue and collapses onto its eigenstate. |
| 张量积 ⊗tensor product ⊗ | 多系统合并规则:基标签并写、振幅相乘;维数相乘(n 比特 → 2ⁿ 维)。How systems combine: labels concatenate, amplitudes multiply; dimensions multiply (n qubits → 2ⁿ). |
| 纠缠态entangled state | 不能写成单比特态张量积的多比特态,如贝尔态。A joint state that factors into no product of single-qubit states, e.g. Bell. |
| 投影算符 P±projectors P± | (I±S)/2;测 S 得 ± 的概率 = |P±ψ|²,测后取 P±ψ 归一。(I±S)/2; outcome probabilities |P±ψ|², post-state P±ψ renormalized. |
| 稳定子 / 症状stabilizer / syndrome | 两两对易的检查清单,编码态为全体 +1 本征态;全部读数的清单即症状。The pairwise-commuting checklist whose common +1 eigenstates form the code; the list of readings is the syndrome. |
| Av, Bp | 星形检查(顶点 4 边上的 X)与面检查(面 4 边上的 Z)。Star check (X on a vertex's 4 edges) and plaquette (Z on a face's 4 edges). |
| 逻辑算符 / 码距 dlogical operators / distance d | 与全部检查对易、又非检查乘积的串(环面上 = 缠绕圈);最轻者的重量即 d = L。码距 d 保证纠正 (d − 1)/2 个错误。Strings commuting with all checks yet not products of them (= winding loops on the torus); the lightest one's weight is d = L. Distance d guarantees correcting (d − 1)/2 errors. |
| 独立检查 / rindependent check / r | 不是清单上其他检查乘积的检查;其条数记作 r,每条把编码空间维数砍半,k = n − r。A check that is not a product of other checks on the list; their number is r, each halves the code-space dimension, k = n − r. |
| 重量weight | 泡利串中不为 I 的格数,如 X₁X₂X₃ 重 3。The number of non-I cells of a Pauli string, e.g. X₁X₂X₃ has weight 3. |
| [[n, k, d]] | 量子码三项指标:n 个物理比特、k 个逻辑比特、码距 d。三比特码 [[3,1,1]],环面码 [[2L²,2,L]]。A quantum code's three numbers: n physical qubits, k logical qubits, distance d. 3-qubit code [[3,1,1]], toric code [[2L²,2,L]]. |
| 同调类homology class | 「相差若干面检查的乘积(一批面的边界)视为相同」的圈分类;由两个方向缠绕数的奇偶决定,环面上共 4 类,对应 2 个逻辑比特。Loop classes “equal up to a product of face checks (the boundary of a set of faces)”; fixed by whether each winding number is even or odd; four on the torus, matching 2 logical qubits. |
| 欧拉示性数 χEuler characteristic χ | V−E+F = 2−2g;环面 χ=0、g=1,而 k = 2g。V−E+F = 2−2g; torus χ=0, g=1, and k = 2g. |
延伸阅读Further reading
- A. Kitaev, “Fault-tolerant quantum computation by anyons” (1997/2003)
原始论文。读完本教程,其第 2–4 节已在射程之内。arXiv: quant-ph/9707021The original. After this tutorial its §2–4 are within range. arXiv: quant-ph/9707021 - D. Gottesman, “Stabilizer Codes and Quantum Error Correction” (1997)
稳定子形式化的奠基博士论文——第 4 章的完整版语言。arXiv: quant-ph/9705052The founding thesis of the stabilizer formalism — the full-dress version of our Chapter 4. arXiv: quant-ph/9705052 - J. Preskill, Caltech Ph219 lecture notes, ch. “Quantum Error Correction”
免费公开、物理直觉最好的系统讲义。Free online; the best physical intuition in a systematic set of notes. - E. Dennis, A. Kitaev, A. Landahl, J. Preskill, “Topological quantum memory” (2002)
链、配对译码与阈值的系统研究。arXiv: quant-ph/0110143The systematic study of chains, matching decoders and thresholds. arXiv: quant-ph/0110143 - M. Nielsen, I. Chuang, “Quantum Computation and Quantum Information”
标准教科书;其第 2 章与本教程第 3–4 章可互为镜像对照。The standard text; its ch. 2 mirrors our Ch. 3–4 almost paragraph for paragraph.
本教程的框架(复数振幅、三公设、投影测量)即标准量子力学,无缩水;以下三处从简:① 互动实验台只展示实振幅切片(完整态空间含复相位,结论不受影响);② 「操作 = 保长度的线性映射(酉矩阵)」我们只用到泡利族,未展开一般理论;③ 测量读数假设完美;实验台的自动译码在警报不超过 14 个时是精确的最小重量完美匹配,更多时退为贪心配对,且不按出错概率给路径加权——两者的现实版本见《Surface Code · 高中数学版》第 4 章、第 6 章。
This tutorial's framework (complex amplitudes, three postulates, projective measurement) is standard quantum mechanics, unshrunk. Three economies: ① the interactive benches display the real-amplitude slice (full state space carries complex phases; no conclusion is affected); ② of “operations = length-preserving linear maps (unitaries)” we used only the Pauli family, not the general theory; ③ measurement readings are assumed perfect; the bench's auto-decoder is exact minimum-weight perfect matching for at most 14 alarms, greedy matching beyond, and it does not weight paths by error probability — reality's versions await “The Surface Code · High-School Edition”, Chapter 4 and Chapter 6.