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
Added schur complement and block decompositions #20406
Conversation
✅ Hi, I am the SymPy bot (v161). I'm here to help you write a release notes entry. Please read the guide on how to write release notes. Your release notes are in good order. Here is what the release notes will look like:
This will be added to https://github.com/sympy/sympy/wiki/Release-Notes-for-1.8. Click here to see the pull request description that was parsed.
Update The release notes on the wiki have been updated. |
@oscarbenjamin I could add this too - #19336 (comment) |
There's a slight problem while building the docs since both |
You have some problems with the references in the docs. |
>>> X.schur() | ||
-C*A**(-1)*B + D | ||
>>> X.schur('D') | ||
A - B*D**(-1)*C |
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.
Passing a string like this seems like an odd interface. Would it be possible for the schur
function to check whether the matrices are invertible and choose which form to use based on that? Otherwise I think that there could be a better way to specify which matrix to invert over.
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.
What if there are multiple matrices which are invertible? Maybe we could use the position of the block matrix, i.e. (0,0) for 'A', (0,1) for 'B ' and so on
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.
@oscarbenjamin Any thoughts?
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.
@oscarbenjamin Please review this when you get some time
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.
@oscarbenjamin Please look into this too
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.
Right now, although it looks an overkill for use block matrix only to get 2x2 schur complements, I believe that we can make any other place to comprehend schur complements as some result of noncommutative matrix computation later, if there is.
I removed the references but I think its failing because of same function names. Or is it something else? |
The references for LUdecomposition in the overall docs should be modified like MatrixBase.LUdecomposition |
The references seem to be fixed, but it says no object found for the references to the functions I have added |
Maybe the path should be like matrices.expressions.blockmatrix.BlockMatrix than matrices.expressions.BlockMatrix I have seen that the docstring for sympy.matrices.dense.diag is using the reference for BlockMatrix like that, so it’s more likely that that works, but I can’t guarantee |
Codecov Report
@@ Coverage Diff @@
## master #20406 +/- ##
=============================================
- Coverage 75.771% 75.739% -0.032%
=============================================
Files 673 673
Lines 174110 174179 +69
Branches 41106 41118 +12
=============================================
- Hits 131925 131923 -2
- Misses 36467 36527 +60
- Partials 5718 5729 +11 |
What is the difference between LDUdecomposition and UDLdecomposition? |
|
If there are no subtle difference than giving permuted output, how should they be in different API? |
The definition of U,D,L stays the same, but the matrices would differ. The matrices L,D,U obtained from |
Okay I see they were just implemented with respect to what wikipedia says. |
Yes, I tried to find more literature on block decompositions, but couldn't find much. The closed form expressions are only available for 2x2 matrices as is the definition of Schur complement |
Added Schur Complement, Generalized Schur Complement and LDU, UDL and LU Block Decompositions
References to other Issues or PRs
Fixes #20401
Release Notes