Kaiser window state

In this example, We introduce the preparation of Kaiser window state.

What is Kaiser window state

The state is defined as

Ψ:=1xf(x)2x=0N1f(x)x|\Psi\rangle := \frac{1}{\sqrt{\sum_x |f(x)|^2}} \sum_{x=0}^{N-1} f(x) |x\rangle

where the amplitude is described by the Kaiser window function f(x)=I0(β1x2)I0(β)f(x) = \frac{I_0(\beta \sqrt{1-x^2})}{I_0 (\beta)}. Here, I0I_0 is the zeroth modified Bessel function of the first kind. The Kaiser window function can be used in quantum phase estimation to boost the success probability without (coherently) calculating the median of several phase evaluations.

The equivalent problem in function approximation

One recent preprint Ref. [1] proposed a procedure for preparing Kaiser window state. It leverages the block encoding of the sine value of equally spaced sample points xsin(x/N)xx\sum_x \sin(x/N)|x\rangle\langle x|. By applying quantum eigenvalue transformation on this block encoding, the Kaiser window state is prepared. Consequently, the problem is reduced to finding the phase factors generating the following function

h(z)=f(arcsin(z))I0(β1arcsin2(z)).h(z) = f(\arcsin(z)) \propto I_0(\beta \sqrt{1 - \arcsin^2(z)}).

where z=sin(x)z = \sin(x) transforms the domain to z[0,sin(1)]z\in [0,\sin(1)].

Setup parameters

beta = 8; 
targ = @(x) besselj(0,1jbetasqrt(1-2asin(x).^2))/besselj(0,1jbeta);

deg = 100; 
delta = 0.01; 
opts.intervals = [0,sin(1)]; 
opts.objnorm = Inf; 
opts.epsil = 0.01; 
opts.npts = 500; 
opts.fscale = 0.98; % scaling factor for the infinity norm 
opts.isplot = true;

opts.maxiter = 100; 
opts.criteria = 1e-12; 
opts.useReal = true; 
opts.targetPre = true; 
opts.method = 'Newton';

Approximating the target function by polynomials

coef_full=cvx_poly_coef(targ, deg, opts); 
parity = mod(deg, 2); 
% only keep coefficients with consistent parity
coef = coef_full(1+parity:2:end);

Solving phase factors by running the solver

[phi_proc,out] = QSP_solver(coef,parity,opts);

Verifying the solution

xlist = linspace(0,sin(1),500)';
func = @(x) ChebyCoef2Func(x, coef, parity, true);
targ_value = targ(xlist);
func_value = func(xlist);
QSP_value = QSPGetEntry(xlist, phi_proc, out);
err= norm(QSP_value-func_value,Inf);
disp('The residual error is');
disp(err);

figure()
plot(xlist,QSP_value-func_value)
xlabel('$x$', 'Interpreter', 'latex')
ylabel('$g(x,\Phi^*)-f_\mathrm{poly}(x)$', 'Interpreter', 'latex')

Reference

  1. McArdle, S., Gilyén, A., & Berta, M. (2022). Quantum state preparation without coherent arithmetic. arXiv preprint arXiv:2210.14892.

Output of the code
norm error = 7.95198e-10
max of solution = 0.98
iter          err
   1  +1.4954e-01 
   2  +3.1526e-02 
   3  +4.7426e-03 
   4  +2.2475e-04 
   5  +6.1800e-07 
   6  +4.7263e-12 
Stop criteria satisfied.
The residual error is
   9.1038e-15

Last updated