Estimates amplitudes and phases of a sparse signal using Prony's method.

Single-ancilla quantum phase estimation returns a signal g(k)=sum (ajexp(ik*phij)), where aj and phij are the amplitudes and corresponding eigenvalues of the unitary whose phases we wish to estimate. When more than one amplitude is involved, Prony's method provides a simple estimation tool, which achieves near-Heisenberg-limited scaling (error scaling as N^{-1/2}K^{-3/2}).

signal 1d complex array

the signal to fit

amplitudes list of complex values

the amplitudes a_i, in descending order by their complex magnitude

phases list of complex values

the complex frequencies gamma_i, correlated with amplitudes.