I would like to generate a uniformly distributed $n \times n$ orthogonal matrix. There seems to be several such methods; see this question and the oft-cited paper by Stewart. Using a QR decompostion of a matrix of normally-distributed variables seems to be another popular method.
However, I am being careful, because apparently it is not hard to generate a subtly-wrong distribution. This paper by Mezzadri demonstrates how it can be wrong for a random unitary matrix.
So, I would like to ask:
- What implementation issues do I need to be aware of when applying either the QR or the Stewart method?
- Are these indeed the fastest methods? (I want to generate $15 \times 15$ matrices on an embedded platform, so both CPU and cache are of the essence)
- How to I verify that the generated distribution is correct?
The last question is important - How do I verify that distribution is correct? What do I need to look for? How can I implement such a test, even if visually for (say) a $2 \times 2$ or $3 \times 3$ matrix?