matrix_power¶
- matrix_power(x: array, n: int, /) array¶
Raises a square matrix (or a stack of square matrices)
xto an integer powern.- Parameters:
x (array) – input array having shape
(..., M, M)and whose innermost two dimensions form square matrices. Should have a floating-point data type.n (int) – integer exponent.
- Returns:
out (array) – if
nis equal to zero, an array containing the identity matrix for each square matrix. Ifnis less than zero, an array containing the inverse of each square matrix raised to the absolute value ofn, provided that each square matrix is invertible. Ifnis greater than zero, an array containing the result of raising each square matrix to the powern. The returned array must have the same shape asxand a floating-point data type determined by Type Promotion Rules.
Notes
Changed in version 2022.12: Added complex data type support.