Gaussian state
In this example, We introduce the preparation of Gaussian state.
What is Gaussian state
Gaussian state is a -qubit quantum state defined as
where is the Gaussian function. Gaussian state is ubiquitous in the application of quantum algorithms in quantum chemistry, simulating quantum field theory, and quantum finance.
The equivalent problem in function approximation
One recent preprint Ref. [1] proposed a procedure for preparing Gaussian state. It leverages the block encoding of the sine value of equally spaced sample points . By applying quantum eigenvalue transformation on this block encoding, the Gaussian state is prepared. Consequently, the problem is reduced to finding the phase factors generating the following function
where transforms the domain to .
Setup parameters
beta = 100;
targ = @(x) exp(-beta/2 *asin(x).^2);
deg = 100;
opts.intervals=[0,sin(1)];
opts.objnorm = Inf;
opts.epsil = 0.01;
opts.npts = 500;
opts.fscale = 0.99;
opts.isplot=true;
opts.maxiter = 100;
opts.criteria = 1e-12;
opts.useReal = true;
opts.targetPre = true;
opts.method = 'LBFGS';
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
McArdle, S., Gilyén, A., & Berta, M. (2022). Quantum state preparation without coherent arithmetic. arXiv preprint arXiv:2210.14892.
Last updated