# Symmetric matrix from a nonsymmetricc matrix

Basically this is a part of a long algorithm to calculate some matrix properties.

Given an upper triangular square matrix R, how can I find an orthonormal matrix W (possibly iteratively) such that WR is square and symmetric?

I have tried using something like Givens rotations in order to get rid of elements above the diagonal. Yet, I noticed that it results in creating some elements below the diagonal. So, this does not work.

Every non-singular matrix $R\in{\bf M}_n({\mathbb R})$ (for example a triangular) has a unique factorization $QS$ where $Q$ is orthogonal and $S$ is symmetric positive definite. This is calles polar decomposition. So $W=Q^T=Q^{-1}$ is a solution to your problem.
However, there does not exist an algorithm with finitely many operations: $S$ is the square root of $R^TR$, and the square root can only be approached.
• Whether it can be finitely many operations depends on what counts as an "operation" - of course finitely many field operations don't suffice. But if you can find the real roots of a polynomial as an "operation", you can get $S$ by diagonalizing $R^T R$. Iterative methods may be better numerically. – Robert Israel Apr 9 '15 at 6:26
I assume this is over the reals. If the singular value decomposition of $R$ is $R = U \Sigma V^T$ ($U$ and $V$ orthogonal, $\Sigma$ diagonal with nonnegative diagonal entries), then $W = V U^T$ is orthogonal and $W R = V \Sigma V^T$ is symmetric and positive semidefinite. Any good numerical linear algebra library will have functions to compute the SVD.