-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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 Range assumption to Kronecker Delta #17433
Conversation
✅ Hi, I am the SymPy bot (v147). 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.5. Note: This comment will be updated with the latest check if you edit the pull request. You need to reload the page to see it. Click here to see the pull request description that was parsed.
Update The release notes on the wiki have been updated. |
assert expr[i, j].diff(A[m, n]).doit() == ( | ||
KDelta(i, m)*KDelta(j, n)*Trace(A) + | ||
KDelta(m, n)*A[i, j] | ||
) |
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.
need to cross-check this result
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.
OK, it's correct.
@asmeurer We have a new algorithm for matrix derivatives... and it was a lot easier to implement than the previous one. |
Codecov Report
@@ Coverage Diff @@
## master #17433 +/- ##
============================================
+ Coverage 60.18% 61.958% +1.778%
============================================
Files 631 631
Lines 163497 163526 +29
Branches 38362 38375 +13
============================================
+ Hits 98393 101319 +2926
+ Misses 59050 56466 -2584
+ Partials 6054 5741 -313 |
@@ -137,26 +144,34 @@ def test_matrix_derivative_vectors_and_scalars(): | |||
# Cookbook example 83: | |||
expr = (X*b + c).T*D*(X*b + c) | |||
assert expr.diff(X) == D*(X*b + c)*b.T + D.T*(X*b + c)*b.T | |||
assert expr[0, 0].diff(X[m, n]).doit() |
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.
Is there something missing from this assert?
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.
Yes, there is a problem with the simplification of the Kronecker delta... the expression is not optimal. I will try to fix this.
Added Range assumption to Kronecker Delta
References to other Issues or PRs
Brief description of what is fixed or changed
Other comments
Release Notes