How do I compute matrix powers in Sage? The syntax is illustrated by the example below.
sage: R = IntegerModRing(51) sage: M = MatrixSpace(R,3,3) sage: A = M([1,2,3, 4,5,6, 7,8,9]) sage: A^1000*A^1007 <BLANKLINE> [ 3 3 3] [18 0 33] [33 48 12] sage: A^2007 <BLANKLINE> [ 3 3 3] [18 0 33] [33 48 12]
See About this document... for information on suggesting changes.