From 6ab3a5cfade50074adb0f3314236c9a84b7e2b8a Mon Sep 17 00:00:00 2001 From: Athan Reines Date: Mon, 12 Apr 2021 11:02:56 -0700 Subject: [PATCH 1/2] Add specification for eigh --- .../linear_algebra_functions.md | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/spec/API_specification/linear_algebra_functions.md b/spec/API_specification/linear_algebra_functions.md index 100efccf2..597ad0d76 100644 --- a/spec/API_specification/linear_algebra_functions.md +++ b/spec/API_specification/linear_algebra_functions.md @@ -107,6 +107,39 @@ TODO TODO +(function-eigh)= +### eigh(x, /, *, upper=False) + +Returns the eigenvalues and eigenvectors of a symmetric matrix (or a stack of symmetric matrices) `x`. + + + +#### Parameters + +- **x**: _<array>_ + + - input array having shape `(..., M, M)` and whose innermost two dimensions form square matrices. Must have a floating-point data type. + +- **upper**: _bool_ + + - If `True`, use the upper-triangular part to compute the eigenvalues and eigenvectors. If `False`, use the lower-triangular part to compute the eigenvalues and eigenvectors. Default: `False`. + +#### Returns + +- **out**: _Tuple\[ <array> ]_ + + - a namedtuple (`e`, `v`) whose + + - first element must have shape `(..., M)` and consist of computed eigenvalues. + - second element must have shape `(..., M, M)`and have the columns of the inner most matrices contain the computed eigenvectors. + + Each returned array must have the same floating-point data type as `x`. + +```{note} + +Eigenvalue sort order is left unspecified. +``` + (function-eigvalsh)= ### eigvalsh() From a99df44c20baeda307584ab6b8cee8c9c6a0b92c Mon Sep 17 00:00:00 2001 From: Athan Reines Date: Mon, 26 Apr 2021 02:25:27 -0700 Subject: [PATCH 2/2] Move API to submodule --- spec/API_specification/linear_algebra_functions.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/API_specification/linear_algebra_functions.md b/spec/API_specification/linear_algebra_functions.md index 597ad0d76..7348dc0b7 100644 --- a/spec/API_specification/linear_algebra_functions.md +++ b/spec/API_specification/linear_algebra_functions.md @@ -107,8 +107,8 @@ TODO TODO -(function-eigh)= -### eigh(x, /, *, upper=False) +(function-linalg-eigh)= +### linalg.eigh(x, /, *, upper=False) Returns the eigenvalues and eigenvectors of a symmetric matrix (or a stack of symmetric matrices) `x`.