Macaulay2 » Documentation
Packages » DeterminantalRepresentations :: randomOrthogonal
next | previous | forward | backward | up | index | toc

randomOrthogonal -- constructs a random special orthogonal matrix

Description

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.

i1 : O1 = randomOrthogonal 5

o1 = | .442386  -.0306554 .751799   -.317548 .370563  |
     | .133864  .768167   -.0944111 -.513838 -.345046 |
     | -.60855  -.385718  .234815   -.587034 -.284854 |
     | -.42001  .39448    .591227   .519553  -.220209 |
     | -.489525 .323399   -.145593  -.143489 .783576  |

                5         5
o1 : Matrix RR    <-- RR
              53        53
i2 : isOrthogonal O1

o2 = true
i3 : eigenvalues O1

o3 = {.070857+.997486*ii}
     {.070857-.997486*ii}
     {.803392+.595451*ii}
     {.803392-.595451*ii}
     {1                 }

o3 : VerticalList
i4 : det O1

o4 = 1

o4 : RR (of precision 53)
i5 : R = QQ[x,y]

o5 = R

o5 : PolynomialRing
i6 : O2 = randomOrthogonal(5, R)

o6 = | -13642637776303/25784639135203 12229430856720/25784639135203 
     | -10626966502320/25784639135203 -22299982236003/25784639135203
     | -8578873737630/25784639135203  898411676400/25784639135203   
     | 526353961350/25784639135203    -2074373150080/25784639135203 
     | -17085652158960/25784639135203 3590161698480/25784639135203  
     ------------------------------------------------------------------------
     -488309514210/1983433779631  12456308748450/25784639135203 
     -101074680000/1983433779631  3866314812080/25784639135203  
     -1465692522094/1983433779631 -13169245762575/25784639135203
     -390527545275/1983433779631  17151229337322/25784639135203 
     1176682179960/1983433779631  -5210172332400/25784639135203 
     ------------------------------------------------------------------------
     11563305687360/25784639135203  |
     6160444867920/25784639135203   |
     -7345702213920/25784639135203  |
     -18447991409400/25784639135203 |
     -9944785964803/25784639135203  |

             5      5
o6 : Matrix R  <-- R
i7 : isOrthogonal O2

o7 = true
i8 : det(O2), det(O2+id_(R^5))

          4480842240000
o8 = (1, --------------)
         25784639135203

o8 : Sequence

See also

Ways to use randomOrthogonal:

  • randomOrthogonal(ZZ)
  • randomOrthogonal(ZZ,Thing)

For the programmer

The object randomOrthogonal is a method function.


The source of this document is in DeterminantalRepresentations.m2:978:0.