# An Early Investigation of the HHL Quantum Linear Solver for Scientific Applications
## 5 Scientific Applications and Evaluation
### Power Flow Problem in Power Grid
#### 5.1.4 Resource Estimation in a Fault-Tolerant Scenario  
Encoded by the surface code described in Section 4 along with a nearest-neighbor connectivity constraint, we estimate the runtime of HHL circuits by the Azure Quantum resource estimator and summarize the data in Figure 4. A strong and consistent linear correlation between the number of clock qubits in QPE, \(n_{c}\), and the runtime in log base 10 is displayed across qubit parameter sets and error budgets. Every extra clock qubit brings \(10^{0.322}\approx 2.099\) times longer runtime when the error budget is 0.1 and \(10^{0.375}\approx 2.371\) times longer when the error budget is 0.01. This multiplier shows an increasing trend when the error budget decreases. Similar correlations are also demonstrated in Figure 5a,b when we further investigate how \(n_{c}\) affects the number of logical cycles for the circuit and the number of \(T\) states. Generally, the exponential dependencies of runtime, number of logical cycles, and number of \(T\) states on \(n_{c}\) match the relationship between the number of gates in HHL circuits and \(n_{c}\). Note that the slopes of the fitted line in Figure 5a,b are not sensitive to error budgets, different from the behavior in Figure 4. Error budgets affect the constant multiplier of the growth of logical cycles and the number of \(T\) states more.  
Table 6 summarizes the other factors of our interest. Those factors have the same values in \((\text{ns},\ 10^{-4})\) and \((\text{us},\ 10^{-4})\) settings. Note that there is a dramatic fall in the number of physical qubits when the error budget is 0.01 and \(n_{c}\) raises from 4 to 5. Combined with Figure 5c,d, this reduction comes from a large drop in the number of physical qubits spent on \(T\) factories, a dominant demand on physical qubits instead of the quantum algorithm itself. The circuit requires \(15\ T\) factories when the error budget is 0.01 and \(n_{c}=4\), but this number is reduced to 12 when \(n_{c}=5\). Recall the definition of the number of \(T\) factories in Table 4, based on the fitted coefficients in Figures 4 and 5; we can see while the increase in \(n_{c}\) from 4 to 5 leads to \(10^{0.322}\) times more \(T\) states, the runtime becomes \(10^{0.375}\) times larger. Since \(T\) factory duration and \(T\) states per factory are kept constant, the faster-growing runtime reduces the number of \(T\) factories required, thus decreasing the overall number of  
Figure 4: The runtime in seconds as a function of the number of clock qubits in QPE under the qubit parameter set (**a**) \((\text{ns},\ 10^{-4})\) and (**b**) \((\text{us},\ 10^{-4})\). The estimated circuits are HHL circuits for power flow problems.  
\begin{table}
\begin{tabular}{c c c c c c c} \hline \hline \(n_{d}\) & \(n_{c}\) & **Depth** & **Gates** & **2-Qubit Gates** & **Gates After Fusion** & **Reduction from Fusion** \\ \hline
4 & 4 & 65,824 & 86,262 & 30,651 & 18,060 & 79.06\% \\
4 & 5 & 135,986 & 178,180 & 63,315 & 37,283 & 79.08\% \\
4 & 6 & 276,308 & 361,980 & 128,631 & 75,717 & 79.08\% \\
4 & 7 & 556,950 & 729,534 & 259,247 & 152,570 & 79.09\% \\ \hline \hline \end{tabular}
\end{table}
Table 5: Depths and gate counts of HHL circuits for power flow problems at Iteration 1.  
physical qubits required. This phenomenon does not occur when the error budget is 0.1 because the growth of runtime and \(T\)-state count are at the same speed.