add matrix exponentiation