Skip to content

Fix Hermitian Lanczos for complex matrices - #288

Merged
pnkraemer merged 3 commits into
pnkraemer:mainfrom
rahulgaur104:fix-complex-hermitian-hessenberg
Sep 2, 2026
Merged

Fix Hermitian Lanczos for complex matrices#288
pnkraemer merged 3 commits into
pnkraemer:mainfrom
rahulgaur104:fix-complex-hermitian-hessenberg

Conversation

@rahulgaur104

@rahulgaur104 rahulgaur104 commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Hi @pnkraemer,
Thank you for the nice package. I have been using matfree to solve a Hermitian eigenvalue stability problem. However, I realized that with a complex matrix, matfree requires some minor modifications for it to work correctly.

Summary

  • use the conjugating inner product in Arnoldi/Hessenberg projections and norms
  • symmetrize tridiagonal matrices with the Hermitian transpose
  • update the direct Lanczos path and tests for complex Hermitian matrices

Tests

  • python -m pytest (415 passed)

@rahulgaur104

Copy link
Copy Markdown
Contributor Author

Closing this fork-based PR; I will try pushing a branch directly to the upstream repository instead.

@rahulgaur104
rahulgaur104 deleted the fix-complex-hermitian-hessenberg branch July 15, 2026 20:28
@rahulgaur104
rahulgaur104 restored the fix-complex-hermitian-hessenberg branch July 15, 2026 20:29
@rahulgaur104 rahulgaur104 reopened this Jul 15, 2026
@rahulgaur104

Copy link
Copy Markdown
Contributor Author

Opening this fork-based PR, as I don't have permissions to create a separate branch.

@pnkraemer pnkraemer left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Thanks a lot for the PR! Really nice to make Lanczos and Arnoldi work for complex matrices.

I left some comments in the diff, would be nice to get them sorted before merging - but nothing major!

Comment thread matfree/decomp.py Outdated
Comment thread matfree/decomp.py
Comment thread tests/test_decomp/test_tridiag_sym.py
Comment thread tests/test_eig/test_eigh_partial.py Outdated
@rahulgaur104

Copy link
Copy Markdown
Contributor Author

@pnkraemer
I think this is ready for review.

@rahulgaur104

rahulgaur104 commented Aug 30, 2026

Copy link
Copy Markdown
Contributor Author

Unrelated but I used your package to write a dense and matrix-free shift invert solver here (page number 11).
If you want, we can add a shift invert solver to matfree.

@pnkraemer

Copy link
Copy Markdown
Owner

Unrelated but I used your package to write a dense and matrix-free shift invert solver here (page number 11). If you want, we can add a shift invert solver to matfree.

Super nice! Let's discuss this in the issue thread?

@pnkraemer pnkraemer left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Thanks a lot for that contribution! :)

@pnkraemer
pnkraemer merged commit 78458b7 into pnkraemer:main Sep 2, 2026
5 checks passed
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.

2 participants