Existence of parametrizations of rational orthogonal matrices I suppose that there are formulas which parametrize all the orthogonal matrices with rational coefficients. Does anyone know anything about it? And what are some publications that discuss this?
Thanks.
 A: The formula in @Carlo Beenakker answer does not give all rational orthogonal matrices, but only those for which $-1$ is not an eigenvalue. Here is a rational parametrization which gives all orthogonal matrices for $n=3$:
$$\frac{1}{a^2+b^2+c^2+d^2}\left(
\begin{array}{ccc}a^2+b^2-c^2-d^2 & 2bc-2ad & 2ac+2bd\\
2ad+2bc & a^2-b^2+c^2-d^2 & 2cd-2ab\\
2bd-2ac & 2ab+2cd & a^2-b^2-c^2+d^2\end{array}\right),$$
where $a,b,c,d$ are integers with no common factor, and not all equal to $0$. This is due to Euler,
and can be proved using quaternions. There is a similar formula for $n=4$.
The answer for $n=4$ is somewhat inconvenient to write here. It was obtained by Euler,  Problema algebraicum ob affectiones prorsus singulares memorabile, Novi Commentarii academiae Scientiarum Petropolitanae, XV, (1771) 75-106.
The formula was proved using quaternions in 1937 by D. Grave, and published in an obscure Ukrainian journal (Zhurnal Instituta Matematiki AN UkrSSR, 3, 73-74.) and in his book Treatease on Algebraic Analysis, vol. I Kiev, 1938.
In English, the formula for $n=4$ is reproduced in the book
S. Khrushchev, Orthogonal polynomials and continued fractions from Euler's point of view, Cambridge UP, 2008. (Encyclopedia of Math and Appl., vol. 122), on page 297.
A: you can use the Cayley transform: $O=(I+H)(I-H)^{-1}$, with $I$ the $n\times n$ identity matrix and $H$ an $n\times n$ skew-symmetric matrix; choose rational values for the matrix elements of $H$ and $O$ will be rational orthogonal; see
The Generation of All Rational Orthogonal Matrices (1991)
