aesara.tensor.nlinalg.matrix_power

Contents

aesara.tensor.nlinalg.matrix_power#

aesara.tensor.nlinalg.matrix_power(M, n)[source]#

Raise a square matrix, M, to the (integer) power n.

This implementation uses exponentiation by squaring which is significantly faster than the naive implementation. The time complexity for exponentiation by squaring is :math: mathcal{O}((n log M)^k)

Parameters:
  • M (TensorVariable) –

  • n (int) –