|   | 1 |  initial version  | 
Unless i misunderstand you question, if M is your matrix and n is an integer,  you can just do:
sage: M^n
|   | 2 |  No.2 Revision  | 
Unless i misunderstand you question, if M is your matrix and n is an integer,  you can just do:
sage: M^n
or, if you prefer to be Python compatible:
sage: M**n
 Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.
 
                
                Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.