  Analyzing large sparse electrical networks is a fundamental task in physics,
electrical engineering and computer science. We propose two classes of quantum
algorithms for this task. The first class is based on solving linear systems,
and the second class is based on using quantum walks. These algorithms compute
various electrical quantities, including voltages, currents, dissipated powers
and effective resistances, in time $\operatorname{poly}(d, c,
\operatorname{log}(N), 1/\lambda, 1/\epsilon)$, where $N$ is the number of
vertices in the network, $d$ is the maximum unweighted degree of the vertices,
$c$ is the ratio of largest to smallest edge resistance, $\lambda$ is the
spectral gap of the normalized Laplacian of the network, and $\epsilon$ is the
accuracy. Furthermore, we show that the polynomial dependence on $1/\lambda$ is
necessary. This implies that our algorithms are optimal up to polynomial
factors and cannot be significantly improved.
