The measurement-based Gidney adder on the full register: the n-fold hybrid amplitude equality #
Category: 3-Local (QM-validity content; no CSD ontology).
MeasurementGidneyAdder.lean re-costs the Gidney adder — n Toffoli forward, 0 on the measured
reverse pass — and MeasurementAdderHybrid.lean proved the amplitude-level statement for the
AND-adder. This module is the same statement for the Gidney adder, on the general hybrid
semantics of HybridLift.lean. Here the per-Toffoli picture is right: the reverse block of a
Gidney cell is [CX cin cout, CCX a b cout, CX cin b, CX cin a], and when its Toffoli fires the
ancilla cout holds exactly the fresh AND (a ⊕ cin) ∧ (b ⊕ cin) of the (still shifted) addend
wires — an AND-shaped block, so Gidney's single-CZ gadget is exact there, one per cell, with the
two un-shifting CNOTs kept as unitaries around it (gidneyHybridCell).
gidneyHybridAdd L mo— the forward and sum passes as unitaries, then the hybrid reverse passgidneyHybridUncompute L mo n(cellsn−1, …, 0; the Toffoli of each replaced by the gadget with outcomemo k).gidneyHybrid_invariant— the run compared with the unitary reverse pass, cell by cell: off the outcome ancillas the two agree (the agreement propagationdenoteGate_agree, gate by gate), the ancillas hold the outcomes, and every gadget meets its AND (MAJ(a,b,c) ⊕ c = (a ⊕ c) ∧ (b ⊕ c),majority_xor_carry, on the forward carry invariant).- ★★
gidneyHybridAdd_amplitude— then-fold hybrid amplitude equality: on every basis input with clean ancillas the hybrid adder produces(√2)⁻¹^n • |out⟩, whereoutagrees with the unitary adder's output on every wire except thencarry ancillas (gidneyHybridAdd_shadow_data) — so the sum register holds(A + B) mod 2ⁿ(gidneyHybridAdd_sum) and the addends are restored (gidneyHybridAdd_shadow_A,_B) — and the ancillas hold the outcomes (gidneyHybridAdd_shadow_outcome). By linearity the same holds for any superposition of clean-ancilla inputs (hybridLin_sum).
With MeasurementAdderHybrid.lean this closes link 11's measurement-gadget strand: both
measurement-based adders of the corpus are amplitude-exact on the full register, at the Toffoli
counts their re-costs state (n here, 3n there).
Honest scope #
Per-outcome representation: each of the 2ⁿ outcome strings has probability 2⁻ⁿ and every
branch carries the right data. The Toffoli count of the reverse pass is 0 as
gidneyMeasAddToffoli_eq states; the measurement count is n. No ECDSA resource claim.
Boolean facts #
MAJ(a,b,c) ⊕ c = (a ⊕ c) ∧ (b ⊕ c): the Gidney cell's fresh AND is the carry-out minus the
carry-in.
The hybrid reverse pass #
The hybrid reverse block of cell k: the reversed Gidney cell with its Toffoli replaced by
the single-correction gadget on the fresh AND (A k ⊕ G k) ∧ (B k ⊕ G k), the un-shifting CNOTs
kept as unitaries.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The unitary reverse block of cell k: the same gates with the Toffoli in place.
The hybrid reverse pass over cells k−1, …, 0 (cell k−1 first, as in the reverse
pass).
Equations
Instances For
The unitary reverse pass over cells k−1, …, 0, in the same shape.
Equations
Instances For
The hybrid Gidney adder: the forward and sum passes as unitaries, then the hybrid reverse
pass over all n cells.
Equations
Instances For
The shaped unitary reverse pass is the reverse pass.
The invariant #
Off the outcome ancillas of cells k, …, n−1, the register state u read as Booleans agrees
with the Boolean state T.
Equations
Instances For
The outcome ancillas of cells k, …, n−1 hold their outcomes.
Equations
Instances For
The wires of cells 0, …, k−1 still hold their post-forward values.
Equations
Instances For
The hybrid reverse pass against the unitary one, cell by cell. If, before the cells
k−1, …, 0, the register state agrees with the Boolean state off the outcome ancillas of the
cells already processed, those hold their outcomes, and the cells to come are still fresh, then
the hybrid pass is well-formed, its shadow agrees with the unitary pass off all outcome ancillas,
and every outcome ancilla holds its outcome.
The carry invariant after the forward and sum passes #
After the forward and sum passes, each cell's fresh AND is its carry-out minus its carry-in:
G (j+1) ⊕ G j = A j ∧ B j on the (shifted) addend wires.
★★ The n-fold hybrid amplitude equality #
The hybrid run is well-formed on every clean-ancilla basis input, and its shadow is the unitary adder's output off the outcome ancillas, which hold the outcomes.
★★ The n-fold hybrid amplitude equality for the Gidney adder. On every basis input with
clean carry ancillas, the hybrid adder — forward and sum passes, then the gadget on each cell's
fresh AND with outcomes mo — produces (√2)⁻¹^n • |out⟩, out the run's shadow.
The data agree with the unitary adder on every wire other than the n carry ancillas
G 1, …, G n.
The ancillas hold the outcomes.
The sum is right on every branch: the sum register holds (A + B) mod 2ⁿ, exactly as for
the unitary adder (gidneyAdd_correct).
The addends are restored on every branch (the un-shifting CNOTs run as unitaries).