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 = | -32 -28 -47 10  |
     | 13  23  2   -41 |
     | -7  11  -5  4   |
     | 6   4   20  -1  |

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

       4      3      2
o4 = (x  + 15x  - 34x  - 20x - 38)

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

o5 = (| -15 1 0 0 |, | 0 22  10  -36 |, | -40 39 -32 1 |)
      | 34  0 1 0 |  | 0 -6  30  48  |  | -30 27 13  0 |
      | 20  0 0 1 |  | 0 40  -47 27  |  | -18 22 -7  0 |
      | 38  0 0 0 |  | 1 -30 49  -24 |  | -43 17 6   0 |

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

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

o7 = true

Ways to use rationalNormalForm :