Spectral Gaps with Quantum Counting Queries and Oblivious State Preparation
Almudena Carrera Vazquez, Aleksandros Sobczyk

TL;DR
This paper introduces a quantum algorithm for efficiently approximating spectral gaps and midpoints of Hermitian matrices, offering potential speed-ups over classical methods, especially for large gaps.
Contribution
The work presents a novel quantum algorithm that approximates spectral gaps with logarithmic qubits and analyzes its complexity, including in the black-box model.
Findings
Quantum algorithm approximates spectral gaps up to additive error with logarithmic qubits.
Complexity bounds show potential speed-up over classical algorithms for large spectral gaps.
Established an lower bound for spectral gap decision in the black-box model.
Abstract
Approximating the -th spectral gap and the corresponding midpoint of an Hermitian matrix with eigenvalues , is an important special case of the eigenproblem with numerous applications in science and engineering. In this work, we present a quantum algorithm which approximates these values up to additive error using a logarithmic number of qubits. Notably, in the QRAM model, its total complexity (queries and gates) is bounded by , where are the accuracy and the failure probability, respectively. For large gaps , this provides a speed-up against the best-known…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
\NAT@set@cites
††thanks: the author contributed to this work exclusively while still at IBM Research and ETH Zurich. Current affiliation: Huawei Zurich Research Center.
Spectral Gaps with Quantum Counting Queries and Oblivious State Preparation
Almudena Carrera Vazquez
IBM Research, Rüschlikon, Switzerland
Aleksandros Sobczyk
IBM Research, Rüschlikon, Switzerland
ETH Zurich, Zurich, Switzerland
Abstract
Approximating the -th spectral gap and the corresponding midpoint of an Hermitian matrix with eigenvalues , is an important special case of the eigenproblem with numerous applications in science and engineering. In this work, we present a quantum algorithm which approximates these values up to additive error using a logarithmic number of qubits. Notably, in the QRAM model, its total complexity (queries and gates) is bounded by , where are the accuracy and the failure probability, respectively. For large gaps , this provides a speed-up against the best-known complexities of classical algorithms, namely, , where is the matrix multiplication exponent. A key technical step in the analysis is the preparation of a suitable random initial state, which ultimately allows us to efficiently count the number of eigenvalues that are smaller than a threshold, while maintaining a quadratic complexity in . In the black-box access model, we also report an query lower bound for deciding the existence of a spectral gap in a binary (albeit non-symmetric) matrix.
1 Introduction
Eigenvalue problems lie in the heart of computational science, engineering, and machine learning. Given an input matrix , the goal is to compute (a subset of) the eigenvalues and/or the eigenvectors , for , which satisfy:
[TABLE]
In this work we focus on algorithms for an important special case of the eigenproblem, namely, the approximation of the so-called spectral gap (or eigengap) and the corresponding midpoint between pairs of consecutive eigenvalues of Hermitian matrices, which we formally define as follows.
Problem 1.1** (Spectral gap and midpoint approximation).**
Let be an Hermitian matrix, with eigenvalues , and be the -th spectral gap and is the corresponding midpoint between and . Given , an integer , and an accuracy , compute two values such that:
[TABLE]
No prior information regarding the eigenvalues or the eigenvectors of is assumed.
Problem 1.1 has numerous applications in different areas. In numerical analysis, estimating spectral gaps is a key subroutine of so-called spectral divide-and-conquer algorithms for diagonalizing matrices [1, 2, 3, 4]. These methods rely on finding a “splitting” point that does not coincide with an eigenvalue; our midpoint estimator provides a natural and well-conditioned choice for such a split, as it maximizes the distance to the nearest eigenvalues. In data analytics, a large gap in the spectrum of a data matrix indicates a separation between the actual information and the “noise” in the data. This phenomenon is often used in Principal Component Analysis [5, 6] to identify good splitting points, or “elbows”, for dimensionality reduction, data visualization, and noise filtering. By directly targeting the -th gap, our algorithm enables the automated detection of these elbows without requiring the explicit computation of (potentially large) subsets of singular values or a full singular value decomposition (SVD). In spectral graph theory, gaps between the eigenvalues of the graph Laplacian reveal connectivity properties, and they can be used, for example, to identify communities, [7, 8, 9, 10].
In the study of quantum phase transitions, the closing of the -th gap, where as the system size increases, serves as a key indicator of topological or magnetic phase transitions [11]. In the context of quantum computing, the size of the spectral gap also determines the runtime of adiabatic state preparation, since the adiabatic theorem requires the evolution time to scale inversely with (a power of) the minimum spectral gap encountered [12]. Last but not least, spectral gaps are also important in electronic structure calculations, for example, to estimate the energy gap (Fermi level) that separates the occupied and unoccupied states of the underlying system [13, 14, 15, 16]. In that direction, our gap estimator could be combined with the techniques of [17] to calculate the electron density of a system at zero temperature.
The aim of this work is to provide a detailed analysis of quantum algorithms for solving Problem 1.1, aiming for provable approximation guarantees and end-to-end worst-case complexity bounds.
1.1 Existing algorithms and complexity bounds
Here we give a brief overview of the related algorithms literature. We first recall that, from the Abel-Ruffini theorem, computing eigenvalues of general matrices is intractable in the algebraic model; see e.g. [18]. Besides trivial cases, such as triangular matrices, algorithms for eigenvalue problems in general return approximate solutions. The computational complexity depends on several different factors, namely, the underlying model of computation, the properties of the input matrix (for example, Hermitian, sparse, structured, or low-rank), the quantities that need to be computed (subset of eigenvalues/eigenvectors), the accuracy, and, for randomized algorithms, the success probability.
In the classical (non-quantum) regime, recent works have established that both the arithmetic and boolean worst-case complexity of diagonalization (approximation of all the eigenvalues and eigenvectors), is upper bounded by operations [3, 19, 20, 21, 22, 4]. Here is the matrix multiplication exponent, currently upper bounded by [23], and hides polylogarithmic factors in and potentially other parameters, such as the accuracy. In terms of solving Problem 1.1 per-se, [20] reports a complexity of operations in the Boolean RAM model.
Beyond the matrix multiplication-type worst-case complexity, fast algorithms have been studied for special classes of matrices. For instance, the eigenvalues of banded symmetric matrices with bands can be computed in time via tridiagonal reduction [20, 24]. For symmetric diagonally dominant matrices (SDD) and graph Laplacians, the smallest eigenvalues of an SDD matrix with non-zeros can be approximated in time [25, 26]. This is faster than the aforementioned bounds even for and , albeit with increased dependence on the accuracy (polynomial instead of logarithmic). The recent work of [27] described an elegant approach specifically targeting spectral gaps of general (non-SDD) sparse symmetric matrices based on stochastic trace estimation [28, 29, 30, 31], albeit, the current worst-case complexity analysis can grow larger than .
The literature on quantum algorithms for eigenvalue problems is vast, and, to date, it keeps growing rapidly. The majority of existing works has focused on the following problems: (i) estimation of extremal eigenvalues, i.e., the ground state energy, (ii) approximating an eigenvalue, given access to the corresponding eigenvector, or (iii) preparation of quantum states that encode eigenvalues as amplitudes. Such methods include the so-called Variational Quantum Eigensolvers [32, 33, 34], and methods based on Quantum Phase Estimation (QPE) [35, 36, 37], such as [38, 39, 40, 41, 42, 43, 44].
Here we highlight recent works that can be considered for solving Problem 1.1, with explicit worst-case complexity bounds. Low and Su [39] (see e.g. Theorem 3) recently proved sharp quantum query bounds for estimating any eigenvalue of general matrices. The query bound is, for Hermitian matrices, where is the block-encoding scaling factor. The algorithm assumes as input an initial state that is -close (in the Euclidean distance) to the corresponding eigenvector. Such a state is hard to obtain in the general case, as it entails to approximate an (unknown) eigenvector.
State preparation assumptions can be relaxed for the problem of estimating the smallest eigenvalues. Recent works of [38, 45, 44, 40] suggest that overlap between the initial state and the target bottom- states is sufficient. If an initial state that satisfies this requirement is readily available, then a straightforward approach to solve Problem 1.1 is to directly [45, 44] to approximate all smallest eigenvalues, in a “brute-force” manner. As it is clearly noted in these works, however, this approach is targeted for approximating few eigenvalues close to the end of the spectrum, in this case, when is small. Moreover, beyond the initial state preparation assumptions, it is required that the smallest eigenvalues are strictly separated by a well-defined minimum gap. For large , and for general Hermitian matrices, it becomes challenging to ensure or to override these assumptions and to guarantee competitive end-to-end complexity bounds in the worst-case.
End-to-end worst-case complexity bounds were proved in recent works by Apers and de Wolf [46], and by Chen, Gilyén and de Wolf [47]. The former showed how to approximate the top- eigenvalues and eigenvectors of SDD matrices with non-zeros in time in the QRAM model. It is faster than the classical SDD algorithms for small and large . For general square matrices, [47] showed how to approximate the top- eigenvectors in , using quantum versions of the power method. As also noted by the authors, however, the algorithm is less competitive for large .
As a last remark, we note that obtaining initial states which sufficiently approximate the target eigenvectors is an interesting research topic on its own. For certain applications, an initial state can be obtained by solving an “easier” or “smaller” version of the problem as a pre-processing step. As [38] notes, this is particularly interesting for quantum chemistry applications [48]. Random states are often recommended for the general case, but they can be also expensive to prepare, as we also discuss here.
1.2 Contributions and methodology
Our main contribution is an algorithm (Algorithm 2) to solve Problem 1.1. In a high-level, it consists of two phases:
- •
In the first phase (Alg. 1), the spectral gap and the midpoint are computed to constant accuracy (i.e., a crude initial approximation).
- •
The second phase (Alg. 2) uses the values returned in the first phase in order to perform a refined search in the restricted domain and increase the solution accuracy.
Both phases use the following steps to locate gaps and/or eigenvalues:
Encode the given Hermitian matrix in a quantum circuit. 2. 2.
Split the spectrum in two parts, by shifting the diagonal elements to a carefully chosen point. 3. 3.
Compute the spectral projector on each part of the spectrum with a polynomial approximation of the sign function. 4. 4.
Compute the trace of the projector. 5. 5.
Repeat 2-4 as a search mechanism (“counting queries”) over a grid to locate eigenvalues and/or gaps.
For Step 1, we use the block-encoding framework [49, 50], which has recently received significant attention for matrix problems. We use the following definition.
Definition 1.1** (Block-Encoding).**
Let be an -qubit matrix, , and . An -Qubit Unitary is an -Block-Encoding of , which is also abbreviated as -QUBE for short, if
[TABLE]
where .
Our main result is summarized in the following theorem.
Theorem 1.1** (Informal, see Theorem 3.1).**
Let be an Hermitian matrix with eigenvalues , , and , and let denote the cost (gate complexity) of the unitary which forms an -block-encoding of . The proposed Algorithm 2 takes as input , an integer , an accuracy , and a failure probability parameter , and it returns values and , which satisfy:
[TABLE]
The total complexity, including all queries to unitaries and auxiliary gates, is bounded by:
[TABLE]
where .
Notably, in the QRAM model, the complexity becomes . This is faster than the arithmetic complexity of the best-known classical algorithms, for all matrices with sufficiently large gaps. This provides evidence that quantum algorithms can beat “matrix multiplication-time” for these problems, at least for the current bound of .
While the general idea is simple, there are several non-trivial parts that need to be addressed to obtain competitive end-to-end complexities. Two major challenges, which can be of independent interest, were the choice of the splitting points, and the preparation of appropriate initial states, which we discuss further below.
Informed choice of splitting points via condition number estimation
As mentioned, the splitting points to split the spectrum and count eigenvalues. If the chosen point is close to an actual eigenvalue, the condition number of the shifted matrix can grow arbitrarily, and it becomes prohibitively expensive to approximate the corresponding spectral projector. Indeed, the convergence of iterative methods, such as the Newton-Schultz iteration or other rational approximations [51], scales as , where is the distance of the splitting point from the closest eigenvalue [49]. For this reason, many existing algorithms that follow this approach require prior knowledge of (or at least a suitable lower bound), which is generally not trivial to obtain.
To avoid this problem, we use a dedicated subroutine which tests whether the gap is larger than a well-defined threshold, before executing any counting query. This is achieved by conveniently applying the ground-energy estimation algorithm of [38] in order to estimate the smallest singular value of the matrix, after shifting its diagonal elements to the chosen splitting point. If this singular value is “large enough”, it means that we can safely count eigenvalues. If not, we keep searching for smaller gaps. This way we have full control of the value of , and, consequently, of the cost of eigenvalue counting.
Initial state preparation
In order to execute our singular value estimation subroutine efficiently, we need to address a second major challenge, which involves the preparation of an appropriate initial state. The algorithm of [38] requires as input an initial state which will overlap appropriately with the corresponding singular vector. In particular, this target singular vector can be any fixed state , and we need to ensure that the initial guess will satisfy
[TABLE]
As the authors of [38, 45] note, such an initial state can be efficiently prepared for certain classes of problems. For instance, if is a binary string with exactly one nonzero entry, a Hadamard state is sufficient, or, in quantum chemistry applications, the Hartree-Fock state can be pre-computed as a “cheap” initial approximation to the ground state [48].
In the general case, where can be any arbitrary state without any explicit prior information, the analysis becomes more involved. In the context of QPE, a common recommendation is to use a random state. However, if the random distribution is not chosen carefully, it can be harmful rather than beneficial. Contributing to this direction, in Section 2.1 we analyze a randomized state preparation method, which achieves all the desired properties. It is oblivious to the target state, in a sense that it guarantees the desired overlap , for any fixed target state, with probability at least . Our construction is an ensemble of a random Rademacher state, together with a randomized Hadamard transform [52, 53, 54]. The latter is a well-established tool in Randomized Numerical Linear Algebra, and it is crucial for our analysis do to its “flattening” properties, commonly attributed as a consequence of the Heisenberg principle.
The size of the final quantum circuit scales as , and it requires a total of random classical bits to prepare. While this cost is prohibitive for applications that target exponential quantum speed-ups, it is “sufficiently cheap” for our analysis, and it can be useful for other works that target polynomial quantum speed-ups.
Lower bounds
The aforementioned upper bounds are also supported with a query lower bound for the problem of deciding whether there exists a gap between two consecutive eigenvalues of a (non-symmetric) binary matrix in the black-box access model. The techniques used here are based on “majority” arguments, inspired by [55, 56, 57]. Evidently, these lower bounds are not tight, as they do not match the reported upper bound. In order to close this complexity gap, we think that one should use entirely different techniques, both for the upper and the lower bounds. This is left as a major open question.
1.3 Notation
denotes an explicit Hilbert space and an ancillary space for post-selection. When we want to emphasize its dimension , we write . The total Hilbert space is given by . Matrices and vectors are denoted with bold capital and small letters, respectively. For a matrix , is the conjugate transpose, denotes its spectral norm, its Frobenius norm, and denotes its spectrum. denotes the gate complexity of the unitary , and we will write when the complexity of is parametrized by .
1.4 Model of computation
The complexity of a quantum algorithm is two-fold. We define the query complexity to be the total number of calls to the block-encoding of the original matrix. The gate complexity is the total number of elementary one- and two-qubit quantum gates, i.e., the size of the quantum circuit. For all algorithms, we explicitly mention both the query and the gate complexities, taking into account all the involved parameters, such as the matrix size, the accuracy, and the success probabilities. For our state-preparation analysis, we also assume access to a (classical) random number generator that produces independent, uniformly random bits.
In Section 4, we specialize the analysis in the so-called Quantum-RAM (or QRAM) model [58]. In this model the quantum processor has access to a memory that stores classical bits. These bits can be read in superposition, but we can only write zeros and ones, just as in the classical case. This model is not necessary for our main analysis, but we dedicate Section 4 to it since it is used in theoretical works, e.g., for graph and matrix computations [46, 47, 41]. For a discussion on QRAM architectures we refer to [59, 60].
1.5 Outline
Section˜2 contains the analysis of the main subroutines that are used by the main algorithms, namely, for state preparation, computing the minimum singular value, and counting eigenvalues that are smaller than a threshold. Section˜3 contains the main algorithm for computing spectral gaps and eigenvalue pairs. In Section˜4 we report the analysis in the QRAM model. In Section˜5 we prove a query lower bound for deciding the existence of a spectral gap in binary matrices in the black-box access model. We finally provide some concluding remarks in Section˜6.
Acknowledgements
We are grateful to Ivano Tavernelli and Simon Apers for valuable discussions.
2 Main Subroutines
Here we describe the main subroutines that are used as building blocks for our main algorithms. Some of the techniques reported here rely on existing results on block-encodings and quantum eigenvalue transformation from [49, 61, 38, 50], which are summarized in Appendix A.
2.1 Oblivious State Preparation
In many applications of QPE, it is required to prepare an initial state that is not orthogonal to the target state (e.g. the ground state). A sufficient condition is typically . The state is sufficient for many applications, e.g., when the desired state is a binary string. For arbitrary , however, there is no theoretical guarantee that is not orthogonal to . For example, it is known that spans the kernel of a connected graph Laplacian, and it is therefore orthogonal to every eigenvector that corresponds to a nonzero eigenvalue.
A reasonable approach to circumvent this limitation is to use random states. However, as already mentioned previously, this needs to be handled with care. Here we describe a random state preparation, inspired by well-known techniques from randomized matrix algorithms [52]. Before stating the main result, we define a state-preparation unitary.
Definition 2.1**.**
A distribution of random quantum circuits forms a -Oblivious State Preparation, or -OSP, if the unitary operates on qubits and it prepares a state such that, for any fixed state :
[TABLE]
Lemma 2.1**.**
Let be any fixed state (e.g. the target ground-state). Let . Here is diagonal with independent diagonal elements, is a Hadamard unitary, and has independent Rademacher elements. Let be a unitary such that . Then, for all , where is a fixed constant, the distribution of unitaries is an -OSP, that is,
[TABLE]
The state can be prepared with elementary gates, i.e., .
Proof.
Let us denote , and to simplify the notation. The operator is a well-studied tool in randomized linear algebra (see e.g. [52]), which has the property that it “flattens” the elements of any fixed vector with high probability. Indeed, using Hoeffding’s inequality, we can see that for any index it holds that
[TABLE]
Taking a union bound for all and setting , we can conclude that
[TABLE]
Denote . It remains to get a lower bound on the overlap . Since is unitary, is a unit vector with flattened entries, which is the key observation to obtain the desired bound. Let and be the largest and second largest elements of in modulus, where . It holds that . For , observe that
[TABLE]
For and , we have that . We now condition on the success of the flattening, and proceed to get a bound for the overlap. Let be four vectors that have exactly the same signs at all the positions except , where in these two positions they have the signs , respectively. The following relations hold:
[TABLE]
Now, denote , and let be the event that , , , and . From the relations above, we can see that (deterministically), we are in one of the following five cases:
[TABLE]
In all cases, at least three out of four vectors satisfy the desired lower bound (deterministically). Then, since we pick any of the four vectors uniformly at random, the success probability is at least .
Since the flattening succeeds with probability , both events succeed with probability at least , which concludes the proof. ∎
2.2 Computing the smallest singular value
Here we describe the subroutine which computes the smallest singular value of a block-encoded matrix. [38] gave an algorithm with near optimal dependence on the precision to find the smallest eigenvalue of a Hermitian matrix .
Theorem 2.1** (Ground energy, Imported Thm. 8 from [38]).**
Let , where , be a Hermitian matrix given through its -block-encoding . Let be an initial state prepared by circuit , with the promise . Then the ground energy can be estimated to additive precision with probability with the following costs:
Queries to : , 2. 2.
Queries to : , 3. 3.
Number of qubits: , 4. 4.
Other elementary gates: .
This can be applied appropriately on the Gramian to compute the minimum singular value.
Lemma 2.2** ().**
Let be a Hermitian matrix, with singular values . Let be an accuracy parameter, and assume that we have access to:
- •
, an -QUBE for , , with cost
- •
, a -OSP, where , and has cost .
We can compute a boolean string , such that satisfies with probability at least , with the following costs:
Queries to : , 2. 2.
Queries to random circuits : , 3. 3.
Number of qubits: , 4. 4.
Other elementary gates: .
Proof.
Given , an -QUBE for with cost , it holds that is an -QUBE for , also with cost . We can combine these two block-encodings as in [50, Lemma 4] to create an -QUBE for , denoted by ,with cost equal to . The minimum eigenvalue of is the square of the minimum singular value of .
The following steps are performed. We first prepare a state where . Then, we use Theorem 2.1 with inputs , , , and . The algorithm returns a bit-string which satisfies with probability at least:
[TABLE]
Here is the block-encoded version of , which satisfies .
From the stability of singular values, which is a consequence of Weyl’s inequality, we conclude that , due to the assumption that . From Theorem 2.1, the cost of such a run is bounded by
- •
queries to ,
- •
queries to ,
- •
qubits,
- •
other elementary gates.
To boost the success probability we can perform multiple runs and keep the median (often referred to as the “median trick”). Note that the returned value is always in , regardless whether the algorithm succeeds or not. Now, assume that we execute runs, and consider the following random variables for each run:
[TABLE]
where . are independent Bernoulli variables which succeed with probability , where . Let . We need to bound the probability that . It holds that . Since, by assumption, we can use a multiplicative Chernoff bound (see e.g. [62]), which gives For , we have that
[TABLE]
Setting we obtain the desired success probability . ∎
2.3 Counting eigenvalues
In this section we describe the second subroutine of our algorithm, which is used to count the eigenvalues of a matrix that are smaller than a given threshold. This is a quantum variant of a standard subroutine in spectral divide-and-conquer eigensolvers [63, 64, 2, 3, 21, 19], often referred to as “NEGCOUNT.” Formally, we have the following lemma.
Lemma 2.3** ().**
Let be a Hermitian matrix with , and a promise that , for some . Given , an -QUBE for , if for some absolute constant , then there exists a quantum algorithm which returns , the true number of eigenvalues of that are smaller than zero, with probability at least , with a cost:
Queries to : , 2. 2.
Number of qubits: , 3. 3.
Other elementary gates: , 4. 4.
Total cost: .
Proof.
The following steps achieve the result.
We use Corollary A.1 to prepare a block-encoding for . As long as for some absolute constant , the corollary returns an -QUBE for with cost
[TABLE] 2. 2.
Thereafter, Corollary A.2 is applied to compute the trace of with accuracy , which takes time
[TABLE] 3. 3.
We now set , , and . Note that this value of satisfies all the requirements of the previous steps. Plugging-in the parameters, the total complexity becomes
[TABLE]
It remains to verify the correctness. Since , the number of eigenvalues of (and also ) that are smaller than zero, is equal to .
From Corollary A.2, the above steps return a value which satisfies . This means that the value satisfies . Therefore, we can round to the nearest integer to recover the true . ∎
3 Main algorithms
We now have all the required tools to describe our main algorithms for the -th spectral gap and midpoint, namely, and . Two algorithms are described. The first one, Algorithm 1 takes as input a Hermitian matrix (scaled to have ), an integer , and a failure probability parameter . It returns constant factor approximations to and .
The second Algorithm 2, takes as input , , , and an accuracy parameter . It first uses Algorithm 1 as a subroutine to compute a coarse (constant factor) approximation to and , and then uses these approximations to refine the accuracy of the solution to the given . As a side-result, it also returns -approximations to the actual eigenvalues and around the gap.
The complexity of these algorithms depends on the value of . However, we highlight that no prior knowledge or lower bound on is required. The only required parameters are the ones given as input to the algorithms. All other parameters that are involved in the complexity are computed/approximated on-the-fly, if required.
Lemma 3.1** (Alg. 1, ).**
Let be an Hermitian matrix with eigenvalues
[TABLE]
Let:
- •
* be the cost of the unitary which forms an -QUBE of .*
- •
* be a -OSP distribution, where has cost .*
Then, given and an integer , Algorithm 1 () computes an approximate midpoint and gap , such that:
[TABLE]
The algorithm succeeds with probability at least . It makes at most:
Queries to unitaries with gate complexity , where :
[TABLE] 2. 2.
Queries to :
[TABLE] 3. 3.
Queries to unitaries with gate complexity , where :
[TABLE] 4. 4.
Number of qubits: 5. 5.
Other elementary gates: .
Proof.
The algorithm executes the following steps. Initially, it sets , and . At each iteration , the goal is to search for all gaps that are larger than .
In the first step of each iteration, a uniform grid with points , , such that . If there exists any gap with width at least , then there exists at least one point such that . For each in the grid, the algorithm proceeds as follows:
Use Lemma A.1 to create an -QUBE of , where we set . The cost of is . 2. 2.
Execute with parameters and to test if satisfies the desired bound.
The requirement of Lemma 2.2 is satisfied, and therefore returns a value which satisfies
[TABLE]
This means that, for each , the algorithm can test if the computed satisfies , and, if this holds for any , then it is ensured that , or, in other words, .
Now, this lower bound allows us to count the eigenvalues smaller than efficiently using :
Use Lemma A.1 to construct an -QUBE for with . Here is the constant from Lemma 2.3 (note that this value of satisfies the requirement of the lemma). The cost of is . 2. 4.
By executing , we obtain , the true number of eigenvalues that are smaller that , with probability at least .
We can now calculate the total costs for each iteration. By replacing and in Lemma 2.2, each call to costs:
Queries to :
[TABLE] 2. 2.
Queries to random state-preparation circuits :
[TABLE] 3. 3.
Number of qubits:
[TABLE] 4. 4.
Other elementary gates:
[TABLE]
From Lemma 2.3, each call to costs:
Queries to : , 2. 2.
Number of qubits: , 3. 3.
Other elementary gates: , 4. 4.
Total cost: .
The number of iterations can be bounded as follows. First, note that a sufficient termination criterion is . If this holds, there exists at least one point in the grid that satisfies . Subsequently, the approximate singular value returned by will satisfy , which means that the algorithm will certainly execute for that point . Ultimately, will verify that is inside the correct gap, and the algorithm will terminate.
We can obtain a necessary termination criterion in a similar way. To see this, assume that the algorithm terminated after finding a point that satisfies . This implies that . But since is inside the correct -th gap, it means that , as initially claimed.
Since we are halving in every iteration, we conclude that the algorithm terminates after iterations, where . This means that . The most expensive iteration is the last one, where the corresponding block-encodings have costs:
- •
, where
[TABLE]
- •
, where
[TABLE]
The total cost of the last iteration is therefore:
[TABLE]
Let us bound each additive term separately. By replacing we have:
[TABLE]
For the second term we have
[TABLE]
After simplifying some constants, the final total cost is bounded by the sum of the following terms:
- •
,
- •
,
- •
where and depend on the values of and , respectively, in the final iteration, and the trailing factor is the number of iterations.
Next, we argue about the correctness of the algorithm and the approximation guarantees of the final results. Once we find some , for which the result of satisfies , we know that the point is inside the correct gap . The algorithm then returns and , which satisfy the following bounds. In the above, we already argued that is necessary for the algorithm to terminate. But we can also see that holds as well. Indeed, the algorithm cannot terminate when , otherwise it would have terminated in the previous step. The combination of these two facts implies that the returned satisfies:
[TABLE]
Combining this with the termination criterion of the algorithm, we also conclude that the returned midpoint satisfies:
[TABLE]
where in the last we replaced and .
Finally, we bound the success probability. There are a total of at most calls to and in each iteration . Each call fails with probability at most . Thus, the total success probability for iteration is at least
[TABLE]
Taking a union bound over all iterations, we have
[TABLE]
∎
With some additional steps the solution accuracy can be increased to any .
Theorem 3.1**.**
Let be an Hermitian matrix, , be an integer, and an accuracy and failure probability parameter, respectively. Let
- •
* denote the cost of the unitary which forms an -QUBE of .*
- •
* be a -OSP distribution.*
Algorithm 2 returns that satisfy:
[TABLE]
In addition to the costs induced by calling Algorithm 1 in the first step, it requires
Queries to unitaries with complexity , where :
[TABLE] 2. 2.
Queries to OSP circuits :
[TABLE] 3. 3.
Queries to unitaries with complexity , where :
[TABLE] 4. 4.
Number of qubits: , 5. 5.
Other elementary gates: .
If we use Lemma 2.1 for , after some simplifications, the total circuit complexity (of both Alg. 1 and 2) is upper bounded by
[TABLE]
where .
Proof.
Let us call and the initial solutions returned by Algorithm 1, i.e., the solutions that satisfy the constant factor accuracy of Lemma 3.1. We know that . By setting , it means that .
We now approximate both eigenvalues and to accuracy each as follows. Consider first . We make a grid on the left of with step , consisting of the points , for . Note that, there exists at least one point such that or, equivalently, .
To find such a point, we first set the parameters:
[TABLE]
and prepare two block-encodings:
- •
,
- •
.
Then we execute the steps 10-18 for each , similar to Algorithm 1, but with the aforementioned parameters. We can verify that the returned values satisfy the advertised bounds.
It remains to bound the complexity. There are a total of points in the two grids, which gives the total number of calls to the subroutines and . At each grid point, we call with parameter , followed by with parameters:
[TABLE]
The cost for each call is
queries to , 2. 2.
queries to OSP circuits , 3. 3.
qubits, 4. 4.
other elementary gates.
In the worst case, will also be called in every iteration. Each call takes as input an –QUBE, accuracy and failure probability . Substituting in Lemma 2.3, each call costs:
[TABLE]
calls to the block-encoding circuit . ∎
4 Complexity in QRAM
In this section we specialize the complexity analysis in the QRAM model [58]. We describe a specific technique to construct block-encodings via the so-called quantum-accessible data structures, studied in [41, 49, 50, 65]. We assume a dense matrix , whose elements are known (i.e. pre-computed), and stored as an array in a classical memory. Given this classical array, a data structure of the form of [41] can be constructed in an offline fashion and stored in a classical memory in arithmetic operations, and it requires space, i.e. words, assuming each matrix element requires one word to store.
For dense matrices, the data structure consists of binary trees with depth and leaves each. If we were to prepare a quantum circuit for the access oracle of this data structure, we would need gates to implement it. To elaborate more, each binary tree can be obtained by constructing a circuit that rotates the state to the state , where the latter contains the leaves of the tree . Such a circuit can be constructed using one and two qubit gates (rotations and CNOT gates) [66, 67], and we need such a circuit for every . However, if the quantum computer has the ability to query the elements of the classical data structure in superposition, which is possible in the QRAM model, the gate complexity can be reduced to [41]. In particular, Theorem 10 of [41] showed that this construction enables efficient circuits implementing the maps
[TABLE]
where is the normalized quantum state corresponding to the -th row of and encodes the row norms. These circuits can be implemented to precision with gate complexity [41, 50]. The following lemma can be used to construct a block-encoding from a quantum-accessible data structure in QRAM.
Lemma 4.1** (Imported result from [50, 49]).**
Let be a matrix stored in a quantum-accessible data structure. There exists a subroutine with and cost .
By using the specific block-encodings from Appendix A and state preparation circuits from Section 2, we can bound the complexity of the algorithm as follows.
Corollary 4.1**.**
Using Lemma˜4.1 to construct block-encodings, and Lemma˜2.1 for state preparation, the total complexity of Theorem 3.1 becomes:
[TABLE]
and the algorithm succeeds with probability at least .
Proof.
It suffices to replace the costs of the block-encodings in Theorem 3.1. For all block-encodings we can use Lemma˜4.1, which means that . The cost has a polylogarithmic dependence on the accuracy. Replacing the costs in Eq. (9) we have
[TABLE]
Combining everything together, Eq. (9) becomes
[TABLE]
where we absorbed all polylogarithmic factors in the trailing term. ∎
5 A lower bound in the Black-Box model
In this section we derive a lower bound for the problem of deciding the existence of a spectral gap of a binary matrix, in the so-called Black-Box access model. Here we assume a unitary through which we can query elements of the matrix via:
[TABLE]
Several lower bounds are known for related problems. A straightforward query lower bound for determining the midpoint can be obtained from the median problem [68]. Let be a quantum algorithm which, given , and an integer , it returns any (classical) value such that . Then can be directly used to solve the median problem, where, given oracle access to a sequence of numbers , where is even, we seek to find a number that lies strictly inside . Such a sequence can be seen as the elements of a diagonal matrix, and the eigenvalues of such a matrix are the diagonal elements themselves. [68] proved a query lower bound for the median problem, assuming that we have oracle access to a quantum circuit implementing the sequence. Indeed, the same bound holds even if we only want to verify that is inside the correct interval, since this generalizes the counting problem [68, 69, 70].
Here we obtain a stronger lower bound for deciding whether there exists a gap between two consecutive eigenvalues, inspired by the reductions of [56, 57]. We remark that the construction below is inherently non-Hermitian. Whether analogous black-box lower bounds hold for Hermitian matrices remains an open question.
Theorem 5.1**.**
Given a matrix , a unitary , and an integer , any quantum algorithm which answers TRUE if , and FALSE otherwise, must execute queries to . Here the eigenvalues of are order such that , and if , then
Proof.
The proof closely follows the techniques of [56, 57] for other similar problems (rank, determinant, matrix power, and inverse), essentially by reducing the problem to counting the number of triangles in a directed graph. Assume that we are given a set and the value , and we ask whether . The query complexity of this problem is [56].
For the reduction the first step is to create a couple of graphs. We create a bipartite graph , with sources and targets , and we insert an edge between and iff . We also create a utility node , which has outgoing edges to every one of the sources, and incoming edges from every one of the targets.
Thereafter, we construct a second bipartite graph which also has sources , targets , and a utility node . We create exactly edges between the sources and the targets, in a round-robin manner, so that the edges are “evenly distributed” among the two vertex sets (for each , we add roughly outgoing edges). Finally, we add edges from to every , and edges from every to .
Note that the two graphs are disjoint. Consider the larger graph , and its adjacency matrix . has nodes. If we choose the node labels of appropriately, consists of two diagonal blocks: one block which corresponds to the adjacency of , and the other to the one of . More specifically,
[TABLE]
We will show that and have only three nonzero eigenvalues.
The elements of the matrix contain the number of paths of length three starting from every node to every other node . Since the only length-three paths from and are towards themselves, the matrix has the following structure:
[TABLE]
where is located in position and in position . It is not hard to see that and are eigenvalues, since .
The matrices and have a special structure. Let us analyze first. From each source vertex , there are exactly paths of length three to every source including itself. This means that the row of contains exactly non-zeros, with the same value , at the positions corresponding to the sources. This gives rise to a submatrix . Looking at the targets , note that there are exactly paths from every node , to . This means that the -th column of the matrix has exactly nonzeros, equal to , at the positions that correspond to target vertices. This gives rise to a submatrix , where and are disjoint. With this description, we conclude that the matrix has the following structure:
[TABLE]
where both and have size . It turns out that they are rank-one matrices. Indeed, we can write , where is the all-ones vector, , and , where . The only nonzero eigenvalues of and are equal to and . We can see that
[TABLE]
Next, we shift our attention to . Since it has very similar structure to , we can argue accordingly that the only two non-zero eigenvalues of are equal to . Now, it follows that
[TABLE]
The above imply that is diagonalizable. The eigenvalues of are the third-roots of the eigenvalues of . Since is real, its complex eigenvalues come in conjugate pairs. The spectrum of is equal to
[TABLE]
where are either all equal to or equal to where are the three third-roots or unity. Similarly, are either all equal to or .
Let be the eigenvalues of sorted in descending order of their real parts, where conflicts are resolved with respect to the imaginary part, i.e.
[TABLE]
We now derive the final argument.
If , we have the following four cases for the eigenvalues of :
[TABLE]
On the opposite direction, we prove each case separately:
- •
If , for , all eigenvalues are equal and hence .
- •
. We already argued that are either all equal to each other or equal to the scaled roots of unity. The same for . The only way that the top-three are equal is if either all are equal and real, or all . Since they are real, and equal to , it means that is also real. We conclude that at least one of is equal to , and at least one of them is equal to , therefore .
- •
The only way that top-6 eigenvalues are equal in pairs, is if both and are the scaled roots of unity, and, in this case, with the same scaling factor, which also implies that .
We conclude that if and only if one of the following relation holds:
- •
- •
.
- •
.
Therefore, one can call the gap algorithm five times, for , and revisit the three cases above in order to verify whether . ∎
6 Conclusion
In this work we studied algorithms for computing spectral gaps between eigenvalues of Hermitian matrices and the corresponding midpoints. One of the main subroutines is a randomized state preparation method, which achieves at least overlap with any fixed target state with probability at least , and requires classical random bits to prepare. This can be used to efficiently approximate the smallest singular value of a block-encoded matrix with high probability, and to count the eigenvalues of a Hermitian matrix that are smaller than a given threshold. In the quantum-accessible data structure model, the total query complexity of our main algorithm scales at most quadratically with respect to the problem size . This indicates the potential for a polynomial quantum speed-up, since the complexity of the best-known classical algorithms require arithmetic operations. In the black-box access model, we also proved an query lower bound for deciding whether there is a gap between two consecutive eigenvalues of a binary matrix.
\c@NAT@ctr
Appendix A Preliminaries on block-encodings and eigenvalue transformation
In this section we recall some basic definitions and known results for block-encodings. Block-encoding refers to the derivation of a unitary operator which can be described by a quantum circuit and “encodes” a given matrix , which was stated in Definition 1.1.
Constructing block-encodings with low cost is not a trivial task. A common approach in the literature is to assume a “black-box” unitary oracle that gives access to a (sparse) matrix . See eg. [49, 71]. Recent works take a step further, describing explicit quantum circuits for the block-encoding of special classes of matrices [72, 73, 50, 74]. In the main algorithm we assume the existence of a general subroutine that can prepare block-encodings, defined as follows.
Definition A.1**.**
A subroutine takes as input a matrix of size and an accuracy , and prepares an -QUBE of . and might be functions of or , for some norm .
It is straightforward to obtain a block-encoding after a diagonal shift.
Lemma A.1** (, follows from [49]).**
Let be a scalar and be a Hermitian matrix with , and be an -QUBE for with cost . We can construct a -QUBE for with a subroutine
[TABLE]
where .
Proof.
We use [49, Lemma 29] in a similar way as in [38]. First we construct a couple of -by- unitaries and , as follows. Set . The values are chosen such that and . Let . One can verify that is an -QUBE of . ∎
A.1 Quantum eigenvalue transformation and matrix sign function
We can now describe how to prepare a block-encoding of the matrix sign function using Quantum Eigenvalue Transformation (QET). We follow the methodology of [38] which is convenient for our analysis, but we also note that many works have studied similar approximations [71, 49, 75, 76]. E.g., an elegant an practical approach is mentioned [75], using a recursive QET based on Padé approximations for the sign function, with sharp complexity bounds.
Corollary A.1** (Adapted from [38, 49]).**
Let be an -QUBE of a Hermitian matrix , , with gate complexity . Let be a scalar in , and assume that , for some (known) . Let be an input accuracy parameter. If , for some absolute constant , then we can construct a unitary which is an -QUBE of . The cost of is:
Queries to : , with , 2. 2.
Number of qubits: , 3. 3.
Other elementary gates: 4. 4.
Total complexity: .
Proof.
Since is an -QUBE for , then, by definition, it is also an -QUBE for a matrix , where . We use Lemma A.1 to prepare an -QUBE for with the same cost (up to constants). Again, by definition, is an -QUBE for a matrix such that .
Using standard techniques from holomorphic functional calculus (see e.g. [19, Lemma B.1]) we know that as long as , for some constant , then it holds that . A sufficient upper bound for is to set . It also holds that since is scale invariant.
It remains to approximate with a polynomial (QET). From Weyl’s inequality, . Therefore, it follows that , where the last bound holds due to the aforementioned value of . From [38, Lemma 3], we can find a polynomial with degree , such that for all , and for all . Consequently, .
From [49, Thm. 2] (or [38, Thm. 1]), we can obtain an -QUBE of using queries of , and elementary gates. This is , and it is easy to see that it forms an -QUBE for , since:
[TABLE]
∎
A.2 Computing the trace of a block-encoded matrix
The main algorithm requires a subroutine to compute the trace of a block-encoded matrix.
Definition A.2** ([61]).**
Let be a density operator on and let be some easy-to-prepare state in . A unitary on is an -preparation unitary of if we have
[TABLE]
where and is implementable using elementary gates.
Proposition A.1**.**
Let denote the identity matrix. Then there exists a -preparation of using CNOT gates and single-qubit gates on .
Proof.
Let denote the basis state on the -dimensional Hilbert space. Then we can prepare the state
[TABLE]
by first applying , where denotes the Hadamard gate, and then CNOT gates between the and the qubits for . Then, we have
[TABLE]
∎
Corollary A.2**.**
Let be an matrix, and . Let be an -QUBE of with circuit complexity such that
[TABLE]
where . There exists a quantum algorithm that produces an estimate of such that
[TABLE]
with probability at least . The algorithm has complexity:
Queries to : , 2. 2.
Number of qubits: , 3. 3.
Other elementary gates: 4. 4.
Total complexity: .
Proof.
From Proposition A.1, there exists an -preparation of with cost elementary gates. From Lemma 5 of [61], we know that if is an -QUBE of with circuit complexity , and has an -preparation unitary, then for every there exists an algorithm that produces an estimate of such that
[TABLE]
with probability at least . The algorithm uses applications of a Grover operator that requires four uses of the R-preparation unitary and two queries to . Note that is an -QUBE of . Using [61, Lemma 5] on with error , we can compute an estimate such that
[TABLE]
with probability at least and circuit complexity
[TABLE]
Then we can set , which satisfies
[TABLE]
∎
The reference list from the paper itself. Each links out to its DOI / PubMed record.
- 1[1] Alex N. Beavers and Eugene D. Denman. “A new similarity transformation method for eigenvalues and eigenvectors”. Mathematical Biosciences 21 , 143–169 (1974). · doi ↗
- 2[2] Yuji Nakatsukasa and Nicholas J. Higham. “Stable and efficient spectral divide and conquer algorithms for the symmetric eigenvalue decomposition and the SVD”. SIAM Journal on Scientific Computing 35 , A 1325–A 1349 (2013). · doi ↗
- 3[3] Jess Banks, Jorge Garza-Vargas, Archit Kulkarni, and Nikhil Srivastava. “Pseudospectral shattering, the sign function, and diagonalization in nearly matrix multiplication time”. Foundations of Computational Mathematics 23 , 1959–2047 (2023). · doi ↗
- 4[4] Rikhav Shah. “Hermitian diagonalization in linear precision”. In Proc. ACM-SIAM Symposium on Discrete Algorithms. Pages 5599–5615 . SIAM (2025). · doi ↗
- 5[5] Ian Jolliffe. “Principal Component Analysis”. Springer-Verlag . (2002). · doi ↗
- 6[6] Bernhard Schölkopf, Alexander Smola, and Klaus-Robert Müller. “Kernel Principal Component Analysis”. In International Conference on Artificial Neural Networks. Pages 583–588 . Springer Berlin Heidelberg (1997). · doi ↗
- 7[7] Ulrike von Luxburg. “A tutorial on spectral clustering”. Statistics and Computing 17 , 395–416 (2007). · doi ↗
- 8[8] Jeff Cheeger. “A lower bound for the smallest eigenvalue of the Laplacian”. In Problems in analysis: A symposium in honor of Salomon Bochner. Pages 195–199 . Princeton University Press, Princeton, NJ (1970). · doi ↗
