Quantum algorithm for linear systems of equations