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 = | 49  -13 4   42  |
     | 32  -3  -38 -26 |
     | -25 -12 49  -16 |
     | 2   -49 -17 -24 |

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

              3      2
o4 = (x + 4)(x  + 26x  - 29x - 8)

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

o5 = (| 1 0   0 0 |, | -30 21  -17 -6  |, | -17 -43 -9  31 |)
      | 0 -26 1 0 |  | 47  -43 -49 50  |  | 15  -48 -21 1  |
      | 0 29  0 1 |  | 40  -28 24  37  |  | -39 -15 21  0  |
      | 0 8   0 0 |  | -17 23  -40 -11 |  | 25  39  13  0  |

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

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

o7 = false

Ways to use rationalNormalForm :