Make $X^TAX$ identity matrix If we have a $n \times m$ matrix  $X$ where  $m<n$,
and a $A$ $n \times n $ matrix.
Given $X$ , In which case that $A$ can make $ X^T A X$ identity matrix?
Note:
what about if we consider $A$ as a diagonal matrix? 

Let $X$ be an $n$ by $m$ matrix which is tall $(n \ge m)$ and has full rank. Let $X = QR$ denote the $QR$ decomposition of $X$. Then $R$ is a nonsingular $m$ by $m$ matrix. Then
\begin{equation}
X^T A X = R^T Q^T A Q R
\end{equation}
which suggest taking
\begin{equation}
A = Q S Q^T
\end{equation}
for suitable $S$, as the expression collapses to 
\begin{equation}
X^T A X = R^T S R
\end{equation}
It follows that
\begin{equation}
S = R^{-T} R^{-1}
\end{equation}
will solve the problem, although it is unlikely to be diagonal. If $X$ is a wide matrix, then rank consideration shows there are no solutions.
