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