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 = | 7  -36 -25 -16 |
     | 16 40  35  -17 |
     | 10 -14 39  26  |
     | 36 -36 38  -9  |

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

               3      2
o4 = (x - 18)(x  + 42x  - 37x + 3)

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

o5 = (| 1 0   0 0 |, | 8   33  -33 25  |, | -43 5   -27 -42 |)
      | 0 -42 1 0 |  | -33 28  -5  -15 |  | 23  -42 -26 1   |
      | 0 37  0 1 |  | -42 -47 22  33  |  | 32  -15 -30 0   |
      | 0 -3  0 0 |  | -33 29  -15 -22 |  | -28 30  -33 0   |

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

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

o7 = false

Ways to use rationalNormalForm :