Previous Up Next

15.2.8  Characteristic polynomial using Hessenberg algorithm

The pcar_hessenberg command finds the characteristic polynomial of a matrix. It computes the polynomial using the Hessenberg algorithm1 which is more efficient (O(n3) deterministic) if the coefficients of the matrix are in a finite field or use a finite representation like approximate numeric coefficients. Note however that this algorithm behaves badly if the coefficients are, for example, in ℚ.

Examples

pcar_hessenberg([[4,1,-2],[1,2,-1],[2,1,0]] % 37)
     

1%37,
−6
%37,12%37,
−8
%37
          
pcar_hessenberg([[4,1,-2],[1,2,-1],[2,1,0]] % 37,x)
     

1%37
x3+

−6
%37
x2+
12%37
x+
−8
%37
          

Hence, the characteristic polynomial of [

41−2
12−1
210

] in ℤ/37 ℤ is x3−6x2+12x−8.


Previous Up Next