QSPPACK
  • Homepage
  • Examples
    • Quantum linear system problems
    • Negative power function
    • Quantum Hamiltonian simulation
    • Quantum Gaussian filter
    • Singular value threshold projector
    • Singular vector transformation
    • Uniform singular value amplification
    • Gaussian state
    • Kaiser window state
    • Gibbs state
Powered by GitBook
On this page
  • What is uniform singular value amplification
  • The equivalent problem in function approximation
  • Set up parameters
  • Solving phase factors by running the solver
  • Verifying the solution
  • Reference
  1. Examples

Uniform singular value amplification

In this example, We introduce the implementation of uniform singular value amplification.

What is uniform singular value amplification

Uniform singular value amplification uniformly amplifies the singular values of a matrix represented as a projected unitary. Suppose that we have access to a unitary UUU, its inverse U†U^\daggerU† and the controlled reflection operators (2Π−I)(2\Pi-I)(2Π−I), (2Π~−I)(2\tilde{\Pi}-I)(2Π~−I). A:=Π~UΠA:=\tilde{\Pi} U\PiA:=Π~UΠ is of our interest and has a singular value decomposition A=WΣVA=W\Sigma VA=WΣV.

The equivalent problem in function approximation

The goal of uniform singular value amplification is to implement the singular value transformation of AAA for function f(x)f(x)f(x). Here, f(x)f(x)f(x) is linear function λx\lambda xλx over some interval and takes value zero for other xxx.

For numerical demonstration, we consider target function to be

f(x)=x/a,x∈[0,a],a=0.2.f(x)=x/a, \quad x\in[0,a], \quad a=0.2.f(x)=x/a,x∈[0,a],a=0.2.

To numerically find the best odd polynomial approximating f(x)f(x)f(x), we use a subroutine which solves the problem using convex optimization. We first set the parameters of the subroutine.

For numerical demonstration, we scale the target function by a factor of 0.90.90.9, to improve the numerical stability.

We call a subroutine to find the best odd polynomial approximating f(x)f(x)f(x) on the interval Da=[0,a]D_a = [0, a]Da​=[0,a], where we solves the problem by convex optimization. Here are the parameters set for the subroutine.

a = 0.2;
targ = @(x) x/a;

deg = 101;
parity = mod(deg, 2);
delta =0.01;
opts.intervals=[0,a];
opts.objnorm = Inf;
% opts.epsil is usually chosen such that target function 
% is bounded by 1-opts.epsil over D_delta 
opts.epsil = 0.01;
opts.npts = 500;
opts.fscale = 0.9;
opts.isplot=true;

coef_full=cvx_poly_coef(targ, deg, opts);
% The solver outputs all Chebyshev coefficients while we have to post-select 
% those of odd order due to the parity constraint.
coef = coef_full(1+parity:2:end);

Set up parameters

We use Newton method for solving phase factors. The parameters of the solver is initiated as follows.

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

Solving phase factors by running the solver

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

Verifying the solution

We verify the solved phase factors by computing the residual error in terms of l∞l^{\infty}l∞ norm.

xlist1 = linspace(0,a-delta,500)';
xlist2 = linspace(a+delta,1,500)';
xlist = cat(1, xlist1,xlist2);
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')
print(gcf,'uniform_singular_value_amplification_error.png','-dpng','-r500');

Reference

  1. Gilyén, A., Su, Y., Low, G. H., & Wiebe, N. (2019, June). Quantum singular value transformation and beyond: exponential improvements for quantum matrix arithmetics. In Proceedings of the 51st Annual ACM SIGACT Symposium on Theory of Computing (pp. 193-204).

  2. Dong, Y., Meng, X., Whaley, K. B., & Lin, L. (2021). Efficient phase-factor evaluation in quantum signal processing. Physical Review A, 103(4), 042419.

Output of the code
norm error = 6.22653e-06
max of solution = 0.992105
iter          err
   1  +7.4719e-01 
   2  +2.1185e-01 
   3  +4.7890e-02 
   4  +5.7683e-03 
   5  +1.5395e-04 
   6  +1.3721e-07 
Stop criteria satisfied.
The residual error is
   7.3552e-14
PreviousSingular vector transformationNextGaussian state

Last updated 1 year ago

Polynomial approximation of the target function
Polynomial approximation error
The point-wise error of the solved phase factors.