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.
129
questions
3
votes
1
answer
50
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 ...
4
votes
1
answer
71
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 ...
3
votes
0
answers
43
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 ...
3
votes
0
answers
42
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 ...
4
votes
0
answers
43
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 ...
3
votes
1
answer
96
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
1
answer
65
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} \...
2
votes
2
answers
114
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$$ ...
4
votes
1
answer
64
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 ...
3
votes
2
answers
559
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
1
answer
65
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
0
answers
77
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?
...
3
votes
1
answer
90
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 ...
0
votes
0
answers
64
views
HHL Algorithm for Classical Syndrome Decoding
Classical Syndrome decoding involves finding the e vector for the given syndrome s and Parity Check matrix H i.e., H.e' = s. This while implemented trying HHL Quantum Algorithm gives error after ...
2
votes
1
answer
114
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|...
0
votes
1
answer
105
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 &...
4
votes
1
answer
91
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?
1
vote
1
answer
84
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 ...
2
votes
0
answers
47
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 ...
4
votes
1
answer
195
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 ...
2
votes
0
answers
82
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 ...
1
vote
0
answers
120
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
0
answers
95
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, ...
0
votes
0
answers
157
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 ...
2
votes
1
answer
131
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
0
answers
49
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?
2
votes
1
answer
182
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 ...
4
votes
1
answer
167
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 ...
2
votes
0
answers
68
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 ...
3
votes
1
answer
168
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 &...
1
vote
2
answers
192
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 ...
4
votes
0
answers
121
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?
3
votes
1
answer
122
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$...
1
vote
0
answers
44
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.
4
votes
1
answer
271
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]] ...
2
votes
1
answer
495
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 ...
3
votes
1
answer
204
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 ...
2
votes
0
answers
62
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 ...
6
votes
0
answers
294
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 ...
6
votes
0
answers
109
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 $...
3
votes
1
answer
345
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 ...
4
votes
0
answers
77
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, ...
1
vote
1
answer
262
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 ...
2
votes
2
answers
393
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(\...
5
votes
1
answer
166
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 ...
3
votes
1
answer
176
views
Function in Qiskit to get the quantum circuit
Is there any way to view the quantum circuit of pre implemented quantum algorithm in Qiskit?
In the Qiskit textbook, there is an example given for HHL algorithm. Is there any function in Qiskit which ...
3
votes
2
answers
384
views
Source code for a Qiskit algorithm: HHL Algorithm
Is it possible to view the source code of one of the Qiskit's algorithm?
Actually, I am trying to find how Qiskit implements the HHL algorithm. I want to see the source code for this algorithm.
5
votes
1
answer
665
views
Quantum Circuit for $e^{iAt}$ Hamiltonian Simulation in HHL algorithm
In HHL algorithm, there is a step in Quantum Phase Estimation where we have to apply powers of $e^{iAt}$ to the register (see pic). I am not able to understand how to find the quantum circuit ...
1
vote
0
answers
179
views
In HHL algorithm, how to find the angle of rotation of ancilla qubits?
In HHL algorithm, after the quantum phase estimation, what is the angle of rotation i.e. what is the value of $\theta$ in R$_y$($\theta$) that is used in rotating ancilla qubit? How to find this angle ...
9
votes
2
answers
400
views
Quantum implementation of arcsin
I am looking to implement a quantum version of the arcsinus function. Such a problem is motivated by the HHL algorithm where $x\mapsto 1/x$ and $\arcsin$ can be used to get $1/x$ from the ...