Skip to content

fix!: revamp linear operator handling#172

Merged
gdalle merged 5 commits intomainfrom
gd/update
Jun 10, 2025
Merged

fix!: revamp linear operator handling#172
gdalle merged 5 commits intomainfrom
gd/update

Conversation

@gdalle
Copy link
Copy Markdown
Member

@gdalle gdalle commented Jun 9, 2025

Caution

Breaking changes in the public API. Bumping version to v0.8.0.

Breaking changes

  • Rename KrylovLinearSolver into IterativeLinearSolver
  • Enforce strict behavior with DifferentiationInterface, with an option to relax it
  • Specify correct vector type in the LinearOperator definition, leading to errors with ComponentArrays
  • Make B a function instead of a linear operator or matrix

Other changes

  • Allow specifying different backends for differentiating conditions with respect to x and y
  • Allow the use of LinearMaps + IterativeSolvers instead of LinearOperators + Krylov

Internal changes

  • Switch to TestItems for testing
  • Add compat deps

@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 9, 2025

Codecov Report

Attention: Patch coverage is 99.14530% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/implicit_function.jl 93.75% 1 Missing ⚠️
Files with missing lines Coverage Δ
ext/ImplicitDifferentiationChainRulesCoreExt.jl 95.00% <100.00%> (+0.26%) ⬆️
ext/ImplicitDifferentiationForwardDiffExt.jl 100.00% <100.00%> (ø)
src/ImplicitDifferentiation.jl 100.00% <ø> (ø)
src/execution.jl 100.00% <100.00%> (ø)
src/preparation.jl 100.00% <100.00%> (ø)
src/settings.jl 100.00% <100.00%> (+7.69%) ⬆️
src/implicit_function.jl 88.88% <93.75%> (+0.88%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@gdalle gdalle changed the title fix!: make B a function and not a linear operator or a matrix fix!: revamp linear operator handling Jun 9, 2025
@gdalle gdalle marked this pull request as ready for review June 10, 2025 20:38
@gdalle gdalle merged commit 474654d into main Jun 10, 2025
4 checks passed
@amontoison
Copy link
Copy Markdown

LinearMaps also works with Krylov.jl. What is the reason to support IterativeSolvers.jl? For information, the GMRES method is only restarted in this package.

@gdalle
Copy link
Copy Markdown
Member Author

gdalle commented Jun 12, 2025

To me it made sense to support both ecosystems: LinearMaps + IterativeSolvers and LinearOperators + Krylov, since they were both designed to work best with each other.

@gdalle gdalle deleted the gd/update branch June 12, 2025 20:38
@amontoison
Copy link
Copy Markdown

amontoison commented Jun 12, 2025

To the best of my knowledge, Krylov.jl was modified since a few years to work with both API the same way.
Be careful if you use solvers IterativeSolvers, a few of their solvers have bugs...
SciML/LinearSolve.jl#181

@gdalle
Copy link
Copy Markdown
Member Author

gdalle commented Jun 12, 2025

Good to know. Judging by number of stars and seniority I thought they were both valid alternatives.

@gdalle
Copy link
Copy Markdown
Member Author

gdalle commented Jun 12, 2025

Essentially my reasoning was: due to some type issues, I sometimes need LinearMaps instead of LinearOperators. In that case, I should pick the solver that goes best with LinearMaps, and I thought that was IterativeSolvers

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