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 6   -10 -13 |
     | 8   -20 4   -36 |
     | 26  -37 25  44  |
     | 33  -8  13  -49 |

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

                       2
o4 = (x + 18)(x - 44)(x  + 17x + 5)

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

o5 = (| 1 0 0   0 |, | 18  22  -31 -38 |, | 38  -13 11  31 |)
      | 0 1 0   0 |  | 20  -46 41  4   |  | 32  42  -31 -1 |
      | 0 0 -17 1 |  | -13 -29 -30 4   |  | -10 44  -41 1  |
      | 0 0 -5  0 |  | 28  -24 18  -33 |  | 28  -39 34  0  |

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

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

o7 = false

Ways to use rationalNormalForm :