Skip to main content

View on GitHub

Open this notebook in GitHub to run it yourself
In this notebook we present three ways of approximating the inverse function with Chebyshev polynomials in some spectral interval S=[1,1κ][1κ,1],S= \left[-1,\, -\frac{1}{\kappa}\right] \cup \left[\frac{1}{\kappa},\, 1\right], given the polynomial degree:
  1. Optimized relative error (optimized_rel): the polynomial p(y)p(y) minimizing
maxySyp(y)1.\max_{y\in S}|y\,p(y)-1|.
  1. Optimized uniform error (optimized_uni): the polynomial p(y)p(y) minimizing
maxySp(y)1/y.\max_{y\in S}|p(y)-1/y|.
  1. CKS trimmed (cks_trimmed): polynomial approximation of the inverse function from the original CKS paper [1], trimmed to the target degree.
The polynomial transformation is given by 1yP(y)=j=0(d1)/2(1)jajT2j+1(y)\Large \frac{1}{y} \approx P(y) = \sum^{(d-1)/2}_{j=0} (-1)^j a_j T_{2j+1}(y) The first two cases are available in Classiq QSP application (see the poly_inversion function). In addition, we consider an approximated transformation, perturbing the polynomial coefficients of those theoretical expansions. This is relevant for reducing gate count in Approximated Chebyshev-LCU quantum linear solvers.

Chebyshev polynomials expansions for different types of error bound definitions

We upload some matrix, and consider its block-encoding. We need the block-encoding scaling factor in order to calculate the effective spectral range of singular-values.
Output:
Output:
output

Chebyshev polynomials expansions with non-exact coefficients

We obtain the approximated coefficients loaded by approximate state preparation. This block enters as the PREPARE part in the Chebyshev-LCU approach.
Output:
Output:
Output:
Output:
Output:
Output:
Next, we plot the approximated coefficients and the resulting polynomial. We can see that for rough approximation, which reduces quantum resources for loading the coefficients on a quantum variable, still gives a good fit.
output

References

[1] Andrew M. Childs, Robin Kothari, and Rolando D. Somma. Quantum algorithm for systems of linear equations with exponentially improved dependence on precision. SIAM Journal on Computing, 46:1920, 2017.