-
Notifications
You must be signed in to change notification settings - Fork 142
Add f4ncgb
algorithm for non-commutative groebner basis computation
#5265
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
base: master
Are you sure you want to change the base?
Conversation
Refactor `groebner_basis` to support multiple algorithms via an `algorithm` keyword argument, including :f4, :buchberger, and :letterplace. Improve documentation. Update F4NCGB interface to handle variable ordering and type consistency. Add tests for F4 algorithm.
@req algorithm in (:f4, :buchberger, :letterplace) "Not a valid algorithm, use :f4ncgb, :buchberger or :letterplace" | ||
|
||
if algorithm == :f4 | ||
@req ordering == :deglex "f4 only supports :deglex ordering" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't like that the default option does not work in all cases. In particular, this may break peoples code where they have a non-deglex ordering and the default algorithm. Their code used to work but will break now.
I think the solution to that is the following: Have as the default option algorithm=:default
, and inside the function decide what the default algorithm should be (by looking at the situation). For the deglex case over QQ, you could change :default
to :f4
, while in other cases you change :default
to :buchberger
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good Idea, I changed it
f4ncgb
algorithm for non-commutative groebner basis computation.f4ncgb
algorithm for non-commutative groebner basis computation
Despite my minor quibbles (all easy to address): very nice, thanks for working on this! |
|
||
if algorithm == :f4 | ||
@req ordering == :deglex "f4 only supports :deglex ordering" | ||
@req base_ring(R) == QQ "only rational coefficients are supported" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First of all, thanks a lot for integrating f4ncgb into Oscar!
Just wanted to let you know that f4ncgb does also support prime fields with p < 2^31 -1. To set the characteristic, we provide the method f4ncgb_set_characteristic
. Just in case you also want to use F4 in those cases...
f4ncgb_set_blocks(handle, UInt32[ngens(R)]) | ||
f4ncgb_set_threads(handle, UInt32(1)) | ||
|
||
deg_bound > 0 && f4ncgb_set_maxdeg(handle, UInt32(deg_bound)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By default f4ncgb
performs only at most 10 iterations of the F4 algorithm, also when the user sets a degree bound. Without changing the iteration limit, the algorithm will stop for higher degree bounds because it hits this maximal number of iterations and not because it hits the degree bound.
The maximal number of iterations can be set with f4ncgb_set_maxiter
. Maybe you want to expose this parameter to the user. Or, if not, at least set it so high that the degree bound will be the termination criterion and not the number of iterations.
Also, by default, f4ncgb
uses some probabilistic tricks that speed up the computation but yield the correct result only with high probability. One can turn these tricks on and off with f4ncgb_set_tracer
(by default it is on). Maybe you also want to expose this parameter to the user, or it least inform them if it is turned on by default.
@benlorenz and I added the
f4ncgb
algorithm by @maximaximal and @ClemensHofstadler as an option for non-commutative groebner basis computation. I set the new algorithm as the default since its performance is better than the other two options.I added
f4ncgb_jll
as a dependency and wrote a basic interface to enable Oscar to communicate with the package.Furthermore, the changes involve updating the documentation for the Groebner basis function and conducting some small tests to check the functionality of the
f4ncgb
interface.