-
-
Notifications
You must be signed in to change notification settings - Fork 5
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
Can't sum partially initialized Hermitian matrices that are not isbits with Hermitian Diagonal matrices #1056
Comments
The issue seems to be with summing a partially uninitialised Matrix and a Diagonal, which lacks a specialised method. I'll try to come up with a fix, which may also help with performance. |
I've looked into it. The problem is that when you call Argh, this means that whenever |
Yes, that makes sense. Perhaps we need to expose some function that falls back to summing over the triangular parts, and one that may be specialized by packages. The reason the current implementation was limited to |
We may use the fact that a `Diagonal` is already triangular to avoid adding a wrapper. Fixes the specific example in https://github.com/JuliaLang/julia/issues/53564, although not the broader issue. This is because it changes the operation from a `UpperTriangular + UpperTriangular` to a `UpperTriangular + Diagonal`, which uses broadcasting. The latter operation may also allow one to define more efficient methods.
This backports the following commits: commit 9690961c426ce2640d7db6c89952e69f87873a93 Author: Jishnu Bhattacharya <jishnub.github@gmail.com> Date: Mon Apr 29 21:43:31 2024 +0530 Add upper/lowertriangular functions and use in applytri (#53573) We may use the fact that a `Diagonal` is already triangular to avoid adding a wrapper. Fixes the specific example in https://github.com/JuliaLang/julia/issues/53564, although not the broader issue. This is because it changes the operation from a `UpperTriangular + UpperTriangular` to a `UpperTriangular + Diagonal`, which uses broadcasting. The latter operation may also allow one to define more efficient methods. commit 77821cdddb968eeabf31ccb6b214ccf59a604c68 Author: Jishnu Bhattacharya <jishnub.github@gmail.com> Date: Wed Aug 28 00:53:31 2024 +0530 Remove Diagonal-triangular specialization commit 621fb2e739a04207df63857700aca3562b41b5eb Author: Jishnu Bhattacharya <jishnub.github@gmail.com> Date: Wed Aug 28 00:50:49 2024 +0530 Restrict broadcasting to strided-diag Diagonal commit 58eb2045ddb5dbbfdb759c06239ca54751e73d71 Author: Jishnu Bhattacharya <jishnub.github@gmail.com> Date: Wed Aug 28 00:44:47 2024 +0530 Add tests for partly filled parent commit 5aa6080a580bfbc9453e94a06f3e379e4517b316 Author: Jishnu Bhattacharya <jishnub.github@gmail.com> Date: Tue Aug 27 20:42:07 2024 +0530 Reroute Symmetric/Hermitian + Diagonal through triangular
This backports the following commits: commit 9690961c426ce2640d7db6c89952e69f87873a93 Author: Jishnu Bhattacharya <jishnub.github@gmail.com> Date: Mon Apr 29 21:43:31 2024 +0530 Add upper/lowertriangular functions and use in applytri (#53573) We may use the fact that a `Diagonal` is already triangular to avoid adding a wrapper. Fixes the specific example in https://github.com/JuliaLang/julia/issues/53564, although not the broader issue. This is because it changes the operation from a `UpperTriangular + UpperTriangular` to a `UpperTriangular + Diagonal`, which uses broadcasting. The latter operation may also allow one to define more efficient methods. commit 77821cdddb968eeabf31ccb6b214ccf59a604c68 Author: Jishnu Bhattacharya <jishnub.github@gmail.com> Date: Wed Aug 28 00:53:31 2024 +0530 Remove Diagonal-triangular specialization commit 621fb2e739a04207df63857700aca3562b41b5eb Author: Jishnu Bhattacharya <jishnub.github@gmail.com> Date: Wed Aug 28 00:50:49 2024 +0530 Restrict broadcasting to strided-diag Diagonal commit 58eb2045ddb5dbbfdb759c06239ca54751e73d71 Author: Jishnu Bhattacharya <jishnub.github@gmail.com> Date: Wed Aug 28 00:44:47 2024 +0530 Add tests for partly filled parent commit 5aa6080a580bfbc9453e94a06f3e379e4517b316 Author: Jishnu Bhattacharya <jishnub.github@gmail.com> Date: Tue Aug 27 20:42:07 2024 +0530 Reroute Symmetric/Hermitian + Diagonal through triangular
We may use the fact that a `Diagonal` is already triangular to avoid adding a wrapper. Fixes the specific example in https://github.com/JuliaLang/julia/issues/53564, although not the broader issue. This is because it changes the operation from a `UpperTriangular + UpperTriangular` to a `UpperTriangular + Diagonal`, which uses broadcasting. The latter operation may also allow one to define more efficient methods.
Edge case of JuliaLang/julia#52895, missed by the bugfix JuliaLang/julia#52942. @jishnub I think this will be easy for you.
The text was updated successfully, but these errors were encountered: