Singular value threshold projector

In this example, We introduce the implementation of singular value threshold projector.

What is singular value threshold projector

Singular value threshold projectors project out singular vectors with singular values below/above a certain threshold. Suppose that we have access to a unitary UU, its inverse UU^\dagger and the controlled reflection operators (2ΠI)(2\Pi-I), (2Π~I)(2\tilde{\Pi}-I). A:=Π~UΠA:=\tilde{\Pi} U\Pi is of our interest and has a singular value decomposition A=WΣVA=W\Sigma V. For SRS\subset R let ΣS\Sigma_S be the matrix obtained from Σ\Sigma by replacing all diagonal entries ΣiiS\Sigma_{ii}\in S by 1 and all diagonal entries ΣiiS\Sigma_{ii}\notin S by 0. We define ΠS:=ΠVΣSVΠ\Pi_S:=\Pi V\Sigma_S V^{\dagger}\Pi and similarly Π~S:=Π~WΣSWΠ~\tilde{\Pi}_S:=\tilde{\Pi} W\Sigma_S W^{\dagger}\tilde{\Pi}. For example, set S=[0,δ]S=[0,\delta] and ΠS\Pi_S projects out right singular vectors with singular value at most δ\delta. These threshold projectors play a major role in quantum algorithms.

The equivalent problem in function approximation

As an example, we implement Π[0,0.5]\Pi_{[0,0.5]}. We need to implement singular value transformation of AA for the following rectangle function. We call a subroutine to find the best even polynomial approximating f(x)f(x) on the interval Dδ=[0,0.5δ][0.5+δ,1].D_{\delta}=[0, 0.5-\delta]\cup [0.5+\delta,1]. We solve the problem by convex optimization. Here are the parameters set for the subroutine.

Set up parameters

opts.intervals=[0,0.5-delta,0.5+delta,1];
opts.objnorm = Inf;
opts.epsil = 0.1;
opts.npts = 500;
opts.isplot= true;
% scaling factor for the infinity norm
opts.fscale = 0.9;
opts.maxiter = 100;
opts.criteria = 1e-12;
opts.useReal = false;
opts.targetPre = true;
opts.method = 'Newton';

Solving polynomial approximation

targ = @(x) rectangularPulse(-0.5,0.5,x);
% Compute its Chebyshev coefficients. 
parity = 0;
deg = 250;
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);

Solving phase factors by running the solver

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

Verifying the solution

xlist1 = linspace(0,0.5-delta,500)';
xlist2 = linspace(0.5+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,'singular_value_threshold_projectors_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.5514e-08
max of solution = 0.9
iter          err
   1  +4.8369e-01 
   2  +1.9791e-01 
   3  +2.7179e-02 
   4  +3.0099e-04 
   5  +3.2263e-08 
Stop criteria satisfied.
The residual error is
   3.3529e-14

Last updated