Quantum algorithms for topological and geometric analysis of data

Extracting useful information from large data sets can be a daunting task. Topological methods for analysing data sets provide a powerful technique for extracting such information. Persistent homology is a sophisticated tool for identifying topological features and for determining how such features persist as the data is viewed at different scales. Here we present quantum machine learning algorithms for calculating Betti numbers—the numbers of connected components, holes and voids—in persistent homology, and for finding eigenvectors and eigenvalues of the combinatorial Laplacian. The algorithms provide an exponential speed-up over the best currently known classical algorithms for topological data analysis.

H uman society is currently generating on the order of Avogadro's number (6 Â 10 23 ) of bits of data a year. Extracting useful information from even a small subset of such a huge data set is difficult. A wide variety of big data processing techniques have been developed to extract from large data sets the hidden information in which one is actually interested. Topological techniques for analysing big data represent a sophisticated and powerful tool  . By its very nature, topology reveals features of the data that robust to how the data were sampled, how it was represented and how it was corrupted by noise. Persistent homology is a particularly useful topological technique that analyses the data to extract topological features such as the number of connected components, holes, voids and so on (Betti numbers) of the underlying structure from which the data was generated. The length scale of analysis is then varied to see whether those topological features persist at different scales. A topological feature that persists over many length scales can be identified with a 'true' feature of the underlying structure.
Topological methods for analysis face challenges: a data consisting of n data points possesses 2 n possible subsets that could contribute to the topology. Performing methods of algebraic topology on simplicial complexes eventually requires matrix multiplication or diagonalization of matrices of dimension O n k þ 1 to extract topological features at dimension k. For small k, such operations require time polynomial in n; however, to extract high-dimensional features, matrix multiplication and diagonalization lead to problem solution scalings that grow exponentially in the size of the complex. A variety of mathematical methods have been developed to cope with the resulting combinatorial explosion, notably mapping the complex to a smaller complex with the same homology, and then performing the matrix operations on the reduced complex  . Even in such cases, the initial reduction must identify all simplices in the original complex, and so can scale no better than linearly in the number of simplices. Consequently, even with only a few hundred data points, creating the persistent homology for Betti numbers at all orders of k is a difficult task. In particular, the most efficient classical algorithms for estimating Betti numbers at order k (the number of k-dimensional gaps, holes and so on), have computational complexity either exponential in k or exponential in n (refs [7][8][9][10][11][12], so that estimating Betti numbers to all orders scales exponentially in n, and algorithms for diagonalizing the combinatorial Laplacian (that reveal not only the Betti numbers but additional geometric structure) at order k have computational complexity as O n k 2 !
, where n is the number of vertices in the (possibly reduced) complex. That is, the best classical algorithms for estimating Betti numbers to all orders 9-12 and for diagonalizing the full combinatorial Laplacian grow exponentially in the number of vertices in the complex. This paper investigates quantum algorithms for performing topological analysis of large data sets. We show that a quantum computer can find the eigenvectors and eigenvalues of the combinatorial Laplacian and estimate Betti numbers to all orders and to accuracy d in time O(n 5 /d), thereby reducing a classical problem for which the best existing solutions have exponential computational complexity, to a polynomial-time quantum problem. Betti numbers can also be estimated by using a reduced, or 'witness' complex, that contains fewer points than the original complex [1][2][3][4][5][6][7][8][9][10][11][12] . Applied to such witness complexes, our method again yields a reduction in estimation time from O 2 2ñ À Á to Oñ 5 ð Þ, whereñ is the number of points in the reduced complex.
Recently, quantum mechanical techniques have been proposed for machine learning and data analysis [25][26][27][28][29][30][31][32][33][34] . In particular, some quantum machine learning algorithms [31][32][33] provide exponential speed-ups over the best existing classical algorithms for supervised and unsupervised learning. Such 'big quantum data' algorithms use a quantum random access memory (qRAM) [35][36][37] to map an N-bit classical data set onto the quantum amplitudes of a (log 2 N)-qubit quantum state, an exponential compression over the classical representation. The resulting state is then manipulated using quantum information processing in time poly(log 2 N) to reveal underlying features of the data set. That is, quantum computers that can perform 'quantum sampling' of data can perform certain machine learning tasks exponentially faster than classical computers performing classical sampling of data. A discussion of computational complexity in quantum machine learning can be found in ref. 34. Constructing a large-scale qRAM to access NB10 9 À 10 12 pieces of data is a difficult task. By contrast, the topological and geometrical algorithms presented here do not require a large-scale qRAM: a qRAM with O(n 2 ) bits suffices to store all pairwise distance information between the points of our data set. The algorithms presented here obtain their exponential speed-up over the best existing classical algorithms not by having quantum access to a large data set, but instead, by mapping a combinatorially large simplicial complex with O(2 n ) simplices to a quantum state with n qubits, and by using quantum information processing techniques such as matrix inversion and diagonalization to perform topological and geometrical analysis exponentially faster than classical algorithms. Essentially, our quantum algorithms operate by finding the eigenvectors and eigenvalues of the combinatorial Laplacian. But diagonalizing a 2 n by 2 n sparse matrix using a quantum computer takes time O(n 2 ), compared with time O(2 2n ) on a classical computer [38][39][40] .
The algorithms given here are related to quantum matrix inversion algorithms 41 . The original matrix inversion algorithm 41 yielded as solution a quantum state, and left open the question of how to extract useful information from that state. The topological and geometric algorithms presented here answer that question: the algorithms yield as output not quantum states but rather topological invariants-Betti numbers-and do so in time exponentially faster than the best existing classical algorithms. The best classical algorithms for calculating the kth Betti number takes time O(n k ), and estimating Betti numbers to all orders to accuracty d takes time at least O(2 n log(1/d)) (refs 7-12). Exact calculation of Betti numbers for some types of topological sets (algebraic varieties) is PSPACE hard 42 . By contrast, our algorithm provides approximate values of Betti numbers to all orders and to accuracy d in time O(n 5 /d): although no polynomial classical algorithm for such approximate evaluation of topological invariants is known, the computational complexity of such approximation remains an open problem. We do not expect our quantum algorithms to solve a PSPACE-hard problem in polynomial time. We summarize the comparison between the amount of resources required by the classical and quantum algorithms in Table 1.

Results
The quantum pipeline. The quantum algorithm operates by mapping vectors, simplices, simplicial complexes and collections of simplicial complexes to quantum mechanical states, and reveals topology by performing linear operations on those states. The 2 n possible simplices of the simplicial complex are mapped onto an n-qubit quantum state. This state is then analysed using conventional quantum computational techniques of eigenvector and eigenvalue analysis, matrix inversion and so on. The quantum analysis reveals topological features of the data, and shows how those features arise and persist when the scale of analysis is varied. The resulting quantum algorithms provide an exponential speed-up over the best existing classical algorithms for topological data analysis.
In addition to revealing topological features such as Betti numbers, our algorithm uses the relationship between algebraic topology and Hodge theory 9-12,14-24 to reveal geometrical information about the data analysed at different scales. The algorithm operates by identifying the harmonic forms of the data, together with the other eigenvalues and eigenvectors of the combinatorial Laplacian-the quantities that famously allow one to 'hear the shape of a drum' 43 . The quantum algorithm reveals these geometric features exponentially faster than the corresponding classical algorithms. In particular, our quantum algorithm for finding all Betti numbers for the persistent homology for simplicial complexes over n points and for diagonalizing the combinatorial Laplacian takes time O(n 5 /d), where d is the multiplicative accuracy to which Betti numbers and eigenvalues are determined. The best available classical algorithms to perform these tasks at all orders of k take time O(2 2n log(1/d)).
The advantage of big quantum data techniques is that they provide exponential compression of the representation of the data. The challenge is to see if-and this is a big 'if'-it is still possible to process the highly compressed quantum data to reveal the desired hidden structure that underlies the original data set.
Here we show that quantum information processing acting on large data sets encoded in a quantum form can indeed reveal topological features of the data set.
Classical algorithms for persistent homology have two steps (the 'pipeline'). First, one processes the data to allow the construction of a topological structure such as a simplicial complex that approximates the hidden structure from which the data was generated. The details of the topological structure depends on the scale at which data is grouped together. Second, one constructs topological invariants of that structure and analyses how those invariants behave as a function of the grouping scale. As above, topological invariants that persist over a wide range of scales are identified as features of the underlying hidden structure.
The quantum 'pipeline' for persistent homology also has two steps. First, one accesses the data in quantum parallel to construct quantum states that encode the desired topological structure: if the structure is a simplicial complex, for example, one constructs quantum states that are uniform superposition of descriptions of the simplices in the complex. Second, one uses the ability of quantum computing to reveal the ranks of linear maps to construct the topological invariants of the structure. The steps of the quantum pipeline are now described in more detail.
Constructing a simplicial complex. Classical persistent homology algorithms use the access to data and distances to construct a topological structure-typically a simplicial complex-that corresponds to the hidden structure whose topology one wishes to reveal. In the quantum algorithm, we use the ability to access data and to estimate distances in quantum parallel to construct quantum states that encode the simplicial complex. Each simplex in the complex consists of a fully connected set of vertices: a k-simplex s k consists of k þ 1 vertices j 0 , j 1 , y, j k (listed in ascending order, j 0 oj 1 o y oj k ) together with the k(k þ 1)/2 edges connecting each vertex to all the other vertices in the simplex. Encode a k-simplex s k as a string of n bits, for example, 0110 y 1, with k þ 1 1s at locations j 0 , j 1 , y, j k designating the vertices in the simplex. Removing the 'th vertex and its associated edges from a k-simplex yields a k À 1 simplex. The k þ 1 simplices s k À 1 ' ð Þ with vertices j 0 . . .ĵ ' . . . j k obtained by removing the 'th vertex j ' from s k form the boundary of the original simplex. The number of potential simplices in a simplicial complex is equal to 2 n , the number of possible subsets of the n points in the graph. That is, every member of the power set is a potential simplex. If n is large, the resulting combinatorial explosion means that identifying large simplices can be difficult.
To define a simplicial complex, fix a grouping scale E, and identify k simplices as subsets of k þ 1 points that are all within E of each other. The resulting set of simplices S E is called the Vietoris-Rips complex. The form of the simplicial complex S E depends on the scale E at which its points are grouped together: persistent homology investigates how topological invariants of the simplicial complex depend on the scale E. The collection of simplicial complexes {S E } for different values of the grouping scale E is called a filtration. Note that if a simplex belongs to the complex S E , then it also belongs to S E 0 , E 0 4E. That is, the filtration consists of a sequence of nested simplicial complexes. When E is sufficiently small, only the zero-simplices (points) lie in the complex. As E increases, one and two simplices (edges and triangles) enter the complex, followed by higher order simplices. As E continues to increase, topological features such as holes, gaps and voids come into existence, and then are eventually filled in. For sufficiently large E, all possible simplices are contained in the complex.
Now construct quantum states that correspond to the simplicial complex. Encode simplices as quantum states over n qubits with 1 s at the positions of the vertices. We designate the k-simplex s k by the n-qubit basis vector s k j i2 C 2 n . Denote the n k þ 1 dimensional Hilbert space corresponding to all possible Assume that the distances between pairs of points are either given by a quantum algorithm or stored in qRAM (see Methods section). The ability to evaluate distances translates onto the ability to apply the projector P E k that projects onto the k-simplex space H E k and the projector P E that projects onto the full simplex space H E . d is the multiplicative accuracy to which the Betti numbers and the eigenvalues of the combinatorial Laplacian are determined. Note the trade-off between the exponential quantum speed-up and accuracy: the quantum algorithms obtain an exponential speed-up over classical algorithms but provide an accuracy that scales polynomially in 1/d rather than exponentially. This feature arises from the nature of the quantum phase estimation/matrix inversion algorithms, which obtain their exponential speed-up by estimating eigenvectors and eigenvalues using a 'pointer-variable' measurement interaction [38][39][40] . By contrast, classical algorithms need only keep O(log(1/d)) bits of precision, but must perform O(2 2n ) steps to diagonalize 2 n Â 2 n sparse matrices.
Grover's algorithm can then be used to construct the k-simplex state where as above S E k is the set of k simplices in the complex at scale E. That is, c j i E k is the uniform superposition of the quantum states corresponding to k simplices in the complex. For each simplex s k , we can verify whether s k 2 S E k in O(k 2 ) steps. That is, we can implement a membership function f E k s k ð Þ ¼ 1 of s k 2 S E k in O(k 2 ) steps. The multi-solution version of Grover's algorithm then allows us to construct the k-simplex state of equation (1).
The construction of the k-simplex state via Grover's algorithm reveals the number of k simplices S E is the fraction of possible k simplices that are actually n the complex at scale E. When this fraction is too small, the quantum search procedure will fail to find the simplices. For ko on, we , and z E k is only polynomially small in n. By contrast, for kEn, z k E can be exponentially small in n: if only an exponentially small set of possible simplices actually lie in the complex, quantum search will fail to find them. For the purposes of performing the quantum algorithm, we fix a parameter z that determines the accuracy to which we wish to determine the simplex state, and run the simplex finding algorithm for a time z À 1/2 . At each grouping scale E, the algorithm will find k simplices when z E k 4z, and estimate the number of k simplices to accuracy z E k AE z. As E increases, more and more simplices enter into the complex; z E k increases; and quantum search will succeed in constructing the simplex state to greater and greater accuracy. When E becomes larger than the maximum distance between vectors, all simplices are in the complex.
Below, it will prove useful to have, in addition to the simplex state c which is the uniform mixture of all k-simplex states in the complex at grouping scale E. r E k can be constructed in a straightforward fashion from the simplex state c j i E k by adding an ancilla and copying the simplex label to construct the state 1 ffiffiffiffiffiffi Tracing out the ancilla then yields the desired uniform mixture over all k simplices. In summary, we can represent the the simplicial complex in quantum mechanical form using exponentially fewer bits than that are required classically. Indeed, the quantum search method for constructing simplicial states works best when z E k is not too small, so that a substantial fraction of simplices that could be in the complex are actually in the complex. But this regime is exactly the regime where the classical algorithms require an exponentially large amount of memory space bits merely to record which simplices are in the complex. Now we show how to act on this quantum mechanical representation of the filtration to reveal persistent homology.
Topological analysis. Having constructed a quantum state that represents the simplicial complex S E at scale E, we use quantum information processing to analyse its topological properties. In algebraic topology in general, and in persistent homology in particular, this analysis is performed by investigating the properties of linear maps on the space of simplices. As above, let H E k be the Hilbert space spanned by vectors corresponding to k simplices in the complex at level E. We identify the vector space H E k with the abelian group C k (the kth chain group) under addition of vectors in the space. Let j 0 y j k be the vertices of s k . Define the boundary map @ k on the space of k simplices by where as above s k À 1 ' ð Þ is the k À 1 simplex on the boundary of s k with vertices j 0 . . .ĵ ' . . . j k obtained by omitting the 'th vertex j ' from s k . The boundary map maps each simplex to the oriented sum of its boundary simplices. @ k is a n k Â n k þ 1 matrix with n À k non-zero entries ± 1 in each row and k þ 1 non-zero entries ±1 per column. Note that @ k @ k þ 1 ¼ 0: the boundary of a boundary is zero. As defined, @ k acts on the space of all k simplices. We define the boundary map restricted to operate from H E k to H E k À 1 to be@ k ¼ @ k P E k , where as above P E k is the projector onto the space of k simplices in the complex at scale E.
The kth homology group H k is the quotient group, Ker@ k =Image k þ 1@ k þ 1 , the kernel of@ k divided by the image of @ k þ 1 acting on H k þ 1 at grouping scale E. The kth Betti number b k is equal to the dimension of H k , which in turn is equal to the dimension of the kernel of@ k minus the dimension of the image of@ k þ 1 .
The strategy that we use to identify persistent topological features operates by identifying the singular values and singular vectors of the boundary map. Connected components, holes, voids and so on, correspond to structures-chains of simplicesthat have no boundary, but that are not themselves a boundary. That is, we are looking for the set of states that lie within the kernel of@ k , but that do not lie within the image of@ k þ 1 . The ability to decompose arbitrary vectors in H E k in terms of these kernels and images allows us to identify Betti numbers at different grouping scales E.
The quantum phase algorithm [38][39][40] allows one to decompose states in terms of the eigenvectors of an Hermitian matrix and to find the associated eigenvalues. Once the k-simplex states c j i E k have been constructed, the quantum phase algorithm allows one to decompose those states in terms of eigenvectors and eigenvalues of the boundary map. The boundary map is not Hermitian. We embed the boundary map@ k into a Hermitian matrix B E k defined by Note that B E k is n-sparse: there are either k or n À k entries per row. Similarly, define the full Hermitian boundary map to be w k þ 1 is the combinatorial Laplacian of the kth simplicial complex [22][23][24] . Because B E ð Þ 2 is the sum of the combinatorial Laplacians, B E is sometimes called the 'Dirac operator', since the original Dirac operator was the square root of the Laplacian. Explicit matrix forms of the Dirac operator and the combinatorial Laplacian are given in the Methods section. Hodge theory 9-12,14-24 implies that the kth homology group satisfies H k ¼ Ker@ k =Image k þ 1@ k þ 1 ffi Ker D k . The dimension of this kernel is the kth Betti number.
To find the dimension of the kernel, apply the quantum phase algorithm [38][39][40] to B E starting from the uniform mixture of simplices r E . The quantum phase algorithm decomposes this state into the eigenvectors of the combinatorial Laplacian, and identifies the corresponding eigenvalues. The probability of yielding a particular eigenvalue is proportional to the dimension of the corresponding eigenspace. As above, classical algorithms for finding the eigenvalues and eigenvectors of the combinatorial Laplacians D k , and calculating the dimension of the eigenspaces ð Þ computational steps using sparse matrix diagonalization via Gaussian elimination or the Lanczos algorithm. On a quantum computer, however, the quantum phase algorithm [38][39][40] can project the simplex states c j i E k onto the eigenspaces of the Dirac operator B E and find corresponding eigenvalues to accuracy d in time Oðn 5 d À 1 z À 1=2 Þ, where as above z is the accuracy to which we choose to construct the simplex state. The factor of n 5 arises because the quantum phase algorithm applied to an n-sparse matrix requires time n 3 /d À 1 : the extra factor of n 2 arises because it takes time O(k 2 ) to evaluate the projector P E k onto the subspace of k simplices. The algorithm also identifies the dimension of the eigenspaces of the Dirac operator and combinatorial Laplacian in time Þ, where Z ' is equal to the dimension d ' of the 'th eigenspace divided by S j j k , the dimension of the k-simplex space. The kth Betti number b k is equal to the dimension of the kernel of D k . The algorithm allows us to construct the full decomposition of the simplicial complex in terms of eigenvectors and eigenvalues of the combinatorial Laplacian, yielding useful geometric information such as harmonic forms. Monitoring how the eigenvalues and eigenspaces of the combinatorial Laplacian change as E changes provides geometric information about how various topological features such as connected components, holes and voids come into existence and disappear as the grouping scale changes 16,17,44 .

Discussion
This paper extended methods of quantum machine learning to topological data analysis. Homology is a powerful topological tool. The representatives of the homology classes for different k define the connected components of the simplicial complex, holes, voids and so on. The Betti numbers count the number of connected components, holes, voids and so on. Varying the simplicial scale E and tracking how Betti numbers change as function of E reveals how topological features come into existence and go away as the data is analysed at different length scales. Our algorithm also reveals how the structure of the eigenspaces and eigenvalues of the combinatorial Laplacian changes as a function of E. This 'persistent geometry' reveals features of the data such as rate of change of harmonic forms over different simplicial scales.
The underlying methods of our quantum algorithms are similar to those in other big quantum data algorithms [19][20][21] . The primary difference between the topological and geometrical algorithms presented here, and algorithms for, for example, constructing clusters 19 , principal components 20 , and support vector machines 21 , is that our topological algorithms require only a small qRAM of size O(n 2 ). Consequently, even when the full qRAM resources are included in the accounting of the computational complexity of the algorithms, the topological algorithms require only an amount of computational resources polynomical in the number of data points, while the best existing classical algorithms for answering the same questions require exponential resources.
To recapitulate the steps of the algorithm: First, the quantum data is processed using standard techniques of quantum computation: distances between points are evaluated, simplices of neighbouring points are identified, and a simplicial complex is constructed. The simplicial complex depends on the grouping scale E. We construct a quantum state that represents the filtration of the complex-the set of simplicial complexes, related by inclusion, for different E. This quantum state contains exponentially fewer qubits than the number of bits required to describe the classical filtration of the complex. Second, we use the quantum phase algorithm [38][39][40] to calculate the eigenvalues and to construct the eigenspaces of the combinatorial Laplacian at each scale E. The dimension of the kernel of the combinatorial Laplacian for k simplices is the kth Betti number. In addition, this construction gives us geometric information about the data set.
Classical algorithms for performing the full persistent homology over a space with n points over all scales k take time O(2 2n ): there are 2 n possible simplices, and evaluating kernels and images of the boundary map via Gaussian elimination for sparse matrices takes time that goes as the square of the dimension of the space of simplices. By contrast, the quantum algorithm for constructing the Betti numbers and for decomposing the simplicial complex in terms of eigenvalues and eigenvectors of the combinatorial Laplacian takes time O(n 5 ), compared with O(2 2n ) for classical algorithms. The eigenvectors of the kernels of the combinatorial Laplacian are related to the representatives of the kth homology class via a boundary term. How to extend the quantum algorithms given here to construct the full barcode of persistent homology and to construct the representatives of the homology class directly is an open question. It would also be interesting to extend the quantum algorithmic methods developed here to further algebraic and combinatorial problems, for example, Morse theory.

Methods
Overview. In this section we provide further details of distance evaluation, simplex state construction, and the form of the Dirac operator and the combinatorial Laplacian.
State preparation and distance evaluation. Topological analysis of the data requires distances between data points. Assume that the data set contains n points together with the n(n À 1)/2 distances between them. The data is stored in qRAM or qRAM [35][36][37] , so that the algorithm can access the data in quantum parallel. The essential feature of a qRAM is that it preserves quantum coherence: the qRAM maps a quantum superposition of inputs P j a j j j i 0 j i to a quantum superposition of outputs P j a j j j i v j . Note that a quantum RAM is potentially significantly easier to construct than a full-blown quantum computer. The storage medium of a quantum RAM can be essentially classical: indeed, a single photon reflected off a compact disk encodes in its quantum state all the bits of information stored in the mirrors on the disk. In addition to a classical storage medium such as a CD, a qRAM contains quantum switches that can be opened in quantum superposition to access that information in quantum parallel. Each call to an N-bit qRAM requires log 2 N quantum operations. Quantum RAMS have been designed, and prototypes have been constructed [35][36][37] . In contrast to other big quantum data algorithms [31][32][33] , the size of the qRAM required to perform topological and geometric analysis is relatively small: because the computational complexity of classical algorithms for persistent homology scales as O(2 2n ), while the quantum algorithms require only O(n 2 ) bits worth of qRAM, a significant quantum advantage could be obtained by a qRAM with hundreds to thousands of bits.
As an alternative to being presented with the pre-calculated distances, the data set could consist of n d-dimensional vectorsṽ j È É over the complex numbers, and we can use the qRAM to construct the distancesṽ i Àṽ j between the ith and jth vectors 31 . Finally, the distances can be presented as the output of a quantum computation. In all cases, our quantum algorithms for topological and geometric analysis operate by accessing the distances in quantum parallel. Big quantum data analysis works by mapping each vectorṽ j to a quantum state v j 2 C d , and the entire database to a quantum state 1= ffiffiffi n p ð Þ P j j j i v j 2 C n C d . A quantum RAM can be queried in quantum parallel: given an input state j j i 0 j i, it produces the output state j j i v j , where v j is normalized quantum state proportional to the vectorṽ j . Such a quantum state can be encoded using O(log 2 (nd)) quantum bits, andṽ j is the norm of the vector.
If we have not been given the n(n À 1)/2 distances directly in qRAM, the next ingredient of the quantum algorithm is the ability to evaluate inner products and distances between vectors. In refs 20,31-33 it is shown how the access to vectors in quantum superposition: the ability to create the quantum states corresponding to the vectors translates into the ability to estimate That is, we can construct a quantum circuit that takes as input the state i j i j j i 0 j i and produces as output the state i where the third register contains an estimate of the distance betweenṽ i andṽ j . To estimate the distance to accuracy d takes O(d À 1 ) quantum memory calls and O(d À 1 ðlog 2 ðndÞÞ 2 Þ quantum operations. As with the qRAM, the circuit to evaluate distances operates in quantum parallel. Simplex state construction. To elucidate the construction of the k-simplex states (1), we look more closely into the implementation of Grover's algorithm to understand when it succeeds in constructing the k-simplex state, and how it fails. Start from a superposition n À 1=2 P k k j i over all values of k. Performing simplex construction in parallel via Grover's algorithm with the membership function f E k yields the full simplex state at scale E: By adding ancillae as above, we can also construct the uniform mixture over all values of k and all k simplices: More precisely, if we run the quantum search procedure for a time z À 1/2 , we will obtain the state that contains the simplex states c j i E k for which z E k ! z and which returns a null result 0 j i for the simplex states for which z E k oz. For small E-where only a small fraction of all possible simplices lie within the complex-and fixed z, the simplex state C j i E z will contain the actual simplex states c j i E k only for small k. As E becomes larger and larger, higher and higher k-simplex states enter the filtration and C j i E z will contain more and more of the k-simplex states.
Constructing the simplex state in quantum parallel at m different grouping scales E i yields the filtration state The filtration state F j i z contains the entire filtration of the simplicial complex in quantum superposition. The quantum filtration state contains exponentially fewer quantum bits than the number of classical bits required to describe the classical filtration of the complex: logm qubits are required to register the grouping scale E, and n qubits are required to label the simplices. F j i z takes time O(z À 1/2 n 2 log(m)) to construct. By contrast, a classical description of the filtration of the simplicial complex requires O(2 n ) bits.
Explicit form of the Dirac operator and simplicial Laplacian. Here we present the full matrix form of the Dirac operator B E and the combinatorial Laplacian (B E ) 2 . The Dirac operator is where as above@ k ¼ P E k À 1 @ k P E k is the boundary map confined to the simplicial subspace H E . It is straightforward to verify that the Dirac operator is n-sparse.
The combinatorial Laplacian is obtained by squaring the Dirac operator: The quantum algorithm operates by diagonalizing the Dirac operator.