Selene · Primitive · Frontier07 / 13
← Frontier index
PrimitiveVerified

QSP / QSVT phase-sequence library

Compute phases from a target polynomial; run the sequence on Selene; verify against classical Chebyshev.

Results · real Selene shots

qsp_phase_finder_verified · measured_within_0.05_of_target

Full QSP loop closes end-to-end: hidden secret ψ defines an achievable target curve; scipy-Powell phase finder recovers φ without seeing ψ; recovered φ is rendered through the same Guppy kernel as G10 and executed on Selene at 2048 shots × 16 x-points. Worst |measured − target| = 0.0169, well under the card's 0.05 threshold.

worst |measured − target| over grid0.0169
JSONsrc/data/demos/nadarasa_g10_phasefinder.json

Why this matters

generate_demos.py ships a toy QSVT with hard-coded phases. Nothing in the repo computes phases from a target curve. A `qsp_sequence(phases)` Guppy primitive plus a NumPy phase finder unlocks Hamiltonian simulation, matrix inversion, amplitude amplification, eigenvalue thresholding — all on the SWAP-test readout we already have.

What the repo already has

Real phase-finder loop in quantum/nadarasa_g10_phasefinder.py: scipy Powell optimizer recovers φ from a hidden achievable target curve, and the recovered phases are executed on Selene through the same @guppy QSP kernel as G10.

What's missing

Nothing required by the card's refutation criterion. Generic polynomial → phases (Remez / Haah factorization) for arbitrary high-degree targets is downstream work; the loop-closure here uses random achievable targets to verify the end-to-end pipeline.

Smallest experiment

Build it or kill it

Qubits

1 signal qubit

Ancilla pattern

n/a — single-qubit QSP

Shots

2048 shots × 16 sample points of x; phases recovered from a 51-point fine grid.

Predicted outcome

Worst |measured − target| over the 16-point sample grid stays below 0.05; the recovered φ reproduces the secret target curve through real Selene execution.

Refutation criterion

If measured response systematically misses the target by > 0.05 at any sample point, either the phase finder is wrong or the QSP kernel diverges from the NumPy reference.

Kernel sketch

Untested — sketch only
# quantum/nadarasa_g10_phasefinder.py (verified)
secret = rng.uniform(-pi, pi, size=d)
target = [reference_p0(secret, x) for x in fine_grid]   # hide secret
phi, _ = find_phases(fine_grid, target, d=d)            # scipy Powell ×40 restarts
# Render recovered phases through the SAME @guppy kernel as nadarasa_g10
for x in xs:
    compiled = compile_kernel(phi, x)
    shots    = run_shots(compiled, n_qubits=1, shots=2048)
    measured = shots.count("s=0") / 2048
    assert abs(measured - reference_p0(secret, x)) < 0.05

Host pipeline

Secret ψ → achievable target curve → numerical phase finder (Powell × 40 restarts) → recovered φ → Selene execution → measured response. Closes the QSP loop end-to-end.

Related

Files in this repo

  • · quantum/nadarasa_g10.py
  • · quantum/nadarasa_g10_lib.py
  • · quantum/nadarasa_g10_phasefinder.py
  • · src/data/demos/nadarasa_g10.json
  • · src/data/demos/nadarasa_g10_phasefinder.json
  • · src/routes/nadarasa.g10.tsx

More in Primitive

3 cards