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 = | 29  30  32  -26 |
     | 25  -42 13  -6  |
     | 48  -31 -24 35  |
     | -42 22  -48 38  |

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

                       2
o4 = (x - 27)(x - 10)(x  + 36x + 11)

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

o5 = (| 1 0 0   0 |, | -23 26  35  9   |, | 5   -28 -22 -32 |)
      | 0 1 0   0 |  | 19  -40 -11 3   |  | -24 -4  -31 -18 |
      | 0 0 -36 1 |  | 22  -24 -31 -10 |  | -17 24  8   1   |
      | 0 0 -11 0 |  | -36 30  -5  -31 |  | -10 15  -9  0   |

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

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

o7 = false

Ways to use rationalNormalForm :