Skip to content

fix eigh to accept complex-valued DNDarrays#2328

Open
GioPede wants to merge 3 commits into
helmholtz-analytics:mainfrom
GioPede:fix/eigh-complex
Open

fix eigh to accept complex-valued DNDarrays#2328
GioPede wants to merge 3 commits into
helmholtz-analytics:mainfrom
GioPede:fix/eigh-complex

Conversation

@GioPede

@GioPede GioPede commented May 27, 2026

Copy link
Copy Markdown
Contributor

Description

Small relaxation of the checks in linalg.eigh to allow complex-valued matrices

Issue/s resolved: #
#2327

Changes proposed:

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Does this change modify the behaviour of other functions? If so, which?

no

@brownbaerchen

Copy link
Copy Markdown
Collaborator

@GioPede, thanks for getting this going! A function that implies Hermitian input in its name but doesn't allow it is indeed a bug! :D I started a PR with some tests on your fork. Since you probably don't watch your own fork, I write a note about this here.

Also, just to make sure we have this discussion also here: This fix only works for non-distributed input, since the _eigh function for distributed input requires percentile, which requires sort, which doesn't allow complex input.

@ClaudiaComito

Copy link
Copy Markdown
Member

@GioPede, thanks for getting this going! A function that implies Hermitian input in its name but doesn't allow it is indeed a bug! :D I started a PR with some tests on your fork. Since you probably don't watch your own fork, I write a note about this here.

Also, just to make sure we have this discussion also here: This fix only works for non-distributed input, since the _eigh function for distributed input requires percentile, which requires sort, which doesn't allow complex input.

Addendum after discussing this in our meeting on Jun 8th.

ht.sort does not support complex dtypes because torch.sort doesn't. We could of course provide at least the CPU functionality via numpy.

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

Labels

None yet

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

3 participants