Draft · v0.2 · Unreviewed
← Index/Project · Nadarasa ReductionDraft · v0.2 · Selene Emulator

primitive · G8

Amplitude estimation via canonical QPE

One target qubit prepared in |1⟩ (a trivial "good-state preparation" for amplitude estimation), an m = 4 estimation register in |+⟩4, controlled-U2j via the cphase_h primitive, then an inverse QFT and a terminal measurement. Bit-reversal is resolved in the host decoder.

amplitude_estimation_verified · bit_order = msb_first · worst bin error = 0

← frontier card

Per-a results

a (predicted)peak binpeak mass|bin − a|shots
221.00001024
441.00001024
661.00001024
771.00001024

a = 2 · histogram over 16 bins (msb_first)

a = 4 · histogram over 16 bins (msb_first)

a = 6 · histogram over 16 bins (msb_first)

a = 7 · histogram over 16 bins (msb_first)

Kernel snippet (a = 4)

open in Playpond ↗

from quantum.nadarasa_g8_lib import (
    guppy, qubit, h, x, cx, rz, measure, result, angle, cphase_h,
)

@guppy
def program() -> None:
    e0 = qubit()
    e1 = qubit()
    e2 = qubit()
    e3 = qubit()
    tgt = qubit()
    x(tgt)
    h(e0); h(e1); h(e2); h(e3)
    cphase_h(e0, tgt, 0.5)
    cphase_h(e1, tgt, 1.0)
    cphase_h(e2, tgt, 2.0)
    cphase_h(e3, tgt, 4.0)
    h(e3)
    cphase_h(e3, e2, -0.5)
    h(e2)
    cphase_h(e3, e1, -0.25)
    cphase_h(e2, e1, -0.5)
    h(e1)
    cphase_h(e3, e0, -0.125)
    cphase_h(e2, e0, -0.25)
    cphase_h(e1, e0, -0.5)
    h(e0)
    result("e0", measure(e0))
    result("e1", measure(e1))
    result("e2", measure(e2))
    result("e3", measure(e3))
    result("tgt", measure(tgt))
Canonical Quantum Phase Estimation on a 1-qubit eigenstate of a Z-rotation. Eigenphase φ = π · a / 2^{m-1} with m=4 estimation qubits, sweeping integer a ∈ {2, 4, 6, 7}. The estimation register is inverse-QFT'd (without final swap; bit-reversal is resolved in the host decoder, which tries both MSB-first and LSB-first and reports the order that matches the prediction). Verdict = verified if the worst-case |peak − a| stays ≤ 1 bin across all a. This IS amplitude estimation under the standard a = sin(θ) ↔ phase φ = 2θ identification — the same QPE machinery, just with a trivial 'good-state preparation' (X on the target qubit).