Suppose $A$ is a positive definite $m \times m$ matrix, and $B$ is a positive definite $n \times n$ matrix; note that $m$ and $n$ are not necessarily equal. Is there a closed-form solution to the equation $A = X B X^\top$? If there are multiple solutions, then I'm fine with any closed-form solution. If there is no closed-form solution, then is there a standard way of numerically solving such an equation, besides just minimizing $\min ||A-X B X^\top||^2$ with (say) gradient descent?
If $m = n$, this problem has closed-form solution $X =A^{-1/2} (A^{1/2} B A^{1/2} )^{1/2}A^{-1/2}$, but I don't know how to generalize to when $m \ne n$.
In order for your problem to be solvable you need of course $n\geq m$, otherwise the rank of the two sides cannot match, so I first take that as an assumption. Since $A$ and $B$ are positive definite, we can express them through their eigenvalue decompositions as \begin{equation} A = U_A \Lambda_A U_A^\mathrm{T}, \end{equation} \begin{equation} B = U_B \Lambda_B U_B^\mathrm{T}, \end{equation} where $U_A$ and $U_B$ are orthogonal matrices (i.e., $U_A\cdot U_A^\mathrm{T}=I_m$, and the same goes for $B$ after adapting dimensions), while $\Lambda_A$ and $\Lambda_B$ are diagonal matrices with the positive eigenvalues in the diagonal. We can then construct the solution simply by \begin{equation} X = U_A \begin{bmatrix}\Lambda_A^{1/2} & 0_{m\times (n-m)}\end{bmatrix} \Lambda_B^{-1/2} U_B^T. \end{equation} The intuition is that $X$ and $X^\mathrm{T}$ are first diagonalizing $B$, then compensating its eigevalues to $1$, and then fixing $A$. Of course the lower $(n-m)$ rows of $\Lambda_B^{-1/2} U_B^T$ don't affect your solution, so you can take this into account if you want to be more efficient there.