Open 8d1h opened 3 years ago
Probably the reason we didn't memoize it originally was to allow for garbage collection of unused Galois fields. One can imagine experiments that make a lot of them. If that's not a concern, memoization might be good now. And it might be good to make GF 11
and ZZ/11
give the same answer.
That would indeed be nice. Also I think currently the arithmetic over ZZ/11
is faster than GF 11
.
i23 : ZZ/11[x]; time for i to 10000 do factor x^2-1;
-- used 0.451269 seconds
i25 : GF 11[x]; time for i to 10000 do factor x^2-1;
-- used 2.07047 seconds
And isFinitePrimeField GF 11
returns false
since it checks with isQuotientRing
.
Hi! I saw this in the documentation which I guess is not the desired behavior.
This could be fixed by making
GF
memoized. I saw this trick in the package "Cyclotomic", where the same number would always give the exact same cyclotomic field.