Characterizing an unknown quantum state typically relies on analysing the outcome of a large set of measurements. Certain quantum-processing tasks are now shown to be realizable using only approximate knowledge of the state, which can be gathered with exponentially fewer resources. 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 statistically1,2. For non-sparse but low-rank quantum states, revealing eigenvectors and corresponding eigenvalues in classical form scales super-linearly with the system dimension3,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 low-rank 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.