I have two diagonalizable matrices that are almost equal to eachother, approximately up to a unitary change of basis $ C_2 \approxeq U C_1 U^\dagger + \epsilon$. I want to find said unitary matrix (and using an efficient algorithm).
My first thought was using svd decomposition because then: $C_1=U_1 S_1 V_1$ , $C_2=U_2 S_2 V_2$ you could set $U=U_1 U_2^\dagger$ such that $C_1 \approxeq U C_2 U^\dagger$. I think this would converge.
The problem is that my singular values are very small, I'm getting numerical errors when computing the svd decomposition. Is there another algorithm or a trick I could do? For example the QR decomposition is very stable, but I don't know how to solve this problem without either diagonalization (expensive) or svd decomposition (inaccurate).