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 = | -37 41  -23 -27 |
     | -48 -28 -42 -6  |
     | 0   48  -22 7   |
     | 8   -2  36  0   |

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

               3      2
o4 = (x + 25)(x  - 39x  + 4x - 32)

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

o5 = (| 1 0  0 0 |, | -17 38  -42 -50 |, | -43 42 -12 26 |)
      | 0 39 1 0 |  | 23  8   2   -29 |  | -37 25 37  1  |
      | 0 -4 0 1 |  | -41 -45 -11 -29 |  | 44  41 48  0  |
      | 0 32 0 0 |  | 2   50  19  -28 |  | 4   43 4   0  |

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

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

o7 = false

Ways to use rationalNormalForm :