You misread the answer (and you linked to a different one). It is $X^*X$, not $X^2$, and it works for matrices of any size.
If your $X$ is real, it is just $X^TX$.
Not sure what you mean by "unique".
You misread the answer (and you linked to a different one). It is $X^*X$, not $X^2$, and it works for matrices of any size.
If your $X$ is real, it is just $X^TX$.
Not sure what you mean by "unique".