-
Notifications
You must be signed in to change notification settings - Fork 13
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
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
The commit adds basic tests for generic coefficients for some Nemo fields. It also fixes a regression in multi-modular when randomized linear algebra was not used for guessing a prime.
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) |
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. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.