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 = | 41  -32 13 -39 |
     | 15  -28 13 -50 |
     | -50 -27 -7 24  |
     | -14 17  12 1   |

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

       4     3      2
o4 = (x  - 7x  - 39x  - 17x + 49)

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

o5 = (| 7   1 0 0 |, | 0 38  -2  19  |, | -23 -14 41  1 |)
      | 39  0 1 0 |  | 0 -44 43  -42 |  | -31 43  15  0 |
      | 17  0 0 1 |  | 0 -4  14  25  |  | -9  -17 -50 0 |
      | -49 0 0 0 |  | 1 18  -18 36  |  | -8  -24 -14 0 |

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

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

o7 = true

Ways to use rationalNormalForm :