-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compute real matrix logarithm and matrix square root using real arithmetic #39973
Merged
Merged
Changes from 69 commits
Commits
Show all changes
70 commits
Select commit
Hold shift + click to select a range
b5a1e13
Add failing test
sethaxen 391eab5
Add sylvester methods for small matrices
sethaxen 413290c
Add 2x2 real matrix square root
sethaxen cc60b10
Add real square root of quasitriangular matrix
sethaxen 063b2e9
Simplify 2x2 real square root
sethaxen f384944
Rename functions to use quasitriu
sethaxen 359c722
Avoid NaNs when eigenvalues are all zero
sethaxen 5d2c60a
Reuse ranges
sethaxen 7e980ed
Add clarifying comments
sethaxen 2bb972f
Unify real and complex matrix square root
sethaxen e465ead
Add reference for real sqrt
sethaxen 539b54d
Move quasitriu auxiliary functions to triangular.jl
sethaxen 7c5ec4a
Ensure loops are type-stable and use simd
sethaxen e1e0484
Remove duplicate computation
sethaxen 56a6cf9
Correctly promote for dimensionful A
sethaxen 6f45ecb
Use simd directive
sethaxen 20a4942
Test that UpperTriangular is returned by sqrt
sethaxen e39698f
Test sqrt for UnitUpperTriangular
sethaxen 96922de
Test that return type is complex when input type is
sethaxen f175738
Test that output is complex when input is
sethaxen a47ccf4
Add failing test
sethaxen eb589cd
Separate type-stable from type-unstable part
sethaxen 46561e1
Use generic sqrt_quasitriu for sqrt triu
sethaxen 4c0799b
Avoid redundant matmul
sethaxen a829f81
Clarify comment
sethaxen c19b557
Return complex output for complex input
sethaxen 0b53d89
Call log_quasitriu
sethaxen 2b61405
Add failing test for log type-inferrability
sethaxen fd3624b
Realify or complexify as necessary
sethaxen 0ba02c1
Call sqrt_quasitriu directly
sethaxen 075c3bc
Refactor sqrt_diag!
sethaxen 39411d1
Simplify utility function
sethaxen 7141bea
Add comment
sethaxen 435c354
Compute accurate block-diagonal
sethaxen 7e9d0ef
Compute superdiagonal for quasi triu A0
sethaxen 86e502e
Compute accurate block superdiagonal
sethaxen 889fd65
Avoid full LU decomposition in inner loop
sethaxen 3c2f567
Avoid promotion to improve type-stability
sethaxen 2813dd1
Modify return type if necessary
sethaxen 023e131
Clarify comment
sethaxen de99f00
Add comments
sethaxen 9775592
Call log_quasitriu on quasitriu matrices
sethaxen e15b92e
Document quasi-triangular algorithm
sethaxen 0ac37df
Remove test
sethaxen e817a37
Rearrange definition
sethaxen 5946cbe
Add compatibility for unit triangular matrices
sethaxen 2ee1585
Release constraints on tests
sethaxen 37d0344
Merge branch 'master' into reallog
sethaxen 23becc5
Separate copying of A from log computation
sethaxen ff9d8d7
Revert "Separate copying of A from log computation"
sethaxen cfa6ea1
Use Givens rotations
sethaxen e14a819
Compute Schur in-place when possible
sethaxen 5d37a0f
Always allocate a copy
sethaxen 3278edd
Fix block indexing
sethaxen 5b96c72
Compute sqrt in-place
sethaxen ae6daae
Overwrite AmI
sethaxen f673914
Reduce allocations in Pade approximation
sethaxen c96a05b
Use T
sethaxen 9db29fc
Don't unnecessarily unwrap
sethaxen 0c475bc
Test remaining log branches
sethaxen 96b6f3d
Add additional matrix square root tests
sethaxen d1da048
Separate type-unstable from type-stable part
sethaxen 69e298d
Use Ref instead of a Vector
sethaxen 9785686
Eliminate allocation in checksquare
sethaxen de1682c
Refactor param choosing code to own function
sethaxen 27d2063
Comment section
sethaxen def31ba
Use more descriptive variable name
sethaxen cb941b1
Reuse temporaries
sethaxen d1d7095
Add reference
sethaxen de5fdd7
More accurately describe condition
sethaxen File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you square
Z
here?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm actually composing two different
Z
s to eliminate one matrix multiplication. In the original implementation, it was essentiallyFZ * SZ * log(T) * SZ' * FZ'