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 = | -47 -49 -42 42  |
     | -49 -15 -25 29  |
     | 9   5   -38 -49 |
     | -21 19  -43 -25 |

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

                       2
o4 = (x + 21)(x + 19)(x  - 16x + 7)

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

o5 = (| -21 0   0  0 |, | 41  -1  -16 -12 |, | -42 -50 45  39  |)
      | 0   -19 0  0 |  | 26  -47 -40 29  |  | 35  43  -27 -33 |
      | 0   0   16 1 |  | -22 -37 41  46  |  | 3   1   47  1   |
      | 0   0   -7 0 |  | -24 -29 -20 -34 |  | 1   1   26  0   |

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

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

o7 = true

Ways to use rationalNormalForm :