Open mbauman opened 11 months ago
I'll try to implement it here first and if it works out, discuss about integrating it into stdlib.
However, I'll be slow as I do this during my free time. Please feel free to overtake me in case you're interested, or better yet, work together with me :)
Some applications require an arbitrary sorting of eigenvalues in a Schur decomposition. Currently,
ordschur
supports re-ordering with a logicalselect
vector that effectively groups the eigenvalues into two clusters using the LAPACKt[rg]sen
. I believe LAPACK also supports moving an individual eigenvalue around withtrexc
.However, newer blocked algorithms exist that outperform LAPACK's naive bubble-sort-like algorithm here and can facilitate sorting eigenvalues into multiple clusters more efficiently. See, e.g., Kressner, Daniel (2006). Block algorithms for reordering standard and generalized Schur forms. ACM Transactions on Mathematical Software, 32(4), 521–532. doi:10.1145/1186785.1186787.
I do not believe any open-source project has incorporated this functionality to date. There is an open issue in scipy requesting its addition: https://github.com/scipy/scipy/issues/10872.