Skip to content
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

Hermitian banded eigendecompositions where T <: BlasFloat #185

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

MikaelSlevinsky
Copy link
Member

@MikaelSlevinsky MikaelSlevinsky commented Jun 24, 2020

This draft PR adds Hermitian banded eigendecompositions based on tridiagonal reduction. It made me realize that LinearAlgebra is missing a Hermitian tridiagonal type and parametric Givens rotations with different types for the sines and cosines: in the BLAS, a complex Givens rotation uses a real cosine. Having a finer grained parametrization of a Givens rotation in LinearAlgebra would probably speed up their application. This proposal is a breaking change to LinearAlgebra, so I think that means if implemented it would only be available from Julia v2.

RFC: it would be easy to destroy the HermTridiagonal type and preserve the outcomes of this PR. Probably HermTridiagonal belongs in LinearAlgebra.

Other improvements:

  • the count of the Givens rotations in band reduction is hoisted out of sbtrd! so that they can be pre-allocated rather than pushed.
  • the Julia sbtrd! function doesn't default to WANTQ = true, unifying calls for eigvals as well.
  • only in-place eigen! and eigvals! are defined and keyword arguments may be passed so that one may ask for, e.g. eigvals(A, -2, 2), all eigenvalues of Symmetric/Hermitian banded A between -2 and 2. Also works with a unitrange.

Todo:

  • Hermitian-definite banded GEP.
  • Documentation.

@KlausC
Copy link
Contributor

KlausC commented Jun 24, 2020

LinearAlgebra is missing a Hermitian tridiagonal type

I dont't see the need for a HermTridiagonal{<:Complex}. All matrices of this format can be easily transformed into SymTridiagonal{<:Real} by a diagonal unitary matrix (all diagonal elements are (complex) numbers with norm 1). All the transformations of Hermitian matrices to 3-Diagonals can be changed to symmetric real matrices by just replacing the subdiagonals by their absolute values; the diagonals are real by definition.

... missing ... parametric Givens rotations with different types for the sines and cosines

I agree with that statement. If you multiply givens rotations with complex arrays you can safe 1/4 of real multiplications, if one of the coefficients in Givens is real (and the other complex). That will improve efficiency of eigenvector calculation.

How is the PR coordinated with #183?

@MikaelSlevinsky
Copy link
Member Author

Rest assured it will be coordinated with #183. Probably we'll merge yours before this one. Please note this is a draft, a work in progress.

@codecov
Copy link

codecov bot commented Jun 24, 2020

Codecov Report

Merging #185 into master will decrease coverage by 0.62%.
The diff coverage is 51.65%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #185      +/-   ##
==========================================
- Coverage   71.83%   71.21%   -0.63%     
==========================================
  Files          21       22       +1     
  Lines        2546     2710     +164     
==========================================
+ Hits         1829     1930     +101     
- Misses        717      780      +63     
Impacted Files Coverage Δ
src/BandedMatrices.jl 50.00% <ø> (-50.00%) ⬇️
src/symbanded/symbanded.jl 86.95% <ø> (-3.05%) ⬇️
src/hermtridiag.jl 19.00% <19.00%> (ø)
src/symbanded/bandedeigen.jl 65.79% <95.18%> (+11.12%) ⬆️
src/lapack.jl 56.96% <100.00%> (-27.04%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 17c66ee...a1dd097. Read the comment docs.

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