Quote:
Originally Posted by krishnai888
I had already asked this question long back but no one has replied to me..I hope someone replies to me because its very important for me as I am doing my internship.
I am currently writing a code involving lot of matrices. At one point I need to calculate the square root of a matrix e.g. A which contains non-zero off-diagonal elements. I searched for a lot of info on net but no algorithm worked. My best bet for finding square root was to find eigenvectors P of a matrix A and its corresponding eigenvalues matrix D, and following formula can be used to calculate square root of matrix
sqrt(A) = [P] * (sqrt[D]) * [transpose of P]
where D matrix is a square matrix with diagonal entries as eigenvalues, so its square root is nothing but square root of diagonal entries.
But this method failed too :( . When I found the square root matrix by this algorithm, I tried squaring that matrix and finding if i get the original matrix A. But I didnt get any values matching with original matrix. I wanted to know if someone has the algorithm or atleast the method for finding an efficient square root of matrix.
Very true only one mistake.
it's not transpose of P, it is inverse of P.
Just change that and check your result.
Thanks