Skip to content

Update arnoldi.jl to include a reorthogonalisation option - #262

Open
cneverett wants to merge 2 commits into
SciML:masterfrom
cneverett:patch-1
Open

Update arnoldi.jl to include a reorthogonalisation option#262
cneverett wants to merge 2 commits into
SciML:masterfrom
cneverett:patch-1

Conversation

@cneverett

@cneverett cneverett commented Jul 28, 2026

Copy link
Copy Markdown

Added an option to reorthogonalise (reorth) each basis vector during its construction in arnoldi!. This helps numerical roundoff from leading to poor basis orthogonalisation, even with a modified Gram-Schmidt procedure, especially when the Krylov subspace dimension is large. This can lead to better stability and smaller errors for large, highly stiff, non-normal systems.

This is my first time contributing to SciML, so I am not familiar with the format of pull requests. This pull request only adds a small feature and I have updated the function documentation to include it. I am not sure if it needs any specific tests.

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

Add any other context about the problem here.

Added an option to reorthogonalise (`reorth`) each basis vector during its construction in `arnoldi!`. This helps numerical roundoff from leading to poor basis orthogonalisation, especially when the Krylov subspace dimension is large.
@ChrisRackauckas

Copy link
Copy Markdown
Member

Do you have a test case where this was shown to be a tangible improvement?

@cneverett

Copy link
Copy Markdown
Author

Unfortunately I don't have a simple test case that shows the improvement. I have been developing a modified version of arnoldi! to work with very large systems that I have been modelling (stiff, non-normal Jacobians of size around 10^4x10^4 needing Krylov dimensions of around 256 to captures dynamics accurately) and I doing so I have found that adding in this simple re-orthogonalisation process does help reduce the errest of functions like phiv! used for time stepping and reduce noise in the output results.

I can try to come up with a simple test-case to demonstrate these findings but it will take time. Or I could use the systems I am currently modelling and show some outputs with and without this re-orthogonalisation?

@ChrisRackauckas

Copy link
Copy Markdown
Member

Tests fail.

This should get at least one test exercising it.

`reorth` now a kwarg to `arnoldi_step!` set by default to `false` to avoid downstream breaking of functions
@cneverett

Copy link
Copy Markdown
Author

I have now made reorth a kwarg in arnoldi_step! (set to false by default) so it shouldn't break downstream tests by changing the number of arguments.

I will come up with at least one test demonstrating the difference, which will take a little time.

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