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 = | 37  36  11  40 |
     | -35 -23 -30 46 |
     | -7  -24 24  48 |
     | 41  -33 -37 30 |

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

                      2
o4 = (x + 9)(x - 39)(x  - 38x - 14)

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

o5 = (| 1 0 0  0 |, | 7   47  31  8   |, | 28  -45 34  -46 |)
      | 0 1 0  0 |  | 30  17  -49 15  |  | -46 1   15  -11 |
      | 0 0 38 1 |  | 30  -30 40  -4  |  | 41  20  4   1   |
      | 0 0 14 0 |  | -30 -39 10  -46 |  | -45 -44 -45 0   |

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

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

o7 = false

Ways to use rationalNormalForm :