Skip to content

Commit 00962f1

Browse files
authored
Merge pull request #395 from SciML/bump_groebner09
Bump Groebner 0.9 and use new functionality
2 parents 37d2b8a + 6af9020 commit 00962f1

File tree

4 files changed

+8
-87
lines changed

4 files changed

+8
-87
lines changed

Project.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,21 +35,21 @@ CPUSummary = "0.2"
3535
Combinatorics = "1"
3636
DataStructures = "0.18"
3737
Dates = "1.10, 1.11"
38-
Groebner = "0.8.1"
38+
Groebner = "0.9"
3939
IterTools = "1"
4040
LinearAlgebra = "1.10, 1.11"
4141
Logging = "1.10, 1.11"
4242
MacroTools = "0.5"
4343
ModelingToolkit = "9.33"
44-
Nemo = "0.46, 0.47, 0.48"
44+
Nemo = "0.46, 0.47, 0.48, 0.49"
4545
ParamPunPam = "0.5"
4646
Pkg = "1.10, 1.11"
4747
PrecompileTools = "1.2"
4848
Primes = "0.5"
4949
Random = "1.10, 1.11"
5050
SpecialFunctions = "2"
51-
SymbolicUtils = "3.7"
52-
Symbolics = "6.16"
51+
SymbolicUtils = "3.14"
52+
Symbolics = "6.29"
5353
Test = "1.10, 1.11"
5454
TestSetExtensions = "2"
5555
TimerOutputs = "0.5"

src/RationalFunctionFields/normalforms.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ end
1212

1313
function Base.push!(tref::TinyRowEchelonForm{T}, vect::Vector{T}) where {T}
1414
@assert count(!iszero, vect) == 1
15-
@assert !in(tref, vect)
15+
@assert !in(vect, tref)
1616
pivot = findfirst(!iszero, vect)
1717
push!(tref.rows, vect)
1818
push!(tref.pivot_cols, pivot)
1919
return vect
2020
end
2121

22-
function Base.in(tref::TinyRowEchelonForm{T}, vect::Vector{T}) where {T}
22+
function Base.in(vect::Vector{T}, tref::TinyRowEchelonForm{T}) where {T}
2323
nnz_inds = findall(!iszero, vect)
2424
for i in nnz_inds
2525
rref_idx = findfirst(pivot_col -> pivot_col == i, tref.pivot_cols)
@@ -72,7 +72,7 @@ function local_normal_forms(
7272
for deg in 1:up_to_degree
7373
for combination in Combinatorics.with_replacement_combinations(pivot_vectors, deg)
7474
exp_vect = sum(combination)
75-
if in(stop_vectors, exp_vect)
75+
if in(exp_vect, stop_vectors)
7676
@debug "Skipping exponent vector $exp_vect"
7777
continue
7878
end

src/primality_check.jl

Lines changed: 1 addition & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,8 @@
1-
# ------------------------------------------------------------------------------
2-
# adapted from https://gitlab.inria.fr/newrur/code/-/blob/main/Julia/RationalUnivariateRepresentation.jl/src/RationalUnivariateRepresentation.jl?ref_type=heads#L180
3-
# thanks to Alexander Demin
4-
"""
5-
quotient_basis(J::Array{QQMPolyRingElem, 1})
6-
7-
Takes as input a Groebner basis J of a zero-dimensional ideal and
8-
returns a monomial basis of the quotient ring
9-
(more precisely, the list of standard monomials)
10-
"""
11-
function quotient_basis(J::Array{<:MPolyRingElem, 1})
12-
if !Groebner.isgroebner(J)
13-
throw(DomainError("Input is not a Groebner basis"))
14-
end
15-
n = length(gens(parent(first(J))))
16-
leading_exponents = [first(Nemo.exponent_vectors(Nemo.leading_monomial(p))) for p in J]
17-
if length(filter(e -> count(iszero, e) == n - 1, leading_exponents)) < n
18-
throw(DomainError("Input does not define zerodimensional ideal"))
19-
end
20-
exponents_to_check = [[0 for _ in 1:n]]
21-
exponents_checked = []
22-
basis_exponents = []
23-
while length(exponents_to_check) > 0
24-
e = popfirst!(exponents_to_check)
25-
push!(exponents_checked, e)
26-
if !any(map(le -> all(e .>= le), leading_exponents))
27-
push!(basis_exponents, e)
28-
for i in 1:n
29-
next_e = copy(e)
30-
next_e[i] += 1
31-
if !(next_e in exponents_checked) && !(next_e in exponents_to_check)
32-
push!(exponents_to_check, next_e)
33-
end
34-
end
35-
end
36-
end
37-
return [prod(gens(parent(first(J))) .^ e) for e in basis_exponents]
38-
end
39-
401
# ------------------------------------------------------------------------------
412

423
function check_primality_zerodim(J::Array{QQMPolyRingElem, 1})
434
J = Groebner.groebner(J)
44-
basis = quotient_basis(J)
5+
basis = Groebner.quotient_basis(J)
456
dim = length(basis)
467
S = Nemo.matrix_space(Nemo.QQ, dim, dim)
478
matrices = []

test/quotient_basis.jl

Lines changed: 0 additions & 40 deletions
This file was deleted.

0 commit comments

Comments
 (0)