The HHL quantum algorithm [1] is a procedure that addresses the resolution of linear systems of equations (QLSP). Under certain conditions, the algorithm has a logarithmic order in the number of equations, better than the faster classical method. The algorithm manages to find a quantum state proportional to the solution vector, up to a normalization factor. The disadvantage is that to determine each of the coefficients of the solution vector, the algorithm’s output quantum state must be determined with additional statistical methods, thus losing its exponential advantage. There are certain types of problems in which this disadvantage can be circumvented, the statistical treatment is unavoidable, but for certain cases such as electrical circuits, in which the main interest is to find only one of the currents, (for example the load current), we only need to measure one of the qubits of the solution state. In this article we solve the linear system associated with the currents of an electrical circuit with sinusoidal voltage, using the HHL algorithm, simulated in a Scilab numerical environment. An optimized example of an electrical line transmission wave in a real computer on the IBMQ platform, is also solved
The HHL quantum algorithm [1] is a procedure that addresses the resolution of linear systems of equations (QLSP). Under certain conditions, the algorithm has a logarithmic order in the number of equations, better than the faster classical method. The algorithm manages to find a quantum state proportional to the solution vector, up to a normalization factor. The disadvantage is that to determine each of the coefficients of the solution vector, the algorithm’s output quantum state must be determined with additional statistical methods, thus losing its exponential advantage. There are certain types of problems in which this disadvantage can be circumvented, the statistical treatment is unavoidable, but for certain cases such as electrical circuits, in which the main interest is to find only one of the currents, (for example the load current), we only need to measure one of the qubits of the solution state. In this article we solve the linear system associated with the currents of an electrical circuit with sinusoidal voltage, using the HHL algorithm, simulated in a Scilab numerical environment. An optimized example of an electrical line transmission wave in a real computer on the IBMQ platform, is also solved
Quantum computing enables the efficient resolution of complex problems, often outperforming classical methods across various applications. In 2009, Harrow, Hassidim and Lloyd proposed an algorithm for solving linear systems of equations, demonstrating exponential speedup (under ideal conditions) with a complexity of poly(logN), in contrast to classical approaches, which in the general case exhibit a complexity of O(N3), although they can achieve O(N) in specific cases involving sparse matrices. This algorithm holds promise for advancements in machine learning, the solution of differential equations, linear regression, and cryptographic analysis. However, its structure is intricate, and there is a notable lack of detailed instructional materials in the literature. In this context, this paper presents a tutorial addressing the physical and mathematical foundations of the HHL algorithm, aimed at undergraduate students, explaining its theoretical construction and its implementation for solving linear equation systems. After discussing the underlying mathematical and physical concepts, we present numerical examples that illustrate the evolution of the quantum circuit. Finally, the algorithm's complexity, limitations, and future prospects are analyzed. The examples are compared with their classical simulations, allowing for an operational assessment of the algorithm's performance.
The Poisson equation is a fundamental equation of mathematical physics that describes the potential distribution in static fields. Solving the Poisson equation on a grid is computationally intensive and can be challenging for large grids. In recent years, quantum computing has emerged as a potential approach to solving the Poisson equation more efficiently. This article uses quantum algorithms, particularly the Harrow–Hassidim–Lloyd (HHL) algorithm, to solve the 2D Poisson equation. This algorithm can solve systems of equations faster than classical algorithms when the matrix A is sparse. The main idea is to use a quantum algorithm to transform the state vector encoding the solution of a system of equations into a superposition of states corresponding to the significant components of this solution. This superposition is measured to obtain the solution of the system of equations. The article also presents the materials and methods used to solve the Poisson equation using the HHL algorithm and provides a quantum circuit diagram. The results demonstrate the low error rate of the quantum algorithm when solving the Poisson equation.
HHL algorithm is a basic quantum algorithm, which is mainly used to solve linear equations. It has a wide range of potential applications in science, engineering, finance, economics and other fields. Although the current scale of quantum computers is small, we can still demonstrate basic quantum algorithms. In this paper, taking the HHL quantum algorithm as an example, the quantum circuit of the HHL quantum algorithm corresponding to 4 qubits and 7 qubits is given, and the simulation verification is carried out on the IBM qiskit development platform. The results show that when the input matrix is a second-order matrix, the fidelity is very high, but when the input is a fourth-order matrix, the probability that the result is close to the real value is very high only when the sparsity of the matrix is relatively strong. However, when the sparsity of the input matrix is very weak, the result will be very different from the real value.
Abstract Quantum computing is a new computing mode that follows the laws of quantum mechanics to control quantum information units for computation. In terms of computational efficiency, due to the existence of quantum mechanical superposition, some known quantum algorithms can process problems faster than traditional general-purpose computers. HHL algorithm is an algorithm for solving linear system problems. Compared with classical algorithms in solving linear equations, it has an exponential acceleration effect in certain cases and as a sub-module, it is widely used in some machine learning algorithms to form quantum machines learning algorithms. However, there are some limiting factors in the use of this algorithm, which affect the overall effect of the algorithm. How to improve it to make the algorithm perform better has become an important issue in the field of quantum computing. This paper summarizes the optimization and improvement of HHL algorithm since it was proposed, and the application of HHL algorithm in machine learning, and discusses some possible future improvements of some subroutines in HHL algorithm.
After learning basic quantum computing concepts, it is desirable to reinforce the learning using an important and relatively complex algorithm through which students can observe and appreciate how qubits evolve and interact with each other. Harrow-Hassidim-Lloyd (HHL) quantum algorithm, which can solve linear system problems with exponential speed-up over the classical method and is the basis of many important quantum computing algorithms, is used to serve this purpose. The HHL algorithm is explained analytically followed by a 4-qubit numerical example in bra-ket notation. Matlab code corresponding to the numerical example is available for students to gain a deeper understanding of the HHL algorithm from a pure matrix point of view. A quantum circuit programmed using qiskit is also provided for real hardware execution in IBM quantum computers. After going through the material, students are expected to have a better appreciation of the concepts such as basis transformation, bra-ket and matrix representations, superposition, entanglement, controlled operations, measurement, quantum Fourier transformation, quantum phase estimation, and quantum programming. To help readers review these basic concepts, brief explanations augmented by the HHL numerical examples in the main text are provided in the Appendix.
Systems of linear equations are ubiquitous across science, engineering, machine learning, and even finance. While classical methods can be prohibitively slow for large-scale problems, quantum linear systems algorithms offer the potential for exponential speedup in certain parameter regimes. However, a significant gap persists between this theoretical promise and practical implementation, as the advantages are often obscured by the substantial quantum resources and high sensitivity to noise inherent in current quantum hardware. One way to bridge this gap is through the use of Iterative Refinement, a classical post-processing scheme that can exponentially improve the accuracy to which a linear system of equations can be solved using low-precision arithmetic. In the context of quantum linear systems algorithms, such as the HHL algorithm proposed by Harrow, Hassidim, and Loyd, Iterative Refinement can greatly reduce the quantum resources required to calculate an accurate solution in terms of tomography cost, circuit volume, and fault-tolerant overhead. Here, we compute and benchmark highly precise solutions to linear systems of equations of up to eight variables by running HHL with Iterative Refinement on NISQ quantum computers. We also present our open-source implementation, emphasizing that our circuit is not tailored to specific problem instances, as most available implementations are.