# An Early Investigation of the HHL Quantum Linear Solver for Scientific Applications
## 4 Factors of Interest  
As we focus on the linear system in scientific applications instead of random systems for benchmarking, we have less control over the specific values of matrix properties like condition numbers. Our interest is more on the number of clock qubits \(n_{c}\) in the HHL circuit, which controls the accuracy of estimated eigenvalues. The error in eigenvalue estimation affects the solution of the linear system through Equation (2). From [35], to obtain an eigenvalue with \(2^{-b}\) accuracy with at least \(1-p_{QPE,fail}\) success probability using QPE, we need  
\[n_{c}=b+\left\lceil\log_{2}\left(2+\frac{1}{2p_{QPE,fail}}\right)\right\rceil.\]  
In the Qiskit-based HHL implementation that we used [55], it is suggested that  
\[n_{c}=\max(n_{d}+1,\lceil\log_{2}(\kappa+1)\rceil)+\mathbb{I}_{nv} \tag{3}\]  
where \(\mathbb{I}_{nv}=1\) if the coefficient matrix has a negative eigenvalue; otherwise, it is 0. In this paper, we will adjust \(n_{c}\) to illustrate the influence of the QPE resources on the HHL circuit's total cost and the algorithm's accuracy in domain applications.  
When discussing resource estimation under a fault-tolerant setting, our primary concerns are the estimated runtime, the number of physical qubits, and extra resources required from the QEC code. We adopt a distance-7 surface code that encodes 98 physical qubits into a single logical qubit. The theoretical logical qubit error rate is \(3~{}\times~{}10^{-10}\), and the error correction threshold is 0.01. The Azure Quantum resource estimator provides several qubit parameter sets to simulate different qubit properties. The preset qubit settings we used in this paper are \((\text{ns},~{}10^{-4})\) and \((\text{us},~{}10^{-4})\) from [42], where the former is close to the specifications of superconducting transmon qubits or spin qubits, and the latter is more relevant for trapped-ion qubits [42]. A list of detailed configurations of qubit parameter set \((\text{ns},~{}10^{-4})\) and \((\text{us},~{}10^{-4})\) is in Table 3. We enforce 2-D nearest-neighbor connectivity of the qubits to simulate the connectivity constraint on real quantum computers. So we also demonstrate the changes in some factors before this constraint is enforced (\"pre-layout\") and after this constraint is enforced (\"after layout\").  
Another important tunable parameter is the overall allowed errors for the algorithm, namely error budget. Its parameter value is equally divided into three parts:  
* Logical error probability: the probability of at least one logical error;
* T-distillation error probability: the probability of at least one faulty T-distillation;
* Rotation synthesis error probability: the probability of at least one failed rotation synthesis.  
\begin{table}
\begin{tabular}{c c c c} \hline \hline  & **Qubit Parameter Set** & \(\mathbf{(ns,~{}10^{-4})}\) & \(\mathbf{(\mu s,~{}10^{-4})}\) \\ \hline \multirow{4}{*}{Operation Time} & Measurement & 100 ns & 100 μs \\  & Single-qubit gate & 50 ns & 100 μs \\  & Two-qubit gate & 50 ns & 100 μs \\  & \(T\) gate & 50 ns & 100 μs \\ \hline \multirow{4}{*}{Error rate} & Measurement & \(10^{-4}\) & \(10^{-4}\) \\  & Single-qubit gate & \(10^{-4}\) & \(10^{-4}\) \\ \cline{1-1}  & Two-qubit gate & \(10^{-4}\) & \(10^{-4}\) \\ \cline{1-1}  & \(T\) gate & \(10^{-4}\) & \(10^{-6}\) \\ \hline \hline \end{tabular}
\end{table}
Table 3: Qubit parameter configurations.  
There are also specific breakdowns in the resource required by QEC that are of interest [42, 43]. We list them in Table 4.