Fix _check_conj_split missing negative-imaginary eigenvalues#62
Open
Marius1311 wants to merge 1 commit intomainfrom
Open
Fix _check_conj_split missing negative-imaginary eigenvalues#62Marius1311 wants to merge 1 commit intomainfrom
Marius1311 wants to merge 1 commit intomainfrom
Conversation
The _check_conj_split function only checked last_eigenvalue.imag > EPS, which missed cases where the negative-imaginary part of a conjugate pair appeared at the split boundary. This caused silent failures to detect complex conjugate splits, leading to incorrect crispness values. With newer scipy/numpy versions, LAPACK may return conjugate pairs with the negative-imaginary eigenvalue first, triggering this latent bug. Changes: - Use abs(last_eigenvalue.imag) > EPS in _check_conj_split - Add normalize_conj_pairs test helper for canonical conjugate pair ordering - Use normalized ordering in eigenvalue assertions in test_P_2_LM/LR
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.
The _check_conj_split function only checked last_eigenvalue.imag > EPS, which missed cases where the negative-imaginary part of a conjugate pair appeared at the split boundary. This caused silent failures to detect complex conjugate splits, leading to incorrect crispness values.
With newer scipy/numpy versions, LAPACK may return conjugate pairs with the negative-imaginary eigenvalue first, triggering this latent bug.
Changes: