Closed jofrevalles closed 8 months ago
Attention: 1 lines
in your changes are missing coverage. Please review.
Comparison is base (
5b3e11b
) 87.71% compared to head (525f14e
) 88.18%. Report is 1 commits behind head on develop.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
@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?
@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: