An Iterative Improvement Method for HHL algorithm for Solving Linear System of Equations Yoshiyuki Saito Graduate School of Computer Science and Engineering University of Aizu Aizu-Wakamatsu, Fukushima, JAPAN m5241141@u-aizu.ac.jp Xinwei Lee Graduate School of Systems and Information Engineering University of Tsukuba Tsukuba, Ibaraki, JAPAN xwlee@cavelab.cs.tsukuba.ac.jp Dongsheng Cai Faculty of Engineering, Information and Systems University of Tsukuba Tsukuba, Ibaraki, JAPAN cai@cs.tsukuba.ac.jp Nobuyoshi Asai School of Computer Science and Engineering University of Aizu Aizu-Wakamatsu, Fukushima, JAPAN nasai@u-aizu.ac.jp Abstract—We propose an iterative improvement method for the Harrow-Hassidim-Lloyd (HHL) algorithm to solve a linear system of equations. This is a quantum-classical hybrid algo- rithm. The accuracy is essential to solve the linear system of equa- tions. However, the accuracy of the HHL algorithm is limited by the number of quantum bits used to express the eigenvalues of the matrix. Our iterative method improves the accuracy of the HHL solutions, and gives higher accuracy which surpasses the accuracy limited by the number of quantum bits. In practical HHL algorithm, a huge number of measurements is required to obtain good accuracy, even if we provide a sufficient number of quantum bits for the eigenvalue expression, since the solution is statistically processed from the measurements. Our improved iterative method can reduce the number of measurements. Moreover, the sign information for each eigenstate of the solution is lost once the measurement is made, although the sign is significant. Therefore, the na¨ıve iterative method of the HHL algorithm may slow down, especially, when the solution includes wrong signs. In this paper, we propose and evaluate an improved iterative method for the HHL algorithm that is robust against the sign information loss, in terms of the number of iterations and the computational accuracy. I. I NTRODUCTION In this paper, we consider a linear system of equations Ax = b where A R N×N be Hermitian matrix and b R N . The linear system of equations is essential in a wide range of fields such as science and engineering, and we have to solve a linear system of equations both at high speed and with high accuracy. To solve it with high speed and accuracy, we focus on the structure of the matrix A (dense, sparse, symmetric, and etc.). In general, there are two types of algorithms for solving linear system of equations: iterative methods, represented by the conjugate gradient method [1], and direct methods, repre- sented by the Gauss elimination method [2]. In the iterative method, the solution converges so that the evaluation function such as the residual converge to 0. In the direct method, the solution can be obtained in the finite number of operations. The accuracies of both methods are influenced by rounding errors. However, since, in the iterative method, its calculations repeat until the residual to be zero, it can improve the accuracy even if it is influenced by the rounding-off errors. On the other hands, since the direct method ends after a finite number of operations, further improvement in accuracy is not possible. Fortunately, with the iterative improvement method in addition to the direct method allows to improve the accuracy [3]. The iterative improvement method [3] aims to improve the solution accuracy by iterative calculation in addition to the direct method. We want to try to improve the accuracy through various methods. On the other hands, in quantum computings, a quantum algorithm for a linear system of equations entitled the HHL algorithm is proposed by Harrow et al. [4]. The HHL algorithm is exponentially faster than a classical algorithm to solve a linear system of equations with sparse Hermitian matrices[5]. In addition, the HHL algorithm has been applied to the least squares method [6] and supervised machine learning [7] due to the potential speed up in quantum computers. In practical applications, when the HHL algorithm is used as a subroutine, the computational accuracy of the whole system can be limited by the HHL algorithm. Therefore, we should pay attention not only on the run time but also on the estimated accuracy of the solution. The estimated accuracy of the HHL solution depends on 1) that of the quantum state constructed by the HHL and on 2) the number of measurements. 1) The accuracy of the constructed quantum state is deter- mined both (a) by the computational accuracy of the matrix e iAt in the Hamiltonian simulation with a Hermitian matrix A, and (b) by the number of quantum bits to represent the eigenvalues of the matrix e iAt in the Quantum Phase Estimation (QPE) algorithm [8], [9]. Since the accuracy of the Hamiltonian simulation is affected by the discretization error in time t, we need to use sufficient number of time arXiv:2108.07744v1 [quant-ph] 17 Aug 2021