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 6   -29 45  |
     | -36 15  39  -16 |
     | -42 -17 -3  -33 |
     | -32 -39 14  34  |

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

               3      2
o4 = (x + 48)(x  + 48x  + 41x + 18)

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

o5 = (| 1 0   0 0 |, | -40 -28 -24 29  |, | -17 45  -36 -31 |)
      | 0 -48 1 0 |  | -27 -29 22  -50 |  | -48 2   20  1   |
      | 0 -41 0 1 |  | 16  -9  43  -22 |  | 4   6   -28 0   |
      | 0 -18 0 0 |  | -16 10  -47 -20 |  | -40 -39 44  0   |

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

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

o7 = false

Ways to use rationalNormalForm :