new function for exponentiation at matrix'