quantumlib / Qualtran

Qᴜᴀʟᴛʀᴀɴ is a Python library for expressing and analyzing Fault Tolerant Quantum algorithms.
https://qualtran.readthedocs.io/en/latest/
Apache License 2.0
138 stars 37 forks source link

[GQSP] Optimally scaling polynomial approximations #860

Open anurudhp opened 4 months ago

anurudhp commented 4 months ago

Context: P is a QSP polynomial if $|P(e^{i\theta})| \le 1$ for every $\theta \in [0, 2\pi)$.

When computing polynomial approximations for functions (that have infinite series), the polynomials may end up having max abs. value on the complex unit circle larger than 1, even if the actual function's absolute value is always at most 1 on the unit circle.

Current fix (https://github.com/quantumlib/Qualtran/pull/851) evaluate polynomial on (2**17 ~= 1.3e5) uniformly spaced points on the complex unit circle to compute the maximum absolute value, and scale down P by that.

Issues:

If anyone has ideas for correct and more efficient ways to compute the optimal scaling, please do share!

cc @tanujkhattar @skushnir123 @NoureldinYosri @ncrubin

NoureldinYosri commented 4 months ago

how large is the degree of the polynomial?

anurudhp commented 4 months ago

The current simulation tests use up to ~ 300. We would ideally want to test it on degrees upto 1e7.