-
-
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
Fix commutation issue of matrix adjoint, transpose, inverse #24738
Conversation
✅ Hi, I am the SymPy bot. I'm here to help you write a release notes entry. Please read the guide on how to write release notes.
Click here to see the pull request description that was parsed.
|
1 similar comment
✅ Hi, I am the SymPy bot. I'm here to help you write a release notes entry. Please read the guide on how to write release notes.
Click here to see the pull request description that was parsed.
|
✅ Hi, I am the SymPy bot. 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.13. Click here to see the pull request description that was parsed.
Update The release notes on the wiki have been updated. |
Benchmark results from GitHub Actions Lower numbers are good, higher numbers are bad. A ratio less than 1 Significantly changed benchmark results (PR vs master) Significantly changed benchmark results (master vs previous release) before after ratio
[41d90958] [31656382]
<sympy-1.11.1^0>
- 1.17±0ms 700±20μs 0.60 solve.TimeSparseSystem.time_linear_eq_to_matrix(10)
- 3.33±0.01ms 1.28±0ms 0.38 solve.TimeSparseSystem.time_linear_eq_to_matrix(20)
- 6.67±0.01ms 1.87±0ms 0.28 solve.TimeSparseSystem.time_linear_eq_to_matrix(30)
Full benchmark results can be found as artifacts in GitHub Actions |
36f59af
to
2335c8c
Compare
I managed to get back this working. I'd like some reviews for this. |
Looks good to me. Thanks! |
References to other Issues or PRs
Fixes #24735
Brief description of what is fixed or changed
I added a guard for
bc_matmul
for matrix power becauselist
multiplied with negative integer gives empty list, which can be causing some bugs whenMatPow
is used with negative integer.So this fixes more general issues with matrix power with negative integer
block_collapse(MatPow(A.transpose(), -2))
This also fixes more general problem of
adjoint, transpose, conjugate
not giving same result asinverse
For example,
because each methods had used different code path.
Other comments
Release Notes
block_collapse
giving wrong result forInverse
adjoint
,transpose
,conjugate
not commuting withinverse
for matrix expressions. For example,A.transpose().inverse()
andA.inverse().transpose()
will give same result.