-
Notifications
You must be signed in to change notification settings - Fork 1
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
Add lu
decomposition for Tensor
s
#94
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## develop #94 +/- ##
===========================================
+ Coverage 87.71% 88.18% +0.46%
===========================================
Files 10 10
Lines 570 584 +14
===========================================
+ Hits 500 515 +15
+ Misses 70 69 -1
☔ View full report in Codecov by Sentry. |
4a2a6f2
to
02f2514
Compare
@jofrevalles I've updated the code to the recent changes. Also, I've refactored the SVD and QR factorizations. Would you mind giving a quick review? |
I have checked it and everything looks good to me! |
Summary
This PR adds the new
lu
function for tensors, extending theLinearAlgebra.lu
function (resolve #26). The newlu
function returns the LU decomposition of aTensor
, where the tensor can be recovered by contracting the permutation tensorP
, the tensorL
, and tensorU
. The tensorsL
andU
are reshaped versions of the original lower and upper triangular matrices obtained during the decomposition process, respectively.This implementation is inspired by the LU decomposition in the
scipy
library, as it returns the permutation tensorP
allowing the original tensorA
to be recovered with the contractionA = P * L * U
. This contrasts withLinearAlgebra
, where the permutation vectorp
is returned, and the original matrix can be recovered withP' * A = L * U
(whereP'
is the permutation matrix built fromp
).Please let me know if there are any concerns or issues with extending the
LinearAlgebra
library in this manner.We have also added tests for this new function.
Example
A usage example of the lu function: