Skip to content

Add matrix_power specification #112

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
May 12, 2021
Merged
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 22 additions & 2 deletions spec/API_specification/linear_algebra_functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,29 @@ TODO
TODO

(function-matrix_power)=
### matrix_power()
### matrix_power(x, n, /)

TODO
Raises a square matrix (or a stack of square matrices) `x` to an integer power `n`.

#### Parameters

- **x**: _<array>_

- input array having shape `(..., M, M)` and whose innermost two dimensions form square matrices. Must have a data type of either `float32` or `float64`.

- **n**: _int_

- integer exponent.

#### Returns

- **out**: _<array>_

- if `n` is equal to zero, an array containing the identity matrix for each square matrix. If `n` is less than zero, an array containing the inverse of each square matrix raised to the absolute value of `n`, provided that each square matrix is invertible. If `n` is greater than zero, an array containing the result of raising each square matrix to the power `n`. The returned array must have the same data type and shape as `x`.

#### Raises

- if `n` is less than zero and a square matrix is not invertible.

(function-matrix_rank)=
### matrix_rank()
Expand Down