Macaulay2 / M2

The primary source code repository for Macaulay2, a system for computing in commutative algebra, algebraic geometry and related fields.
https://macaulay2.com
345 stars 230 forks source link

LUdecomposition incorrect? #2975

Open LukeOeding opened 12 months ago

LukeOeding commented 12 months ago

I noticed an error in the output of LUdecomposition. Here is my MnWE:

K =  matrix {{1, 1, 0, 0}, {0, 0, 1, 0}, {0, 0, 0, 1}, {0, 0, 1, 1}}
(P, L, U) = LUdecomposition ( sub (K,QQ)    )
Q = id_(QQ^4)_P
Q*L*U == K

Not sure the implications of this, or how often this function is actually used.

mikestillman commented 12 months ago

Thanks! I'll take a look.

davikrehalt commented 11 months ago

Is it related to https://github.com/Macaulay2/M2/issues/2941#issue-1920588919? I tried to track down the error there and I wasn't sure if LU decomposition was called there as well

TheGrateSalmon commented 7 months ago

Looking at the high-level documentation, it doesn't look like LUdecomposition is implemented for QQ as it only supports matrices over ZZ/p, RR, and CC. While I'm not sure what could go wrong by using QQ, I don't think it can be expected to work over QQ either (at the moment).