Share Your Experience: Take the 2024 Developer Survey

# Questions tagged [hhl-algorithm]

For questions related to the quantum algorithm for inverting linear systems of equations, developed by Harrow, Hassidim and Lloyd in 2009.

134 questions
Filter by
Sorted by
Tagged with
1 vote
49 views

### What is the intuition behind achieving Quantum advantage in simulating non-hermitian dynamics using Quantum computer?

There have been several works on simulating ODE for classical systems like here and here. They are quantum techniques to solve the ODE related to classical systems. A generic methodology is: To solve ...
• 657
1 vote
32 views

### Quantum algorithm for systems of linear equations with exponentially improved dependence on precision

For Quantum algorithm for systems of linear equations with exponentially improved dependence on precision, any idea why "we need oracle access to the nonzero entries of the rows and columns of A ...
140 views

### Optimal dependency of HHL (or any QLSP) algorithm on condition number $\kappa$

This is conserning the optimal dependency on condition number for Quantum linear system problem (QLSP). For solving QLSP, the HHL (algorithm) paper mentions any polylog($\kappa$) quantum algorihm ...
• 657
1 vote
841 views

### No module named 'qiskit.algorithms.linear_solvers'

I am trying to execute HHL algorithm. I referred to the code from https://quantumpedia.uk/quantum-algorithm-4-hhl-algorithm-for-linear-systems-of-equations-40619daec41d. I tried implementing all the ...
1 vote
49 views

### Can I get valid solution with HHL algorithm even if the QPE is not completely correct?

Can I get the valid solution of linear problem using HHL algorithm even if the QPE is not completely correct? My example is $A=diag(0.5, 0.2, 0.3, 0.6)$, so the solution is $[0.5, 0.2, 0.3, 0.6]$ ...
• 33
70 views

### How to estimate the negative amplitude of multiple qubits?

The probability of measurement is the square of amplitude. After measurement, how to guess the original amplitude of state?? For example, in linear problem, we would like to know the exact solution, ...
• 33
79 views

### Role of qubit registers in HHL circuit

I'm trying to figure out how the HHL algorithm works from reading Dervovic's paper and IBM's tutorial. Dervovic shows the following HHL circuit in Fig 5: whereas IBM uses: I want to clarify the IBM ...
100 views

### Can we efficiently run HHL on a computational basis state without violating the BBBV theorem?

Recall that the linear systems algorithm of Harrow, Hassidim, and Lloyd purports to find a quantum state $|x\rangle$ proportional to $\vec x$, where $\vec x$ satisfies $A\vec x=\vec b$. In addition ...
• 12.5k
78 views

### What is the total number of qubits required for the Harrow-Hassidim-Lloyd algorithm?

I am fairly new to Quantum Computing and I know a bit of Linear Algebra. I am currently working on the HHL algorithm, I'm having confusion as to how many qubits are actually required in the circuit ...
87 views

### How to achieve the controlled rotation in the HHL algorithm

I'm trying to implement the HHL algorithm generally for any 2 x 2 hermitian matrix, but I'm having trouble with the implementation of the controlled rotation of the ancilla qubit. I've read very many ...
• 31
55 views

### We take the reciprocal $\lambda^{-1}$ of eigenvalues in HHL - but what's stopping us from raising them to a positive exponent $\lambda^m$?

The HHL algorithm generally can be thought of as diagonalizing our matrix $A$ with the quantum phase estimation algorithm, and applying a specific function $f(\lambda)=\lambda^{-1}$ to the eigenvalues ...
• 12.5k
198 views

### Determining the number of qubits to represent the eigenvalues in HHL algorithm?

I am trying to understand how well the HHL algorithm would scale. Therefore my first inquiry is how the number of qubits scale with the size of the problem ie the size of the Matrix A in the linear ...
1 vote
105 views

• 491
74 views

### How is $\vec{b}$ loaded in terms of computational basis if we don't know the eigenvectors $\vec{u}_i$ of A?

In HHL, vector $\vec{b}$ is assumed to be decomposed in the eigenbasis {$u_i$}$_{i=1}^n$ of a Hermitian matrix $A$. However, as we do not calculate explicitly the eigenvectors $u_i$ in course of the ...
• 263
1k views

### Why was the HHL algorithm removed from the qiskit library?

I am a beginner in quantum computing and I was meddling with HHL algorithm for my class project. Turns out the linear solver algorithms (mainly HHL algorithm) are removed from qiskit library (see ...
1 vote
75 views

### How to construct the matrix in the equation $Ax=b$ in the HHL algorithm?

I am trying to apply the HHL algorithm to a fluid mechanics problem, but I can't figure how to construct the matrix for the equation $Ax=b$. Specifically, I am trying to reproduce this paper in code ...
1 vote
112 views

### HHL phase estimation step

I have got an HHL circuit that looks as follows: In the phase estimation part we are trying to find the eigenvalues of the matrix A. But what is the role of the piece of circuit hightlighted below? ...
112 views

### HHL Algorithm: How to compute the signs of the solution vector

Let us assume we have used the HHL algorithm to approximately prepare $|x\rangle$, where $|x\rangle$ is a normalized quantum state corresponding to $\vec{x}$, the solution of a system of linear ...
138 views

112 views

### HHL for the pseudoinverse in Qiskit

The HHL algorithm can be modified to compute the pseudoinverse of $A$ as is shown here and here. Is there anyway to do this in Qiskit without coding the entire thing manually?
• 41
1 vote
132 views

### Confusing notation in Block-Encoding

I'm reading the lecture notes from Ronald de Wolf and got confused at the part where it introduces Block encoding, specifically by this notation at page 76: More generally we can define an $a$-qubit ...
• 141
60 views

### Simulation of algorithms with QFT on a classical computer

In paper The Quantum Fourier Transform Has Small Entanglement the authors showed that strong entanglement of qubits caused by QFT comes mainly from ordering the qubits. QFT itself prepares only weak ...
• 14.5k
219 views

### HHL algorithm: how running the process $N$ times gives the vector components of the solution?

In the HHL paper the authors have mentioned that if the user wants to get all the components of vector $\vec{x}$, one needs to run the process at least $N$ times, where $N$ is the dimension of the ...
86 views

### What useful information can be efficiently extracted from solutions provided by the HHL-algorithm?

The result of the HHL-algorithm is the (amplitude-encoded) solution vector $|x\rangle$. I was wondering, which useful information could be extracted from this solution without loosing the algorithms ...
• 21
1 vote
158 views

### Amplitude Amplification applied to HHL Algorithm

I’m trying to understand and implement the amplitude amplification algorithm described in the HHL paper. I’m using the cirq implementation of the HHL algorithm as my starting point. I have a couple of ...
1 vote
115 views

### Changing the eigenvalues used in HHL algorithm

For an HHL algorithm implemented exactly as depicted in Figure 2 of this paper by Dutta et. al (https://arxiv.org/abs/1811.01726), how do I go about changing the eigenvalues that they use? Obviously, ...
193 views

### Implementation of conditional Rotation on ancilla qubit in HHL

In HHL algorithm, after we have encoded the eigenvalues onto the clock register qubits, we apply conditional rotation on ancilla qubit such that it changes from $|0\rangle$ to: To achieve this ...
135 views

### I think I’m having endianness problems replicating the results of this paper?

So I am trying to implement the HHL algorithm depicted in this paper titled 'Quantum Circuit Design for Solving Linear Systems of Equations' by Cao et. al (https://arxiv.org/abs/1110.2232v2), but if I ...
1 vote
61 views

### What is the implementation of AQE on classic?

I want run the HHL, but if the matrices are big, I need to use HHL hybrid, but I was not able to found an implementation or pseudo algorithm of AQE or HHL hybrid. Any solution?
224 views

### HHL for non power of 2 matrix

I'm trying to see how HHL does on a series of matrices coming from a linear problem I'm interested in. These matrices are always square, real, and symmteric. They are not, however, very often exactly ...
• 670
182 views

### Representation of a vector in the HHL algorithm

Reading about the HHL algorithm, which is used to solve the equation $Ax=b$, on Wikipedia, they say to represent $b$ as $|b\rangle=\sum_{i \mathop =1}^N b_i|i\rangle.$ I'm assuming $b$ is a vector ...
• 43
77 views

### How to extract solution from HHL statevector on qskit?

I want to extract the HHL solution from the StateVector. I am doing this on a $4\times4$ matrix. For a $2$ by $2$ the solution is available in the StateVector $8$, $9$. However for a $4$ by $4$ matrix ...
196 views

• 303
412 views

### HHL algorithm for linear systems with a real matrix and a real right side

HHL algorithm can be used for solving linear system $A|x\rangle=|b\rangle$. If we put $|b\rangle$ (to be precise its normalized version) into the algorithm and measuring ancilla to be $|1\rangle$ we ...
• 14.5k
90 views

### What are the correct eigenvalues to use in controlled rotation in HHL?

I'm studying the HHL algorithm from the qiskit textbook, but I don't understand what $\lambda$ we have to use. If my matrix $A$ has eigenvalues that can be written in a binary representation, then, ...
• 180
1 vote