I apologize if similar questions have already been asked, but I have some difficulties with replacements in Mathematica and I would like to make a substitution like
Exp[I m phiA] --> f[m,phiA] Exp[I m phiB] --> f[m,phiB]
where m is a number and
phiB are variables, in expressions that contain sums in the exponent, e.g.
2 + Exp[-2 I (phiA + phiB)] + Exp[2 I phiA + 2 I phiB]
which should give
1/4 + f[-2,phiA] f[-2,phiB] + f[2,phiA] f[2,phiB]
Is this possible? How can it be done?