Skip to content

Commit fe3b410

Browse files
authored
Add specification for computing the eigenvalues and eigenvectors of a real symmetric matrix (linalg: eigh) (#161)
* Add specification for eigh * Move API to submodule
1 parent 3add230 commit fe3b410

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

spec/API_specification/linear_algebra_functions.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,39 @@ Returns the specified diagonals. If `x` has more than two dimensions, then the a
120120

121121
TODO
122122

123+
(function-linalg-eigh)=
124+
### linalg.eigh(x, /, *, upper=False)
125+
126+
Returns the eigenvalues and eigenvectors of a symmetric matrix (or a stack of symmetric matrices) `x`.
127+
128+
<!-- NOTE: once complex number support, each matrix must be Hermitian -->
129+
130+
#### Parameters
131+
132+
- **x**: _&lt;array&gt;_
133+
134+
- input array having shape `(..., M, M)` and whose innermost two dimensions form square matrices. Must have a floating-point data type.
135+
136+
- **upper**: _bool_
137+
138+
- 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`.
139+
140+
#### Returns
141+
142+
- **out**: _Tuple\[ &lt;array&gt; ]_
143+
144+
- a namedtuple (`e`, `v`) whose
145+
146+
- first element must have shape `(..., M)` and consist of computed eigenvalues.
147+
- second element must have shape `(..., M, M)`and have the columns of the inner most matrices contain the computed eigenvectors.
148+
149+
Each returned array must have the same floating-point data type as `x`.
150+
151+
```{note}
152+
153+
Eigenvalue sort order is left unspecified.
154+
```
155+
123156
(function-eigvalsh)=
124157
### eigvalsh()
125158

0 commit comments

Comments
 (0)