I am trying to understand the HHL algorithm for solving linear systems of equations (Harrow, Hassidim, Lloyd; presented in arXiv:0811.3171 and explained on page 17 of arXiv:1804.03719). By reading some papers, I think I got rough idea but there are many things I still do not understand. Let me ask some.
When applying Quantum Phase Estimation, in page 49 of the same article, it says "Prepare $n$ register qubits in $|0\rangle^{\bigotimes n}$ state with the vector $|b\rangle$", so that, by applying QPE to $|b\rangle |0\rangle^{\bigotimes n}$, we can get $\sum_j \beta_j |u_j\rangle |\lambda_j\rangle$.
And $|\lambda_j\rangle$ is the $j^{th}$ eigenvalue of matrix $A$ and $0 < \lambda_j < 1$, and $\left|u_j\right>$ is the corresponding eigenvector.
I also understand $|\lambda_j\rangle$ is the binary representation for fraction of $j^{th}$ eigenvalue of $A$. (i.e. $\left|01\right>$ for $\left|\lambda\right>=1/4$)
My questions are,
Q1: How to decide $n$, how many qubits to prepare? I assume it is related to the precision of expressing the eigenvalue, but not sure.
Q2: What to do if $\lambda_j$ of $A$ is $≤ 0$ or $≥ 1$?