Is it possible to find $D$, given $Α=DBD^{-1}$ I have a problem of the form
$A = DBD^{-1}$
where $D$ is a diagonal matrix with nonzero, positive elements, and $A$ and $B$ are both square and known. Is it possible to find $D$, and if not, is there a way to constrain the problem further in order to obtain a solution?
Thanks in advance.
 A: Even in the best of cases you can determine $D$ only up to an overall constant factor because
$$ DBD^{-1} = (cD)B(cD)^{-1} $$
In some cases you can't even do that -- most dramatically if $B$ is diagonal, in which case $A=B$ and $D$ can be any nonsingular diagonal matrix whatsoever.
In general, follow Omnomnomnom's advice and rearrange to $AD=DB$. Each non-zero off-diagonal element of $B$ now gives rise to a linear equation connecting the logarithms of two the elements of $D$:
$$ a_{ij}d_j = d_ib_{ij} \implies \log d_i - \log d_j = \log\frac{a_{ij}}{b_{ij}} $$
If you have enough nonzero elements that they correspond to a connected graph between the $d_i$s, you can arbitrarily set $d_1=1$ and work out what the other $d_i$s must be by working your way through the graph.
The more connected components the graph has, the more freedom will you have to choose the $d_i$s independently of each other. The extreme case, as noted above, is when $B$ is diagonal, in which case the graph consists of isolated vertices and no edges.
