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 = | -48 -7  22  19  |
     | 7   12  -47 -27 |
     | 0   -43 -42 -21 |
     | -15 7   16  48  |

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

               3      2
o4 = (x - 32)(x  - 39x  + 34x - 19)

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

o5 = (| 1 0   0 0 |, | -17 -2  36  -18 |, | -44 39  -37 -12 |)
      | 0 39  1 0 |  | -23 27  -20 -29 |  | 40  -10 29  1   |
      | 0 -34 0 1 |  | -1  -12 -13 3   |  | -43 -35 -43 0   |
      | 0 19  0 0 |  | 46  48  -49 39  |  | -41 -44 -15 0   |

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

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

o7 = false

Ways to use rationalNormalForm :