Skip to content

sumiya11/Groebner.jl

Repository files navigation

Groebner.jl logo

Runtests Dev codecov

Groebner.jl is a Julia package for computing Groebner bases over fields. Groebner.jl is distributed under GNU GPL v2.

For documentation please check out https://sumiya11.github.io/Groebner.jl. For a simple example, see below.

Installation

You can install Groebner.jl using the Julia package manager. From the Julia REPL, type

import Pkg; Pkg.add("Groebner")

After the installation, you can run the package tests with

import Pkg; Pkg.test("Groebner")

How to use Groebner.jl?

The main function provided by Groebner.jl is groebner. It works with polynomials from AbstractAlgebra.jl, DynamicPolynomials.jl, and Nemo.jl.

with AbstractAlgebra.jl

We create a ring of polynomials in 3 variables

using AbstractAlgebra

R, (x1, x2, x3) = QQ["x1", "x2", "x3"]

Then, we can define a simple polynomial system

system = [
  x1 + x2 + x3,
  x1*x2 + x1*x3 + x2*x3,
  x1*x2*x3 - 1
]

And compute the Groebner basis by passing the system to groebner

using Groebner

G = groebner(system)
# result
3-element Vector{AbstractAlgebra.Generic.MPoly{Rational{BigInt}}}:
 x1 + x2 + x3
 x2^2 + x2*x3 + x3^2
 x3^3 - 1

with DynamicPolynomials.jl

Similarly to AbstractAlgebra.jl, we create a system of polynomials and pass it to groebner

using DynamicPolynomials, Groebner

@polyvar x1 x2
system = [10*x1*x2^2 - 11*x1 + 10,
        10*x1^2*x2 - 11*x2 + 10]

G = groebner(system)
# result
3-element Vector{Polynomial{DynamicPolynomials.Commutative{DynamicPolynomials.CreationOrder}, Graded{LexOrder}, Int64}}:
 10x2 - 10x1 - 11x2² + 11x1²
 110 - 121x2 - 100x2² + 100x1x2 + 110x2³
 10 - 11x1 + 10x1x2²

Contacts

This library is maintained by Alexander Demin (asdemin_2@edu.hse.ru).

Contributing

Contributions are very welcome, as are feature requests and suggestions. In particular additional examples and documentation improvements are encouraged. If you encounter any problems, please open an issue or contact a maintainer.

Acknowledgement

We would like to acknowledge the developers of the msolve library (https://msolve.lip6.fr/), as several components of Groebner.jl were adapted from msolve. In our F4 implementation, we adapt and adjust the code of monomial hashtable, critical pair handling and symbolic preprocessing, and linear algebra from msolve. The source code of msolve is available at https://github.com/algebraic-solving/msolve.

We thank Vladimir Kuznetsov for helpful discussions and providing the sources of his F4 implementation.

We are grateful to The Max Planck Institute for Informatics and The MAX team at l'X for providing computational resources.

See also

Other software in Julia that can be used for computing Groebner bases:

If you do not see your package here, we either do not know about it, or forgot to include it, sorry! Feel free to open a PR.

Citing Groebner.jl

If you find Groebner.jl useful in your work, you can star this repository and cite this paper

@misc{demin2024groebnerjl,
      title={Groebner.jl: A package for Gr\"obner bases computations in Julia}, 
      author={Alexander Demin and Shashi Gowda},
      year={2024},
      eprint={2304.06935},
      archivePrefix={arXiv},
      primaryClass={cs.MS}
}