# 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]$$ which is the eigenvalue of $$A$$.

I run the QPE algorithm with 10000 shots and input the eigenstate as $$b = normalized(5,4,3,2)$$, so the target measurement counts are $$(4630, 2963, 1667, 741)$$

But I got the result $$[\hat{\lambda_1},\hat{\lambda_2},\hat{\lambda_1}',\hat{\lambda_4}, \hat{\lambda_5}] = [0.5062,0.2062,0.3,0.4875,0.6]$$ with measurement counts $$(3180, 2045, 1654, 816, 726)$$ times respectively (with other ignorable results).

I think $$0.5$$ eigenvalue was measured as two different corresponding $$\hat{\lambda_1}, \hat{\lambda_1}'$$, where one is correct and the other is wrong.

But HHL algorithm requires rotation by the parameter $$\widetilde{\lambda_j}$$ corresponding $$b_j$$. If the QPE is not perfect, is it the wrong $$\hat{\lambda_k}$$ multiplied to $$b_j$$ where $$k\neq j$$??

In my example, does the wrong $$\hat{\lambda_1}'$$ affect the solution??

The HHL algorithm result is proportional to $$\sum_{j=1}^{2^2}b_j \frac{C}{\lambda_j}|u_j\rangle$$. So, does the algorithm calculate $$b_1 \frac{C}{\lambda_1}|u_1\rangle+b_2 \frac{C}{\lambda_2}|u_2\rangle+b_3 \frac{C}{\lambda_1'}|u_3\rangle+b_4 \frac{C}{\lambda_3}|u_4\rangle$$??