How to solve a linear system of equations using HHL?
For the HHL we will use QPE with U = eiAtU = eiAt, where AA is the matrix associated to the system we want to solve. In this case, eiAt = N − 1 ∑ j = 0eiλjt | uj⟩⟨uj |
Which is the best algorithm for linear system of equations?
The algorithm estimates the result of a scalar measurement on the solution vector to a given linear system of equations. The algorithm is one of the main fundamental algorithms expected to provide a speedup over their classical counterparts, along with Shor’s factoring algorithm, Grover’s search algorithm and quantum simulation.
Is the HHL algorithm suitable for a quantum simulator?
For the quantum simulator, Qiskit already provides an implementation of the HHL algorithm requiring only the matrix A and | b⟩ as inputs in the simplest example. Although we can give the algorithm a general Hermitian matrix and an arbitrary initial state as NumPy arrays, in these cases the quantum algorithm will not achieve an exponential speedup.
How is the HHL algorithm different from the classical algorithm?
This is an exponential speed up in the size of the system, however one crucial remark to keep in mind is that the classical algorithm returns the full solution, while the HHL can only approximate functions of the solution vector. 2. The HHL algorithm A. Some mathematical background
Do you need previous knowledge of HHL algorithm?
For the purpose of illustrating the algorithm, we will cheat a bit and calculate the eigenvalues of AA to be able to choose tt to obtain an exact binary representation of the rescaled eigenvalues in the nlnl -register. However, keep in mind that for the HHL algorithm implementation one does not need previous knowledge of the eigenvalues.
Can a Hermitian matrix have n different eigenvalues?
In fact, a general Hermitian matrix A of dimension N can have up to N different eigenvalues, therefore calculating them would take O(N) time and the quantum advantage would be lost. Now we are ready to go through the different steps of the HHL algorithm. State preparation in this example is trivial since | b⟩ = | 0⟩.
Is the HHL algorithm too big for an IBM computer?
HHL algorithm with a 4 x 4 matrix A might be to large for the IBM computer. I tried a smaller toy version of the algorithm according with arXiv 1302.1210 link Solving systems of linear equations Unfortunately it is only a 1 qubit input with A = 2 x 2 matrix, in the answer a link to the IBM circuit is given.