Skip to content

Fix _check_conj_split missing negative-imaginary eigenvalues#62

Open
Marius1311 wants to merge 1 commit intomainfrom
fix/check-conj-split-abs-imag
Open

Fix _check_conj_split missing negative-imaginary eigenvalues#62
Marius1311 wants to merge 1 commit intomainfrom
fix/check-conj-split-abs-imag

Conversation

@Marius1311
Copy link
Collaborator

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

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
@Marius1311 Marius1311 requested a review from msmdev February 18, 2026 15:17
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.

1 participant

Comments