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 , its inverse and the controlled reflection operators , . is of our interest and has a singular value decomposition . For let be the matrix obtained from by replacing all diagonal entries by 1 and all diagonal entries by 0. We define and similarly . For example, set and projects out right singular vectors with singular value at most . These threshold projectors play a major role in quantum algorithms.
The equivalent problem in function approximation
As an example, we implement . We need to implement singular value transformation of for the following rectangle function. We call a subroutine to find the best even polynomial approximating on the interval 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
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).
Dong, Y., Meng, X., Whaley, K. B., & Lin, L. (2021). Efficient phase-factor evaluation in quantum signal processing. Physical Review A, 103(4), 042419.
Last updated