Train QSP phase angles with Adam instead of analytic solvers — on a flat, JAX-traceable circuit (QSP · QSVT · variational / differentiable quantum programming). We measure when gradient learning beats mapped analytic baselines (PennyLane poly_to_angles, Chao/pyqsp) on a shared flat-circuit MSE, and release code, sweeps, convention docs, and a reproducible Chebyshev benchmark.
For: variational / QML pipelines with implicit targets · solver comparisons · anyone embedding differentiable QSP blocks · reproducibility audits. PennyLane is the reference frontend only; the flat-circuit pattern ports to Qiskit, Cirq, TFQ, etc. (docs/FRAMEWORKS.md).
Outcome (headline): learned train MSE
Read or download: Zenodo — Version 1.1 (PDF + results ZIP)
LaTeX sources for audit and reuse: manuscript.tex, manuscript_numbers.tex, references.bib.
Classical QSP computes phase angles analytically from a target polynomial. This repo benchmarks the alternative: optimize angles with automatic differentiation and Adam, compare fairly to analytic solvers on one metric, and document pitfalls (e.g. high-level QSVT templates that break JAX grads through qml.QSVT).
This is not a new QSP algorithm — a reproducible measurement protocol, open implementation, and convention mapping.
When to use which
| Situation | Approach |
|---|---|
| Known target, flat-circuit MSE (this benchmark) | Gradient training |
| Fast classical angles in native solver convention | Chao / pyqsp or PennyLane |
| Implicit loss (e.g. energy in a VQA) | End-to-end gradient |
| Novel polynomial, no closed form | Gradient training |
Contributions
- JAX-traceable flat QSP circuit + QSVT-template workaround
- Degree-5 Chebyshev
sin(x)benchmark: multi-seed ($d=5,7,15$ ), scaling, ablation, off-grid probe - Phase-convention protocol —
docs/CONVENTIONS.md(φ_flat = π/2 − φ_chao) - Experiment pipeline, tests, audit trail, manuscript
Code layout: start in demo.ipynb · library in qsp_jax/circuit.py · CLI in experiments/
git clone https://github.com/rosspeili/trainable-qsp-angles
cd trainable-qsp-angles
py -3.13 -m pip install -r requirements.txt
py -3.13 -m pytest tests/ -vInteractive training and plots — no sweeps required:
py -3.13 -m jupyter notebook demo.ipynbDownload the results ZIP from Zenodo, or regenerate locally (defaults in experiments/configs/default.json):
py -3.13 -m experiments.train --seed 0 --steps 500
py -3.13 -m experiments.baseline_analytic
py -3.13 -m experiments.sweep multi-seed
py -3.13 -m experiments.sweep scaling
py -3.13 -m experiments.summarize baselineFull CLI: docs/REPRODUCING.md. Analysis notebooks (after sweeps):
| Notebook | nbviewer |
|---|---|
notebooks/01_baseline_comparison.ipynb |
open |
notebooks/02_scaling_study.ipynb |
open |
Local runs write to results/ (gitignored; see results/schema.json). Committed paper figure values: manuscript_numbers.tex.
Default target: degree-5 Chebyshev approximation of sin(x) on
Chebyshev target (solid) vs. sin(x) (dashed). Training minimizes MSE to the polynomial, not to sin(x) directly.
Mapped analytic rows use the same flat circuit after φ_flat = π/2 − φ_chao (docs/CONVENTIONS.md); PennyLane and pyqsp baselines are compared on equal footing.
| Metric (seed 0, default protocol) | Value |
|---|---|
| Train MSE (gradient Adam) | |
| Train MSE (PennyLane / pyqsp, mapped) | |
| Multi-seed median ( |
|
| Multi-seed success ( |
30/30 each, below |
| Off-grid max error (learned vs mapped analytic) |
|
Demo snapshot (seed 0). Full figures and tables: Zenodo PDF.
| Doc | What it covers |
|---|---|
docs/REPRODUCING.md |
Full experiment CLI and sweep commands |
docs/CONVENTIONS.md |
Phase maps (pyqsp / PennyLane → flat circuit) |
docs/FRAMEWORKS.md |
PennyLane vs Qiskit / Cirq / TFQ / analytic solvers |
docs/AUDIT_TRAIL.md |
Failures, fixes, rationale |
CHANGELOG.md |
Version history |
CITATION.cff |
Machine-readable cite metadata |
Peilivanidis, V. (2026). Learning Quantum Signal Processing Phase Angles via Gradient Descent: A Reproducible Benchmark and JAX Implementation Note (Version 1.1). https://doi.org/10.5281/zenodo.20645402
Apache 2.0 — see LICENSE and NOTICE. Attribution required for code, data, figures, or manuscript reuse.
Low & Chuang (2017) · Gilyén et al. (2019) · Martyn et al. (2021) · Chao et al. (2020) · Haah (2019) · Cerezo et al. (2021) · Bergholm et al. (2022) — full list in references.bib.
Evolved from the earlier PennyLane community demo.


