Hey @Dobby!

I have to admit that I’m not deeply familiar with the VQLS algorithm so this may be a bit of a learning process for us both!

Still, I am curious can the accuracy of VQLS be controlled someway?

Yes, indeed this should be the objective of the cost function - to act as a quantitative measure of the accuracy in this problem. From this part, you can see that we are picking as a cost function C_G = 1 - \vert\langle b | \Psi \rangle\vert^{2}. Minimizing this means that we are maximizing the overlap between |b\rangle and |\Psi\rangle.

If the difference is required to be smaller than some threshold (for example, 10^-6), is keeping minimizing the cost function the only way?

Yes, if we have set up the cost function in a way that captures the accuracy, then minimizing it further should help increase the accuracy. There a couple of options to help things along as the cost function becomes very small, for example we could use a more advanced optimizer that has a variable step size.

Two questions I have for you are:

- What measure of accuracy are you interested in? The cost function is an overlap/fidelity-based measure of accuracy.
- For me, the optimization is already doing quite well with a cost of order 10^{-6} after 30 iterations. What target accuracy are you thinking of aiming for?

Cheers,

Tom