Skip to content

TYP: fix type signature of eigh #924

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
4 changes: 2 additions & 2 deletions src/array_api_stubs/_2021_12/linalg.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def diagonal(x: array, /, *, offset: int = 0) -> array:
"""


def eigh(x: array, /) -> Tuple[array]:
def eigh(x: array, /) -> Tuple[array, array]:
"""
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).

Expand All @@ -106,7 +106,7 @@ def eigh(x: array, /) -> Tuple[array]:

Returns
-------
out: Tuple[array]
out: Tuple[array, array]
a namedtuple (``eigenvalues``, ``eigenvectors``) whose

- 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)``.
Expand Down
4 changes: 2 additions & 2 deletions src/array_api_stubs/_2022_12/linalg.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def diagonal(x: array, /, *, offset: int = 0) -> array:
"""


def eigh(x: array, /) -> Tuple[array]:
def eigh(x: array, /) -> Tuple[array, array]:
r"""
Returns an eigenvalue decomposition of a complex Hermitian or real symmetric matrix (or a stack of matrices) ``x``.

Expand Down Expand Up @@ -168,7 +168,7 @@ def eigh(x: array, /) -> Tuple[array]:

Returns
-------
out: Tuple[array]
out: Tuple[array, array]
a namedtuple (``eigenvalues``, ``eigenvectors``) whose

- 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``).
Expand Down
4 changes: 2 additions & 2 deletions src/array_api_stubs/_2023_12/linalg.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ def diagonal(x: array, /, *, offset: int = 0) -> array:
"""


def eigh(x: array, /) -> Tuple[array]:
def eigh(x: array, /) -> Tuple[array, array]:
r"""
Returns an eigenvalue decomposition of a complex Hermitian or real symmetric matrix (or a stack of matrices) ``x``.

Expand Down Expand Up @@ -197,7 +197,7 @@ def eigh(x: array, /) -> Tuple[array]:

Returns
-------
out: Tuple[array]
out: Tuple[array, array]
a namedtuple (``eigenvalues``, ``eigenvectors``) whose

- 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``).
Expand Down
4 changes: 2 additions & 2 deletions src/array_api_stubs/_2024_12/linalg.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ def diagonal(x: array, /, *, offset: int = 0) -> array:
"""


def eigh(x: array, /) -> Tuple[array]:
def eigh(x: array, /) -> Tuple[array, array]:
r"""
Returns an eigenvalue decomposition of a complex Hermitian or real symmetric matrix (or a stack of matrices) ``x``.

Expand Down Expand Up @@ -197,7 +197,7 @@ def eigh(x: array, /) -> Tuple[array]:

Returns
-------
out: Tuple[array]
out: Tuple[array, array]
a namedtuple (``eigenvalues``, ``eigenvectors``) whose

- 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``).
Expand Down
4 changes: 2 additions & 2 deletions src/array_api_stubs/_draft/linalg.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ def diagonal(x: array, /, *, offset: int = 0) -> array:
"""


def eigh(x: array, /) -> Tuple[array]:
def eigh(x: array, /) -> Tuple[array, array]:
r"""
Returns an eigenvalue decomposition of a complex Hermitian or real symmetric matrix (or a stack of matrices) ``x``.

Expand Down Expand Up @@ -197,7 +197,7 @@ def eigh(x: array, /) -> Tuple[array]:

Returns
-------
out: Tuple[array]
out: Tuple[array, array]
a namedtuple (``eigenvalues``, ``eigenvectors``) whose

- 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``).
Expand Down