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 = | 34 16  49  10 |
     | 48 8   -14 41 |
     | 4  -6  35  50 |
     | 6  -38 -1  32 |

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

       2             2
o4 = (x  - 3x + 11)(x  - 5x + 34)

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

o5 = (| 5   1 0   0 |, | -50 -3  5   -40 |, | -18 -20 -9  -17 |)
      | -34 0 0   0 |  | 4   -26 4   -39 |  | -11 32  36  -18 |
      | 0   0 3   1 |  | 48  15  -25 2   |  | -35 1   -26 1   |
      | 0   0 -11 0 |  | -1  8   27  4   |  | -24 0   -25 0   |

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

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

o7 = true

Ways to use rationalNormalForm :