Skip to content

Commit 284372a

Browse files
authored
Merge 666c16e into 37d2b8a
2 parents 37d2b8a + 666c16e commit 284372a

File tree

3 files changed

+5
-84
lines changed

3 files changed

+5
-84
lines changed

Project.toml

+4-4
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/primality_check.jl

+1-40
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

-40
This file was deleted.

0 commit comments

Comments
 (0)