[FIX] riemann ASR eigpair mismatch in nonlinear_eigenspace#100
Open
nbara wants to merge 3 commits into
Open
Conversation
nbara
force-pushed
the
fix/issue-99-riemann-eigpairs
branch
from
May 24, 2026 20:45
1ef2eaa to
3f568d8
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes a Riemannian ASR instability caused by nonlinear_eigenspace returning eigenvalues that don’t correspond to the optimized eigenvectors, leading to mismatched eigpairs and incorrect component ordering/selection.
Changes:
- Update
nonlinear_eigenspaceto derive returned eigenvalues from the optimized basis (Rayleigh quotients) instead of the random-initialization eigendecomposition output. - Add a regression test asserting returned eigenvalues are consistent with the returned eigenvectors (when
pymanoptis available).
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
meegkit/utils/covariances.py |
Computes eigenvalues from the optimized solution basis to avoid returning mismatched eigpairs. |
tests/test_cov.py |
Adds a regression test checking eigenvalue/eigenvector consistency for nonlinear_eigenspace. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #100 +/- ##
==========================================
+ Coverage 83.10% 83.13% +0.02%
==========================================
Files 25 25
Lines 2818 2823 +5
==========================================
+ Hits 2342 2347 +5
Misses 476 476 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
nbara
force-pushed
the
fix/issue-99-riemann-eigpairs
branch
2 times, most recently
from
May 24, 2026 20:51
231a88c to
3db6d0a
Compare
nbara
added a commit
that referenced
this pull request
May 24, 2026
nbara
force-pushed
the
fix/issue-99-riemann-eigpairs
branch
from
May 24, 2026 20:54
3db6d0a to
3a26f6f
Compare
sappelhoff
approved these changes
Jul 10, 2026
sappelhoff
left a comment
Collaborator
There was a problem hiding this comment.
apart from the uv.lock, this seems to fix it.
sappelhoff
reviewed
Jul 10, 2026
| @@ -0,0 +1,4852 @@ | |||
| version = 1 | |||
nbara
force-pushed
the
fix/issue-99-riemann-eigpairs
branch
from
July 12, 2026 06:50
3a26f6f to
4ee8e7e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Why
The previous implementation returned eigenvalues from a random-initialization matrix (S0) but eigenvectors from the optimizer solution (Xsol.point), producing mismatched eigpairs and unstable component ordering in riemann ASR.
Validation
Closes #99