Repository navigation
Conversation
… follow ?LALN2 (#145) The back substitution for a complex eigenvalue of a real Schur form solved each 2 x 2 diagonal block through its inverse and compared the block's determinant with the entry-sized clamp `eps_norm`. A determinant is a product of two entries, so every block with entries below `sqrt(eps_norm)` got the determinant `eps_norm` with its original numerators. After `scaled_into_range` the blocks of a strongly graded matrix are all that small, so every complex pair got a wrong eigenvector (GET22 up to 2.6e9). Stage comparison with LAPACK 3.12.0 on f64 n = 64: the Schur form is fine (backward error 8.0); on that same Schur form `dtrevc3` gives 2.2e-4 and faer 3.4e7, and every failing eigen-block is a complex pair. Balancing is not the cause (`dgeev` without it: 0.58; fixed faer: 0.45). Both 2 x 2 solves now use `?LALN2`'s method (`solve_shifted_2x2_cplx`): `eps_norm * I` when every entry is below `eps_norm`, otherwise elimination with complete pivoting and the second pivot raised to `eps_norm`. That covers the real-shift solve too, whose inverse through `a^2 - b c` underflowed to `inf` for tiny blocks. Raising only the determinant was rejected in review: with the original numerators it is not a solved system (4.5e14 on a 4 x 4 Schur form, now a test). Upstream faer 0.24.4 has the same comparison; it is added to upstream-reports as faer-029 with a 4 x 4 input that fails there and passes with this solve. Closes #145 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Member
Author
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
Closes #145. On strongly graded matrices
D A D^-1, the real nonsymmetric EVD returned wrong eigenvectors for every complex pair (GET22 up to 2.6e9).Stage-by-stage comparison with LAPACK 3.12.0
f64, n = 64,
D = diag(10^linspace(-6, 6, n)):dtrevc3on the same T)dgeevxon A, balanc = N / P / S / B?GEBAL) is not the cause: without it,dgeevgives 0.58 and the fixed faer 0.45, both well under the threshold. Balancing would bring both to about 1e-10. Adopting it is a separate decision.Cause
solve_cplx_shifted_upper_quasi_triangular_systemsolved each shifted 2×2 block through its inverse, and compared the determinant with the entry-sized clampeps_norm.sqrt(eps_norm)gotdet = eps_normwhile keeping its original numerators (adjugate).scaled_into_range(LAPACK validation: the nonsymmetric EVD fixtures exceed the GET22-style residual threshold (4 dtypes) #112) shrinks the blocks of a graded matrix enough for that to happen to every one of them.Fix
solve_shifted_2x2_cplx, a port of?LALN2's method:eps_norm, the block is taken aseps_norm * I;eps_normwhen it is smaller.a^2 - b c, which underflowed toinffor tiny blocks.Tests (all four dtypes; the real ones reach the changed code)
lapack_nonsymmetric_evd_graded_pairs_keep_their_residual: graded n = 16, 64, 128 plus a coupled 4×4, left and right GET22lapack_nonsymmetric_evd_pair_solve_with_a_small_determinantlapack_nonsymmetric_evd_real_shift_block_below_the_square_root_of_min_positiveNoConvergencelinalg::evdwith--include-ignored(release): 167 passed. The one failure is the known c32 kinds 6/7 case of LAPACK validation: the nonsymmetric EVD fixtures exceed the GET22-style residual threshold (4 dtypes) #112, on the complex path and untouched (diagnostics = 96 before and after).Upstream (
upstream-reports/faer-029-real-evd-pair-clamp)z < eps * norm,src/linalg/evd/mod.rs:828).dgeevCoordination
#112 (primerose-faer-autopilot) has no open PR. What remains there is the c32 complex path (kinds 6/7), and this change does not touch it.
🤖 Generated with Claude Code