Revisiting Quantum Algorithms for Linear Regressions: Quadratic Speedups without Data-Dependent Parameters

## Abstract

Linear regression is one of the most fundamental linear algebra problems. Given a dense matrix A ∈ ℝ n × d 𝐴 superscript ℝ 𝑛 𝑑 A\in\mathbb{R}^{n\times d} italic_A ∈ blackboard_R start_POSTSUPERSCRIPT italic_n × italic_d end_POSTSUPERSCRIPT and a vector b 𝑏 b italic_b , the goal is to find x ′ superscript 𝑥 ′ x^{\prime} italic_x start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT such that ‖ A ⁢ x ′ − b ‖ 2 2 ≤ ( 1 + ϵ ) ⁢ min x ⁡ ‖ A ⁢ x − b ‖ 2 2 superscript subscript norm 𝐴 superscript 𝑥 ′ 𝑏 2 2 1 italic-ϵ subscript 𝑥 superscript subscript norm 𝐴 𝑥 𝑏 2 2 \|Ax^{\prime}-b\|_{2}^{2}\leq(1+\epsilon)\min_{x}\|Ax-b\|_{2}^{2} ∥ italic_A italic_x start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT - italic_b ∥ start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT ≤ ( 1 + italic_ϵ ) roman_min start_POSTSUBSCRIPT italic_x end_POSTSUBSCRIPT ∥ italic_A italic_x - italic_b ∥ start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT .
The best classical algorithm takes O ⁢ ( n ⁢ d ) + poly ⁢ ( d / ϵ ) 𝑂 𝑛 𝑑 poly 𝑑 italic-ϵ O(nd)+\mathrm{poly}(d/\epsilon) italic_O ( italic_n italic_d ) + roman_poly ( italic_d / italic_ϵ ) time [Clarkson and Woodruff STOC 2013, Nelson and Nguyen FOCS 2013]. On the other hand, quantum linear regression algorithms can achieve exponential quantum speedups, as shown in [Wang Phys. Rev. A 96, 012335, Kerenidis and Prakash ITCS 2017, Chakraborty, Gilyén and Jeffery ICALP 2019]. However, the running times of these algorithms depend on some quantum linear algebra-related parameters, such as κ ⁢ ( A ) 𝜅 𝐴 \kappa(A) italic_κ ( italic_A ) , the condition number of A 𝐴 A italic_A . In this work, we develop a quantum algorithm that runs in O ~ ⁢ ( ϵ − 1 ⁢ n ⁢ d 1.5 ) + poly ⁢ ( d / ϵ ) ~ 𝑂 superscript italic-ϵ 1 𝑛 superscript 𝑑 1.5 poly 𝑑 italic-ϵ \widetilde{O}(\epsilon^{-1}\sqrt{n}d^{1.5})+\mathrm{poly}(d/\epsilon) over~ start_ARG italic_O end_ARG ( italic_ϵ start_POSTSUPERSCRIPT - 1 end_POSTSUPERSCRIPT square-root start_ARG italic_n end_ARG italic_d start_POSTSUPERSCRIPT 1.5 end_POSTSUPERSCRIPT ) + roman_poly ( italic_d / italic_ϵ ) time. It provides a quadratic quantum speedup in n 𝑛 n italic_n over the classical lower bound without any dependence on data-dependent parameters. In addition, we also show our result can be generalized to multiple regression and ridge linear regression.

## 1 Introduction

Linear regression is one of the fundamental problems in machine learning and data science [, , ]. It is a statistical method that models the relationship between a dependent variable and one or more independent variables. Multiple regression is an extension of linear regression that predicts a target variable using multiple feature variables. They have many applications across different areas such as predictive analysis [, ], economics [, , ], marketing [], finance [], healthcare [, , , ], education [, , ], social sciences [, ], sports analytics [, ], manufacturing [, ], and quality control [].

The formal definition of linear regression can be described as follows:

###### Definition 1.1 (Linear Regression) .

Given a matrix $A\in\mathbb{R}^{n\times d}$ and a vector $b\in\mathbb{R}^{n}$, we let $\epsilon\in(0,1)$ denote an accuracy parameter. The goal is to output a vector $x\in\mathbb{R}^{d}$ such that

$$ $\displaystyle\|Ax-b\|_{2}^{2}\leq(1+\epsilon)\min_{x^{\prime}\in\mathbb{R}^{d} }\|Ax^{\prime}-b\|_{2}^{2}$ $$

The state-of-the-art algorithms for solving linear regression are due to [, ], where the running time is $O(nd)+\operatorname{poly}(d/\epsilon)$.

The formal definition of multiple regression can be described as follows:

###### Definition 1.2 (Multiple Regression) .

Given two matrices $A\in\mathbb{R}^{n\times d}$ and $B\in\mathbb{R}^{n\times N}$, we let $\epsilon\in(0,1)$ denote an accuracy parameter. The goal is to output a matrix $X\in\mathbb{R}^{d\times N}$ such that

$$ $\displaystyle\|AX-B\|_{F}\leq(1+\epsilon)\min_{X^{\prime}\in\mathbb{R}^{d \times N}}\|AX^{\prime}-B\|_{F}$ $$

Ridge regression is a regularized version of linear regression that adds an $\ell_{2}$ penalty to the regression coefficients, preventing overfitting. This property makes it well-suited for handling high-dimensional data, where feature collinearity is common. In machine learning, ridge regression serves as a common baseline and benchmark method. Several studies have analyzed ridge regression concerning high-dimensional data and models [, ], feature selection [, , ], and regularization path algorithms []. Moreover, it has found extensive use in diverse applications such as image recognition [, ], natural language processing [, ], and bioinformatics [, , ].

###### Definition 1.3 (Ridge Regression) .

Given a matrix $A\in\mathbb{R}^{n\times d}$ and a vector $b\in\mathbb{R}^{n}$, we let $\epsilon\in(0,1)$ denote an accuracy parameter and let $\lambda>0$ denote a regularization parameter. The goal is to output a vector $x\in\mathbb{R}^{d}$ such that

$$ $\displaystyle\|Ax-b\|_{2}^{2}+\lambda\|x\|_{2}^{2}\leq(1+\epsilon)\min_{x^{ \prime}\in\mathbb{R}^{d}}(\|Ax^{\prime}-b\|_{2}^{2}+\lambda\|x^{\prime}\|_{2}^ {2}).$ $$

In this paper, we study the quantum algorithms for the linear regression problem and its variations, including ridge regression and multiple regression. Quantum computing is a rapidly advancing technology, and we now have quantum computers with dramatically increasing capabilities that are on the cusp of achieving quantum advantages over classical computers. It is thus a pertinent question whether quantum computers can accelerate solving classical machine learning optimizations like linear regression.

Quantum algorithms for linear regression have been studied for a long time [, , , , ]. However, the majority of existing algorithms rely on quantum linear algebra techniques, which harbor noteworthy limitations. Specifically, their time complexities hinge on the condition number $\kappa$ of the input matrix. This predicament impedes a direct comparison with state-of-the-art classical methods, whose runtimes remain independent of $\kappa$. Consequently, these quantum algorithms can only guarantee acceleration over classical ones for instances featuring well-conditioned input matrices.

Overcoming this conditional dependence is an open question. We would like quantum regression algorithms that can provably achieve speedups for any input matrix, not just “easy” ones. Developing such algorithms requires departing from the quantum linear algebra framework and exploring novel techniques. In our work, we make progress in this direction by proposing quantum algorithms for linear regression, ridge regression, and multiple regression based on leverage score distribution. Our approach achieves a runtime proportional to the square root of the data dimension $n$, without the dependence on the condition number $\kappa$. This marks the first unconditional acceleration for these three regression problems in comparison to the best-known classical algorithm.

In the classical setting, it is well known that solving linear regression requires $\Omega(n)$ time [, ]. In the quantum setting, it has been known for a while there $\Omega(\sqrt{n}+d)$ times is a lower bound [, ]. Thus, in particular, we can ask the following question

Is that possible to solve linear regression in $O_{d}(\sqrt{n})$ time and without paying matrix-dependent parameters (e.g., $\kappa(A)$)?

In this work, provide a positive answer to this question.

###### Definition 1.1 (Linear Regression) .

###### Definition 1.2 (Multiple Regression) .

###### Definition 1.3 (Ridge Regression) .

### 1.1 Our Results

The main contribution of our work is to propose a quantum algorithm that solves linear regression in $O_{d}(\sqrt{n})$ time while the classical algorithm requires $\Omega_{d}(n)$ time. Notice that the complexity of our algorithm does not have any data-dependent parameter. For comparison, the quantum linear regression algorithms proposed by Wang [], Kerenidis and Prakash [], Chakraborty, Gilyén and Jeffery [] have a time complexity $\operatorname{poly}(\log n,d,\kappa(A),\epsilon^{-1})$. On the other hand, there exists a series of works on developing “quantum-inspired” algorithms for linear regression problems, which show that classical algorithms can also achieve $\log(n)$-dependence by assuming some sampling access to the input matrix. However, the time complexities of these algorithms have large polynomial dependence on some matrix parameters. In particular, Chia, Gilyén, Li, Lin, Tang, and Wang [] presented a quantum-inspired algorithm that runs in $O(({\|A\|_{F}}/{\|A\|})^{6}\kappa(A)^{28})$ time. Further, Gilyén, Song, and Tang [] improved to $O(({\|A\|_{F}}/{\|A\|})^{6}\kappa(A)^{12})$ time.

Our result for linear regression is stated below.

###### Theorem 1.4 (Quantum algorithm for linear regression, informal version of Theorem 3.5 ) .

Let $\epsilon\in(0,1)$. Let $\omega\approx 2.37$ denote the exponent of matrix multiplication. Given a matrix $A\in\mathbb{R}^{n\times d}$ and $b\in\mathbb{R}^{n}$, there is a quantum algorithm that outputs $x\in\mathbb{R}^{d}$ such that

- •
$\|Ax-b\|_{2}\leq(1+\epsilon)\min_{x^{\prime}\in\mathbb{R}^{d}}\|Ax^{\prime}-b
\|_{2}$
- •
it takes $\widetilde{O}(\sqrt{nd}/\epsilon)$ row queries to $A$
- •
it takes $\widetilde{O}(\sqrt{n}d^{1.5}/\epsilon+d^{\omega}/\epsilon)$ time, where $r$ is the row of sparsity of matrix $A$.
- •
the success probability is 0.999

We can also improve the classical multiple linear regression algorithm from $O(nd)+N\operatorname{poly}(d)$ [, ] to $\widetilde{O}(\sqrt{n}d^{1.5})+N\operatorname{poly}(d)$.

###### Theorem 1.5 (Quantum algorithm for multiple regression, informal version of Theorem 3.4 ) .

Let $\epsilon\in(0,1)$. Let $\omega\approx 2.37$ denote the exponent of matrix multiplication. Given a matrix $A\in\mathbb{R}^{n\times d}$ with row sparsity $r$, $B\in\mathbb{R}^{n\times N}$, there is a quantum algorithm that outputs $X\in\mathbb{R}^{d\times N}$ such that

- •
$\|AX-B\|_{F}\leq(1+\epsilon)\min_{X^{\prime}\in\mathbb{R}^{d\times N}}\|AX^{
\prime}-B\|_{F}$
- •
it takes $\widetilde{O}(\sqrt{nd}/\epsilon)$ row queries to $A$
- •
it takes $\widetilde{O}(\sqrt{n}d^{1.5}/\epsilon+d^{\omega}/\epsilon+Nd^{\omega-1}/\epsilon)$ time
- •
the success probability is 0.999,

For ridge regression, the previous best ridge regression algorithm is due to [], which has a running time $O(nd)+\operatorname{poly}(d,\mathsf{sd}_{\lambda}(A),1/\epsilon)$. In quantum, Shao [] gave a quantum algorithm that has a linear dependence in $n$ in the worst case. Chen and de Wolf [] studied quantum algorithms for LASSO (linear regression with $\ell_{1}$-constraint) and ridge regressions. However, they focused on improving the $d$-dependence and only considered the regime when $n=O(\log(d)/\epsilon^{2})$. In this work, we present a quantum algorithm that runs in $\widetilde{O}(\sqrt{n\cdot\mathsf{sd}_{\lambda}(A)}d)+\operatorname{poly}(
\mathsf{sd}_{\lambda}(A),1/\epsilon)$ time.

###### Theorem 1.6 (Quantum algorithm for ridge regression, informal version of Theorem 4.5 ) .

Let $\epsilon\in(0,1)$. Let $\lambda>0$ denote a regularization parameter. Given a matrix $A\in\mathbb{R}^{n\times d}$ and $b\in\mathbb{R}^{n}$. Let $\mathsf{sd}_{\lambda}(A)$ denote the statistical dimension of matrix $A$ (see Definition [2.11](#S2.Thmtheorem11)). There is a quantum algorithm that outputs $x\in\mathbb{R}^{d}$ such that

- •
$\|Ax-b\|_{2}^{2}+\lambda\|x\|_{2}^{2}\leq(1+\epsilon)\min_{x^{\prime}\in
\mathbb{R}^{d}}(\|Ax^{\prime}-b\|_{2}^{2}+\lambda\|x^{\prime}\|_{2}^{2})$
- •
it takes $\widetilde{O}(\sqrt{n\cdot\mathsf{sd}_{\lambda}(A)}/\epsilon)$ row queries to $A$
- •
it takes $\widetilde{O}(\sqrt{n\cdot\mathsf{sd}_{\lambda}(A)}d/\epsilon+\operatorname{
poly}(d,\mathsf{sd}_{\lambda}(A),1/\epsilon))$ time.
- •
the success probability is 0.999

###### Theorem 1.4 (Quantum algorithm for linear regression, informal version of Theorem 3.5 ) .

###### Theorem 1.5 (Quantum algorithm for multiple regression, informal version of Theorem 3.4 ) .

###### Theorem 1.6 (Quantum algorithm for ridge regression, informal version of Theorem 4.5 ) .

#### Roadmap.

In Section [2](#S2), we present the basic notations and the important mathematical definitions and properties. In Section [3](#S3), we analyze the linear regression problem and the multiple regression problem and present the formal version of our main results. In Section [4](#S4), we analyze the ridge regression problem and present the formal version of our main result.

## 2 Preliminary

First, we introduce the basic mathematical notations we use in this paper. Then, we introduce the important definitions and mathematical properties which support our analysis. Specifically, in Section [2.1](#S2.SS1), we introduce the definitions and properties related to the subspace embedding and approximate matrix product. In Section [2.2](#S2.SS2), we formally define leverage score distribution. In Section [2.3](#S2.SS3), we formally define the statistical dimension. In Section [2.4](#S2.SS4), we incorporate the quantum tools to study the properties of subspace embedding. In Section [2.5](#S2.SS5), we show that the leverage score sample preserves the approximate matrix product. In Section [2.6](#S2.SS6), we present the running times of fast matrix multiplication.

#### Notations.

First, we introduce the notations related to the sets. We define $\operatorname*{\mathbb{Z}}^{+}:=\{1,2,3,\dots\}$ to be the set containing all positive integers. Let $n,d\in\operatorname*{\mathbb{Z}}^{+}$. We define $[n]:=\{1,2,3,\dots,n\}$. We use $\mathbb{R}$, $\mathbb{R}^{n}$, and $\mathbb{R}^{n\times d}$ to denote the set containing all real numbers, all $n$-dimensional vectors with real entries, and the $n\times d$ matrices with real entries.

Now, we introduce the notations related to vectors. Let $x\in\mathbb{R}^{n}$. For all $i\in[n]$, we let $x_{i}\in\mathbb{R}$ be the $i$-th entry of $x$. We define the $\ell_{2}$ norm of $x$, denoted as $\|x\|_{2}$, as $\sqrt{\sum_{i=1}^{n}x_{i}^{2}}$.

After that, we present the notations related to the matrices. Let $A\in\mathbb{R}^{n\times d}$. For all $i\in[n]$, $j\in[d]$, we define $A_{i,j}\in\mathbb{R}$ as the entry of $A$ at the $i$-th row and $j$-th column; we define $A_{i,*}\in\mathbb{R}^{d}$ as the $i$-th row of $A$; we define $A_{*,j}\in\mathbb{R}^{n}$ as the $j$-th column of $A$. Given a vector $y\in\mathbb{R}^{d}$ satisfying $\|y\|_{2}=1$, we define the spectral norm of $A$, denoted as $\|A\|$, to be $\max_{y\in\mathbb{R}^{d}}\|Ay\|_{2}$. We define the Frobenius norm of $A$ as $\|A\|_{F}:=\sqrt{\sum_{i=1}^{n}\sum_{j=i}^{d}|A_{i,j}|^{2}}$. The $\ell_{0}$ norm of $A$, denoted as $\|A\|_{0}\in\mathbb{R}$, is defined to be the number of nonzero entries in $A$. We use $I_{d}$ to represent the $d\times d$ identity matrix. We use $A^{\top}\in\mathbb{R}^{d\times n}$ to denote the transpose of the matrix $A$. $A^{\dagger}$ denote the pseudoinverse of $A$. Given two symmetric matrices $B,C\in\mathbb{R}^{n\times n}$, we use $B\preceq C$ to represent that the matrix $C-B$ is positive semidefinite (or PSD), namely for all $x\in\mathbb{R}^{n}$, we have $x^{\top}(C-B)x\geq 0$.

Finally, we define the notations related to functions. We use $\operatorname{poly}(n)$ to represent a polynomial in $n$. Let $f,g:\mathbb{R}\to\mathbb{R}$ be two functions. We use $\widetilde{O}(f)$ to denote $f\cdot\operatorname{poly}(\log f)$. We use $g(n)=O(f(n))$ to represent that there exist two positive real numbers $C$ and $x_{0}$ such that for all $n\geq x_{0}$, we have $|g(n)|\leq C\cdot f(n)$. $\arg\min_{x}f(x)$ denote the $x$ value such that $f(x)$ attains its minimum.

### 2.1 Definitions of SE and AMP

In this section, we introduce key concepts that will be central to proving the guarantees of our quantum algorithms for regression. Specifically, we formally define two main concepts–subspace embedding and approximate matrix product. Subspace embedding is when multiplying by a sketching matrix approximately preserves the geometry or “norms” of vectors from a given subspace. Approximate matrix product means that multiplying a sketch by matrices $A$ and $B$ roughly preserves the Frobenius or spectral norm as if $A$ was directly multiplied by $B$.

###### Definition 2.1 (Subspace embedding, [ 41 ] ) .

Let $\epsilon,\delta\in(0,1)$. Let $n>d$. Given a matrix $U\in\mathbb{R}^{n\times d}$ which is an orthonormal basis (i.e., $U^{\top}U=I_{d}$), we say $S\in\mathbb{R}^{m\times n}$ is an $\operatorname{\mathsf{SE}}(\epsilon,\delta,n,d)$ subspace embedding for $U$ if

$$ $\displaystyle\|SUx\|_{2}^{2}=(1\pm\epsilon)\|Ux\|_{2}^{2},$ $$

holds with probability $1-\delta$.

This is equivalent to

$$ $\displaystyle\|U^{\top}S^{\top}SU-U^{\top}U\|\leq\epsilon$ $$

###### Remark 2.2 .

In general, if $S$ is not depending on $U$ we call it is oblivious subspace embedding. In the most places of this paper, our $S$ is depending on $U$. That’s why we don’t use “oblivious” in the definition like other papers [].

###### Definition 2.3 (Frobenius Norm Approximate Matrix Product, [ 52 ] ) .

Let $\epsilon,\delta\in(0,1)$. We say $S\in\mathbb{R}^{m\times n}$ is $\operatorname{\mathsf{FAMP}}(\epsilon,\delta,n,d)$ Approximate Matrix Product for $A\in\mathbb{R}^{n\times d}$ if for any $B\in\mathbb{R}^{n\times N}$ we have

$$ $\displaystyle\|A^{\top}S^{\top}SB-A^{\top}B\|_{F}^{2}\leq\epsilon^{2}\cdot\|A \|_{F}^{2}\cdot\|B\|_{F}^{2}$ $$

holds with probability $1-\delta$.

###### Remark 2.4 .

Here matrix $B$ has to have the same number of rows as $A$. However, $B$ is not necessarily to have the same number of columns as $A$.

###### Definition 2.5 (Spectral Norm Approximate Matrix Product, see Theorem 17 in [ 1 ] ) .

Let $\epsilon,\delta\in(0,1)$. We say $S\in\mathbb{R}^{m\times n}$ is $\operatorname{\mathsf{SAMP}}(\epsilon,\delta,n,d)$ Approximate Matrix Product for $A\in\mathbb{R}^{n\times d}$ if for any $B\in\mathbb{R}^{n\times N}$ we have

$$ $\displaystyle\|A^{\top}S^{\top}SB-A^{\top}B\|\leq\epsilon\cdot\|A\|\cdot\|B\|$ $$

holds with probability $1-\delta$.

###### Remark 2.6 .

Here matrix $B$ has to have the same number of rows as $A$. However, $B$ is not necessarily to have the same number of columns as $A$.

###### Claim 2.7 .

If the following conditions hold

- •
Let $A\in\mathbb{R}^{n\times d}$.
- •
Let $U$ denote the orthonormal basis of $A$.
- •
Let $D$ denote a diagonal matrix such that $\|DAx\|_{2}^{2}=(1\pm\epsilon)\|Ax\|_{2}^{2}$ for all $x$.

Then, we have

$$ $\displaystyle\|DUx\|_{2}^{2}=(1\pm\epsilon)\|Ux\|_{2}^{2}$ $$

###### Proof.

Let $R\in\mathbb{R}^{d\times d}$ denote the QR factorization of $A$. Then we have

$$ $\displaystyle A=UR$ $$

From $\|DAx\|_{2}^{2}=(1\pm\epsilon)\|Ax\|_{2}^{2}$, we know that

$$ $\displaystyle\|DURx\|_{2}^{2}=(1\pm\epsilon)\|URx\|_{2}^{2},\forall x$ $$

Since $R$ is full rank, then we can replace $Rx$ by $y$ to obtain

$$ $\displaystyle\|DUy\|_{2}^{2}=(1\pm\epsilon)\|Uy\|_{2}^{2},\forall y.$ $$

∎

###### Definition 2.1 (Subspace embedding, [ 41 ] ) .

###### Remark 2.2 .

###### Definition 2.3 (Frobenius Norm Approximate Matrix Product, [ 52 ] ) .

###### Remark 2.4 .

###### Definition 2.5 (Spectral Norm Approximate Matrix Product, see Theorem 17 in [ 1 ] ) .

###### Remark 2.6 .

###### Claim 2.7 .

###### Proof.

### 2.2 Leverage Score Distribution

We introduce leverage score (see Definition [2.8](#S2.Thmtheorem8)) and leverage score distribution (see Definition [2.10](#S2.Thmtheorem10)), which are well-known concepts in numerical linear algebra. We provide definitions that quantify the leverage score of a matrix row as its squared Euclidean norm under an orthonormal transformation of the matrix. Additionally, we define a leverage score distribution as a probability distribution that samples rows with probabilities proportional to these row leverage scores. Intuitively, leverage scores control how much influence each row vector has in spanning the column space.

###### Definition 2.8 (Leverage Score, see Definition B.28 in [ 44 ] as an example) .

Given a matrix $A\in\mathbb{R}^{n\times d}$, we let $U\in\mathbb{R}^{n\times d}$ denote the orthonormal basis of $A$. We define $\sigma_{i}:=\|U_{i,*}\|_{2}^{2}$ for each $i\in[n]$. We say $\sigma\in\mathbb{R}^{n}$ is the leverage score of $A\in\mathbb{R}^{n\times d}$.

###### Fact 2.9 .

It is well known that $\sum_{i=1}^{n}\sigma_{i}=d$.

###### Definition 2.10 ( $D\sim\mathsf{LS}(A)$ , see Definition B.29 in [ 44 ] as an example) .

Let $c>1$ denote some universal constant.

For each $i\in[n]$, we define $p_{i}:=c\cdot\sigma_{i}/d$.

Let $q\in\mathbb{R}^{n}$ be the vector that $q_{i}\geq p_{i}$.

Let $m$ denote the sparsity of diagonal matrix $D\in\mathbb{R}^{n\times n}$.

We say a diagonal matrix $D$ is a sampling and rescaling matrix according to leverage score of $A$ if for each $i\in[n]$, $D_{i,i}=\frac{1}{\sqrt{mq_{i}}}$ with probability $q_{i}$ and 0 0 otherwise. (Note that each $i$ is picked independently and with replacement) We use notion $D\sim\mathsf{LS}(A)$ to denote that.

###### Definition 2.8 (Leverage Score, see Definition B.28 in [ 44 ] as an example) .

###### Fact 2.9 .

###### Definition 2.10 ( D ∼ 𝖫𝖲 ⁢ ( A ) similar-to 𝐷 𝖫𝖲 𝐴 D\sim\mathsf{LS}(A) italic_D ∼ sansserif_LS ( italic_A ) , see Definition B.29 in [ 44 ] as an example) .

### 2.3 Statistical Dimension

In this section, we formally define the statistical dimension. In addition to leverage scores capturing the geometric influence of matrix rows, another related notion that will play an important role is the statistical dimension. While leverage scores are row-specific concepts, statistical dimension provides an aggregate measure of the complexity of a matrix that governs the sample size needed to effectively sketch it.

###### Definition 2.11 (Statistical dimension, see Definition 1 in [ 1 ] as an example) .

For real value $\lambda\geq 0$ and rank-$d$ matrix $A\in\mathbb{R}^{n\times d}$ with singular values $\sigma_{i}(A)$, the quantity $\mathsf{sd}_{\lambda}(A):=\sum_{i=1}^{d}\frac{1}{1+\lambda/\sigma_{i}(A)^{2}}$ is the statistical dimension of the ridge regression problem with regularizing weight $\lambda$.

###### Definition 2.11 (Statistical dimension, see Definition 1 in [ 1 ] as an example) .

### 2.4 Quantum Tools for Subspace Embedding

In this section, our purpose is to bridge the gap between classical theory and quantum techniques: we present a quantum tool we use for designing a fast algorithm based on leverage score sampling. This tool was recently developed by Apers and Gribling [].
In particular, we state two Lemmas analyzing efficient quantum routines for leverage score estimation and sampling, respectively. The first allows approximating row leverage scores (see Definition [2.8](#S2.Thmtheorem8)) with queries to the input matrix scaling as the square root of the dimension. The second one constructs a sampling matrix from these estimated scores that serves as a subspace embedding (see Definition [2.1](#S2.Thmtheorem1)).

###### Lemma 2.12 (Theorem 3.2 in [ 2 ] ) .

Consider query access to matrix $A\in\mathbb{R}^{n\times d}$ with row sparsity $r$. For any $\epsilon_{0}\in(0,1)$, there is a quantum algorithm that, provides query access to estimate $\widetilde{\sigma}_{i}$ for any $i\in[n]$ satisfying $\widetilde{\sigma}_{i}=(1\pm\epsilon_{0})\sigma(A)_{i}$

- •
It makes $\widetilde{O}(\sqrt{nd}/\epsilon_{0})$ row queries to $A$.
- •
It takes $\widetilde{O}(r\sqrt{nd}/\epsilon_{0}+d^{\omega}/\epsilon_{0}^{2}+d^{2}/
\epsilon_{0}^{4})$ time.
- •
The success probability $0.999$
- •
Cost per estimate $\widetilde{\sigma}_{i}$: one row query to $A$ and $\widetilde{O}(r/\epsilon_{0}^{2})$ time

###### Lemma 2.13 .

Consider query access to matrix $A\in\mathbb{R}^{n\times d}$ with row sparsity $r$. Let $U$ denote the orthonormal basis of $A$. For any $\epsilon\in(0,1)$, there is a quantum algorithm that, returns a diagonal matrix $D\in\mathbb{R}^{n\times n}$ such that

- •
$\|D\|_{0}=O(\epsilon^{-2}d\log d)$
- •
$\|DUx\|_{2}^{2}=(1\pm\epsilon)\|Ux\|_{2}^{2}$ (subspace embedding)
- •
$D\sim\mathsf{LS}(A)$ (see Definition [2.10](#S2.Thmtheorem10))
- •
It makes $\widetilde{O}(\sqrt{nd}/\epsilon)$ row queries to $A$.
- •
It takes $\widetilde{O}(r\sqrt{nd}/\epsilon+d^{\omega})$ time.
- •
The success probability $0.999$

###### Proof.

To do the leverage score sampling, we only need to set $\epsilon_{0}=0.1$ to be constant in Lemma [2.12](#S2.Thmtheorem12).

Using classical correctness, we know that if the sampling size is $O(\epsilon^{-2}d\log d)$, then we will get subspace embedding (see Definition [2.1](#S2.Thmtheorem1)).

Using quantum sampling lemma, we know that sampling $\|D\|_{0}$ rows from an $n$ rows of $A$ requires $\sqrt{n\|D\|_{0}}$ row queries to $A$.

Using Lemma [2.12](#S2.Thmtheorem12) it takes

$$ $\displaystyle\widetilde{O}(r\sqrt{n\|D\|_{0}}+d^{\omega})$ $$

Thus, we complete the proof.
∎

###### Lemma 2.12 (Theorem 3.2 in [ 2 ] ) .

###### Lemma 2.13 .

###### Proof.

### 2.5 Leverage Score Sample Preserves Approximate Matrix Product

In this section, we show that the leverage score sample preserves the approximate matrix product. Specifically, we analyze the Lemma showing that sampling rows of a matrix $A$ proportionally to leverage scores (see Definition [2.8](#S2.Thmtheorem8)) generates a sketching matrix that approximates the product between $A$ and any other matrix $B$ with respect to the Frobenius norm.

###### Lemma 2.14 (Lemma C.29 in [ 44 ] ) .

If the following conditions hold

- •
Let $A\in\mathbb{R}^{n\times d}$
- •
Let $B\in\mathbb{R}^{n\times N}$
- •
Let $\epsilon\in(0,1)$
- •
Let $S\sim\mathsf{LS}(A)$ (see Definition [2.10](#S2.Thmtheorem10))
- •
Let $\|S\|_{0}=O(1/\epsilon^{2})$

Then, for any fixed matrix $B$, we have

- •
$\|A^{\top}S^{\top}SB-A^{\top}B\|_{F}^{2}\leq\epsilon^{2}\|A\|_{F}^{2}\|B\|_{F}
^{2}$
- •
The success probability is $0.999$

###### Lemma 2.14 (Lemma C.29 in [ 44 ] ) .

### 2.6 Fast Matrix Multiplication

In this section, we present the running time of the fast matrix multiplication. We define the variable ${\cal T}_{\mathrm{mat}}$ to represent the time cost of multiplying two matrices of designated dimensions. Further, we use $\omega$ to refer to the matrix multiplication exponent governing the asymptotic scaling of these runtimes [, , , , , ]. We also introduce useful facts about manipulating the matrix multiplication time function. These rules will assist with analyzing the runtimes of operations like computing $(SA)^{\dagger}SB$ which occur inside our regression analysis (see Lemma [3.3](#S3.Thmtheorem3)).

###### Definition 2.15 .

Given two matrices $a\times b$ size and $b\times c$, we use the ${\cal T}_{\mathrm{mat}}(a,b,c)$ to denote the time of multiplying $a\times b$ matrix with another $b\times c$.

We use $\omega$ to denote the number that ${\cal T}_{\mathrm{mat}}(n,n,n)=n^{\omega}$.

###### Fact 2.16 .

Given three positive integers, we have

$$ $\displaystyle{\cal T}_{\mathrm{mat}}(a,b,c)=O({\cal T}_{\mathrm{mat}}(a,c,b))= O({\cal T}_{\mathrm{mat}}(b,a,c))=O({\cal T}_{\mathrm{mat}}(b,c,a))=O({\cal T} _{\mathrm{mat}}(c,a,b))=O({\cal T}_{\mathrm{mat}}(c,b,a))$ $$

###### Fact 2.17 .

Given $a,b,c,d$ are positive integers. Then we have

- •
Part 1.
$\displaystyle{\cal T}_{\mathrm{mat}}(a,b,c)=O(d\cdot{\cal T}_{\mathrm{mat}}(a/
d,b,c))$
- •
Part 2.
$\displaystyle{\cal T}_{\mathrm{mat}}(a,b,c)=O(d\cdot{\cal T}_{\mathrm{mat}}(a,
b/d,c))$
- •
Part 3.
$\displaystyle{\cal T}_{\mathrm{mat}}(a,b,c)=O(d\cdot{\cal T}_{\mathrm{mat}}(a,
b,c/d))$

###### Definition 2.15 .

###### Fact 2.16 .

###### Fact 2.17 .

## 3 Multiple Regression and Linear Regression

In this section, we focus on proving the result for multiple regression. It directly implies the result for linear regression.

In Section [3.1](#S3.SS1), we show that the leverage score distribution may imply the subspace embedding and approximate matrix product. In Section [3.2](#S3.Thmtheorem2), we show that by using the subspace embedding and approximate matrix product, we can get the multiple regression. In Section [3.3](#S3.SS3), we analyze the running time for each of the matrices $SA$, $SB$, $(SA)^{\dagger}$, and $(SA)^{\dagger}\cdot(SB)$. In Section [3.4](#S3.SS4), we combine the important properties of this section to form the formal version of our result for multiple regression, and based on that, we take $N=1$ to form the formal version of our result for linear regression.

### 3.1 LS Implies SE and AMP

In this section, we present a tool from Song, Woodruff, and Zhong [] showing that if $S\sim\mathsf{LS}(A)$, a leverage score distribution, then $S$ is a subspace embedding (see Definition [2.1](#S2.Thmtheorem1)) and satisfies the definition of Frobenius norm approximate matrix product (see Definition [2.3](#S2.Thmtheorem3)). The purpose is to rigorously justify why sampling from leverage scores enables dimensionality reduction for regression problems. By showing that the sampled matrix retains the structure of the original matrix, we lay the groundwork to prove that solving regression on the smaller sampled matrix yields an approximate solution for the full regression problem. This then sets up the development in later sections showing how this sampling-based reduction leads to faster quantum algorithms.

###### Lemma 3.1 (Corollary C.30 in [ 44 ] ) .

If the following conditions hold

- •
Given $A\in\mathbb{R}^{n\times d}$
- •
Let $U$ denote the orthonormal basis of $A$
- •
Let $S\sim\mathsf{LS}(A)$ (see Definition [2.10](#S2.Thmtheorem10))
- •
Let $\|S\|_{0}=m$

Then, we have

- •
Part 1. If $m=O(d\log d)$, then $S$ is a $\operatorname{\mathsf{SE}}(1/2,0.99,n,d)$ subspace embedding (see Definition [2.1](#S2.Thmtheorem1)) for $U$
- •
Part 2. If $m=O(d/\epsilon)$, then $S$ satisfies $\operatorname{\mathsf{FAMP}}(\sqrt{\epsilon/d},0.99,n,d)$ (see Definition [2.3](#S2.Thmtheorem3)) for $U$

###### Lemma 3.1 (Corollary C.30 in [ 44 ] ) .

### 3.2 From SE and AMP to Regression

In this section, we present another tool from [] showing that if $S$ is a subspace embedding (see Definition [2.1](#S2.Thmtheorem1)) and satisfies the definition of Frobenius norm approximate matrix product (see Definition [2.3](#S2.Thmtheorem3)), then the multiple regression is satisfied. Therefore, solving the sketched regression problem on the smaller matrix $SA$ yields solutions that generalize to approximate the full regression problem on $A$.

###### Lemma 3.2 (Lemma C.31 in [ 44 ] ) .

If the following conditions hold

- •
Let $A\in\mathbb{R}^{n\times d}$
- •
Let $B\in\mathbb{R}^{n\times N}$
- •
Let $S\sim\mathsf{LS}(A)$ (see Definition [2.10](#S2.Thmtheorem10)).
- •
Let $X^{*}=\arg\min_{X}\|AX-B\|_{F}^{2}$
- •
Let $X^{\prime}=\arg\min_{X}\|SAX-SB\|_{F}^{2}$
- •
Let $U$ denote an orthonormal basis for $A$
- •
Suppose $S$ is $\operatorname{\mathsf{SE}}(1/2,0.99,n,d)$ (see Definition [2.1](#S2.Thmtheorem1)) for $U$
- •
Suppose $S$ is $\operatorname{\mathsf{FAMP}}(\sqrt{\epsilon/d},0.99,n,d)$ (see Definition [2.3](#S2.Thmtheorem3)) for $U$

Then, we have

$$ $\displaystyle\|AX^{\prime}-B\|_{F}^{2}\leq(1+\epsilon)\|AX^{*}-B\|_{F}^{2}$ $$

###### Lemma 3.2 (Lemma C.31 in [ 44 ] ) .

### 3.3 Computing the Running Time

In this section, we state and prove a lemma bounding the running time for using leverage score sampling (see Definition [2.10](#S2.Thmtheorem10)), then forming the sketched matrices $SA$ and $SB$, computing the pseudoinverse of $SA$, and multiplying this pseudoinverse by $SB$ to obtain the sketched solution. Each of these pieces is analyzed in terms of the input dimension $n$, $d$, and the accuracy parameter $\epsilon$. The purpose of this section is to complement the correctness guarantees from Section [3.1](#S3.SS1) and Section [3.2](#S3.SS2) by quantifying the computational efficiency of the sampling reduction process. This runtime analysis will be essential in establishing the time complexities of our final quantum regression algorithms.

###### Lemma 3.3 .

If the following conditions hold

- •
Let $A\in\mathbb{R}^{n\times d}$
- •
Let $\epsilon\in(0,0.1)$
- •
Let $B\in\mathbb{R}^{n\times N}$
- •
Let $\omega\approx 2.37$
- •
Let $S$ denote a diagonal matrix that $\|S\|_{0}=O(d\log d+d/\epsilon)$
- •
$X^{\prime}=(SA)^{\dagger}SB$

Then, we have we can compute $X^{\prime}\in\mathbb{R}^{d\times N}$ in $\widetilde{O}(d^{\omega}/\epsilon+Nd^{\omega-1}/\epsilon)$

###### Proof.

The proof directly follows from computing the time of $SA$, $SB$, $(SA)^{\dagger}$, and $(SA)^{\dagger}\cdot(SB)$.

Before computing the running time, let us recall the definition

- •
$S$ is an $n\times n$ size diagonal entries which only has $\widetilde{O}(d/\epsilon)$ non-entries on diagonal
- •
$A$ has size $n\times d$

Here are the computation costs:

- •
Computing $\widetilde{O}(d/\epsilon)\times d$ size matrix $SA$ takes $\widetilde{O}(d^{2}/\epsilon)$
- •
Computing $\widetilde{O}(d/\epsilon)\times N$ size matrix $SB$ takes $\widetilde{O}(Nd/\epsilon)$ time
- •
Computing $d\times\widetilde{O}(d/\epsilon)$ size matrix $(SA)^{\dagger}$ takes $\widetilde{O}(d^{\omega}/\epsilon)$ time
- •
Computing $d\times N$ size matrix $(SA)^{\dagger}(SB)$ takes ${\cal T}_{\mathrm{mat}}(d,\widetilde{O}(d/\epsilon),N)=\widetilde{O}(Nd^{
\omega-1}/\epsilon)$ time (due to Fact [2.17](#S2.Thmtheorem17)).

Thus, we complete the proof.
∎

###### Lemma 3.3 .

###### Proof.

### 3.4 Main Result

At this point, we have developed all the theoretical concepts required to obtain faster quantum algorithms for regression problems based on a sampling reduction approach. Thus, in this section, we present our main results for the multiple regression and the linear regression. First, we incorporate the mathematical properties developed earlier to present our result for the multiple regression.

###### Theorem 3.4 (Multiple Regression, our result, formal version of Theorem 1.5 ) .

Let $\epsilon\in(0,1)$. Let $\omega\approx 2.37$ denote the exponent of matrix multiplication. Given a matrix $A\in\mathbb{R}^{n\times d}$ with row sparsity $r$, $B\in\mathbb{R}^{n\times N}$, there is a quantum algorithm that outputs $X\in\mathbb{R}^{d\times N}$ such that

- •
$\|AX-B\|_{F}\leq(1+\epsilon)\min_{X^{\prime}\in\mathbb{R}^{d\times N}}\|AX^{
\prime}-B\|_{F}$
- •
it takes $\widetilde{O}(\sqrt{nd}/\epsilon)$ row queries to $A$
- •
it takes $\widetilde{O}(r\sqrt{nd}/\epsilon+d^{\omega}/\epsilon+Nd^{\omega-1}/\epsilon)$ time, where $r$ is the row of sparsity of matrix $A$.
- •
the success probability is 0.999,

###### Proof.

It follows from combining Lemma [2.13](#S2.Thmtheorem13), Lemma [3.1](#S3.Thmtheorem1), Lemma [3.2](#S3.Thmtheorem2), and Lemma [3.3](#S3.Thmtheorem3).

Note that by combining Lemma [3.1](#S3.Thmtheorem1) and Lemma [3.2](#S3.Thmtheorem2), we can have

$$ $\displaystyle\|AX^{\prime}-B\|_{F}^{2}\leq(1+\epsilon)\|AX^{*}-B\|_{F}^{2}.$ $$

Lemma [2.13](#S2.Thmtheorem13) and Lemma [3.3](#S3.Thmtheorem3) give us the running time.
∎

Then, we present our result for the linear regression, where we treat this as the multiple regression for $N=1$.

###### Theorem 3.5 (Linear Regression, our result, formal version of Theorem 1.4 ) .

Let $\epsilon\in(0,1)$. Let $\omega\approx 2.37$ denote the exponent of matrix multiplication. Given a matrix $A\in\mathbb{R}^{n\times d}$ and $b\in\mathbb{R}^{n}$, there is a quantum algorithm that outputs $x\in\mathbb{R}^{d}$ such that

- •
$\|Ax-b\|_{2}\leq(1+\epsilon)\min_{x^{\prime}\in\mathbb{R}^{d}}\|Ax^{\prime}-b
\|_{2}$
- •
it takes $\widetilde{O}(\sqrt{nd}/\epsilon)$ row queries to $A$
- •
it takes $\widetilde{O}(\sqrt{n}d^{1.5}/\epsilon+d^{\omega}/\epsilon)$ time, where $r$ is the row of sparsity of matrix $A$.
- •
the success probability is 0.999

###### Proof.

Let $x:=X\in\mathbb{R}^{d\times N}$ when $N=1$.

Let $b:=B\in\mathbb{R}^{n\times N}$ when $N=1$.

Then, by Theorem [3.4](#S3.Thmtheorem4), we have

$$ $\displaystyle\|Ax-b\|_{2}\leq(1+\epsilon)\min_{x^{\prime}\in\mathbb{R}^{d}}\| Ax^{\prime}-b\|_{2},$ $$

which takes

$$ $\displaystyle\widetilde{O}(r\sqrt{nd}/\epsilon+d^{\omega}/\epsilon+d^{\omega-1 }/\epsilon)=\widetilde{O}(\sqrt{n}d^{1.5}/\epsilon+d^{\omega}/\epsilon)$ $$

time.
∎

###### Theorem 3.4 (Multiple Regression, our result, formal version of Theorem 1.5 ) .

###### Proof.

###### Theorem 3.5 (Linear Regression, our result, formal version of Theorem 1.4 ) .

###### Proof.

## 4 Ridge Regression

In Section [4.1](#S4.SS1), we present a property of the orthonormal basis for the ridge matrix. In Section [4.2](#S4.SS2), we introduce a sampling oracle related to $U_{1}$. In Section [4.3](#S4.SS3), we present the property of the leverage score distribution that for a matrix $S$ sampled from it, $S$ is a subspace embedding (Definition [2.1](#S2.Thmtheorem1)) and satisfy the definition of the spectral norm approximate matrix product (Definition [2.5](#S2.Thmtheorem5)). In Section [4.4](#S4.SS4), we present the property of the matrix if it is a subspace embedding and satisfy the definition of the spectral norm approximate matrix product. In Section [4.5](#S4.SS5), we present our main result for the ridge regression.

### 4.1 Property of Orthonormal Basis for Ridge Matrix

In order to develop our quantum ridge regression algorithm, we require an efficient way to reduce the ridge regression problem on the original matrix $A$ to a regularized regression problem on a much smaller sampled matrix. Therefore, in this section, we present the property of the orthonormal basis for the ridge matrix. The guarantee relating the original ridge regression problem on $A$ and the reduced regression problem on $U_{1}$, which comprises the first $n$ rows of the orthonormal basis of the augmented matrix $\begin{bmatrix}A\\
\sqrt{\lambda}I_{d}\end{bmatrix}$, is formally presented in the following claim. This claim provides an explicit formula for the squared Frobenius norm of $U_{1}$ in terms of the statistical dimension of the ridge problem. It also bounds the spectral norm of $U_{1}$, which will be useful for ensuring subspace embedding properties (see Definition [2.1](#S2.Thmtheorem1)) when we subsample the ridge leverage scores of $U_{1}$.

###### Claim 4.1 ( [ 26 ] , Lemma 12 in [ 1 ] ) .

If the following conditions hold

- •
Given matrix $A\in\mathbb{R}^{n\times d}$
- •
Let $U\in\mathbb{R}^{n\times d}$ denote the orthonormal basis of $A$
- •
Let $U_{1}\in\mathbb{R}^{n\times d}$ comprise the first $n$ rows of orthonormal basis of $\begin{bmatrix}A\\
\sqrt{\lambda}I_{d}\end{bmatrix}$
- •
For each $i\in[d]$, let $\sigma_{i}(A)$ denote the singular value of matrix $A$

Then we have

- •
Part 1. $\|U\|_{F}^{2}=d$
- •
Part 2. $\|U\|=1$
- •
Part 3. $\|U_{1}\|_{F}^{2}=\sum_{i=1}^{d}\frac{1}{1+\lambda/\sigma_{i}(A)^{2}}=\mathsf{
sd}_{\lambda}(A)$
- •
Part 4. $\|U_{1}\|=\frac{1}{\sqrt{1+\lambda/\sigma_{1}^{2}}}$

###### Proof.

For $\|U\|_{F}^{2}=d$, it trivially follows from the definition of the orthonormal basis.

We consider the SVD(^1^11Here we use a different shape of SVD, which is not as usual $\Sigma\in\mathbb{R}^{d\times d}$) of

$$ $\displaystyle A=U\Sigma V^{\top},$ (1) $$

where $U\in\mathbb{R}^{n\times n}$, $\Sigma\in\mathbb{R}^{n\times d}$ and $V\in\mathbb{R}^{d\times d}$.

We define

$$ $\displaystyle D:=(\Sigma^{\top}\Sigma+\lambda I_{d})^{-1/2}.$ (2) $$

We define

$$ $\displaystyle\widehat{A}:=\begin{bmatrix}U\Sigma D\\ V\sqrt{\lambda}D\end{bmatrix}$ (5) $$

Then we have

$$ $\displaystyle\widehat{A}^{\top}\widehat{A}=I_{d}$ $$

For any $x$, we define $y$

$$ $\displaystyle y:=D^{-1}V^{\top}x$ (6) $$

Then, we have

$$ $\displaystyle\widehat{A}y=$ $\displaystyle~{}\begin{bmatrix}U\Sigma D\\ V\sqrt{\lambda}D\end{bmatrix}D^{-1}V^{\top}x$ $\displaystyle=$ $\displaystyle~{}\begin{bmatrix}U\Sigma DD^{-1}V^{\top}\\ V\sqrt{\lambda}DD^{-1}V^{\top}\end{bmatrix}x$ $\displaystyle=$ $\displaystyle~{}\begin{bmatrix}U\Sigma V^{\top}\\ \sqrt{\lambda}VV^{\top}\end{bmatrix}x$ $\displaystyle=$ $\displaystyle~{}\begin{bmatrix}A\\ \sqrt{\lambda}I_{d}\end{bmatrix}x,$ $$

where the first step follows from the definition of $\widehat{A}$ (see Eq. ([5](#S4.E5))) and $y$ (see Eq. ([6](#S4.E6))), the second step follows from simple algebra, the third step follows from the fact that $DD^{-1}$ is the identity matrix, and the last step follows from the SVD of $A$ (see Eq. ([1](#S4.E1))) and the fact that $V$ is orthogonal.

Finally, we can show

$$ $\displaystyle\|U_{1}\|_{F}^{2}=$ $\displaystyle~{}\|U\Sigma D\|_{F}^{2}$ $\displaystyle=$ $\displaystyle~{}\|\Sigma D\|_{F}^{2}$ $\displaystyle=$ $\displaystyle~{}\sum_{i=1}^{d}\frac{1}{1+\lambda/\sigma_{i}(A)^{2}},$ $$

where the first step follows from the Lemma statement, the second step follows from $U$ is an $n\times n$ orthonormal basis, and the last step follows from the definition of statistical dimension (see Definition [2.11](#S2.Thmtheorem11)).
∎

###### Claim 4.1 ( [ 26 ] , Lemma 12 in [ 1 ] ) .

###### Proof.

### 4.2 Sampling Oracle related to U 1 subscript 𝑈 1 U_{1} italic_U start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT

In this section, we present a sampling oracle related to $U_{1}$. Specifically, given query access to an $n\times d$ matrix $A$, we show how to sample rows from $A$ according to the ridge leverage score distribution of $U_{1}$ in input sparsity time. This sampling oracle serves as a crucial subroutine in our quantum ridge regression algorithm, enabling us to reduce solving the ridge regression problem on $A$ to solving a sampled regular regression problem on a much smaller sampled matrix.

###### Lemma 4.2 (Sampling oracle, a ridge regression version of Lemma 2.13 ) .

Consider query access to matrix $A\in\mathbb{R}^{n\times d}$ with row sparsity $r$. Let $U_{1}$ denote the comprise of first $n$ row of orthonormal basis of $\widetilde{A}=\begin{bmatrix}A\\
\sqrt{\lambda}I_{d}\end{bmatrix}$. For any $\epsilon\in(0,1)$, there is a quantum algorithm that, returns a diagonal matrix $D\in\mathbb{R}^{n\times n}$ such that

- •
Let $\|D\|_{0}$ denote the sparsity of $D$
- •
$D\sim\mathsf{LS}(\widetilde{A}_{1:n})$ (see Definition [2.10](#S2.Thmtheorem10))
–
$\widetilde{A}_{1:n}$ is the distribution with respect to $U_{1}$
- •
It makes $\widetilde{O}(\sqrt{n\cdot\|D\|_{0}})$ row queries to $A$.
- •
It takes $\widetilde{O}(r\sqrt{n\|D\|_{0}}+\operatorname{poly}(d,\|D\|_{0}))$ time.
- •
The success probability $0.999$

###### Proof.

The proof is similar to Lemma [2.13](#S2.Thmtheorem13). The major difference is, in Lemma [2.13](#S2.Thmtheorem13), we estimate a distribution with $n$ scores, and take samples from it.

Here, we estimate a distribution $n+d$ scores (with respect to $\widetilde{A}\in\mathbb{R}^{(n+d)\times d}$), but we only take samples from first $n$ scores (with respect to $U_{1}\in\mathbb{R}^{n\times d}$). Since the summation of first $n$ scores is fixed and can be explicitly computed (see Claim [4.1](#S4.Thmtheorem1) for computation of $\|U_{1}\|_{F}^{2}$). Thus, our sampling is correct.
∎

###### Lemma 4.2 (Sampling oracle, a ridge regression version of Lemma 2.13 ) .

###### Proof.

### 4.3 From LS to SE and SAMP

With the sampling oracle and the structural ridge regression properties established in the previous sections, we now have the key ingredients to show the reduction from ridge regression on $A$ to subsampled regular regression. In this section, we present a tool from Avron, Clarkson and Woodruff [], which shows that if $S$ is sampled from the leverage score distribution, then it is a subspace embedding and spectral norm approximate matrix product. The formal guarantees showing that the ridge leverage score sampler $S$ satisfies the desired properties with respect to $U_{1}$ are presented in the following Lemma. This lemma helps establish the validity of our approach to subsample the ridge regression problem and solve the smaller sketched problem. In later sections, we show how solving this sketched regression problem leads to fast quantum algorithms for ridge regression.

###### Lemma 4.3 (Theorem 16 in [ 1 ] ) .

If the following conditions hold

- •
Given matrix $A\in\mathbb{R}^{n\times d}$
- •
Let $U_{1}\in\mathbb{R}^{n\times d}$ comprise the first $n$ rows of the orthonormal basis of $\begin{bmatrix}A\\
\sqrt{\lambda}I_{d}\end{bmatrix}$
- •
Let $S\sim\mathsf{LS}(A)$
- •
Let $\|S\|_{0}=\widetilde{O}(\epsilon^{-1}\mathsf{sd}_{\lambda}(A))$.

Then we have

- •
$S$ is $\mathsf{SE}(1/2,0.99,n,d)$ for $U_{1}$
- •
$S$ is $\mathsf{SAMP}(\sqrt{\epsilon},0.99,n,d)$ for $U_{1}$

###### Lemma 4.3 (Theorem 16 in [ 1 ] ) .

### 4.4 Guarantee of Sketched Solution

What remains is to formally argue that solving the sketched regression problem on the sampled matrix $SU_{1}$ yields a good approximation to the original ridge regression problem on $A$.
In this section, we fill this missing step by showing that the guarantees provided by subspace embedding and spectral norm approximate matrix product on $U_{1}$ imply that the ridge regression objective is well-preserved between the original problem and the sketched problem.

In particular, in the following Lemma, we prove that if $S$ acts as a subspace embedding and spectral norm approximate matrix product for $U_{1}$, then the ridge regression solution on $SU_{1}$ yields an approximate solution for the ridge regression problem on $A$. Combining this with the sampling results from Section [4.3](#S4.SS3) completes the full reduction argument, demonstrating that we can subsample the ridge leverage scores of $U_{1}$ to reduce ridge regression on $A$ to a much smaller sketched regression problem.

###### Lemma 4.4 (Lemma 11 in [ 1 ] ) .

If the following conditions hold

- •
Given matrix $A\in\mathbb{R}^{n\times d}$
- •
Let $U_{1}\in\mathbb{R}^{n\times d}$ comprise the first $n$ rows of orthonormal basis of $\begin{bmatrix}A\\
\sqrt{\lambda}I_{d}\end{bmatrix}$
- •
Suppose $S$ is $\mathsf{SE}(1/2,0.99,n,d)$ for $U_{1}$
- •
Suppose $S$ is $\mathsf{SAMP}(\sqrt{\epsilon},0.99,n,d)$ for $U_{1}$

Then, we have

$$ $\displaystyle\|Ax^{\prime}-b\|_{2}^{2}+\lambda\|x^{\prime}\|_{2}^{2}\leq(1+ \epsilon)\cdot(\|Ax^{*}-b\|_{2}^{2}+\lambda\|x^{*}\|_{2}^{2})$ $$

###### Lemma 4.4 (Lemma 11 in [ 1 ] ) .

### 4.5 Main Result

In this section, we present our main result for the ridge regression, bringing together the sampling oracle and the reduction arguments based on subspace embedding and approximate matrix multiplication.

###### Theorem 4.5 (Ridge Regression, our result, formal version of Theorem 1.6 ) .

Let $\epsilon\in(0,1)$. Let $\lambda>0$ denote a regularization parameter. Given a matrix $A\in\mathbb{R}^{n\times d}$ and $b\in\mathbb{R}^{n}$. Let $\mathsf{sd}_{\lambda}(A)$ denote the statistical dimension of matrix $A$ (see Definition [2.11](#S2.Thmtheorem11)). There is a quantum algorithm that outputs $x\in\mathbb{R}^{d}$ such that

- •
$\|Ax-b\|_{2}^{2}+\lambda\|x\|_{2}^{2}\leq(1+\epsilon)\min_{x^{\prime}\in
\mathbb{R}^{d}}(\|Ax^{\prime}-b\|_{2}^{2}+\lambda\|x^{\prime}\|_{2}^{2})$
- •
it takes $\widetilde{O}(\sqrt{n\cdot\mathsf{sd}_{\lambda}(A)}/\epsilon)$ row queries to $A$
- •
it takes $\widetilde{O}(\sqrt{n\cdot\mathsf{sd}_{\lambda}(A)}\cdot d/\epsilon+
\operatorname{poly}(d,\mathsf{sd}_{\lambda}(A),1/\epsilon))$ time.
- •
the success probability is 0.999

###### Proof.

It follows from combining Lemma [2.13](#S2.Thmtheorem13), Lemma [4.2](#S4.Thmtheorem2), Claim [4.1](#S4.Thmtheorem1), Lemma [4.3](#S4.Thmtheorem3), and Lemma [4.4](#S4.Thmtheorem4).
∎

###### Theorem 4.5 (Ridge Regression, our result, formal version of Theorem 1.6 ) .

###### Proof.

## Peer Reviews

confidence: 4
contribution: 2
initial_rating: 3
presentation: 3
questions: I don't have further questions other than the existing ones above.
soundness: 4
strengths: This paper develops algorithms that achieve quantum speedups without relying on data-dependent parameters, addressing a significant open problem in quantum linear systems research. The literature review is thorough and well-organized.
summary: This paper considers the problem of solving linear regression, multiple regression, and ridge linear regression using quantum algorithms. Previous quantum algorithms that leverage quantum linear algebra techniques have shown exponential speedups in the system size $n$, but they often depend on certain quantum linear algebra-related parameters, such as the condition number of the regression matrix. An open question is whether quantum speedups can be achieved without relying on data-dependent parameters. This paper answers this question in the affirmative by developing quantum algorithms for linear regression, multiple regression, and ridge regression with quadratic quantum speedups. Technically, the algorithms first generate a subspace embedding of the original regression matrix through sampling from its leverage score distribution, achievable in $O(\sqrt{n})$ time if given a quantum row query oracle. The algorithms then solve the regression problems within this reduced subspace, where the solutions also have small regrets in the original problems.
weaknesses: In my view, the techniques used in this paper are relatively straightforward. Specifically, the main result, Theorem 4.4 in Section 4, is proved by combining Lemma A.1, Lemma 4.1, Lemma 4.2, and Lemma 4.3. Among these, Lemmas 4.1 and 4.2 are from existing literature, Lemma 4.3 involves algebraic calculations on the runtime of matrix multiplication.

Minor comments:
1. There appears to be a grammatical issue in Lemma A.1.
2. Lemma 4.2 is missing the phrase "time" or "time complexity."

---

confidence: 4
contribution: 4
initial_rating: 8
presentation: 3
questions: - Theorems 1.4 and 1.5 define that r is the row-sparsity of the matrix but the running time of the algorithms in them has no dependence on r. Consider removing r from them.
- "Classical linear algebra" section in the related work mentions a lot of references. It would be sufficient to give a smaller number of applications for classical linear algebra, as its significance is well understood.
soundness: 4
strengths: Natural research question: linear regression is an important computational task.
Clear improvement over previous work in the chosen parameter (n).
Writing generally good.
summary: The paper presents a quantum algorithm for linear regression, with the running time of O(\sqrt{n}d^{1.5}+d^w) where n is the number of data points, d is the number of variables and w is the matrix multiplication exponent. It also gives quantum algorithms for multiple regression and ridge regression based on the same ideas.

Classically, running time must be at least linear in n. Quantumly, algorithms with running time polylogarithmic in n are known but their running time depends on the condition number of the regression matrix and other extra parameters. The quantum algorithm in the current paper is the first one with a running time that is sublinear in n, polynomial in d and 1/\epsilon where \epsilon is the desired accuracy and no dependence on extra parameters. 

On the technical level, the results are based on combining the recent quantum algorithm by Apers and Gribling for computing leverage scores with classical algorithms for linear regression.
weaknesses: The paper is a combination of existing results from quantum algorithms (Apers-Gribling) and classical algorithms for linear regression but, given that the end result is interesting, I do not view this as a significant weakness.

---

confidence: 4
contribution: 1
initial_rating: 3
presentation: 1
questions: Same as the weaknesses part.
soundness: 2
strengths: The authors applied the quantum leverage score sampling algorithm proposed in [AG23] to the linear regression problem, and obtained quantum algorithms for linear, multiple and ridge regression problems. The time complexity of their quantum algorithms has a square root dependence on the number of rows for the input matrix, a quadratic speedup in this parameter compared with their classical counterparts, at the cost of increasing extra dependence on the number of columns and the inverse of the precision parameters.
summary: Linear regression is a fundamental problem in the field of optimization and linear algebra. In recent years, many quantum algorithms for linear regression problems have been proposed. However, the time complexity in some of the algorithms has a dependence on the condition number of the input matrix of size $n\times d$. In this work, the authors addressed this issue by proposing a new quantum algorithm with time complexity $O(\sqrt{n} d^{1.5}/\varepsilon + \text{poly}(d/\varepsilon))$ for obtaining an $\varepsilon$-approximate solution, which has no dependence on the condition number. The core technique to achieve this speedup is by using the quantum leverage score sampling procedure proposed in [AG23].
weaknesses: The work appears to lack novelty, as the primary techniques employed to develop the algorithm involve applying quantum leverage score sampling, as proposed in [AG23], and the classical leverage score sampling method for linear regression problems, as proposed in [CW13]. It appears that the paper directly replaces the leverage score sampling procedure from [CW13] with its quantum counterpart to achieve results. Furthermore, the concept of using a quantized leverage score sampling procedure for solving linear regression problems has previously been introduced in [Sha23]. 
Also, the result of the work seems a bit weak compared with the classical counterparts. For input an $n\times d$ matrix, a classical algorithm in [CW13] can run in time $O(nd \log (1/\varepsilon)) + \tilde{O} (d^3)$, which could have logarithmic dependence in the error parameter $\varepsilon$, but the quantum algorithm has a polynomial dependence on $\varepsilon$. For comparison, the quantum algorithm for linear programming proposed in [AG23] also achieves a speedup over their classical counterparts while keeping logarithmic dependence in the precision parameter $\varepsilon$.

Meta-review: This paper considers solving the classical problem of linear regression, multiple regression, and ridge linear regression using quantum algorithms. Previous quantum algorithms that leverage quantum linear algebra techniques have shown exponential speedups in the system size $n$, but they often depend on certain quantum linear algebra-related parameters, such as the condition number of the regression matrix. This paper seeks to circumvent this dependence. 

However, two reviewers acknowledge that the technical contributions and novelty here are limited. They apply quantum leverage score sampling, as proposed in [AG23], and the classical leverage score sampling method for linear regression problems, as proposed in [CW13]. The authors combine these in a rather straightforward manner, and even after the discussion period, the reviewers remain unconvinced by the overall novelty of the paper. Hence, I have to unfortunately, reject the paper.

Decision: Reject