Skip to content

Cleanup and generalize functions of Hermitian matrices (#1340 encore) #1358

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

Merged
merged 7 commits into from
May 13, 2025

Conversation

araujoms
Copy link
Collaborator

No description provided.

@araujoms
Copy link
Collaborator Author

The test failure on Windows is unrelated, the method ambiguities themselves are fixed, as the tests on Linux and Mac show.

Copy link

codecov bot commented May 13, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.74%. Comparing base (3e4d569) to head (c970265).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1358      +/-   ##
==========================================
+ Coverage   93.12%   93.74%   +0.62%     
==========================================
  Files          34       34              
  Lines       16705    15724     -981     
==========================================
- Hits        15557    14741     -816     
+ Misses       1148      983     -165     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@araujoms araujoms merged commit 93e97b4 into JuliaLang:master May 13, 2025
4 checks passed
@araujoms
Copy link
Collaborator Author

I've been thinking about how to test matrix functions on Hermitian{<:Quaternion}, to make sure the capability doesn't get accidentally lost in future refactorings. It would quite overkill to include a spectral eigensolver for quaternions in the test files, so perhaps one could instead mock one with something like

function eigen(A::Hermitian{<:Quaternion})
    U = copy(Matrix(A))
    d = checksquare(A)
    λ = randn(real(eltype(A)), d)
    return Eigen(λ, U)
end

Then one could simply test whether the functions don't throw when called on Hermitian{<:Quaternion}, trusting that correctness would follow from the real and complex cases.

What do you think? Perhaps the entire thing is a waste of time and I should just leave it be.

@dkarrasch
Copy link
Member

Hm, perhaps you could design a spectral decomposition right away? Do we have some generic qr, that would give an orthogonal U, and then you specify the real eigenvalues as you like (positive, non-negative, any).

@araujoms
Copy link
Collaborator Author

It's easy to produce an orthogonal U, but I don't see how would that help.

@dkarrasch
Copy link
Member

I thought you wanted to test for quaternion matrices, and for that purpose you needed a spectral decomposition. If you start with one, you could multiply out A = U'D*U and use that one to run the functions on? And even compare the results with a manual U' * f.(D) *U? Maybe I misunderstood.

@araujoms
Copy link
Collaborator Author

What I want to test is e.g. that exp(A) works when A is a Hermitian quaternionic matrix. The current implementation of exp will work whenever eigen supports such A (this happens with GenericLinearAlgebra). So in order to test that I don't simply need a spectral decomposition of A, I need eigen to give it to me.

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