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.
116
questions
1
vote
1
answer
63
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
49
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 &...
3
votes
1
answer
50
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
39
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
25
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 ...
3
votes
1
answer
129
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
73
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
52
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
68
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
78
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
122
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
28
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
72
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 ...
0
votes
0
answers
27
views
HHL: What are those xor's for in the ancilla rotation
I'm working my way through the HHL algorithm. Several text books and also the reference
Cirq Implementation perform an xor computation to determine where to place X-gates. I'm confused by both the ...
4
votes
1
answer
128
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
52
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
118
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
127
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
115
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
101
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
33
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
223
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]] ...
1
vote
1
answer
314
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
150
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
47
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
224
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 ...
5
votes
0
answers
91
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
198
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 ...
3
votes
0
answers
66
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
201
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
313
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
135
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
150
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
259
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
519
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
142
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
318
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 ...
4
votes
1
answer
261
views
HHL algorithm, How to implement exp(iAt) gates?
From this paper Quantum Circuit Design for Solving Linear Systems of Equations, in figure 4
The paper shows what inside operator $e^{-iAt}$ but didn't shows how to connect the control qubit (register ...
1
vote
0
answers
80
views
Why does solving linear systems of equations with HHL return imaginary numbers? [closed]
The textbook shows an example system of linear equations $Ax=b$ with
$$
A=\begin{pmatrix}
-\frac{1}{3} & 1 \\
1 & -\frac{1}{3}
\end{pmatrix} \,\,\,\,
b=\begin{pmatrix}
0 \\
1
\end{pmatrix}.
$$
...
3
votes
1
answer
137
views
Efficient QFT-based QPEA complexity
The HHL algorithm lies on an implementation of the Quantum Phase Estimation algorithm. One popular implementation is based on the Quantum Fourier Transform which can be divided in three steps. Let $U$ ...
5
votes
1
answer
321
views
HHL algorithm, How can I get result from register $|b\rangle$?
From the paper A survey on HHL algorithm: From theory to application in quantum machine learning ,
I use qasm code from here.
I try to follow the example in page 7. with Ax = b
and
the answer x ...
3
votes
1
answer
201
views
HHL and choice of observable for calculating the expectation value thereof
The chapter about solving linear systems in the qiskit textbook describes the last (6th) step of the HHL algorithm as follows
Apply an observable $M$ to calculate $F(x):=\langle x |M|x\rangle$.
How ...
-3
votes
1
answer
75
views
Query on the HHL Algorithm in the Qiskit Aqua Library [closed]
This is a question regarding the Qiskit Aqua package. I have been studying HHL algorithm from QISKIT textbook and after understanding the math I finally got to the code part, I am having a hard time ...
9
votes
2
answers
214
views
How to recover the normalization constant of the HHL solution
HHL solves the linear equation $Ax=b$ by the quantum state $|x\rangle=A^{-1} |b\rangle$. However, the quantum state $|x\rangle$ is normalized and thus diffs a normalization constant from the solution ...
3
votes
1
answer
349
views
Gate-level implementation of Eigenvalue-Inversion in HHL
I am trying to understand how does the gate-level implementation of eigenvalue-inversion step in the HHL algorithm works.
I am following this reference, where it is stated (Lemma 4) that this can be ...
4
votes
1
answer
362
views
How to effectively compute eigenvalue rotation in HHL
In the HHL algorithm, how do you efficiently do the $\lambda-$controlled rotation on the ancillary qubit ? It seems to me after reading around some answers that this can be done in two steps :
First, ...
8
votes
1
answer
163
views
Why is HHL the popular choice to solve QLSP and not the Childs et al. (2017) algorithm?
The Childs, Kthari, and Rolando (2017) (CKS) algorithm can solve the quantum linear systems problem (QLSP) in $\operatorname{poly}(\log N, \log(1/\epsilon))$ time while the HHL algorithm solves it in $...
2
votes
1
answer
228
views
Given a matrix, how do I proceed with the quantum phase estimation algorithm and choose $\theta$?
Given a matrix, say $\begin{bmatrix} 1.5 & 0.5\\
0.5& 1.5
\end{bmatrix}$, with eigenvalues $1$ and $2$, how do I proceed with the quantum phase estimation algorithm?
In particular, how do I ...
0
votes
1
answer
171
views
Qiskit HHL algorithm BrokenProcessPool error
I try to run HHL algorithm on qasm_simulator. I took the example from here. I try to solve 8x8 random matrix and adjust some parameters in create_eigs.
...
4
votes
0
answers
52
views
In the HHL algorithm, how large should the eigenvalue estimation register be?
In the HHL algorithm, we need to estimate the eigenvalues of a matrix $A$. The result is stored in a register with $l$ qubits. Let $T = 2^l$. $T$ cannot be too small, otherwise the result would have a ...