Skip to content

Commit f9cf531

Browse files
authored
fix: update type signature of eigh
PR-URL: #924 Closes: #922 Reviewed-by: Athan Reines <kgryte@gmail.com> Reviewed-by: Lucas Colley <lucas.colley8@gmail.com>
1 parent 0941b21 commit f9cf531

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

src/array_api_stubs/_2021_12/linalg.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def diagonal(x: array, /, *, offset: int = 0) -> array:
8686
"""
8787

8888

89-
def eigh(x: array, /) -> Tuple[array]:
89+
def eigh(x: array, /) -> Tuple[array, array]:
9090
"""
9191
Returns an eigendecomposition x = QLQᵀ of a symmetric matrix (or a stack of symmetric matrices) ``x``, where ``Q`` is an orthogonal matrix (or a stack of matrices) and ``L`` is a vector (or a stack of vectors).
9292
@@ -106,7 +106,7 @@ def eigh(x: array, /) -> Tuple[array]:
106106
107107
Returns
108108
-------
109-
out: Tuple[array]
109+
out: Tuple[array, array]
110110
a namedtuple (``eigenvalues``, ``eigenvectors``) whose
111111
112112
- first element must have the field name ``eigenvalues`` (corresponding to ``L`` above) and must be an array consisting of computed eigenvalues. The array containing the eigenvalues must have shape ``(..., M)``.

src/array_api_stubs/_2022_12/linalg.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ def diagonal(x: array, /, *, offset: int = 0) -> array:
134134
"""
135135

136136

137-
def eigh(x: array, /) -> Tuple[array]:
137+
def eigh(x: array, /) -> Tuple[array, array]:
138138
r"""
139139
Returns an eigenvalue decomposition of a complex Hermitian or real symmetric matrix (or a stack of matrices) ``x``.
140140
@@ -168,7 +168,7 @@ def eigh(x: array, /) -> Tuple[array]:
168168
169169
Returns
170170
-------
171-
out: Tuple[array]
171+
out: Tuple[array, array]
172172
a namedtuple (``eigenvalues``, ``eigenvectors``) whose
173173
174174
- first element must have the field name ``eigenvalues`` (corresponding to :math:`\operatorname{diag}\Lambda` above) and must be an array consisting of computed eigenvalues. The array containing the eigenvalues must have shape ``(..., M)`` and must have a real-valued floating-point data type whose precision matches the precision of ``x`` (e.g., if ``x`` is ``complex128``, then ``eigenvalues`` must be ``float64``).

src/array_api_stubs/_2023_12/linalg.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ def diagonal(x: array, /, *, offset: int = 0) -> array:
163163
"""
164164

165165

166-
def eigh(x: array, /) -> Tuple[array]:
166+
def eigh(x: array, /) -> Tuple[array, array]:
167167
r"""
168168
Returns an eigenvalue decomposition of a complex Hermitian or real symmetric matrix (or a stack of matrices) ``x``.
169169
@@ -197,7 +197,7 @@ def eigh(x: array, /) -> Tuple[array]:
197197
198198
Returns
199199
-------
200-
out: Tuple[array]
200+
out: Tuple[array, array]
201201
a namedtuple (``eigenvalues``, ``eigenvectors``) whose
202202
203203
- first element must have the field name ``eigenvalues`` (corresponding to :math:`\operatorname{diag}\Lambda` above) and must be an array consisting of computed eigenvalues. The array containing the eigenvalues must have shape ``(..., M)`` and must have a real-valued floating-point data type whose precision matches the precision of ``x`` (e.g., if ``x`` is ``complex128``, then ``eigenvalues`` must be ``float64``).

src/array_api_stubs/_2024_12/linalg.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ def diagonal(x: array, /, *, offset: int = 0) -> array:
163163
"""
164164

165165

166-
def eigh(x: array, /) -> Tuple[array]:
166+
def eigh(x: array, /) -> Tuple[array, array]:
167167
r"""
168168
Returns an eigenvalue decomposition of a complex Hermitian or real symmetric matrix (or a stack of matrices) ``x``.
169169
@@ -197,7 +197,7 @@ def eigh(x: array, /) -> Tuple[array]:
197197
198198
Returns
199199
-------
200-
out: Tuple[array]
200+
out: Tuple[array, array]
201201
a namedtuple (``eigenvalues``, ``eigenvectors``) whose
202202
203203
- first element must have the field name ``eigenvalues`` (corresponding to :math:`\operatorname{diag}\Lambda` above) and must be an array consisting of computed eigenvalues. The array containing the eigenvalues must have shape ``(..., M)`` and must have a real-valued floating-point data type whose precision matches the precision of ``x`` (e.g., if ``x`` is ``complex128``, then ``eigenvalues`` must be ``float64``).

src/array_api_stubs/_draft/linalg.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ def diagonal(x: array, /, *, offset: int = 0) -> array:
163163
"""
164164

165165

166-
def eigh(x: array, /) -> Tuple[array]:
166+
def eigh(x: array, /) -> Tuple[array, array]:
167167
r"""
168168
Returns an eigenvalue decomposition of a complex Hermitian or real symmetric matrix (or a stack of matrices) ``x``.
169169
@@ -197,7 +197,7 @@ def eigh(x: array, /) -> Tuple[array]:
197197
198198
Returns
199199
-------
200-
out: Tuple[array]
200+
out: Tuple[array, array]
201201
a namedtuple (``eigenvalues``, ``eigenvectors``) whose
202202
203203
- first element must have the field name ``eigenvalues`` (corresponding to :math:`\operatorname{diag}\Lambda` above) and must be an array consisting of computed eigenvalues. The array containing the eigenvalues must have shape ``(..., M)`` and must have a real-valued floating-point data type whose precision matches the precision of ``x`` (e.g., if ``x`` is ``complex128``, then ``eigenvalues`` must be ``float64``).

0 commit comments

Comments
 (0)