I have a mathematical problem arising from a physics application, which I am sure has been solved before, but I don't know the terminology associated with it. I am looking for references. Briefly, the problem is this:
Given an input function $f$ and a desired output function $g$, find a real-valued function $\phi$ such that the modulus of the Fourier transform $\left|\mathcal{F}\left\{fe^{i\phi}\right\}\right|$ is as close as possible to $|g|$ (with respect to some norm--say $L^2$).
(In my particular case, all functions are defined on a compact subset of $\mathbb{R}^2$, but I doubt that fact matters much.)
In practice, the input function $f$ is an electric field, the phase function $\phi$ is provided by a "spatial light modulator", and the magnitude of the Fourier transform gives the output intensity, which you want to have a specified form.
I'm interested in both abstract results and algorithmic solutions to this problem.
EDIT: Cross-posted on mathoverflow.
I have posted a full answer in the linked mathoverflow question. In short, this problem has been studied many times in many different fields, and goes by the name "phase retrieval problem". There are many algorithms for solving it, the most famous being the "Gerchberg–Saxton algorithm" or "error reduction algorithm". However, there are some more accurate algorithms based on the Monge-Ampere equation, such as the one described in this paper.