How can the following optimization problem be solved?
$$\arg\min_{\mathbf{X} \in \mathcal{C}^{n \times m}} \left\Vert \mathbf{X}\mathbf{A}\mathbf{X}^* - \mathbf{B} \right\Vert_F$$
where $\mathbf{A} \in \mathcal{C}^{m \times m}$ and $\mathbf{B} \in \mathcal{C}^{n \times n}$ are Hermitian, with $m > n$, generally. Matrix $\mathbf{A}$ is diagonal and invertible. Let $^*$ denote the conjugate transpose.
Solution attempt
Solution attempt was wrong, see comments. See the answers for a better attempt.
I realize it is possible to take the derivative of the expression and equating it to zero, but I end up with the following expression I have trouble with
$\require{enclose} \enclose{horizontalstrike}{\frac{d}{d \mathbf{X}}\mathrm{Tr}\left( \mathbf{X}\mathbf{A}\mathbf{X}^* \mathbf{X}\mathbf{A}\mathbf{X}^* - 2\mathbf{X}\mathbf{A}\mathbf{X}^*\mathbf{B} + \mathbf{B}^*\mathbf{B} \right) = 0}$
$\require{enclose} \enclose{horizontalstrike}{\mathbf{X}\mathbf{A}\mathbf{X}^* \mathbf{X}\mathbf{A} - \mathbf{B}\mathbf{X}\mathbf{A} = 0}$
Because $\require{enclose} \enclose{horizontalstrike}{\mathbf{A}}$ is invertible
$\require{enclose} \enclose{horizontalstrike}{\mathbf{X}\mathbf{A}\mathbf{X}^*\mathbf{X} - \mathbf{B}\mathbf{X} = 0}$
Which does not seem any simpler.
Variant
Would the following variant be harder to solve? I don't see it working with Måren W's answer below
$\underset{\mathbf{X}}{\mathrm{argmin}} \left\Vert \mathbf{X}\mathbf{A}\mathbf{X}^T - \mathbf{B} \right\Vert_F$
with $m > n$. Again the matrices are complex, but now $\mathbf{A}$ is a symmetric (not Hermitian), diagonal and invertible matrix and $\mathbf{B}$ is also symmetric.
For the special case where $\mathbf{A}$ and $\mathbf{B}$ are positive definite ($\mathbf{B}$ can be positive semidefinite), we may do as follows:
Let $\mathbf{A}=\mathbf{U}_1\mathbf{\Sigma}_1\mathbf{U}_1^*$ be a singular value decomposition of $\mathbf{A}$, and let $\tilde{\mathbf{B}}=\mathbf{U}_2\mathbf{\Sigma}_2\mathbf{U}_2^*$ be a singular value decomposition of the zero padded matrix $$ \tilde{\mathbf{B}} = \begin{bmatrix} \mathbf{B} & \mathbf{0} \\ \mathbf{0} & \mathbf{0} \end{bmatrix} \in\mathcal{C}^{m\times m}. $$ Then $$ \lVert\tilde{\mathbf{X}}\mathbf{A}\tilde{\mathbf{X}}^*-\tilde{\mathbf{B}}\rVert_F = \lVert\tilde{\mathbf{X}}\mathbf{U}_1\mathbf{\Sigma}_1\mathbf{U}_1^*\tilde{\mathbf{X}}^*-\mathbf{U}_2\mathbf{\Sigma}_2\mathbf{U}_2^*\rVert_F = \lVert\mathbf{U}_2^*\tilde{\mathbf{X}}\mathbf{U}_1\mathbf{\Sigma}_1\mathbf{U}_1^*\tilde{\mathbf{X}}^*\mathbf{U}_2-\mathbf{\Sigma}_2\rVert_F. $$ This is zero (and thus minimal) if $\mathbf{U}_2^*\tilde{\mathbf{X}}\mathbf{U}_1\sqrt{\mathbf{\Sigma}_1}=\sqrt{\mathbf{\Sigma}_2}$, i.e. when $$ \tilde{\mathbf{X}}=\mathbf{U}_2\sqrt{\mathbf{\Sigma}_2\mathbf{\Sigma}_1^{-1}}\mathbf{U}_1^*. $$ Now, if $\mathbf{X}$ is the topmost $n\times m$ submatrix of $\tilde{\mathbf{X}}$, then $$ \lVert\mathbf{X}\mathbf{A}\mathbf{X}^*-\mathbf{B}\rVert_F = 0. $$