Skip to main content
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.

Filter by
Sorted by
Tagged with
1 vote
0 answers
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 ...
Manish Kumar's user avatar
1 vote
1 answer
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 ...
super_mario's user avatar
4 votes
1 answer
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 ...
Manish Kumar's user avatar
1 vote
1 answer
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 ...
quantipai's user avatar
1 vote
0 answers
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]$ ...
Nyyni's user avatar
  • 33
2 votes
2 answers
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, ...
Nyyni's user avatar
  • 33
3 votes
1 answer
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 ...
Medulla Oblongata's user avatar
4 votes
1 answer
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 ...
Mark Spinelli's user avatar
5 votes
0 answers
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 ...
Subhradeep Sarkar's user avatar
3 votes
0 answers
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 ...
brett037's user avatar
4 votes
0 answers
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 ...
Mark Spinelli's user avatar
3 votes
1 answer
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 ...
Noé Bosc-Haddad's user avatar
1 vote
1 answer
105 views

How to read the result of this HHL algorithm circuit output?

I have computed the final states of a 1-qubit HHL circuit using initial conditions $$ A|x\rangle = |b\rangle$$ $$\begin{bmatrix} 8 & 6+i \\ 6-i & -1\end{bmatrix} |x\rangle = \begin{bmatrix} \...
James's user avatar
  • 491
3 votes
2 answers
123 views

What is the algebraic result of the matrix exponential operation $e^{i A}|b\rangle$?

The circuit for the HHL algorithm looks as follows: I am uncertain what is the algebraic operation of the matrix exponential $e^{i A}$ on $|b\rangle$? If $$|b\rangle = b_0|0\rangle + b_1|1\rangle$$ ...
James's user avatar
  • 491
4 votes
1 answer
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 ...
wondering's user avatar
  • 263
4 votes
2 answers
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 ...
peckinpah's user avatar
1 vote
1 answer
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 ...
random person's user avatar
1 vote
0 answers
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? ...
Марина Лисниченко's user avatar
3 votes
1 answer
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 ...
Dominik Vereno's user avatar
2 votes
1 answer
138 views

Is a diagonal matrix with one non-zero element a measurable observable?

The HHL algorithm prepares the output state $|x\rangle$. However, we cannot efficiently measure the state directly to get its components. Instead, we can construct an operator $M$ to find $\langle x|M|...
Dominik Vereno's user avatar
0 votes
1 answer
144 views

hhl algorithm output

I'm trying to implement the HHL algorithm for the matrix and vecor as follows: $ A = \begin{bmatrix} 11 & 5 & -1 & -1 \\ 5 & 11 & 1 & 1 \\ -1 & 1 & 11 & -5 \\ -1 &...
Марина Лисниченко's user avatar
4 votes
1 answer
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?
bonsh's user avatar
  • 41
1 vote
1 answer
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 ...
dnnagy's user avatar
  • 141
2 votes
0 answers
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 ...
Martin Vesely's user avatar
4 votes
1 answer
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 ...
saliha majeed's user avatar
2 votes
0 answers
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 ...
mr.creme's user avatar
1 vote
0 answers
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 ...
Markivaira's user avatar
1 vote
0 answers
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, ...
ctimms137's user avatar
0 votes
0 answers
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 ...
saliha majeed's user avatar
2 votes
1 answer
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 ...
ctimms137's user avatar
1 vote
0 answers
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?
João Eudes Lima's user avatar
2 votes
1 answer
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 ...
Cuhrazatee's user avatar
4 votes
1 answer
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 ...
BBB's user avatar
  • 43
2 votes
0 answers
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 ...
Arnav Singh's user avatar
3 votes
1 answer
196 views

Is it possible to compute a matrix inverse for an arbitrary matrix within a subroutine?

Suppose I want solve a lower diagonal linear system of equations given in block form by $ \left( {\begin{array}{cccc} I & 0 & \cdots & 0 &0\\ M & I & \cdots & 0 &...
thespaceman's user avatar
1 vote
2 answers
231 views

How to extract a solution to HHL from the full statevector?

I am having a difficult time trying to extract an HHL matrix inversion solution from the full system statevector. I have a 32x32 size matrix A and a 32x1 vector b, and I ran HHL on 13 qubits. HHL ...
Anupama Raghunathan's user avatar
4 votes
0 answers
125 views

Is the exponential speedup and output $\langle x|M|x\rangle$ in contradiction in HHL algorithm?

Isn't the exponential speedup and the output $\langle x|M|x\rangle$ in contradiction in HHL algorithm? How can we print the solution vector $|x\rangle$ without losing the exponential speedup?
Mark234's user avatar
  • 51
3 votes
1 answer
139 views

Which observable $M$ provides the Absolute Average of a statevector?

My question should be fairly simple, though I did not find an answer to it here or anywhere else. I have been working on an algorithm which, similarly to the HHL algorithm, provides a state $|x\rangle$...
João Alves's user avatar
1 vote
0 answers
51 views

Plots of the result for the qiskit HHL tutorial

Could anyone make explicit the code which gives the two plots at the end of the HHL tutorial. They show the results of the jobs on a real IBM quantum device.
Holger's user avatar
  • 161
4 votes
1 answer
313 views

HHL - the result is correct for one matrix but wrong for another one

I tried to run HHL algorithm in new version of Qiskit (0.29). Firstly I tried to solve a diagonal system 4x4 with matrix [[1,0,0,0],[0,2,0,0],[0,0,3,0],[0,0,0,4]] ...
Martin Vesely's user avatar
2 votes
1 answer
566 views

"Classical" phase estimation versus iterative phase estimation

In the article Arbitrary accuracy iterative phase estimation algorithm as a two qubit benchmark, the authors introduced implementation of phase estimation with two qubits only. The trick that bits ...
Martin Vesely's user avatar
3 votes
1 answer
231 views

Combining Amplitude Amplification with HHL

I'm recently learning about how to apply Grover search techniques to other places. An example I've come across is to amplify the probability of measure a $\lvert 1 \rangle$ of the ancilla qubit in HHL ...
genesis gcd's user avatar
2 votes
0 answers
69 views

Difference in HLL applications

I am new to Qiskit and I have seen two types of simple 2X2 $Ax=b$ system solutions. I am wondering what the difference is exactly. They both occur on a simulator backend, but the first gives me a ...
Corey's user avatar
  • 127
7 votes
0 answers
320 views

Solving linear system $Ax=b$ with exponential speed-up via binary optimization?

The main disadvantage of HHL algorithm for solving $A|x\rangle = |b\rangle$ is that exponential speed-up is reached only in case we are interested in value $\langle x|M|x\rangle$, where $M$ is a ...
Martin Vesely's user avatar
6 votes
0 answers
123 views

What is the largest linear system of equations solved using HHL experimentally?

Can someone tell what is the largest system of equations solved using HHL algorithm experimentally? I know the $8$ x $8$ system has been solved experimentally. Has someone gone beyond this to solve $...
quankid's user avatar
  • 303
3 votes
1 answer
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 ...
Martin Vesely's user avatar
4 votes
0 answers
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, ...
Simona99's user avatar
  • 180
1 vote
1 answer
339 views

In the HHL alghoritm, how can I transform my hermitian matrix into a unitary operator?

I'm studying the HHL algorithm and I'm trying to do an his implementation but, there are some points that I don't understand how I can transform my hermitian Matrix into its unitary operator? In ...
Simona99's user avatar
  • 180
2 votes
2 answers
417 views

Question on qiskit.circuit.library.PiecewiseChebyshev Qiskit circuit library

This question follows the post https://quantumcomputing.stackexchange.com/posts/15070/. I am working on an implementation of HHL algorithm, to do so, I need to map $|\lambda\rangle\mapsto |\arcsin(\...
SRichoux's user avatar
  • 319
5 votes
1 answer
192 views

I don't understand unitary of ${e^{iAt}}$ from HHL algorithm

I tried to implement the following circuit in the image below but with the red circled gates replaced with a unitary controlled ${e^{iAt/2}}$ and controlled ${e^{iAt/4}}$ The image came from this ...
Tanin Imanothai's user avatar