randomOrthogonal n
randomOrthogonal(n, R)
This method returns a random orthogonal matrix of a given size $n$. The orthogonal matrix is constructed via Cayley's correspondence, which gives a bijection between skew-symmetric matrices, and orthogonal matrices $O$ which do not have $1$ as an eigenvalue (i.e., $O - I$ is invertible). Up to changing signs of rows, any orthogonal matrix can be obtained this way: if $G\cong (\ZZ/2\ZZ)^n$ is the group of diagonal matrices with diagonal entries equal to ±1, acting on $n\times n$ matrices by left multiplication, then (as one may check) every $G$-orbit contains a matrix that does not have $1$ as an eigenvalue (if the characteristic is not 2).
Note that the matrices which feature in the Cayley correspondence have determinant $(-1)^n$, so this method scales by $-1$ to return a special orthogonal matrix. Thus the matrices returned by this method do not have $-1$ as an eigenvalue.
By default a matrix over RR is returned. This method also accepts a ring as an (optional) argument, in which case a special orthogonal matrix over the ring is returned, with entries in the base coefficient ring.
|
|
|
|
|
|
|
|
The object randomOrthogonal is a method function.
The source of this document is in DeterminantalRepresentations.m2:978:0.