Skip to content

Add EigenvalueProblem, EigenvalueSolution, and EigenvalueTarget#1417

Merged
ChrisRackauckas merged 2 commits into
SciML:masterfrom
AJ0070:fix/LinearSolve-143
Jul 7, 2026
Merged

Add EigenvalueProblem, EigenvalueSolution, and EigenvalueTarget#1417
ChrisRackauckas merged 2 commits into
SciML:masterfrom
AJ0070:fix/LinearSolve-143

Conversation

@AJ0070

@AJ0070 AJ0070 commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Checklist

  • Appropriate tests were added
  • Any code changes were done in a way that does not break public API
  • All documentation related to code changes were updated
  • The new code follows the
    contributor guidelines, in particular the SciML Style Guide and
    COLPRAC.
  • Any new documentation only uses public API

Additional context

  • Added EigenvalueProblem, EigenvalueSolution, and the EigenvalueTarget enum, mirroring the existing LinearProblem/LinearSolution pattern.
  • Added AbstractEigenvalueProblem/AbstractEigenvalueSolution abstract types and build_eigenvalue_solution.
  • Added tests for construction, which normalization (SymbolEigenvalueTarget), and error handling.

Enables SciML/LinearSolve.jl's new EigenvalueProblem support (dense, Arpack, ArnoldiMethod, KrylovKit, JacobiDavidson backends) to share one canonical definition instead of duplicating it downstream.

AI Usage: Usead Claude Sonnet 5
Part of SciML/LinearSolve.jl#143

Comment thread src/problems/eigenvalue_problems.jl Outdated
SmallestRealPart
"Eigenvalues with the largest (most positive) imaginary part (symbol `:LI`)."
LargestImaginaryPart
"Eigenvalues with the smallest (most negative) imaginary part (symbol `:SI`)."

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

get rid of the symbols, use the enums

Comment thread src/problems/eigenvalue_problems.jl Outdated

- `A`: the operator whose eigenvalues are sought.
- `B`: the second operator for a generalized problem, or `nothing` for a standard one.
- `nev`: the requested number of eigenpairs.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

num_eigenpairs

Comment thread src/problems/eigenvalue_problems.jl Outdated
- `A`: the operator whose eigenvalues are sought.
- `B`: the second operator for a generalized problem, or `nothing` for a standard one.
- `nev`: the requested number of eigenpairs.
- `which`: the [`EigenvalueTarget`](@ref) selecting the part of the spectrum.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

eigentarget

Comment thread src/problems/eigenvalue_problems.jl Outdated
- `B`: the second operator for a generalized problem, or `nothing` for a standard one.
- `nev`: the requested number of eigenpairs.
- `which`: the [`EigenvalueTarget`](@ref) selecting the part of the spectrum.
- `sigma`: the shift for shift-and-invert, or `nothing`.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

shift

Comment thread src/problems/eigenvalue_problems.jl Outdated
Comment on lines +71 to +73
- `which`: which part of the spectrum to return, as an [`EigenvalueTarget`](@ref). An
ARPACK-style `Symbol` (`:LM`, `:SM`, `:LR`, `:SR`, `:LI`, `:SI`) is also accepted and
converted to the corresponding `EigenvalueTarget`. Defaults to the eigenvalues of

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Only accept the enum

Comment on lines +52 to +53
```math
A v = \lambda B v

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should define the default typing rules. If u0 is provided, then typeof(v) = typeof(u0). Otherwise it's the dense type of a row of A. Meanwhile, typeof(lambda) = eltype(A).

@ChrisRackauckas ChrisRackauckas merged commit b892a38 into SciML:master Jul 7, 2026
33 of 63 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