 Charpoly - Maple Programming Help

Home : Support : Online Help : Mathematics : Inert Functions : Charpoly

Charpoly

compute characteristic polynomial function over a ring of characteristic p

 Calling Sequence Charpoly(A,x) mod p

Parameters

 A - square Matrix x - name; specifies the variable in the characteristic polynomial p - non-zero integer; specifies the characteristic of the ring

Description

 • Given an $n$ by $n$ matrix $A$ over a ring $F$ of prime characteristic $p$, the Charpoly( A, x ) mod p calling sequence computes the characteristic polynomial of $A$, a monic polynomial in $x$ of degree $n$ over $F$.
 • For matrices over the prime field $\mathrm{GF}\left(p\right)$, for $p$ a prime, Maple uses an $\mathrm{O}\left({n}^{3}\right)$ algorithm. Otherwise, Maple uses an $\mathrm{O}\left({n}^{4}\right)$ division free algorithm.

Examples

 > $A≔\mathrm{Matrix}\left(\left[\left[2,1,0\right],\left[1,2,1\right],\left[0,1,2\right]\right]\right)$
 ${A}{≔}\left[\begin{array}{ccc}{2}& {1}& {0}\\ {1}& {2}& {1}\\ {0}& {1}& {2}\end{array}\right]$ (1)
 > $\mathrm{Charpoly}\left(A,x\right)\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{mod}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}3$
 ${{x}}^{{3}}{+}{x}{+}{2}$ (2)
 > $p≔3:$$\mathrm{alias}\left(a=\mathrm{RootOf}\left({x}^{2}+1\right)\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{mod}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}p\right):$
 > $A≔\mathrm{Matrix}\left(\left[\left[1,a,0\right],\left[a,1\right],\left[0,0,a\right]\right]\right)$
 ${A}{≔}\left[\begin{array}{ccc}{1}& {a}& {0}\\ {a}& {1}& {0}\\ {0}& {0}& {a}\end{array}\right]$ (3)
 > $C≔\mathrm{Charpoly}\left(A,x\right)\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{mod}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}p$
 ${C}{≔}{{x}}^{{3}}{+}{2}{}\left({2}{+}{a}\right){}{{x}}^{{2}}{+}{2}{}\left({1}{+}{a}\right){}{x}{+}{a}$ (4)
 > $\mathrm{Factor}\left(C\right)\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{mod}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}p$
 $\left({x}{+}{2}{}{a}\right){}\left({x}{+}{2}{+}{2}{}{a}\right){}\left({x}{+}{a}{+}{2}\right)$ (5)
 > $A≔\mathrm{Matrix}\left(\left[\left[1,t,\frac{1}{t}\right],\left[\frac{1}{t},1,t\right],\left[t,\frac{1}{t},1\right]\right]\right)$
 ${A}{≔}\left[\begin{array}{ccc}{1}& {t}& \frac{{1}}{{t}}\\ \frac{{1}}{{t}}& {1}& {t}\\ {t}& \frac{{1}}{{t}}& {1}\end{array}\right]$ (6)
 > $\mathrm{Charpoly}\left(A,x\right)\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{mod}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}2$
 ${{x}}^{{3}}{+}{{x}}^{{2}}{+}\frac{{{t}}^{{6}}{+}{1}}{{{t}}^{{3}}}$ (7)