A reproducible benchmark and JAX‑traceable implementation is now available – no analytic solver required.
Quantum Signal Processing (QSP) is one of the most elegant building blocks in quantum computing. It turns a single qubit and a handful of phase angles into a polynomial transformer: feed in a signal (x \in [-1,1]), and the circuit outputs (P(x)) for a polynomial of your choice. Hamiltonian simulation, amplitude amplification, even quantum phase estimation – all can be written as QSP with the right phase angles.
The catch? Until now, getting those phase angles meant running an analytic solver. That works, but it can be numerically fragile at high degree, and it assumes you have a closed‑form target polynomial. What if your target is defined implicitly by a loss function? What if you want to embed QSP as a differentiable layer inside a larger variational circuit?
Learning phases instead of deriving them
A new paper and open‑source implementation (DOI: 10.5281/zenodo.20645403, github.com/rosspeili/trainable-qsp-angles) shows that you can learn QSP phase angles from random initialization using gradient descent – with no analytic pre‑computation.
The approach is deceptively simple:
- Build a flat QSP circuit from primitive gates (no high‑level template that freezes values at build time)
- Keep all phase angles as live JAX arrays
- Minimise MSE against your target polynomial using Adam
What the paper delivers
The author (Vladimiros Peilivanidis) provides a reproducible benchmark that goes far beyond a simple demo:
- 30-seed statistics at degree 5 – all seeds converge below 10⁻³ train MSE, median 6.3 × 10⁻⁵
- Hyperparameter ablation (learning rate, grid size, initialisation range) – 18 configs, all successful
- Degree scaling from 5 up to 21 (seed 0)
-
Fair baseline comparison against analytic solvers (PennyLane
poly_to_anglesand Chao/pyqsp), including a convention mapping φ_flat = π/2 − φ_chao that makes the comparison meaningful on the same flat circuit - Hold-out validation – the reported metrics are not overfitting to the training grid
All results are hardcoded into the LaTeX source directly from generated JSON logs. What you see in the paper is exactly what the experiments produced – no manual cherry-picking.
Why you should care
You hit the JAX tracing wall. High‑level QSVT templates (like PennyLane's
qml.QSVT) capture concrete operator values at circuit‑build time, breaking gradients. The flat‑circuit pattern in this repo is the proven workaround.Your target polynomial has no closed form. Maybe it comes from a neural network, an energy function, or a physical model. Gradient‑based learning works where analytic solvers cannot start.
You want a ready‑to‑run template. The repository contains scripts for single runs, multi‑seed sweeps, scaling studies, ablation, audit logging, and even a demo notebook. You can adapt the same structure to your own QSP or QSVT problems.
You care about reproducibility in quantum ML. This project sets a high bar: append‑only audit logs, hardcoded manuscript numbers, and a clear separation between reference seed and population statistics.
How to get started
Clone the repository and run the demo in under two minutes:
git clone https://github.com/rosspeili/trainable-qsp-angles
cd trainable-qsp-angles
pip install -r requirements.txt
jupyter notebook demo.ipynb
To reproduce the paper's main results:
python -m experiments.train --seed 0 --steps 500
python -m experiments.baseline_analytic
python -m experiments.sweep multi-seed
The flat QSP circuit is defined in qsp_jax/circuit.py. It uses PennyLane as a reference frontend, but the same pattern works with Qiskit, Cirq, or TensorFlow Quantum – anywhere you can keep parameters live in the autodiff graph.
The bottom line
Gradient‑based learning will not replace analytic solvers for every use case. When you need machine precision or extreme speed, Chao et al.'s method is still your friend. But for variational settings, end‑to‑end differentiable pipelines, or any case where your target is not a closed‑form polynomial, this repository gives you a principled, tested, and reproducible way forward.
Read the paper, run the code, and consider whether the next quantum algorithm you design might be trained rather than derived.
Citation: Peilivanidis, V. (2026). Learning Quantum Signal Processing Phase Angles via Gradient Descent. DOI: 10.5281/zenodo.20645403
Code: github.com/rosspeili/trainable-qsp-angles (Apache 2.0)
Top comments (1)
This is an excellent illustration of how statistical artifacts and collection choices can mislead conclusions, especially when working with repeated LLM outputs. I love how you identified the effective sample size, anchor effects, and payload truncation as key traps that distort apparent sector dominance. The leave-one-out analysis is particularly elegant—it turns what looked like a sector-level preference into a concrete, verifiable insight about single entities like Nubank.
I’d love to collaborate and explore this further. I work on LLM benchmarking and statistical analysis of AI outputs, and it would be great to share methods, validate results, and experiment with robust ways to aggregate and interpret AI-generated data. If you’re open to it, we could run joint experiments on prompt design, clustering, and entity-level effects to make findings more reproducible across engines.
Would you be interested in exploring a collaboration like that?