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

Unify eigenvalue interface #1611

Merged
merged 11 commits into from
Jan 23, 2024
Merged

Unify eigenvalue interface #1611

merged 11 commits into from
Jan 23, 2024

Conversation

joschmitt
Copy link
Collaborator

@joschmitt joschmitt commented Jan 4, 2024

This is one half of my proposal to unify the eigenvalue interface throughout OSCAR (oscar-system/Oscar.jl#2017). The other half is thofma/Hecke.jl#1344 .

The changes are:

  • Consistently use the name eigvals and introduce the alias eigenvalues (in consistency with LinearAlgebra).
  • If a field is supplied in which the eigenvalues are supposed to be computed, this comes first in the signature (in consistency with e.g. factor(ZZ, QQ(2))). I assume this change constitutes a breaking change.
  • The return type is a dictionary with key-value-pairs the eigenvalue and its multiplicity (in consistency with other things returning multiplicities like factor, but not consistent with eigvals from LinearAlgebra). Another breaking change.

This is what seems to me to be "the most consistent" right now. I don't insist on any of these changes and I am happy to change things back/differently.

EDIT: This list is not up to date anymore. See oscar-system/Oscar.jl#2017 (comment) for what was decided.

Copy link

codecov bot commented Jan 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (3572e5d) 84.07% compared to head (322234b) 84.10%.
Report is 3 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1611      +/-   ##
==========================================
+ Coverage   84.07%   84.10%   +0.03%     
==========================================
  Files          93       93              
  Lines       36769    36826      +57     
==========================================
+ Hits        30915    30974      +59     
+ Misses       5854     5852       -2     

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

@lgoettgens
Copy link
Collaborator

Thanks for taking care of this. Two comments:

  1. The generic implementation should move from Hecke to AA.
  2. I think that eigenvalues fits more our general naming scheme than eigvalues. There is already a list in AA of things that we aliased from LinearAlgebra to our own names, so that would be no contradicting point to naming it eigenvalues

@joschmitt
Copy link
Collaborator Author

eigenvalues would also go better with eigenspaces in Hecke. (Although it doesn't really matter as long as both options exist.) Other opinions?

src/Aliases.jl Outdated
@@ -8,6 +8,9 @@ include(joinpath(pathof(AbstractAlgebra), "..", "Aliases.jl"))
@alias is_less isless
@alias is_real isreal

@alias eigenvalues eigvals
@alias eigenvalues_simple eigvals_simple
Copy link
Collaborator

Choose a reason for hiding this comment

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

What does this function even do? I am asking as we didn't talk about it today.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

According to the doc string, it computes eigenvalues, but the function only works if the matrix has only "simple eigenvalues" (I assume simple = multiplicity 1).

docs/src/matrix.md Outdated Show resolved Hide resolved
src/Aliases.jl Outdated Show resolved Hide resolved
src/Exports.jl Outdated Show resolved Hide resolved
src/HeckeMiscMatrix.jl Outdated Show resolved Hide resolved
src/HeckeMiscMatrix.jl Outdated Show resolved Hide resolved
src/HeckeMiscMatrix.jl Outdated Show resolved Hide resolved
src/HeckeMiscMatrix.jl Outdated Show resolved Hide resolved
@@ -201,6 +201,8 @@ import AbstractAlgebra: set_attribute!

include("Exports.jl")

const eigenvalues = eigvals # alternative name for the function from LinearAlgebra
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I didn't find a better place to put this. In Aliases.jl it is too late.

@lgoettgens lgoettgens closed this Jan 9, 2024
@lgoettgens lgoettgens reopened this Jan 9, 2024
@joschmitt joschmitt closed this Jan 10, 2024
@joschmitt joschmitt reopened this Jan 10, 2024
@lgoettgens
Copy link
Collaborator

This looks good now, and just waits for the next time we do a breaking release.

@lgoettgens lgoettgens mentioned this pull request Jan 23, 2024
12 tasks
@lgoettgens lgoettgens closed this Jan 23, 2024
@lgoettgens lgoettgens reopened this Jan 23, 2024
@lgoettgens lgoettgens enabled auto-merge (squash) January 23, 2024 16:34
@fingolfin fingolfin merged commit fa1d911 into Nemocas:master Jan 23, 2024
49 of 54 checks passed
@joschmitt joschmitt deleted the eigen branch January 24, 2024 08:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants