问题
I need to take the square root of a real symmetric 10,000 x 10,000 matrix. I thought of using scipy.linalg.sqrtm. I think the matrix is supposed to have 9,999 positive eigenvalues, and 1 zero eigenvalue. Just to be sure, I printed the eigenvalues; one of them came out around -1.05e-12. Probably just rounding error.
When I then calculated the matrix square root, I got entries with an imaginary part around e-10. Of course I could just chop those off and proceed with just the real parts (order of magnitude at least e-4). But are those trustworthy, or could the negative eigenvalue have ruined the accuracy of those?
Thanks
来源:https://stackoverflow.com/questions/57252639/square-root-of-positive-semidefinite-matrix-worried-about-bad-eigenvalue