Quantum phase estimation algorithm