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 = | -34 -3  -35 30  |
     | -15 50  1   14  |
     | -50 -49 30  15  |
     | 23  -16 24  -31 |

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

                       2
o4 = (x + 49)(x + 39)(x  - 2x + 16)

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

o5 = (| 1 0 0   0 |, | 44  19  47 4   |, | -13 -25 39  39  |)
      | 0 1 0   0 |  | -27 -32 24 5   |  | 45  6   -14 -29 |
      | 0 0 2   1 |  | 18  10  -8 -45 |  | 32  -2  6   1   |
      | 0 0 -16 0 |  | -19 23  -5 25  |  | 44  -33 -29 0   |

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

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

o7 = false

Ways to use rationalNormalForm :