Skip to content

Add complex number support to eigh and eigvalsh - #543

Merged
rgommers merged 4 commits into
mainfrom
cmplx-eigh
Dec 14, 2022
Merged

Add complex number support to eigh and eigvalsh#543
rgommers merged 4 commits into
mainfrom
cmplx-eigh

Conversation

@kgryte

Copy link
Copy Markdown
Contributor

This PR

  • adds complex number support to eigh and eigvalsh.
  • follows PyTorch and NumPy in requiring that eigenvalues be returned as real-valued floating-point arrays.
  • requires that complex input arrays be Hermitian.
  • the precision of the eigenvalue array must match that of the input array.

@kgrytekgryte added API change Changes to existing functions or objects in the API. topic: Complex Data Types Complex number data types. topic: Linear Algebra Linear algebra. labels Dec 1, 2022
@kgrytekgryte added this to the v2022 milestone Dec 1, 2022

@rgommersrgommers left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM modulo my one question on (non-)orthogonality of eigenvectors.

Comment threadspec/API_specification/array_api/linalg.py
Whether an array library explicitly checks whether an input array is Hermitian or a symmetric matrix (or a stack of matrices) is implementation-defined.

.. note::
The function ``eig`` will be added in a future version of the specification.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I refreshed my memory on this point. There is gh-113 and #403 (comment), so yes there seems to be demand and hence this note seems fine.

@rgommers
rgommers merged commit b3f2829 into mainDec 14, 2022
@rgommers
rgommers deleted the cmplx-eigh branch December 14, 2022 20:34
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

API changeChanges to existing functions or objects in the API.topic: Complex Data TypesComplex number data types.topic: Linear AlgebraLinear algebra.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@kgryte@rgommers