genQ generates a square matrix of random normal noise, and then takes the QR decomposition to return Q, a random orthogonal square matrix.
Usage
genQ(n, lim_attempts = 200)
Arguments
n
the dimension of the desired random orthonormal matrix
lim_attempts
the random matrix of normal noise must be full rank to generate the appropriate QR decomposition. lim_attempts gives the maximum number of attempts for generating a full rank matrix of normal noise.