Skip to content

Return complex arrays from eig / eigvals#2953

Open
antonwolfy wants to merge 4 commits into
masterfrom
adopt-to-complex-dtype-in-eig-eigvals
Open

Return complex arrays from eig / eigvals#2953
antonwolfy wants to merge 4 commits into
masterfrom
adopt-to-complex-dtype-in-eig-eigvals

Conversation

@antonwolfy

@antonwolfy antonwolfy commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

NumPY 2.5 changed numpy.linalg.eig and numpy.linalg.eigvals so that for general (non-symmetric) matrices they always return complex-typed eigenvalues, instead of value-dependently casting the result back to a real type when the imaginary parts happen to be zero. For real input, float64 now yields complex128 and float32 yields complex64.

dpnp.linalg.eig / eigvals are thin NumPy fallbacks (the OneMKL geev routine is not yet wired up), so they inherit this behavior directly from the installed NumPy.

This PR brings dpnp's documentation in line with the new always-complex output.

  • Have you provided a meaningful PR description?
  • Have you added a test, reproducer or referred to an issue with a reproducer?
  • Have you tested your changes locally for CPU and GPU devices?
  • Have you made sure that new changes do not introduce compiler warnings?
  • Have you checked performance impact of proposed changes?
  • Have you added documentation for your changes, if necessary?
  • Have you added your changes to the changelog?

@antonwolfy antonwolfy added this to the 0.21.0 release milestone Jun 17, 2026
@antonwolfy antonwolfy self-assigned this Jun 17, 2026
@github-actions

Copy link
Copy Markdown
Contributor

View rendered docs @ https://intelpython.github.io/dpnp/pull/2953/index.html

@coveralls

Copy link
Copy Markdown
Collaborator

Coverage Status

coverage: 78.116% (+0.003%) from 78.113% — adopt-to-complex-dtype-in-eig-eigvals into master

@github-actions

Copy link
Copy Markdown
Contributor

Array API standard conformance tests for dpnp=0.21.0dev1=py313h509198e_8 ran successfully.
Passed: 1355
Failed: 5
Skipped: 16

@antonwolfy antonwolfy marked this pull request as ready for review June 17, 2026 16:55

@vlad-perevezentsev vlad-perevezentsev left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM
Thank you @antonwolfy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants