Abstract
We establish an improved classical algorithm for solving linear systems in a model analogous to the QRAM that is used by quantum linear solvers. Precisely, for the linear system , we show that there is a classical algorithm that outputs a data structure for allowing sampling and querying to the entries, where is such that . This output can be viewed as a classical analogue to the output of quantum linear solvers. The complexity of our algorithm is $\widetilde{O}(\kappa_F^4 \kappa^2/\epsilon^2 )\kappa_F = \|A\|_F\|A^{+}\|\kappa = \|A\|\|A^{+}\|$. This improves the previous best algorithm [Gily{\'e}n, Song and Tang, arXiv:2009.07268] of complexity $\widetilde{O}(\kappa_F^6 \kappa^6/\epsilon^4)$. Our algorithm is based on the randomized Kaczmarz method, which is a particular case of stochastic gradient descent. We also find that when is row sparse, this method already returns an approximate solution in time , while the best quantum algorithm known returns in time when is stored in the QRAM data structure. As a result, assuming access to QRAM and if is row sparse, the speedup based on current quantum algorithms is quadratic.