I would like an efficient way to solve for $\mathrm{tr}(X)$, where \begin{equation} XA=B \end{equation} and I know the matrices $A$ and $B$, but not $X$. $A$ and $B$ are Hermitian and sparse and I would like to avoid computing $X$ in its entirety, only to take its trace and nothing else.
There is a detailed answer to a similar question involving the Lyapunov equation, but I hoped that in this simpler case that there may be less involved or more efficient options.
I have been impressed recently by the performance of iterative techniques, such as those of Yousef Saad in solving matrix-vector equations and I wonder whether there is a similar technique that can be applied here? Sadly, the best I can think of at the moment, however, is to solve row-by-row and summing the element corresponding to the diagonal. Of course, that would be counterproductive when an LU decomposition approach would be much more efficient (assuming I have to compute the whole matrix).
Thanks,
Joly