Abstract
The usual way to reveal properties of an unknown quantum state, given many copies of a system in that state, is to perform measurements of different observables and to analyse the results statistically^{1,2}. For nonsparse but lowrank quantum states, revealing eigenvectors and corresponding eigenvalues in classical form scales superlinearly with the system dimension^{3,4,5,6}. Here we show that multiple copies of a quantum system with density matrix ρ can be used to construct the unitary transformation e^{−iρt}. As a result, one can perform quantum principal component analysis of an unknown lowrank density matrix, revealing in quantum form the eigenvectors corresponding to the large eigenvalues in time exponentially faster than any existing algorithm. We discuss applications to data analysis, process tomography and state discrimination.
Similar content being viewed by others
Main
Quantum tomography is the process of discovering features of an unknown quantum state ρ (refs 1, 2). Quantum tomography is a widely used tool with important practical applications in communication systems such as optical channels, precision measurement devices such as atomic clocks, and quantum computation. The basic assumption of quantum tomography is that one is given multiple copies of ρ in a ddimensional Hilbert space, for example, states of atoms in an atomic clock or inputs and outputs of a quantum channel. A variety of measurement techniques allow one to extract desired features of the state. For example, recent developments have shown that quantum compressed sensing can give significant advantages for determining the unknown state or dynamics of a quantum system, particularly when that state or dynamics can be represented by lowrank or sparse matrices^{3,4,5,7,8}. The spectral decomposition of a matrix represents the matrix in terms of its eigenvectors and corresponding eigenvalues. The optimal lowrank approximation of a matrix can be constructed from the spectral decomposition by discarding the eigenvalues and corresponding eigenvectors below a given threshold. This procedure is frequently called principal component analysis (PCA), and can be used, for example, to construct the lowrank approximation of the positive semidefinite symmetric covariance matrix of sampled random vectors^{9,10}. The cost of PCA is prohibitive when one is presented with a large number of highdimensional vectors^{6}.
Conventional quantum state tomography operates by making measurements on multiple copies of the state: the state plays a passive role. This paper shows that the state can play a dynamic role in its own analysis. In particular, we show that multiple copies of the state ρ can be used to implement the unitary operator e^{−iρt}: that is, the state functions as an energy operator or Hamiltonian, generating transformations on other states. Thus, multiple copies of a density matrix can be used to reveal the matrix’s eigenvectors and eigenvalues in quantum form. With further processing and measurements, this density matrix exponentiation can provide significant advantages for quantum tomography. Moreover, it allows us to perform quantum PCA (qPCA) of an unknown lowrank density matrix to construct the eigenvectors corresponding to the large eigenvalues of the state (the principal components) in time O(log d), an exponential speedup over existing algorithms. We also show how qPCA can provide new methods of state discrimination and cluster assignment.
Suppose that one is presented with n copies of ρ. A simple trick allows one to apply the unitary transformation e^{−iρt} to any density matrix σ up to nth order in t. Note that
Here tr_{P} is the partial trace over the first variable and S is the swap operator. S is a sparse matrix and its elements are efficiently computable, so e^{−iSΔt} can be performed efficiently^{11,12,13,14}. Repeated application of (1) with n copies of ρ allows one to construct e^{−iρnΔt}σe^{iρnΔt}. Comparison with the Suzuki–Trotter theory of quantum simulation^{11,12,13,14} shows that to simulate e^{−iρt} to accuracy ε requires n = O(t^{2}ε^{−1}ρ − σ^{2}) ≤ O(t^{2}ε^{−1}) steps, where t = nΔt and   is the sup norm. Thus, simply performing repeated infinitesimal swap operations on ρ ⊗ σ allows us to construct the unitary operator e^{−iρt}. The quantum matrix inversion techniques of ref. 15 then allow us to use multiple copies of a density matrix ρ to implement e^{−ig(ρ)} efficiently for any simply computable function g(x).
Note that density matrix exponentiation is most effective when some of the eigenvalues of ρ are large. If all of the eigenvalues are of size O(1/d) then we require time t = O(d) to resolve the eigenvalues^{15}. In contrast, if the density matrix is dominated by a few large eigenvalues—that is, when the matrix is well represented by its principal components—then the method works well (the accuracy will be analysed below). In this case, there exists a subspace of dimension R ≪ d such that the projection of ρ onto this subspace is close to ρ: ‖ρ − PρP‖_{1} ≤ ε, where P is the projector onto the subspace. When the matrix is of low rank, the projection is exact. Present techniques for matrix exponentiation are efficient when the matrix to be exponentiated is sparse^{13,14}. The construction here shows that nonsparse but lowrank matrices can also be exponentiated efficiently as long as multiple copies of the corresponding density matrix are available.
Density matrix exponentiation now allows us to apply the quantum phase algorithm to find the eigenvectors and eigenvalues of an unknown density matrix. If we have n copies of ρ, we use the ability to apply e^{−iρt} to perform the quantum phase algorithm^{1}. In particular, the quantum phase algorithm uses conditional applications of e^{−iρt} for varying times t to take any initial state ψ〉0〉 to , where χ_{i}〉 are the eigenvectors of ρ, are estimates of the corresponding eigenvalues, and ψ_{i} = 〈χ_{i}ψ〉. In refs 16, 17 it was shown that the ability to apply an unknown unitary does not automatically translate into the ability to apply the unitary in a conditional fashion. Here, in contrast, the conditional operation can be performed simply by replacing the SWAP operator with a conditional SWAP in the derivation above. More precisely, taket = nΔt, and apply the unitary to the state
where σ = χ〉〈χ and S_{j} swaps σ with the jth copy of ρ. Taking the partial trace over the copies of ρ yields the desired conditional operation t〉χ〉 → t〉e^{−iρt}χ〉. Inserting this conditional operation in the quantum phase algorithm and using the improved phaseestimation techniques of ref. 15 yields the eigenvectors and eigenvalues to accuracy ε by applying the quantum phase algorithm for time t = O(ε^{−1}), and so requires n = O(1/ε^{3}) copies of the state ρ. Using ρ itself as the initial state, the quantum phase algorithm yields the state
Sampling from this state allows us to reveal features of the eigenvectors and eigenvalues of ρ. The use of multiple copies of a state to construct its eigenvectors and eigenvalues will be referred to here as qPCA.
As above, qPCA is useful if ρ has small rank R or admits a rank R approximation. In this case, only the largest R eigenvalues will register as nonzero in the eigenvector/eigenvalue decomposition (2). Using mn copies of ρ we obtain m copies of the decomposition (2), where the ith eigenvalue r_{i} appears ≍r_{i}m times. The features of the ith eigenstate can then be determined by performing a quantum measurement to obtain the expectation value 〈χ_{i}Mχ_{i}〉 of the eigenvector with eigenvalue r_{i} for desired Hermitian M. As long as M is sparse^{11,12,13,14} or efficiently simulable by the methods given in this paper, this measurement can itself be performed in time O(log d). qPCA efficiently reveals the eigenvectors and eigenvalues of the unknown density matrix ρ and allows one to probe their properties. For example, in manybody quantum systems in condensed phase, such as correlated electronic systems and chemical systems, it is of significant importance to simulate certain physical and chemical properties of interest (such as correlation functions, dipole moments, statetostate transitions, tunnelling rates, chemical reactions) when we know the system is in the ground state or first few excited states. Our quantum algorithm could be used to estimate such observables on the corresponding eigenvectors.
As an application to data analysis, suppose that the density matrix corresponds to the covariance matrix of a set of data vectors a_{i} ∈ C^{d} that can be generated in quantum parallel using an oracle. As will now be shown, qPCA then allows us to find and to work with the directions in the data space that have the largest variance in time O(log d). Define the covariance matrix Σ = AA^{†}, where A has columns a_{j}, not necessarily normalized to 1. In quantummechanical form, where e_{i}〉 is an orthonormal basis, and the a_{i}〉 are normalized to 1. Assume that we have quantum access to the columns a_{i}〉 of A and to their norms a_{i}. That is, we have a quantum computer or quantum random access memory^{18,19,20} that takes i〉0〉0〉 → i〉a_{i}〉a_{i}〉. Quantum random access memory requires O(d) hardware resources to store all of the coefficients of the vectors and O(d) switches to make them accessible but allows access to the data in O(log d) operations. As in ref. 21, quantum access to vectors and norms allows us to construct the (unnormalized) state : the density matrix for the second register is proportional to Σ. Using n = O(t^{2}ε^{−1}) copies of Σ/trΣ allows us to implement e^{−itΣ/trΣ} to accuracy ε in time O(n log d). Our method allows us to exponentiate any lowrank matrix Σ in time O(log d) as long as it is presented to us in Gram form Σ = AA^{†}, and we are given quantum access to the columns of A. In contrast, existing methods using the higher order Suzuki–Trotter expansion^{11,12,13,14} require O(d log d) operations to exponentiate nonsparse Hamiltonians. Density matrix exponentiation extends the efficient implementation of e^{−iΣt} to a large class of nonsparse but lowrank matrices Σ.
qPCA for quantum states can be extended to quantum processes by using the Choi–Jamiolkowski state for a completely positive map (ref. 22). For a comprehensive review of the Choi–Jamiolkowski isomorphism in the context of quantum state and process tomography see ref. 2, including a detailed resources analysis of various entanglementassisted protocols. For quantum channel tomography, for example, the Choi–Jamiolkowski state is obtained by sending half of a fully entangled quantum state down the channel. qPCA can then be used to construct the eigenvectors corresponding to the dominant eigenvalues of this state: the resulting spectral decomposition in turn encapsulates many of the most important properties of the channel^{22}.
qPCA is a new state and processtomography primitive that reveals eigenvectors and eigenvalues of density matrices. To get a clearer picture of the advantages and disadvantages of qPCA, it is useful to compare it with quantum compressed sensing^{3,4,5,7,8}, a powerful method for performing tomography on sparse and lowrank density matrices. The primary difference is that qPCA constructs eigenvectors and associates them with the corresponding eigenvalues in time O(R log d): the eigenvectors are then available in quantum form so that their properties can be tested by measurement, and correlated with the eigenvalues. Compressed sensing, in contrast^{3,4,5,7,8}, is a state and processtomography method that reconstructs a classical description of the full density matrix in time O(Rd log d). Only singlequbit preparations and measurements are employed. qPCA could also be used to perform state tomography on the eigenvectors, revealing their components in time O(Rd log d). This classical description of the eigenvalues and eigenvectors can then be used to reproduce the full density matrix in time O(Rd log d), the same as in quantum compressed sensing but relying on the multiqubit infinitesimal swap operation. In contrast, to construct the eigenvectors and eigenvalues using compressed sensing one must first reconstruct the density matrix and then diagonalize it, which takes time >O(d^{2}logR + dR^{2}) by randomized algorithms for lowrank matrices^{6}. It can be shown by informationtheoretic arguments that finding a lowrank approximation by sampling without prior knowledge is lower bounded by Ω(d) (ref. 23). qPCA can be compared to grouprepresentationbased methods for estimating the spectrum and eigenvectors of a density matrix^{24,25,26}. These methods reveal the spectrum^{24,25,26} in time O(poly(log d)) but take time O(d^{2}) to reconstruct the eigenvectors^{26}.
qPCA can also be useful in state discrimination and assignment^{27}. For example, suppose that we can sample from two sets of m states, the first set {ϕ_{i}〉} characterized by a density matrix and the second set {ψ_{i}〉} characterized by a density matrix σ = (1/m)∑ _{i}ψ_{i}〉〈ψ_{i}. Now we are given a new state χ〉. Our job is to assign the state to one set or the other. Density matrix exponentiation and quantum phase estimation then allow us to decompose χ〉 in terms of the eigenvectors and eigenvalues of the ρ–σ:
where ξ_{j}〉 are the eigenvectors of ρ–σ and x_{j} are the corresponding eigenvalues. Measure the eigenvalue register, and assign χ〉 to the first set if the eigenvalue is positive and to the second set if it is negative. If χ〉 is selected from one of the two sets, this procedure is simply minimum error state discrimination^{1}, but exponentially faster. As a bonus, the magnitude of the measured eigenvalue is a measure of the confidence of the set assignment measurement: larger magnitude eigenvalues correspond to higher confidence in the assignment, and magnitude 1 corresponds to certainty—in this case ξ〉 is orthogonal to all of the members of one of the sets. If χ〉 is some other vector, then the method provides a method for supervised learning and cluster assignment^{9,10,21,28}: the two sets are training sets and the vector is assigned to the set of vectors to which it is more similar.
Discussion
Density matrix exponentiation represents a powerful tool for analysing the properties of unknown density matrices. The ability to use n copies of ρ to apply the unitary operator e^{−iρt} allows us to exponentiate nonsparse ddimensional matrices to accuracy ε = O(t^{2}/n), and to perform qPCA to construct the eigenvectors and eigenvalues of a lowrank matrix ρ in time O(R log d). Like quantum matrix inversion^{14}, qPCA maps a classical procedure that takes time polynomial in the dimension of a system to a quantum procedure that takes time polynomial in the logarithm of the dimension. This exponential compression means that qPCA can reveal only a fraction of the full information required to describe the system. That particular fraction of information can be very useful, however, as the ability of density matrix exponentiation to reconstruct its principal components shows.
We anticipate that qPCA can play a key role in a variety of quantum algorithms and measurement applications. As the example of quantum cluster assignment shows, qPCA could be useful for speeding up machine learning problems such as clustering and pattern recognition^{8,9,20,26}. The ability to identify the largest eigenvalues of a matrix together with the corresponding eigenvectors is potentially useful for the representation and analysis of large amounts of highdimensional data.
References
Nielsen, M. A. & Chuang, I. L. Quantum Computation and Quantum Information (Cambridge Univ. Press, 2000).
Mohseni, M., Rezakhani, A. T. & Lidar, D. A. Quantumprocess tomography: Resource analysis of different strategies. Phys. Rev. A 77, 032322 (2008).
Gross, D., Liu, YK., Flammia, S. T., Becker, S. & Eisert, J. Quantum state tomography via compressed sensing. Phys. Rev. Lett. 105, 150401 (2010).
Liu, YK. Universal lowrank matrix recovery from Pauli measurements. Adv. Neural Inf. Proc. Sys. (NIPS) 24, 1638–1646 (2011).
Flammia, S. T., Gross, D., Liu, YK. & Eisert, J. Quantum tomography via compressed sensing: Error bounds, sample complexity and efficient estimators. New J. Phys. 14, 095022 (2012).
Liberty, E., Woolfe, F., Martinsson, PG., Rokhlin, V. & Tygert, M. Randomized algorithms for the lowrank approximation of matrices. Proc. Natl Acad. Sci. USA 104, 20167–20172 (2007).
Shabani, A. et al. Efficient measurement of quantum dynamics via compressive sensing. Phys. Rev. Lett. 106, 100401 (2011).
Shabani, A., Mohseni, M., Lloyd, S., Kosut, R. L. & Rabitz, H. Estimation of manybody quantum hamiltonians via compressive sensing. Phys. Rev. A 84, 012107 (2011).
Bishop, C. M. Pattern Recognition and Machine Learning (Springer, 2006).
Murphy, K. P. Machine Learning: A Probabilistic Perspective (MIT Press, 2012).
Lloyd, S. Universal quantum simulators. Science 273, 1073–1078 (1996).
Aharonov, D. & TaShma, A. Proc. 35th Annu. ACM Symp. on Theory of Computing 20–29 (ACM, 2003).
Berry, D. W., Ahokas, G., Cleve, R. & Sanders, B. C. Efficient quantum algorithms for simulating sparse hamiltonians. Commun. Math. Phys. 270, 359–371 (2007).
Wiebe, N., Berry, D. W., Hoyer, P. & Sanders, B. C. Simulating quantum dynamics on a quantum computer. J. Phys. A 43, 065203 (2010).
Harrow, A. W., Hassidim, A. & Lloyd, S. Quantum algorithm for linear systems of equations. Phys. Rev. Lett. 103, 150502 (2009).
Araújo, M., Feix, A., Costa, F. & Brukner, Č. Quantum circuits cannot control unknown operations. Preprint at http://arxiv.org/abs/1309.7976 (2013).
Nakayama, S., Soeda, A. & Murao, M. Universal implementation of projective measurement of energy. Preprint at http://arxiv.org/abs/1310.3047 (2013).
Giovannetti, V., Lloyd, S. & Maccone, L. Quantum random access memory. Phys. Rev. Lett. 100, 160501 (2008).
Giovannetti, V., Lloyd, S. & Maccone, L. Architectures for a quantum random access memory. Phys. Rev. A 78, 052310 (2008).
De Martini, F. et al. Experimental quantum private queries with linear optics. Phys. Rev. A 80, 010302(R) (2009).
Lloyd, S., Mohseni, M. & Rebentrost, P. Quantum algorithms for supervised and unsupervised machine learning. Preprint at http://arxiv.org/abs/1307.0411 (2013).
Choi, MD. Completely positive linear maps on complex matrices. Lin. Alg. Appl. 10, 285–290 (1975).
BarYossef, Z. Proc. 35th Annu. ACM Symp. on Theory of Computing 335–344 (ACM, 2003).
Keyl, M. & Werner, R. F. Estimating the spectrum of a density operator. Phys. Rev. A 64, 052311 (2001).
Bacon, D., Chuang, I. L. & Harrow, A. W. Efficient quantum circuits for Schur and Clebsch–Gordan transforms. Phys. Rev. Lett. 97, 170502 (2006).
Keyl, M. Quantum state estimation and large deviations. Rev. Math. Phys. 18, 19–60 (2006).
Helstrom, C. W. Quantum Detection and Estimation Theory (Academic, 1976).
Rebentrost, P., Mohseni, M. & Lloyd, S. Quantum support vector machine for big data classification. Preprint at http://arxiv.org/abs/1307.0471 (2013).
Acknowledgements
This work was supported by DARPA, GoogleNASA Quantum Artificial Intelligence Laboratory, AFOSR under a MURI program, and J. Epstein. The authors thank A. Childs and R. Kothari for helpful discussions.
Author information
Authors and Affiliations
Contributions
S.L., M.M. and P.R. contributed to the theoretical research described in the paper and the writing of the manuscript.
Corresponding author
Ethics declarations
Competing interests
The authors declare no competing financial interests.
Rights and permissions
About this article
Cite this article
Lloyd, S., Mohseni, M. & Rebentrost, P. Quantum principal component analysis. Nature Phys 10, 631–633 (2014). https://doi.org/10.1038/nphys3029
Received:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1038/nphys3029
This article is cited by

Towards provably efficient quantum algorithms for largescale machinelearning models
Nature Communications (2024)

Quantum Algorithm for Classical Multidimensional Scaling
International Journal of Theoretical Physics (2024)

Shallow quantum neural networks (SQNNs) with application to crack identification
Applied Intelligence (2024)

Variational quantum multidimensional scaling algorithm
Quantum Information Processing (2024)

Denoising quantum mixed states using quantum autoencoders
Quantum Information Processing (2024)