# Tag Info

## Hot answers tagged hhl-algorithm

### What could be the possible future applications for HHL algorithm?

A couple years ago it was shown in Quantum algorithms and the finite element method by Montanaro and Pallister that the HHL algorithm could be applied to the Finite Element Method (FEM) which is a "...
• 1,576
Accepted

### Quantum phase estimation and HHL algorithm - knowledge of eigenvalues required?

You should know a bound on the eigenvalues (both upper and lower). As you say, you can then normalise $A$ by rescaling $t$. Indeed, you should do this to get the most accurate estimate possible, ...
• 48.1k
Accepted

• 12.8k

### Source code for a Qiskit algorithm: HHL Algorithm

Qiskit is an open source. Specifically for HHL, see https://github.com/Qiskit/qiskit-aqua/blob/master/qiskit/aqua/algorithms/linear_solvers/hhl.py.
Accepted

### Clarification of the "Calculations" section of the (HHL09) paper

I know that $b$ can be decomposed mathematically as $b= c_1u_1 + > \cdots + c_nu_n$ since these eigenvectors form an orthonormal basis. Why only consider the effect on $|u_j \rangle$? As you say,...
• 48.1k

### How to speed up the matrix multiplication steps in multi-linear regression?

You were correct to seek a new quantum algorithm for this rather than just using HHL to do step 3. There are separate quantum algorithms to do regressions: Quantum Algorithm for Data Fitting (same ...
• 12.1k
Accepted

### HHL algorithm -- controlled-by-eigenvalues rotations

If $\tilde{\lambda_{k}} < C$, the controlled rotation becomes non-physical since you have coeffecient greater than 1 on your $|1\rangle$ state. As a result $C < \lambda_{min}$ is a safer choice,...
• 1,696
Accepted

### Quantum algorithm for linear systems of equations (HHL09): Step 1 - Confusion regarding the usage of phase estimation algorithm

It depends on the papers but I saw 2 approaches: In most of the papers I read about the HHL algorithm and its implementation, the Hamiltonian evolution time $t$ is taken such that this factor ...
• 4,552
Accepted

### HHL algorithm -- problem with the outcome of postselection

Your intuition is correct for a single qubit, in that if I measure $$\alpha\vert 0 \rangle + \beta\vert 1 \rangle$$ I would get either $\vert 0 \rangle$ or $\vert 1 \rangle$. But since the qubits are ...
• 1,696

### Quantum algorithm for linear systems of equations (HHL09): Step 2 - What is $|\Psi_0\rangle$?

$\newcommand{\bra}{\left\langle#1\right|}\newcommand{\ket}{\left|#1\right\rangle}\newcommand{\proj}{|#1\rangle\langle#1|}\newcommand{\half}{\frac12}$In answer to your first question, I wrote ...
• 48.1k
Accepted

### Controlled unitary from the HHL algorithm – practical implementation using Qiskit

Disclaimer: I'm the one that wrote the code of the 4x4 HHL. Controlling a quantum gate $U$ can be achieved by controlling each of the $U_i$ gates that are composing $U$. For the specific example you ...
• 4,552
Accepted

### What does $||A|| = 1$ mean in the definition of QLSP?

Certainly it is meant as the largest eigenvalue. I have no idea why the linked review paper uses the determinant. I don't see anywhere that they use that property (from an admittedly brief skim). I ...
• 48.1k
Accepted

### Using the HHL algorithm to compute $A |b \rangle$ instead of $A^{-1} |b \rangle$

Note: the graphics have been generated with the LaTeX code available here. Credits to @Niel de Beaudrap. Yes it is possible! The HHL algorithm can be schematically depicted as Let's split down the ...
• 4,552
Accepted

• 48.1k

### Quantum circuit to implement matrix exponential

You want to implement $$e^{i3\pi/4}e^{iX\pi/4}.$$ I would rewrite this as $$e^{i3\pi/4}He^{iZ\pi/4}H.$$ This is the same as $$-HS^\dagger H$$ in standard gate terminology. If you're only ...
• 48.1k
Accepted

### Quantum circuit to get expectation values of Pauli matrices, given state $|\psi\rangle$

To find the expectation value of a given Pauli matrix, you just measure in the basis defined by the Pauli matrix. For example, to evaluate the expectation value of the $X$ matrix, you find the basis ...
• 48.1k

### Problem with controlled rotation in HHL

You don't know the eigenvalues a priori, but you have performed phase estimation, and have (at least a good approximation to) your eigenvalues recorded on a register. If you control off that register, ...
• 48.1k

### New Hybrid-HHL algorithm vs VQLS

By a large margin, I would recommend VQLS rather than H-HHL. VQLS is significantly more well-tested, is a more significant leap from the previous state-of-the-art for hybrid quantum/classical linear ...
• 12.1k
There is a new approach that will be merged soon in qiskit terra (here for the PR) that uses polynomial approximation to compute $\arcsin(C/\lambda)$, and asymptotically this would be the efficient ...