I have the following scalar function:
$$f\left(\mathbf{X}\right) = \left\|\mathbf{A} - e^{i\mathbf{X}}\mathbf{B}\right\|_{F}^{2} $$
where the matrices $\mathbf{A}$ and $\mathbf{B}$ inside the squared Frobenius norm have complex-valued entries, the matrix $\mathbf{X}$ has real-valued entries, and $i$ is the imaginary unit. Let's assume, for convenience, that all matrices are square and have dimensions $n \times n$.
I want to compute the gradient of this scalar function $f\left(\mathbf{X}\right)$ with respect to the matrix $\mathbf{X}$.
I tried several things but I wasn't able to solve this problem. Any help / hint / guidance would be appreciated.