VQE Suite / Physics
Zero-Noise Extrapolation
How the ZNE panel turns a noisy energy estimate back toward the noiseless answer: depolarizing noise, digital gate folding, and Richardson extrapolation — with real numbers from the shipped simulator.
Depolarizing noise
Each gate in the ansatz circuit is followed by a depolarizing channel acting on the qubit(s) it touched. For a single qubit,
and for the two-qubit CNOT gate, the channel spreads over all 15 non-identity two-qubit Pauli strings:
implemented directly on a 4×4 density matrix in src/lib/physics/densityMatrix.ts — the playground's two sliders set the single-qubit gate error rate and the two-qubit (CNOT) gate error rate independently, since real hardware's two-qubit gates are consistently noisier.
Digital gate folding
Zero-noise extrapolation needs the same circuit run at several different noise levels. Rather than changing hardware noise directly, digital ZNE scales it by re-running extra, otherwise-redundant gates: global folding replaces the ansatz unitary with
Ideally , so computes the same thing as — but each extra pair re-executes every physical gate, which re-exposes the state to the depolarizing channels above. More folds, same ideal answer, more accumulated noise:
1 applySequence(ansatzPhysicalGates(theta, false)); // U 2 for (let k = 0; k < foldK; k++) { 3 applySequence(ansatzPhysicalGates(theta, true)); // U-dagger 4 applySequence(ansatzPhysicalGates(theta, false)); // U 5 } 6 // lambda = 2*foldK + 1
The playground evaluates ().
Richardson extrapolation via Lagrange interpolation
With noisy energy estimates at known noise scales, Richardson extrapolation fits the unique degree- polynomial through those points and evaluates it at . Since these are exact deterministic simulation outputs (not statistically noisy samples), plain Lagrange interpolation is the right tool — no least-squares regression needed:
1 export function lagrangeInterpolate(points: { x: number; y: number }[], atX: number): number { 2 let total = 0; 3 for (let i = 0; i < points.length; i++) { 4 let weight = 1; 5 for (let j = 0; j < points.length; j++) { 6 if (i === j) continue; 7 weight *= (atX - points[j].x) / (points[i].x - points[j].x); 8 } 9 total += weight * points[i].y; 10 } 11 return total; 12 }
The playground reports both the 2-point linear extrapolation () and the 3-point quadratic extrapolation ().
Worked example (real measured output)
runZne() in src/lib/physics/zne.ts) at the VQE-optimized , with error rates per single-qubit gate and per CNOT — not illustrative/rounded figures.| λ | Energy (Ha) | Error vs. noiseless (mHa) |
|---|---|---|
| 1 (raw, noisy) | -1.083360 | 62.270 |
| 3 (raw, noisy) | -0.967183 | 178.446 |
| 5 (raw, noisy) | -0.861327 | 284.302 |
| 0 (linear extrap., 2-pt) | -1.141448 | 4.181 |
| 0 (quadratic extrap., 3-pt) | -1.145319 | 0.311 |
Chemical accuracy is conventionally mHa. The raw λ=1 estimate misses it by nearly 40×; quadratic Richardson extrapolation recovers it from the same noisy data. Reproduce this yourself, or with your own error rates, on the VQE Suite playground — see also Hamiltonian & Ansatz for the parameter-shift optimizer that produces .
Source: src/lib/physics/densityMatrix.ts, zne.ts, linalg.ts