Skip to content
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

Generic coefficient type #163

Merged
merged 18 commits into from
Nov 20, 2024
Merged

Generic coefficient type #163

merged 18 commits into from
Nov 20, 2024

Conversation

sumiya11
Copy link
Owner

With this commit, Groebner aims to support all fields in AbstractAlgebra and Nemo, i.e., anything that is a subtype of AbstractAlgebra.Field.

The implementation over AbstractAlgebra.GF(p) and AbstractAlgebra.QQ is not affected by this commit.

For all other fields, the coefficients of polynomials are wrapped in Groebner.CoeffGeneric. Conversion functions now recognize this type as a special case. Additionally now Groebner.CoeffGeneric is also Groebner.Coeff, so that F4 supports Groebner.CoeffGeneric.

Low-level functions now may accept and output Groebner.CoeffGeneric.

Some more tests and benchmarks will follow.

With this commit, Groebner aims to support all
fields in AbstractAlgebra and Nemo, i.e., anything
that is a subtype of AbstractAlgebra.Field.

The implementation over AbstractAlgebra.GF(p) and
AbstractAlgebra.QQ is not affected by this commit.

For all other fields, the coefficients of
polynomials are wrapped in Groebner.CoeffGeneric.
Additionally we declare
    Groebner.CoeffGeneric <: Groebner.Coeff
so that F4 supports Groebner.CoeffGeneric.

Low-level functions now may accept and output
Groebner.CoeffGeneric.

Some more tests and benchmarks will follow.
@sumiya11
Copy link
Owner Author

sumiya11 commented Nov 20, 2024

Native Z/pZ vs. generic Z/pZ, in AbstractAlgebra and Nemo:

using Nemo, AbstractAlgebra

c = Groebner.Examples.cyclicn(7, k=GF(2^30+3))

@time g = groebner(c, linalg=:deterministic);
  0.143969 seconds (47.23 k allocations: 17.132 MiB)
@time g = groebner(c, _generic=true);
  1.217754 seconds (47.28 k allocations: 20.749 MiB, 0.80% gc time)

c = Groebner.Examples.cyclicn(7, k=Nemo.GF(2^30+3))

@time g = groebner(c, linalg=:deterministic);
  0.141782 seconds (238.55 k allocations: 24.014 MiB)
@time g = groebner(c, _generic=true);
  6.404721 seconds (147.42 M allocations: 10.995 GiB, 26.34% gc time)

@sumiya11
Copy link
Owner Author

sumiya11 commented Nov 20, 2024

Generic coefficients seem to work, so I merge this. May need an entry in the documentation and more tests; would come in a separate PR.

@sumiya11 sumiya11 merged commit bd2d137 into master Nov 20, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant