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 = | 25  5   -5  46  |
     | -29 5   -1  -14 |
     | -46 -16 -29 -48 |
     | -5  7   -11 -9  |

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

                       2
o4 = (x - 12)(x - 39)(x  - 42x - 29)

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

o5 = (| 39 0  0  0 |, | -22 44  30  -5  |, | -36 4   -13 0   |)
      | 0  12 0  0 |  | 10  -41 -5  27  |  | -17 -49 -9  -42 |
      | 0  0  42 1 |  | -6  -49 -38 -40 |  | -8  11  37  1   |
      | 0  0  29 0 |  | 37  -10 -15 32  |  | 1   1   -2  0   |

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

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

o7 = true

Ways to use rationalNormalForm :