Skip to content

Commit

Permalink
Add NEWS.md, fix some bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
sumiya11 committed Jul 11, 2023
1 parent 4c2741f commit b4dd132
Show file tree
Hide file tree
Showing 39 changed files with 809 additions and 1,177 deletions.
8 changes: 0 additions & 8 deletions CONTRIBUTING.md

This file was deleted.

7 changes: 5 additions & 2 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
## Groebner v0.4.0 Release notes

Changelog

Minor bug fixes and improvements.

Changes in the interface:
- Keyword argument `rng` removed. Instead, now the `seed` keyword argument is provided for setting the seed of the internal random number generator.
- Changed keyword arguments `linalg`, `monoms`, and `loglevel`.
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,24 @@
[![Runtests](https://github.com/sumiya11/Groebner.jl/actions/workflows/Runtests.yml/badge.svg)](https://github.com/sumiya11/Groebner.jl/actions/workflows/Runtests.yml)
[![Dev](https://img.shields.io/badge/docs-dev-blue.svg)](https://sumiya11.github.io/Groebner.jl)

Groebner.jl is a Julia package for computing Groebner bases over fields.

The package provides Groebner bases computation interface in pure Julia with the performance comparable to Singular.
`Groebner.jl` works over finite fields and over the rationals, and supports various monomial orderings.
For documentation and more please check out https://sumiya11.github.io/Groebner.jl.
For a simple example, see below.

For documentation and more please check out https://sumiya11.github.io/Groebner.jl

Groebner.jl can be extended : how the code is structured .
## How to use Groebner.jl?

# TODO: say how one can contribute.
You can install Groebner.jl using the Julia package manager. From the Julia REPL, type

## How to use Groebner.jl?
```julia
import Pkg; Pkg.add("Groebner")
```

Our package works with polynomials from `AbstractAlgebra.jl`, `DynamicPolynomials.jl`, and `Nemo.jl`. We will demonstrate the usage on a simple example. Lets first create a ring of polynomials in 3 variables
Our package works with polynomials from `AbstractAlgebra.jl`, `DynamicPolynomials.jl`, and `Nemo.jl`. Let's create a ring of polynomials in 3 variables

```julia
using AbstractAlgebra
R, (x1, x2, x3) = PolynomialRing(QQ, ["x1", "x2", "x3"]);
R, (x1, x2, x3) = PolynomialRing(QQ, ["x1", "x2", "x3"])
```

Then we can define a simple polynomial system
Expand All @@ -29,11 +30,10 @@ polys = [
x1 + x2 + x3,
x1*x2 + x1*x3 + x2*x3,
x1*x2*x3 - 1
];
]
```

And compute the Groebner basis passing the system to `groebner`

And compute the Groebner basis by passing the system to `groebner`

```julia
using Groebner
Expand Down
23 changes: 14 additions & 9 deletions experimental/SI/fujita.jl → experimental/SI/si.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,10 @@ using AbstractAlgebra, BenchmarkTools, JLD2
import Nemo, Profile

macro myprof(ex)
:(
(VSCodeServer.Profile).clear();
Profile.init(n=10^7, delay=0.0000001);
Profile.@profile $ex;
VSCodeServer.view_profile(;)
)
:((VSCodeServer.Profile).clear();
Profile.init(n=10^7, delay=0.0000001);
Profile.@profile $ex;
VSCodeServer.view_profile(;))
end

ode = @ODEmodel(
Expand Down Expand Up @@ -44,6 +42,14 @@ ode = @ODEmodel(
y3(t) = a3 * pS6(t)
)

siwr = @ODEmodel(
S'(t) = mu - bi * S(t) * I(t) - bw * S(t) * W(t) - mu * S(t) + a * R(t),
I'(t) = bw * S(t) * W(t) + bi * S(t) * I(t) - (gam + mu) * I(t),
W'(t) = xi * (I(t) - W(t)),
R'(t) = gam * I(t) - (mu + a) * R(t),
y(t) = k * I(t)
)

G = StructuralIdentifiability.ideal_generators(ode);

par = parent(G[1])
Expand All @@ -67,7 +73,7 @@ Groebner.logging_enabled() = false
Groebner.invariants_enabled() = false

gb = Groebner.groebner(G_zp);
graph, gb_1 = Groebner.groebner_learn(G_zp);
@time graph, gb_1 = Groebner.groebner_learn(G_zp);
graph
graph.matrix_infos
flag, gb_2 = Groebner.groebner_apply!(graph, G_zp)
Expand All @@ -77,8 +83,7 @@ flag, gb_2 = Groebner.groebner_apply!(graph, G_zp)
@btime Groebner.groebner_apply!($graph, $G_zp);

@myprof begin
for i in 1:1000
for i in 1:100
Groebner.groebner_apply!(graph, G_zp)
end
end

16 changes: 7 additions & 9 deletions src/Groebner.jl
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,15 @@ invariants_enabled() = true
Specifies if custom logging is enabled.
If `false`, then all logging is disabled, and entails no runtime overhead.
See also `@log` in `src/uti0-w2q3=-asqqw2q=[-edrfls/logging.jl`.
See also `@log` in `src/utils/logging.jl`.
"""
logging_enabled() = true

# Groebner does not provide
# a polynomial implementation of its own but relies on existing symbolic
# computation packages in Julia for communicating with the user instead.
# Groebner accepts as its input polynomials from the Julia packages
# AbstractAlgebra.jl (Oscar.jl) and MultivariatePolynomials.jl. This list can be
# extended; see `src/input-output.jl` for details. TODO: make the
# AbstractAlgebra and MultivariatePolynomials dependencies optional!
# Groebner does not provide a polynomial implementation of its own but relies on
# existing symbolic computation packages in Julia for communicating with the
# user instead. Groebner accepts as its input polynomials from the Julia
# packages AbstractAlgebra.jl (Oscar.jl) and MultivariatePolynomials.jl. This
# list can be extended; see `src/input-output/` for details.
import AbstractAlgebra
import AbstractAlgebra: base_ring, elem_type

Expand Down Expand Up @@ -78,7 +76,7 @@ include("utils/parameters.jl")
# Input-output conversions for polynomials
include("input-output/input-output.jl")
include("input-output/AbstractAlgebra.jl")
# include("input-output/DynamicPolynomials.jl")
include("input-output/DynamicPolynomials.jl")

#= generic f4 implementation =#
#= the heart of this library =#
Expand Down
8 changes: 1 addition & 7 deletions src/arithmetic/Zp.jl
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,8 @@ end
end


# finite field arithmetic in case of UInt8, UInt16, UInt32, UInt64
function select_arithmetic(coeffs::Vector{Vector{T}}, ch) where {T <: CoeffFF}
SpecializedBuiltinArithmeticZp(unsigned(ch))
end

# finite field arithmetic in case of UInt128
function select_arithmetic(coeffs::Vector{Vector{UInt128}}, ch)
SpecializedBuiltinArithmeticZp(unsigned(ch))
SpecializedBuiltinArithmeticZp(convert(T, ch))
end

# arithmetic over rational numbers
Expand Down
Loading

0 comments on commit b4dd132

Please sign in to comment.