Compute $B=QAQ^{-1}$ $A,B$ are $n\times n$ matrices, $B=QAQ^{-1}$, and I know $A$ and $B$, how to compute $Q$?

I know if $T$ a linear transformation, and with different basis we get $A$ and $B$, and we could use these basis to compute $Q$, but how to compute if we only got the matrices?
This amounts to finding an invertible solution $Q$ to the Sylvester equation
$$
BQ - QA = 0
$$
You should use SVD decomposition in a such way you decompose them.