I want to solve the following equation for $\mathbf{X}\in\mathbb{C}^{N\times M}$, with $M < N$:
$$\mbox{tr}(\mathbf{X}\mathbf{X}^H)\overline{\mathbf{B}}=\mbox{tr}(\mathbf{X}\mathbf{X}^H\mathbf{B})\mathbf{I}$$
where $\mathbf{B}$ is a known $N\times N$ Hermitian positive semidefinite matrix, and $\mathbf{I}$ is the identity matrix. $\overline{\mathbf{B}}$ means the complex conjugate of $\mathbf{B}$.
I have tried to express $\mathbf{B}$ as $\mathbf{B} = \mathbf{b}\mathbf{b}^H$, and got the following equation
$$ \mbox{tr}(\mathbf{X}\mathbf{X}^H)\overline{\mathbf{b}\mathbf{b}^H}=\mbox{tr}(\mathbf{X}\mathbf{X}^H\mathbf{b}\mathbf{b}^H)\mathbf{I} = \mathbf{b}^H\mathbf{X}\mathbf{X}^H\mathbf{b}\mathbf{I} $$
but still hard to solve.
I also tried to vectorize the matrix, and got
$$ \mbox{vec}^H(\mathbf{X})\mbox{vec}(\mathbf{X})\overline{\mathbf{b}\mathbf{b}^H}=\mbox{vec}^H(\mathbf{X})(\mathbf{X}^H \otimes \mathbf{I})\mbox{vec}(\mathbf{b}\mathbf{b}^H)\mathbf{I} = \mbox{vec}^H(\mathbf{X})\mbox{vec}(\mathbf{b}\mathbf{b}^H \mathbf{X}^H)\mathbf{I} $$
But I have no idea how to solve this, could someone please help me with that?
Clearly $X=0$ is a solution.
Now suppose $X\ne0$. Then $XX^H$ is a nonzero positive semidefinite matrix. Therefore $\operatorname{tr}(XX^H)>0$ and the equation implies that $\overline{B}=kI$ where $k=\frac{\operatorname{tr}(XX^HB)}{\operatorname{tr}(XX^H)}$. The equation can therefore be rewritten as $\operatorname{tr}(XX^H)\overline{k}I=\operatorname{tr}(kXX^H)I$ and further be rewritten as $\operatorname{tr}(XX^H)\overline{k}I=\operatorname{tr}(XX^H)kI$. Since $\operatorname{tr}(XX^H)>0$, it is solvable only if $k$ is real. If this is the case, every nonzero $X$ is a solution.
So, in summary, every (zero or nonzero) $X$ is a solution when $B$ is a real scalar multiple of $I$, or $X=0$ is the only solution otherwise.