Draft · v0.2 · Unreviewed
← Index/Project · Nadarasa ReductionDraft · v0.2 · Selene Emulator
Selene · Runtime · Frontier card → /selene-frontier/feed-forward

[G4] Real
feed-forward

A compiled @guppy program calls measure(a) mid-circuit, binds the outcome to a classical bit b, and applies rz(d, angle(θ)) only when b == 1 — all in the same shot, no host round-trip. The conditional gate's effect is read out via a branch-split metric.

Verdict

Feed-forward verified
Worst-case |observed − predicted| = 0.0162 against a refutation threshold of 0.0500. The split-distance metric tracks sin²(θ/2) across all five sample θ values, with the b == 0 branch always reading P(y₂ = 1) ≈ 0 — exactly the no-op behaviour. Guppy's in-kernel if on a measured bit is real.

Branch-split distance vs analytic sin²(θ/2)

Per-θ shot table

θ (rad)n (b=0)n (b=1)P(y₂=1 | b=0)P(y₂=1 | b=1)splitpredictedΔ
0.0000195320470.00000.00000.00000.0000+0.0000
0.7854205719430.00000.13020.13020.1464-0.0162
1.5708202619740.00000.50960.50960.5000+0.0096
2.3562203819620.00000.85370.85370.8536+0.0002
3.1416200119990.00001.00001.00001.0000+0.0000

Kernel snippet (θ = π)

open in Playpond ↗

from quantum.nadarasa_g4_lib import (
    guppy, qubit, h, cx, rz, measure, result, angle,
)

@guppy
def program() -> None:
    # Ancilla = coin-flip in |+>; measure gives a random classical bit b.
    # We feed b into a SAME-SHOT conditional gate on a data qubit d.
    # The data qubit was prepared in |+>; if b fires we apply rz(theta);
    # we then read d in the X basis (h, measure). Analytic prediction:
    #     P(d=1 | b=1) = sin^2(theta/2)
    #     P(d=1 | b=0) = 0
    # split_distance = sin^2(theta/2).
    a = qubit()
    d = qubit()
    h(a)
    h(d)
    b = measure(a)
    if b:
        rz(d, angle(-1.0))
    h(d)
    result("b", b)
    result("y2", measure(d))

One @guppy program per θ. NB: in guppylang 0.21.16 angle(x) takes halfturns (multiples of π), not radians — the driver divides by π before baking the literal in.