# Finding an orthogonal $P$ and a diagonal matrix $D$ so that $D=P^tAP$

Given some matrix $A$, how do I find a diagonal matrix $D$ and an orthogonal $P$ so that $D = P^t A P$? I know how it's done with a regular $P$ which is invertible, how is it different with $P$ is orthogonal?

• This isn't always possible. Even if $A$ is assumed to be diagonalizable, it's not always possible. But if it possible, you just have to find $P$ in the usual way and then you apply G.S. to its columns. – Git Gud Apr 25 '14 at 14:02
• You can do this if and only if $A$ is (real) symmetric. – Brandon Carter Apr 25 '14 at 14:08
• You can also do something very similar if $A$ is (complex) Hermitian (i.e., $\overline{A}^t = A$), in which case one can find a unitary matrix $P$ (i.e., $P^{-1} = \overline{P}^t$) with $D = \overline{P}^t A P$ a diagonal matrix. (here, $\overline{a+ib} = a-ib$ is complex conjugation) – Nicholas Stull Apr 25 '14 at 15:05