next | previous | forward | backward | up | top | index | toc | Macaulay2 web site
Kronecker :: rationalNormalForm

rationalNormalForm -- rational normal form of a matrix

Synopsis

Description

This function produces a matrix B in rational normal form, and invertible matrices P and Q such that P*Q = I and B = P*A*Q.
i1 : R = ZZ/101[x]

o1 = R

o1 : PolynomialRing
i2 : M = R^4

      4
o2 = R

o2 : R-module, free
i3 : A = random(M,M)

o3 = | -44 -44 -37 37  |
     | -11 16  -47 25  |
     | -7  28  36  -1  |
     | 17  -45 -11 -36 |

             4       4
o3 : Matrix R  <--- R
i4 : factor det(x*id_M - A)

       4      3      2
o4 = (x  + 28x  - 33x  - 25x - 14)

o4 : Expression of class Product
i5 : (B,P,Q) = rationalNormalForm A

o5 = (| -28 1 0 0 |, | 0 21  -5 -36 |, | 11  -25 -44 1 |)
      | 33  0 1 0 |  | 0 -20 -2 10  |  | 9   -49 -11 0 |
      | 25  0 0 1 |  | 0 -4  14 27  |  | 7   34  -7  0 |
      | 14  0 0 0 |  | 1 2   15 16  |  | -21 20  17  0 |

o5 : Sequence
i6 : B - P*A*Q == 0

o6 = true
i7 : P*Q - id_M == 0

o7 = true

Ways to use rationalNormalForm :