Let $A$ be a real $m\times n$ matrix and $A=QR$ be the QR decomposition of $A$. For what integer elements of $A$ do $Q$ and $R$ have integer elements?
I think there are two approaches:
- Constructing $A$ so that $A=QR$. (I think this way is not useful)
- Constructing an orthogonal matrix $Q$ with integer elements and an upper triangular matrix $R$ with integer elements so that $A=QR$ have integer elements. (I think this way is better, but I don't know how to achieve it)
Every orthogonal matrix with integer entries are of the form $PD$ (or $DP$ if you like) where $P$ is a permutation matrix and $D$ is a diagonal matrix with entries $\pm 1$. That means if $A = QR$ and all these matrices have integer entries, then $A = PDR$, and rows of $A$ would be just permuted rows of $R$ with possible sign flips. $A$ must have a certain number of zeros in each column (depending on the column index and its dimension) to guarantee that some row permutation can put it into an upper triangular form.