feat: Implement Ogita-Aishima iterative refinement method - #17
Conversation
This commit introduces the Ogita-Aishima (OA) iterative refinement method as a new correction strategy for eigenvalue tracking. The OA method provides a more sophisticated way to correct the trajectory of eigenpairs compared to the existing matching method. It iteratively refines an approximate eigendecomposition to improve its accuracy, with special handling for clustered eigenvalues. Changes include: - A new `ogita_aishima_refinement` function in `correction.py` that contains the core implementation of the algorithm. - The `correct_trajectory` function has been refactored to act as a dispatcher, allowing the user to select the correction method. - The main `eigenpairtrack` function now exposes a `correction_method` argument to the user. - Added new unit tests for the `ogita_aishima_refinement` function, including a case for clustered eigenvalues. - Updated existing tests to be compatible with the new `correction_method` argument.
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll acknowledge your comments with a 👀 emoji and then get to work. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! I will automatically address your feedback. For any comments you don't want me to act on, just include (aside). For security, I will only act on instructions from the user who triggered this task for this pull request. |
|
Please run lint before you push! 👀 |
Thank you for the feedback! I have now run the linter and fixed the reported issues. |
This commit introduces the Ogita-Aishima (OA) iterative refinement method as a new correction strategy for eigenvalue tracking. The OA method provides a more sophisticated way to correct the trajectory of eigenpairs compared to the existing matching method. It iteratively refines an approximate eigendecomposition to improve its accuracy, with special handling for clustered eigenvalues. Changes include: - A new `ogita_aishima_refinement` function in `correction.py` that contains the core implementation of the algorithm. - The `correct_trajectory` function has been refactored to act as a dispatcher, allowing the user to select the correction method. - The main `eigenpairtrack` function now exposes a `correction_method` argument to the user. - Added new unit tests for the `ogita_aishima_refinement` function, including a case for clustered eigenvalues. - Updated existing tests to be compatible with the new `correction_method` argument. - Ran linter and fixed reported issues.
Code Review generated by Gemini👀:
|
Thank you for the excellent suggestion! I have vectorized the implementation of |
This commit introduces the Ogita-Aishima (OA) iterative refinement method as a new correction strategy for eigenvalue tracking. The OA method provides a more sophisticated way to correct the trajectory of eigenpairs compared to the existing matching method. It iteratively refines an approximate eigendecomposition to improve its accuracy, with special handling for clustered eigenvalues. Changes include: - A new `ogita_aishima_refinement` function in `correction.py` that contains the core implementation of the algorithm. This function is vectorized for performance. - The `correct_trajectory` function has been refactored to act as a dispatcher, allowing the user to select the correction method. - The main `eigenpairtrack` function now exposes a `correction_method` argument to the user. - Added new unit tests for the `ogita_aishima_refinement` function, including a case for clustered eigenvalues. - Updated existing tests to be compatible with the new `correction_method` argument. - Ran linter and fixed reported issues.
|
👀 Add a demonstration notebook for the OA method. Execute it before commit it and ensure that the demonstration can be rendered on browser viewers. |
I have added a new demonstration notebook for the Ogita-Aishima method at |
This commit adds a new Jupyter notebook to demonstrate the usage and effectiveness of the Ogita-Aishima iterative refinement method. The notebook (`notebooks/ogita_aishima_demonstration.ipynb`) includes: - A setup for a matrix with clustered eigenvalues. - A comparison of the tracking results using both the standard 'matching' correction and the new 'ogita_aishima' correction. - A plot to visualize the difference in norm error between the two methods.
This commit adds a new Jupyter notebook to demonstrate the usage and effectiveness of the Ogita-Aishima iterative refinement method. The notebook (`notebooks/ogita_aishima_demonstration.ipynb`) has been executed with `papermill`, so it includes all the outputs and plots. The demonstration includes: - A setup for a matrix with clustered eigenvalues. - A comparison of the tracking results using both the standard 'matching' correction and the new 'ogita_aishima' correction. - A plot to visualize the difference in norm error between the two methods.
This patch implements the Ogita-Aishima (OA) iterative refinement method for eigenvalue decomposition tracking, as described in the paper "荻田・相島の固有ベクトル反復改良法に基づく実対称行列の固有値分解追跡手法" (Shiroma, Kudo, Yamamoto, 2019).
The OA method is a powerful technique for improving the accuracy of an approximate eigendecomposition. It has been integrated into the library as a new correction method that can be selected by the user. This provides a more advanced alternative to the existing post-hoc matching correction.
The implementation follows the detailed mathematical formulation provided by the user, including the branching logic to handle clustered eigenvalues, which is a key feature of the OA method.