pcar_hessenberg takes as argument a square
matrix A of size n and optionally the name of a symbolic variable.
pcar_hessenberg returns the characteristic polynomial P of A written as the list of its coefficients if no variable was provided or written in its symbolic form with respect to the variable name given as second argument, where
The characteristic polynomial is computed using the Hessenberg algorithm
(see e.g. Cohen) which is more efficient (O(n3) deterministic) if
the coefficients of A 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 e.g. in ℚ.
^3-6 %37 *x
^2+12 % 37 *x-8 % 37
Hence, the characteristic polynomial of [[4,1,-2],[1,2,-1],[2,1,0]] in ℤ/37 ℤ is