arXiv:cs/0501074v2 [cs.SC] 8 Feb 2005 aheaius 84 rnbe France. Grenoble, math´ematiques, 38041 ntemti hntecaatrsi oyoil otalgo exampl most for (see nor polynomial, polynomial characteristic Frobenius characteristic the the no of Frobenius than computations of the matrix computation Although the similarity. the on for to matrices two related test closely matr is integer an It of polynomial characteristic the Computing Introduction 1 hrceitcplnma snwdy pia.Ide,ma Indeed, optimal. nowadays is polynomial characteristic iecmlxt oorkoldeteodroei u oDani to due is one older the knowledge our to ( complexity time lovr promising. very also h hr loih fKle-erghsa has Keller-Gehrig of algorithm third the smttctm opeiyis complexity time asymptotic 2 nue hsotmlt.Btwt atmti arithmeti matrix fast with But to proven optimality. is this determinant the ensures of [2] computation the that fact The ipie eso fteagrtmdsrbdi 2]ad[1 and [24] in described algorithm field the finite of our version and case polynomial simplified a integer minimal a propose the the also of we for computation Therefore, exist box matrices. algorithms outpe structured better application or sparse Now basic This cases. [7]. many from chine adaptated using criterion matrices pra integer of in polynomial promising characteristic also is but interest algorit theoretical third of Keller-Gehrig’s only on not focus we bran Then Keller-Gehrig’s improve algorithms. operations; matrix block the prtosoe nt ed epooeanew a propose We field. [ finite in developped a techniques over the used operations we Therefore field. finite matrices. generic ∗ † sn lsi arxmlilcto,teagbactm co time algebraic the multiplication, matrix classic Using sa plcto,w hwta hs eut ietyla t lead directly results these that show we application, an As nti ril efcso h rciaiiyo uhalgori such of practicability the on focus we article this In nvri´ eGeol,lbrtied o´lsto tc et mod´elisation de laboratoire Grenoble, de Universit´e et fCmue n n.Sine nvriyo Delaware, of University Science, Inf. and Computer of Dept. ffiin optto fteCaatrsi Polynomial Characteristic the of Computation Efficient atclrywl utdt preado tutrdmatri structured polynom and/or sparse minimal to integer suited on well remaind based particularly Chinese char and approach, the termination of probabilistic computation early a the use for first basis We comp a matrices. both eliminat as improve results Gaussian these could Then use and algorithm We Keller-Gehrig. iterates third of present Krylov Keller-Gehrig’s algorithm first of on second We the based integers. of is improvement the one over and fields: fields finite small over hsatcedaswt h optto ftecharacterist the of computation the with deals article This enGilueDumas Jean-Guillaume O ( n ω { log enGilueDms Clement.Pernet Jean-Guillaume.Dumas, ∗ n uut1,2016 18, August n Cl´ement Pernet and ,gvnb elrGhi’ rnhn loih 1] Now [18]. algorithm branching Keller-Gehrig’s by given ), Abstract O ( n 1 ω leri iecmlxt u nywrsfor works only but complexity time algebraic ) O ( n 3 lu,LCIA P5 ,5 vnedes avenue 51 X, 53 BP LMC-IMAG alcul, eak E176 USA. 19716, DE Newark, ermidrn n nerytermination early an and remaindering se loih eindt aebnfi of benefit take to designed algorithm ) hn loih n opr hs two these compare and algorithm ching [23, e madpoeta t eeaiainis generalization its that prove and hm ctice. ces. xi lsia ahmtclproblem. mathematical classical a is ix yagrtm aea have algorithms ny frstebs xsigsfwrson softwares existing best the rforms mlfr otismr information more contains form rmal rbblsi loih sn black- a using algorithm probabilistic ( c ,6,frecetbsclna algebra linear basic efficient for 6], 5, 7, peiyo h optto fthe of computation the of mplexity ihst opt taebsdon based are it compute to rithms ea ada arxmultiplication matrix as hard as be eiyadcmuainltime. computational and lexity cplnma fdnematrices dense of polynomial ic a n eslfcoiain is factorization, Hensel and ial O rn o es arcs Then matrices. dense for ering integer of polynomial acteristic ∗ n a emr ffiinswith efficients more be can and , eso htageneralization a that show we hsapido arcsoe a over matrices on applied thms loih.Ti a evee as viewed be can This algorithm. a omwihcnb sdto used be can which form mal n hnogWan Zhendong and § § necetcmuaino the of computation efficient an o ( w loihsfrtefinite the for algorithms two .] t ffiinyi rcieis practice in efficiency Its 7.2]. .]). 9.7] n o.W opr tt an to it compare We ion. esi ecie n[13, in described levski, ω ih2 with ) } @imag.fr ≤ [email protected] < ω . O ( n ) h best the 3), 3 algebraic ) † § 24]). . 2 Krylov’s approach
Among the different techniques to compute the characteristic polynomial over a field, many of them rely on the Krylov approach. A description of them can be found in [13]. They are based on the following fact: the minimal linear dependance relation between the Krylov iterates of a vector i min v (i.e. the sequence (A v)i gives the minimal polynomial PA,v of this sequence, and a divisor of the minimal polynomial of A. Moreover, if X is the matrix formed by the first independent column vectors of this sequence, we have the relation
AX = XC min PA,v
min where C min is the companion matrix associated to P . PA,v A,v
2.1 Minimal polynomial We give here a new algorithm to compute the minimal polynomial of the sequence of the Krylov’s min iterates of a vector v and a matrix A. This is the monic polynomial PA,v of least degree such that P (A).v = 0. We firstly presented it in [22, 21] and it was simultaneously published in [20, Algorithm 2.14]. The idea is to compute the n n matrix KA,v (we call it Krylov’s matrix), whose ith column is the vector Aiu, and to perform× an elimination on it. More precisely, one computes the LSP t factorization of KA,v (see [14] for a description of the LSP factorization). Let k be the degree min of PA,v . This means that the first k columns of KA,v are linearly independent, and the n k following ones are linearly dependent with the first k ones. Therefore S is triangular with its− last n k rows equals to 0. Thus, the LSP factorization of Kt can be viewed as in figure 1. − A,v
v t (Av) t 2 t (A v) L1..k t = K(A,v) = ...... PS k+1 t (A v) Lk+1 .....
min Figure 1: principle of the computation of PA,v
1 Now the trick is to notice that the vector m = Lk+1L1−...k gives the opposites of the coefficients min t of PA,v . Indeed, let us define X = KA,v
k 1 − X = (Akv)t = m (Aiv)t = m X 1...n,k+1 i · 1...n,1...k i=0 X min k k 1 where PA,v (X)= X mkX − m1X m0. Thus − −···− − L SP = m L SP k+1 · 1...k 1 And finally m = Lk+1.L1−...k The algorithm is then straightforward: The dominant operation in this algorithm is the computation of K, in log2n matrix multipli- cations, i.e. in (nωlogn) algebraic operations. The LSP factorization requires (nω) operations O O
2 Algorithm 2.1 MinPoly : Minimal Polynomial of A and v Require: A a n n matrix and v a vector over a field A,v × i Ensure: Pmin (X) the minimal polynomial of the sequence of vectors (A v)i 1: K1...n,1 = v 2: for i =1 to log2(n) do − 2i 1 3: K1...n,2i...2i+1 1 = A K1...n,1...2i 1 − − 4: end for 5: (L,S,P ) = LSP(Kt), k = rank(K) 1 6: m = Lk+1.L1−...k A,v k k 1 i 7: return Pmin (X)= X + i=0− miX P and the triangular system resolution, (n2). The algebraic time complexity of this algorithm is thus (nωlogn). O WhenO using classical matrix multiplications (assuming ω = 3), it is preferable to compute the Krylov matrix K by k successive matrix vector products. The number of field operations is then (n3). O It is also possible to merge the creation of the Krylov matrix and its LSP factorization so as to avoid the computation of the last n k Krylov iterates with an early termination approach. This reduces the time complexity to (n−ωlog(k)) for fast matrix arithmetic, and (n2k) for classic matrix arithmetic. O O Note that choosing v randomly makes the algorithm Monte-Carlo for the computation of the minimal polynomial of A.
2.2 LU-Krylov algorithm We present here an algorithm, using the previous computation of the minimal polynomial of the i sequence (A v)i to compute the characteristic polynomial of A. The previous algorithm produces the k first independent Krylov iterates of v. They can be viewed as a basis of an invariant subspace min min under the action of A, and if PA,v = PA , this subspace is the first invariant subspace of A. The idea is to make use of the elimination performed on this basis to compute a basis of its supplementary subspace. Then a recursive call on this second basis will decompose this subspace into a series of invariant subspaces generated by one vector. The algorithm is the following, where k, P , and S come from the notation of algorithm 2.1.
Algorithm 2.2 LUK : LU-Krylov algorithm Require: A a n n matrix over a field A × Ensure: Pchar(X) the characteristic polynomial of A 1: Pick a random vector v A,v 2: Pmin (X)= MinPoly(A, v) of degree k L1 X = [S1 S2]P is computed { L2 | } 3: if (k = n) then A A,v 4: return Pchar = Pmin 5: else T T A11′ A12′ 6: A′ = P A P = where A11′ is k k. A21′ A22′ × ′ ′ −1 A22 A21S1 S2 1 − 7: Pchar (X)= LUK(A22′ A21′ S1− S2) −′ ′ −1 A,v A A S S2 8: return P A (X)= P (X) P 22− 21 1 (X) char min × char 9: end if
3 Theorem 2.1. The algorithm LU-Krylov computes the characteristic polynomial of an n n matrix A in (n3) field operations. × O Proof. Let us use the following notations
L1 X = [S1 S2]P L2 |
As we already mentioned, the first k rows of X (X1...k,1...n) form a basis of the invariant subspace generated by v. Moreover we have
T T X1..kA = C A,v X1..k Pmin Indeed T i 1 T T i T i