Conversation
This was referenced Sep 30, 2026
leburgel
force-pushed
the
lb/block_qr_pivoting
branch
from
September 30, 2026 17:58
926acc4 to
5f0bbc2
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #170 +/- ##
==========================================
+ Coverage 86.65% 86.69% +0.04%
==========================================
Files 36 36
Lines 3918 3915 -3
==========================================
- Hits 3395 3394 -1
+ Misses 523 521 -2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This branch has not been deployed
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.
I was trying to hack a way around #78 by using the
BlockLanczosmethod to warm-start aneigsolvefor 6 extremal eigenvectors using a previous partially converged result, and ran into what I think is a bug inblock_qr!that actually made the warm start worse than starting from scratch.block_qr!orthogonalized the vectors in the order they were given, so the detected rank could depend on that order. This adds column pivoting: the remaining vector with the largest norm is processed first.This shows up when warm-starting
BlockLanczosfrom the eigenvectors of an earlier, unconvergedeigsolve. Those vectors share one residual direction, soAX - XΘhas rank 1 and the block should shrink to size 1 after the first step. The first vector is usually the best converged one, though. Normalizing its tiny residual first gives a direction dominated by rounding errors, and projecting the larger residuals onto it leaves remainders aboveqr_tol. The iteration then carries a spurious second vector, doubling the matvecs per step. Reversing the input order avoids it on master.goodidxis now returned in pivot order, andRis upper triangular only up to a column permutation. The callers only rely onblock[goodidx] * Rreproducing the block, so they don't change.Reproducer:
master:
this PR:
Added a test in
test/block.jlthat fails on master.With
krylovdim = 20the warm start is still slower than a cold start (1173 vs 886 matvecs), which was a bit disappointing since that was exactly the case I was actually interested in.Could this be a separate problem in theBlockLanczosrestart?