一个量子比特,布洛赫向量 r₀,经过一扇门 Ry(θ) = e−iθY/2 后测沿单位轴 m 的泡利算符,期望值 f(θ) = m·r(θ)。页面上的每个数都实时算出;本页是数值演示,不是证明。
- 曲线。Ry(θ) 把 r₀ 绕 Y 轴转 θ,所以 f(θ) = c + a cos θ + b sin θ,只含常数项与一倍角谐波;令 R = √(a² + b²)、θ₀ = atan2(b, a),就是 f = c + R cos(θ − θ₀)。圆里的箭头长 R、与竖直方向夹角 θ − θ₀,它的高度就是 f:箭头在测量轴上的影子。第十二章的例子是 r₀ = m = (0, 0, 1),f = cos θ;“倾斜”一例取 r₀ = (0.48, 0.60, 0.64)、m = (0.80, 0.36, 0.48),c = 0.216、a = 0.6912、b = 0.2816。
- 左右各 90°。两个青色的点在 θ ± 90°。因为 cos(φ + 90°) = −sin φ,f(θ + 90°) − c 恰好等于斜率 f′(θ) = −R sin(θ − θ₀),f(θ − 90°) − c 是它的相反数;两值之差的一半就是斜率,常数 c 消掉。这是参数位移律(文献结果,未在本书形式化),它要求 θ 只出现在一扇对合泡利门里。
- 切线。虚线切线的斜率不是由两点公式算的:页面把 ρθ = Uρ₀U*、P = (I + m·σ)/2 写成 2 × 2 复矩阵,按冻结命题的对易子公式 p′ = Re(i Tr(ρθ(HP − PH)))、H = Y/2 算出 f′ = 2p′。量尺上青色与切线重合,是两种算法给出同一个数。
- 小步长差分。品红的弦连接 θ ± h 两点,斜率 [f(θ + h) − f(θ − h)]/(2h)。对这样的曲线它等于 f′(θ)·sin h / h:斜率不为零时,h = 30° 短 4.5%,h 越小越准,但从不精确;只在斜率为零的极值点,两者同为 0。
- 采样。真实硬件只能测有限发,每发 ±1,均值的方差是 (1 − f²)/N。两点公式的散布是 √[(1 − f(θ + 90°)²) + (1 − f(θ − 90°)²)] / (2√N);小步长差分的散布是 √[(1 − f(θ + h)²) + (1 − f(θ − h)²)] / (2h√N)(h 以弧度计)。两组取值点各取自己的 f,宽度之比随 θ 与 h 而变,并不总大于 1:f = cos θ、θ = 0° 时它是 sin h / h。f = cos θ、h = 6°、N = 100、θ = 60° 时,两者理论宽度是 0.035 与 0.58。小图画出截断误差随 h 变小、噪声随 h 变大。
书中:第十二章 · 泡利转角与精确参数位移 · 投影测量概率的对易子导数 · 参数位移律(文献结果) · 一次传态、两次移位与一次球面下降
One qubit with Bloch vector r₀ passes one gate Ry(θ) = e−iθY/2, and the Pauli operator along a unit axis m is measured: the expectation value is f(θ) = m·r(θ). Every number on the page is computed live; the page is a numerical illustration, not a proof.
- The curve. Ry(θ) turns r₀ by θ about the Y axis, so f(θ) = c + a cos θ + b sin θ: a constant and the first harmonic only. With R = √(a² + b²) and θ₀ = atan2(b, a) this is f = c + R cos(θ − θ₀). The arrow in the dial has length R and makes the angle θ − θ₀ with the vertical; its height is f, the arrow's shadow on the measured axis. The example of Chapter 12 is r₀ = m = (0, 0, 1), f = cos θ; the tilted case takes r₀ = (0.48, 0.60, 0.64) and m = (0.80, 0.36, 0.48), so c = 0.216, a = 0.6912 and b = 0.2816.
- A quarter turn each way. The two cyan points sit at θ ± 90°. Since cos(φ + 90°) = −sin φ, f(θ + 90°) − c is exactly the slope f′(θ) = −R sin(θ − θ₀) and f(θ − 90°) − c is its negative; half their difference is the slope, and the constant c drops out. This is the parameter-shift rule (a literature result, not formalized in this book); it needs θ to appear in a single involutory Pauli gate.
- The tangent. The slope of the dashed tangent does not come from the two-point formula: the page writes ρθ = Uρ₀U* and P = (I + m·σ)/2 as 2 × 2 complex matrices and evaluates the commutator formula of the frozen proposition, p′ = Re(i Tr(ρθ(HP − PH))) with H = Y/2, to get f′ = 2p′. On the gauge the cyan mark sits on the tangent's line: two computations give the same number.
- The small step. The magenta chord joins the points at θ ± h; its slope is [f(θ + h) − f(θ − h)]/(2h). For such a curve this equals f′(θ)·sin h / h: where the slope is not zero it is 4.5% short at h = 30°, better as h shrinks, never exact; only at the extrema, where the slope is zero, are both 0.
- Shots. Hardware only takes finitely many shots, each ±1, and the variance of their mean is (1 − f²)/N. The two-point formula scatters by √[(1 − f(θ + 90°)²) + (1 − f(θ − 90°)²)] / (2√N); the small-step difference scatters by √[(1 − f(θ + h)²) + (1 − f(θ − h)²)] / (2h√N) (h in radians). Each pair takes f at its own settings, so the ratio of widths depends on θ and h and is not always above 1: for f = cos θ at θ = 0° it is sin h / h. For f = cos θ at h = 6°, N = 100 and θ = 60° the predicted widths are 0.035 and 0.58. The small plot shows the truncation error falling and the noise rising as h shrinks.
In the book: Chapter 12 · Pauli angles and exact parameter shift · the commutator derivative of a projection probability · the parameter-shift rule (literature) · one teleportation, two shifts and one spherical descent