Quantum phase estimation (source code)

= Quantum phase estimation
{wiki}

Given controlled powers of a unitary $U$ and an eigenstate $U|\psi\rangle=e^{2\pi i\phi}|\psi\rangle$, quantum phase estimation outputs an approximation to $\phi$. If the input is a superposition of eigenstates, measurement selects an eigenphase with probability equal to the squared magnitude of its coefficient.