Finding a diagonal matrix for a given matrix
Let A be a real n×n matrix. Then there exist orthogonal matrices T1 and T2 such that A=T1DT2 where D is a diagonal matrix with positive entries. D is unique up permutation of the diagonal entries. This decomposition is sometimes called Cartan decomposition.
Question: Is it possible to obtain the matrix D for a given matrix A in Sage?
This might be of some interest for you... as well as this answer.
Not sure but have a look at A.eigenmatrix_left() and eigenmatrix_right() , the eigenvectors are orthogonal and the eigenmatrix is diagonal.