# Matrix equation $P^TAP=A$

Let $$A\in \mathcal{M}_{m\times m}(\mathbb R)$$ , $$det(A)=1$$ , $$A$$ is positively definite. Which matrices $$P$$ satisfy the equation $$P^TAP=A$$ In fact I am interested in sequences of traces $$tr P^n$$ of the iterations of such solutions.

In dimension $$2$$ one can show that $$P^n=\left( \begin{array}{cc} \cos n\phi& -\beta \sin n\phi \\ \alpha \sin n\phi & \cos n\phi\\ \end{array}\right)$$ for some $$\phi, \alpha, \beta$$ satisfying$$\alpha\beta=1$$ hence $$tr P^n= 2\cos n\phi$$.

• Two comments: All invertible $P$ with this property is a group. The second comment:the expresion $P^TAP$ instead of $P^{-1}AP$ remind me of the following: after change of coordinate with linear part $P$ the first fundamental form of the surface would be replaced by $P^T\mathcal{F}P$ instead of $P^{-1}\mathcal{F}P$. Jun 23, 2021 at 21:30

As $$A=L^\top L$$, for some $$L\in M_{m\times m}(\mathbb{R})$$, $$\det L=1$$, you can rewrite $$P^\top L^\top LP=L^\top L$$ and then multiply both sides by $$L^{-1}$$, etc., obtaining $$(L^{\top})^{-1}P^\top L^\top LPL^{-1}=(LPL^{-1})^\top LPL^{-1}=I$$, i.e. each $$LPL^{-1}$$ must be orthogonal.
As traces are preserved under conjugation, you can assume $$L=I$$, and so your question is reduced to studying traces of orthogonal matrices. The trace is the sum of eigenvalues, which are all modulus 1 complex numbers for orthogonal matrices.
• Centraliser of $A$, i.e. $\{X \in GL_m\mid AX=XA\}$ is a different beast - it depends on eigenvalues of $A$. It's quite small if they are all different, and the whole $GL_m$ is they are all the same. Jun 24, 2021 at 12:08
• Yes I see. On the other hand the Lie algebra of the other group is $V^T A+AV=0$ Jun 24, 2021 at 14:32
Using the vec operator, any matrix $$X$$ such that $$vec A$$ is an eigenvector of $$(X\otimes X)^T$$ corresponding to the eigenvalue $$1$$ would work.