Skip to content

Commit a1d00d5

Browse files
authored
Add specification for computing the eigenvalues of a symmetric matrix (linalg: eigvalsh) (#162)
* Add eigvalsh * Fix duplicate target * Move API to submodule
1 parent fe3b410 commit a1d00d5

File tree

1 file changed

+26
-3
lines changed

1 file changed

+26
-3
lines changed

spec/API_specification/linear_algebra_functions.md

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,10 +153,33 @@ Returns the eigenvalues and eigenvectors of a symmetric matrix (or a stack of sy
153153
Eigenvalue sort order is left unspecified.
154154
```
155155

156-
(function-eigvalsh)=
157-
### eigvalsh()
156+
(function-linalg-eigvalsh)=
157+
### linalg.eigvalsh(x, /, *, upper=False)
158158

159-
TODO
159+
Computes the eigenvalues of a symmetric matrix (or a stack of symmetric matrices) `x`.
160+
161+
<!-- NOTE: once complex number support, each matrix must be Hermitian -->
162+
163+
#### Parameters
164+
165+
- **x**: _&lt;array&gt;_
166+
167+
- input array having shape `(..., M, M)` and whose innermost two dimensions form square matrices. Must have a floating-point data type.
168+
169+
- **upper**: _bool_
170+
171+
- If `True`, use the upper-triangular part to compute the eigenvalues. If `False`, use the lower-triangular part to compute the eigenvalues. Default: `False`.
172+
173+
#### Returns
174+
175+
- **out**: _&lt;array&gt;_
176+
177+
- an array containing the computed eigenvalues. The returned array must have shape `(..., M)` and have the same data type as `x`.
178+
179+
```{note}
180+
181+
Eigenvalue sort order is left unspecified.
182+
```
160183

161184
(function-einsum)=
162185
### einsum()

0 commit comments

Comments
 (0)