Implement schur_full/schur_vals for Diagonal inputs - #277
Open
lkdvos wants to merge 1 commit into
Open
Conversation
Schur reuses eig's algorithm selection, which routes `Diagonal` to `DiagonalAlgorithm`, but no such implementation existed, so both threw a `MethodError`. A diagonal matrix is already in Schur form: `T = A`, `Z = I` and `vals = diagview(A)`, without any reordering. Fixes #276 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
🚀 New features to boost your workflow:
|
Member
|
What is the rational for |
Member
Author
|
No rationale... I forgot we had this whole discussion with the eigenvalues as well, I'll change it |
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.
Fixes #276:
Diagonalinput selectsDiagonalAlgorithm, which schur never implemented, soschur_full/schur_valsthrew aMethodError.A diagonal matrix is already in Schur form, so
T = A,Z = Iandvals = diagview(A). Two choices worth flagging:Diagonalpath ofeig, which sorts. Soschur_vals(::Diagonal) != eig_vals(::Diagonal)in ordering; the testsuite'svalsc ≈ eig_vals(A)is relaxed accordingly.valskeepseltype(A)(no complexification), andZstaysDiagonal, asqr/lqkeepQandRdiagonal.Enables the
Diagonalschur tests that were commented out as "not supported yet", CPU and CUDA. Note this alone does not fixschur_full(::DiagonalTensorMap): TensorKit omits schur from itsdefault_algorithmforwarding, so selection fails there for every tensor, diagonal or not. That needs a separate PR.🤖 Generated with Claude Code