I am interested in expressing the matrix $B$ that satisfies $$ (AB)^T (AB) = A^TA $$ In terms of $A$, where $A$ and $B$ are both real-valued square matrices.
Since $(AB)^T = B^T A^T$ and defining $G = A^T A$ we can rewrite this as
$$ B^T G B = G $$ But I have no idea how to continue beyond this, or if it is even possible to express $B$ in terms of $A$.