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
Fix matrix-matrix hadamard power #16508
Conversation
✅ Hi, I am the SymPy bot (v148). 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. |
Codecov Report
@@ Coverage Diff @@
## master #16508 +/- ##
=============================================
- Coverage 74.699% 74.694% -0.005%
=============================================
Files 633 633
Lines 164460 164487 +27
Branches 38611 38623 +12
=============================================
+ Hits 122850 122863 +13
- Misses 36219 36223 +4
- Partials 5391 5401 +10 |
I see sympy raises error when hadamard product between matrix and scalar. We may need some other source to verify |
This has merge conflicts now... |
218f8ae
to
67556b9
Compare
Whatever, I couldn't find any good article for the hadamard product notation to be defined between a matrix and scalar, or the hadamard power notation to be defined between a matrix and a matrix, but at least having an option to raise a matrix base to a matrix exponent can be convenient if defined. If other properties related to the hadamard product or hadamard power do not break with such new definition, |
…uct and HadamardPower doc for sympy website
67556b9
to
708c383
Compare
I've got the sphinx render, |
Looks good. Merging |
References to other Issues or PRs
Fixes #16505
Brief description of what is fixed or changed
If both base and exponent are matrix, hadamard power can be defined from hadamard exponential and logarithm as usual definition for the matrix power.
And since hadamard exponential and hadamard log are elementwise exponential and logarithm, it can be reduced to
for each matrix elements.
Still the definition for the hadamard power between a matrix and a scalar is unclear, however, if it is defined as usual matrix-scalar product, it can easily be reduced to the elementwise power.
Other comments
Release Notes
HadamardProduct.as_explicit
now supports matrix to matrix power.HadamardProduct
andHadamardPower
.