From 80895896f9fa42d444f2dbcf0b0cb76b4bc212d8 Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Thu, 15 Feb 2024 09:51:22 +0100 Subject: [PATCH 001/179] =?UTF-8?q?Move=20Gr=C3=B6bner=20walk=20to=20exper?= =?UTF-8?q?imental?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 13 + docs/doc.main | 8 + src/GroebnerWalk.jl | 0 src/walk.jl | 1724 +++++++++++++++++++++++++++++++++++++++++ test/groebner_walk.jl | 258 ++++++ 5 files changed, 2003 insertions(+) create mode 100644 README.md create mode 100644 docs/doc.main create mode 100644 src/GroebnerWalk.jl create mode 100644 src/walk.jl create mode 100644 test/groebner_walk.jl diff --git a/README.md b/README.md new file mode 100644 index 000000000000..34433a0f5a3e --- /dev/null +++ b/README.md @@ -0,0 +1,13 @@ +# Gröbner walk + +## Aims + +This is an example for a file structure to set up a new package +in the experimental section. All files you find here are part of the +minimum requirements. See also the official Oscar documentation. + +## Status + +We plan to also provide a function to automatically copy this template +for you to start your own package. + diff --git a/docs/doc.main b/docs/doc.main new file mode 100644 index 000000000000..c42ec6a31cee --- /dev/null +++ b/docs/doc.main @@ -0,0 +1,8 @@ +# An example documentation + +This is a sample text to outline the structure of the packages in the `Experimental` folder. +You can show docstrings like this: +```@docs + my_access_func(S::ExampleStruct) +``` + diff --git a/src/GroebnerWalk.jl b/src/GroebnerWalk.jl new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/src/walk.jl b/src/walk.jl new file mode 100644 index 000000000000..84e6ae8ff2da --- /dev/null +++ b/src/walk.jl @@ -0,0 +1,1724 @@ +using Oscar + +global infoLevel = 0 + +############################################################### +# Implementation of different variants of the Groebner Walk. +# The Groebner Walk is proposed by Collart, Kalkbrener & Mall (1997). +############################################################### +@doc raw""" + groebnerwalk( + I::MPolyIdeal; + startOrder::MonomialOrdering = default_ordering(base_ring(I)), + targetOrder::Symbol = lex(base_ring(I)), + walktype::Symbol = :standard, + perturbationDegree::Int = 2, + ) +Compute a reduced Groebner basis w.r.t. to a monomial order by converting it using the Groebner Walk. +The Groebner Walk is proposed by Collart, Kalkbrener & Mall (1997). +One can choose a strategy of: +Standard Walk (:standard) computes the Walk like it´s presented in Cox, Little & O´Shea (2005). +Generic Walk (:generic) computes the Walk like it´s presented in Fukuda, Jensen, Lauritzen & Thomas (2005). +Perturbed Walk (:perturbed, with p = degree of the perturbation) computes the Walk like it´s presented in Amrhein, Gloor & Küchlin (1997). +Tran´s Walk (:tran) computes the Walk like it´s presented in Tran (2000). +Fractal Walk (:fractalcombined) computes the Walk like it´s presented in Amrhein & Gloor (1998) with multiple extensions. The target monomial order has to be lex. This version uses the Buchberger Algorithm to skip weight vectors with entries bigger than Int32. +Fractal Walk (:fractal) computes the Walk like it´s presented in Amrhein & Gloor (1998). Pertubes only the target vector. +Set infoLevel to trace the walk: + -'infoLevel=0': no detailed printout, + -'infoLevel=1': adds intermediate weight vectors, + -'infoLevel=2': adds information about the Groebner basis. + +#Arguments +- `G::Oscar.IdealGens`: ideal one wants to compute a Groebner basis for. +- `startOrder::MonomialOrdering=:degrevlex`: monomial order to begin the conversion. +- `targetOrder::MonomialOrdering=:lex`: monomial order one wants to compute a Groebner basis for. +- `walktype::Symbol=standard`: strategy of the Groebner Walk. One can choose a strategy of: + - `standard`: Standard Walk, + - `perturbed`: Perturbed Walk, + - `tran`: Tran´s Walk, + - `generic`: Generic Walk, + - `fractal`: standard-version of the Fractal Walk, + - `fractalcombined`: combined Version of the Fractal Walk. Target monomial order needs to be lex, +- `perturbationDegree::Int=2`: perturbationdegree for the perturbed Walk. + + +# Examples + +```jldoctest +julia> R,(x,y) = polynomial_ring(QQ, ["x","y"], ordering = :degrevlex); + +julia> I = ideal([y^4+ x^3-x^2+x,x^4]); + +julia> groebnerwalk(I, degrevlex(R), lex(R), :standard) +standard_walk results +Crossed Cones in: +[4, 3] +[4, 1] +[12, 1] +[1, 0] +Cones crossed: 4 +Gröbner basis with elements +1 -> y^16 +2 -> x + y^12 - y^8 + y^4 +with respect to the ordering +matrix_ordering([x, y], [1 0; 0 1]) + +julia> groebnerwalk(I, degrevlex(R), lex(R), :perturbed, 2) +perturbed_walk results +Crossed Cones in: +[4, 3] +[4, 1] +[5, 1] +[12, 1] +[1, 0] +Cones crossed: 5 +Gröbner basis with elements +1 -> y^16 +2 -> x + y^12 - y^8 + y^4 +with respect to the ordering +matrix_ordering([x, y], [1 0; 0 1]) +``` +""" +function groebnerwalk( + I::MPolyIdeal, startOrder::MonomialOrdering = default_ordering(base_ring(I)), + targetOrder::MonomialOrdering = lex(base_ring(I)), + walktype::Symbol = :standard, + perturbationDegree::Int = 2) + S = canonical_matrix(startOrder) + T = canonical_matrix(targetOrder) + return groebnerwalk( + I, + S, T, + walktype, + perturbationDegree, + ) +end + +@doc raw""" + groebnerwalk( + G::Oscar.IdealGens, + S::Union{Matrix{T}, MatElem{T}}, + T::Union{Matrix{T}, MatElem{T}}, + walktype::Symbol = :standard, + p::Int = 2 + ) where T +Computes a reduced Groebner basis w.r.t. the monomial order T by converting the reduced Groebner basis G w.r.t. the monomial order S using the Groebner Walk. +One can choose a strategy of: +Standard Walk (:standard) computes the Walk like it´s presented in Cox et al. (2005). +Generic Walk (:generic) computes the Walk like it´s presented in Fukuda et al. (2005). +Perturbed Walk (:perturbed, with p = degree of the perturbation) computes the Walk like it´s presented in Amrhein et al. (1997). +Tran´s Walk (:tran) computes the Walk like it´s presented in Tran (2000). +Fractal Walk (:fractal) computes the Walk like it´s presented in Amrhein & Gloor (1998). Pertubes only the target vector. +Fractal Walk (:fractalcombined) computes the Walk like it´s presented in Amrhein & Gloor (1998) with multiple extensions. The target monomial order has to be lex. This version uses the Buchberger Algorithm to skip weightvectors with entries bigger than Int32. +Set infoLevel to trace the walk: + -'infoLevel=0': no detailed printout, + -'infoLevel=1': adds intermediate weight vectors, + -'infoLevel=2': adds information about the Groebner basis. + +#Arguments +-`G::Oscar.IdealGens`: Groebner basis to convert to the Groebner basis w.r.t. the target order T. G needs to be a Groebner basis w.r.t. the start order S. +-`S::Union{Matrix{N}, MatElem{N}}`: start monomial order w.r.t. the Groebner basis G. Note that S has to be a nxn-matrix with rank(S)=n and its first row needs to have positive entries. +-`T::Union{Matrix{N}, MatElem{N}}`: target monomial order one wants to compute a Groebner basis for. Note that T has to be a nxn-matrix with rank(T)=n and its first row needs to have positive entries. +-`walktype::Symbol=standard`: strategy of the Groebner Walk. One can choose a strategy of: + - `standard`: Standard Walk (default), + - `perturbed`: Perturbed Walk, + - `tran`: Tran´s Walk, + - `generic`: Generic Walk, + - `fractal`: standard-version of the Fractal Walk, + - `fractalcombined`: combined version of the Fractal Walk. The target monomial order needs to be lex, +-`p::Int=2`: perturbationdegree for the perturbed Walk. + +# Examples + +```jldoctest +julia> R,(x,y) = polynomial_ring(QQ, ["x","y"], ordering = :degrevlex); + +julia> I = ideal([y^4+ x^3-x^2+x,x^4]); + +julia> groebnerwalk(I, [1 1; 0 -1], [1 0; 0 1], :standard) +standard_walk results +Crossed Cones in: +[4, 3] +[4, 1] +[12, 1] +[1, 0] +Cones crossed: 4 +Gröbner basis with elements +1 -> y^16 +2 -> x + y^12 - y^8 + y^4 +with respect to the ordering +matrix_ordering([x, y], [1 0; 0 1]) + +julia> groebnerwalk(I, [1 1; 0 -1], [1 0; 0 1], :perturbed, 2) +perturbed_walk results +Crossed Cones in: +[4, 3] +[4, 1] +[5, 1] +[12, 1] +[1, 0] +Cones crossed: 5 +Gröbner basis with elements +1 -> y^16 +2 -> x + y^12 - y^8 + y^4 +with respect to the ordering +matrix_ordering([x, y], [1 0; 0 1]) +``` +""" +function groebnerwalk( + G::Union{Oscar.IdealGens, MPolyIdeal}, + S::Union{Matrix{N}, MatElem{N}}, + T::Union{Matrix{N}, MatElem{N}}, + walktype::Symbol = :standard, + p::Int = 2, +) where N + + if walktype == :standard + walk = (x) -> standard_walk(x, S, T) + elseif walktype == :generic + walk = (x) -> generic_walk(x, S, T) + elseif walktype == :perturbed + walk = (x) -> perturbed_walk(x, S, T, p) + elseif walktype == :fractal + walk = (x) -> fractal_walk(x, S, T) + elseif walktype == :fractal_start_order + walk = (x) -> fractal_walk_start_order(x, S, T) + # elseif walktype == :fractal_lex + # walk = (x) -> fractal_walk_lex(x, S, T) + # elseif walktype == :fractal_look_ahead + # walk = (x) -> fractal_walk_look_ahead(x, S, T) + elseif walktype == :tran + walk = (x) -> tran_walk(x, S, T) + elseif walktype == :fractal_combined + walk = (x) -> fractal_walk_combined(x, S, T) + end + delete_step_counter() + S = Matrix{Int}(S) + T = Matrix{Int}(T) + # Make sure G is a fully reduced Groebner Basis + Gb = groebner_basis(ideal(gens(G)), ordering = matrix_ordering(base_ring(G), S), complete_reduction = true) + Gb = walk(Gb) + + if infoLevel >= 1 + println("Cones crossed: ", delete_step_counter()) + end + return Oscar.IdealGens(gens(Gb), matrix_ordering(base_ring(G), T), isGB = true) +end + +########################################### +# Counter for the steps +########################################### +counter = 0 +function delete_step_counter() + global counter + temp = counter + counter = 0 + return temp +end +function getstep_counter() + global counter + return counter +end +function raise_step_counter() + global counter = getstep_counter() + 1 +end +############################################################### +# Implementation of the standard walk. +############################################################### + +function standard_walk( + G::Oscar.IdealGens, + S::Matrix{Int}, + T::Matrix{Int}, +) + if infoLevel >= 1 + println("standard_walk results") + println("Crossed Cones in: ") + end + + Gb = standard_walk(G, S, T, S[1, :], T[1, :]) + + return Gb +end + +function standard_walk( + G::Oscar.IdealGens, + S::Matrix{Int}, + T::Matrix{Int}, + currweight::Vector{Int}, + tarweight::Vector{Int}) + while true + G = standard_step(G, currweight, T) + if currweight == tarweight + return G + else + currweight = next_weight(G, currweight, tarweight) + end + if infoLevel >= 1 + raise_step_counter() + println(currweight) + if infoLevel == 2 + println(G) + end + end + end +end + +############################################################### +# The standard step is used for the strategies standard and perturbed. +############################################################### + +function standard_step(G::Oscar.IdealGens, w::Vector{Int}, T::Matrix{Int}) + R = base_ring(G) + ordAlt = G.ord + Gw = 0 + + #check if no entry of w is bigger than Int32. If it´s bigger multiply it by 0.1 and round. + if !checkInt32(w) + Gw = ideal(initials(G, w)) + w, b = truncw(G, w, gens(Gw)) + !b && throw(error("Some entries of the intermediate weight-vector $w are bigger than int32")) + else + Gw = ideal(initials(G, w)) + end + ordNew = create_order(R, w, T) + H = groebner_basis(Gw, ordering = ordNew, complete_reduction = true, algorithm = :buchberger) + #H = liftGW2(G, ordAlt, Gw, H, ordNew) + H = lift(G, ordAlt, H, ordNew) + return interreduce_walk(H) +end + +############################################################### +# Generic-version of the Groebner Walk. +############################################################### + +function generic_walk( + G::Oscar.IdealGens, + S::Matrix{Int}, + T::Matrix{Int}, +) + Lm = [leading_term(g, ordering = matrix_ordering(base_ring(G), S)) for g in G] + v = next_gamma(G, Lm, [0], S, T) + ordNew = matrix_ordering(base_ring(G), T) + if infoLevel >= 1 + println("generic_walk results") + println("Facets crossed for: ") + end + while !isempty(v) + G, Lm = generic_step(G, Lm, v, ordNew) + raise_step_counter() + + if infoLevel >= 1 + println(v) + if infoLevel == 2 + println(G) + end + end + G = Oscar.IdealGens(G, ordNew) + v = next_gamma(G, Lm, v, S, T) + end + return G +end + +function generic_step( + G::Oscar.IdealGens, + Lm::Vector{T}, + v::Vector{Int}, + ord::MonomialOrdering, +) where {T <: MPolyRingElem} + facet_Generators = facet_initials(G, Lm, v) + H = groebner_basis(ideal(facet_Generators), ordering = ord, complete_reduction = true, algorithm = :buchberger) + H, Lm = lift_generic(gens(G), Lm, gens(H), ord) + G = interreduce(H, Lm, ord) + return G, Lm +end + +############################################################### +# Perturbed-version of the Groebner Walk. +############################################################### + +function perturbed_walk( + G::Oscar.IdealGens, + S::Matrix{Int}, + T::Matrix{Int}, + p::Int, +) + if infoLevel >= 1 + println("perturbed_walk results") + println("Crossed Cones in: ") + end + + currweight = perturbed_vector(G, S, p) + + while true + tarweight = perturbed_vector(G, T, p) + Tn = add_weight_vector(tarweight, T) + G = standard_walk(G, S, Tn, currweight, tarweight) + if same_cone(G, T) + return G + else + p = p - 1 + currweight = tarweight + S = Tn + end + end +end + +############################################################### +# The Fractal Walk +############################################################### + +########################################## +# global weightvectors +########################################## +pTargetWeights = [] +pStartWeights = [] +firstStepMode = false + +############################################################### +# Combined version of the extensions of the Fractal Walk. +# This version +# - checks if the starting weight vector represents the monomial order and pertubes it if necessary. +# - analyses the Groebner basis Gw of the initialforms and uses the Buchberger-algorithm if the generators of Gw are binomial or less. +# - skips a step in top level in the last step. +# - checks if an entry of an intermediate weight vector is bigger than int32. In case of that the Buchberger-Algorithm is used to compute the Groebner basis of the ideal of the initialforms. +############################################################### +function fractal_walk_combined( + G::Oscar.IdealGens, + S::Matrix{Int}, + T::Matrix{Int}, +) + if infoLevel >= 1 + println("fractal_walk_combined results") + println("Crossed Cones in: ") + end + + global pTargetWeights = + [perturbed_vector(G, T, i) for i ∈ 1:nvars(base_ring(G))] + return fractal_walk_combined(G, S, T, S[1, :], pTargetWeights, 1) +end + +function fractal_walk_combined( + G::Oscar.IdealGens, + S::Matrix{Int}, + T::Matrix{Int}, + currweight::Vector{Int}, + pTargetWeights::Vector{Vector{Int}}, + p::Int, +) + R = base_ring(G) + G.isGB = true + w = currweight + ordAlt = G.ord + + # Handling the weight of the start order. + if (p == 1) + if !ismonomial(initials(G, w)) + global pStartWeights = [perturbed_vector(G, S, i) for i ∈ 1:nvars(R)] + global firstStepMode = true + end + end + if firstStepMode + w = pStartWeights[p] + else + w = currweight + end + + # main loop + while true + t = next_weight_fractal_walk(G, w, pTargetWeights[p]) + + # Handling the final step in the current depth. + # next_weight_fractal_walk may return 0 if the target vector does not lie in the cone of T while G already defines the Groebner basis w.r.t. T. + # -> Checking if G is already a Groebner basis w.r.t. T solves this problem and reduces computational effort since next_weight_fractal_walk returns 1 in the last step on every local path. + if t == 1 && p != 1 + if same_cone(G, T) + if infoLevel >= 1 + println("depth $p: in cone ", currweight, ".") + end + + # Check if a target weight of pTargetWeights[p] and pTargetWeights[p-1] lies in the wrong cone. + if !inCone(G, T, pTargetWeights, p) + global pTargetWeights = + [perturbed_vector(G, T, i) for i ∈ 1:nvars(R)] + if infoLevel >= 1 + println("depth $p: not in cone ", pTargetWeights[p], ".") + end + end + return G + end + elseif t == [0] # The Groebner basis w.r.t. the target weight and T is already computed. + if inCone(G, T, pTargetWeights, p) + if infoLevel >= 1 + println("depth $p: in cone ", pTargetWeights[p], ".") + end + return G + end + global pTargetWeights = + [perturbed_vector(G, T, i) for i ∈ 1:nvars(R)] + if infoLevel >= 1 + println("depth $p: not in cone ", pTargetWeights[p], ".") + end + continue + end + + # skip a step for target monomial order lex. + if t == 1 && p == 1 + if infoLevel >= 1 + println("depth $p: recursive call in ", pTargetWeights[p]) + end + return fractal_walk_combined( + G, + S, + T, + w, + pTargetWeights, + p + 1, + ) + else + w = w + t * (pTargetWeights[p] - w) + w = convert_bounding_vector(w) + Gw = ideal(initials(G, w)) + + # handling the current weight with regards to Int32-entries. If an entry of w is bigger than Int32 use the Buchberger-algorithm. + if !checkInt32(w) + println("depth $p: Some entries of $w are bigger than Int32. Trying to find another weight,") + w, b = truncw(G, w, gens(Gw)) + if !b + println("depth $p: Doing a direct conversion to the target monomial ordering.") + ordNew = matrix_ordering(R, T) + w = T[1, :] + G = groebner_basis(ideal(G), ordering = ordNew, complete_reduction = true, algorithm = :buchberger) + + if !inCone(G, T, pTargetWeights, p) + global pTargetWeights = + [perturbed_vector(G, T, i) for i ∈ 1:nvars(R)] + if infoLevel >= 1 + println("depth $p: not in cone ", pTargetWeights[p], ".") + end + end + return G + end + end + ordNew = create_order(R, w, T) + # converting the Groebner basis + if (p == nvars(R) || isbinomial(gens(Gw))) + H = groebner_basis(Gw, ordering = ordNew, complete_reduction = true, algorithm = :buchberger) + + if infoLevel >= 1 + println("depth $p: conversion in ", w, ".") + end + raise_step_counter() + else + if infoLevel >= 1 + println("depth $p: recursive call in $w.") + end + H = fractal_walk_combined( + Oscar.IdealGens(R, gens(Gw), ordAlt), + S, + T, + deepcopy(currweight), + pTargetWeights, + p + 1, + ) + global firstStepMode = false + end + end + #H = liftGW2(G, ordAlt, Gw,H, ordNew) + H = lift_fractal_walk(G, H, ordNew) + G = interreduce_walk(H) + ordAlt = ordNew + currweight = w + end +end + +############################################################### +# Plain version of the Fractal Walk. +# This version checks if an entry of an intermediate weight vector is bigger than int32. In case of that the Buchberger-Algorithm is used to compute the Groebner basis of the ideal of the initialforms. +############################################################### + +function fractal_walk( + G::Oscar.IdealGens, + S::Matrix{Int}, + T::Matrix{Int}, +) + if infoLevel >= 1 + println("FractalWalk_standard results") + println("Crossed Cones in: ") + end + + global pTargetWeights = + [perturbed_vector(G, T, i) for i ∈ 1:nvars(base_ring(G))] + return fractal_recursiv(G, S, T, S[1, :], pTargetWeights, 1) +end + +function fractal_recursiv( + G::Oscar.IdealGens, + S::Matrix{Int}, + T::Matrix{Int}, + currweight::Vector{Int}, + pTargetWeights::Vector{Vector{Int}}, + p::Int, +) + R = base_ring(G) + G.isGB = true + w = currweight + ordAlt = G.ord + while true + t = next_weight_fractal_walk(G, w, pTargetWeights[p]) + + # Handling the final step in the current depth. + # next_weight_fractal_walk may return 0 if the target vector does not lie in the cone of T while G already defines the Groebner basis w.r.t. T. + # -> Checking if G is already a Groebner basis w.r.t. T solves this problem and reduces computational effort since next_weight_fractal_walk returns 1 in the last step on every local path. if t == 1 && p != 1 + if t == 1 && p != 1 + if same_cone(G, T) + if infoLevel >= 1 + println("depth $p: in cone ", currweight, ".") + end + + # Check if a target weight of pTargetWeights[p] and pTargetWeights[p-1] lies in the wrong cone. + if !inCone(G, T, pTargetWeights, p) + global pTargetWeights = + [perturbed_vector(G, T, i) for i ∈ 1:nvars(R)] + if infoLevel >= 1 + println("depth $p: not in cone ", pTargetWeights[p], ".") + end + end + return G + end + elseif t == [0] # The Groebner basis w.r.t. the target weight and T is already computed. + if inCone(G, T, pTargetWeights, p) + if infoLevel >= 1 + println("depth $p: in cone ", pTargetWeights[p], ".") + end + return G + end + global pTargetWeights = + [perturbed_vector(G, T, i) for i ∈ 1:nvars(R)] + if infoLevel >= 1 + println("depth $p: not in cone ", pTargetWeights[p], ".") + end + continue + end + + w = w + t * (pTargetWeights[p] - w) + w = convert_bounding_vector(w) + Gw = ideal(initials(G, w)) + + # Handling the current weight with regards to Int32-entries. If an entry of w is bigger than Int32 use the Buchberger-algorithm. + if !checkInt32(w) + println("depth $p: Some entries of $w are bigger than Int32. Trying to find another weight,") + w, b = truncw(G, w, gens(Gw)) + if !b + println("depth $p: Doing a direct conversion to the target monomial ordering.") + ordNew = matrix_ordering(R, T) + w = T[1, :] + G = groebner_basis(Gw, ordering = ordNew, complete_reduction = true, algorithm = :buchberger) + + if !inCone(G, T, pTargetWeights, p) + global pTargetWeights = + [perturbed_vector(G, T, i) for i ∈ 1:nvars(R)] + if infoLevel >= 1 + println("depth $p: not in cone ", pTargetWeights[p], ".") + end + end + return G + end + end + ordNew = create_order(R, w, T) + # Converting the Groebner basis + if p == nvars(R) + H = groebner_basis(Gw, ordering = ordNew, complete_reduction = true, algorithm = :buchberger) + + if infoLevel >= 1 + println("depth $p: conversion in ", w, ".") + end + raise_step_counter() + else + if infoLevel >= 1 + println("depth $p: recursive call in $w.") + end + H = fractal_recursiv( + Oscar.IdealGens(R, gens(Gw), ordAlt), + S, + T, + deepcopy(currweight), + pTargetWeights, + p + 1, + ) + end + #H = liftGW2(G, R, Gw, H, Rn) + H = lift_fractal_walk(G, H, ordNew) + G = interreduce_walk(H) + ordAlt = ordNew + currweight = w + end +end + +############################################################### +# Extends the plain Fractal Walk by checking the start order. +############################################################### + +function fractal_walk_start_order( + G::Oscar.IdealGens, + S::Matrix{Int}, + T::Matrix{Int}, +) + if infoLevel >= 1 + println("fractal_walk_withStartorder results") + println("Crossed Cones in: ") + end + + global pTargetWeights = + [perturbed_vector(G, T, i) for i ∈ 1:nvars(Singular.base_ring(G))] + return fractal_walk_recursiv_startorder( + G, + S, + T, + S[1, :], + pTargetWeights, + 1, + ) +end + +function fractal_walk_recursiv_startorder( + G::Oscar.IdealGens, + S::Matrix{Int}, + T::Matrix{Int}, + currweight::Vector{Int}, + pTargetWeights::Vector{Vector{Int}}, + p::Int, +) + R = base_ring(G) + G.isGB = true + ordAlt = G.ord + + # Handling the starting weight. + if (p == 1) + if !ismonomial(initials(G, currweight)) + global pStartWeights = [perturbed_vector(G, S, i) for i ∈ 1:nvars(R)] + global firstStepMode = true + end + end + if firstStepMode + w = pStartWeights[p] + else + w = currweight + end + + while true + t = next_weight_fractal_walk(G, w, pTargetWeights[p]) + + # Handling the final step in the current depth. + # next_weight_fractal_walk may return 0 if the target vector does not lie in the cone of T while G already defines the Groebner basis w.r.t. T. + # -> Checking if G is already a Groebner basis w.r.t. T solves this problem and reduces computational effort since next_weight_fractal_walk returns 1 in the last step on every local path. if t == 1 && p != 1 + if t == 1 && p != 1 + if same_cone(G, T) + if infoLevel >= 1 + println("depth $p: in cone ", currweight, ".") + end + + # Check if a target weight of pTargetWeights[p] and pTargetWeights[p-1] lies in the wrong cone. + if !inCone(G, T, pTargetWeights, p) + global pTargetWeights = + [perturbed_vector(G, T, i) for i ∈ 1:nvars(R)] + if infoLevel >= 1 + println("depth $p: not in cone ", pTargetWeights[p], ".") + end + end + return G + end + elseif t == [0] # The Groebner basis w.r.t. the target weight and T is already computed. + if inCone(G, T, pTargetWeights, p) + if infoLevel >= 1 + println("depth $p: in cone ", pTargetWeights[p], ".") + end + return G + end + global pTargetWeights = + [perturbed_vector(G, T, i) for i ∈ 1:nvars(R)] + if infoLevel >= 1 + println("depth $p: not in cone ", pTargetWeights[p], ".") + end + continue + end + + w = w + t * (pTargetWeights[p] - w) + w = convert_bounding_vector(w) + Gw = ideal(initials(G, w)) + + # Handling the current weight with regards to Int32-entries. If an entry of w is bigger than Int32 use the Buchberger-algorithm. + if !checkInt32(w) + w, b = truncw(G, w, gens(Gw)) + if !b + ordNew = matrix_ordering(R, T) + w = T[1, :] + G = groebner_basis(Gw, ordering = ordNew, complete_reduction = true, algorithm = :buchberger) + + if !inCone(G, T, pTargetWeights, p) + global pTargetWeights = + [perturbed_vector(G, T, i) for i ∈ 1:nvars(R)] + if infoLevel >= 1 + println("depth $p: not in cone ", pTargetWeights[p], ".") + end + end + return G + end + end + ordNew = create_order(R, w, T) + + # Converting the Groebner basis + if p == nvars(R) + H = groebner_basis(Gw, ordering = ordNew, complete_reduction = true, algorithm = :buchberger) + + if infoLevel >= 1 + println("depth $p: conversion in ", w, ".") + end + raise_step_counter() + else + if infoLevel >= 1 + println("depth $p: recursive call in $w.") + end + H = fractal_walk_recursiv_startorder( + Oscar.IdealGens(R, gens(Gw), ordAlt), + S, + T, + deepcopy(currweight), + pTargetWeights, + p + 1, + ) + global firstStepMode = false + end + #H = liftGW2(G, R, Gw, H, Rn) + H = lift_fractal_walk(G, H, ordNew) + G = interreduce_walk(H) + ordAlt = ordNew + currweight = w + end +end + + +############################################################### +# Tran´s version of the Groebner Walk. +# Returns the intermediate Groebner basis if an entry of an intermediate weight vector is bigger than int32. +############################################################### + +function tran_walk( + G::Oscar.IdealGens, + S::Matrix{Int}, + T::Matrix{Int}, +) + if infoLevel >= 1 + println("tran_walk results") + println("Crossed Cones in: ") + end + currweight = S[1, :] + tarweight = T[1, :] + R = base_ring(G) + if !ismonomial(initials(G, currweight)) + currweight = perturbed_vector(G, S, nvars(R)) + end + + while true + w = next_weight(G, currweight, tarweight) + + # return the Groebner basis if an entry of w is bigger than int32. + if !checkInt32(w) + w, b = truncw(G, w, initials(G, w)) + !b && throw(error("Some entries of the intermediate weight-vector $w are bigger than int32. Choose an other algorithm instead.")) + end + if w == tarweight + if same_cone(G, T) + if infoLevel >= 1 + println("Cones crossed: ", counter) + end + return G + elseif inSeveralCones(initials(G, tarweight)) + tarweight = representation_vector(G, T) + continue + end + end + G = standard_step_without_int32_check(G, w, T) + if infoLevel >= 1 + println(w) + if infoLevel == 2 + println(G) + end + end + currweight = w + raise_step_counter() + end +end + +############################################################### +# Standard step without checking of the entries of a given weight vector. +############################################################### + +function standard_step_without_int32_check( + G::Oscar.IdealGens, + w::Vector{Int}, + T::Matrix{Int}, +) + R = base_ring(G) + ordAlt = G.ord + ordNew = create_order(R, w, T) + Gw = initials(G, w) + H = groebner_basis(ideal(Gw), ordering = ordNew, complete_reduction = true, algorithm = :buchberger) + #H = liftGW2(G, R, Gw, H, Rn) + H = lift(G, ordAlt, H, ordNew) + return interreduce_walk(H) +end + + +################################################################# +# Procedures of the fractal walk. +# The fractal walk is proposed by Amrhein & Gloor (1998). +################################################################# + +# lifts the Groebner basis G to the Groebner basis w.r.t. in the Fractal Walk like it´s done in Fukuda et. al (2005). +function lift_fractal_walk( + G::Oscar.IdealGens, + H::Oscar.IdealGens, + orderingNew::MonomialOrdering, +) + R = base_ring(G) + G.isGB = true + G = Oscar.IdealGens( + R, + [ + gen - + Oscar.IdealGens([reduce(gen, gens(G), ordering = G.ord, complete_reduction = true)], H.ord)[1] for + gen in gens(H) + ], + orderingNew, + ) + G.isGB = true + return G +end + +# returns ´true´ if all polynomials of the given array are monomials. +function ismonomial(Gw::Vector{T}) where {T <: MPolyRingElem} + for g in Gw + if length(coefficients(g)) > 1 + return false + end + end + return true +end + +# returns ´true´ if all polynomials of the given array are binomials or less. +function isbinomial(Gw::Vector{T}) where {T <: MPolyRingElem} + for g in Gw + if length(coefficients(g)) > 2 + return false + end + end + return true +end + +# returns the next t to compute the next weight vector w(t) = w + t * (tw - w) like it´s done in Amrhein & Gloor (1998). This Method is NOT tested sufficiently. +function nextT( + G::Oscar.IdealGens, + w::Array{T, 1}, + tw::Array{K, 1}, +) where {T <: Number, K <: Number} + if (w == tw) + return [0] + end + tmin = 2 + t = 0 + for g in gens(G) + a = Singular.leading_exponent_vector(g) + d = Singular.exponent_vectors(tail(g)) + for v in d + frac = (dot(w, a) - dot(w, v) + dot(tw, v) - dot(tw, a)) + if frac != 0 + t = (dot(w, a) - dot(w, v)) // frac + end + if t > 0 && t < tmin + tmin = t + end + end + end + if tmin <= 1 + return tmin + else + return [0] + end +end + +# returns the next t to compute the next weight vector w(t) = w + t * (tw - w) like it´s done in Cox, Little & O'Sheao (2005). +function next_weight_fractal_walk( + G::Oscar.IdealGens, + cweight::Array{T, 1}, + tweight::Array{K, 1}, +) where {T <: Number, K <: Number} + if (cweight == tweight) + return [0] + end + tmin = 1 + for v in difference_lead_tail(G) + tw = dot(tweight, v) + if tw < 0 + cw = dot(cweight, v) + t = cw // (cw - tw) + if t < tmin + tmin = t + end + end + end + + # BigInt is needed to prevent overflows in the conversion of the weight vectors. + return BigInt(numerator(tmin)) // BigInt(denominator(tmin)) +end + +# returns 'true' if the leading terms of G w.r.t the matrixordering T are the same as the leading terms of G w.r.t the weighted monomial ordering with weight vector of pvecs[p] (pvecs[p-1]) and the matrixordering T. +function inCone( + G::Oscar.IdealGens, + T::Matrix{Int}, + pvecs::Vector{Vector{Int}}, + p::Int, +) + # pvecs(1) equals the first row of T + if p == 1 + return true + end + ord = matrix_ordering(base_ring(G), T) + cvzip = zip( + gens(G), + initials(G, pvecs[p-1]), + initials(G, pvecs[p]), + ) + for (g, in, in2) in cvzip + if !isequal( + leading_term(g, ordering = ord), + leading_term(in, ordering = ord), + ) || + !isequal( + leading_term(g, ordering = ord), + leading_term(in2, ordering = ord), + ) + return false + end + end + return true +end + + +################################################################# +# Procedures of the generic walk. +# The generic walk is proposed by Fukuda, Lauritzen & Thomas (2005). +################################################################# + +# returns the initials of the polynomials w.r.t. the vector v. +function facet_initials( + G::Oscar.IdealGens, + lm::Vector{T}, + v::Vector{Int}, +) where {T <: MPolyRingElem} + Rn = parent(first(G)) + initials = Array{Singular.elem_type(Rn), 1}(undef, 0) + count = 1 + for g in G + inw = Singular.MPolyBuildCtx(Rn) + el = first(Singular.exponent_vectors(lm[count])) + for (e, c) in + zip(Singular.exponent_vectors(g), Singular.coefficients(g)) + if el == e || isparallel(el - e, v) + Singular.push_term!(inw, c, e) + end + end + h = finish(inw) + push!(initials, h) + count += 1 + end + return initials +end + +# returns the differences of the exponent vectors of the leading terms and the polynomials of the generators of I. +function difference_lead_tail( + G::Oscar.IdealGens, + Lm::Vector{L}, + T::Union{Matrix{N}, MatElem{N}}, +) where {L <: MPolyRingElem, N} + v = Vector{Int}[] + for i ∈ 1:length(G) + ltu = collect(AbstractAlgebra.exponent_vectors(leading_term(Lm[i], ordering = matrix_ordering(base_ring(G), T))))[1] + for e in AbstractAlgebra.exponent_vectors(G[i]) + if ltu != e + push!(v, ltu .- e) + end + end + end + return unique!(v) +end + +# returns true if the vector u is parallel to the vector v. +function isparallel(u::Vector{Int}, v::Vector{Int}) + count = 1 + x = 0 + for i ∈ 1:length(u) + if u[i] == 0 + if v[count] == 0 + count += +1 + else + return false + end + else + x = v[count] // u[i] + count += 1 + break + end + end + if count > length(v) + return true + end + for i ∈ count:length(v) + @inbounds if v[i] != x * u[i] + return false + end + end + return true +end + +# performs the lifting in the generic Walk like it´s proposed by Fukuda et al. (2005). +function lift_generic( + G::Vector{T}, + Lm::Vector{T}, + H::Vector{T}, + ord::MonomialOrdering, +) where {T <: MPolyRingElem} + R = parent(first(G)) + Newlm = Array{elem_type(R), 1}(undef, 0) + liftPolys = Array{elem_type(R), 1}(undef, 0) + for g in H + push!(Newlm, leading_term(g, ordering = ord)) + push!(liftPolys, g - reduce_walk(g, G, Lm, ord)) + end + return liftPolys, Newlm +end + +# returns all v \in V if v<0 w.r.t. the ordering represented by T and v>0 w.r.t the ordering represented by S. +function filter_by_ordering(S::Matrix{Int}, T::Matrix{Int}, V::Vector{Vector{Int}}) + btz = Set{Vector{Int}}() + for v in V + if less_than_zero(T, v) && bigger_than_zero(S, v) + push!(btz, v) + end + end + return btz +end + +# returns all v \in V if w0 w.r.t. the ordering M. +function bigger_than_zero(M::Matrix{Int}, v::Vector{Int}) + nrows, ncols = size(M) + for i ∈ 1:nrows + d = 0 + for j ∈ 1:ncols + @inbounds d += M[i, j] * v[j] + end + if d != 0 + return d > 0 + end + end + return false +end + +# tests if v<0 w.r.t. the ordering M. +function less_than_zero(M::Matrix{Int}, v::Vector{Int}) + nrows, ncols = size(M) + for i ∈ 1:nrows + d = 0 + for j ∈ 1:ncols + @inbounds d += M[i, j] * v[j] + end + if d != 0 + return d < 0 + end + end + return false +end + +# tests if u max + max = temp + end + end + push!(m, max) + end + msum = 0 + for i ∈ 2:p + msum += m[i] + end + maxdeg = 0 + for g in gens(G) + td = deg(g, n) + if (td > maxdeg) + maxdeg = td + end + end + e = maxdeg * msum + 1 + w = M[1, :] * e^(p - 1) + for i ∈ 2:p + w += e^(p - i) * M[i, :] + end + return convert_bounding_vector(w) +end + +# returns 'true' if the leading terms of G w.r.t the matrixorder T are the same as the leading terms of G w.r.t the weighted monomial order with weight vector t and matrix T. +#function inCone(G::Oscar.IdealGens, T::Union{Matrix{N}, MatElem{N}}, t::Vector{Int}) +# R = change_order(G.base_ring, T) +# I = Singular.Ideal(R, [change_ring(x, R) for x in gens(G)]) +# cvzip = zip(Singular.gens(I), initials(R, Singular.gens(I), t)) +# for (g, ing) in cvzip +# if !isequal(Singular.leading_exponent_vector(g), Singular.leading_exponent_vector(ing)) +# return false +# end +# end +# return true +#end + +# returns 'true' if the leading terms of G w.r.t the matrixordering T are the same as the leading terms of G w.r.t the weighted monomial order with weight vector t and the matrix order T. +#function inCone(G::Oscar.IdealGens, t::Vector{Int}) +# cvzip = zip(Singular.gens(G), initials(base_ring(G), gens(G), t)) +# for (g, ing) in cvzip +# if !isequal(leading_exponent_vector(g), leading_exponent_vector(ing)) +# return false +# end +# end +# return true +#end + +# returns 'true' if the leading terms of G w.r.t the matrixordering T are the same as the leading terms of G with the current ordering. +function same_cone(G::Oscar.IdealGens, T::Matrix{Int}) + R = base_ring(G) + ord = matrix_ordering(R, T) + for g in gens(G) + if leading_term(g, ordering = ord) != leading_term(g, ordering = G.ord) + return false + end + end + return true +end + +# lifts the Groebner basis G to the Groebner basis w.r.t. the Ring Rn like it´s presented in Fukuda et al. (2005). +function lift( + G::Oscar.IdealGens, + orderingAlt::MonomialOrdering, + H::Oscar.IdealGens, + ordering::MonomialOrdering, +) + G = Oscar.IdealGens( + [ + gen - Oscar.IdealGens([reduce(gen, gens(G), ordering = orderingAlt, complete_reduction = true)], ordering)[1] + for gen in gens(H) + ], + ordering, + isGB = true, + ) + return G +end + +# lifts the Groebner basis G to the Groebner basis w.r.t. the Ring Rn like it´s done in Collart et al. (1997). +# FIXME: Needs to be fixed. +function liftGW2( + G::Oscar.IdealGens, + orderingAlt::MonomialOrdering, + inG::MPolyIdeal{T}, + H::Oscar.IdealGens, + ordering::MonomialOrdering, +) where {T <: MPolyRingElem} + H = gens(H) + R = base_ring(G) + G = gens(G) + for i ∈ 1:length(H) + q = divrem(gens(Oscar.IdealGens([H[i]], orderingAlt)), gens(inG)) + H[i] = R(0) + for j ∈ 1:length(gens(inG)) + println(gens(inG)[j]) + println(G[j]) + H[i] = H[i] + q[1][1][j] * G[j] + end + end + return Oscar.IdealGens(filter(!iszero, H), ordering) +end + +# divisionalgorithm that returns q with q_1*f_1 + ... + q_s *f_s=p. +function division_algorithm( + p::T, + f::Vector{T}, + R::MPolyRing, +) where {T <: MPolyRingElem} + q = Array{Singular.elem_type(R), 1}(undef, length(f)) + for i ∈ 1:length(f) + q[i] = R(0) + end + while !isequal(p, R(0)) + i = 1 + div = false + while (div == false && i <= length(f)) + b, m = divides(leading_term(p), leading_term(f[i])) + if b + q[i] = q[i] + m + p = p - (m * f[i]) + div = true + else + i = i + 1 + end + end + if div == false + p = p - leading_term(p) + end + end + return q +end + +# converts a vector wtemp by dividing the entries with gcd(wtemp). +function convert_bounding_vector(wtemp::Vector{T}) where {T <: Rational{BigInt}} + w = Vector{Int}() + g = gcd(wtemp) + for i ∈ 1:length(wtemp) + push!(w, float(divexact(wtemp[i], g))) + end + return w +end + +# converts a vector wtemp by dividing the entries with gcd(wtemp). +function convert_bounding_vector(wtemp::Vector{T}) where {T <: Number} + w = Vector{Int}() + g = gcd(wtemp) + for i ∈ 1:length(wtemp) + push!(w, float(divexact(wtemp[i], g))) + end + return w +end + +# returns a copy of the PolynomialRing I, equipped with the ordering weight_ordering(cw)*matrix_ordering(T). +function create_order( + R::MPolyRing, + cw::Array{L, 1}, + T::Matrix{Int}, +) where {L <: Number} + s = size(T) + if s[1] == s[2] + ord = weight_ordering(cw, matrix_ordering(R, T)) + elseif s[1] - s[2] == 1 + ord = weight_ordering(cw, + matrix_ordering(R, T)) + else + ord = weight_ordering(cw, + matrix_ordering(R, T), + ) + end + return ord +end + +# interreduces the Groebner basis G. +function interreduce_walk(G::Oscar.IdealGens) + Rn = base_ring(G) + Generator = collect(gens(G)) + I = 0 + for i ∈ 1:length(gens(G)) + Generator[i] = reduce(Generator[i], Generator[1:end.!=i], ordering = G.ord, complete_reduction = true) + end + return Oscar.IdealGens(Generator, G.ord) +end + +############################################# +# unspecific help functions +############################################# + +function ident_matrix(n::Int) + M = zeros(Int, n, n) + for i ∈ 1:n + M[i, i] = 1 + end + return M +end + +function anti_diagonal_matrix(n::Int) + M = zeros(Int, n, n) + for i ∈ 1:n + M[i, n+1-i] = -1 + end + return M +end + +# Singular.isequal depends on order of generators +function equalitytest(G::Oscar.IdealGens, K::Oscar.IdealGens) + if length(gens(G)) != length(gens(K)) + return false + end + generators = Singular.gens(G) + count = 0 + for gen in generators + for r in Singular.gens(K) + if gen * first(coefficients(leading_term(r, ordering = G.ord))) - r * first(coefficients(leading_term(gen, ordering = G.ord))) == 0 + count += 1 + break + end + end + end + if count == length(gens(G)) + return true + end + return false +end + +function dot(v::Vector{Int}, w::Vector{Int}) + sum = 0 + for i ∈ 1:length(v) + @inbounds sum += v[i] * w[i] + end + return sum +end + +function ordering_as_matrix(w::Vector{Int}, ord::Symbol) + if length(w) > 2 + if ord == :lex + return [ + w' + ident_matrix(length(w))[1:length(w)-1, :] + ] + end + if ord == :deglex + return [ + w' + ones(Int, length(w))' + ident_matrix(length(w))[1:length(w)-2, :] + ] + end + if ord == :degrevlex + return [ + w' + ones(Int, length(w))' + anti_diagonal_matrix(length(w))[1:length(w)-2, :] + ] + end + if ord == :revlex + return [ + w' + anti_diagonal_matrix(length(w))[1:length(w)-1, :] + ] + end + else + error("not implemented") + end +end + +function change_weight_vector(w::Vector{Int}, M::Matrix{Int}) + return [ + w' + M[2:length(w), :] + ] +end + +function insert_weight_vector(w::Vector{Int}, M::Matrix{Int}) + return [ + w' + M[1:length(w)-1, :] + ] +end + +function add_weight_vector(w::Vector{Int}, M::Matrix{Int}) + return [ + w' + M + ] +end + +function ordering_as_matrix(ord::Symbol, nvars::Int) + if ord == :lex + return ident_matrix(nvars) + end + if ord == :deglex + return [ + ones(Int, nvars)' + ident_matrix(nvars)[1:nvars-1, :] + ] + end + if ord == :degrevlex + return [ + ones(Int, nvars)' + anti_diagonal_matrix(nvars)[1:nvars-1, :] + ] + end + if ord == :revlex + return [ + w' + anti_diagonal_matrix(length(w))[1:length(w)-1, :] + ] + else + error("not implemented") + end +end + +function deg(p::MPolyRingElem, n::Int) + max = 0 + for mon in Singular.monomials(p) + ev = Singular.exponent_vectors(mon) + sum = 0 + for e in ev + for i ∈ 1:n + sum += e[i] + end + if (max < sum) + max = sum + end + end + end + return max +end + + +function checkInt32(w::Vector{Int}) + for i ∈ 1:length(w) + if tryparse(Int32, string(w[i])) == nothing + return false + end + end + return true +end + +# computes the representation of the matrixorder defined by T. +function representation_vector(G::Oscar.IdealGens, T::Matrix{Int}) + n = size(T)[1] + M = 0 + for i ∈ 1:n + for j ∈ 1:n + temp = T[i, j] + if M < temp + M = temp + end + end + end + d0 = 0 + for g in Singular.gens(G) + temp = deg(g, n) + if d0 < temp + d0 = temp + end + end + d = M * (2 * d0^2 + (n + 1) * d0) + w = d^(n - 1) * T[1, :] + for i ∈ 2:n + w = w + d^(n - i) * T[i, :] + end + return w +end + +# checks if Gw is an initialform of an ideal corresponding to a face of the Groebner fan with dimension less than n-1. +function inSeveralCones(Gw::Vector{T}) where {T <: MPolyRingElem} + counter = 0 + for g in Gw + if size(collect(Singular.coefficients(g)))[1] > 2 + return true + end + if size(collect(Singular.coefficients(g)))[1] == 2 + counter = counter + 1 + end + end + if counter > 1 + return true + end + return false +end \ No newline at end of file diff --git a/test/groebner_walk.jl b/test/groebner_walk.jl new file mode 100644 index 000000000000..10f181eb47f3 --- /dev/null +++ b/test/groebner_walk.jl @@ -0,0 +1,258 @@ +@testset "Testing the Groebner Walk" begin + R, (a, b, c, d) = polynomial_ring( + Singular.N_ZpField(32003), + ["a", "b", "c", "d"], + ordering = :degrevlex, + ) + id = ideal( + R, + [ + 2 * a^2 * b + + 3 * a * b^2 + + 3 * b^3 + + 4 * c^3 + + 4 * a * b * d + + c^2 * d + + 2 * b * d^2 + + 2 * d^3 + + 4 * c^2 + + 2 * c * d + + 2 * c, + 2 * a^2 * b + + 5 * a^2 * c + + 2 * b * c^2 + + c^2 * d + + a * c + + 2 * b * d + + 2 * c * d + + d^2 + + a + + 4 * d, + ], + ) + + ideals = [] + infoLevel = 1 + for i ∈ 2:nvars(R) + push!(ideals, groebnerwalk(id, degrevlex(R), lex(R), :perturbed, i)) + end + push!(ideals, groebnerwalk(id, degrevlex(R), lex(R), :standard)) + # push!(ideals, groebnerwalk(id, degrevlex(R), lex(R), :tran)) + + push!(ideals, groebnerwalk(id, degrevlex(R), lex(R), :fractal)) + push!(ideals, groebnerwalk(id, degrevlex(R), lex(R), :fractal_start_order)) + push!(ideals, groebnerwalk(id, degrevlex(R), lex(R), :fractal_combined)) + push!(ideals, groebnerwalk(id, degrevlex(R), lex(R), :generic)) + + s = groebner_basis(id, ordering = lex(R), complete_reduction = true) + for i in ideals + i.isGB = true + @test equalitytest( + Oscar.IdealGens(R, gens(i), lex(R)), + s, + ) + end + + R, (x, y) = polynomial_ring(QQ, ["x", "y"], ordering = :degrevlex) + I = ideal([y^4 + x^3 - x^2 + x, x^4]) + id = groebnerwalk(I, degrevlex(R), lex(R), :tran) + + s = groebner_basis(I, ordering = lex(R), complete_reduction = true) + @test equalitytest( + Oscar.IdealGens(R, gens(id), lex(R)), + s, + ) + + @testset "backend-functions for the Groebner Walk" begin + + R, (x, y, z) = polynomial_ring( + QQ, + ["x", "y", "z"], + ordering = :degrevlex, + ) + + f1 = 3 * x^2 + 16 * x^2 * z + 14 * x^2 * y^3 + f2 = y^3 * z + 17 * x^2 * z^2 + 7 * x^2 * y^2 * z^2 + 13 * x^3 * z^2 + I = Oscar.IdealGens(R, [f1, f2], degrevlex(R)) + sol = [14 * x^2 * y^3, y^3 * z + 7 * x^2 * y^2 * z^2] + @test initials(I, [1, 3, 1]) == sol + + @test difference_lead_tail(I) == + [[0, 3, -1], [0, 3, 0], [-1, 2, 0], [2, -1, 1], [0, 2, 0]] + + F = [ + 13 * x^3 * z^2, + 14 * x^2 * y^3, + 98 * x * y^5 * z^2, + y^7 * z + x^2 * z^3, + 14 * x * y^6 * z, + ] + g = y^7 * z + x^2 * z^3 + 28 * x^2 * y^4 + q = Array{elem_type(R), 1}(undef, 5) + q[1] = R(0) + q[2] = R(2 * y) + q[3] = R(0) + q[4] = R(1) + q[5] = R(0) + @test division_algorithm(g, F, R) == q + + J = Oscar.IdealGens(R, [f2, f1]) + f1 = 4 * x^2 + 16 * x^2 * z + 14 * x^2 * y^3 + f2 = y^3 * z + 17 * x^2 * z^2 + 7 * x^2 * y^2 * z^2 + 13 * x^3 * z^2 + K = Oscar.IdealGens(R, [f1, f2]) + @test equalitytest(I, J) == true + @test equalitytest(I, K) == false + + @test deg(f1, 3) == 5 + + R, (x, y, z, t, u, v) = polynomial_ring( + Singular.N_ZpField(32003), + ["x", "y", "z", "t", "u", "v"], + ordering = :degrevlex, + ) + StartOrd = ordering_as_matrix(:degrevlex, 6) + TarOrd = ordering_as_matrix(:lex, 6) + f1 = 45 * y + 35 * u - 165 * v - 36 + f2 = 36 * y + 25 * z + 40 * t - 27 * u + f3 = 25 * y * u - 165 * v^2 + 15 * x - 18 * z + 30t + f4 = 15 * y * z + 20 * t * u - 9 * x + f5 = -11 * v^3 + x * y + 2 * z * t + f6 = -11 * u * v + 3 * v^2 + 99 * x + id = ideal(R, [f1, f2, f3, f4, f5, f6]) + I = groebner_basis(id, complete_reduction = true) + @test perturbed_vector(I, StartOrd, 1) == [1, 1, 1, 1, 1, 1] + @test perturbed_vector(I, StartOrd, 2) == [4, 4, 4, 4, 4, 3] + @test perturbed_vector(I, StartOrd, 3) == [49, 49, 49, 49, 48, 42] + @test perturbed_vector(I, StartOrd, 4) == + [1000, 1000, 1000, 999, 990, 900] + @test perturbed_vector(I, TarOrd, 1) == [1, 0, 0, 0, 0, 0] + @test perturbed_vector(I, TarOrd, 2) == [4, 1, 0, 0, 0, 0] + @test perturbed_vector(I, TarOrd, 3) == [49, 7, 1, 0, 0, 0] + @test perturbed_vector(I, TarOrd, 4) == [1000, 100, 10, 1, 0, 0] + + @test same_cone(I, add_weight_vector([1000, 1000, 1000, 999, 990, 900], TarOrd)) == true + @test same_cone(I, add_weight_vector([100, 1000, 1000, 999, 990, 900], TarOrd)) == false + + @test dot([1, 2, 3, 4], [2, 2, 2, 2]) == 20 + + R, (x, y, z) = polynomial_ring( + QQ, + ["x", "y", "z"], + ordering = :degrevlex, + ) + + f1 = 3 * x^2 + f2 = y^3 * z + 17 * x^2 * z^2 + I = ideal(R, [f1, f2]) + f1 = 3 * x^2 + f2 = y^3 * z + J = ideal(R, [f1, f2]) + f1 = x^3 * y^2 + z^2 + y^2 + f2 = y^3 + K = ideal(R, [f1, f2]) + + @test ismonomial(gens(I)) == false + @test ismonomial(gens(J)) == true + @test isbinomial(gens(I)) == true + @test isbinomial(gens(J)) == true + @test isbinomial(gens(K)) == false + @test ismonomial(gens(K)) == false + + R, (x, y) = polynomial_ring( + QQ, + ["x", "y"], + ordering = :degrevlex, + ) + + f1 = x^2 - y^3 + f2 = x^3 - y^2 - x + I = ideal(R, [f1, f2]) + G = groebner_basis(I, complete_reduction = true) + + @test next_gamma( + G, + [leading_term(g) for g in gens(G)], + [0], + ordering_as_matrix(:degrevlex, 2), + ordering_as_matrix(:lex, 2), + ) == [-2, 3] + + + g = [R(y^3 - x^2), R(x^3)] + G.ord = lex(R) + @test facet_initials( + G, + [leading_term(g) for g in G], + [-2, 3], + ) == g + G.ord = degrevlex(R) + @test difference_lead_tail( + G, + [leading_term(g) for g in gens(G)], ordering_as_matrix(:lex, 2), + ) == [[-2, 3], [3, -2], [2, 0]] + + @test isparallel([1, 2], [1, 4]) == false + @test isparallel([1, 2], [2, 4]) == true + @test isparallel([-1, 0], [-2, 1]) == false + @test isparallel([-1, 0], [2, 0]) == true + + @test less_facet( + [-2, 3], + [-1, 4], + ordering_as_matrix(:degrevlex, 2), + ordering_as_matrix(:lex, 2), + ) == true + @test less_facet( + [-1, 7], + [-1, 4], + ordering_as_matrix(:degrevlex, 2), + ordering_as_matrix(:lex, 2), + ) == false + + R, (a, b, c, d, e) = PolynomialRing( + QQ, + ["a", "b", "c", "d", "e"], + ordering = :degrevlex, + ) + J = ideal( + R, + [ + b + 3 * b^3 + 2 * b * c * e + 5 * b * d * e, + 4 + b^2 + 4 * b * c + 5 * b^3 + c * d * e, + d * e + 5 * b^2 * e, + ], + ) + I = groebner_basis(J, complete_reduction = true) + f1 = R( + a^3 + + a^2 + + b^5 * a^3 * c^9 + + e^3 + + b^2 * a^2 * c^4 + + d^3 + + e^3 + + b^2 * d^2 * e^7, + ) + f2 = R(a^3 * b^3) + f3 = R(a^2 * b^4 + c^2 + a^3 * 4 + a * e^3) + f4 = R(0) + + @test (reduce(f3, gens(I), ordering = degrevlex(R), complete_reduction = true)) == + reduce_walk(f3, gens(I), [leading_term(g) for g in gens(I)], degrevlex(R)) + @test (reduce(f2, gens(I), ordering = degrevlex(R), complete_reduction = true)) == + reduce_walk(f2, gens(I), [leading_term(g) for g in gens(I)], degrevlex(R)) + @test (reduce(f2, gens(I), ordering = degrevlex(R), complete_reduction = true)) == + reduce_walk(f2, gens(I), [leading_term(g) for g in gens(I)], degrevlex(R)) + @test (reduce(f4, gens(I), ordering = degrevlex(R), complete_reduction = true)) == + reduce_walk(f4, gens(I), [leading_term(g) for g in gens(I)], degrevlex(R)) + + J = groebner_basis(J, ordering = degrevlex(R), complete_reduction = false) + @test equalitytest( + groebner_basis(ideal(R, gens(J)), complete_reduction = true), Oscar.IdealGens(interreduce( + gens(J), + [leading_term(g) for g in gens(J)], + degrevlex(R), + )), + ) + end +end \ No newline at end of file From 9e31ce225f50158b60996d31b826c7fa24583cd8 Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Thu, 15 Feb 2024 09:51:44 +0100 Subject: [PATCH 002/179] Phase out global infoLevel --- src/walk.jl | 2438 ++++++++++++++++++++++++--------------------------- 1 file changed, 1136 insertions(+), 1302 deletions(-) diff --git a/src/walk.jl b/src/walk.jl index 84e6ae8ff2da..7b89fad5d46b 100644 --- a/src/walk.jl +++ b/src/walk.jl @@ -1,44 +1,40 @@ -using Oscar global infoLevel = 0 +add_verbosity_scope(:intermediate) +add_verbosity_scope(:detailed) + +set_verbosity_level(:intermediate, 1); +set_verbosity_level(:detailed, 2); + ############################################################### # Implementation of different variants of the Groebner Walk. # The Groebner Walk is proposed by Collart, Kalkbrener & Mall (1997). ############################################################### @doc raw""" - groebnerwalk( - I::MPolyIdeal; - startOrder::MonomialOrdering = default_ordering(base_ring(I)), - targetOrder::Symbol = lex(base_ring(I)), - walktype::Symbol = :standard, - perturbationDegree::Int = 2, - ) + groebnerwalk(I::MPolyIdeal; startOrder::MonomialOrdering = default_ordering(base_ring(I)), targetOrder::Symbol = lex(base_ring(I)), walktype::Symbol = :standard, perturbationDegree::Int = 2) + Compute a reduced Groebner basis w.r.t. to a monomial order by converting it using the Groebner Walk. The Groebner Walk is proposed by Collart, Kalkbrener & Mall (1997). One can choose a strategy of: Standard Walk (:standard) computes the Walk like it´s presented in Cox, Little & O´Shea (2005). -Generic Walk (:generic) computes the Walk like it´s presented in Fukuda, Jensen, Lauritzen & Thomas (2005). -Perturbed Walk (:perturbed, with p = degree of the perturbation) computes the Walk like it´s presented in Amrhein, Gloor & Küchlin (1997). -Tran´s Walk (:tran) computes the Walk like it´s presented in Tran (2000). -Fractal Walk (:fractalcombined) computes the Walk like it´s presented in Amrhein & Gloor (1998) with multiple extensions. The target monomial order has to be lex. This version uses the Buchberger Algorithm to skip weight vectors with entries bigger than Int32. -Fractal Walk (:fractal) computes the Walk like it´s presented in Amrhein & Gloor (1998). Pertubes only the target vector. -Set infoLevel to trace the walk: - -'infoLevel=0': no detailed printout, - -'infoLevel=1': adds intermediate weight vectors, - -'infoLevel=2': adds information about the Groebner basis. +- Generic Walk (:generic) computes the Walk as presented in Fukuda, Jensen, Lauritzen & Thomas (2005). +- Perturbed Walk (:perturbed, with p = degree of the perturbation) computes the Walk ass presented in Amrhein, Gloor & Küchlin (1997). +- Tran's Walk (:tran) computes the Walk like as presented in Tran (2000). +- Fractal Walk (:fractalcombined) computes the Walk like as presented in Amrhein & Gloor (1998) with multiple extensions. The target monomial order has to be lex. This version uses the Buchberger algorithm to skip weight vectors with entries bigger than Int32. +- Fractal Walk (:fractal) computes the Walk as presented in Amrhein & Gloor (1998). Perturbs only the target vector. #Arguments - `G::Oscar.IdealGens`: ideal one wants to compute a Groebner basis for. - `startOrder::MonomialOrdering=:degrevlex`: monomial order to begin the conversion. - `targetOrder::MonomialOrdering=:lex`: monomial order one wants to compute a Groebner basis for. - `walktype::Symbol=standard`: strategy of the Groebner Walk. One can choose a strategy of: - - `standard`: Standard Walk, - - `perturbed`: Perturbed Walk, - - `tran`: Tran´s Walk, - - `generic`: Generic Walk, - - `fractal`: standard-version of the Fractal Walk, - - `fractalcombined`: combined Version of the Fractal Walk. Target monomial order needs to be lex, + - `standard`: Standard Walk, + - `perturbed`: Perturbed Walk, + - `tran`: Tran´s Walk, + - `generic`: Generic Walk, + - `fractal`: standard-version of the Fractal Walk, + - `fractalcombined`: combined Version of the Fractal Walk. Target monomial order needs to be lex, - `perturbationDegree::Int=2`: perturbationdegree for the perturbed Walk. @@ -80,28 +76,25 @@ matrix_ordering([x, y], [1 0; 0 1]) ``` """ function groebnerwalk( - I::MPolyIdeal, startOrder::MonomialOrdering = default_ordering(base_ring(I)), - targetOrder::MonomialOrdering = lex(base_ring(I)), - walktype::Symbol = :standard, - perturbationDegree::Int = 2) - S = canonical_matrix(startOrder) - T = canonical_matrix(targetOrder) - return groebnerwalk( - I, - S, T, - walktype, - perturbationDegree, - ) + I::MPolyIdeal, + startOrder::MonomialOrdering=default_ordering(base_ring(I)), + targetOrder::MonomialOrdering=lex(base_ring(I)), + walktype::Symbol=:standard, + perturbationDegree::Int=2, +) + S = canonical_matrix(startOrder) + T = canonical_matrix(targetOrder) + return groebnerwalk(I, S, T, walktype, perturbationDegree) end @doc raw""" - groebnerwalk( - G::Oscar.IdealGens, - S::Union{Matrix{T}, MatElem{T}}, - T::Union{Matrix{T}, MatElem{T}}, - walktype::Symbol = :standard, - p::Int = 2 - ) where T + groebnerwalk( + G::Oscar.IdealGens, + S::Union{Matrix{T}, MatElem{T}}, + T::Union{Matrix{T}, MatElem{T}}, + walktype::Symbol = :standard, + p::Int = 2 + ) where T Computes a reduced Groebner basis w.r.t. the monomial order T by converting the reduced Groebner basis G w.r.t. the monomial order S using the Groebner Walk. One can choose a strategy of: Standard Walk (:standard) computes the Walk like it´s presented in Cox et al. (2005). @@ -111,21 +104,21 @@ Tran´s Walk (:tran) computes the Walk like it´s presented in Tran (2000). Fractal Walk (:fractal) computes the Walk like it´s presented in Amrhein & Gloor (1998). Pertubes only the target vector. Fractal Walk (:fractalcombined) computes the Walk like it´s presented in Amrhein & Gloor (1998) with multiple extensions. The target monomial order has to be lex. This version uses the Buchberger Algorithm to skip weightvectors with entries bigger than Int32. Set infoLevel to trace the walk: - -'infoLevel=0': no detailed printout, - -'infoLevel=1': adds intermediate weight vectors, - -'infoLevel=2': adds information about the Groebner basis. + -'infoLevel=0': no detailed printout, + -'infoLevel=1': adds intermediate weight vectors, + -'infoLevel=2': adds information about the Groebner basis. #Arguments -`G::Oscar.IdealGens`: Groebner basis to convert to the Groebner basis w.r.t. the target order T. G needs to be a Groebner basis w.r.t. the start order S. -`S::Union{Matrix{N}, MatElem{N}}`: start monomial order w.r.t. the Groebner basis G. Note that S has to be a nxn-matrix with rank(S)=n and its first row needs to have positive entries. -`T::Union{Matrix{N}, MatElem{N}}`: target monomial order one wants to compute a Groebner basis for. Note that T has to be a nxn-matrix with rank(T)=n and its first row needs to have positive entries. -`walktype::Symbol=standard`: strategy of the Groebner Walk. One can choose a strategy of: - - `standard`: Standard Walk (default), - - `perturbed`: Perturbed Walk, - - `tran`: Tran´s Walk, - - `generic`: Generic Walk, - - `fractal`: standard-version of the Fractal Walk, - - `fractalcombined`: combined version of the Fractal Walk. The target monomial order needs to be lex, + - `standard`: Standard Walk (default), + - `perturbed`: Perturbed Walk, + - `tran`: Tran´s Walk, + - `generic`: Generic Walk, + - `fractal`: standard-version of the Fractal Walk, + - `fractalcombined`: combined version of the Fractal Walk. The target monomial order needs to be lex, -`p::Int=2`: perturbationdegree for the perturbed Walk. # Examples @@ -166,43 +159,42 @@ matrix_ordering([x, y], [1 0; 0 1]) ``` """ function groebnerwalk( - G::Union{Oscar.IdealGens, MPolyIdeal}, - S::Union{Matrix{N}, MatElem{N}}, - T::Union{Matrix{N}, MatElem{N}}, - walktype::Symbol = :standard, - p::Int = 2, -) where N - - if walktype == :standard - walk = (x) -> standard_walk(x, S, T) - elseif walktype == :generic - walk = (x) -> generic_walk(x, S, T) - elseif walktype == :perturbed - walk = (x) -> perturbed_walk(x, S, T, p) - elseif walktype == :fractal - walk = (x) -> fractal_walk(x, S, T) - elseif walktype == :fractal_start_order - walk = (x) -> fractal_walk_start_order(x, S, T) - # elseif walktype == :fractal_lex - # walk = (x) -> fractal_walk_lex(x, S, T) - # elseif walktype == :fractal_look_ahead - # walk = (x) -> fractal_walk_look_ahead(x, S, T) - elseif walktype == :tran - walk = (x) -> tran_walk(x, S, T) - elseif walktype == :fractal_combined - walk = (x) -> fractal_walk_combined(x, S, T) - end - delete_step_counter() - S = Matrix{Int}(S) - T = Matrix{Int}(T) - # Make sure G is a fully reduced Groebner Basis - Gb = groebner_basis(ideal(gens(G)), ordering = matrix_ordering(base_ring(G), S), complete_reduction = true) - Gb = walk(Gb) - - if infoLevel >= 1 - println("Cones crossed: ", delete_step_counter()) - end - return Oscar.IdealGens(gens(Gb), matrix_ordering(base_ring(G), T), isGB = true) + G::Union{Oscar.IdealGens,MPolyIdeal}, + S::Union{Matrix{N},MatElem{N}}, + T::Union{Matrix{N},MatElem{N}}, + walktype::Symbol=:standard, + p::Int=2, +) where {N} + if walktype == :standard + walk = (x) -> standard_walk(x, S, T) + elseif walktype == :generic + walk = (x) -> generic_walk(x, S, T) + elseif walktype == :perturbed + walk = (x) -> perturbed_walk(x, S, T, p) + elseif walktype == :fractal + walk = (x) -> fractal_walk(x, S, T) + elseif walktype == :fractal_start_order + walk = (x) -> fractal_walk_start_order(x, S, T) + # elseif walktype == :fractal_lex + # walk = (x) -> fractal_walk_lex(x, S, T) + # elseif walktype == :fractal_look_ahead + # walk = (x) -> fractal_walk_look_ahead(x, S, T) + elseif walktype == :tran + walk = (x) -> tran_walk(x, S, T) + elseif walktype == :fractal_combined + walk = (x) -> fractal_walk_combined(x, S, T) + end + delete_step_counter() + S = Matrix{Int}(S) + T = Matrix{Int}(T) + # Make sure G is a fully reduced Groebner Basis + Gb = groebner_basis( + ideal(gens(G)); ordering=matrix_ordering(base_ring(G), S), complete_reduction=true + ) + Gb = walk(Gb) + + @vprintln(:intermediate, "Cones crossed: ", delete_step_counter()) + return Oscar.IdealGens(gens(Gb), matrix_ordering(base_ring(G), T); isGB=true) end ########################################### @@ -210,58 +202,53 @@ end ########################################### counter = 0 function delete_step_counter() - global counter - temp = counter - counter = 0 - return temp + global counter + temp = counter + counter = 0 + return temp end function getstep_counter() - global counter - return counter + global counter + return counter end function raise_step_counter() - global counter = getstep_counter() + 1 + global counter = getstep_counter() + 1 end ############################################################### # Implementation of the standard walk. ############################################################### -function standard_walk( - G::Oscar.IdealGens, - S::Matrix{Int}, - T::Matrix{Int}, -) - if infoLevel >= 1 - println("standard_walk results") - println("Crossed Cones in: ") - end +function standard_walk(G::Oscar.IdealGens, S::Matrix{Int}, T::Matrix{Int}) + @vprintln(:intermediate, "standard_walk results") + @vprintln(:intermediate, "Crossed Cones in: ") - Gb = standard_walk(G, S, T, S[1, :], T[1, :]) + Gb = standard_walk(G, S, T, S[1, :], T[1, :]) - return Gb + return Gb end function standard_walk( - G::Oscar.IdealGens, - S::Matrix{Int}, - T::Matrix{Int}, - currweight::Vector{Int}, - tarweight::Vector{Int}) - while true - G = standard_step(G, currweight, T) - if currweight == tarweight - return G - else - currweight = next_weight(G, currweight, tarweight) - end - if infoLevel >= 1 - raise_step_counter() - println(currweight) - if infoLevel == 2 - println(G) - end - end - end + G::Oscar.IdealGens, + S::Matrix{Int}, + T::Matrix{Int}, + currweight::Vector{Int}, + tarweight::Vector{Int}, +) + while true + G = standard_step(G, currweight, T) + if currweight == tarweight + return G + else + currweight = next_weight(G, currweight, tarweight) + end + if infoLevel >= 1 + raise_step_counter() + @vprintln(:intermediate, currweight) + if infoLevel == 2 + @vprintln(:detailed, G) + end + end + end end ############################################################### @@ -269,99 +256,89 @@ end ############################################################### function standard_step(G::Oscar.IdealGens, w::Vector{Int}, T::Matrix{Int}) - R = base_ring(G) - ordAlt = G.ord - Gw = 0 - - #check if no entry of w is bigger than Int32. If it´s bigger multiply it by 0.1 and round. - if !checkInt32(w) - Gw = ideal(initials(G, w)) - w, b = truncw(G, w, gens(Gw)) - !b && throw(error("Some entries of the intermediate weight-vector $w are bigger than int32")) - else - Gw = ideal(initials(G, w)) - end - ordNew = create_order(R, w, T) - H = groebner_basis(Gw, ordering = ordNew, complete_reduction = true, algorithm = :buchberger) - #H = liftGW2(G, ordAlt, Gw, H, ordNew) - H = lift(G, ordAlt, H, ordNew) - return interreduce_walk(H) + R = base_ring(G) + ordAlt = G.ord + Gw = 0 + + #check if no entry of w is bigger than Int32. If it´s bigger multiply it by 0.1 and round. + if !checkInt32(w) + Gw = ideal(initials(G, w)) + w, b = truncw(G, w, gens(Gw)) + !b && throw( + error("Some entries of the intermediate weight-vector $w are bigger than int32") + ) + else + Gw = ideal(initials(G, w)) + end + ordNew = create_order(R, w, T) + H = groebner_basis(Gw; ordering=ordNew, complete_reduction=true, algorithm=:buchberger) + #H = liftGW2(G, ordAlt, Gw, H, ordNew) + H = lift(G, ordAlt, H, ordNew) + return interreduce_walk(H) end ############################################################### # Generic-version of the Groebner Walk. ############################################################### -function generic_walk( - G::Oscar.IdealGens, - S::Matrix{Int}, - T::Matrix{Int}, -) - Lm = [leading_term(g, ordering = matrix_ordering(base_ring(G), S)) for g in G] - v = next_gamma(G, Lm, [0], S, T) - ordNew = matrix_ordering(base_ring(G), T) - if infoLevel >= 1 - println("generic_walk results") - println("Facets crossed for: ") - end - while !isempty(v) - G, Lm = generic_step(G, Lm, v, ordNew) - raise_step_counter() - - if infoLevel >= 1 - println(v) - if infoLevel == 2 - println(G) - end - end - G = Oscar.IdealGens(G, ordNew) - v = next_gamma(G, Lm, v, S, T) - end - return G +function generic_walk(G::Oscar.IdealGens, S::Matrix{Int}, T::Matrix{Int}) + Lm = [leading_term(g; ordering=matrix_ordering(base_ring(G), S)) for g in G] + v = next_gamma(G, Lm, [0], S, T) + ordNew = matrix_ordering(base_ring(G), T) + if infoLevel >= 1 + @vprintln(:intermediate, "generic_walk results") + @vprintln(:intermediate, "Facets crossed for: ") + end + while !isempty(v) + G, Lm = generic_step(G, Lm, v, ordNew) + raise_step_counter() + + if infoLevel >= 1 + @vprintln(:intermediate, v) + if infoLevel == 2 + @vprintln(:detailed, G) + end + end + G = Oscar.IdealGens(G, ordNew) + v = next_gamma(G, Lm, v, S, T) + end + return G end function generic_step( - G::Oscar.IdealGens, - Lm::Vector{T}, - v::Vector{Int}, - ord::MonomialOrdering, -) where {T <: MPolyRingElem} - facet_Generators = facet_initials(G, Lm, v) - H = groebner_basis(ideal(facet_Generators), ordering = ord, complete_reduction = true, algorithm = :buchberger) - H, Lm = lift_generic(gens(G), Lm, gens(H), ord) - G = interreduce(H, Lm, ord) - return G, Lm + G::Oscar.IdealGens, Lm::Vector{T}, v::Vector{Int}, ord::MonomialOrdering +) where {T<:MPolyRingElem} + facet_Generators = facet_initials(G, Lm, v) + H = groebner_basis( + ideal(facet_Generators); ordering=ord, complete_reduction=true, algorithm=:buchberger + ) + H, Lm = lift_generic(gens(G), Lm, gens(H), ord) + G = interreduce(H, Lm, ord) + return G, Lm end ############################################################### # Perturbed-version of the Groebner Walk. ############################################################### -function perturbed_walk( - G::Oscar.IdealGens, - S::Matrix{Int}, - T::Matrix{Int}, - p::Int, -) - if infoLevel >= 1 - println("perturbed_walk results") - println("Crossed Cones in: ") - end - - currweight = perturbed_vector(G, S, p) - - while true - tarweight = perturbed_vector(G, T, p) - Tn = add_weight_vector(tarweight, T) - G = standard_walk(G, S, Tn, currweight, tarweight) - if same_cone(G, T) - return G - else - p = p - 1 - currweight = tarweight - S = Tn - end - end +function perturbed_walk(G::Oscar.IdealGens, S::Matrix{Int}, T::Matrix{Int}, p::Int) + @vprintln(:intermediate, "perturbed_walk results") + @vprintln(:intermediate, "Crossed Cones in: ") + + currweight = perturbed_vector(G, S, p) + + while true + tarweight = perturbed_vector(G, T, p) + Tn = add_weight_vector(tarweight, T) + G = standard_walk(G, S, Tn, currweight, tarweight) + if same_cone(G, T) + return G + else + p = p - 1 + currweight = tarweight + S = Tn + end + end end ############################################################### @@ -383,153 +360,126 @@ firstStepMode = false # - skips a step in top level in the last step. # - checks if an entry of an intermediate weight vector is bigger than int32. In case of that the Buchberger-Algorithm is used to compute the Groebner basis of the ideal of the initialforms. ############################################################### -function fractal_walk_combined( - G::Oscar.IdealGens, - S::Matrix{Int}, - T::Matrix{Int}, -) - if infoLevel >= 1 - println("fractal_walk_combined results") - println("Crossed Cones in: ") - end - - global pTargetWeights = - [perturbed_vector(G, T, i) for i ∈ 1:nvars(base_ring(G))] - return fractal_walk_combined(G, S, T, S[1, :], pTargetWeights, 1) +function fractal_walk_combined(G::Oscar.IdealGens, S::Matrix{Int}, T::Matrix{Int}) + @vprintln(:intermediate, "fractal_walk_combined results") + @vprintln(:intermediate, "Crossed Cones in: ") + + global pTargetWeights = [perturbed_vector(G, T, i) for i in 1:nvars(base_ring(G))] + return fractal_walk_combined(G, S, T, S[1, :], pTargetWeights, 1) end function fractal_walk_combined( - G::Oscar.IdealGens, - S::Matrix{Int}, - T::Matrix{Int}, - currweight::Vector{Int}, - pTargetWeights::Vector{Vector{Int}}, - p::Int, + G::Oscar.IdealGens, + S::Matrix{Int}, + T::Matrix{Int}, + currweight::Vector{Int}, + pTargetWeights::Vector{Vector{Int}}, + p::Int, ) - R = base_ring(G) - G.isGB = true - w = currweight - ordAlt = G.ord - - # Handling the weight of the start order. - if (p == 1) - if !ismonomial(initials(G, w)) - global pStartWeights = [perturbed_vector(G, S, i) for i ∈ 1:nvars(R)] - global firstStepMode = true - end - end - if firstStepMode - w = pStartWeights[p] - else - w = currweight - end - - # main loop - while true - t = next_weight_fractal_walk(G, w, pTargetWeights[p]) - - # Handling the final step in the current depth. - # next_weight_fractal_walk may return 0 if the target vector does not lie in the cone of T while G already defines the Groebner basis w.r.t. T. - # -> Checking if G is already a Groebner basis w.r.t. T solves this problem and reduces computational effort since next_weight_fractal_walk returns 1 in the last step on every local path. - if t == 1 && p != 1 - if same_cone(G, T) - if infoLevel >= 1 - println("depth $p: in cone ", currweight, ".") - end - - # Check if a target weight of pTargetWeights[p] and pTargetWeights[p-1] lies in the wrong cone. - if !inCone(G, T, pTargetWeights, p) - global pTargetWeights = - [perturbed_vector(G, T, i) for i ∈ 1:nvars(R)] - if infoLevel >= 1 - println("depth $p: not in cone ", pTargetWeights[p], ".") - end - end - return G - end - elseif t == [0] # The Groebner basis w.r.t. the target weight and T is already computed. - if inCone(G, T, pTargetWeights, p) - if infoLevel >= 1 - println("depth $p: in cone ", pTargetWeights[p], ".") - end - return G - end - global pTargetWeights = - [perturbed_vector(G, T, i) for i ∈ 1:nvars(R)] - if infoLevel >= 1 - println("depth $p: not in cone ", pTargetWeights[p], ".") - end - continue - end - - # skip a step for target monomial order lex. - if t == 1 && p == 1 - if infoLevel >= 1 - println("depth $p: recursive call in ", pTargetWeights[p]) - end - return fractal_walk_combined( - G, - S, - T, - w, - pTargetWeights, - p + 1, - ) - else - w = w + t * (pTargetWeights[p] - w) - w = convert_bounding_vector(w) - Gw = ideal(initials(G, w)) - - # handling the current weight with regards to Int32-entries. If an entry of w is bigger than Int32 use the Buchberger-algorithm. - if !checkInt32(w) - println("depth $p: Some entries of $w are bigger than Int32. Trying to find another weight,") - w, b = truncw(G, w, gens(Gw)) - if !b - println("depth $p: Doing a direct conversion to the target monomial ordering.") - ordNew = matrix_ordering(R, T) - w = T[1, :] - G = groebner_basis(ideal(G), ordering = ordNew, complete_reduction = true, algorithm = :buchberger) - - if !inCone(G, T, pTargetWeights, p) - global pTargetWeights = - [perturbed_vector(G, T, i) for i ∈ 1:nvars(R)] - if infoLevel >= 1 - println("depth $p: not in cone ", pTargetWeights[p], ".") - end - end - return G - end - end - ordNew = create_order(R, w, T) - # converting the Groebner basis - if (p == nvars(R) || isbinomial(gens(Gw))) - H = groebner_basis(Gw, ordering = ordNew, complete_reduction = true, algorithm = :buchberger) - - if infoLevel >= 1 - println("depth $p: conversion in ", w, ".") - end - raise_step_counter() - else - if infoLevel >= 1 - println("depth $p: recursive call in $w.") - end - H = fractal_walk_combined( - Oscar.IdealGens(R, gens(Gw), ordAlt), - S, - T, - deepcopy(currweight), - pTargetWeights, - p + 1, - ) - global firstStepMode = false - end - end - #H = liftGW2(G, ordAlt, Gw,H, ordNew) - H = lift_fractal_walk(G, H, ordNew) - G = interreduce_walk(H) - ordAlt = ordNew - currweight = w - end + R = base_ring(G) + G.isGB = true + w = currweight + ordAlt = G.ord + + # Handling the weight of the start order. + if (p == 1) + if !ismonomial(initials(G, w)) + global pStartWeights = [perturbed_vector(G, S, i) for i in 1:nvars(R)] + global firstStepMode = true + end + end + if firstStepMode + w = pStartWeights[p] + else + w = currweight + end + + # main loop + while true + t = next_weight_fractal_walk(G, w, pTargetWeights[p]) + + # Handling the final step in the current depth. + # next_weight_fractal_walk may return 0 if the target vector does not lie in the cone of T while G already defines the Groebner basis w.r.t. T. + # -> Checking if G is already a Groebner basis w.r.t. T solves this problem and reduces computational effort since next_weight_fractal_walk returns 1 in the last step on every local path. + if t == 1 && p != 1 + if same_cone(G, T) + @vprintln(:intermediate, "depth $p: in cone ", currweight, ".") + + # Check if a target weight of pTargetWeights[p] and pTargetWeights[p-1] lies in the wrong cone. + if !inCone(G, T, pTargetWeights, p) + global pTargetWeights = [perturbed_vector(G, T, i) for i in 1:nvars(R)] + @vprintln(:intermediate, "depth $p: not in cone ", pTargetWeights[p], ".") + end + return G + end + elseif t == [0] # The Groebner basis w.r.t. the target weight and T is already computed. + if inCone(G, T, pTargetWeights, p) + @vprintln(:intermediate,"depth $p: in cone ", pTargetWeights[p], ".") + return G + end + global pTargetWeights = [perturbed_vector(G, T, i) for i in 1:nvars(R)] + @vprintln(:intermediate,"depth $p: not in cone ", pTargetWeights[p], ".") + continue + end + + # skip a step for target monomial order lex. + if t == 1 && p == 1 + @vprintln(:intermediate,"depth $p: recursive call in ", pTargetWeights[p]) + return fractal_walk_combined(G, S, T, w, pTargetWeights, p + 1) + else + w = w + t * (pTargetWeights[p] - w) + w = convert_bounding_vector(w) + Gw = ideal(initials(G, w)) + + # handling the current weight with regards to Int32-entries. If an entry of w is bigger than Int32 use the Buchberger-algorithm. + if !checkInt32(w) + println( + "depth $p: Some entries of $w are bigger than Int32. Trying to find another weight,", + ) + w, b = truncw(G, w, gens(Gw)) + if !b + println("depth $p: Doing a direct conversion to the target monomial ordering.") + ordNew = matrix_ordering(R, T) + w = T[1, :] + G = groebner_basis( + ideal(G); ordering=ordNew, complete_reduction=true, algorithm=:buchberger + ) + + if !inCone(G, T, pTargetWeights, p) + global pTargetWeights = [perturbed_vector(G, T, i) for i in 1:nvars(R)] + @vprintln(:intermediate,"depth $p: not in cone ", pTargetWeights[p], ".") + end + return G + end + end + ordNew = create_order(R, w, T) + # converting the Groebner basis + if (p == nvars(R) || isbinomial(gens(Gw))) + H = groebner_basis( + Gw; ordering=ordNew, complete_reduction=true, algorithm=:buchberger + ) + + @vprintln(:intermediate,"depth $p: conversion in ", w, ".") + raise_step_counter() + else + @vprintln(:intermediate,"depth $p: recursive call in $w.") + H = fractal_walk_combined( + Oscar.IdealGens(R, gens(Gw), ordAlt), + S, + T, + deepcopy(currweight), + pTargetWeights, + p + 1, + ) + global firstStepMode = false + end + end + #H = liftGW2(G, ordAlt, Gw,H, ordNew) + H = lift_fractal_walk(G, H, ordNew) + G = interreduce_walk(H) + ordAlt = ordNew + currweight = w + end end ############################################################### @@ -537,317 +487,270 @@ end # This version checks if an entry of an intermediate weight vector is bigger than int32. In case of that the Buchberger-Algorithm is used to compute the Groebner basis of the ideal of the initialforms. ############################################################### -function fractal_walk( - G::Oscar.IdealGens, - S::Matrix{Int}, - T::Matrix{Int}, -) - if infoLevel >= 1 - println("FractalWalk_standard results") - println("Crossed Cones in: ") - end - - global pTargetWeights = - [perturbed_vector(G, T, i) for i ∈ 1:nvars(base_ring(G))] - return fractal_recursiv(G, S, T, S[1, :], pTargetWeights, 1) +function fractal_walk(G::Oscar.IdealGens, S::Matrix{Int}, T::Matrix{Int}) + @vprintln(:intermediate, "FractalWalk_standard results") + @vprintln(:intermediate, "Crossed Cones in: ") + + global pTargetWeights = [perturbed_vector(G, T, i) for i in 1:nvars(base_ring(G))] + return fractal_recursiv(G, S, T, S[1, :], pTargetWeights, 1) end function fractal_recursiv( - G::Oscar.IdealGens, - S::Matrix{Int}, - T::Matrix{Int}, - currweight::Vector{Int}, - pTargetWeights::Vector{Vector{Int}}, - p::Int, + G::Oscar.IdealGens, + S::Matrix{Int}, + T::Matrix{Int}, + currweight::Vector{Int}, + pTargetWeights::Vector{Vector{Int}}, + p::Int, ) - R = base_ring(G) - G.isGB = true - w = currweight - ordAlt = G.ord - while true - t = next_weight_fractal_walk(G, w, pTargetWeights[p]) - - # Handling the final step in the current depth. - # next_weight_fractal_walk may return 0 if the target vector does not lie in the cone of T while G already defines the Groebner basis w.r.t. T. - # -> Checking if G is already a Groebner basis w.r.t. T solves this problem and reduces computational effort since next_weight_fractal_walk returns 1 in the last step on every local path. if t == 1 && p != 1 - if t == 1 && p != 1 - if same_cone(G, T) - if infoLevel >= 1 - println("depth $p: in cone ", currweight, ".") - end - - # Check if a target weight of pTargetWeights[p] and pTargetWeights[p-1] lies in the wrong cone. - if !inCone(G, T, pTargetWeights, p) - global pTargetWeights = - [perturbed_vector(G, T, i) for i ∈ 1:nvars(R)] - if infoLevel >= 1 - println("depth $p: not in cone ", pTargetWeights[p], ".") - end - end - return G - end - elseif t == [0] # The Groebner basis w.r.t. the target weight and T is already computed. - if inCone(G, T, pTargetWeights, p) - if infoLevel >= 1 - println("depth $p: in cone ", pTargetWeights[p], ".") - end - return G - end - global pTargetWeights = - [perturbed_vector(G, T, i) for i ∈ 1:nvars(R)] - if infoLevel >= 1 - println("depth $p: not in cone ", pTargetWeights[p], ".") - end - continue - end - - w = w + t * (pTargetWeights[p] - w) - w = convert_bounding_vector(w) - Gw = ideal(initials(G, w)) - - # Handling the current weight with regards to Int32-entries. If an entry of w is bigger than Int32 use the Buchberger-algorithm. - if !checkInt32(w) - println("depth $p: Some entries of $w are bigger than Int32. Trying to find another weight,") - w, b = truncw(G, w, gens(Gw)) - if !b - println("depth $p: Doing a direct conversion to the target monomial ordering.") - ordNew = matrix_ordering(R, T) - w = T[1, :] - G = groebner_basis(Gw, ordering = ordNew, complete_reduction = true, algorithm = :buchberger) - - if !inCone(G, T, pTargetWeights, p) - global pTargetWeights = - [perturbed_vector(G, T, i) for i ∈ 1:nvars(R)] - if infoLevel >= 1 - println("depth $p: not in cone ", pTargetWeights[p], ".") - end - end - return G - end - end - ordNew = create_order(R, w, T) - # Converting the Groebner basis - if p == nvars(R) - H = groebner_basis(Gw, ordering = ordNew, complete_reduction = true, algorithm = :buchberger) - - if infoLevel >= 1 - println("depth $p: conversion in ", w, ".") - end - raise_step_counter() - else - if infoLevel >= 1 - println("depth $p: recursive call in $w.") - end - H = fractal_recursiv( - Oscar.IdealGens(R, gens(Gw), ordAlt), - S, - T, - deepcopy(currweight), - pTargetWeights, - p + 1, - ) - end - #H = liftGW2(G, R, Gw, H, Rn) - H = lift_fractal_walk(G, H, ordNew) - G = interreduce_walk(H) - ordAlt = ordNew - currweight = w - end + R = base_ring(G) + G.isGB = true + w = currweight + ordAlt = G.ord + while true + t = next_weight_fractal_walk(G, w, pTargetWeights[p]) + + # Handling the final step in the current depth. + # next_weight_fractal_walk may return 0 if the target vector does not lie in the cone of T while G already defines the Groebner basis w.r.t. T. + # -> Checking if G is already a Groebner basis w.r.t. T solves this problem and reduces computational effort since next_weight_fractal_walk returns 1 in the last step on every local path. if t == 1 && p != 1 + if t == 1 && p != 1 + if same_cone(G, T) + @vprintln(:intermediate,"depth $p: in cone ", currweight, ".") + + # Check if a target weight of pTargetWeights[p] and pTargetWeights[p-1] lies in the wrong cone. + if !inCone(G, T, pTargetWeights, p) + global pTargetWeights = [perturbed_vector(G, T, i) for i in 1:nvars(R)] + @vprintln(:intermediate,"depth $p: not in cone ", pTargetWeights[p], ".") + end + return G + end + elseif t == [0] # The Groebner basis w.r.t. the target weight and T is already computed. + if inCone(G, T, pTargetWeights, p) + @vprintln(:intermediate,"depth $p: in cone ", pTargetWeights[p], ".") + return G + end + global pTargetWeights = [perturbed_vector(G, T, i) for i in 1:nvars(R)] + @vprintln(:intermediate,"depth $p: not in cone ", pTargetWeights[p], ".") + continue + end + + w = w + t * (pTargetWeights[p] - w) + w = convert_bounding_vector(w) + Gw = ideal(initials(G, w)) + + # Handling the current weight with regards to Int32-entries. If an entry of w is bigger than Int32 use the Buchberger-algorithm. + if !checkInt32(w) + println( + "depth $p: Some entries of $w are bigger than Int32. Trying to find another weight," + ) + w, b = truncw(G, w, gens(Gw)) + if !b + println("depth $p: Doing a direct conversion to the target monomial ordering.") + ordNew = matrix_ordering(R, T) + w = T[1, :] + G = groebner_basis( + Gw; ordering=ordNew, complete_reduction=true, algorithm=:buchberger + ) + + if !inCone(G, T, pTargetWeights, p) + global pTargetWeights = [perturbed_vector(G, T, i) for i in 1:nvars(R)] + @vprintln(:intermediate,"depth $p: not in cone ", pTargetWeights[p], ".") + end + return G + end + end + ordNew = create_order(R, w, T) + # Converting the Groebner basis + if p == nvars(R) + H = groebner_basis( + Gw; ordering=ordNew, complete_reduction=true, algorithm=:buchberger + ) + + @vprintln(:intermediate,"depth $p: conversion in ", w, ".") + raise_step_counter() + else + @vprintln(:intermediate,"depth $p: recursive call in $w.") + H = fractal_recursiv( + Oscar.IdealGens(R, gens(Gw), ordAlt), + S, + T, + deepcopy(currweight), + pTargetWeights, + p + 1, + ) + end + #H = liftGW2(G, R, Gw, H, Rn) + H = lift_fractal_walk(G, H, ordNew) + G = interreduce_walk(H) + ordAlt = ordNew + currweight = w + end end ############################################################### # Extends the plain Fractal Walk by checking the start order. ############################################################### -function fractal_walk_start_order( - G::Oscar.IdealGens, - S::Matrix{Int}, - T::Matrix{Int}, -) - if infoLevel >= 1 - println("fractal_walk_withStartorder results") - println("Crossed Cones in: ") - end - - global pTargetWeights = - [perturbed_vector(G, T, i) for i ∈ 1:nvars(Singular.base_ring(G))] - return fractal_walk_recursiv_startorder( - G, - S, - T, - S[1, :], - pTargetWeights, - 1, - ) +function fractal_walk_start_order(G::Oscar.IdealGens, S::Matrix{Int}, T::Matrix{Int}) + @vprintln(:intermediate, "fractal_walk_withStartorder results") + @vprintln(:intermediate, "Crossed Cones in: ") + + + global pTargetWeights = [perturbed_vector(G, T, i) for i in 1:nvars( + Singular.base_ring(G) + )] + return fractal_walk_recursiv_startorder(G, S, T, S[1, :], pTargetWeights, 1) end function fractal_walk_recursiv_startorder( - G::Oscar.IdealGens, - S::Matrix{Int}, - T::Matrix{Int}, - currweight::Vector{Int}, - pTargetWeights::Vector{Vector{Int}}, - p::Int, + G::Oscar.IdealGens, + S::Matrix{Int}, + T::Matrix{Int}, + currweight::Vector{Int}, + pTargetWeights::Vector{Vector{Int}}, + p::Int, ) - R = base_ring(G) - G.isGB = true - ordAlt = G.ord - - # Handling the starting weight. - if (p == 1) - if !ismonomial(initials(G, currweight)) - global pStartWeights = [perturbed_vector(G, S, i) for i ∈ 1:nvars(R)] - global firstStepMode = true - end - end - if firstStepMode - w = pStartWeights[p] - else - w = currweight - end - - while true - t = next_weight_fractal_walk(G, w, pTargetWeights[p]) - - # Handling the final step in the current depth. - # next_weight_fractal_walk may return 0 if the target vector does not lie in the cone of T while G already defines the Groebner basis w.r.t. T. - # -> Checking if G is already a Groebner basis w.r.t. T solves this problem and reduces computational effort since next_weight_fractal_walk returns 1 in the last step on every local path. if t == 1 && p != 1 - if t == 1 && p != 1 - if same_cone(G, T) - if infoLevel >= 1 - println("depth $p: in cone ", currweight, ".") - end - - # Check if a target weight of pTargetWeights[p] and pTargetWeights[p-1] lies in the wrong cone. - if !inCone(G, T, pTargetWeights, p) - global pTargetWeights = - [perturbed_vector(G, T, i) for i ∈ 1:nvars(R)] - if infoLevel >= 1 - println("depth $p: not in cone ", pTargetWeights[p], ".") - end - end - return G - end - elseif t == [0] # The Groebner basis w.r.t. the target weight and T is already computed. - if inCone(G, T, pTargetWeights, p) - if infoLevel >= 1 - println("depth $p: in cone ", pTargetWeights[p], ".") - end - return G - end - global pTargetWeights = - [perturbed_vector(G, T, i) for i ∈ 1:nvars(R)] - if infoLevel >= 1 - println("depth $p: not in cone ", pTargetWeights[p], ".") - end - continue - end - - w = w + t * (pTargetWeights[p] - w) - w = convert_bounding_vector(w) - Gw = ideal(initials(G, w)) - - # Handling the current weight with regards to Int32-entries. If an entry of w is bigger than Int32 use the Buchberger-algorithm. - if !checkInt32(w) - w, b = truncw(G, w, gens(Gw)) - if !b - ordNew = matrix_ordering(R, T) - w = T[1, :] - G = groebner_basis(Gw, ordering = ordNew, complete_reduction = true, algorithm = :buchberger) - - if !inCone(G, T, pTargetWeights, p) - global pTargetWeights = - [perturbed_vector(G, T, i) for i ∈ 1:nvars(R)] - if infoLevel >= 1 - println("depth $p: not in cone ", pTargetWeights[p], ".") - end - end - return G - end - end - ordNew = create_order(R, w, T) - - # Converting the Groebner basis - if p == nvars(R) - H = groebner_basis(Gw, ordering = ordNew, complete_reduction = true, algorithm = :buchberger) - - if infoLevel >= 1 - println("depth $p: conversion in ", w, ".") - end - raise_step_counter() - else - if infoLevel >= 1 - println("depth $p: recursive call in $w.") - end - H = fractal_walk_recursiv_startorder( - Oscar.IdealGens(R, gens(Gw), ordAlt), - S, - T, - deepcopy(currweight), - pTargetWeights, - p + 1, - ) - global firstStepMode = false - end - #H = liftGW2(G, R, Gw, H, Rn) - H = lift_fractal_walk(G, H, ordNew) - G = interreduce_walk(H) - ordAlt = ordNew - currweight = w - end + R = base_ring(G) + G.isGB = true + ordAlt = G.ord + + # Handling the starting weight. + if (p == 1) + if !ismonomial(initials(G, currweight)) + global pStartWeights = [perturbed_vector(G, S, i) for i in 1:nvars(R)] + global firstStepMode = true + end + end + if firstStepMode + w = pStartWeights[p] + else + w = currweight + end + + while true + t = next_weight_fractal_walk(G, w, pTargetWeights[p]) + + # Handling the final step in the current depth. + # next_weight_fractal_walk may return 0 if the target vector does not lie in the cone of T while G already defines the Groebner basis w.r.t. T. + # -> Checking if G is already a Groebner basis w.r.t. T solves this problem and reduces computational effort since next_weight_fractal_walk returns 1 in the last step on every local path. if t == 1 && p != 1 + if t == 1 && p != 1 + if same_cone(G, T) + @vprintln(:intermediate, "depth $p: in cone ", currweight, ".") + + # Check if a target weight of pTargetWeights[p] and pTargetWeights[p-1] lies in the wrong cone. + if !inCone(G, T, pTargetWeights, p) + global pTargetWeights = [perturbed_vector(G, T, i) for i in 1:nvars(R)] + @vprintln(:intermediate, "depth $p: not in cone ", pTargetWeights[p], ".") + end + return G + end + elseif t == [0] # The Groebner basis w.r.t. the target weight and T is already computed. + if inCone(G, T, pTargetWeights, p) + @vprintln(:intermediate, "depth $p: in cone ", pTargetWeights[p], ".") + return G + end + global pTargetWeights = [perturbed_vector(G, T, i) for i in 1:nvars(R)] + @vprintln(:intermediate, "depth $p: not in cone ", pTargetWeights[p], ".") + continue + end + + w = w + t * (pTargetWeights[p] - w) + w = convert_bounding_vector(w) + Gw = ideal(initials(G, w)) + + # Handling the current weight with regards to Int32-entries. If an entry of w is bigger than Int32 use the Buchberger-algorithm. + if !checkInt32(w) + w, b = truncw(G, w, gens(Gw)) + if !b + ordNew = matrix_ordering(R, T) + w = T[1, :] + G = groebner_basis( + Gw; ordering=ordNew, complete_reduction=true, algorithm=:buchberger + ) + + if !inCone(G, T, pTargetWeights, p) + global pTargetWeights = [perturbed_vector(G, T, i) for i in 1:nvars(R)] + @vprintln(:intermediate, "depth $p: not in cone ", pTargetWeights[p], ".") + end + return G + end + end + ordNew = create_order(R, w, T) + + # Converting the Groebner basis + if p == nvars(R) + H = groebner_basis( + Gw; ordering=ordNew, complete_reduction=true, algorithm=:buchberger + ) + + @vprintln(:intermediate, "depth $p: conversion in ", w, ".") + raise_step_counter() + else + @vprintln(:intermediate, "depth $p: recursive call in $w.") + H = fractal_walk_recursiv_startorder( + Oscar.IdealGens(R, gens(Gw), ordAlt), + S, + T, + deepcopy(currweight), + pTargetWeights, + p + 1, + ) + global firstStepMode = false + end + #H = liftGW2(G, R, Gw, H, Rn) + H = lift_fractal_walk(G, H, ordNew) + G = interreduce_walk(H) + ordAlt = ordNew + currweight = w + end end - ############################################################### # Tran´s version of the Groebner Walk. # Returns the intermediate Groebner basis if an entry of an intermediate weight vector is bigger than int32. ############################################################### -function tran_walk( - G::Oscar.IdealGens, - S::Matrix{Int}, - T::Matrix{Int}, -) - if infoLevel >= 1 - println("tran_walk results") - println("Crossed Cones in: ") - end - currweight = S[1, :] - tarweight = T[1, :] - R = base_ring(G) - if !ismonomial(initials(G, currweight)) - currweight = perturbed_vector(G, S, nvars(R)) - end - - while true - w = next_weight(G, currweight, tarweight) - - # return the Groebner basis if an entry of w is bigger than int32. - if !checkInt32(w) - w, b = truncw(G, w, initials(G, w)) - !b && throw(error("Some entries of the intermediate weight-vector $w are bigger than int32. Choose an other algorithm instead.")) - end - if w == tarweight - if same_cone(G, T) - if infoLevel >= 1 - println("Cones crossed: ", counter) - end - return G - elseif inSeveralCones(initials(G, tarweight)) - tarweight = representation_vector(G, T) - continue - end - end - G = standard_step_without_int32_check(G, w, T) - if infoLevel >= 1 - println(w) - if infoLevel == 2 - println(G) - end - end - currweight = w - raise_step_counter() - end +function tran_walk(G::Oscar.IdealGens, S::Matrix{Int}, T::Matrix{Int}) + @vprintln(:intermediate, "tran_walk results") + @vprintln(:intermediate, "Crossed Cones in: ") + + currweight = S[1, :] + tarweight = T[1, :] + R = base_ring(G) + if !ismonomial(initials(G, currweight)) + currweight = perturbed_vector(G, S, nvars(R)) + end + + while true + w = next_weight(G, currweight, tarweight) + + # return the Groebner basis if an entry of w is bigger than int32. + if !checkInt32(w) + w, b = truncw(G, w, initials(G, w)) + !b && throw( + error( + "Some entries of the intermediate weight-vector $w are bigger than int32. Choose an other algorithm instead.", + ), + ) + end + if w == tarweight + if same_cone(G, T) + @vprintln(:intermediate, "Cones crossed: ", counter) + return G + elseif inSeveralCones(initials(G, tarweight)) + tarweight = representation_vector(G, T) + continue + end + end + G = standard_step_without_int32_check(G, w, T) + @vprintln(:intermediate, w) + if infoLevel == 2 + @vprintln(:detailed, G) + end + + currweight = w + raise_step_counter() + end end ############################################################### @@ -855,21 +758,20 @@ end ############################################################### function standard_step_without_int32_check( - G::Oscar.IdealGens, - w::Vector{Int}, - T::Matrix{Int}, + G::Oscar.IdealGens, w::Vector{Int}, T::Matrix{Int} ) - R = base_ring(G) - ordAlt = G.ord - ordNew = create_order(R, w, T) - Gw = initials(G, w) - H = groebner_basis(ideal(Gw), ordering = ordNew, complete_reduction = true, algorithm = :buchberger) - #H = liftGW2(G, R, Gw, H, Rn) - H = lift(G, ordAlt, H, ordNew) - return interreduce_walk(H) + R = base_ring(G) + ordAlt = G.ord + ordNew = create_order(R, w, T) + Gw = initials(G, w) + H = groebner_basis( + ideal(Gw); ordering=ordNew, complete_reduction=true, algorithm=:buchberger + ) + #H = liftGW2(G, R, Gw, H, Rn) + H = lift(G, ordAlt, H, ordNew) + return interreduce_walk(H) end - ################################################################# # Procedures of the fractal walk. # The fractal walk is proposed by Amrhein & Gloor (1998). @@ -877,134 +779,112 @@ end # lifts the Groebner basis G to the Groebner basis w.r.t. in the Fractal Walk like it´s done in Fukuda et. al (2005). function lift_fractal_walk( - G::Oscar.IdealGens, - H::Oscar.IdealGens, - orderingNew::MonomialOrdering, + G::Oscar.IdealGens, H::Oscar.IdealGens, orderingNew::MonomialOrdering ) - R = base_ring(G) - G.isGB = true - G = Oscar.IdealGens( - R, - [ - gen - - Oscar.IdealGens([reduce(gen, gens(G), ordering = G.ord, complete_reduction = true)], H.ord)[1] for - gen in gens(H) - ], - orderingNew, - ) - G.isGB = true - return G + R = base_ring(G) + G.isGB = true + G = Oscar.IdealGens( + R, + [ + gen - Oscar.IdealGens( + [reduce(gen, gens(G); ordering=G.ord, complete_reduction=true)], H.ord + )[1] for gen in gens(H) + ], + orderingNew, + ) + G.isGB = true + return G end # returns ´true´ if all polynomials of the given array are monomials. -function ismonomial(Gw::Vector{T}) where {T <: MPolyRingElem} - for g in Gw - if length(coefficients(g)) > 1 - return false - end - end - return true +function ismonomial(Gw::Vector{T}) where {T<:MPolyRingElem} + for g in Gw + if length(coefficients(g)) > 1 + return false + end + end + return true end # returns ´true´ if all polynomials of the given array are binomials or less. -function isbinomial(Gw::Vector{T}) where {T <: MPolyRingElem} - for g in Gw - if length(coefficients(g)) > 2 - return false - end - end - return true +function isbinomial(Gw::Vector{T}) where {T<:MPolyRingElem} + for g in Gw + if length(coefficients(g)) > 2 + return false + end + end + return true end # returns the next t to compute the next weight vector w(t) = w + t * (tw - w) like it´s done in Amrhein & Gloor (1998). This Method is NOT tested sufficiently. function nextT( - G::Oscar.IdealGens, - w::Array{T, 1}, - tw::Array{K, 1}, -) where {T <: Number, K <: Number} - if (w == tw) - return [0] - end - tmin = 2 - t = 0 - for g in gens(G) - a = Singular.leading_exponent_vector(g) - d = Singular.exponent_vectors(tail(g)) - for v in d - frac = (dot(w, a) - dot(w, v) + dot(tw, v) - dot(tw, a)) - if frac != 0 - t = (dot(w, a) - dot(w, v)) // frac - end - if t > 0 && t < tmin - tmin = t - end - end - end - if tmin <= 1 - return tmin - else - return [0] - end + G::Oscar.IdealGens, w::Array{T,1}, tw::Array{K,1} +) where {T<:Number,K<:Number} + if (w == tw) + return [0] + end + tmin = 2 + t = 0 + for g in gens(G) + a = Singular.leading_exponent_vector(g) + d = Singular.exponent_vectors(tail(g)) + for v in d + frac = (dot(w, a) - dot(w, v) + dot(tw, v) - dot(tw, a)) + if frac != 0 + t = (dot(w, a) - dot(w, v))//frac + end + if t > 0 && t < tmin + tmin = t + end + end + end + if tmin <= 1 + return tmin + else + return [0] + end end # returns the next t to compute the next weight vector w(t) = w + t * (tw - w) like it´s done in Cox, Little & O'Sheao (2005). function next_weight_fractal_walk( - G::Oscar.IdealGens, - cweight::Array{T, 1}, - tweight::Array{K, 1}, -) where {T <: Number, K <: Number} - if (cweight == tweight) - return [0] - end - tmin = 1 - for v in difference_lead_tail(G) - tw = dot(tweight, v) - if tw < 0 - cw = dot(cweight, v) - t = cw // (cw - tw) - if t < tmin - tmin = t - end - end - end - - # BigInt is needed to prevent overflows in the conversion of the weight vectors. - return BigInt(numerator(tmin)) // BigInt(denominator(tmin)) + G::Oscar.IdealGens, cweight::Array{T,1}, tweight::Array{K,1} +) where {T<:Number,K<:Number} + if (cweight == tweight) + return [0] + end + tmin = 1 + for v in difference_lead_tail(G) + tw = dot(tweight, v) + if tw < 0 + cw = dot(cweight, v) + t = cw//(cw - tw) + if t < tmin + tmin = t + end + end + end + + # BigInt is needed to prevent overflows in the conversion of the weight vectors. + return BigInt(numerator(tmin))//BigInt(denominator(tmin)) end # returns 'true' if the leading terms of G w.r.t the matrixordering T are the same as the leading terms of G w.r.t the weighted monomial ordering with weight vector of pvecs[p] (pvecs[p-1]) and the matrixordering T. -function inCone( - G::Oscar.IdealGens, - T::Matrix{Int}, - pvecs::Vector{Vector{Int}}, - p::Int, -) - # pvecs(1) equals the first row of T - if p == 1 - return true - end - ord = matrix_ordering(base_ring(G), T) - cvzip = zip( - gens(G), - initials(G, pvecs[p-1]), - initials(G, pvecs[p]), - ) - for (g, in, in2) in cvzip - if !isequal( - leading_term(g, ordering = ord), - leading_term(in, ordering = ord), - ) || - !isequal( - leading_term(g, ordering = ord), - leading_term(in2, ordering = ord), - ) - return false - end - end - return true +function inCone(G::Oscar.IdealGens, T::Matrix{Int}, pvecs::Vector{Vector{Int}}, p::Int) + # pvecs(1) equals the first row of T + if p == 1 + return true + end + ord = matrix_ordering(base_ring(G), T) + cvzip = zip(gens(G), initials(G, pvecs[p - 1]), initials(G, pvecs[p])) + for (g, in, in2) in cvzip + if !isequal(leading_term(g; ordering=ord), leading_term(in; ordering=ord)) || + !isequal(leading_term(g; ordering=ord), leading_term(in2; ordering=ord)) + return false + end + end + return true end - ################################################################# # Procedures of the generic walk. # The generic walk is proposed by Fukuda, Lauritzen & Thomas (2005). @@ -1012,240 +892,211 @@ end # returns the initials of the polynomials w.r.t. the vector v. function facet_initials( - G::Oscar.IdealGens, - lm::Vector{T}, - v::Vector{Int}, -) where {T <: MPolyRingElem} - Rn = parent(first(G)) - initials = Array{Singular.elem_type(Rn), 1}(undef, 0) - count = 1 - for g in G - inw = Singular.MPolyBuildCtx(Rn) - el = first(Singular.exponent_vectors(lm[count])) - for (e, c) in - zip(Singular.exponent_vectors(g), Singular.coefficients(g)) - if el == e || isparallel(el - e, v) - Singular.push_term!(inw, c, e) - end - end - h = finish(inw) - push!(initials, h) - count += 1 - end - return initials + G::Oscar.IdealGens, lm::Vector{T}, v::Vector{Int} +) where {T<:MPolyRingElem} + Rn = parent(first(G)) + initials = Array{Singular.elem_type(Rn),1}(undef, 0) + count = 1 + for g in G + inw = Singular.MPolyBuildCtx(Rn) + el = first(Singular.exponent_vectors(lm[count])) + for (e, c) in zip(Singular.exponent_vectors(g), Singular.coefficients(g)) + if el == e || isparallel(el - e, v) + Singular.push_term!(inw, c, e) + end + end + h = finish(inw) + push!(initials, h) + count += 1 + end + return initials end # returns the differences of the exponent vectors of the leading terms and the polynomials of the generators of I. function difference_lead_tail( - G::Oscar.IdealGens, - Lm::Vector{L}, - T::Union{Matrix{N}, MatElem{N}}, -) where {L <: MPolyRingElem, N} - v = Vector{Int}[] - for i ∈ 1:length(G) - ltu = collect(AbstractAlgebra.exponent_vectors(leading_term(Lm[i], ordering = matrix_ordering(base_ring(G), T))))[1] - for e in AbstractAlgebra.exponent_vectors(G[i]) - if ltu != e - push!(v, ltu .- e) - end - end - end - return unique!(v) + G::Oscar.IdealGens, Lm::Vector{L}, T::Union{Matrix{N},MatElem{N}} +) where {L<:MPolyRingElem,N} + v = Vector{Int}[] + for i in 1:length(G) + ltu = collect( + AbstractAlgebra.exponent_vectors( + leading_term(Lm[i]; ordering=matrix_ordering(base_ring(G), T)) + ), + )[1] + for e in AbstractAlgebra.exponent_vectors(G[i]) + if ltu != e + push!(v, ltu .- e) + end + end + end + return unique!(v) end # returns true if the vector u is parallel to the vector v. function isparallel(u::Vector{Int}, v::Vector{Int}) - count = 1 - x = 0 - for i ∈ 1:length(u) - if u[i] == 0 - if v[count] == 0 - count += +1 - else - return false - end - else - x = v[count] // u[i] - count += 1 - break - end - end - if count > length(v) - return true - end - for i ∈ count:length(v) - @inbounds if v[i] != x * u[i] - return false - end - end - return true + count = 1 + x = 0 + for i in 1:length(u) + if u[i] == 0 + if v[count] == 0 + count += +1 + else + return false + end + else + x = v[count]//u[i] + count += 1 + break + end + end + if count > length(v) + return true + end + for i in count:length(v) + @inbounds if v[i] != x * u[i] + return false + end + end + return true end # performs the lifting in the generic Walk like it´s proposed by Fukuda et al. (2005). function lift_generic( - G::Vector{T}, - Lm::Vector{T}, - H::Vector{T}, - ord::MonomialOrdering, -) where {T <: MPolyRingElem} - R = parent(first(G)) - Newlm = Array{elem_type(R), 1}(undef, 0) - liftPolys = Array{elem_type(R), 1}(undef, 0) - for g in H - push!(Newlm, leading_term(g, ordering = ord)) - push!(liftPolys, g - reduce_walk(g, G, Lm, ord)) - end - return liftPolys, Newlm + G::Vector{T}, Lm::Vector{T}, H::Vector{T}, ord::MonomialOrdering +) where {T<:MPolyRingElem} + R = parent(first(G)) + Newlm = Array{elem_type(R),1}(undef, 0) + liftPolys = Array{elem_type(R),1}(undef, 0) + for g in H + push!(Newlm, leading_term(g; ordering=ord)) + push!(liftPolys, g - reduce_walk(g, G, Lm, ord)) + end + return liftPolys, Newlm end # returns all v \in V if v<0 w.r.t. the ordering represented by T and v>0 w.r.t the ordering represented by S. function filter_by_ordering(S::Matrix{Int}, T::Matrix{Int}, V::Vector{Vector{Int}}) - btz = Set{Vector{Int}}() - for v in V - if less_than_zero(T, v) && bigger_than_zero(S, v) - push!(btz, v) - end - end - return btz + btz = Set{Vector{Int}}() + for v in V + if less_than_zero(T, v) && bigger_than_zero(S, v) + push!(btz, v) + end + end + return btz end # returns all v \in V if w0 w.r.t. the ordering M. function bigger_than_zero(M::Matrix{Int}, v::Vector{Int}) - nrows, ncols = size(M) - for i ∈ 1:nrows - d = 0 - for j ∈ 1:ncols - @inbounds d += M[i, j] * v[j] - end - if d != 0 - return d > 0 - end - end - return false + nrows, ncols = size(M) + for i in 1:nrows + d = 0 + for j in 1:ncols + @inbounds d += M[i, j] * v[j] + end + if d != 0 + return d > 0 + end + end + return false end # tests if v<0 w.r.t. the ordering M. function less_than_zero(M::Matrix{Int}, v::Vector{Int}) - nrows, ncols = size(M) - for i ∈ 1:nrows - d = 0 - for j ∈ 1:ncols - @inbounds d += M[i, j] * v[j] - end - if d != 0 - return d < 0 - end - end - return false + nrows, ncols = size(M) + for i in 1:nrows + d = 0 + for j in 1:ncols + @inbounds d += M[i, j] * v[j] + end + if d != 0 + return d < 0 + end + end + return false end # tests if u max - max = temp - end - end - push!(m, max) - end - msum = 0 - for i ∈ 2:p - msum += m[i] - end - maxdeg = 0 - for g in gens(G) - td = deg(g, n) - if (td > maxdeg) - maxdeg = td - end - end - e = maxdeg * msum + 1 - w = M[1, :] * e^(p - 1) - for i ∈ 2:p - w += e^(p - i) * M[i, :] - end - return convert_bounding_vector(w) + m = Int[] + n = size(M, 1) + for i in 1:p + max = M[i, 1] + for j in 1:n + temp = abs(M[i, j]) + if temp > max + max = temp + end + end + push!(m, max) + end + msum = 0 + for i in 2:p + msum += m[i] + end + maxdeg = 0 + for g in gens(G) + td = deg(g, n) + if (td > maxdeg) + maxdeg = td + end + end + e = maxdeg * msum + 1 + w = M[1, :] * e^(p - 1) + for i in 2:p + w += e^(p - i) * M[i, :] + end + return convert_bounding_vector(w) end # returns 'true' if the leading terms of G w.r.t the matrixorder T are the same as the leading terms of G w.r.t the weighted monomial order with weight vector t and matrix T. @@ -1390,137 +1232,129 @@ end # returns 'true' if the leading terms of G w.r.t the matrixordering T are the same as the leading terms of G with the current ordering. function same_cone(G::Oscar.IdealGens, T::Matrix{Int}) - R = base_ring(G) - ord = matrix_ordering(R, T) - for g in gens(G) - if leading_term(g, ordering = ord) != leading_term(g, ordering = G.ord) - return false - end - end - return true + R = base_ring(G) + ord = matrix_ordering(R, T) + for g in gens(G) + if leading_term(g; ordering=ord) != leading_term(g; ordering=G.ord) + return false + end + end + return true end # lifts the Groebner basis G to the Groebner basis w.r.t. the Ring Rn like it´s presented in Fukuda et al. (2005). function lift( - G::Oscar.IdealGens, - orderingAlt::MonomialOrdering, - H::Oscar.IdealGens, - ordering::MonomialOrdering, + G::Oscar.IdealGens, + orderingAlt::MonomialOrdering, + H::Oscar.IdealGens, + ordering::MonomialOrdering, ) - G = Oscar.IdealGens( - [ - gen - Oscar.IdealGens([reduce(gen, gens(G), ordering = orderingAlt, complete_reduction = true)], ordering)[1] - for gen in gens(H) - ], - ordering, - isGB = true, - ) - return G + G = Oscar.IdealGens( + [ + gen - Oscar.IdealGens( + [reduce(gen, gens(G); ordering=orderingAlt, complete_reduction=true)], ordering + )[1] for gen in gens(H) + ], + ordering; + isGB=true, + ) + return G end # lifts the Groebner basis G to the Groebner basis w.r.t. the Ring Rn like it´s done in Collart et al. (1997). # FIXME: Needs to be fixed. function liftGW2( - G::Oscar.IdealGens, - orderingAlt::MonomialOrdering, - inG::MPolyIdeal{T}, - H::Oscar.IdealGens, - ordering::MonomialOrdering, -) where {T <: MPolyRingElem} - H = gens(H) - R = base_ring(G) - G = gens(G) - for i ∈ 1:length(H) - q = divrem(gens(Oscar.IdealGens([H[i]], orderingAlt)), gens(inG)) - H[i] = R(0) - for j ∈ 1:length(gens(inG)) - println(gens(inG)[j]) - println(G[j]) - H[i] = H[i] + q[1][1][j] * G[j] - end - end - return Oscar.IdealGens(filter(!iszero, H), ordering) + G::Oscar.IdealGens, + orderingAlt::MonomialOrdering, + inG::MPolyIdeal{T}, + H::Oscar.IdealGens, + ordering::MonomialOrdering, +) where {T<:MPolyRingElem} + H = gens(H) + R = base_ring(G) + G = gens(G) + for i in 1:length(H) + q = divrem(gens(Oscar.IdealGens([H[i]], orderingAlt)), gens(inG)) + H[i] = R(0) + for j in 1:length(gens(inG)) + println(gens(inG)[j]) + println(G[j]) + H[i] = H[i] + q[1][1][j] * G[j] + end + end + return Oscar.IdealGens(filter(!iszero, H), ordering) end # divisionalgorithm that returns q with q_1*f_1 + ... + q_s *f_s=p. -function division_algorithm( - p::T, - f::Vector{T}, - R::MPolyRing, -) where {T <: MPolyRingElem} - q = Array{Singular.elem_type(R), 1}(undef, length(f)) - for i ∈ 1:length(f) - q[i] = R(0) - end - while !isequal(p, R(0)) - i = 1 - div = false - while (div == false && i <= length(f)) - b, m = divides(leading_term(p), leading_term(f[i])) - if b - q[i] = q[i] + m - p = p - (m * f[i]) - div = true - else - i = i + 1 - end - end - if div == false - p = p - leading_term(p) - end - end - return q +function division_algorithm(p::T, f::Vector{T}, R::MPolyRing) where {T<:MPolyRingElem} + q = Array{Singular.elem_type(R),1}(undef, length(f)) + for i in 1:length(f) + q[i] = R(0) + end + while !isequal(p, R(0)) + i = 1 + div = false + while (div == false && i <= length(f)) + b, m = divides(leading_term(p), leading_term(f[i])) + if b + q[i] = q[i] + m + p = p - (m * f[i]) + div = true + else + i = i + 1 + end + end + if div == false + p = p - leading_term(p) + end + end + return q end # converts a vector wtemp by dividing the entries with gcd(wtemp). -function convert_bounding_vector(wtemp::Vector{T}) where {T <: Rational{BigInt}} - w = Vector{Int}() - g = gcd(wtemp) - for i ∈ 1:length(wtemp) - push!(w, float(divexact(wtemp[i], g))) - end - return w +function convert_bounding_vector(wtemp::Vector{T}) where {T<:Rational{BigInt}} + w = Vector{Int}() + g = gcd(wtemp) + for i in 1:length(wtemp) + push!(w, float(divexact(wtemp[i], g))) + end + return w end # converts a vector wtemp by dividing the entries with gcd(wtemp). -function convert_bounding_vector(wtemp::Vector{T}) where {T <: Number} - w = Vector{Int}() - g = gcd(wtemp) - for i ∈ 1:length(wtemp) - push!(w, float(divexact(wtemp[i], g))) - end - return w +function convert_bounding_vector(wtemp::Vector{T}) where {T<:Number} + w = Vector{Int}() + g = gcd(wtemp) + for i in 1:length(wtemp) + push!(w, float(divexact(wtemp[i], g))) + end + return w end # returns a copy of the PolynomialRing I, equipped with the ordering weight_ordering(cw)*matrix_ordering(T). -function create_order( - R::MPolyRing, - cw::Array{L, 1}, - T::Matrix{Int}, -) where {L <: Number} - s = size(T) - if s[1] == s[2] - ord = weight_ordering(cw, matrix_ordering(R, T)) - elseif s[1] - s[2] == 1 - ord = weight_ordering(cw, - matrix_ordering(R, T)) - else - ord = weight_ordering(cw, - matrix_ordering(R, T), - ) - end - return ord +function create_order(R::MPolyRing, cw::Array{L,1}, T::Matrix{Int}) where {L<:Number} + s = size(T) + if s[1] == s[2] + ord = weight_ordering(cw, matrix_ordering(R, T)) + elseif s[1] - s[2] == 1 + ord = weight_ordering(cw, matrix_ordering(R, T)) + else + ord = weight_ordering(cw, matrix_ordering(R, T)) + end + return ord end # interreduces the Groebner basis G. function interreduce_walk(G::Oscar.IdealGens) - Rn = base_ring(G) - Generator = collect(gens(G)) - I = 0 - for i ∈ 1:length(gens(G)) - Generator[i] = reduce(Generator[i], Generator[1:end.!=i], ordering = G.ord, complete_reduction = true) - end - return Oscar.IdealGens(Generator, G.ord) + Rn = base_ring(G) + Generator = collect(gens(G)) + I = 0 + for i in 1:length(gens(G)) + Generator[i] = reduce( + Generator[i], Generator[1:end .!= i]; ordering=G.ord, complete_reduction=true + ) + end + return Oscar.IdealGens(Generator, G.ord) end ############################################# @@ -1528,197 +1362,197 @@ end ############################################# function ident_matrix(n::Int) - M = zeros(Int, n, n) - for i ∈ 1:n - M[i, i] = 1 - end - return M + M = zeros(Int, n, n) + for i in 1:n + M[i, i] = 1 + end + return M end function anti_diagonal_matrix(n::Int) - M = zeros(Int, n, n) - for i ∈ 1:n - M[i, n+1-i] = -1 - end - return M + M = zeros(Int, n, n) + for i in 1:n + M[i, n + 1 - i] = -1 + end + return M end # Singular.isequal depends on order of generators function equalitytest(G::Oscar.IdealGens, K::Oscar.IdealGens) - if length(gens(G)) != length(gens(K)) - return false - end - generators = Singular.gens(G) - count = 0 - for gen in generators - for r in Singular.gens(K) - if gen * first(coefficients(leading_term(r, ordering = G.ord))) - r * first(coefficients(leading_term(gen, ordering = G.ord))) == 0 - count += 1 - break - end - end - end - if count == length(gens(G)) - return true - end - return false + if length(gens(G)) != length(gens(K)) + return false + end + generators = Singular.gens(G) + count = 0 + for gen in generators + for r in Singular.gens(K) + if gen * first(coefficients(leading_term(r; ordering=G.ord))) - + r * first(coefficients(leading_term(gen; ordering=G.ord))) == 0 + count += 1 + break + end + end + end + if count == length(gens(G)) + return true + end + return false end function dot(v::Vector{Int}, w::Vector{Int}) - sum = 0 - for i ∈ 1:length(v) - @inbounds sum += v[i] * w[i] - end - return sum + sum = 0 + for i in 1:length(v) + @inbounds sum += v[i] * w[i] + end + return sum end function ordering_as_matrix(w::Vector{Int}, ord::Symbol) - if length(w) > 2 - if ord == :lex - return [ - w' - ident_matrix(length(w))[1:length(w)-1, :] - ] - end - if ord == :deglex - return [ - w' - ones(Int, length(w))' - ident_matrix(length(w))[1:length(w)-2, :] - ] - end - if ord == :degrevlex - return [ - w' - ones(Int, length(w))' - anti_diagonal_matrix(length(w))[1:length(w)-2, :] - ] - end - if ord == :revlex - return [ - w' - anti_diagonal_matrix(length(w))[1:length(w)-1, :] - ] - end - else - error("not implemented") - end + if length(w) > 2 + if ord == :lex + return [ + w' + ident_matrix(length(w))[1:(length(w) - 1), :] + ] + end + if ord == :deglex + return [ + w' + ones(Int, length(w))' + ident_matrix(length(w))[1:(length(w) - 2), :] + ] + end + if ord == :degrevlex + return [ + w' + ones(Int, length(w))' + anti_diagonal_matrix(length(w))[1:(length(w) - 2), :] + ] + end + if ord == :revlex + return [ + w' + anti_diagonal_matrix(length(w))[1:(length(w) - 1), :] + ] + end + else + error("not implemented") + end end function change_weight_vector(w::Vector{Int}, M::Matrix{Int}) - return [ - w' - M[2:length(w), :] - ] + return [ + w' + M[2:length(w), :] + ] end function insert_weight_vector(w::Vector{Int}, M::Matrix{Int}) - return [ - w' - M[1:length(w)-1, :] - ] + return [ + w' + M[1:(length(w) - 1), :] + ] end function add_weight_vector(w::Vector{Int}, M::Matrix{Int}) - return [ - w' - M - ] + return [ + w' + M + ] end function ordering_as_matrix(ord::Symbol, nvars::Int) - if ord == :lex - return ident_matrix(nvars) - end - if ord == :deglex - return [ - ones(Int, nvars)' - ident_matrix(nvars)[1:nvars-1, :] - ] - end - if ord == :degrevlex - return [ - ones(Int, nvars)' - anti_diagonal_matrix(nvars)[1:nvars-1, :] - ] - end - if ord == :revlex - return [ - w' - anti_diagonal_matrix(length(w))[1:length(w)-1, :] - ] - else - error("not implemented") - end + if ord == :lex + return ident_matrix(nvars) + end + if ord == :deglex + return [ + ones(Int, nvars)' + ident_matrix(nvars)[1:(nvars - 1), :] + ] + end + if ord == :degrevlex + return [ + ones(Int, nvars)' + anti_diagonal_matrix(nvars)[1:(nvars - 1), :] + ] + end + if ord == :revlex + return [ + w' + anti_diagonal_matrix(length(w))[1:(length(w) - 1), :] + ] + else + error("not implemented") + end end function deg(p::MPolyRingElem, n::Int) - max = 0 - for mon in Singular.monomials(p) - ev = Singular.exponent_vectors(mon) - sum = 0 - for e in ev - for i ∈ 1:n - sum += e[i] - end - if (max < sum) - max = sum - end - end - end - return max + max = 0 + for mon in Singular.monomials(p) + ev = Singular.exponent_vectors(mon) + sum = 0 + for e in ev + for i in 1:n + sum += e[i] + end + if (max < sum) + max = sum + end + end + end + return max end - function checkInt32(w::Vector{Int}) - for i ∈ 1:length(w) - if tryparse(Int32, string(w[i])) == nothing - return false - end - end - return true + for i in 1:length(w) + if tryparse(Int32, string(w[i])) == nothing + return false + end + end + return true end # computes the representation of the matrixorder defined by T. function representation_vector(G::Oscar.IdealGens, T::Matrix{Int}) - n = size(T)[1] - M = 0 - for i ∈ 1:n - for j ∈ 1:n - temp = T[i, j] - if M < temp - M = temp - end - end - end - d0 = 0 - for g in Singular.gens(G) - temp = deg(g, n) - if d0 < temp - d0 = temp - end - end - d = M * (2 * d0^2 + (n + 1) * d0) - w = d^(n - 1) * T[1, :] - for i ∈ 2:n - w = w + d^(n - i) * T[i, :] - end - return w + n = size(T)[1] + M = 0 + for i in 1:n + for j in 1:n + temp = T[i, j] + if M < temp + M = temp + end + end + end + d0 = 0 + for g in Singular.gens(G) + temp = deg(g, n) + if d0 < temp + d0 = temp + end + end + d = M * (2 * d0^2 + (n + 1) * d0) + w = d^(n - 1) * T[1, :] + for i in 2:n + w = w + d^(n - i) * T[i, :] + end + return w end # checks if Gw is an initialform of an ideal corresponding to a face of the Groebner fan with dimension less than n-1. -function inSeveralCones(Gw::Vector{T}) where {T <: MPolyRingElem} - counter = 0 - for g in Gw - if size(collect(Singular.coefficients(g)))[1] > 2 - return true - end - if size(collect(Singular.coefficients(g)))[1] == 2 - counter = counter + 1 - end - end - if counter > 1 - return true - end - return false +function inSeveralCones(Gw::Vector{T}) where {T<:MPolyRingElem} + counter = 0 + for g in Gw + if size(collect(Singular.coefficients(g)))[1] > 2 + return true + end + if size(collect(Singular.coefficients(g)))[1] == 2 + counter = counter + 1 + end + end + if counter > 1 + return true + end + return false end \ No newline at end of file From 86ad34b786023a34a5aa8bc43f19e879d3b1e624 Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Thu, 15 Feb 2024 10:02:00 +0100 Subject: [PATCH 003/179] Reformat docstring --- src/walk.jl | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/walk.jl b/src/walk.jl index 7b89fad5d46b..dc968ff0b3c8 100644 --- a/src/walk.jl +++ b/src/walk.jl @@ -88,13 +88,13 @@ function groebnerwalk( end @doc raw""" - groebnerwalk( - G::Oscar.IdealGens, - S::Union{Matrix{T}, MatElem{T}}, - T::Union{Matrix{T}, MatElem{T}}, - walktype::Symbol = :standard, - p::Int = 2 - ) where T + groebnerwalk( + G::Oscar.IdealGens, + S::Union{Matrix{T}, MatElem{T}}, + T::Union{Matrix{T}, MatElem{T}}, + walktype::Symbol = :standard, + p::Int = 2 + ) where T Computes a reduced Groebner basis w.r.t. the monomial order T by converting the reduced Groebner basis G w.r.t. the monomial order S using the Groebner Walk. One can choose a strategy of: Standard Walk (:standard) computes the Walk like it´s presented in Cox et al. (2005). From cd6df31f5858f04e8b8c6dc064bc8f386261486e Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Wed, 20 Mar 2024 12:24:06 +0100 Subject: [PATCH 004/179] Add GroebnerWalk as rudimentary experimental package --- src/GroebnerWalk.jl | 16 +++++++ src/walk.jl | 102 +++++++++++++++++++++----------------------- 2 files changed, 64 insertions(+), 54 deletions(-) diff --git a/src/GroebnerWalk.jl b/src/GroebnerWalk.jl index e69de29bb2d1..353355c23957 100644 --- a/src/GroebnerWalk.jl +++ b/src/GroebnerWalk.jl @@ -0,0 +1,16 @@ +module GroebnerWalk +using Oscar + +include("walk.jl") + +export groebner_walk + +function __init__() + add_verbosity_scope(:intermediate) + add_verbosity_scope(:detailed) + + set_verbosity_level(:intermediate, 1) + set_verbosity_level(:detailed, 2) +end + +end \ No newline at end of file diff --git a/src/walk.jl b/src/walk.jl index dc968ff0b3c8..287321963dda 100644 --- a/src/walk.jl +++ b/src/walk.jl @@ -1,18 +1,12 @@ global infoLevel = 0 -add_verbosity_scope(:intermediate) -add_verbosity_scope(:detailed) - -set_verbosity_level(:intermediate, 1); -set_verbosity_level(:detailed, 2); - ############################################################### # Implementation of different variants of the Groebner Walk. # The Groebner Walk is proposed by Collart, Kalkbrener & Mall (1997). ############################################################### @doc raw""" - groebnerwalk(I::MPolyIdeal; startOrder::MonomialOrdering = default_ordering(base_ring(I)), targetOrder::Symbol = lex(base_ring(I)), walktype::Symbol = :standard, perturbationDegree::Int = 2) + groebner_walk(I::MPolyIdeal; startOrder::MonomialOrdering = default_ordering(base_ring(I)), targetOrder::Symbol = lex(base_ring(I)), walktype::Symbol = :standard, perturbationDegree::Int = 2) Compute a reduced Groebner basis w.r.t. to a monomial order by converting it using the Groebner Walk. The Groebner Walk is proposed by Collart, Kalkbrener & Mall (1997). @@ -75,7 +69,7 @@ with respect to the ordering matrix_ordering([x, y], [1 0; 0 1]) ``` """ -function groebnerwalk( +function groebner_walk( I::MPolyIdeal, startOrder::MonomialOrdering=default_ordering(base_ring(I)), targetOrder::MonomialOrdering=lex(base_ring(I)), @@ -84,7 +78,7 @@ function groebnerwalk( ) S = canonical_matrix(startOrder) T = canonical_matrix(targetOrder) - return groebnerwalk(I, S, T, walktype, perturbationDegree) + return groebner_walk(I, S, T, walktype, perturbationDegree) end @doc raw""" @@ -158,7 +152,7 @@ with respect to the ordering matrix_ordering([x, y], [1 0; 0 1]) ``` """ -function groebnerwalk( +function groebner_walk( G::Union{Oscar.IdealGens,MPolyIdeal}, S::Union{Matrix{N},MatElem{N}}, T::Union{Matrix{N},MatElem{N}}, @@ -193,7 +187,7 @@ function groebnerwalk( ) Gb = walk(Gb) - @vprintln(:intermediate, "Cones crossed: ", delete_step_counter()) + # @vprintln :intermediate "Cones crossed: " delete_step_counter() return Oscar.IdealGens(gens(Gb), matrix_ordering(base_ring(G), T); isGB=true) end @@ -219,8 +213,8 @@ end ############################################################### function standard_walk(G::Oscar.IdealGens, S::Matrix{Int}, T::Matrix{Int}) - @vprintln(:intermediate, "standard_walk results") - @vprintln(:intermediate, "Crossed Cones in: ") + # @vprintln :intermediate "standard_walk results" + # @vprintln :intermediate "Crossed Cones in: " Gb = standard_walk(G, S, T, S[1, :], T[1, :]) @@ -243,9 +237,9 @@ function standard_walk( end if infoLevel >= 1 raise_step_counter() - @vprintln(:intermediate, currweight) + # @vprintln :intermediate currweight if infoLevel == 2 - @vprintln(:detailed, G) + # @vprintln :detailed G end end end @@ -286,17 +280,17 @@ function generic_walk(G::Oscar.IdealGens, S::Matrix{Int}, T::Matrix{Int}) v = next_gamma(G, Lm, [0], S, T) ordNew = matrix_ordering(base_ring(G), T) if infoLevel >= 1 - @vprintln(:intermediate, "generic_walk results") - @vprintln(:intermediate, "Facets crossed for: ") + @vprintln :intermediate "generic_walk results" + # @vprintln :intermediate "Facets crossed for: " end while !isempty(v) G, Lm = generic_step(G, Lm, v, ordNew) raise_step_counter() if infoLevel >= 1 - @vprintln(:intermediate, v) + # @vprintln :intermediate v if infoLevel == 2 - @vprintln(:detailed, G) + # @vprintln :detailed G end end G = Oscar.IdealGens(G, ordNew) @@ -322,8 +316,8 @@ end ############################################################### function perturbed_walk(G::Oscar.IdealGens, S::Matrix{Int}, T::Matrix{Int}, p::Int) - @vprintln(:intermediate, "perturbed_walk results") - @vprintln(:intermediate, "Crossed Cones in: ") + # @vprintln(:intermediate, "perturbed_walk results") + # @vprintln(:intermediate, "Crossed Cones in: ") currweight = perturbed_vector(G, S, p) @@ -361,8 +355,8 @@ firstStepMode = false # - checks if an entry of an intermediate weight vector is bigger than int32. In case of that the Buchberger-Algorithm is used to compute the Groebner basis of the ideal of the initialforms. ############################################################### function fractal_walk_combined(G::Oscar.IdealGens, S::Matrix{Int}, T::Matrix{Int}) - @vprintln(:intermediate, "fractal_walk_combined results") - @vprintln(:intermediate, "Crossed Cones in: ") + # @vprintln(:intermediate, "fractal_walk_combined results") + # @vprintln(:intermediate, "Crossed Cones in: ") global pTargetWeights = [perturbed_vector(G, T, i) for i in 1:nvars(base_ring(G))] return fractal_walk_combined(G, S, T, S[1, :], pTargetWeights, 1) @@ -403,28 +397,28 @@ function fractal_walk_combined( # -> Checking if G is already a Groebner basis w.r.t. T solves this problem and reduces computational effort since next_weight_fractal_walk returns 1 in the last step on every local path. if t == 1 && p != 1 if same_cone(G, T) - @vprintln(:intermediate, "depth $p: in cone ", currweight, ".") + # @vprintln(:intermediate, "depth $p: in cone ", currweight, ".") # Check if a target weight of pTargetWeights[p] and pTargetWeights[p-1] lies in the wrong cone. if !inCone(G, T, pTargetWeights, p) global pTargetWeights = [perturbed_vector(G, T, i) for i in 1:nvars(R)] - @vprintln(:intermediate, "depth $p: not in cone ", pTargetWeights[p], ".") + # @vprintln(:intermediate, "depth $p: not in cone ", pTargetWeights[p], ".") end return G end elseif t == [0] # The Groebner basis w.r.t. the target weight and T is already computed. if inCone(G, T, pTargetWeights, p) - @vprintln(:intermediate,"depth $p: in cone ", pTargetWeights[p], ".") + # @vprintln(:intermediate,"depth $p: in cone ", pTargetWeights[p], ".") return G end global pTargetWeights = [perturbed_vector(G, T, i) for i in 1:nvars(R)] - @vprintln(:intermediate,"depth $p: not in cone ", pTargetWeights[p], ".") + # @vprintln(:intermediate,"depth $p: not in cone ", pTargetWeights[p], ".") continue end # skip a step for target monomial order lex. if t == 1 && p == 1 - @vprintln(:intermediate,"depth $p: recursive call in ", pTargetWeights[p]) + # @vprintln(:intermediate,"depth $p: recursive call in ", pTargetWeights[p]) return fractal_walk_combined(G, S, T, w, pTargetWeights, p + 1) else w = w + t * (pTargetWeights[p] - w) @@ -447,7 +441,7 @@ function fractal_walk_combined( if !inCone(G, T, pTargetWeights, p) global pTargetWeights = [perturbed_vector(G, T, i) for i in 1:nvars(R)] - @vprintln(:intermediate,"depth $p: not in cone ", pTargetWeights[p], ".") + # @vprintln(:intermediate,"depth $p: not in cone ", pTargetWeights[p], ".") end return G end @@ -459,10 +453,10 @@ function fractal_walk_combined( Gw; ordering=ordNew, complete_reduction=true, algorithm=:buchberger ) - @vprintln(:intermediate,"depth $p: conversion in ", w, ".") + # @vprintln(:intermediate,"depth $p: conversion in ", w, ".") raise_step_counter() else - @vprintln(:intermediate,"depth $p: recursive call in $w.") + # @vprintln(:intermediate,"depth $p: recursive call in $w.") H = fractal_walk_combined( Oscar.IdealGens(R, gens(Gw), ordAlt), S, @@ -488,8 +482,8 @@ end ############################################################### function fractal_walk(G::Oscar.IdealGens, S::Matrix{Int}, T::Matrix{Int}) - @vprintln(:intermediate, "FractalWalk_standard results") - @vprintln(:intermediate, "Crossed Cones in: ") + # @vprintln(:intermediate, "FractalWalk_standard results") + # @vprintln(:intermediate, "Crossed Cones in: ") global pTargetWeights = [perturbed_vector(G, T, i) for i in 1:nvars(base_ring(G))] return fractal_recursiv(G, S, T, S[1, :], pTargetWeights, 1) @@ -515,22 +509,22 @@ function fractal_recursiv( # -> Checking if G is already a Groebner basis w.r.t. T solves this problem and reduces computational effort since next_weight_fractal_walk returns 1 in the last step on every local path. if t == 1 && p != 1 if t == 1 && p != 1 if same_cone(G, T) - @vprintln(:intermediate,"depth $p: in cone ", currweight, ".") + # @vprintln(:intermediate,"depth $p: in cone ", currweight, ".") # Check if a target weight of pTargetWeights[p] and pTargetWeights[p-1] lies in the wrong cone. if !inCone(G, T, pTargetWeights, p) global pTargetWeights = [perturbed_vector(G, T, i) for i in 1:nvars(R)] - @vprintln(:intermediate,"depth $p: not in cone ", pTargetWeights[p], ".") + # @vprintln(:intermediate,"depth $p: not in cone ", pTargetWeights[p], ".") end return G end elseif t == [0] # The Groebner basis w.r.t. the target weight and T is already computed. if inCone(G, T, pTargetWeights, p) - @vprintln(:intermediate,"depth $p: in cone ", pTargetWeights[p], ".") + # @vprintln(:intermediate,"depth $p: in cone ", pTargetWeights[p], ".") return G end global pTargetWeights = [perturbed_vector(G, T, i) for i in 1:nvars(R)] - @vprintln(:intermediate,"depth $p: not in cone ", pTargetWeights[p], ".") + # @vprintln(:intermediate,"depth $p: not in cone ", pTargetWeights[p], ".") continue end @@ -554,7 +548,7 @@ function fractal_recursiv( if !inCone(G, T, pTargetWeights, p) global pTargetWeights = [perturbed_vector(G, T, i) for i in 1:nvars(R)] - @vprintln(:intermediate,"depth $p: not in cone ", pTargetWeights[p], ".") + # @vprintln(:intermediate,"depth $p: not in cone ", pTargetWeights[p], ".") end return G end @@ -566,10 +560,10 @@ function fractal_recursiv( Gw; ordering=ordNew, complete_reduction=true, algorithm=:buchberger ) - @vprintln(:intermediate,"depth $p: conversion in ", w, ".") + # @vprintln(:intermediate,"depth $p: conversion in ", w, ".") raise_step_counter() else - @vprintln(:intermediate,"depth $p: recursive call in $w.") + # @vprintln(:intermediate,"depth $p: recursive call in $w.") H = fractal_recursiv( Oscar.IdealGens(R, gens(Gw), ordAlt), S, @@ -592,8 +586,8 @@ end ############################################################### function fractal_walk_start_order(G::Oscar.IdealGens, S::Matrix{Int}, T::Matrix{Int}) - @vprintln(:intermediate, "fractal_walk_withStartorder results") - @vprintln(:intermediate, "Crossed Cones in: ") + # @vprintln(:intermediate, "fractal_walk_withStartorder results") + # @vprintln(:intermediate, "Crossed Cones in: ") global pTargetWeights = [perturbed_vector(G, T, i) for i in 1:nvars( @@ -635,22 +629,22 @@ function fractal_walk_recursiv_startorder( # -> Checking if G is already a Groebner basis w.r.t. T solves this problem and reduces computational effort since next_weight_fractal_walk returns 1 in the last step on every local path. if t == 1 && p != 1 if t == 1 && p != 1 if same_cone(G, T) - @vprintln(:intermediate, "depth $p: in cone ", currweight, ".") + # @vprintln(:intermediate, "depth $p: in cone ", currweight, ".") # Check if a target weight of pTargetWeights[p] and pTargetWeights[p-1] lies in the wrong cone. if !inCone(G, T, pTargetWeights, p) global pTargetWeights = [perturbed_vector(G, T, i) for i in 1:nvars(R)] - @vprintln(:intermediate, "depth $p: not in cone ", pTargetWeights[p], ".") + # @vprintln(:intermediate, "depth $p: not in cone ", pTargetWeights[p], ".") end return G end elseif t == [0] # The Groebner basis w.r.t. the target weight and T is already computed. if inCone(G, T, pTargetWeights, p) - @vprintln(:intermediate, "depth $p: in cone ", pTargetWeights[p], ".") + # @vprintln(:intermediate, "depth $p: in cone ", pTargetWeights[p], ".") return G end global pTargetWeights = [perturbed_vector(G, T, i) for i in 1:nvars(R)] - @vprintln(:intermediate, "depth $p: not in cone ", pTargetWeights[p], ".") + # @vprintln(:intermediate, "depth $p: not in cone ", pTargetWeights[p], ".") continue end @@ -670,7 +664,7 @@ function fractal_walk_recursiv_startorder( if !inCone(G, T, pTargetWeights, p) global pTargetWeights = [perturbed_vector(G, T, i) for i in 1:nvars(R)] - @vprintln(:intermediate, "depth $p: not in cone ", pTargetWeights[p], ".") + # @vprintln(:intermediate, "depth $p: not in cone ", pTargetWeights[p], ".") end return G end @@ -683,10 +677,10 @@ function fractal_walk_recursiv_startorder( Gw; ordering=ordNew, complete_reduction=true, algorithm=:buchberger ) - @vprintln(:intermediate, "depth $p: conversion in ", w, ".") + # @vprintln(:intermediate, "depth $p: conversion in ", w, ".") raise_step_counter() else - @vprintln(:intermediate, "depth $p: recursive call in $w.") + # @vprintln(:intermediate, "depth $p: recursive call in $w.") H = fractal_walk_recursiv_startorder( Oscar.IdealGens(R, gens(Gw), ordAlt), S, @@ -711,8 +705,8 @@ end ############################################################### function tran_walk(G::Oscar.IdealGens, S::Matrix{Int}, T::Matrix{Int}) - @vprintln(:intermediate, "tran_walk results") - @vprintln(:intermediate, "Crossed Cones in: ") + # @vprintln(:intermediate, "tran_walk results") + # @vprintln(:intermediate, "Crossed Cones in: ") currweight = S[1, :] tarweight = T[1, :] @@ -735,7 +729,7 @@ function tran_walk(G::Oscar.IdealGens, S::Matrix{Int}, T::Matrix{Int}) end if w == tarweight if same_cone(G, T) - @vprintln(:intermediate, "Cones crossed: ", counter) + # @vprintln(:intermediate, "Cones crossed: ", counter) return G elseif inSeveralCones(initials(G, tarweight)) tarweight = representation_vector(G, T) @@ -743,9 +737,9 @@ function tran_walk(G::Oscar.IdealGens, S::Matrix{Int}, T::Matrix{Int}) end end G = standard_step_without_int32_check(G, w, T) - @vprintln(:intermediate, w) + # @vprintln(:intermediate, w) if infoLevel == 2 - @vprintln(:detailed, G) + # @vprintln(:detailed, G) end currweight = w From fa2026874b13878effeea06aa5d937b89506b5cf Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Wed, 20 Mar 2024 12:25:48 +0100 Subject: [PATCH 005/179] Fix identation in docstring --- src/walk.jl | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/walk.jl b/src/walk.jl index 287321963dda..4e5238a08af4 100644 --- a/src/walk.jl +++ b/src/walk.jl @@ -6,7 +6,13 @@ global infoLevel = 0 # The Groebner Walk is proposed by Collart, Kalkbrener & Mall (1997). ############################################################### @doc raw""" - groebner_walk(I::MPolyIdeal; startOrder::MonomialOrdering = default_ordering(base_ring(I)), targetOrder::Symbol = lex(base_ring(I)), walktype::Symbol = :standard, perturbationDegree::Int = 2) + groebner_walk( + I::MPolyIdeal; + startOrder::MonomialOrdering = default_ordering(base_ring(I)), + targetOrder::Symbol = lex(base_ring(I)), + walktype::Symbol = :standard, + perturbationDegree::Int = 2 + ) Compute a reduced Groebner basis w.r.t. to a monomial order by converting it using the Groebner Walk. The Groebner Walk is proposed by Collart, Kalkbrener & Mall (1997). From a5c6eca3ca1fe3fb29436baa0f5a47bb3fa30905 Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Wed, 20 Mar 2024 12:31:06 +0100 Subject: [PATCH 006/179] Fix doctest --- src/walk.jl | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/src/walk.jl b/src/walk.jl index 4e5238a08af4..1f1a9c8562a3 100644 --- a/src/walk.jl +++ b/src/walk.jl @@ -41,33 +41,18 @@ Standard Walk (:standard) computes the Walk like it´s presented in Cox, Little # Examples ```jldoctest -julia> R,(x,y) = polynomial_ring(QQ, ["x","y"], ordering = :degrevlex); +julia> R,(x,y) = polynomial_ring(QQ, ["x","y"]); julia> I = ideal([y^4+ x^3-x^2+x,x^4]); -julia> groebnerwalk(I, degrevlex(R), lex(R), :standard) -standard_walk results -Crossed Cones in: -[4, 3] -[4, 1] -[12, 1] -[1, 0] -Cones crossed: 4 +julia> groebner_walk(I, degrevlex(R), lex(R), :standard) Gröbner basis with elements 1 -> y^16 2 -> x + y^12 - y^8 + y^4 with respect to the ordering matrix_ordering([x, y], [1 0; 0 1]) -julia> groebnerwalk(I, degrevlex(R), lex(R), :perturbed, 2) -perturbed_walk results -Crossed Cones in: -[4, 3] -[4, 1] -[5, 1] -[12, 1] -[1, 0] -Cones crossed: 5 +julia> groebner_walk(I, degrevlex(R), lex(R), :perturbed, 2) Gröbner basis with elements 1 -> y^16 2 -> x + y^12 - y^8 + y^4 From b1166bd12ce088e24148d22027158edf0e142085 Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Wed, 20 Mar 2024 13:45:03 +0100 Subject: [PATCH 007/179] Add problematic example that does not work (for now) --- examples/problematic_example_1.jl | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 examples/problematic_example_1.jl diff --git a/examples/problematic_example_1.jl b/examples/problematic_example_1.jl new file mode 100644 index 000000000000..47f3265db654 --- /dev/null +++ b/examples/problematic_example_1.jl @@ -0,0 +1,15 @@ +using Oscar +using Oscar.GroebnerWalk + +R, (x,y,z,u,v) = polynomial_ring(QQ, ["x","y","z","u","v"]) + +o1 = weight_ordering([1,1,1,0,0], degrevlex(R)) +o2 = weight_ordering([0,0,0,1,1], degrevlex(R)) + +I1 = ideal([ + u + u^2 - 2*v - 2*u^2*v + 2*u*v^2 - x, + -6*u + 2*v + v^2 - 5*v^3 + 2*u*v^2 - 4*u^2*v^2 - y, + -2 + 2*u^2 + 6*v - 3*u^2*v^2 - z +]) + +groebner_walk(I1, o1, o2) \ No newline at end of file From 931ccdb76b7a3543980d2a49ed319ebf53775bdc Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Wed, 20 Mar 2024 13:56:03 +0100 Subject: [PATCH 008/179] Rename verbosity_scope for this module --- src/walk.jl | 52 +++++++++++++++++++++++++--------------------------- 1 file changed, 25 insertions(+), 27 deletions(-) diff --git a/src/walk.jl b/src/walk.jl index 1f1a9c8562a3..4372b2f9a2f4 100644 --- a/src/walk.jl +++ b/src/walk.jl @@ -62,10 +62,10 @@ matrix_ordering([x, y], [1 0; 0 1]) """ function groebner_walk( I::MPolyIdeal, - startOrder::MonomialOrdering=default_ordering(base_ring(I)), - targetOrder::MonomialOrdering=lex(base_ring(I)), - walktype::Symbol=:standard, - perturbationDegree::Int=2, + startOrder::MonomialOrdering = default_ordering(base_ring(I)), + targetOrder::MonomialOrdering = lex(base_ring(I)), + walktype::Symbol = :standard, + perturbationDegree = 2, ) S = canonical_matrix(startOrder) T = canonical_matrix(targetOrder) @@ -73,12 +73,12 @@ function groebner_walk( end @doc raw""" - groebnerwalk( + groebner_walk( G::Oscar.IdealGens, S::Union{Matrix{T}, MatElem{T}}, T::Union{Matrix{T}, MatElem{T}}, walktype::Symbol = :standard, - p::Int = 2 + perturbationDegree::Int = 2 ) where T Computes a reduced Groebner basis w.r.t. the monomial order T by converting the reduced Groebner basis G w.r.t. the monomial order S using the Groebner Walk. One can choose a strategy of: @@ -178,7 +178,8 @@ function groebner_walk( ) Gb = walk(Gb) - # @vprintln :intermediate "Cones crossed: " delete_step_counter() + @vprintln :groebner_walk "Cones crossed: " + delete_step_counter() return Oscar.IdealGens(gens(Gb), matrix_ordering(base_ring(G), T); isGB=true) end @@ -204,8 +205,8 @@ end ############################################################### function standard_walk(G::Oscar.IdealGens, S::Matrix{Int}, T::Matrix{Int}) - # @vprintln :intermediate "standard_walk results" - # @vprintln :intermediate "Crossed Cones in: " + @vprintln :groebner_walk "standard_walk results" + @vprintln :groebner_walk "Crossed Cones in: " Gb = standard_walk(G, S, T, S[1, :], T[1, :]) @@ -228,11 +229,10 @@ function standard_walk( end if infoLevel >= 1 raise_step_counter() - # @vprintln :intermediate currweight - if infoLevel == 2 - # @vprintln :detailed G - end end + + @vprintln :groebner_walk currweight + @vprintln :groebner_walk 2 G end end @@ -270,20 +270,18 @@ function generic_walk(G::Oscar.IdealGens, S::Matrix{Int}, T::Matrix{Int}) Lm = [leading_term(g; ordering=matrix_ordering(base_ring(G), S)) for g in G] v = next_gamma(G, Lm, [0], S, T) ordNew = matrix_ordering(base_ring(G), T) - if infoLevel >= 1 - @vprintln :intermediate "generic_walk results" - # @vprintln :intermediate "Facets crossed for: " - end + + @vprintln :groebner_walk "generic_walk results" + @vprintln :groebner_walk "Facets crossed for: " + while !isempty(v) G, Lm = generic_step(G, Lm, v, ordNew) raise_step_counter() - if infoLevel >= 1 - # @vprintln :intermediate v - if infoLevel == 2 - # @vprintln :detailed G - end - end + + @vprintln :groebner_walk v + @vprintln :groebner_walk 2 G + G = Oscar.IdealGens(G, ordNew) v = next_gamma(G, Lm, v, S, T) end @@ -307,8 +305,8 @@ end ############################################################### function perturbed_walk(G::Oscar.IdealGens, S::Matrix{Int}, T::Matrix{Int}, p::Int) - # @vprintln(:intermediate, "perturbed_walk results") - # @vprintln(:intermediate, "Crossed Cones in: ") + @vprintln :groebner_walk "perturbed_walk results" + @vprintln :groebner_walk "Crossed Cones in: " currweight = perturbed_vector(G, S, p) @@ -346,8 +344,8 @@ firstStepMode = false # - checks if an entry of an intermediate weight vector is bigger than int32. In case of that the Buchberger-Algorithm is used to compute the Groebner basis of the ideal of the initialforms. ############################################################### function fractal_walk_combined(G::Oscar.IdealGens, S::Matrix{Int}, T::Matrix{Int}) - # @vprintln(:intermediate, "fractal_walk_combined results") - # @vprintln(:intermediate, "Crossed Cones in: ") + @vprintln :groebner_walk "fractal_walk_combined results" + @vprintln :groebner_walk "Crossed Cones in: " global pTargetWeights = [perturbed_vector(G, T, i) for i in 1:nvars(base_ring(G))] return fractal_walk_combined(G, S, T, S[1, :], pTargetWeights, 1) From 4272841790f27878667645a5781ada8bdb44d26a Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Wed, 20 Mar 2024 13:56:42 +0100 Subject: [PATCH 009/179] Change to getter --- src/walk.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/walk.jl b/src/walk.jl index 4372b2f9a2f4..536192c748a4 100644 --- a/src/walk.jl +++ b/src/walk.jl @@ -242,7 +242,7 @@ end function standard_step(G::Oscar.IdealGens, w::Vector{Int}, T::Matrix{Int}) R = base_ring(G) - ordAlt = G.ord + ordAlt = ordering(G) Gw = 0 #check if no entry of w is bigger than Int32. If it´s bigger multiply it by 0.1 and round. From 5822ed5b9837c3a316d9e8eae7330a8c149d7376 Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Wed, 20 Mar 2024 14:27:53 +0100 Subject: [PATCH 010/179] Phase out `global infoLevel` --- src/walk.jl | 81 ++++++++++++++++++++++++++--------------------------- 1 file changed, 40 insertions(+), 41 deletions(-) diff --git a/src/walk.jl b/src/walk.jl index 536192c748a4..d1a07c8d1579 100644 --- a/src/walk.jl +++ b/src/walk.jl @@ -279,8 +279,8 @@ function generic_walk(G::Oscar.IdealGens, S::Matrix{Int}, T::Matrix{Int}) raise_step_counter() - @vprintln :groebner_walk v - @vprintln :groebner_walk 2 G + @vprintln :groebner_walk v + @vprintln :groebner_walk 2 G G = Oscar.IdealGens(G, ordNew) v = next_gamma(G, Lm, v, S, T) @@ -386,28 +386,28 @@ function fractal_walk_combined( # -> Checking if G is already a Groebner basis w.r.t. T solves this problem and reduces computational effort since next_weight_fractal_walk returns 1 in the last step on every local path. if t == 1 && p != 1 if same_cone(G, T) - # @vprintln(:intermediate, "depth $p: in cone ", currweight, ".") + @vprintln :groebner_walk ("depth $p: in cone ", currweight, ".")... # Check if a target weight of pTargetWeights[p] and pTargetWeights[p-1] lies in the wrong cone. if !inCone(G, T, pTargetWeights, p) global pTargetWeights = [perturbed_vector(G, T, i) for i in 1:nvars(R)] - # @vprintln(:intermediate, "depth $p: not in cone ", pTargetWeights[p], ".") + @vprintln :groebner_walk ("depth $p: not in cone ", pTargetWeights[p], ".")... end return G end elseif t == [0] # The Groebner basis w.r.t. the target weight and T is already computed. if inCone(G, T, pTargetWeights, p) - # @vprintln(:intermediate,"depth $p: in cone ", pTargetWeights[p], ".") + @vprintln :groebner_walk ("depth $p: in cone ", pTargetWeights[p], ".")... return G end global pTargetWeights = [perturbed_vector(G, T, i) for i in 1:nvars(R)] - # @vprintln(:intermediate,"depth $p: not in cone ", pTargetWeights[p], ".") + @vprintln :groebner_walk ("depth $p: not in cone ", pTargetWeights[p], ".")... continue end # skip a step for target monomial order lex. if t == 1 && p == 1 - # @vprintln(:intermediate,"depth $p: recursive call in ", pTargetWeights[p]) + @vprintln :groebner_walk ("depth $p: recursive call in ", pTargetWeights[p])... return fractal_walk_combined(G, S, T, w, pTargetWeights, p + 1) else w = w + t * (pTargetWeights[p] - w) @@ -430,7 +430,7 @@ function fractal_walk_combined( if !inCone(G, T, pTargetWeights, p) global pTargetWeights = [perturbed_vector(G, T, i) for i in 1:nvars(R)] - # @vprintln(:intermediate,"depth $p: not in cone ", pTargetWeights[p], ".") + @vprintln :groebner_walk ("depth $p: not in cone ", pTargetWeights[p], ".")... end return G end @@ -442,10 +442,10 @@ function fractal_walk_combined( Gw; ordering=ordNew, complete_reduction=true, algorithm=:buchberger ) - # @vprintln(:intermediate,"depth $p: conversion in ", w, ".") + @vprintln :groebner_walk ("depth $p: conversion in ", w, ".")... raise_step_counter() else - # @vprintln(:intermediate,"depth $p: recursive call in $w.") + @vprintln :groebner_walk "depth $p: recursive call in $w." H = fractal_walk_combined( Oscar.IdealGens(R, gens(Gw), ordAlt), S, @@ -471,14 +471,14 @@ end ############################################################### function fractal_walk(G::Oscar.IdealGens, S::Matrix{Int}, T::Matrix{Int}) - # @vprintln(:intermediate, "FractalWalk_standard results") - # @vprintln(:intermediate, "Crossed Cones in: ") + @vprintln :groebner_walk "FractalWalk_standard results" + @vprintln :groebner_walk "Crossed Cones in: " global pTargetWeights = [perturbed_vector(G, T, i) for i in 1:nvars(base_ring(G))] - return fractal_recursiv(G, S, T, S[1, :], pTargetWeights, 1) + return fractal_recursion_step(G, S, T, S[1, :], pTargetWeights, 1) end -function fractal_recursiv( +function fractal_recursion_step( G::Oscar.IdealGens, S::Matrix{Int}, T::Matrix{Int}, @@ -498,22 +498,22 @@ function fractal_recursiv( # -> Checking if G is already a Groebner basis w.r.t. T solves this problem and reduces computational effort since next_weight_fractal_walk returns 1 in the last step on every local path. if t == 1 && p != 1 if t == 1 && p != 1 if same_cone(G, T) - # @vprintln(:intermediate,"depth $p: in cone ", currweight, ".") + @vprintln :groebner_walk ("depth $p: in cone ", currweight, ".")... # Check if a target weight of pTargetWeights[p] and pTargetWeights[p-1] lies in the wrong cone. if !inCone(G, T, pTargetWeights, p) global pTargetWeights = [perturbed_vector(G, T, i) for i in 1:nvars(R)] - # @vprintln(:intermediate,"depth $p: not in cone ", pTargetWeights[p], ".") + @vprintln :groebner_walk ("depth $p: not in cone ", pTargetWeights[p], ".")... end return G end elseif t == [0] # The Groebner basis w.r.t. the target weight and T is already computed. if inCone(G, T, pTargetWeights, p) - # @vprintln(:intermediate,"depth $p: in cone ", pTargetWeights[p], ".") + @vprintln :groebner_walk ("depth $p: in cone ", pTargetWeights[p], ".")... return G end global pTargetWeights = [perturbed_vector(G, T, i) for i in 1:nvars(R)] - # @vprintln(:intermediate,"depth $p: not in cone ", pTargetWeights[p], ".") + @vprintln :groebner_walk ("depth $p: not in cone ", pTargetWeights[p], ".")... continue end @@ -537,7 +537,7 @@ function fractal_recursiv( if !inCone(G, T, pTargetWeights, p) global pTargetWeights = [perturbed_vector(G, T, i) for i in 1:nvars(R)] - # @vprintln(:intermediate,"depth $p: not in cone ", pTargetWeights[p], ".") + @vprintln :groebner_walk ("depth $p: not in cone ", pTargetWeights[p], ".")... end return G end @@ -549,11 +549,11 @@ function fractal_recursiv( Gw; ordering=ordNew, complete_reduction=true, algorithm=:buchberger ) - # @vprintln(:intermediate,"depth $p: conversion in ", w, ".") + @vprintln :groebner_walk ("depth $p: conversion in ", w, ".")... raise_step_counter() else - # @vprintln(:intermediate,"depth $p: recursive call in $w.") - H = fractal_recursiv( + @vprintln :groebner_walk "depth $p: recursive call in $w." + H = fractal_recursion_step( Oscar.IdealGens(R, gens(Gw), ordAlt), S, T, @@ -575,17 +575,17 @@ end ############################################################### function fractal_walk_start_order(G::Oscar.IdealGens, S::Matrix{Int}, T::Matrix{Int}) - # @vprintln(:intermediate, "fractal_walk_withStartorder results") - # @vprintln(:intermediate, "Crossed Cones in: ") + @vprintln :groebner_walk "fractal_walk_withStartorder results" + @vprintln :groebner_walk "Crossed Cones in: " global pTargetWeights = [perturbed_vector(G, T, i) for i in 1:nvars( Singular.base_ring(G) )] - return fractal_walk_recursiv_startorder(G, S, T, S[1, :], pTargetWeights, 1) + return fractal_walk_recursive_startorder(G, S, T, S[1, :], pTargetWeights, 1) end -function fractal_walk_recursiv_startorder( +function fractal_walk_recursive_startorder( G::Oscar.IdealGens, S::Matrix{Int}, T::Matrix{Int}, @@ -618,22 +618,22 @@ function fractal_walk_recursiv_startorder( # -> Checking if G is already a Groebner basis w.r.t. T solves this problem and reduces computational effort since next_weight_fractal_walk returns 1 in the last step on every local path. if t == 1 && p != 1 if t == 1 && p != 1 if same_cone(G, T) - # @vprintln(:intermediate, "depth $p: in cone ", currweight, ".") + @vprintln :groebner_walk ("depth $p: in cone ", currweight, ".")... # Check if a target weight of pTargetWeights[p] and pTargetWeights[p-1] lies in the wrong cone. if !inCone(G, T, pTargetWeights, p) global pTargetWeights = [perturbed_vector(G, T, i) for i in 1:nvars(R)] - # @vprintln(:intermediate, "depth $p: not in cone ", pTargetWeights[p], ".") + @vprintln :groebner_walk ("depth $p: not in cone ", pTargetWeights[p], ".")... end return G end elseif t == [0] # The Groebner basis w.r.t. the target weight and T is already computed. if inCone(G, T, pTargetWeights, p) - # @vprintln(:intermediate, "depth $p: in cone ", pTargetWeights[p], ".") + @vprintln :groebner_walk ("depth $p: in cone ", pTargetWeights[p], ".")... return G end global pTargetWeights = [perturbed_vector(G, T, i) for i in 1:nvars(R)] - # @vprintln(:intermediate, "depth $p: not in cone ", pTargetWeights[p], ".") + @vprintln :groebner_walk ("depth $p: not in cone ", pTargetWeights[p], ".")... continue end @@ -653,7 +653,7 @@ function fractal_walk_recursiv_startorder( if !inCone(G, T, pTargetWeights, p) global pTargetWeights = [perturbed_vector(G, T, i) for i in 1:nvars(R)] - # @vprintln(:intermediate, "depth $p: not in cone ", pTargetWeights[p], ".") + @vprintln :groebner_walk ("depth $p: not in cone ", pTargetWeights[p], ".")... end return G end @@ -666,11 +666,11 @@ function fractal_walk_recursiv_startorder( Gw; ordering=ordNew, complete_reduction=true, algorithm=:buchberger ) - # @vprintln(:intermediate, "depth $p: conversion in ", w, ".") + @vprintln :groebner_walk ("depth $p: conversion in ", w, ".")... raise_step_counter() else - # @vprintln(:intermediate, "depth $p: recursive call in $w.") - H = fractal_walk_recursiv_startorder( + @vprintln :groebner_walk "depth $p: recursive call in $w." + H = fractal_walk_recursive_startorder( Oscar.IdealGens(R, gens(Gw), ordAlt), S, T, @@ -694,8 +694,8 @@ end ############################################################### function tran_walk(G::Oscar.IdealGens, S::Matrix{Int}, T::Matrix{Int}) - # @vprintln(:intermediate, "tran_walk results") - # @vprintln(:intermediate, "Crossed Cones in: ") + @vprintln :groebner_walk "tran_walk results" + @vprintln :groebner_walk "Crossed Cones in: " currweight = S[1, :] tarweight = T[1, :] @@ -718,7 +718,7 @@ function tran_walk(G::Oscar.IdealGens, S::Matrix{Int}, T::Matrix{Int}) end if w == tarweight if same_cone(G, T) - # @vprintln(:intermediate, "Cones crossed: ", counter) + @vprintln :groebner_walk ("Cones crossed: ", counter)... return G elseif inSeveralCones(initials(G, tarweight)) tarweight = representation_vector(G, T) @@ -726,10 +726,9 @@ function tran_walk(G::Oscar.IdealGens, S::Matrix{Int}, T::Matrix{Int}) end end G = standard_step_without_int32_check(G, w, T) - # @vprintln(:intermediate, w) - if infoLevel == 2 - # @vprintln(:detailed, G) - end + + @vprintln :groebner_walk w + @vprintln :groebner_walk 2 G currweight = w raise_step_counter() From 795b1d4f4454f21ecbcc1700052c7e5469826af7 Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Thu, 21 Mar 2024 02:13:37 +0100 Subject: [PATCH 011/179] Reduce redundant docstrings --- src/walk.jl | 82 ++++++++++++++++------------------------------------- 1 file changed, 24 insertions(+), 58 deletions(-) diff --git a/src/walk.jl b/src/walk.jl index d1a07c8d1579..ee18e4eab8d9 100644 --- a/src/walk.jl +++ b/src/walk.jl @@ -13,19 +13,27 @@ global infoLevel = 0 walktype::Symbol = :standard, perturbationDegree::Int = 2 ) + groebner_walk( + G::Oscar.IdealGens, + startOrder::Union{Matrix{N}, MatElem{N}}, + targetOrder::Union{Matrix{N}, MatElem{N}}, + walktype::Symbol = :standard, + perturbationDegree::Int = 2 + ) where N Compute a reduced Groebner basis w.r.t. to a monomial order by converting it using the Groebner Walk. The Groebner Walk is proposed by Collart, Kalkbrener & Mall (1997). One can choose a strategy of: -Standard Walk (:standard) computes the Walk like it´s presented in Cox, Little & O´Shea (2005). +- Standard Walk (:standard) computes the Walk like as presented in Cox, Little & O´Shea (2005). - Generic Walk (:generic) computes the Walk as presented in Fukuda, Jensen, Lauritzen & Thomas (2005). - Perturbed Walk (:perturbed, with p = degree of the perturbation) computes the Walk ass presented in Amrhein, Gloor & Küchlin (1997). - Tran's Walk (:tran) computes the Walk like as presented in Tran (2000). - Fractal Walk (:fractalcombined) computes the Walk like as presented in Amrhein & Gloor (1998) with multiple extensions. The target monomial order has to be lex. This version uses the Buchberger algorithm to skip weight vectors with entries bigger than Int32. - Fractal Walk (:fractal) computes the Walk as presented in Amrhein & Gloor (1998). Perturbs only the target vector. -#Arguments -- `G::Oscar.IdealGens`: ideal one wants to compute a Groebner basis for. +# Arguments +- `I::MPolyIdeal`: ideal one wants to compute a Groebner basis for. +- `G::Oscar.IdealGens`: generators of an ideal one wants to compute a Groebner basis for. - `startOrder::MonomialOrdering=:degrevlex`: monomial order to begin the conversion. - `targetOrder::MonomialOrdering=:lex`: monomial order one wants to compute a Groebner basis for. - `walktype::Symbol=standard`: strategy of the Groebner Walk. One can choose a strategy of: @@ -37,7 +45,6 @@ Standard Walk (:standard) computes the Walk like it´s presented in Cox, Little - `fractalcombined`: combined Version of the Fractal Walk. Target monomial order needs to be lex, - `perturbationDegree::Int=2`: perturbationdegree for the perturbed Walk. - # Examples ```jldoctest @@ -58,60 +65,6 @@ Gröbner basis with elements 2 -> x + y^12 - y^8 + y^4 with respect to the ordering matrix_ordering([x, y], [1 0; 0 1]) -``` -""" -function groebner_walk( - I::MPolyIdeal, - startOrder::MonomialOrdering = default_ordering(base_ring(I)), - targetOrder::MonomialOrdering = lex(base_ring(I)), - walktype::Symbol = :standard, - perturbationDegree = 2, -) - S = canonical_matrix(startOrder) - T = canonical_matrix(targetOrder) - return groebner_walk(I, S, T, walktype, perturbationDegree) -end - -@doc raw""" - groebner_walk( - G::Oscar.IdealGens, - S::Union{Matrix{T}, MatElem{T}}, - T::Union{Matrix{T}, MatElem{T}}, - walktype::Symbol = :standard, - perturbationDegree::Int = 2 - ) where T -Computes a reduced Groebner basis w.r.t. the monomial order T by converting the reduced Groebner basis G w.r.t. the monomial order S using the Groebner Walk. -One can choose a strategy of: -Standard Walk (:standard) computes the Walk like it´s presented in Cox et al. (2005). -Generic Walk (:generic) computes the Walk like it´s presented in Fukuda et al. (2005). -Perturbed Walk (:perturbed, with p = degree of the perturbation) computes the Walk like it´s presented in Amrhein et al. (1997). -Tran´s Walk (:tran) computes the Walk like it´s presented in Tran (2000). -Fractal Walk (:fractal) computes the Walk like it´s presented in Amrhein & Gloor (1998). Pertubes only the target vector. -Fractal Walk (:fractalcombined) computes the Walk like it´s presented in Amrhein & Gloor (1998) with multiple extensions. The target monomial order has to be lex. This version uses the Buchberger Algorithm to skip weightvectors with entries bigger than Int32. -Set infoLevel to trace the walk: - -'infoLevel=0': no detailed printout, - -'infoLevel=1': adds intermediate weight vectors, - -'infoLevel=2': adds information about the Groebner basis. - -#Arguments --`G::Oscar.IdealGens`: Groebner basis to convert to the Groebner basis w.r.t. the target order T. G needs to be a Groebner basis w.r.t. the start order S. --`S::Union{Matrix{N}, MatElem{N}}`: start monomial order w.r.t. the Groebner basis G. Note that S has to be a nxn-matrix with rank(S)=n and its first row needs to have positive entries. --`T::Union{Matrix{N}, MatElem{N}}`: target monomial order one wants to compute a Groebner basis for. Note that T has to be a nxn-matrix with rank(T)=n and its first row needs to have positive entries. --`walktype::Symbol=standard`: strategy of the Groebner Walk. One can choose a strategy of: - - `standard`: Standard Walk (default), - - `perturbed`: Perturbed Walk, - - `tran`: Tran´s Walk, - - `generic`: Generic Walk, - - `fractal`: standard-version of the Fractal Walk, - - `fractalcombined`: combined version of the Fractal Walk. The target monomial order needs to be lex, --`p::Int=2`: perturbationdegree for the perturbed Walk. - -# Examples - -```jldoctest -julia> R,(x,y) = polynomial_ring(QQ, ["x","y"], ordering = :degrevlex); - -julia> I = ideal([y^4+ x^3-x^2+x,x^4]); julia> groebnerwalk(I, [1 1; 0 -1], [1 0; 0 1], :standard) standard_walk results @@ -143,6 +96,19 @@ with respect to the ordering matrix_ordering([x, y], [1 0; 0 1]) ``` """ +function groebner_walk( + I::MPolyIdeal, + startOrder::MonomialOrdering = default_ordering(base_ring(I)), + targetOrder::MonomialOrdering = lex(base_ring(I)), + walktype::Symbol = :standard, + perturbationDegree = 2 +) + S = canonical_matrix(startOrder) + T = canonical_matrix(targetOrder) + + return groebner_walk(I, S, T, walktype, perturbationDegree) +end + function groebner_walk( G::Union{Oscar.IdealGens,MPolyIdeal}, S::Union{Matrix{N},MatElem{N}}, From a65b60bcd34141b426b343804e93941a117bb8d9 Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Thu, 21 Mar 2024 02:21:47 +0100 Subject: [PATCH 012/179] Replace manual computation of maximum --- src/walk.jl | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/src/walk.jl b/src/walk.jl index ee18e4eab8d9..c66542a52c34 100644 --- a/src/walk.jl +++ b/src/walk.jl @@ -1464,22 +1464,10 @@ end # computes the representation of the matrixorder defined by T. function representation_vector(G::Oscar.IdealGens, T::Matrix{Int}) n = size(T)[1] - M = 0 - for i in 1:n - for j in 1:n - temp = T[i, j] - if M < temp - M = temp - end - end - end - d0 = 0 - for g in Singular.gens(G) - temp = deg(g, n) - if d0 < temp - d0 = temp - end - end + M = maximum(T) + + d0 = maximum(g -> deg(g, n), gens(g)) + d = M * (2 * d0^2 + (n + 1) * d0) w = d^(n - 1) * T[1, :] for i in 2:n From 6dfc46f6f38e9fee85fff5e9cbc3c42d78363515 Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Thu, 21 Mar 2024 02:22:14 +0100 Subject: [PATCH 013/179] Add verbosity scope for `groebner_walk` --- src/GroebnerWalk.jl | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/GroebnerWalk.jl b/src/GroebnerWalk.jl index 353355c23957..e512feb4fc88 100644 --- a/src/GroebnerWalk.jl +++ b/src/GroebnerWalk.jl @@ -6,11 +6,9 @@ include("walk.jl") export groebner_walk function __init__() - add_verbosity_scope(:intermediate) - add_verbosity_scope(:detailed) + add_verbosity_scope(:groebner_walk) - set_verbosity_level(:intermediate, 1) - set_verbosity_level(:detailed, 2) + set_verbosity_level(:groebner_walk, 0) end end \ No newline at end of file From c5b7eee052d1e585972cef6dd5cd313157b9123c Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Thu, 21 Mar 2024 20:31:42 +0100 Subject: [PATCH 014/179] Rework `initials` into `initial_form` --- src/walk.jl | 36 +++++++++++++++++------------------- 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/src/walk.jl b/src/walk.jl index c66542a52c34..b222744c4d78 100644 --- a/src/walk.jl +++ b/src/walk.jl @@ -1086,29 +1086,27 @@ function truncw(G::Oscar.IdealGens, w::Vector{Int}, inw::Vector{T}) where {T<:MP end # returns the initialform of G w.r.t. the given weight vector. -function initials(G::Oscar.IdealGens, w::Vector{Int}) - R = base_ring(G) - inits = elem_type(R)[] - for g in gens(G) - inw = MPolyBuildCtx(R) - maxw = 0 - eczip = zip(AbstractAlgebra.exponent_vectors(g), coefficients(g)) - for (e, c) in eczip - tmpw = dot(w, e) - if maxw == tmpw - push_term!(inw, c, e) - elseif maxw < tmpw - inw = MPolyBuildCtx(R) - push_term!(inw, c, e) - maxw = tmpw - end +function initial_form(f::MPolyRingElem, w::Vector{ZZRingElem}) + R = parent(f) + + ctx = MPolyBuildCtx(R) + + exponent_vectors = exponent_vector.(monomials(f), Ref(1)) + WE = dot.(Ref(w), Vector{ZZRingElem}.(exponent_vectors)) + maxw = maximum(WE) + + for (e,c, we) in zip(exponent_vectors, coefficients(f), WE) + if we == maxw + push_term!(ctx, c, e) end - h = finish(inw) - push!(inits, h) end - return inits + + return finish(ctx) end +initial_forms(G::Oscar.IdealGens, w::Vector{ZZRingElem}) = initial_form.(G, Ref(w)) +initial_forms(G::Oscar.IdealGens, w::Vector{Int}) = initial_form.(G, Ref(ZZ.(w))) + function difference_lead_tail(I::Oscar.IdealGens) v = Vector{Int}[] for g in gens(I) From 1c1eabb257184aea414fed603f0379e81bb2edca Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Thu, 21 Mar 2024 21:00:15 +0100 Subject: [PATCH 015/179] Simplify `standard_step` --- src/walk.jl | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/src/walk.jl b/src/walk.jl index b222744c4d78..c8535a97b94f 100644 --- a/src/walk.jl +++ b/src/walk.jl @@ -206,28 +206,18 @@ end # The standard step is used for the strategies standard and perturbed. ############################################################### -function standard_step(G::Oscar.IdealGens, w::Vector{Int}, T::Matrix{Int}) +function standard_step(G::Oscar.IdealGens, w::Vector{ZZRingElem}, target_ordering::MonomialOrdering) R = base_ring(G) - ordAlt = ordering(G) - Gw = 0 + current_ordering = ordering(G) + + Gw = ideal(initial_forms(G,w)) + H = groebner_basis(Gw; ordering=target_ordering, complete_reduction=true) |> (x->lift(G, current_ordering, x, target_ordering)) - #check if no entry of w is bigger than Int32. If it´s bigger multiply it by 0.1 and round. - if !checkInt32(w) - Gw = ideal(initials(G, w)) - w, b = truncw(G, w, gens(Gw)) - !b && throw( - error("Some entries of the intermediate weight-vector $w are bigger than int32") - ) - else - Gw = ideal(initials(G, w)) - end - ordNew = create_order(R, w, T) - H = groebner_basis(Gw; ordering=ordNew, complete_reduction=true, algorithm=:buchberger) - #H = liftGW2(G, ordAlt, Gw, H, ordNew) - H = lift(G, ordAlt, H, ordNew) return interreduce_walk(H) end +standard_step(G::Oscar.IdealGens, w::Vector{Int}, T::Matrix{Int}) = standard_step(G, ZZ.(w), create_order(base_ring(G), w, T)) + ############################################################### # Generic-version of the Groebner Walk. ############################################################### From 1374f3fc450cd79c20693b4407fad2007007f56f Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Thu, 21 Mar 2024 23:41:25 +0100 Subject: [PATCH 016/179] Reduce amount of Matrix<->MonomialOrdering conversions --- src/walk.jl | 139 +++++++++++++++++++++++++++++----------------------- 1 file changed, 77 insertions(+), 62 deletions(-) diff --git a/src/walk.jl b/src/walk.jl index c8535a97b94f..b08b536174e3 100644 --- a/src/walk.jl +++ b/src/walk.jl @@ -97,6 +97,7 @@ matrix_ordering([x, y], [1 0; 0 1]) ``` """ function groebner_walk( + ::Type{Int}, I::MPolyIdeal, startOrder::MonomialOrdering = default_ordering(base_ring(I)), targetOrder::MonomialOrdering = lex(base_ring(I)), @@ -109,6 +110,28 @@ function groebner_walk( return groebner_walk(I, S, T, walktype, perturbationDegree) end +function groebner_walk( + I::MPolyIdeal, + start_ordering::MonomialOrdering = default_ordering(base_ring(I)), + target_ordering::MonomialOrdering = lex(base_ring(I)), + walk_type::Symbol = :standard, + perturbationDegree = 2 +) + if walk_type == :standard + walk = (x) -> standard_walk(x, start_ordering, target_ordering) + else + throw(NotImplementedError(:groebner_walk, walk_type)) + end + + Gb = groebner_basis(I; ordering=start_ordering, complete_reduction=true) + Gb = walk(Gb) + + # @vprintln :groebner_walk "Cones crossed: " + # delete_step_counter() + + return Oscar.IdealGens(gens(Gb), target_ordering; isGB=true) +end + function groebner_walk( G::Union{Oscar.IdealGens,MPolyIdeal}, S::Union{Matrix{N},MatElem{N}}, @@ -170,34 +193,50 @@ end # Implementation of the standard walk. ############################################################### -function standard_walk(G::Oscar.IdealGens, S::Matrix{Int}, T::Matrix{Int}) - @vprintln :groebner_walk "standard_walk results" - @vprintln :groebner_walk "Crossed Cones in: " - - Gb = standard_walk(G, S, T, S[1, :], T[1, :]) +function standard_walk( + G::Oscar.IdealGens, + start_ordering::MonomialOrdering, + target_ordering::MonomialOrdering +) + + start_weight = canonical_matrix(start_ordering)[1,:] + target_weight = canonical_matrix(target_ordering)[1,:] - return Gb + return standard_walk(G, start_ordering, target_ordering, start_weight, target_weight) end +standard_walk(G::Oscar.IdealGens, S::ZZMatrix, T::ZZMatrix) = standard_walk( + G, + matrix_ordering(base_ring(G), S), + matrix_ordering(base_ring(G), T), + S[1, :], + T[1, :] +) + function standard_walk( G::Oscar.IdealGens, - S::Matrix{Int}, - T::Matrix{Int}, - currweight::Vector{Int}, - tarweight::Vector{Int}, + start_ordering::MonomialOrdering, + target_ordering::MonomialOrdering, + current_weight::Vector{ZZRingElem}, + target_weight::Vector{ZZRingElem} ) + @vprintln :groebner_walk "Results for standard_walk" + @vprintln :groebner_walk "Crossed Cones in: " + while true - G = standard_step(G, currweight, T) - if currweight == tarweight + G = standard_step(G, current_weight, target_ordering) + + if current_weight == target_weight return G else - currweight = next_weight(G, currweight, tarweight) + current_weight = next_weight(G, current_weight, target_weight) end + if infoLevel >= 1 raise_step_counter() end - @vprintln :groebner_walk currweight + @vprintln :groebner_walk current_weight @vprintln :groebner_walk 2 G end end @@ -209,14 +248,20 @@ end function standard_step(G::Oscar.IdealGens, w::Vector{ZZRingElem}, target_ordering::MonomialOrdering) R = base_ring(G) current_ordering = ordering(G) + next_ordering = weight_ordering(w, target_ordering) Gw = ideal(initial_forms(G,w)) - H = groebner_basis(Gw; ordering=target_ordering, complete_reduction=true) |> (x->lift(G, current_ordering, x, target_ordering)) + + H = groebner_basis(Gw; ordering=next_ordering, complete_reduction=true) + H = lift(G, current_ordering, H, next_ordering) + + @vprintln :groebner_walk 3 Gw + @vprintln :groebner_walk 3 H return interreduce_walk(H) end -standard_step(G::Oscar.IdealGens, w::Vector{Int}, T::Matrix{Int}) = standard_step(G, ZZ.(w), create_order(base_ring(G), w, T)) +standard_step(G::Oscar.IdealGens, w::Vector{Int}, T::Matrix{Int}) = standard_step(G, ZZ.(w), create_ordering(base_ring(G), w, T)) ############################################################### # Generic-version of the Groebner Walk. @@ -1042,21 +1087,13 @@ end ############################################################### # returns the next intermediate weight vector. -function next_weight(G::Oscar.IdealGens, cw::Vector{Int}, tw::Vector{Int}) - tmin = 1 - for v in difference_lead_tail(G) - tdotw = dot(tw, v) - if tdotw < 0 - cdotw = dot(cw, v) - t = cdotw//(cdotw - tdotw) - if t < tmin - tmin = t - end - end - end - return convert_bounding_vector( - cw + BigInt(numerator(tmin))//BigInt(denominator(tmin)) * (tw - cw) - ) +function next_weight(G::Oscar.IdealGens, cw::Vector{ZZRingElem}, tw::Vector{ZZRingElem}) + V = difference_lead_tail(G) + tmin = minimum(c//(c-t) for (c,t) in zip(dot.(Ref(cw), V), dot.(Ref(tw), V)) if t<0; init=1) + + @vprintln :groebner_walk 3 (QQ.(cw) + tmin * QQ.(tw-cw)) + + return QQ.(cw) + tmin * QQ.(tw-cw) |> convert_bounding_vector end # multiplies every entry of the given weight w with 0.1 as long as it stays on the same halfspace as w. @@ -1085,7 +1122,7 @@ function initial_form(f::MPolyRingElem, w::Vector{ZZRingElem}) WE = dot.(Ref(w), Vector{ZZRingElem}.(exponent_vectors)) maxw = maximum(WE) - for (e,c, we) in zip(exponent_vectors, coefficients(f), WE) + for (e,c,we) in zip(exponent_vectors, coefficients(f), WE) if we == maxw push_term!(ctx, c, e) end @@ -1178,22 +1215,24 @@ function same_cone(G::Oscar.IdealGens, T::Matrix{Int}) return true end -# lifts the Groebner basis G to the Groebner basis w.r.t. the Ring Rn like it´s presented in Fukuda et al. (2005). +# TODO: Actual docstring +# lifts the Groebner basis G to the Groebner basis w.r.t. the Ring Rn like as presented in Fukuda et al. (2005). function lift( G::Oscar.IdealGens, - orderingAlt::MonomialOrdering, + current::MonomialOrdering, H::Oscar.IdealGens, - ordering::MonomialOrdering, + target::MonomialOrdering, ) G = Oscar.IdealGens( [ gen - Oscar.IdealGens( - [reduce(gen, gens(G); ordering=orderingAlt, complete_reduction=true)], ordering + [reduce(gen, gens(G); ordering=current, complete_reduction=true)], target )[1] for gen in gens(H) ], - ordering; + target; isGB=true, ) + return G end @@ -1248,24 +1287,8 @@ function division_algorithm(p::T, f::Vector{T}, R::MPolyRing) where {T<:MPolyRin end # converts a vector wtemp by dividing the entries with gcd(wtemp). -function convert_bounding_vector(wtemp::Vector{T}) where {T<:Rational{BigInt}} - w = Vector{Int}() - g = gcd(wtemp) - for i in 1:length(wtemp) - push!(w, float(divexact(wtemp[i], g))) - end - return w -end +convert_bounding_vector(w::Vector{T}) where {T<:Union{ZZRingElem, QQFieldElem}} = ZZ.(floor.(w//gcd(w))) -# converts a vector wtemp by dividing the entries with gcd(wtemp). -function convert_bounding_vector(wtemp::Vector{T}) where {T<:Number} - w = Vector{Int}() - g = gcd(wtemp) - for i in 1:length(wtemp) - push!(w, float(divexact(wtemp[i], g))) - end - return w -end # returns a copy of the PolynomialRing I, equipped with the ordering weight_ordering(cw)*matrix_ordering(T). function create_order(R::MPolyRing, cw::Array{L,1}, T::Matrix{Int}) where {L<:Number} @@ -1335,14 +1358,6 @@ function equalitytest(G::Oscar.IdealGens, K::Oscar.IdealGens) return false end -function dot(v::Vector{Int}, w::Vector{Int}) - sum = 0 - for i in 1:length(v) - @inbounds sum += v[i] * w[i] - end - return sum -end - function ordering_as_matrix(w::Vector{Int}, ord::Symbol) if length(w) > 2 if ord == :lex From 7eec7d841d0f0aa642780a334efe958a5dda5dc4 Mon Sep 17 00:00:00 2001 From: Ortfs Date: Mon, 25 Mar 2024 16:06:53 +0100 Subject: [PATCH 017/179] added lift comment --- src/walk.jl | 1 + 1 file changed, 1 insertion(+) diff --git a/src/walk.jl b/src/walk.jl index b08b536174e3..e789c2aafc4b 100644 --- a/src/walk.jl +++ b/src/walk.jl @@ -1217,6 +1217,7 @@ end # TODO: Actual docstring # lifts the Groebner basis G to the Groebner basis w.r.t. the Ring Rn like as presented in Fukuda et al. (2005). +#add theorem reference here function lift( G::Oscar.IdealGens, current::MonomialOrdering, From 30ad7e7eda459125e585f819954e863681ad3e45 Mon Sep 17 00:00:00 2001 From: Ortfs Date: Tue, 26 Mar 2024 15:26:02 +0100 Subject: [PATCH 018/179] commented lift, interreduce and next_weight --- src/walk.jl | 53 +++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 49 insertions(+), 4 deletions(-) diff --git a/src/walk.jl b/src/walk.jl index e789c2aafc4b..ff5bba6f9e73 100644 --- a/src/walk.jl +++ b/src/walk.jl @@ -1086,7 +1086,20 @@ end # Several Procedures for the Groebner Walk ############################################################### -# returns the next intermediate weight vector. + +# Computes the next weight vector as described in Algorithm 5.2 on pg. 437 of "Using algebraic geometry" (Cox, Little, O'Shea, 2005) +#= Input: - G, a reduced GB w.r.t the current monomial order + - cw, a weight vector in the current Gröbner cone (corresponding to G) + - tw a target vector in the Gröbner cone of the target monomial order + + Output: - The point furthest along the line segment conv(cw,tw) still in the starting cone + + QUESTIONS: - why are we making pointers with Ref()? Also, does the conversion at the end work? Type stable? + - + COMMENTS: - even in the standard walk, it makes more sense to work with integer weight vectors. (do this by multiplying with the gcd at the end) + + +=# function next_weight(G::Oscar.IdealGens, cw::Vector{ZZRingElem}, tw::Vector{ZZRingElem}) V = difference_lead_tail(G) tmin = minimum(c//(c-t) for (c,t) in zip(dot.(Ref(cw), V), dot.(Ref(tw), V)) if t<0; init=1) @@ -1134,6 +1147,26 @@ end initial_forms(G::Oscar.IdealGens, w::Vector{ZZRingElem}) = initial_form.(G, Ref(w)) initial_forms(G::Oscar.IdealGens, w::Vector{Int}) = initial_form.(G, Ref(ZZ.(w))) + +# Computes a list of "Bounding vectors" of a generating set of I + +# If the generating set is a G.B w.r.t some monmial order, +# then the bounding vectors form an H-description of the Gröbner cone + +# cf. "Using algebraic geometry", pg. 437 (CLO, 2005) + +#= Input: - generators of an ideal I (in practice a reduced G.B) + + Output: - a list of integer vectors of the form "exponent vector of leading monomial" - "exponent vector of tail monomial" + + QUESTIONS: - are leading terms being computed twice? (Once in leadexpv, once in tailexpvs) One instead could simply subtract leading terms, no? + - type instability? Do I want ints or ringelements? + + COMMENTS: - rename this to "BoundingVectors" or something similar (as in M2 implementation/master's thesis) + - generally, this is one of the routines where it would be really nice to have a "marked Gröbner basis" object + =# + + function difference_lead_tail(I::Oscar.IdealGens) v = Vector{Int}[] for g in gens(I) @@ -1216,8 +1249,19 @@ function same_cone(G::Oscar.IdealGens, T::Matrix{Int}) end # TODO: Actual docstring -# lifts the Groebner basis G to the Groebner basis w.r.t. the Ring Rn like as presented in Fukuda et al. (2005). -#add theorem reference here +#= Lifting step from Proposition 3.2 of "The generic Gröbner walk" (Fukuda et al., 2005) + + Input: - G , the reduced G.B of I w.r.t current + - current, the current monomial order + - H, the reduced G.B of inw(I) w.r.t the next weight vector w + - target, the next monomial order + + Output: - an inclusion minimal G.B of target obtained by subtracting normal forms + + QUESTION: why do we need "target" in Oscar.IdealGens(...)? + + COMMENT: I think "target" is inappropriately named. It is rather "next_ordering" (i.e the target order, refined by w) +=# function lift( G::Oscar.IdealGens, current::MonomialOrdering, @@ -1304,7 +1348,8 @@ function create_order(R::MPolyRing, cw::Array{L,1}, T::Matrix{Int}) where {L<:Nu return ord end -# interreduces the Groebner basis G. +# interreduces the Groebner basis G. +# each element of G is replaced by its normal form w.r.t the other elements of G and the current monomial order function interreduce_walk(G::Oscar.IdealGens) Rn = base_ring(G) Generator = collect(gens(G)) From d524c8fe554ed72ac6c21b1e0d1fbfdc47fb70b5 Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Wed, 27 Mar 2024 15:42:13 +0100 Subject: [PATCH 019/179] Add some exports --- src/GroebnerWalk.jl | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/GroebnerWalk.jl b/src/GroebnerWalk.jl index e512feb4fc88..58083178a375 100644 --- a/src/GroebnerWalk.jl +++ b/src/GroebnerWalk.jl @@ -1,9 +1,21 @@ module GroebnerWalk using Oscar +exponent_vectors = f->exponent_vector.(monomials(f), Ref(1)) + include("walk.jl") export groebner_walk +export standard_walk + +export initial_form +export initial_forms + + + +export standard_step +export next_weight +export difference_lead_tail function __init__() add_verbosity_scope(:groebner_walk) From 41ec234393396409d704af6cf95c401bb1134c47 Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Wed, 27 Mar 2024 15:42:41 +0100 Subject: [PATCH 020/179] Renaming --- src/walk.jl | 207 +++++++++++++++++++++++------------------- test/groebner_walk.jl | 4 +- 2 files changed, 118 insertions(+), 93 deletions(-) diff --git a/src/walk.jl b/src/walk.jl index ff5bba6f9e73..f924f0353b8a 100644 --- a/src/walk.jl +++ b/src/walk.jl @@ -97,39 +97,27 @@ matrix_ordering([x, y], [1 0; 0 1]) ``` """ function groebner_walk( - ::Type{Int}, I::MPolyIdeal, - startOrder::MonomialOrdering = default_ordering(base_ring(I)), - targetOrder::MonomialOrdering = lex(base_ring(I)), - walktype::Symbol = :standard, - perturbationDegree = 2 -) - S = canonical_matrix(startOrder) - T = canonical_matrix(targetOrder) - - return groebner_walk(I, S, T, walktype, perturbationDegree) -end - -function groebner_walk( - I::MPolyIdeal, - start_ordering::MonomialOrdering = default_ordering(base_ring(I)), - target_ordering::MonomialOrdering = lex(base_ring(I)), - walk_type::Symbol = :standard, - perturbationDegree = 2 + start::MonomialOrdering = default_ordering(base_ring(I)), + target::MonomialOrdering = lex(base_ring(I)), + perturbationDegree = 2; + walk_type::Symbol = :standard ) if walk_type == :standard - walk = (x) -> standard_walk(x, start_ordering, target_ordering) + walk = (x) -> standard_walk(x, start, target) + elseif walk_type == :generic + walk = (x) -> generic_walk(x, start, target) else throw(NotImplementedError(:groebner_walk, walk_type)) end - Gb = groebner_basis(I; ordering=start_ordering, complete_reduction=true) + Gb = groebner_basis(I; ordering=start, complete_reduction=true) Gb = walk(Gb) # @vprintln :groebner_walk "Cones crossed: " # delete_step_counter() - return Oscar.IdealGens(gens(Gb), target_ordering; isGB=true) + return Oscar.IdealGens(gens(Gb), target; isGB=true) end function groebner_walk( @@ -195,14 +183,14 @@ end function standard_walk( G::Oscar.IdealGens, - start_ordering::MonomialOrdering, - target_ordering::MonomialOrdering + start::MonomialOrdering, + target::MonomialOrdering ) - start_weight = canonical_matrix(start_ordering)[1,:] - target_weight = canonical_matrix(target_ordering)[1,:] + start_weight = canonical_matrix(start)[1,:] + target_weight = canonical_matrix(target)[1,:] - return standard_walk(G, start_ordering, target_ordering, start_weight, target_weight) + return standard_walk(G, start, target, start_weight, target_weight) end standard_walk(G::Oscar.IdealGens, S::ZZMatrix, T::ZZMatrix) = standard_walk( @@ -215,26 +203,29 @@ standard_walk(G::Oscar.IdealGens, S::ZZMatrix, T::ZZMatrix) = standard_walk( function standard_walk( G::Oscar.IdealGens, - start_ordering::MonomialOrdering, - target_ordering::MonomialOrdering, + start::MonomialOrdering, + target::MonomialOrdering, current_weight::Vector{ZZRingElem}, - target_weight::Vector{ZZRingElem} + target_weight::Vector{ZZRingElem}; ) @vprintln :groebner_walk "Results for standard_walk" @vprintln :groebner_walk "Crossed Cones in: " + @v_do :groebner_walk steps = 0 + while true - G = standard_step(G, current_weight, target_ordering) + G = standard_step(G, current_weight, target) if current_weight == target_weight + @vprint :groebner_walk "Cones crossed: " + @vprintln :groebner_walk steps + return G else current_weight = next_weight(G, current_weight, target_weight) end - if infoLevel >= 1 - raise_step_counter() - end + @v_do :groebner_walk steps+=1 @vprintln :groebner_walk current_weight @vprintln :groebner_walk 2 G @@ -245,15 +236,14 @@ end # The standard step is used for the strategies standard and perturbed. ############################################################### -function standard_step(G::Oscar.IdealGens, w::Vector{ZZRingElem}, target_ordering::MonomialOrdering) - R = base_ring(G) +function standard_step(G::Oscar.IdealGens, w::Vector{ZZRingElem}, target::MonomialOrdering) current_ordering = ordering(G) - next_ordering = weight_ordering(w, target_ordering) + next = weight_ordering(w, target) Gw = ideal(initial_forms(G,w)) - H = groebner_basis(Gw; ordering=next_ordering, complete_reduction=true) - H = lift(G, current_ordering, H, next_ordering) + H = groebner_basis(Gw; ordering=next, complete_reduction=true) + H = lift(G, current_ordering, H, next) @vprintln :groebner_walk 3 Gw @vprintln :groebner_walk 3 H @@ -267,6 +257,15 @@ standard_step(G::Oscar.IdealGens, w::Vector{Int}, T::Matrix{Int}) = standard_ste # Generic-version of the Groebner Walk. ############################################################### +function generic_walk(G::Oscar.IdealGens, start::MonomialOrdering, target::MonomialOrdering) + Lm = leading_term.(G; ordering=start) + v = next_gamma(G, Lm, [ZZ(0)], start, target) + + @vprintln :groebner_walk "Results for generic_walk" + @vprintln :groebner_walk "Facets crossed for: " + +end + function generic_walk(G::Oscar.IdealGens, S::Matrix{Int}, T::Matrix{Int}) Lm = [leading_term(g; ordering=matrix_ordering(base_ring(G), S)) for g in G] v = next_gamma(G, Lm, [0], S, T) @@ -367,7 +366,7 @@ function fractal_walk_combined( # Handling the weight of the start order. if (p == 1) - if !ismonomial(initials(G, w)) + if !ismonomial(initial_forms(G, w)) global pStartWeights = [perturbed_vector(G, S, i) for i in 1:nvars(R)] global firstStepMode = true end @@ -413,7 +412,7 @@ function fractal_walk_combined( else w = w + t * (pTargetWeights[p] - w) w = convert_bounding_vector(w) - Gw = ideal(initials(G, w)) + Gw = ideal(initial_forms(G, w)) # handling the current weight with regards to Int32-entries. If an entry of w is bigger than Int32 use the Buchberger-algorithm. if !checkInt32(w) @@ -436,7 +435,7 @@ function fractal_walk_combined( return G end end - ordNew = create_order(R, w, T) + ordNew = create_ordering(R, w, T) # converting the Groebner basis if (p == nvars(R) || isbinomial(gens(Gw))) H = groebner_basis( @@ -520,7 +519,7 @@ function fractal_recursion_step( w = w + t * (pTargetWeights[p] - w) w = convert_bounding_vector(w) - Gw = ideal(initials(G, w)) + Gw = ideal(initial_forms(G, w)) # Handling the current weight with regards to Int32-entries. If an entry of w is bigger than Int32 use the Buchberger-algorithm. if !checkInt32(w) @@ -543,7 +542,7 @@ function fractal_recursion_step( return G end end - ordNew = create_order(R, w, T) + ordNew = create_ordering(R, w, T) # Converting the Groebner basis if p == nvars(R) H = groebner_basis( @@ -600,7 +599,7 @@ function fractal_walk_recursive_startorder( # Handling the starting weight. if (p == 1) - if !ismonomial(initials(G, currweight)) + if !ismonomial(initial_forms(G, currweight)) global pStartWeights = [perturbed_vector(G, S, i) for i in 1:nvars(R)] global firstStepMode = true end @@ -640,7 +639,7 @@ function fractal_walk_recursive_startorder( w = w + t * (pTargetWeights[p] - w) w = convert_bounding_vector(w) - Gw = ideal(initials(G, w)) + Gw = ideal(initial_forms(G, w)) # Handling the current weight with regards to Int32-entries. If an entry of w is bigger than Int32 use the Buchberger-algorithm. if !checkInt32(w) @@ -659,7 +658,7 @@ function fractal_walk_recursive_startorder( return G end end - ordNew = create_order(R, w, T) + ordNew = create_ordering(R, w, T) # Converting the Groebner basis if p == nvars(R) @@ -701,7 +700,7 @@ function tran_walk(G::Oscar.IdealGens, S::Matrix{Int}, T::Matrix{Int}) currweight = S[1, :] tarweight = T[1, :] R = base_ring(G) - if !ismonomial(initials(G, currweight)) + if !ismonomial(initial_forms(G, currweight)) currweight = perturbed_vector(G, S, nvars(R)) end @@ -710,7 +709,7 @@ function tran_walk(G::Oscar.IdealGens, S::Matrix{Int}, T::Matrix{Int}) # return the Groebner basis if an entry of w is bigger than int32. if !checkInt32(w) - w, b = truncw(G, w, initials(G, w)) + w, b = truncw(G, w, initial_forms(G, w)) !b && throw( error( "Some entries of the intermediate weight-vector $w are bigger than int32. Choose an other algorithm instead.", @@ -721,7 +720,7 @@ function tran_walk(G::Oscar.IdealGens, S::Matrix{Int}, T::Matrix{Int}) if same_cone(G, T) @vprintln :groebner_walk ("Cones crossed: ", counter)... return G - elseif inSeveralCones(initials(G, tarweight)) + elseif inSeveralCones(initial_forms(G, tarweight)) tarweight = representation_vector(G, T) continue end @@ -745,8 +744,8 @@ function standard_step_without_int32_check( ) R = base_ring(G) ordAlt = G.ord - ordNew = create_order(R, w, T) - Gw = initials(G, w) + ordNew = create_ordering(R, w, T) + Gw = initial_forms(G, w) H = groebner_basis( ideal(Gw); ordering=ordNew, complete_reduction=true, algorithm=:buchberger ) @@ -858,7 +857,7 @@ function inCone(G::Oscar.IdealGens, T::Matrix{Int}, pvecs::Vector{Vector{Int}}, return true end ord = matrix_ordering(base_ring(G), T) - cvzip = zip(gens(G), initials(G, pvecs[p - 1]), initials(G, pvecs[p])) + cvzip = zip(gens(G), initial_forms(G, pvecs[p - 1]), initial_forms(G, pvecs[p])) for (g, in, in2) in cvzip if !isequal(leading_term(g; ordering=ord), leading_term(in; ordering=ord)) || !isequal(leading_term(g; ordering=ord), leading_term(in2; ordering=ord)) @@ -897,24 +896,34 @@ end # returns the differences of the exponent vectors of the leading terms and the polynomials of the generators of I. function difference_lead_tail( - G::Oscar.IdealGens, Lm::Vector{L}, T::Union{Matrix{N},MatElem{N}} -) where {L<:MPolyRingElem,N} - v = Vector{Int}[] - for i in 1:length(G) - ltu = collect( - AbstractAlgebra.exponent_vectors( - leading_term(Lm[i]; ordering=matrix_ordering(base_ring(G), T)) - ), - )[1] - for e in AbstractAlgebra.exponent_vectors(G[i]) - if ltu != e - push!(v, ltu .- e) - end - end - end - return unique!(v) + G::Oscar.IdealGens, Lm::Vector{L}, T::MonomialOrdering +) where {L<:MPolyRingElem} + lead_exp = leading_term.(Lm; ordering=T) .|> exponent_vectors .|> first + + v = zip(lead_exp, exponent_vectors.(G)) .|> splat((l, t) -> Ref(l).-t) + + return unique!(reduce(vcat, v)) end +# function difference_lead_tail( +# G::Oscar.IdealGens, Lm::Vector{L}, T::Union{Matrix{N},MatElem{N}} +# ) where {L<:MPolyRingElem,N} +# v = Vector{Int}[] +# for i in 1:length(G) +# ltu = collect( +# AbstractAlgebra.exponent_vectors( +# leading_term(Lm[i]; ordering=matrix_ordering(base_ring(G), T)) +# ), +# )[1] +# for e in AbstractAlgebra.exponent_vectors(G[i]) +# if ltu != e +# push!(v, ltu .- e) +# end +# end +# end +# return unique!(v) +# end + # returns true if the vector u is parallel to the vector v. function isparallel(u::Vector{Int}, v::Vector{Int}) count = 1 @@ -958,10 +967,18 @@ function lift_generic( end # returns all v \in V if v<0 w.r.t. the ordering represented by T and v>0 w.r.t the ordering represented by S. +function filter_by_ordering(S::MonomialOrdering, T::MonomialOrdering, V::Vector{Vector{Int}}) + pred = v->( + less_than_zero(canonical_matrix(T), ZZ.(v)) && + greater_than_zero(canonical_matrix(S), ZZ.(v)) + ) + return unique!(filter(pred, V)) +end + function filter_by_ordering(S::Matrix{Int}, T::Matrix{Int}, V::Vector{Vector{Int}}) btz = Set{Vector{Int}}() for v in V - if less_than_zero(T, v) && bigger_than_zero(S, v) + if less_than_zero(T, v) && greater_than_zero(S, v) push!(btz, v) end end @@ -980,6 +997,12 @@ function filter_lf(w::Vector{Int}, S::Matrix{Int}, T::Matrix{Int}, V::Set{Vector end # computes the next vector in the generic walk. +function next_gamma( + G::Oscar.IdealGens, Lm::Vector{L}, w::Vector{ZZRingElem}, start::MonomialOrdering, target::MonomialOrdering +) where {L<:MPolyRingElem} + V = filter_by_ordering(start, target, difference_lead_tail(G, Lm, target)) +end + function next_gamma( G::Oscar.IdealGens, Lm::Vector{L}, w::Vector{Int}, S::Matrix{Int}, T::Matrix{Int} ) where {L<:MPolyRingElem} @@ -1000,7 +1023,9 @@ function next_gamma( end # tests if v>0 w.r.t. the ordering M. -function bigger_than_zero(M::Matrix{Int}, v::Vector{Int}) +greater_than_zero(M::MonomialOrdering, v::Vector{Int}) = greater_than_zero(canonical_matrix(M), v) +# TODO What is the definition? +function greater_than_zero(M::Matrix{Int}, v::Vector{Int}) nrows, ncols = size(M) for i in 1:nrows d = 0 @@ -1015,6 +1040,7 @@ function bigger_than_zero(M::Matrix{Int}, v::Vector{Int}) end # tests if v<0 w.r.t. the ordering M. +less_than_zero(M::MonomialOrdering, v::Vector{Int}) = less_than_zero(canonical_matrix(M), v) function less_than_zero(M::Matrix{Int}, v::Vector{Int}) nrows, ncols = size(M) for i in 1:nrows @@ -1116,7 +1142,7 @@ function truncw(G::Oscar.IdealGens, w::Vector{Int}, inw::Vector{T}) where {T<:MP w[i] = round(w[i] * 0.10) end w = convert_bounding_vector(w) - if inw != initials(G, w) + if inw != initial_forms(G, w) # initials are different - return unrounded weight return w, false end @@ -1131,11 +1157,11 @@ function initial_form(f::MPolyRingElem, w::Vector{ZZRingElem}) ctx = MPolyBuildCtx(R) - exponent_vectors = exponent_vector.(monomials(f), Ref(1)) - WE = dot.(Ref(w), Vector{ZZRingElem}.(exponent_vectors)) + E = exponent_vectors(f) + WE = dot.(Ref(w), Vector{ZZRingElem}.(E)) maxw = maximum(WE) - for (e,c,we) in zip(exponent_vectors, coefficients(f), WE) + for (e,c,we) in zip(E, coefficients(f), WE) if we == maxw push_term!(ctx, c, e) end @@ -1168,15 +1194,12 @@ initial_forms(G::Oscar.IdealGens, w::Vector{Int}) = initial_form.(G, Ref(ZZ.(w)) function difference_lead_tail(I::Oscar.IdealGens) - v = Vector{Int}[] - for g in gens(I) - leadexpv = first(AbstractAlgebra.exponent_vectors(leading_term(g; ordering=I.ord))) - tailexpvs = AbstractAlgebra.exponent_vectors(tail(g; ordering=I.ord)) - for e in tailexpvs - push!(v, leadexpv .- e) - end - end - return unique!(v) + lead_exp = leading_term.(I; ordering=ordering(I)) .|> exponent_vectors .|> first + tail_exps = tail.(I; ordering=ordering(I)) .|> exponent_vectors + + v = zip(lead_exp, tail_exps) .|> splat((l, t) -> Ref(l).-t) + + return unique!(reduce(vcat, v)) end # computes a p-perturbed vector from the matrix M. @@ -1263,9 +1286,9 @@ end COMMENT: I think "target" is inappropriately named. It is rather "next_ordering" (i.e the target order, refined by w) =# function lift( - G::Oscar.IdealGens, + G::Oscar.IdealGens, # momentane GB current::MonomialOrdering, - H::Oscar.IdealGens, + H::Oscar.IdealGens, # soll GB von initial forms sein target::MonomialOrdering, ) G = Oscar.IdealGens( @@ -1336,7 +1359,7 @@ convert_bounding_vector(w::Vector{T}) where {T<:Union{ZZRingElem, QQFieldElem}} # returns a copy of the PolynomialRing I, equipped with the ordering weight_ordering(cw)*matrix_ordering(T). -function create_order(R::MPolyRing, cw::Array{L,1}, T::Matrix{Int}) where {L<:Number} +function create_ordering(R::MPolyRing, cw::Vector{L}, T::Matrix{Int}) where {L<:Number} s = size(T) if s[1] == s[2] ord = weight_ordering(cw, matrix_ordering(R, T)) @@ -1350,16 +1373,18 @@ end # interreduces the Groebner basis G. # each element of G is replaced by its normal form w.r.t the other elements of G and the current monomial order +# TODO reference, docstring +# interreduces the Groebner basis G. function interreduce_walk(G::Oscar.IdealGens) - Rn = base_ring(G) - Generator = collect(gens(G)) + generators = collect(gens(G)) + I = 0 for i in 1:length(gens(G)) - Generator[i] = reduce( - Generator[i], Generator[1:end .!= i]; ordering=G.ord, complete_reduction=true + generators[i] = reduce( + generators[i], generators[1:end .!= i]; ordering=G.ord, complete_reduction=true ) end - return Oscar.IdealGens(Generator, G.ord) + return Oscar.IdealGens(generators, G.ord) end ############################################# diff --git a/test/groebner_walk.jl b/test/groebner_walk.jl index 10f181eb47f3..26a07edce28c 100644 --- a/test/groebner_walk.jl +++ b/test/groebner_walk.jl @@ -34,9 +34,9 @@ ideals = [] infoLevel = 1 for i ∈ 2:nvars(R) - push!(ideals, groebnerwalk(id, degrevlex(R), lex(R), :perturbed, i)) + push!(ideals, groebner_walk(id, degrevlex(R), lex(R), :perturbed, i)) end - push!(ideals, groebnerwalk(id, degrevlex(R), lex(R), :standard)) + push!(ideals, groebner_walk(id, degrevlex(R), lex(R), :standard)) # push!(ideals, groebnerwalk(id, degrevlex(R), lex(R), :tran)) push!(ideals, groebnerwalk(id, degrevlex(R), lex(R), :fractal)) From ee7195ac3b9afb1b04e4b8e97d6cac9ba3692cc8 Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Wed, 27 Mar 2024 16:02:07 +0100 Subject: [PATCH 021/179] Add toy example --- examples/toy_example.jl | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 examples/toy_example.jl diff --git a/examples/toy_example.jl b/examples/toy_example.jl new file mode 100644 index 000000000000..6d8dfe726747 --- /dev/null +++ b/examples/toy_example.jl @@ -0,0 +1,23 @@ +using Oscar +using Oscar.GroebnerWalk + +R,(x,y) = polynomial_ring(QQ, ["x","y"]) +I = ideal([y^4+ x^3-x^2+x,x^4]) + +set_verbosity_level(:groebner_walk, 1) + +groebner_walk(I) + +S = degrevlex(R) +T = lex(R) + +s = canonical_matrix(S)[1,:] +t = canonical_matrix(T)[1,:] + +G = groebner_basis(I; ordering=degrevlex(R), complete_reduction=true) + +G1 = standard_step(G, s, T) + +next_weight(G1, ZZ.([1,1]), ZZ.([1,0])) + +groebner_walk(I; walk_type=:generic) \ No newline at end of file From bca36918d6c61bc05de3af7d50b542e51e64e9eb Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Wed, 27 Mar 2024 16:02:16 +0100 Subject: [PATCH 022/179] Resolved questions --- src/walk.jl | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/src/walk.jl b/src/walk.jl index f924f0353b8a..a0582e1de9fa 100644 --- a/src/walk.jl +++ b/src/walk.jl @@ -1119,12 +1119,6 @@ end - tw a target vector in the Gröbner cone of the target monomial order Output: - The point furthest along the line segment conv(cw,tw) still in the starting cone - - QUESTIONS: - why are we making pointers with Ref()? Also, does the conversion at the end work? Type stable? - - - COMMENTS: - even in the standard walk, it makes more sense to work with integer weight vectors. (do this by multiplying with the gcd at the end) - - =# function next_weight(G::Oscar.IdealGens, cw::Vector{ZZRingElem}, tw::Vector{ZZRingElem}) V = difference_lead_tail(G) @@ -1359,17 +1353,7 @@ convert_bounding_vector(w::Vector{T}) where {T<:Union{ZZRingElem, QQFieldElem}} # returns a copy of the PolynomialRing I, equipped with the ordering weight_ordering(cw)*matrix_ordering(T). -function create_ordering(R::MPolyRing, cw::Vector{L}, T::Matrix{Int}) where {L<:Number} - s = size(T) - if s[1] == s[2] - ord = weight_ordering(cw, matrix_ordering(R, T)) - elseif s[1] - s[2] == 1 - ord = weight_ordering(cw, matrix_ordering(R, T)) - else - ord = weight_ordering(cw, matrix_ordering(R, T)) - end - return ord -end +create_ordering(R::MPolyRing, cw::Vector{L}, T::Matrix{Int}) where {L<:Number} = weight_ordering(cw, matrix_ordering(R, T)) # interreduces the Groebner basis G. # each element of G is replaced by its normal form w.r.t the other elements of G and the current monomial order From a7d0e0817ac2b749e4f3b45f1c01a88127486d46 Mon Sep 17 00:00:00 2001 From: Ortfs Date: Tue, 2 Apr 2024 09:30:45 +0200 Subject: [PATCH 023/179] added comments, examples and facet_preorder --- examples/thesisexamples/chap3.jl | 97 +++++++++++++++++++++ examples/thesisexamples/chap4.jl | 28 ++++++ examples/thesisexamples/chap5_generic.jl | 37 ++++++++ src/GroebnerWalk.jl | 7 ++ src/facet_preorder.jl | 105 +++++++++++++++++++++++ src/walk.jl | 24 ++++++ test/groebner_walk.jl | 3 +- 7 files changed, 299 insertions(+), 2 deletions(-) create mode 100644 examples/thesisexamples/chap3.jl create mode 100644 examples/thesisexamples/chap4.jl create mode 100644 examples/thesisexamples/chap5_generic.jl create mode 100644 src/facet_preorder.jl diff --git a/examples/thesisexamples/chap3.jl b/examples/thesisexamples/chap3.jl new file mode 100644 index 000000000000..dc21dca04dca --- /dev/null +++ b/examples/thesisexamples/chap3.jl @@ -0,0 +1,97 @@ +#Testing welpj's Groebner walk with my examples + +#Examples from chapter 3 + +using Oscar +using Oscar.GroebnerWalk + + +#We perform computations on the same ideal throughout + +R, (x,y,z) = polynomial_ring(QQ, ["x","y","z"]) + +set_verbosity_level(:groebner_walk, 1) + + +I = ideal([x^2 + y*z, x*y + z^2]) + +#First example: conversion from degrevlex to lex + +Gfinal = groebner_walk(I) + +#The algorithm terminates after 1 standard step. +#Check the subroutines: +G = groebner_basis(I; ordering=degrevlex(R), complete_reduction=true) + +w = next_weight(G, ZZ.([1,1,1]), ZZ.([1,0,0])) + +# I agree with the output of next_weight +# However, I think infoLevel should say "Crossed Cones in: [1,1,1]" (and not [1,0,0]) + +#First iteration +inwI = ideal(initial_forms(G,w)) +H = groebner_basis(inwI; ordering = weight_ordering(w, lex(R)), complete_reduction = true ) +Gnew = lift2(G, degrevlex(R), H, weight_ordering(w, lex(R))) + +#w != tau, so we go again, updating to Gnew, etc. + +w2 = next_weight(Gnew, ZZ.([1,1,1]), ZZ.([1,0,0])) + +inwI2 = ideal(initial_forms(Gnew, w2)) + +H2 = groebner_basis(inwI2; ordering = weight_ordering(w2, lex(R)), complete_reduction = true ) +G2new = lift2(Gnew, ordering(Gnew), H2, weight_ordering(w2, lex(R))) + +#G2new is Glex, as w = tau + + + + +#Second example (same conversion with different choice of weight vectors) + +o2 = weight_ordering([1,1,0], degrevlex(R)) + +o3 = weight_ordering([3,1,0], lex(R)) + +Gfinal2 = groebner_walk(I, o2, o3) + +#gens(Gfinal) == gens(Gfinal2) + +#the conversion works but like before I don't like that it says "Crossed cones in [3,1,0]" +#[3,1,0] lies in the interior of a cone. + + +#Third example: convert from lex to deglex, refined by [1,3,0] +o4 = weight_ordering([1,3,0], deglex(R)) + +Gfinal3 = groebner_walk(I, lex(R), o4) + +#two cones are crossed. +#Integer weight vectors is the standard choice. + + +#leading_term.(gens(Gfinal3), ordering = ordering(Gfinal3)) + + + +#= +groebner_walk(I, degrevlex(R), lex(R)) + +M = [1 3 0; 1 1 1; 1 0 0; 0 1 0; 0 0 1] + +o2 = matrix_ordering([x,y,z], M) + +result2 = groebner_walk(I, lex(R), o2) + +gens(result2) + +o3 = weight_ordering([1,3,0], deglex(R)) + +canonical_matrix(o2) + +canonical_matrix(o3) + +#leading_term.(gens(Gnew)) +#tail.(gens(Gnew))) + +=# \ No newline at end of file diff --git a/examples/thesisexamples/chap4.jl b/examples/thesisexamples/chap4.jl new file mode 100644 index 000000000000..cbd29355637c --- /dev/null +++ b/examples/thesisexamples/chap4.jl @@ -0,0 +1,28 @@ +using Oscar +using Oscar.GroebnerWalk +R, (x,y,z) = polynomial_ring(QQ, ["x","y","z"]) + +I = ideal([6 + 3*x^3+16*x^2*z+14*x^2*y^3, 6+y^3*z+17*x^2*z^2+7*x*y^2*z^2+13*x^3*z^2]) + +# This is an example 3.8 from Tran 2004. +# In M2, "gb I" takes ~90s +# standard Gröbner Walk takes ~12s +# generic Gröbner Walk takes ~2s + +groebner_basis(I, ordering = lex(R)) +#this takes longer than 30 mins in OSCAR, compared with ~90s in M2 +#Is this to be expected? + + +groebner_walk(I, degrevlex(R), lex(R)) + + +groebner_walk(I, degrevlex(R), lex(R), :generic) + +#the line above terminates in a few secs + +#you should count the number of conversions + +#problem: the two functions above appear to do exactly the same thing! +#"Results for standard_walk....etc. + diff --git a/examples/thesisexamples/chap5_generic.jl b/examples/thesisexamples/chap5_generic.jl new file mode 100644 index 000000000000..174edd2b8fe5 --- /dev/null +++ b/examples/thesisexamples/chap5_generic.jl @@ -0,0 +1,37 @@ +using Oscar +using Oscar.GroebnerWalk + + +#The generic walk currently doesn't work (type conflicts) +#This example tests "new_next_gamma" +#We perform computations on the same ideal throughout + +R, (x,y,z) = polynomial_ring(QQ, ["x","y","z"]) + +set_verbosity_level(:groebner_walk, 1) + + +I = ideal([x^2 + y*z, x*y + z^2]) + +o_s = lex(R) + +o_t = weight_ordering([1,3,0], deglex(R)) + +G = groebner_basis(I, ordering = o_s) +S = canonical_matrix(o_s) +T = canonical_matrix(o_t) + +new_next_gamma(G, ZZ.([0]), o_s, o_t) +#Gfinal = groebner_walk(I, lex(R), o4; walk_type = :generic) #throws an error + + + + +#= + +R2, (x,y) = polynomial_ring(QQ, ["x","y"]) + +I2 = ideal([x^2-y^3, x^3 -y^2 - x]) + +G2 = groebner_basis(I2) +#= Fukuda Jensen example \ No newline at end of file diff --git a/src/GroebnerWalk.jl b/src/GroebnerWalk.jl index 58083178a375..b2957c615ac1 100644 --- a/src/GroebnerWalk.jl +++ b/src/GroebnerWalk.jl @@ -5,6 +5,10 @@ exponent_vectors = f->exponent_vector.(monomials(f), Ref(1)) include("walk.jl") +include("facet_preorder.jl") + + + export groebner_walk export standard_walk @@ -15,8 +19,11 @@ export initial_forms export standard_step export next_weight +export lift2 export difference_lead_tail +export new_next_gamma + function __init__() add_verbosity_scope(:groebner_walk) diff --git a/src/facet_preorder.jl b/src/facet_preorder.jl new file mode 100644 index 000000000000..0664cbf0c4bb --- /dev/null +++ b/src/facet_preorder.jl @@ -0,0 +1,105 @@ +#returns 'true' if Mv <_{lex} 0 , 'false' otherwise +# <_{lex} is the lexicographic ordering on Q^n +#with the notation from my thesis, this is equivalent to v <_M 0 +function new_less_than_zero(M::ZZMatrix, v::Vector{ZZRingElem}) + i = 1 + while dot(M[i, :], v) == 0 + i += 1 + end + return dot(M[i, :], v) < 0 +end + +#returns all v in V with 0 <_S v and v <_T 0 +#when V are the bounding vectors of a cone, this is the set of all "candidates" for the next facet normal +function new_filter_by_ordering(S::MonomialOrdering, T::MonomialOrdering, V::Vector{Vector{ZZRingElem}}) + pred = v->( + new_less_than_zero(canonical_matrix(T), ZZ.(v)) && !new_less_than_zero(canonical_matrix(S), ZZ.(v)) + ) + return unique!(filter(pred, V)) + end + + +#returns true if v <_M w , false otherwise +#i.e elements of the vectors Mv and Mw are compared until a tie is broken + +function matrix_less_than(M::ZZMatrix, v::Vector{ZZRingElem}, w::Vector{ZZRingElem}) + i = 1 + while dot(M[i, :], v) == dot(M[i, :], w) && i != number_of_rows(M) + i += 1 + end + return dot(M[i, :], v) < dot(M[i, :], w) +end + +#returns true if v < w w.r.t the Facet preorder (cf. "The generic Gröbner walk" (Fukuda et a;. 2007), pg. 10) +function facet_less_than(S::ZZMatrix, T::ZZMatrix, u::Vector{ZZRingElem}, v::Vector{ZZRingElem}) + i = 1 + while dot(T[i,:], u)v == dot(T[i,:], v)u && i != number_of_rows(T) + i += 1 + end + return matrix_less_than(S, dot(T[i,:], u)v, dot(T[i,:], v)u) +end + +#returns all elements of V smaller than w w.r.t the facet preorder +#QUESTION: Is there any particular reason to use sets here? +function new_filter_lf(w::Vector{ZZRingElem}, S::ZZMatrix, T::ZZMatrix, V::Set{Vector{ZZRingElem}}) + btz = Set{Vector{ZZRingELem}}() + for v in V + if facet_less_than(S,T,v,w) + push!(btz, v) + end + end + return btz +end + + +#given a Gröbner basis G and the previous normal vector w, find the next one +#This method is compute_last_w from Fukuda 2007, pg. 12 +#Initialization is with w = ZZ.([0]) +#termination condition is V = [] +function new_next_gamma( + G::Oscar.IdealGens, w::Vector{ZZRingElem}, start::MonomialOrdering, target::MonomialOrdering + ) where {L<:MPolyRingElem} + V = new_filter_by_ordering(start, target, [ZZ.(v) for v in difference_lead_tail(G)]) + if w != ZZ.([0]) + V = new_filter_lf(w, S, T, V) + end + if isempty(V) + return v + end + minV = first(V) + for v in V + if facet_less_than(canonical_matrix(start), canonical_matrix(target),v, minV) + minV = v + end + end + return minV +end + +#= tests + + +R, (x,y,z) = polynomial_ring(QQ, ["x","y","z"]) + +o_s = lex(R) + +o_t= weight_ordering([1,3,0], deglex(R)) + +S = canonical_matrix(o_s) +T = canonical_matrix(o_t) + +V = [ZZ.([0, 3, -3]), ZZ.([1, -2, 1]), ZZ.([1,1,-2]), ZZ.([2,-1,-1])] + +u = ZZ.([1,-2,1]) +v = ZZ.([2,-1,-1]) +filter_by_ordering(o_s, o_t, V) + + + +matrix_less_than(S, ZZ.([3,2,1]), ZZ.([3,3,3])) + + +I = ideal([x^2 + y*z, x*y + z^2]) + +Gfinal = groebner_walk(I) + +=# \ No newline at end of file diff --git a/src/walk.jl b/src/walk.jl index a0582e1de9fa..4d2b2538fc53 100644 --- a/src/walk.jl +++ b/src/walk.jl @@ -1025,6 +1025,7 @@ end # tests if v>0 w.r.t. the ordering M. greater_than_zero(M::MonomialOrdering, v::Vector{Int}) = greater_than_zero(canonical_matrix(M), v) # TODO What is the definition? +# This should be the ordering on Q^n induced by M: ( u <_M v iff Mu <_lex Mv)? function greater_than_zero(M::Matrix{Int}, v::Vector{Int}) nrows, ncols = size(M) for i in 1:nrows @@ -1041,6 +1042,7 @@ end # tests if v<0 w.r.t. the ordering M. less_than_zero(M::MonomialOrdering, v::Vector{Int}) = less_than_zero(canonical_matrix(M), v) +less_than_zero(M::ZZMatrix, v::Vector{ZZRingElem}) = less_than_zero(M, v) function less_than_zero(M::Matrix{Int}, v::Vector{Int}) nrows, ncols = size(M) for i in 1:nrows @@ -1549,4 +1551,26 @@ function inSeveralCones(Gw::Vector{T}) where {T<:MPolyRingElem} return true end return false +end + + +#Create a copy of the "lift" function (to export it without conflicts) + +function lift2( + G::Oscar.IdealGens, # momentane GB + current::MonomialOrdering, + H::Oscar.IdealGens, # soll GB von initial forms sein + target::MonomialOrdering, +) + G = Oscar.IdealGens( + [ + gen - Oscar.IdealGens( + [reduce(gen, gens(G); ordering=current, complete_reduction=true)], target + )[1] for gen in gens(H) + ], + target; + isGB=true, + ) + + return G end \ No newline at end of file diff --git a/test/groebner_walk.jl b/test/groebner_walk.jl index 26a07edce28c..f3e5620924e4 100644 --- a/test/groebner_walk.jl +++ b/test/groebner_walk.jl @@ -254,5 +254,4 @@ degrevlex(R), )), ) - end -end \ No newline at end of file + end \ No newline at end of file From e0e164fc237231b4e39974b74ebc38197889b084 Mon Sep 17 00:00:00 2001 From: Ortfs Date: Fri, 5 Apr 2024 12:20:36 +0200 Subject: [PATCH 024/179] added folder new_generic_walk --- examples/thesisexamples/chap5_generic.jl | 3 +- src/GroebnerWalk.jl | 2 + src/facet_preorder.jl | 105 ----------------- src/new_generic_walk/fukuda_example.jl | 51 +++++++++ src/new_generic_walk/new_generic_step.jl | 136 +++++++++++++++++++++++ src/new_generic_walk/new_generic_walk.jl | 17 +++ src/new_generic_walk/new_next_gamma.jl | 133 ++++++++++++++++++++++ src/new_generic_walk/thesis_example.jl | 47 ++++++++ src/walk.jl | 4 +- 9 files changed, 391 insertions(+), 107 deletions(-) delete mode 100644 src/facet_preorder.jl create mode 100644 src/new_generic_walk/fukuda_example.jl create mode 100644 src/new_generic_walk/new_generic_step.jl create mode 100644 src/new_generic_walk/new_generic_walk.jl create mode 100644 src/new_generic_walk/new_next_gamma.jl create mode 100644 src/new_generic_walk/thesis_example.jl diff --git a/examples/thesisexamples/chap5_generic.jl b/examples/thesisexamples/chap5_generic.jl index 174edd2b8fe5..24c5cb2acd00 100644 --- a/examples/thesisexamples/chap5_generic.jl +++ b/examples/thesisexamples/chap5_generic.jl @@ -22,7 +22,8 @@ S = canonical_matrix(o_s) T = canonical_matrix(o_t) new_next_gamma(G, ZZ.([0]), o_s, o_t) -#Gfinal = groebner_walk(I, lex(R), o4; walk_type = :generic) #throws an error + +Gfinal = groebner_walk(I, lex(R), o_t; walk_type = :generic) #throws an error diff --git a/src/GroebnerWalk.jl b/src/GroebnerWalk.jl index b2957c615ac1..6395bb61b8e9 100644 --- a/src/GroebnerWalk.jl +++ b/src/GroebnerWalk.jl @@ -21,6 +21,8 @@ export standard_step export next_weight export lift2 export difference_lead_tail +export less_than_zero +export new_less_than_zero export new_next_gamma diff --git a/src/facet_preorder.jl b/src/facet_preorder.jl deleted file mode 100644 index 0664cbf0c4bb..000000000000 --- a/src/facet_preorder.jl +++ /dev/null @@ -1,105 +0,0 @@ -#returns 'true' if Mv <_{lex} 0 , 'false' otherwise -# <_{lex} is the lexicographic ordering on Q^n -#with the notation from my thesis, this is equivalent to v <_M 0 -function new_less_than_zero(M::ZZMatrix, v::Vector{ZZRingElem}) - i = 1 - while dot(M[i, :], v) == 0 - i += 1 - end - return dot(M[i, :], v) < 0 -end - -#returns all v in V with 0 <_S v and v <_T 0 -#when V are the bounding vectors of a cone, this is the set of all "candidates" for the next facet normal -function new_filter_by_ordering(S::MonomialOrdering, T::MonomialOrdering, V::Vector{Vector{ZZRingElem}}) - pred = v->( - new_less_than_zero(canonical_matrix(T), ZZ.(v)) && !new_less_than_zero(canonical_matrix(S), ZZ.(v)) - ) - return unique!(filter(pred, V)) - end - - -#returns true if v <_M w , false otherwise -#i.e elements of the vectors Mv and Mw are compared until a tie is broken - -function matrix_less_than(M::ZZMatrix, v::Vector{ZZRingElem}, w::Vector{ZZRingElem}) - i = 1 - while dot(M[i, :], v) == dot(M[i, :], w) && i != number_of_rows(M) - i += 1 - end - return dot(M[i, :], v) < dot(M[i, :], w) -end - -#returns true if v < w w.r.t the Facet preorder (cf. "The generic Gröbner walk" (Fukuda et a;. 2007), pg. 10) -function facet_less_than(S::ZZMatrix, T::ZZMatrix, u::Vector{ZZRingElem}, v::Vector{ZZRingElem}) - i = 1 - while dot(T[i,:], u)v == dot(T[i,:], v)u && i != number_of_rows(T) - i += 1 - end - return matrix_less_than(S, dot(T[i,:], u)v, dot(T[i,:], v)u) -end - -#returns all elements of V smaller than w w.r.t the facet preorder -#QUESTION: Is there any particular reason to use sets here? -function new_filter_lf(w::Vector{ZZRingElem}, S::ZZMatrix, T::ZZMatrix, V::Set{Vector{ZZRingElem}}) - btz = Set{Vector{ZZRingELem}}() - for v in V - if facet_less_than(S,T,v,w) - push!(btz, v) - end - end - return btz -end - - -#given a Gröbner basis G and the previous normal vector w, find the next one -#This method is compute_last_w from Fukuda 2007, pg. 12 -#Initialization is with w = ZZ.([0]) -#termination condition is V = [] -function new_next_gamma( - G::Oscar.IdealGens, w::Vector{ZZRingElem}, start::MonomialOrdering, target::MonomialOrdering - ) where {L<:MPolyRingElem} - V = new_filter_by_ordering(start, target, [ZZ.(v) for v in difference_lead_tail(G)]) - if w != ZZ.([0]) - V = new_filter_lf(w, S, T, V) - end - if isempty(V) - return v - end - minV = first(V) - for v in V - if facet_less_than(canonical_matrix(start), canonical_matrix(target),v, minV) - minV = v - end - end - return minV -end - -#= tests - - -R, (x,y,z) = polynomial_ring(QQ, ["x","y","z"]) - -o_s = lex(R) - -o_t= weight_ordering([1,3,0], deglex(R)) - -S = canonical_matrix(o_s) -T = canonical_matrix(o_t) - -V = [ZZ.([0, 3, -3]), ZZ.([1, -2, 1]), ZZ.([1,1,-2]), ZZ.([2,-1,-1])] - -u = ZZ.([1,-2,1]) -v = ZZ.([2,-1,-1]) -filter_by_ordering(o_s, o_t, V) - - - -matrix_less_than(S, ZZ.([3,2,1]), ZZ.([3,3,3])) - - -I = ideal([x^2 + y*z, x*y + z^2]) - -Gfinal = groebner_walk(I) - -=# \ No newline at end of file diff --git a/src/new_generic_walk/fukuda_example.jl b/src/new_generic_walk/fukuda_example.jl new file mode 100644 index 000000000000..06361032574a --- /dev/null +++ b/src/new_generic_walk/fukuda_example.jl @@ -0,0 +1,51 @@ +#The example from section 5 of "The generic Gröbner Walk" (Fukuda et al. 2007) + +using Oscar + + +include("new_generic_walk.jl") + +R, (x,y) = polynomial_ring(QQ, ["x","y"]) + +I = ideal([x^2 - y^3, x^3 - y^2 - x]) + +start = degrevlex(R) +target = lex(R) +G = groebner_basis(I, ordering = start) +new_generic_walk(G, start, target) #success! + + + +#= Go through the example step by step +Lm = leading_term.(G, ordering = start) + +w = new_next_gamma(G, Lm, [ZZ.(0)], start, target) + +inwG = new_facet_initials(G, Lm, w) + +(G2, Lm2) = new_generic_step(G, Lm, w, target) + +G2 = Oscar.IdealGens(G2) + +w2 = new_next_gamma(G2, Lm2, w , start, target) + +inw2G = new_facet_initials(G2, Lm2, w2) + +new_lift_generic(gens(G2), Lm2, inw2G, target) #success! This is correct + +(G, Lm) = new_generic_step(G, Lm, w2, target) + +G = Oscar.IdealGens(G) + +w3 = new_next_gamma(G, Lm, w2, start, target) + +inwG = new_facet_initials(G, Lm, w3) + +(G,Lm) = new_generic_step(G,Lm,w3,target) + +G = Oscar.IdealGens(G) + +w4 = new_next_gamma(G,Lm,w3, start, target) + +terminate +=# \ No newline at end of file diff --git a/src/new_generic_walk/new_generic_step.jl b/src/new_generic_walk/new_generic_step.jl new file mode 100644 index 000000000000..5c4a80aa173b --- /dev/null +++ b/src/new_generic_walk/new_generic_step.jl @@ -0,0 +1,136 @@ +using Oscar + +#include("new_next_gamma.jl") + + + +#TODO: This function is asymmetric; For v = 0 and any u, new_is_parallel(u,v) = true but new_is_parallel(v,u) is false +#This is not a problem, as both u and v are non-zero in our setting +#Nevertheless, this should be fixed +function new_is_parallel(u::Vector{ZZRingElem}, v::Vector{ZZRingElem}) + count = 1 + x = 0 + for i = 1:length(u) + if u[i] == 0 + if v[count] == 0 + count += +1 + else + return false + end + else + x = v[count] // u[i] + count += 1 + break + end + end + if count > length(v) + return true + end + for i = count:length(v) + @inbounds if v[i] != x * u[i] + return false + end + end + return true + +end + + +#INPUT: A Gröbner basis G, the set lm of leading monomials of elements of G, a vector v +#OUTPUT: The set of initial forms inw(G), where w is a vector lying on the facet defined by v +function new_facet_initials(G::Oscar.IdealGens, lm::Vector{T}, v::Vector{ZZRingElem} + ) where {T<:MPolyRingElem} +inwG = copy(lm) +generators = gens(G) + for i in 1:length(lm) + a = first(exponent_vector.(monomials(lm[i]), Ref(1))) + for (b, coeff) in zip(exponent_vectors(generators[i]), + [leading_coefficient(term) for term in terms(generators[i])]) + if new_is_parallel(ZZ.(a-b), v) + inwG[i] += coeff*monomial(R,b) + end + end + end + return inwG +end + + +#= The lifting step, as described in "The generic Gröbner walk" (Fukuda et al 2007), pg.8 + + Given a set of initial forms inwG of the marked Gröbner basis G, + convert inwG to a Gröbner basis M of InwI w.r.t "target", and + "lift" M to a Gröbner basis of I by subtracting from each m in M + its normal form w.r.t the starting basis G. + +=# + +function new_lift_generic(G::Vector{T}, Lm::Vector{T}, inwG::Vector{T}, target::MonomialOrdering +) where {T<:MPolyRingElem} + M = gens(groebner_basis(ideal(inwG), ordering = target, complete_reduction = true, algorithm=:buchberger)) + leading_newGB = Vector{MPolyRingElem}() + newGB = Vector{MPolyRingElem}() + for m in M + push!(newGB, m - reduce_walk(m, G, Lm, target)) + push!(leading_newGB, leading_term(m, ordering = target)) + end + return newGB, leading_newGB +end + + + +#TODO: I still need to have a proper look at these functions. Improvements may be possible + +#INPUT: A polynomial p, the generators of a marked G.B G, the leading monomials Lm, a monomial order ord +#OUTPUT: The normal form of p w.r.t the marked Gröbner basis G +#QUESTION: Where do I need ord? I think things all work without it +function reduce_walk( + p::MPolyRingElem, G::Vector{T}, Lm::Vector{T}, ord::MonomialOrdering +) where {T<:MPolyRingElem} + for i in 1:length(G) + (q, b) = divides_walk(p, Lm[i], parent(p)) + if b + return reduce_walk(p - (q * G[i]), G, Lm, ord) + end + end + return p +end + + +function divides_walk(p::MPolyRingElem, lm::MPolyRingElem, S::MPolyRing) + div = false + newpoly = MPolyBuildCtx(S) + for term in terms(p) + (b, c) = divides(term, lm) + if b + push_term!( + newpoly, first(coefficients(c)), first(AbstractAlgebra.exponent_vectors(c)) + ) + div = true + end + end + return finish(newpoly), div +end + + + +function new_generic_step( + G::Oscar.IdealGens, Lm::Vector{T}, v::Vector{ZZRingElem}, ord::MonomialOrdering +) where {T<:MPolyRingElem} + inwG = new_facet_initials(G, Lm, v) + + G, Lm = new_lift_generic(gens(G), Lm, inwG, ord) + G = interreduce(G, Lm, ord) + return G, Lm +end + +function interreduce( + G::Vector{T}, Lm::Vector{T}, ord::MonomialOrdering +) where {T<:MPolyRingElem} + for i in 1:length(G) + G[i] = reduce_walk(G[i], G[1:end .!= i], Lm[1:end .!= i], ord) + end + return G +end + + + diff --git a/src/new_generic_walk/new_generic_walk.jl b/src/new_generic_walk/new_generic_walk.jl new file mode 100644 index 000000000000..5de70d2df61e --- /dev/null +++ b/src/new_generic_walk/new_generic_walk.jl @@ -0,0 +1,17 @@ +include("new_generic_step.jl") +include("new_next_gamma.jl") + +function new_generic_walk(G::Oscar.IdealGens, start::MonomialOrdering, target::MonomialOrdering) + Lm = leading_term.(G, ordering = start) + v = new_next_gamma(G, Lm, ZZ.([0]), start, target) + + while !isempty(v) + G, Lm = new_generic_step(G, Lm, v, target) + + G = Oscar.IdealGens(G) + v = new_next_gamma(G, Lm, v, start, target) + end + return G + end + + diff --git a/src/new_generic_walk/new_next_gamma.jl b/src/new_generic_walk/new_next_gamma.jl new file mode 100644 index 000000000000..08d54497cf9d --- /dev/null +++ b/src/new_generic_walk/new_next_gamma.jl @@ -0,0 +1,133 @@ +#get all exponent vectors of a polynomial f +exponent_vectors = f->exponent_vector.(monomials(f), Ref(1)) + +#= +returns the set of bounding vectors of a marked Gröbner basis G, with markings given by Lm + +INPUT: A Gröbner basis G, a set of monomials Lm (the leading monomials of G) +OUTPUT: A set of n-dimensional integer vectors of the form a-b, +where a is the exponent vector of a leading monomoial of some g in G, +and b is the exponent vector of some other term +=# +function difference_lead_tail( + G::Oscar.IdealGens, Lm::Vector{L} +) where {L<:MPolyRingElem} + lead_exp = Lm .|> exponent_vectors .|> first + + v = zip(lead_exp, exponent_vectors.(G)) .|> splat((l, t) -> Ref(l).-t) + + return unique!(reduce(vcat, v))[2:end] #temporary solution: the first element is always the zero vector? +end + + +function difference_lead_tail(I::Oscar.IdealGens) + lead_exp = leading_term.(I; ordering=ordering(I)) .|> exponent_vectors .|> first + tail_exps = tail.(I; ordering=ordering(I)) .|> exponent_vectors + + v = zip(lead_exp, tail_exps) .|> splat((l, t) -> Ref(l).-t) + + return unique!(reduce(vcat, v)) +end + + + + + +#returns 'true' if Mv <_{lex} 0 , 'false' otherwise +# <_{lex} is the lexicographic ordering on Q^n +#with the notation from my thesis, this is equivalent to v <_M 0 +function new_less_than_zero(M::ZZMatrix, v::Vector{ZZRingElem}) + if is_zero(v) + return false + else + i = 1 + end + while dot(M[i, :], v) == 0 + i += 1 + end + return dot(M[i, :], v) < 0 +end + +#returns all v in V with 0 <_S v and v <_T 0 +#when V are the bounding vectors of a cone, this is the set of all "candidates" for the next facet normal +function new_filter_by_ordering(start::MonomialOrdering, target::MonomialOrdering, V::Vector{Vector{ZZRingElem}}) + pred = v->( + new_less_than_zero(canonical_matrix(target), ZZ.(v)) && !new_less_than_zero(canonical_matrix(start), ZZ.(v)) + ) + return unique!(filter(pred, V)) + end + + +#returns true if v <_M w , false otherwise +#i.e elements of the vectors Mv and Mw are compared until a tie is broken + +function matrix_less_than(M::ZZMatrix, v::Vector{ZZRingElem}, w::Vector{ZZRingElem}) + i = 1 + while dot(M[i, :], v) == dot(M[i, :], w) && i != number_of_rows(M) + i += 1 + end + return dot(M[i, :], v) < dot(M[i, :], w) +end + +#returns true if u < v w.r.t the Facet preorder (cf. "The generic Gröbner walk" (Fukuda et a;. 2007), pg. 10) +#Comment: It may make more sense to have the monomial orderings as inputs. +function facet_less_than(S::ZZMatrix, T::ZZMatrix, u::Vector{ZZRingElem}, v::Vector{ZZRingElem}) + i = 1 + while dot(T[i,:], u)v == dot(T[i,:], v)u && i != number_of_rows(T) + i += 1 + end + return matrix_less_than(S, dot(T[i,:], u)v, dot(T[i,:], v)u) +end + +#returns all elements of V smaller than w w.r.t the facet preorder +function new_filter_lf(w::Vector{ZZRingElem}, start::MonomialOrdering, target::MonomialOrdering, V::Vector{Vector{ZZRingElem}}) + btz = Vector{Vector{ZZRingElem}}() + for v in V + if facet_less_than(canonical_matrix(start),canonical_matrix(target),w,v) && !(v in btz) + push!(btz, v) + end + end + return btz +end + +#= +given a Gröbner basis G with markings given by Lm and the previous normal vector w, find the next one +This method is compute_last_w from Fukuda 2007, pg. 12 +Initialization is with w = ZZ.([0]) +termination condition is V = [] +=# + +function new_next_gamma( + G::Oscar.IdealGens, Lm::Vector{L}, w::Vector{ZZRingElem}, start::MonomialOrdering, target::MonomialOrdering + ) where {L<:MPolyRingElem} + V = new_filter_by_ordering(start, target, [ZZ.(v) for v in difference_lead_tail(G, Lm)]) + if w != ZZ.([0]) + V = new_filter_lf(w, start, target, V) + end + if isempty(V) + return V + end + minV = first(V) + for v in V + if facet_less_than(canonical_matrix(start), canonical_matrix(target),v, minV) + minV = v + end + end + return minV +end + + + + + +#= +function difference_lead_tail( + G::Oscar.IdealGens, Lm::Vector{L}, T::MonomialOrdering +) where {L<:MPolyRingElem} + lead_exp = leading_term.(Lm, ordering=T) .|> exponent_vectors .|> first + + v = zip(lead_exp, exponent_vectors.(G)) .|> splat((l, t) -> Ref(l).-t) + + return unique!(reduce(vcat, v))[2:end] #TEMPORARY SOLUTION +end +=# \ No newline at end of file diff --git a/src/new_generic_walk/thesis_example.jl b/src/new_generic_walk/thesis_example.jl new file mode 100644 index 000000000000..b27586f7a6c9 --- /dev/null +++ b/src/new_generic_walk/thesis_example.jl @@ -0,0 +1,47 @@ +using Oscar + +include("new_generic_walk.jl") + +R, (x,y,z) = polynomial_ring(QQ, ["x","y","z"]) + +o_s = lex(R) + +o_t= weight_ordering([1,3,0], deglex(R)) +S = canonical_matrix(o_s) +T = canonical_matrix(o_t) + +I = ideal([x^2 + y*z, x*y + z^2]) +G = groebner_basis(I, ordering = o_s) + +new_generic_walk(G, o_s, o_t) + +#= +Tests +Lm = leading_term.(G, ordering = o_s) +w = new_next_gamma(G, Lm, ZZ.([0]), o_s, o_t) +(newG, newLm) = new_generic_step(G, Lm, w, o_t) + + +newG = Oscar.IdealGens(newG) + +difference_lead_tail(newG, Lm) + +w2 = new_next_gamma(newG, newLm, w, o_s, o_t) + +(newnewG, newnewLm) = new_generic_step(newG, newLm, w2, o_t) + +newnewG = Oscar.IdealGens(newnewG) + +w3 = new_next_gamma(newnewG, newnewLm, w2,o_s, o_t) #throws an error. It should give an empty list (or some other signal that we're done) + +(finalG, finalLm) = new_generic_step(newnewG, newnewLm, w2, o_t) +finalG = Oscar.IdealGens(finalG) + +finalG, newnewG +new_filter_lf(w2, S, T, Vector(Vector{ZZRingElem}[])) + +generic_walk(G, o_s, o_t) + +difference_lead_tail(newnewG, newnewLm, o_t) #confusing output + +=# \ No newline at end of file diff --git a/src/walk.jl b/src/walk.jl index 4d2b2538fc53..7332c9c0f312 100644 --- a/src/walk.jl +++ b/src/walk.jl @@ -895,6 +895,8 @@ function facet_initials( end # returns the differences of the exponent vectors of the leading terms and the polynomials of the generators of I. +#Comment: I shouldn't need the ordering T here. (Lm already consists of monomials) + function difference_lead_tail( G::Oscar.IdealGens, Lm::Vector{L}, T::MonomialOrdering ) where {L<:MPolyRingElem} @@ -1042,7 +1044,7 @@ end # tests if v<0 w.r.t. the ordering M. less_than_zero(M::MonomialOrdering, v::Vector{Int}) = less_than_zero(canonical_matrix(M), v) -less_than_zero(M::ZZMatrix, v::Vector{ZZRingElem}) = less_than_zero(M, v) +less_than_zero(M::ZZMatrix, v::Vector{ZZRingElem}) = new_less_than_zero(M, v) function less_than_zero(M::Matrix{Int}, v::Vector{Int}) nrows, ncols = size(M) for i in 1:nrows From ddfeaf232eb6a6a94f22e0e69bbe1c65e7656a7f Mon Sep 17 00:00:00 2001 From: Ortfs Date: Fri, 5 Apr 2024 15:15:51 +0200 Subject: [PATCH 025/179] removed old dependencies --- src/GroebnerWalk.jl | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/GroebnerWalk.jl b/src/GroebnerWalk.jl index 6395bb61b8e9..cc1107b30a81 100644 --- a/src/GroebnerWalk.jl +++ b/src/GroebnerWalk.jl @@ -5,7 +5,6 @@ exponent_vectors = f->exponent_vector.(monomials(f), Ref(1)) include("walk.jl") -include("facet_preorder.jl") @@ -21,10 +20,6 @@ export standard_step export next_weight export lift2 export difference_lead_tail -export less_than_zero -export new_less_than_zero - -export new_next_gamma function __init__() add_verbosity_scope(:groebner_walk) From b7a4db298c89e604aa5c85539a9b979eea9a72da Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Tue, 16 Apr 2024 22:30:30 +0200 Subject: [PATCH 026/179] Make this thing standalone --- Project.toml | 7 +++++++ src/GroebnerWalk.jl | 9 +++++++++ 2 files changed, 16 insertions(+) create mode 100644 Project.toml diff --git a/Project.toml b/Project.toml new file mode 100644 index 000000000000..0049e433abf9 --- /dev/null +++ b/Project.toml @@ -0,0 +1,7 @@ +name = "GroebnerWalk" +uuid = "6dc8777d-2b0c-4de5-9e3c-426c1820f6f9" +authors = ["Kamillo Ferry ", "Francesco Nowell "] +version = "0.1.0" + +[deps] +Oscar = "f1435218-dba5-11e9-1e4d-f1a5fab5fc13" diff --git a/src/GroebnerWalk.jl b/src/GroebnerWalk.jl index cc1107b30a81..39f02eadd9d0 100644 --- a/src/GroebnerWalk.jl +++ b/src/GroebnerWalk.jl @@ -6,6 +6,15 @@ exponent_vectors = f->exponent_vector.(monomials(f), Ref(1)) include("walk.jl") +import Oscar: weight_ordering, ZZRingElem, MonomialOrdering, ZZMatrix +import Oscar.Orderings: MatrixOrdering, _support_indices +function weight_ordering(w::Vector{ZZRingElem}, o::MonomialOrdering) + i = _support_indices(o.o) + m = ZZMatrix(1, length(w), w) + return MonomialOrdering(base_ring(o), MatrixOrdering(i, m, false))*o +end + +#weight_ordering(w::Vector{Int}, o::MonomialOrdering) = weight_ordering(ZZ.(w), o) export groebner_walk From f649edabb16cc90f331b9eb1b2c2476b05b53d19 Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Wed, 17 Apr 2024 20:02:33 +0200 Subject: [PATCH 027/179] Change order of `groebner_walk` arguments to most likely to be set by user --- src/walk.jl | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/src/walk.jl b/src/walk.jl index 7332c9c0f312..ef79bc1542b7 100644 --- a/src/walk.jl +++ b/src/walk.jl @@ -8,15 +8,15 @@ global infoLevel = 0 @doc raw""" groebner_walk( I::MPolyIdeal; - startOrder::MonomialOrdering = default_ordering(base_ring(I)), targetOrder::Symbol = lex(base_ring(I)), + startOrder::MonomialOrdering = default_ordering(base_ring(I)); walktype::Symbol = :standard, perturbationDegree::Int = 2 ) groebner_walk( G::Oscar.IdealGens, - startOrder::Union{Matrix{N}, MatElem{N}}, targetOrder::Union{Matrix{N}, MatElem{N}}, + startOrder::Union{Matrix{N}, MatElem{N}}, walktype::Symbol = :standard, perturbationDegree::Int = 2 ) where N @@ -34,8 +34,8 @@ One can choose a strategy of: # Arguments - `I::MPolyIdeal`: ideal one wants to compute a Groebner basis for. - `G::Oscar.IdealGens`: generators of an ideal one wants to compute a Groebner basis for. -- `startOrder::MonomialOrdering=:degrevlex`: monomial order to begin the conversion. -- `targetOrder::MonomialOrdering=:lex`: monomial order one wants to compute a Groebner basis for. +- `target::MonomialOrdering=:lex`: monomial order one wants to compute a Groebner basis for. +- `start::MonomialOrdering=:degrevlex`: monomial order to begin the conversion. - `walktype::Symbol=standard`: strategy of the Groebner Walk. One can choose a strategy of: - `standard`: Standard Walk, - `perturbed`: Perturbed Walk, @@ -97,18 +97,20 @@ matrix_ordering([x, y], [1 0; 0 1]) ``` """ function groebner_walk( - I::MPolyIdeal, - start::MonomialOrdering = default_ordering(base_ring(I)), + I::MPolyIdeal, target::MonomialOrdering = lex(base_ring(I)), - perturbationDegree = 2; - walk_type::Symbol = :standard + start::MonomialOrdering = default_ordering(base_ring(I)); + perturbation_degree = 2, + algorithm::Symbol = :standard ) - if walk_type == :standard + if algorithm == :standard walk = (x) -> standard_walk(x, start, target) - elseif walk_type == :generic + elseif algorithm == :generic walk = (x) -> generic_walk(x, start, target) + elseif algorithm == :perturbed + walk = (x) -> perturbed_walk(x, start, target, perturbation_degree) else - throw(NotImplementedError(:groebner_walk, walk_type)) + throw(NotImplementedError(:groebner_walk, algorithm)) end Gb = groebner_basis(I; ordering=start, complete_reduction=true) @@ -122,8 +124,8 @@ end function groebner_walk( G::Union{Oscar.IdealGens,MPolyIdeal}, - S::Union{Matrix{N},MatElem{N}}, T::Union{Matrix{N},MatElem{N}}, + S::Union{Matrix{N},MatElem{N}}, walktype::Symbol=:standard, p::Int=2, ) where {N} From c721bbdcccd5c2a7a952f9723647b724369e0c43 Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Wed, 17 Apr 2024 20:05:51 +0200 Subject: [PATCH 028/179] Remove unused argument --- src/walk.jl | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/walk.jl b/src/walk.jl index ef79bc1542b7..bc9f106610d9 100644 --- a/src/walk.jl +++ b/src/walk.jl @@ -192,12 +192,11 @@ function standard_walk( start_weight = canonical_matrix(start)[1,:] target_weight = canonical_matrix(target)[1,:] - return standard_walk(G, start, target, start_weight, target_weight) + return standard_walk(G, target, start_weight, target_weight) end standard_walk(G::Oscar.IdealGens, S::ZZMatrix, T::ZZMatrix) = standard_walk( G, - matrix_ordering(base_ring(G), S), matrix_ordering(base_ring(G), T), S[1, :], T[1, :] @@ -205,7 +204,6 @@ standard_walk(G::Oscar.IdealGens, S::ZZMatrix, T::ZZMatrix) = standard_walk( function standard_walk( G::Oscar.IdealGens, - start::MonomialOrdering, target::MonomialOrdering, current_weight::Vector{ZZRingElem}, target_weight::Vector{ZZRingElem}; From 149a4c06027c7d8610b37b881a95986cd7a6924d Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Wed, 17 Apr 2024 20:11:21 +0200 Subject: [PATCH 029/179] Remove a `while true` loop --- src/walk.jl | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/src/walk.jl b/src/walk.jl index bc9f106610d9..7dbb68d94aeb 100644 --- a/src/walk.jl +++ b/src/walk.jl @@ -213,23 +213,20 @@ function standard_walk( @v_do :groebner_walk steps = 0 - while true + while current_weight != target_weight G = standard_step(G, current_weight, target) - if current_weight == target_weight - @vprint :groebner_walk "Cones crossed: " - @vprintln :groebner_walk steps - - return G - else - current_weight = next_weight(G, current_weight, target_weight) - end + current_weight = next_weight(G, current_weight, target_weight) @v_do :groebner_walk steps+=1 - @vprintln :groebner_walk current_weight @vprintln :groebner_walk 2 G end + + @vprint :groebner_walk "Cones crossed: " + @vprintln :groebner_walk steps + + return G end ############################################################### From 0b7bc5de4604549e92c0502dac0e4cc9f417f574 Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Wed, 17 Apr 2024 20:39:35 +0200 Subject: [PATCH 030/179] Import some stuff from OSCAR --- src/GroebnerWalk.jl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/GroebnerWalk.jl b/src/GroebnerWalk.jl index 39f02eadd9d0..465827892048 100644 --- a/src/GroebnerWalk.jl +++ b/src/GroebnerWalk.jl @@ -6,8 +6,9 @@ exponent_vectors = f->exponent_vector.(monomials(f), Ref(1)) include("walk.jl") -import Oscar: weight_ordering, ZZRingElem, MonomialOrdering, ZZMatrix +import Oscar: weight_ordering, ZZRingElem, MonomialOrdering, ZZMatrix, IdealGens import Oscar.Orderings: MatrixOrdering, _support_indices + function weight_ordering(w::Vector{ZZRingElem}, o::MonomialOrdering) i = _support_indices(o.o) m = ZZMatrix(1, length(w), w) From 119f367770a1497b3648a5805c26b6c699621561 Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Wed, 17 Apr 2024 22:16:56 +0200 Subject: [PATCH 031/179] Enable debug print --- src/walk.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/walk.jl b/src/walk.jl index 7dbb68d94aeb..3e5d44016842 100644 --- a/src/walk.jl +++ b/src/walk.jl @@ -116,7 +116,7 @@ function groebner_walk( Gb = groebner_basis(I; ordering=start, complete_reduction=true) Gb = walk(Gb) - # @vprintln :groebner_walk "Cones crossed: " + @vprintln :groebner_walk "Cones crossed: " # delete_step_counter() return Oscar.IdealGens(gens(Gb), target; isGB=true) From 5458d20e74b4760c54ffa908247a410c2b053ed2 Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Wed, 17 Apr 2024 22:19:15 +0200 Subject: [PATCH 032/179] Cleanup generic and perturbed walks --- src/walk.jl | 285 ++++++++++++++++++++++++---------------------------- 1 file changed, 131 insertions(+), 154 deletions(-) diff --git a/src/walk.jl b/src/walk.jl index 3e5d44016842..a85a16473eb6 100644 --- a/src/walk.jl +++ b/src/walk.jl @@ -188,7 +188,6 @@ function standard_walk( start::MonomialOrdering, target::MonomialOrdering ) - start_weight = canonical_matrix(start)[1,:] target_weight = canonical_matrix(target)[1,:] @@ -247,7 +246,6 @@ function standard_step(G::Oscar.IdealGens, w::Vector{ZZRingElem}, target::Monomi return interreduce_walk(H) end - standard_step(G::Oscar.IdealGens, w::Vector{Int}, T::Matrix{Int}) = standard_step(G, ZZ.(w), create_ordering(base_ring(G), w, T)) ############################################################### @@ -256,37 +254,28 @@ standard_step(G::Oscar.IdealGens, w::Vector{Int}, T::Matrix{Int}) = standard_ste function generic_walk(G::Oscar.IdealGens, start::MonomialOrdering, target::MonomialOrdering) Lm = leading_term.(G; ordering=start) - v = next_gamma(G, Lm, [ZZ(0)], start, target) + V = next_gamma(G, Lm, zeros(ZZRingElem, 1), start, target) @vprintln :groebner_walk "Results for generic_walk" @vprintln :groebner_walk "Facets crossed for: " -end - -function generic_walk(G::Oscar.IdealGens, S::Matrix{Int}, T::Matrix{Int}) - Lm = [leading_term(g; ordering=matrix_ordering(base_ring(G), S)) for g in G] - v = next_gamma(G, Lm, [0], S, T) - ordNew = matrix_ordering(base_ring(G), T) - - @vprintln :groebner_walk "generic_walk results" - @vprintln :groebner_walk "Facets crossed for: " - - while !isempty(v) - G, Lm = generic_step(G, Lm, v, ordNew) - raise_step_counter() - - - @vprintln :groebner_walk v + while !isempty(V) + G, Lm = generic_step(G, Lm, V, target) + + # TODO: increase step_counter here + @vprintln :groebner_walk V @vprintln :groebner_walk 2 G - G = Oscar.IdealGens(G, ordNew) - v = next_gamma(G, Lm, v, S, T) + G = IdealGens(G, target) + V = next_gamma(G, Lm, V, start, target) end + return G end +generic_walk(G::Oscar.IdealGens, S::Matrix{Int}, T::Matrix{Int}) = generic_walk(G, monomial_ordering(base_ring(G), S), monomial_ordering(base_ring(G), T)) function generic_step( - G::Oscar.IdealGens, Lm::Vector{T}, v::Vector{Int}, ord::MonomialOrdering + G::Oscar.IdealGens, Lm::Vector{T}, v::Vector{ZZRingElem}, ord::MonomialOrdering ) where {T<:MPolyRingElem} facet_Generators = facet_initials(G, Lm, v) H = groebner_basis( @@ -301,26 +290,36 @@ end # Perturbed-version of the Groebner Walk. ############################################################### -function perturbed_walk(G::Oscar.IdealGens, S::Matrix{Int}, T::Matrix{Int}, p::Int) +function perturbed_walk( + G::Oscar.IdealGens, + start::MonomialOrdering, + target::MonomialOrdering, + p::Int +) @vprintln :groebner_walk "perturbed_walk results" @vprintln :groebner_walk "Crossed Cones in: " - currweight = perturbed_vector(G, S, p) + R = base_ring(G) + S = canonical_matrix(start) + T = canonical_matrix(target) - while true - tarweight = perturbed_vector(G, T, p) - Tn = add_weight_vector(tarweight, T) - G = standard_walk(G, S, Tn, currweight, tarweight) - if same_cone(G, T) - return G - else - p = p - 1 - currweight = tarweight - S = Tn - end + current_weight = perturbed_vector(G, S, p) + + while !same_cone(G, target) + target_weight = perturbed_vector(G, T, p) + next_target = matrix_ordering(R, add_weight_vector(target_weight, T)) + G = standard_walk(G, next_target, current_weight, target_weight) + + p = p - 1 + current_weight = target_weight + S = next_target end + + return G end +perturbed_walk(G::Oscar.IdealGens, S::Matrix{Int}, T::Matrix{Int}, p::Int) = perturbed_walk(G, matrix_ordering(base_ring(G),S), matrix_ordering(base_ring(G),T), p) + ############################################################### # The Fractal Walk ############################################################### @@ -871,23 +870,22 @@ end # returns the initials of the polynomials w.r.t. the vector v. function facet_initials( - G::Oscar.IdealGens, lm::Vector{T}, v::Vector{Int} -) where {T<:MPolyRingElem} - Rn = parent(first(G)) - initials = Array{Singular.elem_type(Rn),1}(undef, 0) - count = 1 - for g in G - inw = Singular.MPolyBuildCtx(Rn) - el = first(Singular.exponent_vectors(lm[count])) - for (e, c) in zip(Singular.exponent_vectors(g), Singular.coefficients(g)) - if el == e || isparallel(el - e, v) - Singular.push_term!(inw, c, e) + G::Oscar.IdealGens, lm::Vector{<:MPolyRingElem}, v::Vector{ZZRingElem} +) + initials = Vector{MPolyRingElem}() + + # TODO: this really wants marked Gröbner bases + ctx = MPolyBuildCtx(base_ring(G)) + for (g,el) in zip(G, exponent_vectors.(lm) .|> first) + for (c,e) in zip(coefficients(g), exponent_vectors(g)) + if el == e || is_parallel(ZZ.(el - e), v) + push_term!(ctx, c, e) end end - h = finish(inw) - push!(initials, h) - count += 1 + + push!(initials, finish(ctx)) end + return initials end @@ -904,6 +902,8 @@ function difference_lead_tail( return unique!(reduce(vcat, v)) end +difference_lead_tail(::Type{ZZRingElem}, G::Oscar.IdealGens, Lm::Vector{<:MPolyRingElem}, T::MonomialOrdering) = Vector{ZZRingElem}.(difference_lead_tail(G, Lm, T)) + # function difference_lead_tail( # G::Oscar.IdealGens, Lm::Vector{L}, T::Union{Matrix{N},MatElem{N}} # ) where {L<:MPolyRingElem,N} @@ -924,7 +924,7 @@ end # end # returns true if the vector u is parallel to the vector v. -function isparallel(u::Vector{Int}, v::Vector{Int}) +function is_parallel(u::Vector{T}, v::Vector{T}) where T count = 1 x = 0 for i in 1:length(u) @@ -966,98 +966,106 @@ function lift_generic( end # returns all v \in V if v<0 w.r.t. the ordering represented by T and v>0 w.r.t the ordering represented by S. -function filter_by_ordering(S::MonomialOrdering, T::MonomialOrdering, V::Vector{Vector{Int}}) +function filter_by_ordering(S::ZZMatrix, T::ZZMatrix, V::Vector{Vector{ZZRingElem}}) pred = v->( - less_than_zero(canonical_matrix(T), ZZ.(v)) && - greater_than_zero(canonical_matrix(S), ZZ.(v)) + less_than_zero(T, v) && + greater_than_zero(S, v) ) return unique!(filter(pred, V)) end -function filter_by_ordering(S::Matrix{Int}, T::Matrix{Int}, V::Vector{Vector{Int}}) - btz = Set{Vector{Int}}() - for v in V - if less_than_zero(T, v) && greater_than_zero(S, v) - push!(btz, v) - end - end - return btz -end +# function filter_by_ordering(S::Matrix{Int}, T::Matrix{Int}, V::Vector{Vector{Int}}) +# btz = Set{Vector{Int}}() +# for v in V +# if less_than_zero(T, v) && greater_than_zero(S, v) +# push!(btz, v) +# end +# end +# return btz +# end # returns all v \in V if wless_facet(w, v, start, target) + + return unique!(filter(pred, V)) end # computes the next vector in the generic walk. function next_gamma( - G::Oscar.IdealGens, Lm::Vector{L}, w::Vector{ZZRingElem}, start::MonomialOrdering, target::MonomialOrdering -) where {L<:MPolyRingElem} - V = filter_by_ordering(start, target, difference_lead_tail(G, Lm, target)) -end + G::Oscar.IdealGens, + Lm::Vector{<:MPolyRingElem}, + w::Vector{ZZRingElem}, + start::MonomialOrdering, + target::MonomialOrdering +) + S = canonical_matrix(start) + T = canonical_matrix(target) + + V = filter_by_ordering(S, T, difference_lead_tail(ZZRingElem, G, Lm, target)) -function next_gamma( - G::Oscar.IdealGens, Lm::Vector{L}, w::Vector{Int}, S::Matrix{Int}, T::Matrix{Int} -) where {L<:MPolyRingElem} - V = filter_by_ordering(S, T, difference_lead_tail(G, Lm, T)) - if (w != [0]) - V = filter_lf(w, S, T, V) + if (w != zeros(ZZRingElem, 1)) + V = filter_lf(w, S, T, V) #TODO end + if isempty(V) return V end - minV = first(V) - for v in V + + op = (minV,v) -> if less_facet(v, minV, S, T) - minV = v - end + return v + else return minV end - return minV + + return foldl(op, V; init=first(V)) end # tests if v>0 w.r.t. the ordering M. -greater_than_zero(M::MonomialOrdering, v::Vector{Int}) = greater_than_zero(canonical_matrix(M), v) # TODO What is the definition? # This should be the ordering on Q^n induced by M: ( u <_M v iff Mu <_lex Mv)? -function greater_than_zero(M::Matrix{Int}, v::Vector{Int}) - nrows, ncols = size(M) +function greater_than_zero(M::ZZMatrix, v::Vector{ZZRingElem}) + nrows, _ = size(M) + for i in 1:nrows - d = 0 - for j in 1:ncols - @inbounds d += M[i, j] * v[j] - end + d = dot(M[i,:], v) + if d != 0 return d > 0 end end + return false end # tests if v<0 w.r.t. the ordering M. -less_than_zero(M::MonomialOrdering, v::Vector{Int}) = less_than_zero(canonical_matrix(M), v) -less_than_zero(M::ZZMatrix, v::Vector{ZZRingElem}) = new_less_than_zero(M, v) -function less_than_zero(M::Matrix{Int}, v::Vector{Int}) - nrows, ncols = size(M) +# less_than_zero(M::ZZMatrix, v::Vector{ZZRingElem}) = new_less_than_zero(M, v) +function less_than_zero(M::ZZMatrix, v::Vector{ZZRingElem}) + nrows, _ = size(M) + for i in 1:nrows - d = 0 - for j in 1:ncols - @inbounds d += M[i, j] * v[j] - end + d = dot(M[i,:], v) + if d != 0 return d < 0 end end + return false end # tests if u max - max = temp - end - end - push!(m, max) - end - msum = 0 - for i in 2:p - msum += m[i] - end - maxdeg = 0 - for g in gens(G) - td = deg(g, n) - if (td > maxdeg) - maxdeg = td - end - end - e = maxdeg * msum + 1 + rows = [M[i,:] for i in 1:p] + + m = maximum.(Ref(abs), rows) + m_sum = sum(m) + max_deg = maximum(total_degree.(G)) # TODO: I think this is total degree + + e = max_deg * m_sum + 1 w = M[1, :] * e^(p - 1) for i in 2:p w += e^(p - i) * M[i, :] end + + w = sum(rows .* (p .- Vector(1:p))) + return convert_bounding_vector(w) end @@ -1255,16 +1250,7 @@ end #end # returns 'true' if the leading terms of G w.r.t the matrixordering T are the same as the leading terms of G with the current ordering. -function same_cone(G::Oscar.IdealGens, T::Matrix{Int}) - R = base_ring(G) - ord = matrix_ordering(R, T) - for g in gens(G) - if leading_term(g; ordering=ord) != leading_term(g; ordering=G.ord) - return false - end - end - return true -end +same_cone(G::Oscar.IdealGens, T::MonomialOrdering) = all(leading_term.(G; ordering=T) .== leading_term.(G; ordering=ordering(G))) # TODO: Actual docstring #= Lifting step from Proposition 3.2 of "The generic Gröbner walk" (Fukuda et al., 2005) @@ -1350,8 +1336,14 @@ function division_algorithm(p::T, f::Vector{T}, R::MPolyRing) where {T<:MPolyRin end # converts a vector wtemp by dividing the entries with gcd(wtemp). -convert_bounding_vector(w::Vector{T}) where {T<:Union{ZZRingElem, QQFieldElem}} = ZZ.(floor.(w//gcd(w))) - +function convert_bounding_vector(w::Vector{T}) where {T<:Union{ZZRingElem, QQFieldElem}} + c = gcd(w) + if c != 0 + return ZZ.(floor.(w//c)) + else + w + end +end # returns a copy of the PolynomialRing I, equipped with the ordering weight_ordering(cw)*matrix_ordering(T). create_ordering(R::MPolyRing, cw::Vector{L}, T::Matrix{Int}) where {L<:Number} = weight_ordering(cw, matrix_ordering(R, T)) @@ -1468,6 +1460,8 @@ function add_weight_vector(w::Vector{Int}, M::Matrix{Int}) ] end +add_weight_vector(w::Vector{ZZRingElem}, M::ZZMatrix) = ZZMatrix(add_weight_vector(Int.(w), Matrix{Int}(M))) + function ordering_as_matrix(ord::Symbol, nvars::Int) if ord == :lex return ident_matrix(nvars) @@ -1494,23 +1488,6 @@ function ordering_as_matrix(ord::Symbol, nvars::Int) end end -function deg(p::MPolyRingElem, n::Int) - max = 0 - for mon in Singular.monomials(p) - ev = Singular.exponent_vectors(mon) - sum = 0 - for e in ev - for i in 1:n - sum += e[i] - end - if (max < sum) - max = sum - end - end - end - return max -end - function checkInt32(w::Vector{Int}) for i in 1:length(w) if tryparse(Int32, string(w[i])) == nothing From f87106412d174eb55db0f8d1fb459302ad5457bf Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Thu, 18 Apr 2024 18:34:17 +0200 Subject: [PATCH 033/179] Add README.md --- README.md | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 34433a0f5a3e..d8661e6ebdac 100644 --- a/README.md +++ b/README.md @@ -2,12 +2,8 @@ ## Aims -This is an example for a file structure to set up a new package -in the experimental section. All files you find here are part of the -minimum requirements. See also the official Oscar documentation. +This package implements a several variants of the Gröbner walk algorithm in OSCAR. ## Status - -We plan to also provide a function to automatically copy this template -for you to start your own package. - +This repository represents the status of the code as a submission for MEGA 2024. +It is slated for inclusion into OSCAR as experimental package. \ No newline at end of file From 0a07f839998398d414a56793fc9cb923d33a3d3f Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Thu, 18 Apr 2024 23:08:20 +0200 Subject: [PATCH 034/179] Move some Standard walk procedures to own file --- src/standard_walk.jl | 178 +++++++++++++++++++++++++++++++++++++++++++ src/walk.jl | 136 --------------------------------- 2 files changed, 178 insertions(+), 136 deletions(-) create mode 100644 src/standard_walk.jl diff --git a/src/standard_walk.jl b/src/standard_walk.jl new file mode 100644 index 000000000000..1db600b66554 --- /dev/null +++ b/src/standard_walk.jl @@ -0,0 +1,178 @@ +############################################################### +# Implementation of the standard walk. +############################################################### +@doc raw""" + standard_walk(G::Oscar.IdealGens, start::MonomialOrdering, target::MonomialOrdering) + +Compute a reduced Groebner basis w.r.t. to a monomial order by converting it using the Groebner Walk +using the algorithm proposed by Collart, Kalkbrener & Mall (1997). + +# Arguments +- `G::Oscar.IdealGens`: Groebner basis of an ideal with respect to a starting monomial order. +- `target::MonomialOrdering`: monomial order one wants to compute a Groebner basis for. +- `start::MonomialOrdering`: monomial order to begin the conversion. +""" +function standard_walk( + G::Oscar.IdealGens, + target::MonomialOrdering +) + start = ordering(G) + start_weight = canonical_matrix(start)[1, :] + target_weight = canonical_matrix(target)[1, :] + + return standard_walk(G, target, start_weight, target_weight) +end + +@doc raw""" + standard_walk(G::Oscar.IdealGens, target::MonomialOrdering, current_weight::Vector{ZZRingElem}, target_weight::Vector{ZZRingElem}) + +Compute a reduced Groebner basis w.r.t. to the monomial order `target` by converting it using the Groebner Walk +using the algorithm proposed by Collart, Kalkbrener & Mall (1997). + +# Arguments +- `G::Oscar.IdealGens`: Groebner basis of an ideal with respect to a starting monomial order. +- `target::MonomialOrdering`: monomial order one wants to compute a Groebner basis for. +- `current_weight::Vector{ZZRingElem}`: weight vector representing the starting monomial order. +- `target_weight::Vector{ZZRingElem}`: weight vector representing the target weight. +""" +function standard_walk( + G::Oscar.IdealGens, + target::MonomialOrdering, + current_weight::Vector{ZZRingElem}, + target_weight::Vector{ZZRingElem}; +) + @vprintln :groebner_walk "Results for standard_walk" + @vprintln :groebner_walk "Crossed Cones in: " + + @v_do :groebner_walk steps = 0 + + while current_weight != target_weight + G = standard_step(G, current_weight, target) + + current_weight = next_weight(G, current_weight, target_weight) + + @v_do :groebner_walk steps += 1 + @vprintln :groebner_walk current_weight + @vprintln :groebner_walk 2 G + end + + @vprint :groebner_walk "Cones crossed: " + @vprintln :groebner_walk steps + + return G +end + +############################################################### +# The standard step is used for the strategies standard and perturbed. +############################################################### + +@doc raw""" + standard_step(G::Oscar.IdealGens, w::Vector{ZZRingElem}, target::MonomialOrdering) + +TODO + +# Arguments +- `G::Oscar.IdealGens`: Groebner basis of an ideal. +- `w::Vector{ZZRingElem}`: TODO +- `target::MonomialOrdering`: TODO +""" +function standard_step(G::Oscar.IdealGens, w::Vector{ZZRingElem}, target::MonomialOrdering) + current_ordering = ordering(G) + next = weight_ordering(w, target) + + Gw = ideal(initial_forms(G, w)) + + H = groebner_basis(Gw; ordering=next, complete_reduction=true) + H = lift(G, current_ordering, H, next) + + @vprintln :groebner_walk 3 Gw + @vprintln :groebner_walk 3 H + + return interreduce_walk(H) +end +standard_step(G::Oscar.IdealGens, w::Vector{Int}, T::Matrix{Int}) = standard_step(G, ZZ.(w), create_ordering(base_ring(G), w, T)) + +@doc raw""" + initial_form(f::MPolyRingElem, w::Vector{ZZRingElem}) + +Returns the initial form of `f` with respect to the weight vector `w`. +""" +function initial_form(f::MPolyRingElem, w::Vector{ZZRingElem}) + R = parent(f) + + ctx = MPolyBuildCtx(R) + + E = exponent_vectors(f) + WE = dot.(Ref(w), Vector{ZZRingElem}.(E)) + maxw = maximum(WE) + + for (e, c, we) in zip(E, coefficients(f), WE) + if we == maxw + push_term!(ctx, c, e) + end + end + + return finish(ctx) +end + +@doc raw""" + initial_form(G::Oscar.IdealGens, w::Vector{ZZRingElem}) + +Returns the initial form of each element in `G` with respect to the weight vector `w`. +""" +initial_forms(G::Oscar.IdealGens, w::Vector{ZZRingElem}) = initial_form.(G, Ref(w)) +initial_forms(G::Oscar.IdealGens, w::Vector{Int}) = initial_form.(G, Ref(ZZ.(w))) + +@doc raw""" + next_weight(G::Oscar.IdealGens, current::Vector{ZZRingElem}, target::Vector{ZZRingElem}) + +Returns the point furthest along the line segment conv(current,target) still in the starting cone +as described in Algorithm 5.2 on pg. 437 of "Using algebraic geometry" (Cox, Little, O'Shea, 2005). + +# Arguments +- G, a reduced GB w.r.t the current monomial order +- current, a weight vector in the current Gröbner cone (corresponding to G) +- target a target vector in the Gröbner cone of the target monomial order +""" +function next_weight(G::Oscar.IdealGens, current::Vector{ZZRingElem}, target::Vector{ZZRingElem}) + V = difference_lead_tail(G) + tmin = minimum(c//(c-t) for (c,t) in zip(dot.(Ref(current), V), dot.(Ref(target), V)) if t<0; init=1) + + @vprintln :groebner_walk 3 (QQ.(current) + tmin * QQ.(target-current)) + + return QQ.(current) + tmin * QQ.(target-current) |> convert_bounding_vector +end + +# Computes a list of "Bounding vectors" of a generating set of I + +# If the generating set is a G.B w.r.t some monmial order, +# then the bounding vectors form an H-description of the Gröbner cone + +# cf. "Using algebraic geometry", pg. 437 (CLO, 2005) + +#= Input: - generators of an ideal I (in practice a reduced G.B) + + Output: - a list of integer vectors of the form "exponent vector of leading monomial" - "exponent vector of tail monomial" + + QUESTIONS: - are leading terms being computed twice? (Once in leadexpv, once in tailexpvs) One instead could simply subtract leading terms, no? + - type instability? Do I want ints or ringelements? + + COMMENTS: - rename this to "BoundingVectors" or something similar (as in M2 implementation/master's thesis) + - generally, this is one of the routines where it would be really nice to have a "marked Gröbner basis" object + =# +@doc raw""" + difference_lead_tail(I::Oscar.IdealGens) + +Returns a list of "bounding vectors" of a Gröbner basis of `I`, as pairs of +"exponent vector of leading monomial" and "exponent vector of tail monomial". +The bounding vectors form an H-description of the Gröbner cone. +""" +function difference_lead_tail(I::Oscar.IdealGens) + # TODO: rename this to "BoundingVectors" or something similar (as in M2 implementation/master's thesis) + lead_exp = leading_term.(I; ordering=ordering(I)) .|> exponent_vectors .|> first + tail_exps = tail.(I; ordering=ordering(I)) .|> exponent_vectors + + v = zip(lead_exp, tail_exps) .|> splat((l, t) -> Ref(l).-t) + + return unique!(reduce(vcat, v)) +end \ No newline at end of file diff --git a/src/walk.jl b/src/walk.jl index a85a16473eb6..3ec756c85b0c 100644 --- a/src/walk.jl +++ b/src/walk.jl @@ -179,74 +179,6 @@ end function raise_step_counter() global counter = getstep_counter() + 1 end -############################################################### -# Implementation of the standard walk. -############################################################### - -function standard_walk( - G::Oscar.IdealGens, - start::MonomialOrdering, - target::MonomialOrdering -) - start_weight = canonical_matrix(start)[1,:] - target_weight = canonical_matrix(target)[1,:] - - return standard_walk(G, target, start_weight, target_weight) -end - -standard_walk(G::Oscar.IdealGens, S::ZZMatrix, T::ZZMatrix) = standard_walk( - G, - matrix_ordering(base_ring(G), T), - S[1, :], - T[1, :] -) - -function standard_walk( - G::Oscar.IdealGens, - target::MonomialOrdering, - current_weight::Vector{ZZRingElem}, - target_weight::Vector{ZZRingElem}; -) - @vprintln :groebner_walk "Results for standard_walk" - @vprintln :groebner_walk "Crossed Cones in: " - - @v_do :groebner_walk steps = 0 - - while current_weight != target_weight - G = standard_step(G, current_weight, target) - - current_weight = next_weight(G, current_weight, target_weight) - - @v_do :groebner_walk steps+=1 - @vprintln :groebner_walk current_weight - @vprintln :groebner_walk 2 G - end - - @vprint :groebner_walk "Cones crossed: " - @vprintln :groebner_walk steps - - return G -end - -############################################################### -# The standard step is used for the strategies standard and perturbed. -############################################################### - -function standard_step(G::Oscar.IdealGens, w::Vector{ZZRingElem}, target::MonomialOrdering) - current_ordering = ordering(G) - next = weight_ordering(w, target) - - Gw = ideal(initial_forms(G,w)) - - H = groebner_basis(Gw; ordering=next, complete_reduction=true) - H = lift(G, current_ordering, H, next) - - @vprintln :groebner_walk 3 Gw - @vprintln :groebner_walk 3 H - - return interreduce_walk(H) -end -standard_step(G::Oscar.IdealGens, w::Vector{Int}, T::Matrix{Int}) = standard_step(G, ZZ.(w), create_ordering(base_ring(G), w, T)) ############################################################### # Generic-version of the Groebner Walk. @@ -1121,23 +1053,6 @@ end # Several Procedures for the Groebner Walk ############################################################### - -# Computes the next weight vector as described in Algorithm 5.2 on pg. 437 of "Using algebraic geometry" (Cox, Little, O'Shea, 2005) -#= Input: - G, a reduced GB w.r.t the current monomial order - - cw, a weight vector in the current Gröbner cone (corresponding to G) - - tw a target vector in the Gröbner cone of the target monomial order - - Output: - The point furthest along the line segment conv(cw,tw) still in the starting cone -=# -function next_weight(G::Oscar.IdealGens, cw::Vector{ZZRingElem}, tw::Vector{ZZRingElem}) - V = difference_lead_tail(G) - tmin = minimum(c//(c-t) for (c,t) in zip(dot.(Ref(cw), V), dot.(Ref(tw), V)) if t<0; init=1) - - @vprintln :groebner_walk 3 (QQ.(cw) + tmin * QQ.(tw-cw)) - - return QQ.(cw) + tmin * QQ.(tw-cw) |> convert_bounding_vector -end - # multiplies every entry of the given weight w with 0.1 as long as it stays on the same halfspace as w. function truncw(G::Oscar.IdealGens, w::Vector{Int}, inw::Vector{T}) where {T<:MPolyRingElem} while !checkInt32(w) @@ -1154,57 +1069,6 @@ function truncw(G::Oscar.IdealGens, w::Vector{Int}, inw::Vector{T}) where {T<:MP return w, true end -# returns the initialform of G w.r.t. the given weight vector. -function initial_form(f::MPolyRingElem, w::Vector{ZZRingElem}) - R = parent(f) - - ctx = MPolyBuildCtx(R) - - E = exponent_vectors(f) - WE = dot.(Ref(w), Vector{ZZRingElem}.(E)) - maxw = maximum(WE) - - for (e,c,we) in zip(E, coefficients(f), WE) - if we == maxw - push_term!(ctx, c, e) - end - end - - return finish(ctx) -end - -initial_forms(G::Oscar.IdealGens, w::Vector{ZZRingElem}) = initial_form.(G, Ref(w)) -initial_forms(G::Oscar.IdealGens, w::Vector{Int}) = initial_form.(G, Ref(ZZ.(w))) - - -# Computes a list of "Bounding vectors" of a generating set of I - -# If the generating set is a G.B w.r.t some monmial order, -# then the bounding vectors form an H-description of the Gröbner cone - -# cf. "Using algebraic geometry", pg. 437 (CLO, 2005) - -#= Input: - generators of an ideal I (in practice a reduced G.B) - - Output: - a list of integer vectors of the form "exponent vector of leading monomial" - "exponent vector of tail monomial" - - QUESTIONS: - are leading terms being computed twice? (Once in leadexpv, once in tailexpvs) One instead could simply subtract leading terms, no? - - type instability? Do I want ints or ringelements? - - COMMENTS: - rename this to "BoundingVectors" or something similar (as in M2 implementation/master's thesis) - - generally, this is one of the routines where it would be really nice to have a "marked Gröbner basis" object - =# - - -function difference_lead_tail(I::Oscar.IdealGens) - lead_exp = leading_term.(I; ordering=ordering(I)) .|> exponent_vectors .|> first - tail_exps = tail.(I; ordering=ordering(I)) .|> exponent_vectors - - v = zip(lead_exp, tail_exps) .|> splat((l, t) -> Ref(l).-t) - - return unique!(reduce(vcat, v)) -end - # computes a p-perturbed vector from the matrix M. function perturbed_vector(G::Oscar.IdealGens, M::ZZMatrix, p::Int) n = size(M, 1) From 6d5a136f3c404cb06ced4c45926d456685fd608d Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Thu, 18 Apr 2024 23:09:02 +0200 Subject: [PATCH 035/179] Rename `difference_lead_tail` to `bounding_vectors` --- src/standard_walk.jl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/standard_walk.jl b/src/standard_walk.jl index 1db600b66554..249161ade2f9 100644 --- a/src/standard_walk.jl +++ b/src/standard_walk.jl @@ -135,7 +135,7 @@ as described in Algorithm 5.2 on pg. 437 of "Using algebraic geometry" (Cox, Lit - target a target vector in the Gröbner cone of the target monomial order """ function next_weight(G::Oscar.IdealGens, current::Vector{ZZRingElem}, target::Vector{ZZRingElem}) - V = difference_lead_tail(G) + V = bounding_vectors(G) tmin = minimum(c//(c-t) for (c,t) in zip(dot.(Ref(current), V), dot.(Ref(target), V)) if t<0; init=1) @vprintln :groebner_walk 3 (QQ.(current) + tmin * QQ.(target-current)) @@ -161,13 +161,13 @@ end - generally, this is one of the routines where it would be really nice to have a "marked Gröbner basis" object =# @doc raw""" - difference_lead_tail(I::Oscar.IdealGens) + bounding_vectors(I::Oscar.IdealGens) Returns a list of "bounding vectors" of a Gröbner basis of `I`, as pairs of "exponent vector of leading monomial" and "exponent vector of tail monomial". The bounding vectors form an H-description of the Gröbner cone. """ -function difference_lead_tail(I::Oscar.IdealGens) +function bounding_vectors(I::Oscar.IdealGens) # TODO: rename this to "BoundingVectors" or something similar (as in M2 implementation/master's thesis) lead_exp = leading_term.(I; ordering=ordering(I)) .|> exponent_vectors .|> first tail_exps = tail.(I; ordering=ordering(I)) .|> exponent_vectors From bdba49b1734b39a2e1b0b3bafd1aa52748dcb813 Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Thu, 18 Apr 2024 23:20:19 +0200 Subject: [PATCH 036/179] Don't compute lead_exp twice(?) --- src/standard_walk.jl | 24 +++++------------------- 1 file changed, 5 insertions(+), 19 deletions(-) diff --git a/src/standard_walk.jl b/src/standard_walk.jl index 249161ade2f9..2d5c7b797127 100644 --- a/src/standard_walk.jl +++ b/src/standard_walk.jl @@ -143,34 +143,20 @@ function next_weight(G::Oscar.IdealGens, current::Vector{ZZRingElem}, target::Ve return QQ.(current) + tmin * QQ.(target-current) |> convert_bounding_vector end -# Computes a list of "Bounding vectors" of a generating set of I - -# If the generating set is a G.B w.r.t some monmial order, -# then the bounding vectors form an H-description of the Gröbner cone - -# cf. "Using algebraic geometry", pg. 437 (CLO, 2005) - -#= Input: - generators of an ideal I (in practice a reduced G.B) - - Output: - a list of integer vectors of the form "exponent vector of leading monomial" - "exponent vector of tail monomial" - - QUESTIONS: - are leading terms being computed twice? (Once in leadexpv, once in tailexpvs) One instead could simply subtract leading terms, no? - - type instability? Do I want ints or ringelements? - - COMMENTS: - rename this to "BoundingVectors" or something similar (as in M2 implementation/master's thesis) - - generally, this is one of the routines where it would be really nice to have a "marked Gröbner basis" object - =# @doc raw""" bounding_vectors(I::Oscar.IdealGens) Returns a list of "bounding vectors" of a Gröbner basis of `I`, as pairs of "exponent vector of leading monomial" and "exponent vector of tail monomial". -The bounding vectors form an H-description of the Gröbner cone. +The bounding vectors form an H-description of the Gröbner cone. (cf. "Using algebraic geometry", pg. 437 (CLO, 2005)) TODO: consistent citations, compare with OSCAR """ function bounding_vectors(I::Oscar.IdealGens) # TODO: rename this to "BoundingVectors" or something similar (as in M2 implementation/master's thesis) + # TODO: Marked Gröbner basis lead_exp = leading_term.(I; ordering=ordering(I)) .|> exponent_vectors .|> first - tail_exps = tail.(I; ordering=ordering(I)) .|> exponent_vectors + # TODO: are leading terms being computed twice? (Once in leadexpv, once in tailexpvs) One instead could simply subtract leading terms, no? + tail_exps = zip(gens(I) .|> exponent_vectors, lead_exp) .|> splat((e, lead) -> filter(!=(lead), e)) + # tail_exps = tail.(I; ordering=ordering(I)) .|> exponent_vectors v = zip(lead_exp, tail_exps) .|> splat((l, t) -> Ref(l).-t) From b97b5b0955948ad2937ce2c6efb48f7aa8a721a0 Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Fri, 19 Apr 2024 00:16:35 +0200 Subject: [PATCH 037/179] Move perturbed_walk --- src/perturbed_walk.jl | 34 ++++++++++++++++++++++++++++++++++ src/walk.jl | 34 ---------------------------------- 2 files changed, 34 insertions(+), 34 deletions(-) create mode 100644 src/perturbed_walk.jl diff --git a/src/perturbed_walk.jl b/src/perturbed_walk.jl new file mode 100644 index 000000000000..220b910dfacc --- /dev/null +++ b/src/perturbed_walk.jl @@ -0,0 +1,34 @@ +############################################################### +# Perturbed-version of the Groebner Walk. +############################################################### + +function perturbed_walk( + G::Oscar.IdealGens, + start::MonomialOrdering, + target::MonomialOrdering, + p::Int + ) + @vprintln :groebner_walk "perturbed_walk results" + @vprintln :groebner_walk "Crossed Cones in: " + + R = base_ring(G) + S = canonical_matrix(start) + T = canonical_matrix(target) + + current_weight = perturbed_vector(G, S, p) + + while !same_cone(G, target) + target_weight = perturbed_vector(G, T, p) + next_target = matrix_ordering(R, add_weight_vector(target_weight, T)) + G = standard_walk(G, next_target, current_weight, target_weight) + + p = p - 1 + current_weight = target_weight + S = next_target + end + + return G + end + + perturbed_walk(G::Oscar.IdealGens, S::Matrix{Int}, T::Matrix{Int}, p::Int) = perturbed_walk(G, matrix_ordering(base_ring(G),S), matrix_ordering(base_ring(G),T), p) + \ No newline at end of file diff --git a/src/walk.jl b/src/walk.jl index 3ec756c85b0c..73a89f418e34 100644 --- a/src/walk.jl +++ b/src/walk.jl @@ -218,40 +218,6 @@ function generic_step( return G, Lm end -############################################################### -# Perturbed-version of the Groebner Walk. -############################################################### - -function perturbed_walk( - G::Oscar.IdealGens, - start::MonomialOrdering, - target::MonomialOrdering, - p::Int -) - @vprintln :groebner_walk "perturbed_walk results" - @vprintln :groebner_walk "Crossed Cones in: " - - R = base_ring(G) - S = canonical_matrix(start) - T = canonical_matrix(target) - - current_weight = perturbed_vector(G, S, p) - - while !same_cone(G, target) - target_weight = perturbed_vector(G, T, p) - next_target = matrix_ordering(R, add_weight_vector(target_weight, T)) - G = standard_walk(G, next_target, current_weight, target_weight) - - p = p - 1 - current_weight = target_weight - S = next_target - end - - return G -end - -perturbed_walk(G::Oscar.IdealGens, S::Matrix{Int}, T::Matrix{Int}, p::Int) = perturbed_walk(G, matrix_ordering(base_ring(G),S), matrix_ordering(base_ring(G),T), p) - ############################################################### # The Fractal Walk ############################################################### From a2fe385205da5e161715f2cd4bbedb6e84d2d043 Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Fri, 19 Apr 2024 00:18:51 +0200 Subject: [PATCH 038/179] Move to `perturbed_walk.jl` --- src/GroebnerWalk.jl | 5 +-- src/perturbed_walk.jl | 75 +++++++++++++++++++++++++++---------------- src/walk.jl | 68 +++++++++++++++------------------------ 3 files changed, 75 insertions(+), 73 deletions(-) diff --git a/src/GroebnerWalk.jl b/src/GroebnerWalk.jl index 465827892048..ab63248a9ee7 100644 --- a/src/GroebnerWalk.jl +++ b/src/GroebnerWalk.jl @@ -4,7 +4,8 @@ using Oscar exponent_vectors = f->exponent_vector.(monomials(f), Ref(1)) include("walk.jl") - +include("standard_walk.jl") +include("perturbed_walk.jl") import Oscar: weight_ordering, ZZRingElem, MonomialOrdering, ZZMatrix, IdealGens import Oscar.Orderings: MatrixOrdering, _support_indices @@ -29,7 +30,7 @@ export initial_forms export standard_step export next_weight export lift2 -export difference_lead_tail +export bounding_vectors function __init__() add_verbosity_scope(:groebner_walk) diff --git a/src/perturbed_walk.jl b/src/perturbed_walk.jl index 220b910dfacc..73e5cef5b989 100644 --- a/src/perturbed_walk.jl +++ b/src/perturbed_walk.jl @@ -3,32 +3,51 @@ ############################################################### function perturbed_walk( - G::Oscar.IdealGens, - start::MonomialOrdering, - target::MonomialOrdering, - p::Int - ) - @vprintln :groebner_walk "perturbed_walk results" - @vprintln :groebner_walk "Crossed Cones in: " - - R = base_ring(G) - S = canonical_matrix(start) - T = canonical_matrix(target) - - current_weight = perturbed_vector(G, S, p) - - while !same_cone(G, target) - target_weight = perturbed_vector(G, T, p) - next_target = matrix_ordering(R, add_weight_vector(target_weight, T)) - G = standard_walk(G, next_target, current_weight, target_weight) - - p = p - 1 - current_weight = target_weight - S = next_target - end - - return G + G::Oscar.IdealGens, + start::MonomialOrdering, + target::MonomialOrdering, + p::Int +) + @vprintln :groebner_walk "perturbed_walk results" + @vprintln :groebner_walk "Crossed Cones in: " + + R = base_ring(G) + S = canonical_matrix(start) + T = canonical_matrix(target) + + current_weight = perturbed_vector(G, S, p) + + while !same_cone(G, target) + target_weight = perturbed_vector(G, T, p) + next_target = matrix_ordering(R, add_weight_vector(target_weight, T)) + G = standard_walk(G, next_target, current_weight, target_weight) + + p = p - 1 + current_weight = target_weight + S = next_target + end + + return G +end + +perturbed_walk(G::Oscar.IdealGens, S::Matrix{Int}, T::Matrix{Int}, p::Int) = perturbed_walk(G, matrix_ordering(base_ring(G), S), matrix_ordering(base_ring(G), T), p) + +# computes a p-perturbed vector from the matrix M. +function perturbed_vector(G::Oscar.IdealGens, M::ZZMatrix, p::Int) + n = size(M, 1) + rows = [M[i, :] for i in 1:p] + + m = maximum.(Ref(abs), rows) + m_sum = sum(m) + max_deg = maximum(total_degree.(G)) # TODO: I think this is total degree + + e = max_deg * m_sum + 1 + w = M[1, :] * e^(p - 1) + for i in 2:p + w += e^(p - i) * M[i, :] end - - perturbed_walk(G::Oscar.IdealGens, S::Matrix{Int}, T::Matrix{Int}, p::Int) = perturbed_walk(G, matrix_ordering(base_ring(G),S), matrix_ordering(base_ring(G),T), p) - \ No newline at end of file + + w = sum(rows .* (p .- Vector(1:p))) + + return convert_bounding_vector(w) +end \ No newline at end of file diff --git a/src/walk.jl b/src/walk.jl index 73a89f418e34..550b7f952c6d 100644 --- a/src/walk.jl +++ b/src/walk.jl @@ -52,12 +52,12 @@ julia> R,(x,y) = polynomial_ring(QQ, ["x","y"]); julia> I = ideal([y^4+ x^3-x^2+x,x^4]); -julia> groebner_walk(I, degrevlex(R), lex(R), :standard) +julia> groebner_walk(I, lex(R)) Gröbner basis with elements -1 -> y^16 -2 -> x + y^12 - y^8 + y^4 +1 -> x + y^12 - y^8 + y^4 +2 -> y^16 with respect to the ordering -matrix_ordering([x, y], [1 0; 0 1]) +lex([x, y]) julia> groebner_walk(I, degrevlex(R), lex(R), :perturbed, 2) Gröbner basis with elements @@ -104,11 +104,13 @@ function groebner_walk( algorithm::Symbol = :standard ) if algorithm == :standard - walk = (x) -> standard_walk(x, start, target) + walk = (x) -> standard_walk(x, target) elseif algorithm == :generic walk = (x) -> generic_walk(x, start, target) elseif algorithm == :perturbed walk = (x) -> perturbed_walk(x, start, target, perturbation_degree) + elseif walktype == :fractal + walk = (x) -> fractal_walk(x, start, target) else throw(NotImplementedError(:groebner_walk, algorithm)) end @@ -116,9 +118,6 @@ function groebner_walk( Gb = groebner_basis(I; ordering=start, complete_reduction=true) Gb = walk(Gb) - @vprintln :groebner_walk "Cones crossed: " - # delete_step_counter() - return Oscar.IdealGens(gens(Gb), target; isGB=true) end @@ -364,26 +363,29 @@ end # This version checks if an entry of an intermediate weight vector is bigger than int32. In case of that the Buchberger-Algorithm is used to compute the Groebner basis of the ideal of the initialforms. ############################################################### -function fractal_walk(G::Oscar.IdealGens, S::Matrix{Int}, T::Matrix{Int}) +function fractal_walk(G::Oscar.IdealGens, S::MonomialOrdering, T::MonomialOrdering) @vprintln :groebner_walk "FractalWalk_standard results" @vprintln :groebner_walk "Crossed Cones in: " - global pTargetWeights = [perturbed_vector(G, T, i) for i in 1:nvars(base_ring(G))] + S = canonical_matrix(start) + T = canonical_matrix(target) + + pTargetWeights = [perturbed_vector(G, T, i) for i in 1:nvars(base_ring(G))] return fractal_recursion_step(G, S, T, S[1, :], pTargetWeights, 1) end function fractal_recursion_step( G::Oscar.IdealGens, - S::Matrix{Int}, - T::Matrix{Int}, - currweight::Vector{Int}, - pTargetWeights::Vector{Vector{Int}}, + S::ZZMatrix, + T::ZZMatrix, + current_weight::Vector{ZZRingElem}, + pTargetWeights::Vector{Vector{ZZRingElem}}, p::Int, ) R = base_ring(G) G.isGB = true - w = currweight - ordAlt = G.ord + w = current_weight + old_ordering = ordering(G) while true t = next_weight_fractal_walk(G, w, pTargetWeights[p]) @@ -392,7 +394,7 @@ function fractal_recursion_step( # -> Checking if G is already a Groebner basis w.r.t. T solves this problem and reduces computational effort since next_weight_fractal_walk returns 1 in the last step on every local path. if t == 1 && p != 1 if t == 1 && p != 1 if same_cone(G, T) - @vprintln :groebner_walk ("depth $p: in cone ", currweight, ".")... + @vprintln :groebner_walk ("depth $p: in cone ", current_weight, ".")... # Check if a target weight of pTargetWeights[p] and pTargetWeights[p-1] lies in the wrong cone. if !inCone(G, T, pTargetWeights, p) @@ -451,7 +453,7 @@ function fractal_recursion_step( Oscar.IdealGens(R, gens(Gw), ordAlt), S, T, - deepcopy(currweight), + deepcopy(current_weight), pTargetWeights, p + 1, ) @@ -460,7 +462,7 @@ function fractal_recursion_step( H = lift_fractal_walk(G, H, ordNew) G = interreduce_walk(H) ordAlt = ordNew - currweight = w + current_weight = w end end @@ -729,7 +731,7 @@ function next_weight_fractal_walk( return [0] end tmin = 1 - for v in difference_lead_tail(G) + for v in bounding_vectors(G) tw = dot(tweight, v) if tw < 0 cw = dot(cweight, v) @@ -790,7 +792,7 @@ end # returns the differences of the exponent vectors of the leading terms and the polynomials of the generators of I. #Comment: I shouldn't need the ordering T here. (Lm already consists of monomials) -function difference_lead_tail( +function bounding_vectors( G::Oscar.IdealGens, Lm::Vector{L}, T::MonomialOrdering ) where {L<:MPolyRingElem} lead_exp = leading_term.(Lm; ordering=T) .|> exponent_vectors .|> first @@ -800,7 +802,7 @@ function difference_lead_tail( return unique!(reduce(vcat, v)) end -difference_lead_tail(::Type{ZZRingElem}, G::Oscar.IdealGens, Lm::Vector{<:MPolyRingElem}, T::MonomialOrdering) = Vector{ZZRingElem}.(difference_lead_tail(G, Lm, T)) +bounding_vectors(::Type{ZZRingElem}, G::Oscar.IdealGens, Lm::Vector{<:MPolyRingElem}, T::MonomialOrdering) = Vector{ZZRingElem}.(bounding_vectors(G, Lm, T)) # function difference_lead_tail( # G::Oscar.IdealGens, Lm::Vector{L}, T::Union{Matrix{N},MatElem{N}} @@ -910,7 +912,7 @@ function next_gamma( S = canonical_matrix(start) T = canonical_matrix(target) - V = filter_by_ordering(S, T, difference_lead_tail(ZZRingElem, G, Lm, target)) + V = filter_by_ordering(S, T, bounding_vectors(ZZRingElem, G, Lm, target)) if (w != zeros(ZZRingElem, 1)) V = filter_lf(w, S, T, V) #TODO @@ -1035,26 +1037,6 @@ function truncw(G::Oscar.IdealGens, w::Vector{Int}, inw::Vector{T}) where {T<:MP return w, true end -# computes a p-perturbed vector from the matrix M. -function perturbed_vector(G::Oscar.IdealGens, M::ZZMatrix, p::Int) - n = size(M, 1) - rows = [M[i,:] for i in 1:p] - - m = maximum.(Ref(abs), rows) - m_sum = sum(m) - max_deg = maximum(total_degree.(G)) # TODO: I think this is total degree - - e = max_deg * m_sum + 1 - w = M[1, :] * e^(p - 1) - for i in 2:p - w += e^(p - i) * M[i, :] - end - - w = sum(rows .* (p .- Vector(1:p))) - - return convert_bounding_vector(w) -end - # returns 'true' if the leading terms of G w.r.t the matrixorder T are the same as the leading terms of G w.r.t the weighted monomial order with weight vector t and matrix T. #function inCone(G::Oscar.IdealGens, T::Union{Matrix{N}, MatElem{N}}, t::Vector{Int}) # R = change_order(G.base_ring, T) From 476f33258831fd50f3ee37fa11bd5d069b596274 Mon Sep 17 00:00:00 2001 From: Ortfs Date: Fri, 19 Apr 2024 14:56:52 +0200 Subject: [PATCH 039/179] removed new_generic_walk, added markedGB generic walk --- Manifest.toml | 861 +++++++++++++++++++++++ src/GroebnerWalk.jl | 3 +- src/markedGB.jl | 116 +++ src/markedGB_generic_walk.jl | 56 ++ src/markedGB_helpers.jl | 184 +++++ src/new_generic_walk/fukuda_example.jl | 51 -- src/new_generic_walk/new_generic_step.jl | 136 ---- src/new_generic_walk/new_generic_walk.jl | 17 - src/new_generic_walk/new_next_gamma.jl | 133 ---- src/new_generic_walk/thesis_example.jl | 47 -- 10 files changed, 1219 insertions(+), 385 deletions(-) create mode 100644 Manifest.toml create mode 100644 src/markedGB.jl create mode 100644 src/markedGB_generic_walk.jl create mode 100644 src/markedGB_helpers.jl delete mode 100644 src/new_generic_walk/fukuda_example.jl delete mode 100644 src/new_generic_walk/new_generic_step.jl delete mode 100644 src/new_generic_walk/new_generic_walk.jl delete mode 100644 src/new_generic_walk/new_next_gamma.jl delete mode 100644 src/new_generic_walk/thesis_example.jl diff --git a/Manifest.toml b/Manifest.toml new file mode 100644 index 000000000000..46b71c499747 --- /dev/null +++ b/Manifest.toml @@ -0,0 +1,861 @@ +# This file is machine-generated - editing it directly is not advised + +julia_version = "1.10.2" +manifest_format = "2.0" +project_hash = "65115cabba4ddcc4c529649a0e0a395536a9a242" + +[[deps.ASL_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "6252039f98492252f9e47c312c8ffda0e3b9e78d" +uuid = "ae81ac8f-d209-56e5-92de-9978fef736f9" +version = "0.1.3+0" + +[[deps.AbstractAlgebra]] +deps = ["InteractiveUtils", "LinearAlgebra", "MacroTools", "Preferences", "Random", "RandomExtensions", "SparseArrays", "Test"] +git-tree-sha1 = "20b4984a6fa7e22346b4f420125342142d367913" +uuid = "c3fe647b-3220-5bb0-a1ea-a7954cac585d" +version = "0.40.9" + +[[deps.Adapt]] +deps = ["LinearAlgebra", "Requires"] +git-tree-sha1 = "6a55b747d1812e699320963ffde36f1ebdda4099" +uuid = "79e6a3ab-5dfb-504d-930d-738a2a938a0e" +version = "4.0.4" +weakdeps = ["StaticArrays"] + + [deps.Adapt.extensions] + AdaptStaticArraysExt = "StaticArrays" + +[[deps.AlgebraicSolving]] +deps = ["LinearAlgebra", "Logging", "LoopVectorization", "Markdown", "Nemo", "Printf", "Random", "StaticArrays", "Test", "msolve_jll"] +git-tree-sha1 = "8f559bb41ca4749a940683a94f6316f1013d8210" +uuid = "66b61cbe-0446-4d5d-9090-1ff510639f9d" +version = "0.4.13" + +[[deps.Antic_jll]] +deps = ["Artifacts", "FLINT_jll", "GMP_jll", "JLLWrappers", "Libdl", "MPFR_jll", "Pkg"] +git-tree-sha1 = "4b354e5ef3d0a235515bd1b27af9cee3fa1de62c" +uuid = "e21ec000-9f72-519e-ba6d-10061e575a27" +version = "0.201.500+0" + +[[deps.Arb_jll]] +deps = ["Artifacts", "FLINT_jll", "GMP_jll", "JLLWrappers", "Libdl", "MPFR_jll", "Pkg"] +git-tree-sha1 = "a564158702b6a4d1fb53c3fa399e891d7599afa0" +uuid = "d9960996-1013-53c9-9ba4-74a4155039c3" +version = "200.2300.0+0" + +[[deps.ArgTools]] +uuid = "0dad84c5-d112-42e6-8d28-ef12dabb789f" +version = "1.1.1" + +[[deps.ArrayInterface]] +deps = ["Adapt", "LinearAlgebra", "SparseArrays", "SuiteSparse"] +git-tree-sha1 = "44691067188f6bd1b2289552a23e4b7572f4528d" +uuid = "4fba245c-0d91-5ea0-9b3e-6abc04ee57a9" +version = "7.9.0" + + [deps.ArrayInterface.extensions] + ArrayInterfaceBandedMatricesExt = "BandedMatrices" + ArrayInterfaceBlockBandedMatricesExt = "BlockBandedMatrices" + ArrayInterfaceCUDAExt = "CUDA" + ArrayInterfaceChainRulesExt = "ChainRules" + ArrayInterfaceGPUArraysCoreExt = "GPUArraysCore" + ArrayInterfaceReverseDiffExt = "ReverseDiff" + ArrayInterfaceStaticArraysCoreExt = "StaticArraysCore" + ArrayInterfaceTrackerExt = "Tracker" + + [deps.ArrayInterface.weakdeps] + BandedMatrices = "aae01518-5342-5314-be14-df237901396f" + BlockBandedMatrices = "ffab5731-97b5-5995-9138-79e8c1846df0" + CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba" + ChainRules = "082447d4-558c-5d27-93f4-14fc19e9eca2" + GPUArraysCore = "46192b85-c4d5-4398-a991-12ede77f4527" + ReverseDiff = "37e2e3b7-166d-5795-8a7a-e32c996b4267" + StaticArraysCore = "1e83bf80-4336-4d27-bf5d-d5a4f845583c" + Tracker = "9f7883ad-71c0-57eb-9f7f-b5c9e6d3789c" + +[[deps.Artifacts]] +uuid = "56f22d72-fd6d-98f1-02f0-08ddc0907c33" + +[[deps.Base64]] +uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f" + +[[deps.BinaryWrappers]] +deps = ["JLLWrappers", "Scratch"] +git-tree-sha1 = "7fea8f658689fa5062b23f4400eda888b7ae2aaa" +uuid = "f01c122e-0ea1-4f85-ad8f-907073ad7a9f" +version = "0.1.3" + +[[deps.BitTwiddlingConvenienceFunctions]] +deps = ["Static"] +git-tree-sha1 = "0c5f81f47bbbcf4aea7b2959135713459170798b" +uuid = "62783981-4cbd-42fc-bca8-16325de8dc4b" +version = "0.1.5" + +[[deps.Bzip2_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "9e2a6b69137e6969bab0152632dcb3bc108c8bdd" +uuid = "6e34b625-4abd-537c-b88f-471c36dfa7a0" +version = "1.0.8+1" + +[[deps.CPUSummary]] +deps = ["CpuId", "IfElse", "PrecompileTools", "Static"] +git-tree-sha1 = "601f7e7b3d36f18790e2caf83a882d88e9b71ff1" +uuid = "2a0fbf3d-bb9c-48f3-b0a9-814d99fd7ab9" +version = "0.2.4" + +[[deps.Calcium_jll]] +deps = ["Antic_jll", "Arb_jll", "Artifacts", "FLINT_jll", "GMP_jll", "JLLWrappers", "Libdl", "MPFR_jll", "Pkg"] +git-tree-sha1 = "37fd335ecca9bd6ab25a2a4d26b7b2f6fe64c246" +uuid = "fcfa6d1b-d8ce-59d5-8c0a-c0d7f69e4f40" +version = "0.401.100+0" + +[[deps.CloseOpenIntervals]] +deps = ["Static", "StaticArrayInterface"] +git-tree-sha1 = "70232f82ffaab9dc52585e0dd043b5e0c6b714f1" +uuid = "fb6a15b2-703c-40df-9091-08a04967cfa9" +version = "0.1.12" + +[[deps.Compat]] +deps = ["TOML", "UUIDs"] +git-tree-sha1 = "c955881e3c981181362ae4088b35995446298b80" +uuid = "34da2185-b29b-5c13-b0c7-acf172513d20" +version = "4.14.0" +weakdeps = ["Dates", "LinearAlgebra"] + + [deps.Compat.extensions] + CompatLinearAlgebraExt = "LinearAlgebra" + +[[deps.CompilerSupportLibraries_jll]] +deps = ["Artifacts", "Libdl"] +uuid = "e66e0078-7015-5450-92f7-15fbd957f2ae" +version = "1.1.0+0" + +[[deps.CpuId]] +deps = ["Markdown"] +git-tree-sha1 = "fcbb72b032692610bfbdb15018ac16a36cf2e406" +uuid = "adafc99b-e345-5852-983c-f28acb93d879" +version = "0.3.1" + +[[deps.CxxWrap]] +deps = ["Libdl", "MacroTools", "libcxxwrap_julia_jll"] +git-tree-sha1 = "3345cb637ca1efb2ebf7f5145558522b92660d1f" +uuid = "1f15a43c-97ca-5a2a-ae31-89f07a497df4" +version = "0.14.2" + +[[deps.Dates]] +deps = ["Printf"] +uuid = "ade2ca70-3891-5945-98fb-dc099432e06a" + +[[deps.DecFP]] +deps = ["DecFP_jll", "Printf", "Random", "SpecialFunctions"] +git-tree-sha1 = "4a10cec664e26d9d63597daf9e62147e79d636e3" +uuid = "55939f99-70c6-5e9b-8bb0-5071ed7d61fd" +version = "1.3.2" + +[[deps.DecFP_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "e9a8da19f847bbfed4076071f6fef8665a30d9e5" +uuid = "47200ebd-12ce-5be5-abb7-8e082af23329" +version = "2.0.3+1" + +[[deps.Distributed]] +deps = ["Random", "Serialization", "Sockets"] +uuid = "8ba89e20-285c-5b6f-9357-94700520ee1b" + +[[deps.DocStringExtensions]] +deps = ["LibGit2"] +git-tree-sha1 = "2fb1e02f2b635d0845df5d7c167fec4dd739b00d" +uuid = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae" +version = "0.9.3" + +[[deps.Downloads]] +deps = ["ArgTools", "FileWatching", "LibCURL", "NetworkOptions"] +uuid = "f43a241f-c20a-4ad4-852c-f6b1247861c6" +version = "1.6.0" + +[[deps.FLINT_jll]] +deps = ["Artifacts", "GMP_jll", "JLLWrappers", "Libdl", "MPFR_jll", "OpenBLAS32_jll"] +git-tree-sha1 = "4eef82c467ec1020174d96f83f44e1ef84061e8c" +uuid = "e134572f-a0d5-539d-bddf-3cad8db41a82" +version = "200.900.9+0" + +[[deps.FileWatching]] +uuid = "7b1f6079-737a-58dc-b8bc-7a2ca5c1b5ee" + +[[deps.GAP]] +deps = ["Artifacts", "Compat", "Downloads", "GAP_jll", "GAP_lib_jll", "GAP_pkg_juliainterface_jll", "InteractiveUtils", "Libdl", "MacroTools", "Markdown", "Ncurses_jll", "Pidfile", "Pkg", "REPL", "Random", "Scratch"] +git-tree-sha1 = "dd79bde23f1a96c7efd7ede3ffba51a61a767321" +uuid = "c863536a-3901-11e9-33e7-d5cd0df7b904" +version = "0.10.3" + +[[deps.GAP_jll]] +deps = ["Artifacts", "GMP_jll", "JLLWrappers", "Libdl", "Pkg", "Readline_jll", "Zlib_jll"] +git-tree-sha1 = "c3a00b8f8ced0887d52104d0a0df233d9efc79d4" +uuid = "5cd7a574-2c56-5be2-91dc-c8bc375b9ddf" +version = "400.1200.200+9" + +[[deps.GAP_lib_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "473b619163e30d9cc58d4a8f9d412e6ea8910fcf" +uuid = "de1ad85e-c930-5cd4-919d-ccd3fcafd1a3" +version = "400.1201.200+0" + +[[deps.GAP_pkg_juliainterface_jll]] +deps = ["Artifacts", "GAP_jll", "GAP_lib_jll", "JLLWrappers", "Libdl"] +git-tree-sha1 = "c5a0f16f0478ab067752861d3c9339f335832459" +uuid = "ba154793-3a7d-51ee-8800-e295b0cf7374" +version = "0.800.300+3" + +[[deps.GLPK_jll]] +deps = ["Artifacts", "GMP_jll", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "fe68622f32828aa92275895fdb324a85894a5b1b" +uuid = "e8aa6df9-e6ca-548a-97ff-1f85fc5b8b98" +version = "5.0.1+0" + +[[deps.GMP_jll]] +deps = ["Artifacts", "Libdl"] +uuid = "781609d7-10c4-51f6-84f2-b8444358ff6d" +version = "6.2.1+6" + +[[deps.Hecke]] +deps = ["AbstractAlgebra", "Dates", "Distributed", "InteractiveUtils", "LazyArtifacts", "Libdl", "LinearAlgebra", "Markdown", "Nemo", "Pkg", "Printf", "Random", "RandomExtensions", "Serialization", "SparseArrays"] +git-tree-sha1 = "bf7de4aedfcaff528747cb5dce419abf258d621b" +uuid = "3e1990a7-5d81-5526-99ce-9ba3ff248f21" +version = "0.30.9" +weakdeps = ["GAP", "Polymake"] + + [deps.Hecke.extensions] + GAPExt = "GAP" + PolymakeExt = "Polymake" + +[[deps.HostCPUFeatures]] +deps = ["BitTwiddlingConvenienceFunctions", "IfElse", "Libdl", "Static"] +git-tree-sha1 = "eb8fed28f4994600e29beef49744639d985a04b2" +uuid = "3e5b6fbb-0976-4d2c-9146-d79de83f2fb0" +version = "0.1.16" + +[[deps.Hwloc_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl"] +git-tree-sha1 = "ca0f6bf568b4bfc807e7537f081c81e35ceca114" +uuid = "e33a78d0-f292-5ffc-b300-72abe9b543c8" +version = "2.10.0+0" + +[[deps.IfElse]] +git-tree-sha1 = "debdd00ffef04665ccbb3e150747a77560e8fad1" +uuid = "615f187c-cbe4-4ef1-ba3b-2fcf58d6d173" +version = "0.1.1" + +[[deps.InteractiveUtils]] +deps = ["Markdown"] +uuid = "b77e0a4c-d291-57a0-90e8-8db25a27a240" + +[[deps.Ipopt_jll]] +deps = ["ASL_jll", "Artifacts", "CompilerSupportLibraries_jll", "JLLWrappers", "Libdl", "MUMPS_seq_jll", "SPRAL_jll", "libblastrampoline_jll"] +git-tree-sha1 = "546c40fd3718c65d48296dd6cec98af9904e3ca4" +uuid = "9cc047cb-c261-5740-88fc-0cf96f7bdcc7" +version = "300.1400.1400+0" + +[[deps.IrrationalConstants]] +git-tree-sha1 = "630b497eafcc20001bba38a4651b327dcfc491d2" +uuid = "92d709cd-6900-40b7-9082-c6be49f344b6" +version = "0.2.2" + +[[deps.JLLWrappers]] +deps = ["Artifacts", "Preferences"] +git-tree-sha1 = "7e5d6779a1e09a36db2a7b6cff50942a0a7d0fca" +uuid = "692b3bcd-3c85-4b1f-b108-f13ce0eb3210" +version = "1.5.0" + +[[deps.JSON]] +deps = ["Dates", "Mmap", "Parsers", "Unicode"] +git-tree-sha1 = "31e996f0a15c7b280ba9f76636b3ff9e2ae58c9a" +uuid = "682c06a0-de6a-54ab-a142-c8b1cf79cde6" +version = "0.21.4" + +[[deps.JSON3]] +deps = ["Dates", "Mmap", "Parsers", "PrecompileTools", "StructTypes", "UUIDs"] +git-tree-sha1 = "eb3edce0ed4fa32f75a0a11217433c31d56bd48b" +uuid = "0f8b85d8-7281-11e9-16c2-39a750bddbf1" +version = "1.14.0" + + [deps.JSON3.extensions] + JSON3ArrowExt = ["ArrowTypes"] + + [deps.JSON3.weakdeps] + ArrowTypes = "31f734f8-188a-4ce0-8406-c8a06bd891cd" + +[[deps.LLVMOpenMP_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl"] +git-tree-sha1 = "d986ce2d884d49126836ea94ed5bfb0f12679713" +uuid = "1d63c593-3942-5779-bab2-d838dc0a180e" +version = "15.0.7+0" + +[[deps.LZO_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "e5b909bcf985c5e2605737d2ce278ed791b89be6" +uuid = "dd4b983a-f0e5-5f8d-a1b7-129d4a5fb1ac" +version = "2.10.1+0" + +[[deps.LayoutPointers]] +deps = ["ArrayInterface", "LinearAlgebra", "ManualMemory", "SIMDTypes", "Static", "StaticArrayInterface"] +git-tree-sha1 = "62edfee3211981241b57ff1cedf4d74d79519277" +uuid = "10f19ff3-798f-405d-979b-55457f8fc047" +version = "0.1.15" + +[[deps.LazyArtifacts]] +deps = ["Artifacts", "Pkg"] +uuid = "4af54fe1-eca0-43a8-85a7-787d91b784e3" + +[[deps.LibCURL]] +deps = ["LibCURL_jll", "MozillaCACerts_jll"] +uuid = "b27032c2-a3e7-50c8-80cd-2d36dbcbfd21" +version = "0.6.4" + +[[deps.LibCURL_jll]] +deps = ["Artifacts", "LibSSH2_jll", "Libdl", "MbedTLS_jll", "Zlib_jll", "nghttp2_jll"] +uuid = "deac9b47-8bc7-5906-a0fe-35ac56dc84c0" +version = "8.4.0+0" + +[[deps.LibGit2]] +deps = ["Base64", "LibGit2_jll", "NetworkOptions", "Printf", "SHA"] +uuid = "76f85450-5226-5b5a-8eaa-529ad045b433" + +[[deps.LibGit2_jll]] +deps = ["Artifacts", "LibSSH2_jll", "Libdl", "MbedTLS_jll"] +uuid = "e37daf67-58a4-590a-8e99-b0245dd2ffc5" +version = "1.6.4+0" + +[[deps.LibSSH2_jll]] +deps = ["Artifacts", "Libdl", "MbedTLS_jll"] +uuid = "29816b5a-b9ab-546f-933c-edad1886dfa8" +version = "1.11.0+1" + +[[deps.Libdl]] +uuid = "8f399da3-3557-5675-b5ff-fb832c97cbdb" + +[[deps.LinearAlgebra]] +deps = ["Libdl", "OpenBLAS_jll", "libblastrampoline_jll"] +uuid = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" + +[[deps.LogExpFunctions]] +deps = ["DocStringExtensions", "IrrationalConstants", "LinearAlgebra"] +git-tree-sha1 = "18144f3e9cbe9b15b070288eef858f71b291ce37" +uuid = "2ab3a3ac-af41-5b50-aa03-7779005ae688" +version = "0.3.27" + + [deps.LogExpFunctions.extensions] + LogExpFunctionsChainRulesCoreExt = "ChainRulesCore" + LogExpFunctionsChangesOfVariablesExt = "ChangesOfVariables" + LogExpFunctionsInverseFunctionsExt = "InverseFunctions" + + [deps.LogExpFunctions.weakdeps] + ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4" + ChangesOfVariables = "9e997f8a-9a97-42d5-a9f1-ce6bfc15e2c0" + InverseFunctions = "3587e190-3f89-42d0-90ee-14403ec27112" + +[[deps.Logging]] +uuid = "56ddb016-857b-54e1-b83d-db4d58db5568" + +[[deps.LoopVectorization]] +deps = ["ArrayInterface", "CPUSummary", "CloseOpenIntervals", "DocStringExtensions", "HostCPUFeatures", "IfElse", "LayoutPointers", "LinearAlgebra", "OffsetArrays", "PolyesterWeave", "PrecompileTools", "SIMDTypes", "SLEEFPirates", "Static", "StaticArrayInterface", "ThreadingUtilities", "UnPack", "VectorizationBase"] +git-tree-sha1 = "a13f3be5d84b9c95465d743c82af0b094ef9c2e2" +uuid = "bdcacae8-1622-11e9-2a5c-532679323890" +version = "0.12.169" + + [deps.LoopVectorization.extensions] + ForwardDiffExt = ["ChainRulesCore", "ForwardDiff"] + SpecialFunctionsExt = "SpecialFunctions" + + [deps.LoopVectorization.weakdeps] + ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4" + ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210" + SpecialFunctions = "276daf66-3868-5448-9aa4-cd146d93841b" + +[[deps.METIS_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "1fd0a97409e418b78c53fac671cf4622efdf0f21" +uuid = "d00139f3-1899-568f-a2f0-47f597d42d70" +version = "5.1.2+0" + +[[deps.MPFR_jll]] +deps = ["Artifacts", "GMP_jll", "Libdl"] +uuid = "3a97d323-0669-5f0c-9066-3539efd106a3" +version = "4.2.0+1" + +[[deps.MUMPS_seq_jll]] +deps = ["Artifacts", "CompilerSupportLibraries_jll", "JLLWrappers", "Libdl", "METIS_jll", "libblastrampoline_jll"] +git-tree-sha1 = "840b83c65b27e308095c139a457373850b2f5977" +uuid = "d7ed1dd3-d0ae-5e8e-bfb4-87a502085b8d" +version = "500.600.201+0" + +[[deps.MacroTools]] +deps = ["Markdown", "Random"] +git-tree-sha1 = "2fa9ee3e63fd3a4f7a9a4f4744a52f4856de82df" +uuid = "1914dd2f-81c6-5fcd-8719-6d5c9610ff09" +version = "0.5.13" + +[[deps.ManualMemory]] +git-tree-sha1 = "bcaef4fc7a0cfe2cba636d84cda54b5e4e4ca3cd" +uuid = "d125e4d3-2237-4719-b19c-fa641b8a4667" +version = "0.1.8" + +[[deps.Markdown]] +deps = ["Base64"] +uuid = "d6f4376e-aef5-505a-96c1-9c027394607a" + +[[deps.MbedTLS_jll]] +deps = ["Artifacts", "Libdl"] +uuid = "c8ffd9c3-330d-5841-b78e-0817d7145fa1" +version = "2.28.2+1" + +[[deps.Mmap]] +uuid = "a63ad114-7e13-5084-954f-fe012c677804" + +[[deps.MongoC_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "OpenSSL_jll", "Pkg", "Zlib_jll", "Zstd_jll", "snappy_jll"] +git-tree-sha1 = "a9c90f9f48024f064fdfbd2f29826bd524acf33a" +uuid = "90100e71-7732-535a-9be7-2e9affd1cfc1" +version = "1.19.1+0" + +[[deps.Mongoc]] +deps = ["Dates", "DecFP", "MongoC_jll", "Serialization"] +git-tree-sha1 = "f47bf7ed9d9c1da0a632777ca7dc406e3ad5f923" +uuid = "4fe8b98c-fc19-5c23-8ec2-168ff83495f2" +version = "0.9.0" + +[[deps.MozillaCACerts_jll]] +uuid = "14a3606d-f60d-562e-9121-12d972cd8159" +version = "2023.1.10" + +[[deps.Ncurses_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl"] +git-tree-sha1 = "bd4eb207e17878ceec404e74130639b6dda8b63b" +uuid = "68e3532b-a499-55ff-9963-d1c0c0748b3a" +version = "6.4.1+0" + +[[deps.Nemo]] +deps = ["AbstractAlgebra", "Antic_jll", "Arb_jll", "Calcium_jll", "FLINT_jll", "Libdl", "LinearAlgebra", "Pkg", "Random", "RandomExtensions", "SHA"] +git-tree-sha1 = "29767dbbc3d04b81696f5f237dbf085a57408435" +uuid = "2edaba10-b0f1-5616-af89-8c11ac63239a" +version = "0.43.2" + +[[deps.NetworkOptions]] +uuid = "ca575930-c2e3-43a9-ace4-1e988b2c1908" +version = "1.2.0" + +[[deps.Ninja_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "e3d67b139972540f1c0a3a3ed8c2f48a7e7f304d" +uuid = "76642167-d241-5cee-8c94-7a494e8cb7b7" +version = "1.11.1+0" + +[[deps.OffsetArrays]] +git-tree-sha1 = "e64b4f5ea6b7389f6f046d13d4896a8f9c1ba71e" +uuid = "6fe1bfb0-de20-5000-8ca7-80f57d26f881" +version = "1.14.0" +weakdeps = ["Adapt"] + + [deps.OffsetArrays.extensions] + OffsetArraysAdaptExt = "Adapt" + +[[deps.OpenBLAS32_jll]] +deps = ["Artifacts", "CompilerSupportLibraries_jll", "JLLWrappers", "Libdl"] +git-tree-sha1 = "6065c4cff8fee6c6770b277af45d5082baacdba1" +uuid = "656ef2d0-ae68-5445-9ca0-591084a874a2" +version = "0.3.24+0" + +[[deps.OpenBLAS_jll]] +deps = ["Artifacts", "CompilerSupportLibraries_jll", "Libdl"] +uuid = "4536629a-c528-5b80-bd46-f80d51c5b363" +version = "0.3.23+4" + +[[deps.OpenLibm_jll]] +deps = ["Artifacts", "Libdl"] +uuid = "05823500-19ac-5b8b-9628-191a04bc5112" +version = "0.8.1+2" + +[[deps.OpenSSL_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl"] +git-tree-sha1 = "a12e56c72edee3ce6b96667745e6cbbe5498f200" +uuid = "458c3c95-2e84-50aa-8efc-19380b2a3a95" +version = "1.1.23+0" + +[[deps.OpenSpecFun_jll]] +deps = ["Artifacts", "CompilerSupportLibraries_jll", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "13652491f6856acfd2db29360e1bbcd4565d04f1" +uuid = "efe28fd5-8261-553b-a9e1-b2916fc3738e" +version = "0.5.5+0" + +[[deps.Oscar]] +deps = ["AbstractAlgebra", "AlgebraicSolving", "Distributed", "DocStringExtensions", "GAP", "Hecke", "JSON", "JSON3", "LazyArtifacts", "Nemo", "Pkg", "Polymake", "Preferences", "Random", "RandomExtensions", "Serialization", "Singular", "TOPCOM_jll", "UUIDs", "cohomCalg_jll"] +git-tree-sha1 = "f42a32f14fa7aa4223da69d24690d10d3e4cfb35" +uuid = "f1435218-dba5-11e9-1e4d-f1a5fab5fc13" +version = "1.0.2" + +[[deps.PPL_jll]] +deps = ["Artifacts", "GMP_jll", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "dc69ba2b374b5bd6e876fa3a8441563c0eeafb9e" +uuid = "80dd9cbb-8b87-5171-a280-372cc418f402" +version = "1.2.1+0" + +[[deps.Parsers]] +deps = ["Dates", "PrecompileTools", "UUIDs"] +git-tree-sha1 = "8489905bcdbcfac64d1daa51ca07c0d8f0283821" +uuid = "69de0a69-1ddd-5017-9359-2bf0b02dc9f0" +version = "2.8.1" + +[[deps.Perl_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Readline_jll"] +git-tree-sha1 = "7ab65a258bcf6da373cab49af462aead452d3960" +uuid = "83958c19-0796-5285-893e-a1267f8ec499" +version = "5.34.1+0" + +[[deps.Pidfile]] +deps = ["FileWatching", "Test"] +git-tree-sha1 = "2d8aaf8ee10df53d0dfb9b8ee44ae7c04ced2b03" +uuid = "fa939f87-e72e-5be4-a000-7fc836dbe307" +version = "1.3.0" + +[[deps.Pkg]] +deps = ["Artifacts", "Dates", "Downloads", "FileWatching", "LibGit2", "Libdl", "Logging", "Markdown", "Printf", "REPL", "Random", "SHA", "Serialization", "TOML", "Tar", "UUIDs", "p7zip_jll"] +uuid = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" +version = "1.10.0" + +[[deps.PolyesterWeave]] +deps = ["BitTwiddlingConvenienceFunctions", "CPUSummary", "IfElse", "Static", "ThreadingUtilities"] +git-tree-sha1 = "240d7170f5ffdb285f9427b92333c3463bf65bf6" +uuid = "1d0040c9-8b98-4ee7-8388-3f51789ca0ad" +version = "0.2.1" + +[[deps.Polymake]] +deps = ["BinaryWrappers", "CxxWrap", "Downloads", "JSON", "Libdl", "Mongoc", "MozillaCACerts_jll", "Ninja_jll", "Perl_jll", "Pkg", "REPL", "Scratch", "SparseArrays", "TOPCOM_jll", "lib4ti2_jll", "libpolymake_julia_jll", "polymake_jll", "polymake_oscarnumber_jll"] +git-tree-sha1 = "88e5a36d1231de98680b323f93cd1b7fdcc319c3" +uuid = "d720cf60-89b5-51f5-aff5-213f193123e7" +version = "0.11.15" + +[[deps.PrecompileTools]] +deps = ["Preferences"] +git-tree-sha1 = "5aa36f7049a63a1528fe8f7c3f2113413ffd4e1f" +uuid = "aea7be01-6a6a-4083-8856-8a6e6704d82a" +version = "1.2.1" + +[[deps.Preferences]] +deps = ["TOML"] +git-tree-sha1 = "9306f6085165d270f7e3db02af26a400d580f5c6" +uuid = "21216c6a-2e73-6563-6e65-726566657250" +version = "1.4.3" + +[[deps.Printf]] +deps = ["Unicode"] +uuid = "de0858da-6303-5e67-8744-51eddeeeb8d7" + +[[deps.REPL]] +deps = ["InteractiveUtils", "Markdown", "Sockets", "Unicode"] +uuid = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb" + +[[deps.Random]] +deps = ["SHA"] +uuid = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" + +[[deps.RandomExtensions]] +deps = ["Random", "SparseArrays"] +git-tree-sha1 = "b8a399e95663485820000f26b6a43c794e166a49" +uuid = "fb686558-2515-59ef-acaa-46db3789a887" +version = "0.4.4" + +[[deps.Readline_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Ncurses_jll"] +git-tree-sha1 = "9d70e0c890a6c7ca3eb1ca0eaabba4d34795b7fb" +uuid = "05236dd9-4125-5232-aa7c-9ec0c9b2c25a" +version = "8.2.1+0" + +[[deps.Requires]] +deps = ["UUIDs"] +git-tree-sha1 = "838a3a4188e2ded87a4f9f184b4b0d78a1e91cb7" +uuid = "ae029012-a4dd-5104-9daa-d747884805df" +version = "1.3.0" + +[[deps.SCIP_jll]] +deps = ["Artifacts", "Bzip2_jll", "CompilerSupportLibraries_jll", "GMP_jll", "Ipopt_jll", "JLLWrappers", "Libdl", "Pkg", "Readline_jll", "Zlib_jll", "bliss_jll", "boost_jll"] +git-tree-sha1 = "cf69186eb29307fbb2319b90e6133797bad983ce" +uuid = "e5ac4fe4-a920-5659-9bf8-f9f73e9e79ce" +version = "800.0.301+0" + +[[deps.SHA]] +uuid = "ea8e919c-243c-51af-8825-aaa63cd721ce" +version = "0.7.0" + +[[deps.SIMDTypes]] +git-tree-sha1 = "330289636fb8107c5f32088d2741e9fd7a061a5c" +uuid = "94e857df-77ce-4151-89e5-788b33177be4" +version = "0.1.0" + +[[deps.SLEEFPirates]] +deps = ["IfElse", "Static", "VectorizationBase"] +git-tree-sha1 = "3aac6d68c5e57449f5b9b865c9ba50ac2970c4cf" +uuid = "476501e8-09a2-5ece-8869-fb82de89a1fa" +version = "0.6.42" + +[[deps.SPRAL_jll]] +deps = ["Artifacts", "CompilerSupportLibraries_jll", "Hwloc_jll", "JLLWrappers", "Libdl", "METIS_jll", "libblastrampoline_jll"] +git-tree-sha1 = "34b9dacd687cace8aa4d550e3e9bb8615f1a61e9" +uuid = "319450e9-13b8-58e8-aa9f-8fd1420848ab" +version = "2024.1.18+0" + +[[deps.Scratch]] +deps = ["Dates"] +git-tree-sha1 = "3bac05bc7e74a75fd9cba4295cde4045d9fe2386" +uuid = "6c6a2e73-6563-6170-7368-637461726353" +version = "1.2.1" + +[[deps.Serialization]] +uuid = "9e88b42a-f829-5b0c-bbe9-9e923198166b" + +[[deps.Singular]] +deps = ["AbstractAlgebra", "BinaryWrappers", "CxxWrap", "Libdl", "LinearAlgebra", "Nemo", "Pidfile", "Pkg", "Random", "RandomExtensions", "Singular_jll", "Statistics", "lib4ti2_jll", "libsingular_julia_jll"] +git-tree-sha1 = "a12a7028afc5960a83436c051dc98be1434014d9" +uuid = "bcd08a7b-43d2-5ff7-b6d4-c458787f915c" +version = "0.22.6" + +[[deps.Singular_jll]] +deps = ["Artifacts", "FLINT_jll", "GMP_jll", "JLLWrappers", "Libdl", "MPFR_jll", "cddlib_jll"] +git-tree-sha1 = "ecd57fb5445348183ef39d3380035d102e7054b9" +uuid = "43d676ae-4934-50ba-8046-7a96366d613b" +version = "403.216.1602+0" + +[[deps.Sockets]] +uuid = "6462fe0b-24de-5631-8697-dd941f90decc" + +[[deps.SparseArrays]] +deps = ["Libdl", "LinearAlgebra", "Random", "Serialization", "SuiteSparse_jll"] +uuid = "2f01184e-e22b-5df5-ae63-d93ebab69eaf" +version = "1.10.0" + +[[deps.SpecialFunctions]] +deps = ["IrrationalConstants", "LogExpFunctions", "OpenLibm_jll", "OpenSpecFun_jll"] +git-tree-sha1 = "e2cfc4012a19088254b3950b85c3c1d8882d864d" +uuid = "276daf66-3868-5448-9aa4-cd146d93841b" +version = "2.3.1" + + [deps.SpecialFunctions.extensions] + SpecialFunctionsChainRulesCoreExt = "ChainRulesCore" + + [deps.SpecialFunctions.weakdeps] + ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4" + +[[deps.Static]] +deps = ["IfElse"] +git-tree-sha1 = "d2fdac9ff3906e27f7a618d47b676941baa6c80c" +uuid = "aedffcd0-7271-4cad-89d0-dc628f76c6d3" +version = "0.8.10" + +[[deps.StaticArrayInterface]] +deps = ["ArrayInterface", "Compat", "IfElse", "LinearAlgebra", "PrecompileTools", "Requires", "SparseArrays", "Static", "SuiteSparse"] +git-tree-sha1 = "5d66818a39bb04bf328e92bc933ec5b4ee88e436" +uuid = "0d7ed370-da01-4f52-bd93-41d350b8b718" +version = "1.5.0" +weakdeps = ["OffsetArrays", "StaticArrays"] + + [deps.StaticArrayInterface.extensions] + StaticArrayInterfaceOffsetArraysExt = "OffsetArrays" + StaticArrayInterfaceStaticArraysExt = "StaticArrays" + +[[deps.StaticArrays]] +deps = ["LinearAlgebra", "PrecompileTools", "Random", "StaticArraysCore"] +git-tree-sha1 = "bf074c045d3d5ffd956fa0a461da38a44685d6b2" +uuid = "90137ffa-7385-5640-81b9-e52037218182" +version = "1.9.3" + + [deps.StaticArrays.extensions] + StaticArraysChainRulesCoreExt = "ChainRulesCore" + StaticArraysStatisticsExt = "Statistics" + + [deps.StaticArrays.weakdeps] + ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4" + Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2" + +[[deps.StaticArraysCore]] +git-tree-sha1 = "36b3d696ce6366023a0ea192b4cd442268995a0d" +uuid = "1e83bf80-4336-4d27-bf5d-d5a4f845583c" +version = "1.4.2" + +[[deps.Statistics]] +deps = ["LinearAlgebra", "SparseArrays"] +uuid = "10745b16-79ce-11e8-11f9-7d13ad32a3b2" +version = "1.10.0" + +[[deps.StructTypes]] +deps = ["Dates", "UUIDs"] +git-tree-sha1 = "ca4bccb03acf9faaf4137a9abc1881ed1841aa70" +uuid = "856f2bd8-1eba-4b0a-8007-ebc267875bd4" +version = "1.10.0" + +[[deps.SuiteSparse]] +deps = ["Libdl", "LinearAlgebra", "Serialization", "SparseArrays"] +uuid = "4607b0f0-06f3-5cda-b6b1-a6196a1729e9" + +[[deps.SuiteSparse_jll]] +deps = ["Artifacts", "Libdl", "libblastrampoline_jll"] +uuid = "bea87d4a-7f5b-5778-9afe-8cc45184846c" +version = "7.2.1+1" + +[[deps.TOML]] +deps = ["Dates"] +uuid = "fa267f1f-6049-4f14-aa54-33bafae1ed76" +version = "1.0.3" + +[[deps.TOPCOM_jll]] +deps = ["Artifacts", "GMP_jll", "JLLWrappers", "Libdl", "Pkg", "cddlib_jll"] +git-tree-sha1 = "adbe178144e762ae7057fcb8e26564de7ee2e36c" +uuid = "36f60fef-b880-50dc-9289-4aaecee93cc3" +version = "0.17.8+0" + +[[deps.Tar]] +deps = ["ArgTools", "SHA"] +uuid = "a4e569a6-e804-4fa4-b0f3-eef7a1d5b13e" +version = "1.10.0" + +[[deps.Test]] +deps = ["InteractiveUtils", "Logging", "Random", "Serialization"] +uuid = "8dfed614-e22c-5e08-85e1-65c5234f0b40" + +[[deps.ThreadingUtilities]] +deps = ["ManualMemory"] +git-tree-sha1 = "eda08f7e9818eb53661b3deb74e3159460dfbc27" +uuid = "8290d209-cae3-49c0-8002-c8c24d57dab5" +version = "0.5.2" + +[[deps.UUIDs]] +deps = ["Random", "SHA"] +uuid = "cf7118a7-6976-5b1a-9a39-7adc72f591a4" + +[[deps.UnPack]] +git-tree-sha1 = "387c1f73762231e86e0c9c5443ce3b4a0a9a0c2b" +uuid = "3a884ed6-31ef-47d7-9d2a-63182c4928ed" +version = "1.0.2" + +[[deps.Unicode]] +uuid = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5" + +[[deps.VectorizationBase]] +deps = ["ArrayInterface", "CPUSummary", "HostCPUFeatures", "IfElse", "LayoutPointers", "Libdl", "LinearAlgebra", "SIMDTypes", "Static", "StaticArrayInterface"] +git-tree-sha1 = "ac377f0a248753a1b1d58bbc92a64f5a726dfb71" +uuid = "3d5dd08c-fd9d-11e8-17fa-ed2836048c2f" +version = "0.21.66" + +[[deps.Zlib_jll]] +deps = ["Libdl"] +uuid = "83775a58-1f1d-513f-b197-d71354ab007a" +version = "1.2.13+1" + +[[deps.Zstd_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl"] +git-tree-sha1 = "e678132f07ddb5bfa46857f0d7620fb9be675d3b" +uuid = "3161d3a3-bdf6-5164-811a-617609db77b4" +version = "1.5.6+0" + +[[deps.bliss_jll]] +deps = ["Artifacts", "GMP_jll", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "f8b75e896a326a162a4f6e998990521d8302c810" +uuid = "508c9074-7a14-5c94-9582-3d4bc1871065" +version = "0.77.0+1" + +[[deps.boost_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Zlib_jll"] +git-tree-sha1 = "7a89efe0137720ca82f99e8daa526d23120d0d37" +uuid = "28df3c45-c428-5900-9ff8-a3135698ca75" +version = "1.76.0+1" + +[[deps.cddlib_jll]] +deps = ["Artifacts", "GMP_jll", "JLLWrappers", "Libdl"] +git-tree-sha1 = "08f5df03703af917b9bfec47b9767eb943220d08" +uuid = "f07e07eb-5685-515a-97c8-3014f6152feb" +version = "0.94.14+0" + +[[deps.cohomCalg_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "999c34925053825bfa29f54b3c00b80668b681ec" +uuid = "5558cf25-a90e-53b0-b813-cadaa3ae7ade" +version = "0.32.0+0" + +[[deps.lib4ti2_jll]] +deps = ["Artifacts", "GLPK_jll", "GMP_jll", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "79116185def638e73ea3d88ca6c10e210a1dc183" +uuid = "1493ae25-0f90-5c0e-a06c-8c5077d6d66f" +version = "1.6.10+0" + +[[deps.libblastrampoline_jll]] +deps = ["Artifacts", "Libdl"] +uuid = "8e850b90-86db-534c-a0d3-1478176c7d93" +version = "5.8.0+1" + +[[deps.libcxxwrap_julia_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl"] +git-tree-sha1 = "02d0a0a623248c709727088aaf722ab14f1463a5" +uuid = "3eaa8342-bff7-56a5-9981-c04077f7cee7" +version = "0.11.2+1" + +[[deps.libpolymake_julia_jll]] +deps = ["Artifacts", "CompilerSupportLibraries_jll", "FLINT_jll", "JLLWrappers", "Libdl", "TOPCOM_jll", "lib4ti2_jll", "libcxxwrap_julia_jll", "polymake_jll"] +git-tree-sha1 = "190d600cec352e643a201cafa7e414b93632b1e4" +uuid = "4d8266f6-2b3b-57e3-ad7a-d431eaaac945" +version = "0.11.4+0" + +[[deps.libsingular_julia_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Singular_jll", "libcxxwrap_julia_jll"] +git-tree-sha1 = "e71531083e598a7b71632858aaf36754f4b39deb" +uuid = "ae4fbd8f-ecdb-54f8-bbce-35570499b30e" +version = "0.44.2+0" + +[[deps.lrslib_jll]] +deps = ["Artifacts", "GMP_jll", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "9169c4d5823195a7a2173fc6b479468478857438" +uuid = "3873f7d0-7b7c-52c3-bdf4-8ab39b8f337a" +version = "0.3.3+0" + +[[deps.msolve_jll]] +deps = ["Artifacts", "CompilerSupportLibraries_jll", "FLINT_jll", "GMP_jll", "JLLWrappers", "LLVMOpenMP_jll", "Libdl", "MPFR_jll"] +git-tree-sha1 = "6c4026900ccd998531cfedf606f6b14b05a9cbca" +uuid = "6d01cc9a-e8f6-580e-8c54-544227e08205" +version = "0.6.5+0" + +[[deps.nauty_jll]] +deps = ["Artifacts", "GMP_jll", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "fc7dc197df0648cd5f965801bfe086abd9325add" +uuid = "55c6dc9b-343a-50ca-8ff2-b71adb3733d5" +version = "2.6.13+1" + +[[deps.nghttp2_jll]] +deps = ["Artifacts", "Libdl"] +uuid = "8e850ede-7688-5339-a07c-302acd2aaf8d" +version = "1.52.0+1" + +[[deps.normaliz_jll]] +deps = ["Artifacts", "CompilerSupportLibraries_jll", "FLINT_jll", "GMP_jll", "JLLWrappers", "LLVMOpenMP_jll", "Libdl", "MPFR_jll", "Pkg", "nauty_jll"] +git-tree-sha1 = "30bc19e1b68db7625eeeb375b7f5602337caa314" +uuid = "6690c6e9-4e12-53b8-b8fd-4bffaef8839f" +version = "300.900.301+0" + +[[deps.p7zip_jll]] +deps = ["Artifacts", "Libdl"] +uuid = "3f19e933-33d8-53b3-aaab-bd5110c3b7a0" +version = "17.4.0+2" + +[[deps.polymake_jll]] +deps = ["Artifacts", "CompilerSupportLibraries_jll", "FLINT_jll", "GMP_jll", "JLLWrappers", "LLVMOpenMP_jll", "Libdl", "MPFR_jll", "MongoC_jll", "PPL_jll", "Perl_jll", "SCIP_jll", "bliss_jll", "boost_jll", "cddlib_jll", "lrslib_jll", "normaliz_jll"] +git-tree-sha1 = "f77c91a5c44d0f54d491bc32bdcb31574d188818" +uuid = "7c209550-9012-526c-9264-55ba7a78ba2c" +version = "400.1100.1+0" + +[[deps.polymake_oscarnumber_jll]] +deps = ["Artifacts", "CompilerSupportLibraries_jll", "JLLWrappers", "LLVMOpenMP_jll", "Libdl", "libcxxwrap_julia_jll", "libpolymake_julia_jll", "polymake_jll"] +git-tree-sha1 = "412e4359b0b1ad1ea315ec96c97800feb751c1c2" +uuid = "10f31823-b687-53e6-9f29-edb9d4da9f9f" +version = "0.2.11+0" + +[[deps.snappy_jll]] +deps = ["Artifacts", "JLLWrappers", "LZO_jll", "Libdl", "Zlib_jll"] +git-tree-sha1 = "ab27636e7c8222f14b9318a983fcd89cf130d419" +uuid = "fe1e1685-f7be-5f59-ac9f-4ca204017dfd" +version = "1.1.10+0" diff --git a/src/GroebnerWalk.jl b/src/GroebnerWalk.jl index 465827892048..0e943e536e62 100644 --- a/src/GroebnerWalk.jl +++ b/src/GroebnerWalk.jl @@ -3,6 +3,7 @@ using Oscar exponent_vectors = f->exponent_vector.(monomials(f), Ref(1)) +include("generic_walk.jl") include("walk.jl") @@ -37,4 +38,4 @@ function __init__() set_verbosity_level(:groebner_walk, 0) end -end \ No newline at end of file +end diff --git a/src/markedGB.jl b/src/markedGB.jl new file mode 100644 index 000000000000..9327f002c285 --- /dev/null +++ b/src/markedGB.jl @@ -0,0 +1,116 @@ +using Oscar + +#constructs a "markedGB" consisting of two lists +#gens, a vector of generators of a Gröbner basis +#markings, a vector "Markings" of G, corresponding to leading terms w.r.t some monomial ordering +#TODO: maybe initialize s.t. G is reduced/monic? + +struct markedGB + gens::Vector{<:MPolyRingElem} + markings::Vector{<:MPolyRingElem} + function markedGB(gens::Vector{<:MPolyRingElem},markings::Vector{<:MPolyRingElem}) + if length(gens)!= length(markings) + throw(ArgumentError("Inputs are of different length")) + else + if 0 in gens + throw(ArgumentError("Gröbner basis contains the zero polynomial")) + end + new(gens, markings) + end + end + +end + +#Given a polynomial p and a monomial lm +#if lm divides a term of p, return (true, q). where p = q*lm + "terms not divisible by lm" +function new_divides_walk(p::MPolyRingElem, lm::MPolyRingElem) + div = false + newpoly = 0*p + for term in terms(p) + (b, c) = divides(term, lm) + if b + newpoly += c + div = true + end + end + return div, newpoly +end + +#Given a polynomial p and a markedGB MG +#compute the normal form of p w.r.t MG2 (orderings are not necessary, it is sufficient to know the markings) +#NB: This only works if G is a reduced Marked Gröbner basis +function normal_form(p::MPolyRingElem, MG::markedGB) + #queue = Set(terms(p)) + nf = zero(parent(p)) + + markedGB = zip(MG.gens, MG.markings) + + while !iszero(p) + m = first(terms(p)) + + div = false + for (g, lm) in markedGB + (div, q) = divides(m, lm) + if div + p = p - q*g + break + end + end + + if !div + nf += m + p -= m + end + end + + return nf +end + + + +#Given a markedGB MG, reduce it by replacing each g with its normal form w.r.t G\{g} +#NB: only works if MG is inclusion minimal +#In this case upon reduction, the markings are preserved +#Question: Can I eliminate the 'if' condition? probably +function reductionalg(MG::markedGB) + newgens = Vector{typeof(first(MG.gens))}() + newlm = Vector{typeof(first(MG.gens))}() + for i in 1:length(MG.gens) + if normal_form(MG.gens[i], markedGB(MG.gens[1:end .!= i], MG.markings[1:end .!= i])) != 0 + push!(newgens, normal_form(MG.gens[i], markedGB(MG.gens[1:end .!= i], MG.markings[1:end .!= i]))) + push!(newlm, MG.markings[i]) + end + end + return markedGB(newgens, newlm) +end + +#= + +tests + +R, (x,y) = polynomial_ring(QQ, ["x","y"]) + +G = [x^3 + y^4 + y^6 + x*y^7, y^2 + 4*x^5 + x^2*y^7] +LM = [x*y^7, 4*x^5] +MG = markedGB(G, LM) +reductionalg(MG) +normal_form(x^5, MG) + +R, (x,y,z,w) = polynomial_ring(QQ, ["x","y","z","w"]) +G = [x-2*y-z-w, z+3*w] +lm = [x, z] +MG = markedGB(G, lm) +p = w +normal_form(p, MG) +normal_form(x, MG) + + +KK = GF(19) +R, (x,y) = polynomial_ring(KK, ["x", "y"]) +G = [x^2 + y^2, y] +Lm = [x^2, y] +MG = markedGB(G, Lm) +MG = reductionalg(MG) +normal_form(x^3 - 1, MG) +=# + diff --git a/src/markedGB_generic_walk.jl b/src/markedGB_generic_walk.jl new file mode 100644 index 000000000000..a390cde643ed --- /dev/null +++ b/src/markedGB_generic_walk.jl @@ -0,0 +1,56 @@ +using Oscar +include("markedGB.jl") +include("markedGB_helpers.jl") + + + + + + +function markedGB_generic_walk(G::Oscar.IdealGens, start::MonomialOrdering, target::MonomialOrdering) + Lm = leading_term.(G, ordering = start) + MG = markedGB(gens(G), Lm) + v = markedGB_next_gamma(MG, ZZ.([0]), start, target) + + while !isempty(v) + MG = markedGB_generic_step(MG, v, target) + v = markedGB_next_gamma(MG, v, start, target) + end + return Oscar.IdealGens(MG.gens, o_t; isGB = true) + end + + + +#Given the "old markedGB" GB and the newly computed facet normal v +#compute the next markedGB by taking G.B of initial forms H w.r.t less +#and lifting it with markedGB_lift_generic. Subsequently reduce + +function markedGB_generic_step(MG::markedGB, v::Vector{ZZRingElem}, ord::MonomialOrdering) + facet_Generators = markedGB_facet_initials(MG, v) + H = groebner_basis( + ideal(facet_Generators); ordering=ord, complete_reduction=true, algorithm=:buchberger + ) + newGB = markedGB_lift_generic(MG, gens(H), ord) + newGB = reductionalg(newGB) + return newGB +end + + +#= + +----- thesis example (chap3) +R, (x,y,z) = polynomial_ring(QQ, ["x","y","z"]) + +o_s = lex(R) + +o_t= weight_ordering([1,3,0], deglex(R)) +S = canonical_matrix(o_s) +T = canonical_matrix(o_t) + +I = ideal([x^2 + y*z, x*y + z^2]) +G = groebner_basis(I, ordering = o_s, complete_reduction = true) + +markedGB_generic_walk(G, o_s, o_t) + + +#= \ No newline at end of file diff --git a/src/markedGB_helpers.jl b/src/markedGB_helpers.jl new file mode 100644 index 000000000000..b576b055b778 --- /dev/null +++ b/src/markedGB_helpers.jl @@ -0,0 +1,184 @@ + +#Auxiliary functions for the generic Gröbner walk, ordered by subroutine +#---------------------------------- + + +#------next_gamma (Goal: Get next facet normal along generic path) + +exponent_vectors = f->exponent_vector.(monomials(f), Ref(1)) #returns exponent vectors of all terms in f + + + +#returns a list of integer vectors of the form a - b +# (where a is a leading exponent and b is in the tail of some g in MG) +function markedGB_difference_lead_tail(MG::markedGB) + (G,Lm) = MG.gens, MG.markings + lead_exp = Lm .|> exponent_vectors .|> first + + v = zip(lead_exp, exponent_vectors.(G)) .|> splat((l, t) -> Ref(l).-t) + + return [ZZ.(v) for v in unique!(reduce(vcat, v))[2:end]] #temporary solution: the first element is always the zero vector? +end + +#given a marked GB, the previous weight vector w and monomial orderings +#returns the "next" facet normal +#i.e. the bounding vector v fulfilling w( + new_less_than_zero(canonical_matrix(target), ZZ.(v)) && !new_less_than_zero(canonical_matrix(start), ZZ.(v)) + ) + return unique!(filter(pred, V)) + end + + +#returns true if v <_M w , false otherwise +#i.e elements of the vectors Mv and Mw are compared until a tie is broken + +function matrix_less_than(M::ZZMatrix, v::Vector{ZZRingElem}, w::Vector{ZZRingElem}) + i = 1 + while dot(M[i, :], v) == dot(M[i, :], w) && i != number_of_rows(M) + i += 1 + end + return dot(M[i, :], v) < dot(M[i, :], w) +end + +#returns true if u < v w.r.t the Facet preorder (cf. "The generic Gröbner walk" (Fukuda et a;. 2007), pg. 10) +#Comment: It may make more sense to have the monomial orderings as inputs. +function new_facet_less_than(S::ZZMatrix, T::ZZMatrix, u::Vector{ZZRingElem}, v::Vector{ZZRingElem}) + i = 1 + while dot(T[i,:], u)v == dot(T[i,:], v)u && i != number_of_rows(T) + i += 1 + end + return matrix_less_than(S, dot(T[i,:], u)v, dot(T[i,:], v)u) +end + +#returns all elements of V smaller than w w.r.t the facet preorder +function new_filter_lf(w::Vector{ZZRingElem}, start::MonomialOrdering, target::MonomialOrdering, V::Vector{Vector{ZZRingElem}}) + btz = Vector{Vector{ZZRingElem}}() + for v in V + if new_facet_less_than(canonical_matrix(start),canonical_matrix(target),w,v) && !(v in btz) + push!(btz, v) + end + end + return btz +end + + +#returns true if u is a non-zero integer multiple of v + +function new_is_parallel(u::Vector{ZZRingElem}, v::Vector{ZZRingElem}) + count = 1 + x = 0 + for i = 1:length(u) + if u[i] == 0 + if v[count] == 0 + count += +1 + else + return false + end + else + x = v[count] // u[i] + count += 1 + break + end + end + if count > length(v) + return true + end + for i = count:length(v) + @inbounds if v[i] != x * u[i] + return false + end + end + return true + + end + +#TODO: add tests \ No newline at end of file diff --git a/src/new_generic_walk/fukuda_example.jl b/src/new_generic_walk/fukuda_example.jl deleted file mode 100644 index 06361032574a..000000000000 --- a/src/new_generic_walk/fukuda_example.jl +++ /dev/null @@ -1,51 +0,0 @@ -#The example from section 5 of "The generic Gröbner Walk" (Fukuda et al. 2007) - -using Oscar - - -include("new_generic_walk.jl") - -R, (x,y) = polynomial_ring(QQ, ["x","y"]) - -I = ideal([x^2 - y^3, x^3 - y^2 - x]) - -start = degrevlex(R) -target = lex(R) -G = groebner_basis(I, ordering = start) -new_generic_walk(G, start, target) #success! - - - -#= Go through the example step by step -Lm = leading_term.(G, ordering = start) - -w = new_next_gamma(G, Lm, [ZZ.(0)], start, target) - -inwG = new_facet_initials(G, Lm, w) - -(G2, Lm2) = new_generic_step(G, Lm, w, target) - -G2 = Oscar.IdealGens(G2) - -w2 = new_next_gamma(G2, Lm2, w , start, target) - -inw2G = new_facet_initials(G2, Lm2, w2) - -new_lift_generic(gens(G2), Lm2, inw2G, target) #success! This is correct - -(G, Lm) = new_generic_step(G, Lm, w2, target) - -G = Oscar.IdealGens(G) - -w3 = new_next_gamma(G, Lm, w2, start, target) - -inwG = new_facet_initials(G, Lm, w3) - -(G,Lm) = new_generic_step(G,Lm,w3,target) - -G = Oscar.IdealGens(G) - -w4 = new_next_gamma(G,Lm,w3, start, target) - -terminate -=# \ No newline at end of file diff --git a/src/new_generic_walk/new_generic_step.jl b/src/new_generic_walk/new_generic_step.jl deleted file mode 100644 index 5c4a80aa173b..000000000000 --- a/src/new_generic_walk/new_generic_step.jl +++ /dev/null @@ -1,136 +0,0 @@ -using Oscar - -#include("new_next_gamma.jl") - - - -#TODO: This function is asymmetric; For v = 0 and any u, new_is_parallel(u,v) = true but new_is_parallel(v,u) is false -#This is not a problem, as both u and v are non-zero in our setting -#Nevertheless, this should be fixed -function new_is_parallel(u::Vector{ZZRingElem}, v::Vector{ZZRingElem}) - count = 1 - x = 0 - for i = 1:length(u) - if u[i] == 0 - if v[count] == 0 - count += +1 - else - return false - end - else - x = v[count] // u[i] - count += 1 - break - end - end - if count > length(v) - return true - end - for i = count:length(v) - @inbounds if v[i] != x * u[i] - return false - end - end - return true - -end - - -#INPUT: A Gröbner basis G, the set lm of leading monomials of elements of G, a vector v -#OUTPUT: The set of initial forms inw(G), where w is a vector lying on the facet defined by v -function new_facet_initials(G::Oscar.IdealGens, lm::Vector{T}, v::Vector{ZZRingElem} - ) where {T<:MPolyRingElem} -inwG = copy(lm) -generators = gens(G) - for i in 1:length(lm) - a = first(exponent_vector.(monomials(lm[i]), Ref(1))) - for (b, coeff) in zip(exponent_vectors(generators[i]), - [leading_coefficient(term) for term in terms(generators[i])]) - if new_is_parallel(ZZ.(a-b), v) - inwG[i] += coeff*monomial(R,b) - end - end - end - return inwG -end - - -#= The lifting step, as described in "The generic Gröbner walk" (Fukuda et al 2007), pg.8 - - Given a set of initial forms inwG of the marked Gröbner basis G, - convert inwG to a Gröbner basis M of InwI w.r.t "target", and - "lift" M to a Gröbner basis of I by subtracting from each m in M - its normal form w.r.t the starting basis G. - -=# - -function new_lift_generic(G::Vector{T}, Lm::Vector{T}, inwG::Vector{T}, target::MonomialOrdering -) where {T<:MPolyRingElem} - M = gens(groebner_basis(ideal(inwG), ordering = target, complete_reduction = true, algorithm=:buchberger)) - leading_newGB = Vector{MPolyRingElem}() - newGB = Vector{MPolyRingElem}() - for m in M - push!(newGB, m - reduce_walk(m, G, Lm, target)) - push!(leading_newGB, leading_term(m, ordering = target)) - end - return newGB, leading_newGB -end - - - -#TODO: I still need to have a proper look at these functions. Improvements may be possible - -#INPUT: A polynomial p, the generators of a marked G.B G, the leading monomials Lm, a monomial order ord -#OUTPUT: The normal form of p w.r.t the marked Gröbner basis G -#QUESTION: Where do I need ord? I think things all work without it -function reduce_walk( - p::MPolyRingElem, G::Vector{T}, Lm::Vector{T}, ord::MonomialOrdering -) where {T<:MPolyRingElem} - for i in 1:length(G) - (q, b) = divides_walk(p, Lm[i], parent(p)) - if b - return reduce_walk(p - (q * G[i]), G, Lm, ord) - end - end - return p -end - - -function divides_walk(p::MPolyRingElem, lm::MPolyRingElem, S::MPolyRing) - div = false - newpoly = MPolyBuildCtx(S) - for term in terms(p) - (b, c) = divides(term, lm) - if b - push_term!( - newpoly, first(coefficients(c)), first(AbstractAlgebra.exponent_vectors(c)) - ) - div = true - end - end - return finish(newpoly), div -end - - - -function new_generic_step( - G::Oscar.IdealGens, Lm::Vector{T}, v::Vector{ZZRingElem}, ord::MonomialOrdering -) where {T<:MPolyRingElem} - inwG = new_facet_initials(G, Lm, v) - - G, Lm = new_lift_generic(gens(G), Lm, inwG, ord) - G = interreduce(G, Lm, ord) - return G, Lm -end - -function interreduce( - G::Vector{T}, Lm::Vector{T}, ord::MonomialOrdering -) where {T<:MPolyRingElem} - for i in 1:length(G) - G[i] = reduce_walk(G[i], G[1:end .!= i], Lm[1:end .!= i], ord) - end - return G -end - - - diff --git a/src/new_generic_walk/new_generic_walk.jl b/src/new_generic_walk/new_generic_walk.jl deleted file mode 100644 index 5de70d2df61e..000000000000 --- a/src/new_generic_walk/new_generic_walk.jl +++ /dev/null @@ -1,17 +0,0 @@ -include("new_generic_step.jl") -include("new_next_gamma.jl") - -function new_generic_walk(G::Oscar.IdealGens, start::MonomialOrdering, target::MonomialOrdering) - Lm = leading_term.(G, ordering = start) - v = new_next_gamma(G, Lm, ZZ.([0]), start, target) - - while !isempty(v) - G, Lm = new_generic_step(G, Lm, v, target) - - G = Oscar.IdealGens(G) - v = new_next_gamma(G, Lm, v, start, target) - end - return G - end - - diff --git a/src/new_generic_walk/new_next_gamma.jl b/src/new_generic_walk/new_next_gamma.jl deleted file mode 100644 index 08d54497cf9d..000000000000 --- a/src/new_generic_walk/new_next_gamma.jl +++ /dev/null @@ -1,133 +0,0 @@ -#get all exponent vectors of a polynomial f -exponent_vectors = f->exponent_vector.(monomials(f), Ref(1)) - -#= -returns the set of bounding vectors of a marked Gröbner basis G, with markings given by Lm - -INPUT: A Gröbner basis G, a set of monomials Lm (the leading monomials of G) -OUTPUT: A set of n-dimensional integer vectors of the form a-b, -where a is the exponent vector of a leading monomoial of some g in G, -and b is the exponent vector of some other term -=# -function difference_lead_tail( - G::Oscar.IdealGens, Lm::Vector{L} -) where {L<:MPolyRingElem} - lead_exp = Lm .|> exponent_vectors .|> first - - v = zip(lead_exp, exponent_vectors.(G)) .|> splat((l, t) -> Ref(l).-t) - - return unique!(reduce(vcat, v))[2:end] #temporary solution: the first element is always the zero vector? -end - - -function difference_lead_tail(I::Oscar.IdealGens) - lead_exp = leading_term.(I; ordering=ordering(I)) .|> exponent_vectors .|> first - tail_exps = tail.(I; ordering=ordering(I)) .|> exponent_vectors - - v = zip(lead_exp, tail_exps) .|> splat((l, t) -> Ref(l).-t) - - return unique!(reduce(vcat, v)) -end - - - - - -#returns 'true' if Mv <_{lex} 0 , 'false' otherwise -# <_{lex} is the lexicographic ordering on Q^n -#with the notation from my thesis, this is equivalent to v <_M 0 -function new_less_than_zero(M::ZZMatrix, v::Vector{ZZRingElem}) - if is_zero(v) - return false - else - i = 1 - end - while dot(M[i, :], v) == 0 - i += 1 - end - return dot(M[i, :], v) < 0 -end - -#returns all v in V with 0 <_S v and v <_T 0 -#when V are the bounding vectors of a cone, this is the set of all "candidates" for the next facet normal -function new_filter_by_ordering(start::MonomialOrdering, target::MonomialOrdering, V::Vector{Vector{ZZRingElem}}) - pred = v->( - new_less_than_zero(canonical_matrix(target), ZZ.(v)) && !new_less_than_zero(canonical_matrix(start), ZZ.(v)) - ) - return unique!(filter(pred, V)) - end - - -#returns true if v <_M w , false otherwise -#i.e elements of the vectors Mv and Mw are compared until a tie is broken - -function matrix_less_than(M::ZZMatrix, v::Vector{ZZRingElem}, w::Vector{ZZRingElem}) - i = 1 - while dot(M[i, :], v) == dot(M[i, :], w) && i != number_of_rows(M) - i += 1 - end - return dot(M[i, :], v) < dot(M[i, :], w) -end - -#returns true if u < v w.r.t the Facet preorder (cf. "The generic Gröbner walk" (Fukuda et a;. 2007), pg. 10) -#Comment: It may make more sense to have the monomial orderings as inputs. -function facet_less_than(S::ZZMatrix, T::ZZMatrix, u::Vector{ZZRingElem}, v::Vector{ZZRingElem}) - i = 1 - while dot(T[i,:], u)v == dot(T[i,:], v)u && i != number_of_rows(T) - i += 1 - end - return matrix_less_than(S, dot(T[i,:], u)v, dot(T[i,:], v)u) -end - -#returns all elements of V smaller than w w.r.t the facet preorder -function new_filter_lf(w::Vector{ZZRingElem}, start::MonomialOrdering, target::MonomialOrdering, V::Vector{Vector{ZZRingElem}}) - btz = Vector{Vector{ZZRingElem}}() - for v in V - if facet_less_than(canonical_matrix(start),canonical_matrix(target),w,v) && !(v in btz) - push!(btz, v) - end - end - return btz -end - -#= -given a Gröbner basis G with markings given by Lm and the previous normal vector w, find the next one -This method is compute_last_w from Fukuda 2007, pg. 12 -Initialization is with w = ZZ.([0]) -termination condition is V = [] -=# - -function new_next_gamma( - G::Oscar.IdealGens, Lm::Vector{L}, w::Vector{ZZRingElem}, start::MonomialOrdering, target::MonomialOrdering - ) where {L<:MPolyRingElem} - V = new_filter_by_ordering(start, target, [ZZ.(v) for v in difference_lead_tail(G, Lm)]) - if w != ZZ.([0]) - V = new_filter_lf(w, start, target, V) - end - if isempty(V) - return V - end - minV = first(V) - for v in V - if facet_less_than(canonical_matrix(start), canonical_matrix(target),v, minV) - minV = v - end - end - return minV -end - - - - - -#= -function difference_lead_tail( - G::Oscar.IdealGens, Lm::Vector{L}, T::MonomialOrdering -) where {L<:MPolyRingElem} - lead_exp = leading_term.(Lm, ordering=T) .|> exponent_vectors .|> first - - v = zip(lead_exp, exponent_vectors.(G)) .|> splat((l, t) -> Ref(l).-t) - - return unique!(reduce(vcat, v))[2:end] #TEMPORARY SOLUTION -end -=# \ No newline at end of file diff --git a/src/new_generic_walk/thesis_example.jl b/src/new_generic_walk/thesis_example.jl deleted file mode 100644 index b27586f7a6c9..000000000000 --- a/src/new_generic_walk/thesis_example.jl +++ /dev/null @@ -1,47 +0,0 @@ -using Oscar - -include("new_generic_walk.jl") - -R, (x,y,z) = polynomial_ring(QQ, ["x","y","z"]) - -o_s = lex(R) - -o_t= weight_ordering([1,3,0], deglex(R)) -S = canonical_matrix(o_s) -T = canonical_matrix(o_t) - -I = ideal([x^2 + y*z, x*y + z^2]) -G = groebner_basis(I, ordering = o_s) - -new_generic_walk(G, o_s, o_t) - -#= -Tests -Lm = leading_term.(G, ordering = o_s) -w = new_next_gamma(G, Lm, ZZ.([0]), o_s, o_t) -(newG, newLm) = new_generic_step(G, Lm, w, o_t) - - -newG = Oscar.IdealGens(newG) - -difference_lead_tail(newG, Lm) - -w2 = new_next_gamma(newG, newLm, w, o_s, o_t) - -(newnewG, newnewLm) = new_generic_step(newG, newLm, w2, o_t) - -newnewG = Oscar.IdealGens(newnewG) - -w3 = new_next_gamma(newnewG, newnewLm, w2,o_s, o_t) #throws an error. It should give an empty list (or some other signal that we're done) - -(finalG, finalLm) = new_generic_step(newnewG, newnewLm, w2, o_t) -finalG = Oscar.IdealGens(finalG) - -finalG, newnewG -new_filter_lf(w2, S, T, Vector(Vector{ZZRingElem}[])) - -generic_walk(G, o_s, o_t) - -difference_lead_tail(newnewG, newnewLm, o_t) #confusing output - -=# \ No newline at end of file From dac47253b3753724dac7413f836a54e7e85a42d7 Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Fri, 19 Apr 2024 15:04:30 +0200 Subject: [PATCH 040/179] Remove `infoLevel` --- src/walk.jl | 37 ++++++++++++++++--------------------- 1 file changed, 16 insertions(+), 21 deletions(-) diff --git a/src/walk.jl b/src/walk.jl index 550b7f952c6d..b4ef6bff546a 100644 --- a/src/walk.jl +++ b/src/walk.jl @@ -1,10 +1,4 @@ -global infoLevel = 0 - -############################################################### -# Implementation of different variants of the Groebner Walk. -# The Groebner Walk is proposed by Collart, Kalkbrener & Mall (1997). -############################################################### @doc raw""" groebner_walk( I::MPolyIdeal; @@ -26,7 +20,7 @@ The Groebner Walk is proposed by Collart, Kalkbrener & Mall (1997). One can choose a strategy of: - Standard Walk (:standard) computes the Walk like as presented in Cox, Little & O´Shea (2005). - Generic Walk (:generic) computes the Walk as presented in Fukuda, Jensen, Lauritzen & Thomas (2005). -- Perturbed Walk (:perturbed, with p = degree of the perturbation) computes the Walk ass presented in Amrhein, Gloor & Küchlin (1997). +- Perturbed Walk (:perturbed, with p = degree of the perturbation) computes the Walk as presented in Amrhein, Gloor & Küchlin (1997). - Tran's Walk (:tran) computes the Walk like as presented in Tran (2000). - Fractal Walk (:fractalcombined) computes the Walk like as presented in Amrhein & Gloor (1998) with multiple extensions. The target monomial order has to be lex. This version uses the Buchberger algorithm to skip weight vectors with entries bigger than Int32. - Fractal Walk (:fractal) computes the Walk as presented in Amrhein & Gloor (1998). Perturbs only the target vector. @@ -59,28 +53,29 @@ Gröbner basis with elements with respect to the ordering lex([x, y]) -julia> groebner_walk(I, degrevlex(R), lex(R), :perturbed, 2) +julia> groebner_walk(I, lex(R); algorithm=:perturbed) Gröbner basis with elements -1 -> y^16 -2 -> x + y^12 - y^8 + y^4 +1 -> x + y^12 - y^8 + y^4 +2 -> y^16 with respect to the ordering -matrix_ordering([x, y], [1 0; 0 1]) +lex([x, y]) -julia> groebnerwalk(I, [1 1; 0 -1], [1 0; 0 1], :standard) -standard_walk results +julia> julia> set_verbosity_level(:groebner_walk, 1); +julia> groebner_walk(I, lex(R)) +Results for standard_walk Crossed Cones in: -[4, 3] -[4, 1] -[12, 1] -[1, 0] +ZZRingElem[4, 3] +ZZRingElem[4, 1] +ZZRingElem[12, 1] +ZZRingElem[1, 0] Cones crossed: 4 Gröbner basis with elements -1 -> y^16 -2 -> x + y^12 - y^8 + y^4 +1 -> x + y^12 - y^8 + y^4 +2 -> y^16 with respect to the ordering -matrix_ordering([x, y], [1 0; 0 1]) +lex([x, y]) -julia> groebnerwalk(I, [1 1; 0 -1], [1 0; 0 1], :perturbed, 2) +julia> groebner_walk(I, lex(R); algorithm=:perturbed) perturbed_walk results Crossed Cones in: [4, 3] From 383aee56af626bfee1120ce2ed02f3932363cf4d Mon Sep 17 00:00:00 2001 From: Ortfs Date: Fri, 19 Apr 2024 16:24:16 +0200 Subject: [PATCH 041/179] cleaning up Co-authored-by: Kamillo Ferry --- src/GroebnerWalk.jl | 2 +- src/generic_walk.jl | 251 +++++++++++++++++++++++++++++++++++++++ src/markedGB/markedGB.jl | 2 - src/walk.jl | 32 ++--- 4 files changed, 268 insertions(+), 19 deletions(-) create mode 100644 src/generic_walk.jl diff --git a/src/GroebnerWalk.jl b/src/GroebnerWalk.jl index 0e943e536e62..12e326fd41a4 100644 --- a/src/GroebnerWalk.jl +++ b/src/GroebnerWalk.jl @@ -3,10 +3,10 @@ using Oscar exponent_vectors = f->exponent_vector.(monomials(f), Ref(1)) +include("markedGB.jl") include("generic_walk.jl") include("walk.jl") - import Oscar: weight_ordering, ZZRingElem, MonomialOrdering, ZZMatrix, IdealGens import Oscar.Orderings: MatrixOrdering, _support_indices diff --git a/src/generic_walk.jl b/src/generic_walk.jl new file mode 100644 index 000000000000..5fc5cb9bb8a4 --- /dev/null +++ b/src/generic_walk.jl @@ -0,0 +1,251 @@ +function generic_walk(G::Oscar.IdealGens, start::MonomialOrdering, target::MonomialOrdering) + @vprintln :groebner_walk "Results for generic_walk" + @vprintln :groebner_walk "Facets crossed for: " + + Lm = leading_term.(G, ordering = start) + MG = markedGB(gens(G), Lm) + v = markedGB_next_gamma(MG, ZZ.([0]), start, target) + + while !isempty(v) + MG = markedGB_generic_step(MG, v, target) + v = markedGB_next_gamma(MG, v, start, target) + + # TODO: increase step_counter here + @vprintln :groebner_walk v + @vprintln :groebner_walk 2 G + end + return Oscar.IdealGens(MG.gens, target; isGB = true) +end + + +function markedGB_generic_walk(G::Oscar.IdealGens, start::MonomialOrdering, target::MonomialOrdering) + Lm = leading_term.(G, ordering = start) + MG = markedGB(gens(G), Lm) + v = markedGB_next_gamma(MG, ZZ.([0]), start, target) + + while !isempty(v) + MG = markedGB_generic_step(MG, v, target) + v = markedGB_next_gamma(MG, v, start, target) + end + return Oscar.IdealGens(MG.gens, target; isGB = true) +end + +#Given the "old markedGB" GB and the newly computed facet normal v +#compute the next markedGB by taking G.B of initial forms H w.r.t less +#and lifting it with markedGB_lift_generic. Subsequently reduce + +function markedGB_generic_step(MG::markedGB, v::Vector{ZZRingElem}, ord::MonomialOrdering) +facet_Generators = markedGB_facet_initials(MG, v) +H = groebner_basis( + ideal(facet_Generators); ordering=ord, complete_reduction=true, algorithm=:buchberger +) +newGB = markedGB_lift_generic(MG, gens(H), ord) +newGB = reductionalg(newGB) +return newGB +end + + +#= + +----- thesis example (chap3) +R, (x,y,z) = polynomial_ring(QQ, ["x","y","z"]) + +o_s = lex(R) + +o_t= weight_ordering([1,3,0], deglex(R)) +S = canonical_matrix(o_s) +T = canonical_matrix(o_t) + +I = ideal([x^2 + y*z, x*y + z^2]) +G = groebner_basis(I, ordering = o_s, complete_reduction = true) + +markedGB_generic_walk(G, o_s, o_t) + + +=# + + +#Auxiliary functions for the generic Gröbner walk, ordered by subroutine +#---------------------------------- + + +#------next_gamma (Goal: Get next facet normal along generic path) + +exponent_vectors = f->exponent_vector.(monomials(f), Ref(1)) #returns exponent vectors of all terms in f + + + +#returns a list of integer vectors of the form a - b +# (where a is a leading exponent and b is in the tail of some g in MG) +function markedGB_difference_lead_tail(MG::markedGB) + (G,Lm) = MG.gens, MG.markings + lead_exp = Lm .|> exponent_vectors .|> first + + v = zip(lead_exp, exponent_vectors.(G)) .|> splat((l, t) -> Ref(l).-t) + + return [ZZ.(v) for v in unique!(reduce(vcat, v))[2:end]] #temporary solution: the first element is always the zero vector? +end + +#given a marked GB, the previous weight vector w and monomial orderings +#returns the "next" facet normal +#i.e. the bounding vector v fulfilling w( + new_less_than_zero(canonical_matrix(target), ZZ.(v)) && !new_less_than_zero(canonical_matrix(start), ZZ.(v)) + ) + return unique!(filter(pred, V)) + end + + +#returns true if v <_M w , false otherwise +#i.e elements of the vectors Mv and Mw are compared until a tie is broken + +function matrix_less_than(M::ZZMatrix, v::Vector{ZZRingElem}, w::Vector{ZZRingElem}) + i = 1 + while dot(M[i, :], v) == dot(M[i, :], w) && i != number_of_rows(M) + i += 1 + end + return dot(M[i, :], v) < dot(M[i, :], w) +end + +#returns true if u < v w.r.t the Facet preorder (cf. "The generic Gröbner walk" (Fukuda et a;. 2007), pg. 10) +#Comment: It may make more sense to have the monomial orderings as inputs. +function new_facet_less_than(S::ZZMatrix, T::ZZMatrix, u::Vector{ZZRingElem}, v::Vector{ZZRingElem}) + i = 1 + while dot(T[i,:], u)v == dot(T[i,:], v)u && i != number_of_rows(T) + i += 1 + end + return matrix_less_than(S, dot(T[i,:], u)v, dot(T[i,:], v)u) +end + +#returns all elements of V smaller than w w.r.t the facet preorder +function new_filter_lf(w::Vector{ZZRingElem}, start::MonomialOrdering, target::MonomialOrdering, V::Vector{Vector{ZZRingElem}}) + btz = Vector{Vector{ZZRingElem}}() + for v in V + if new_facet_less_than(canonical_matrix(start),canonical_matrix(target),w,v) && !(v in btz) + push!(btz, v) + end + end + return btz +end + + +#returns true if u is a non-zero integer multiple of v + +function new_is_parallel(u::Vector{ZZRingElem}, v::Vector{ZZRingElem}) + count = 1 + x = 0 + for i = 1:length(u) + if u[i] == 0 + if v[count] == 0 + count += +1 + else + return false + end + else + x = v[count] // u[i] + count += 1 + break + end + end + if count > length(v) + return true + end + for i = count:length(v) + @inbounds if v[i] != x * u[i] + return false + end + end + return true + + end + +#TODO: add tests \ No newline at end of file diff --git a/src/markedGB/markedGB.jl b/src/markedGB/markedGB.jl index 9327f002c285..e55037135b95 100644 --- a/src/markedGB/markedGB.jl +++ b/src/markedGB/markedGB.jl @@ -1,5 +1,3 @@ -using Oscar - #constructs a "markedGB" consisting of two lists #gens, a vector of generators of a Gröbner basis #markings, a vector "Markings" of G, corresponding to leading terms w.r.t some monomial ordering diff --git a/src/walk.jl b/src/walk.jl index b4ef6bff546a..38dd05c9659b 100644 --- a/src/walk.jl +++ b/src/walk.jl @@ -178,27 +178,27 @@ end # Generic-version of the Groebner Walk. ############################################################### -function generic_walk(G::Oscar.IdealGens, start::MonomialOrdering, target::MonomialOrdering) - Lm = leading_term.(G; ordering=start) - V = next_gamma(G, Lm, zeros(ZZRingElem, 1), start, target) +# function generic_walk(G::Oscar.IdealGens, start::MonomialOrdering, target::MonomialOrdering) +# Lm = leading_term.(G; ordering=start) +# V = next_gamma(G, Lm, zeros(ZZRingElem, 1), start, target) - @vprintln :groebner_walk "Results for generic_walk" - @vprintln :groebner_walk "Facets crossed for: " +# @vprintln :groebner_walk "Results for generic_walk" +# @vprintln :groebner_walk "Facets crossed for: " - while !isempty(V) - G, Lm = generic_step(G, Lm, V, target) +# while !isempty(V) +# G, Lm = generic_step(G, Lm, V, target) - # TODO: increase step_counter here - @vprintln :groebner_walk V - @vprintln :groebner_walk 2 G +# # TODO: increase step_counter here +# @vprintln :groebner_walk V +# @vprintln :groebner_walk 2 G - G = IdealGens(G, target) - V = next_gamma(G, Lm, V, start, target) - end +# G = IdealGens(G, target) +# V = next_gamma(G, Lm, V, start, target) +# end - return G -end -generic_walk(G::Oscar.IdealGens, S::Matrix{Int}, T::Matrix{Int}) = generic_walk(G, monomial_ordering(base_ring(G), S), monomial_ordering(base_ring(G), T)) +# return G +# end +# generic_walk(G::Oscar.IdealGens, S::Matrix{Int}, T::Matrix{Int}) = generic_walk(G, monomial_ordering(base_ring(G), S), monomial_ordering(base_ring(G), T)) function generic_step( G::Oscar.IdealGens, Lm::Vector{T}, v::Vector{ZZRingElem}, ord::MonomialOrdering From c792aff0166551d30f4df5619130d98976a1e11a Mon Sep 17 00:00:00 2001 From: Ortfs Date: Fri, 19 Apr 2024 16:26:35 +0200 Subject: [PATCH 042/179] Clean up --- Manifest.toml | 861 -------------------------- src/markedGB/markedGB.jl | 114 ---- src/markedGB/markedGB_generic_walk.jl | 56 -- src/markedGB/markedGB_helpers.jl | 184 ------ src/markedGB_generic_walk.jl | 56 -- src/markedGB_helpers.jl | 184 ------ 6 files changed, 1455 deletions(-) delete mode 100644 Manifest.toml delete mode 100644 src/markedGB/markedGB.jl delete mode 100644 src/markedGB/markedGB_generic_walk.jl delete mode 100644 src/markedGB/markedGB_helpers.jl delete mode 100644 src/markedGB_generic_walk.jl delete mode 100644 src/markedGB_helpers.jl diff --git a/Manifest.toml b/Manifest.toml deleted file mode 100644 index 46b71c499747..000000000000 --- a/Manifest.toml +++ /dev/null @@ -1,861 +0,0 @@ -# This file is machine-generated - editing it directly is not advised - -julia_version = "1.10.2" -manifest_format = "2.0" -project_hash = "65115cabba4ddcc4c529649a0e0a395536a9a242" - -[[deps.ASL_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "6252039f98492252f9e47c312c8ffda0e3b9e78d" -uuid = "ae81ac8f-d209-56e5-92de-9978fef736f9" -version = "0.1.3+0" - -[[deps.AbstractAlgebra]] -deps = ["InteractiveUtils", "LinearAlgebra", "MacroTools", "Preferences", "Random", "RandomExtensions", "SparseArrays", "Test"] -git-tree-sha1 = "20b4984a6fa7e22346b4f420125342142d367913" -uuid = "c3fe647b-3220-5bb0-a1ea-a7954cac585d" -version = "0.40.9" - -[[deps.Adapt]] -deps = ["LinearAlgebra", "Requires"] -git-tree-sha1 = "6a55b747d1812e699320963ffde36f1ebdda4099" -uuid = "79e6a3ab-5dfb-504d-930d-738a2a938a0e" -version = "4.0.4" -weakdeps = ["StaticArrays"] - - [deps.Adapt.extensions] - AdaptStaticArraysExt = "StaticArrays" - -[[deps.AlgebraicSolving]] -deps = ["LinearAlgebra", "Logging", "LoopVectorization", "Markdown", "Nemo", "Printf", "Random", "StaticArrays", "Test", "msolve_jll"] -git-tree-sha1 = "8f559bb41ca4749a940683a94f6316f1013d8210" -uuid = "66b61cbe-0446-4d5d-9090-1ff510639f9d" -version = "0.4.13" - -[[deps.Antic_jll]] -deps = ["Artifacts", "FLINT_jll", "GMP_jll", "JLLWrappers", "Libdl", "MPFR_jll", "Pkg"] -git-tree-sha1 = "4b354e5ef3d0a235515bd1b27af9cee3fa1de62c" -uuid = "e21ec000-9f72-519e-ba6d-10061e575a27" -version = "0.201.500+0" - -[[deps.Arb_jll]] -deps = ["Artifacts", "FLINT_jll", "GMP_jll", "JLLWrappers", "Libdl", "MPFR_jll", "Pkg"] -git-tree-sha1 = "a564158702b6a4d1fb53c3fa399e891d7599afa0" -uuid = "d9960996-1013-53c9-9ba4-74a4155039c3" -version = "200.2300.0+0" - -[[deps.ArgTools]] -uuid = "0dad84c5-d112-42e6-8d28-ef12dabb789f" -version = "1.1.1" - -[[deps.ArrayInterface]] -deps = ["Adapt", "LinearAlgebra", "SparseArrays", "SuiteSparse"] -git-tree-sha1 = "44691067188f6bd1b2289552a23e4b7572f4528d" -uuid = "4fba245c-0d91-5ea0-9b3e-6abc04ee57a9" -version = "7.9.0" - - [deps.ArrayInterface.extensions] - ArrayInterfaceBandedMatricesExt = "BandedMatrices" - ArrayInterfaceBlockBandedMatricesExt = "BlockBandedMatrices" - ArrayInterfaceCUDAExt = "CUDA" - ArrayInterfaceChainRulesExt = "ChainRules" - ArrayInterfaceGPUArraysCoreExt = "GPUArraysCore" - ArrayInterfaceReverseDiffExt = "ReverseDiff" - ArrayInterfaceStaticArraysCoreExt = "StaticArraysCore" - ArrayInterfaceTrackerExt = "Tracker" - - [deps.ArrayInterface.weakdeps] - BandedMatrices = "aae01518-5342-5314-be14-df237901396f" - BlockBandedMatrices = "ffab5731-97b5-5995-9138-79e8c1846df0" - CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba" - ChainRules = "082447d4-558c-5d27-93f4-14fc19e9eca2" - GPUArraysCore = "46192b85-c4d5-4398-a991-12ede77f4527" - ReverseDiff = "37e2e3b7-166d-5795-8a7a-e32c996b4267" - StaticArraysCore = "1e83bf80-4336-4d27-bf5d-d5a4f845583c" - Tracker = "9f7883ad-71c0-57eb-9f7f-b5c9e6d3789c" - -[[deps.Artifacts]] -uuid = "56f22d72-fd6d-98f1-02f0-08ddc0907c33" - -[[deps.Base64]] -uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f" - -[[deps.BinaryWrappers]] -deps = ["JLLWrappers", "Scratch"] -git-tree-sha1 = "7fea8f658689fa5062b23f4400eda888b7ae2aaa" -uuid = "f01c122e-0ea1-4f85-ad8f-907073ad7a9f" -version = "0.1.3" - -[[deps.BitTwiddlingConvenienceFunctions]] -deps = ["Static"] -git-tree-sha1 = "0c5f81f47bbbcf4aea7b2959135713459170798b" -uuid = "62783981-4cbd-42fc-bca8-16325de8dc4b" -version = "0.1.5" - -[[deps.Bzip2_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "9e2a6b69137e6969bab0152632dcb3bc108c8bdd" -uuid = "6e34b625-4abd-537c-b88f-471c36dfa7a0" -version = "1.0.8+1" - -[[deps.CPUSummary]] -deps = ["CpuId", "IfElse", "PrecompileTools", "Static"] -git-tree-sha1 = "601f7e7b3d36f18790e2caf83a882d88e9b71ff1" -uuid = "2a0fbf3d-bb9c-48f3-b0a9-814d99fd7ab9" -version = "0.2.4" - -[[deps.Calcium_jll]] -deps = ["Antic_jll", "Arb_jll", "Artifacts", "FLINT_jll", "GMP_jll", "JLLWrappers", "Libdl", "MPFR_jll", "Pkg"] -git-tree-sha1 = "37fd335ecca9bd6ab25a2a4d26b7b2f6fe64c246" -uuid = "fcfa6d1b-d8ce-59d5-8c0a-c0d7f69e4f40" -version = "0.401.100+0" - -[[deps.CloseOpenIntervals]] -deps = ["Static", "StaticArrayInterface"] -git-tree-sha1 = "70232f82ffaab9dc52585e0dd043b5e0c6b714f1" -uuid = "fb6a15b2-703c-40df-9091-08a04967cfa9" -version = "0.1.12" - -[[deps.Compat]] -deps = ["TOML", "UUIDs"] -git-tree-sha1 = "c955881e3c981181362ae4088b35995446298b80" -uuid = "34da2185-b29b-5c13-b0c7-acf172513d20" -version = "4.14.0" -weakdeps = ["Dates", "LinearAlgebra"] - - [deps.Compat.extensions] - CompatLinearAlgebraExt = "LinearAlgebra" - -[[deps.CompilerSupportLibraries_jll]] -deps = ["Artifacts", "Libdl"] -uuid = "e66e0078-7015-5450-92f7-15fbd957f2ae" -version = "1.1.0+0" - -[[deps.CpuId]] -deps = ["Markdown"] -git-tree-sha1 = "fcbb72b032692610bfbdb15018ac16a36cf2e406" -uuid = "adafc99b-e345-5852-983c-f28acb93d879" -version = "0.3.1" - -[[deps.CxxWrap]] -deps = ["Libdl", "MacroTools", "libcxxwrap_julia_jll"] -git-tree-sha1 = "3345cb637ca1efb2ebf7f5145558522b92660d1f" -uuid = "1f15a43c-97ca-5a2a-ae31-89f07a497df4" -version = "0.14.2" - -[[deps.Dates]] -deps = ["Printf"] -uuid = "ade2ca70-3891-5945-98fb-dc099432e06a" - -[[deps.DecFP]] -deps = ["DecFP_jll", "Printf", "Random", "SpecialFunctions"] -git-tree-sha1 = "4a10cec664e26d9d63597daf9e62147e79d636e3" -uuid = "55939f99-70c6-5e9b-8bb0-5071ed7d61fd" -version = "1.3.2" - -[[deps.DecFP_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "e9a8da19f847bbfed4076071f6fef8665a30d9e5" -uuid = "47200ebd-12ce-5be5-abb7-8e082af23329" -version = "2.0.3+1" - -[[deps.Distributed]] -deps = ["Random", "Serialization", "Sockets"] -uuid = "8ba89e20-285c-5b6f-9357-94700520ee1b" - -[[deps.DocStringExtensions]] -deps = ["LibGit2"] -git-tree-sha1 = "2fb1e02f2b635d0845df5d7c167fec4dd739b00d" -uuid = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae" -version = "0.9.3" - -[[deps.Downloads]] -deps = ["ArgTools", "FileWatching", "LibCURL", "NetworkOptions"] -uuid = "f43a241f-c20a-4ad4-852c-f6b1247861c6" -version = "1.6.0" - -[[deps.FLINT_jll]] -deps = ["Artifacts", "GMP_jll", "JLLWrappers", "Libdl", "MPFR_jll", "OpenBLAS32_jll"] -git-tree-sha1 = "4eef82c467ec1020174d96f83f44e1ef84061e8c" -uuid = "e134572f-a0d5-539d-bddf-3cad8db41a82" -version = "200.900.9+0" - -[[deps.FileWatching]] -uuid = "7b1f6079-737a-58dc-b8bc-7a2ca5c1b5ee" - -[[deps.GAP]] -deps = ["Artifacts", "Compat", "Downloads", "GAP_jll", "GAP_lib_jll", "GAP_pkg_juliainterface_jll", "InteractiveUtils", "Libdl", "MacroTools", "Markdown", "Ncurses_jll", "Pidfile", "Pkg", "REPL", "Random", "Scratch"] -git-tree-sha1 = "dd79bde23f1a96c7efd7ede3ffba51a61a767321" -uuid = "c863536a-3901-11e9-33e7-d5cd0df7b904" -version = "0.10.3" - -[[deps.GAP_jll]] -deps = ["Artifacts", "GMP_jll", "JLLWrappers", "Libdl", "Pkg", "Readline_jll", "Zlib_jll"] -git-tree-sha1 = "c3a00b8f8ced0887d52104d0a0df233d9efc79d4" -uuid = "5cd7a574-2c56-5be2-91dc-c8bc375b9ddf" -version = "400.1200.200+9" - -[[deps.GAP_lib_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "473b619163e30d9cc58d4a8f9d412e6ea8910fcf" -uuid = "de1ad85e-c930-5cd4-919d-ccd3fcafd1a3" -version = "400.1201.200+0" - -[[deps.GAP_pkg_juliainterface_jll]] -deps = ["Artifacts", "GAP_jll", "GAP_lib_jll", "JLLWrappers", "Libdl"] -git-tree-sha1 = "c5a0f16f0478ab067752861d3c9339f335832459" -uuid = "ba154793-3a7d-51ee-8800-e295b0cf7374" -version = "0.800.300+3" - -[[deps.GLPK_jll]] -deps = ["Artifacts", "GMP_jll", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "fe68622f32828aa92275895fdb324a85894a5b1b" -uuid = "e8aa6df9-e6ca-548a-97ff-1f85fc5b8b98" -version = "5.0.1+0" - -[[deps.GMP_jll]] -deps = ["Artifacts", "Libdl"] -uuid = "781609d7-10c4-51f6-84f2-b8444358ff6d" -version = "6.2.1+6" - -[[deps.Hecke]] -deps = ["AbstractAlgebra", "Dates", "Distributed", "InteractiveUtils", "LazyArtifacts", "Libdl", "LinearAlgebra", "Markdown", "Nemo", "Pkg", "Printf", "Random", "RandomExtensions", "Serialization", "SparseArrays"] -git-tree-sha1 = "bf7de4aedfcaff528747cb5dce419abf258d621b" -uuid = "3e1990a7-5d81-5526-99ce-9ba3ff248f21" -version = "0.30.9" -weakdeps = ["GAP", "Polymake"] - - [deps.Hecke.extensions] - GAPExt = "GAP" - PolymakeExt = "Polymake" - -[[deps.HostCPUFeatures]] -deps = ["BitTwiddlingConvenienceFunctions", "IfElse", "Libdl", "Static"] -git-tree-sha1 = "eb8fed28f4994600e29beef49744639d985a04b2" -uuid = "3e5b6fbb-0976-4d2c-9146-d79de83f2fb0" -version = "0.1.16" - -[[deps.Hwloc_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl"] -git-tree-sha1 = "ca0f6bf568b4bfc807e7537f081c81e35ceca114" -uuid = "e33a78d0-f292-5ffc-b300-72abe9b543c8" -version = "2.10.0+0" - -[[deps.IfElse]] -git-tree-sha1 = "debdd00ffef04665ccbb3e150747a77560e8fad1" -uuid = "615f187c-cbe4-4ef1-ba3b-2fcf58d6d173" -version = "0.1.1" - -[[deps.InteractiveUtils]] -deps = ["Markdown"] -uuid = "b77e0a4c-d291-57a0-90e8-8db25a27a240" - -[[deps.Ipopt_jll]] -deps = ["ASL_jll", "Artifacts", "CompilerSupportLibraries_jll", "JLLWrappers", "Libdl", "MUMPS_seq_jll", "SPRAL_jll", "libblastrampoline_jll"] -git-tree-sha1 = "546c40fd3718c65d48296dd6cec98af9904e3ca4" -uuid = "9cc047cb-c261-5740-88fc-0cf96f7bdcc7" -version = "300.1400.1400+0" - -[[deps.IrrationalConstants]] -git-tree-sha1 = "630b497eafcc20001bba38a4651b327dcfc491d2" -uuid = "92d709cd-6900-40b7-9082-c6be49f344b6" -version = "0.2.2" - -[[deps.JLLWrappers]] -deps = ["Artifacts", "Preferences"] -git-tree-sha1 = "7e5d6779a1e09a36db2a7b6cff50942a0a7d0fca" -uuid = "692b3bcd-3c85-4b1f-b108-f13ce0eb3210" -version = "1.5.0" - -[[deps.JSON]] -deps = ["Dates", "Mmap", "Parsers", "Unicode"] -git-tree-sha1 = "31e996f0a15c7b280ba9f76636b3ff9e2ae58c9a" -uuid = "682c06a0-de6a-54ab-a142-c8b1cf79cde6" -version = "0.21.4" - -[[deps.JSON3]] -deps = ["Dates", "Mmap", "Parsers", "PrecompileTools", "StructTypes", "UUIDs"] -git-tree-sha1 = "eb3edce0ed4fa32f75a0a11217433c31d56bd48b" -uuid = "0f8b85d8-7281-11e9-16c2-39a750bddbf1" -version = "1.14.0" - - [deps.JSON3.extensions] - JSON3ArrowExt = ["ArrowTypes"] - - [deps.JSON3.weakdeps] - ArrowTypes = "31f734f8-188a-4ce0-8406-c8a06bd891cd" - -[[deps.LLVMOpenMP_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl"] -git-tree-sha1 = "d986ce2d884d49126836ea94ed5bfb0f12679713" -uuid = "1d63c593-3942-5779-bab2-d838dc0a180e" -version = "15.0.7+0" - -[[deps.LZO_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "e5b909bcf985c5e2605737d2ce278ed791b89be6" -uuid = "dd4b983a-f0e5-5f8d-a1b7-129d4a5fb1ac" -version = "2.10.1+0" - -[[deps.LayoutPointers]] -deps = ["ArrayInterface", "LinearAlgebra", "ManualMemory", "SIMDTypes", "Static", "StaticArrayInterface"] -git-tree-sha1 = "62edfee3211981241b57ff1cedf4d74d79519277" -uuid = "10f19ff3-798f-405d-979b-55457f8fc047" -version = "0.1.15" - -[[deps.LazyArtifacts]] -deps = ["Artifacts", "Pkg"] -uuid = "4af54fe1-eca0-43a8-85a7-787d91b784e3" - -[[deps.LibCURL]] -deps = ["LibCURL_jll", "MozillaCACerts_jll"] -uuid = "b27032c2-a3e7-50c8-80cd-2d36dbcbfd21" -version = "0.6.4" - -[[deps.LibCURL_jll]] -deps = ["Artifacts", "LibSSH2_jll", "Libdl", "MbedTLS_jll", "Zlib_jll", "nghttp2_jll"] -uuid = "deac9b47-8bc7-5906-a0fe-35ac56dc84c0" -version = "8.4.0+0" - -[[deps.LibGit2]] -deps = ["Base64", "LibGit2_jll", "NetworkOptions", "Printf", "SHA"] -uuid = "76f85450-5226-5b5a-8eaa-529ad045b433" - -[[deps.LibGit2_jll]] -deps = ["Artifacts", "LibSSH2_jll", "Libdl", "MbedTLS_jll"] -uuid = "e37daf67-58a4-590a-8e99-b0245dd2ffc5" -version = "1.6.4+0" - -[[deps.LibSSH2_jll]] -deps = ["Artifacts", "Libdl", "MbedTLS_jll"] -uuid = "29816b5a-b9ab-546f-933c-edad1886dfa8" -version = "1.11.0+1" - -[[deps.Libdl]] -uuid = "8f399da3-3557-5675-b5ff-fb832c97cbdb" - -[[deps.LinearAlgebra]] -deps = ["Libdl", "OpenBLAS_jll", "libblastrampoline_jll"] -uuid = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" - -[[deps.LogExpFunctions]] -deps = ["DocStringExtensions", "IrrationalConstants", "LinearAlgebra"] -git-tree-sha1 = "18144f3e9cbe9b15b070288eef858f71b291ce37" -uuid = "2ab3a3ac-af41-5b50-aa03-7779005ae688" -version = "0.3.27" - - [deps.LogExpFunctions.extensions] - LogExpFunctionsChainRulesCoreExt = "ChainRulesCore" - LogExpFunctionsChangesOfVariablesExt = "ChangesOfVariables" - LogExpFunctionsInverseFunctionsExt = "InverseFunctions" - - [deps.LogExpFunctions.weakdeps] - ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4" - ChangesOfVariables = "9e997f8a-9a97-42d5-a9f1-ce6bfc15e2c0" - InverseFunctions = "3587e190-3f89-42d0-90ee-14403ec27112" - -[[deps.Logging]] -uuid = "56ddb016-857b-54e1-b83d-db4d58db5568" - -[[deps.LoopVectorization]] -deps = ["ArrayInterface", "CPUSummary", "CloseOpenIntervals", "DocStringExtensions", "HostCPUFeatures", "IfElse", "LayoutPointers", "LinearAlgebra", "OffsetArrays", "PolyesterWeave", "PrecompileTools", "SIMDTypes", "SLEEFPirates", "Static", "StaticArrayInterface", "ThreadingUtilities", "UnPack", "VectorizationBase"] -git-tree-sha1 = "a13f3be5d84b9c95465d743c82af0b094ef9c2e2" -uuid = "bdcacae8-1622-11e9-2a5c-532679323890" -version = "0.12.169" - - [deps.LoopVectorization.extensions] - ForwardDiffExt = ["ChainRulesCore", "ForwardDiff"] - SpecialFunctionsExt = "SpecialFunctions" - - [deps.LoopVectorization.weakdeps] - ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4" - ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210" - SpecialFunctions = "276daf66-3868-5448-9aa4-cd146d93841b" - -[[deps.METIS_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "1fd0a97409e418b78c53fac671cf4622efdf0f21" -uuid = "d00139f3-1899-568f-a2f0-47f597d42d70" -version = "5.1.2+0" - -[[deps.MPFR_jll]] -deps = ["Artifacts", "GMP_jll", "Libdl"] -uuid = "3a97d323-0669-5f0c-9066-3539efd106a3" -version = "4.2.0+1" - -[[deps.MUMPS_seq_jll]] -deps = ["Artifacts", "CompilerSupportLibraries_jll", "JLLWrappers", "Libdl", "METIS_jll", "libblastrampoline_jll"] -git-tree-sha1 = "840b83c65b27e308095c139a457373850b2f5977" -uuid = "d7ed1dd3-d0ae-5e8e-bfb4-87a502085b8d" -version = "500.600.201+0" - -[[deps.MacroTools]] -deps = ["Markdown", "Random"] -git-tree-sha1 = "2fa9ee3e63fd3a4f7a9a4f4744a52f4856de82df" -uuid = "1914dd2f-81c6-5fcd-8719-6d5c9610ff09" -version = "0.5.13" - -[[deps.ManualMemory]] -git-tree-sha1 = "bcaef4fc7a0cfe2cba636d84cda54b5e4e4ca3cd" -uuid = "d125e4d3-2237-4719-b19c-fa641b8a4667" -version = "0.1.8" - -[[deps.Markdown]] -deps = ["Base64"] -uuid = "d6f4376e-aef5-505a-96c1-9c027394607a" - -[[deps.MbedTLS_jll]] -deps = ["Artifacts", "Libdl"] -uuid = "c8ffd9c3-330d-5841-b78e-0817d7145fa1" -version = "2.28.2+1" - -[[deps.Mmap]] -uuid = "a63ad114-7e13-5084-954f-fe012c677804" - -[[deps.MongoC_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "OpenSSL_jll", "Pkg", "Zlib_jll", "Zstd_jll", "snappy_jll"] -git-tree-sha1 = "a9c90f9f48024f064fdfbd2f29826bd524acf33a" -uuid = "90100e71-7732-535a-9be7-2e9affd1cfc1" -version = "1.19.1+0" - -[[deps.Mongoc]] -deps = ["Dates", "DecFP", "MongoC_jll", "Serialization"] -git-tree-sha1 = "f47bf7ed9d9c1da0a632777ca7dc406e3ad5f923" -uuid = "4fe8b98c-fc19-5c23-8ec2-168ff83495f2" -version = "0.9.0" - -[[deps.MozillaCACerts_jll]] -uuid = "14a3606d-f60d-562e-9121-12d972cd8159" -version = "2023.1.10" - -[[deps.Ncurses_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl"] -git-tree-sha1 = "bd4eb207e17878ceec404e74130639b6dda8b63b" -uuid = "68e3532b-a499-55ff-9963-d1c0c0748b3a" -version = "6.4.1+0" - -[[deps.Nemo]] -deps = ["AbstractAlgebra", "Antic_jll", "Arb_jll", "Calcium_jll", "FLINT_jll", "Libdl", "LinearAlgebra", "Pkg", "Random", "RandomExtensions", "SHA"] -git-tree-sha1 = "29767dbbc3d04b81696f5f237dbf085a57408435" -uuid = "2edaba10-b0f1-5616-af89-8c11ac63239a" -version = "0.43.2" - -[[deps.NetworkOptions]] -uuid = "ca575930-c2e3-43a9-ace4-1e988b2c1908" -version = "1.2.0" - -[[deps.Ninja_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "e3d67b139972540f1c0a3a3ed8c2f48a7e7f304d" -uuid = "76642167-d241-5cee-8c94-7a494e8cb7b7" -version = "1.11.1+0" - -[[deps.OffsetArrays]] -git-tree-sha1 = "e64b4f5ea6b7389f6f046d13d4896a8f9c1ba71e" -uuid = "6fe1bfb0-de20-5000-8ca7-80f57d26f881" -version = "1.14.0" -weakdeps = ["Adapt"] - - [deps.OffsetArrays.extensions] - OffsetArraysAdaptExt = "Adapt" - -[[deps.OpenBLAS32_jll]] -deps = ["Artifacts", "CompilerSupportLibraries_jll", "JLLWrappers", "Libdl"] -git-tree-sha1 = "6065c4cff8fee6c6770b277af45d5082baacdba1" -uuid = "656ef2d0-ae68-5445-9ca0-591084a874a2" -version = "0.3.24+0" - -[[deps.OpenBLAS_jll]] -deps = ["Artifacts", "CompilerSupportLibraries_jll", "Libdl"] -uuid = "4536629a-c528-5b80-bd46-f80d51c5b363" -version = "0.3.23+4" - -[[deps.OpenLibm_jll]] -deps = ["Artifacts", "Libdl"] -uuid = "05823500-19ac-5b8b-9628-191a04bc5112" -version = "0.8.1+2" - -[[deps.OpenSSL_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl"] -git-tree-sha1 = "a12e56c72edee3ce6b96667745e6cbbe5498f200" -uuid = "458c3c95-2e84-50aa-8efc-19380b2a3a95" -version = "1.1.23+0" - -[[deps.OpenSpecFun_jll]] -deps = ["Artifacts", "CompilerSupportLibraries_jll", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "13652491f6856acfd2db29360e1bbcd4565d04f1" -uuid = "efe28fd5-8261-553b-a9e1-b2916fc3738e" -version = "0.5.5+0" - -[[deps.Oscar]] -deps = ["AbstractAlgebra", "AlgebraicSolving", "Distributed", "DocStringExtensions", "GAP", "Hecke", "JSON", "JSON3", "LazyArtifacts", "Nemo", "Pkg", "Polymake", "Preferences", "Random", "RandomExtensions", "Serialization", "Singular", "TOPCOM_jll", "UUIDs", "cohomCalg_jll"] -git-tree-sha1 = "f42a32f14fa7aa4223da69d24690d10d3e4cfb35" -uuid = "f1435218-dba5-11e9-1e4d-f1a5fab5fc13" -version = "1.0.2" - -[[deps.PPL_jll]] -deps = ["Artifacts", "GMP_jll", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "dc69ba2b374b5bd6e876fa3a8441563c0eeafb9e" -uuid = "80dd9cbb-8b87-5171-a280-372cc418f402" -version = "1.2.1+0" - -[[deps.Parsers]] -deps = ["Dates", "PrecompileTools", "UUIDs"] -git-tree-sha1 = "8489905bcdbcfac64d1daa51ca07c0d8f0283821" -uuid = "69de0a69-1ddd-5017-9359-2bf0b02dc9f0" -version = "2.8.1" - -[[deps.Perl_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Readline_jll"] -git-tree-sha1 = "7ab65a258bcf6da373cab49af462aead452d3960" -uuid = "83958c19-0796-5285-893e-a1267f8ec499" -version = "5.34.1+0" - -[[deps.Pidfile]] -deps = ["FileWatching", "Test"] -git-tree-sha1 = "2d8aaf8ee10df53d0dfb9b8ee44ae7c04ced2b03" -uuid = "fa939f87-e72e-5be4-a000-7fc836dbe307" -version = "1.3.0" - -[[deps.Pkg]] -deps = ["Artifacts", "Dates", "Downloads", "FileWatching", "LibGit2", "Libdl", "Logging", "Markdown", "Printf", "REPL", "Random", "SHA", "Serialization", "TOML", "Tar", "UUIDs", "p7zip_jll"] -uuid = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" -version = "1.10.0" - -[[deps.PolyesterWeave]] -deps = ["BitTwiddlingConvenienceFunctions", "CPUSummary", "IfElse", "Static", "ThreadingUtilities"] -git-tree-sha1 = "240d7170f5ffdb285f9427b92333c3463bf65bf6" -uuid = "1d0040c9-8b98-4ee7-8388-3f51789ca0ad" -version = "0.2.1" - -[[deps.Polymake]] -deps = ["BinaryWrappers", "CxxWrap", "Downloads", "JSON", "Libdl", "Mongoc", "MozillaCACerts_jll", "Ninja_jll", "Perl_jll", "Pkg", "REPL", "Scratch", "SparseArrays", "TOPCOM_jll", "lib4ti2_jll", "libpolymake_julia_jll", "polymake_jll", "polymake_oscarnumber_jll"] -git-tree-sha1 = "88e5a36d1231de98680b323f93cd1b7fdcc319c3" -uuid = "d720cf60-89b5-51f5-aff5-213f193123e7" -version = "0.11.15" - -[[deps.PrecompileTools]] -deps = ["Preferences"] -git-tree-sha1 = "5aa36f7049a63a1528fe8f7c3f2113413ffd4e1f" -uuid = "aea7be01-6a6a-4083-8856-8a6e6704d82a" -version = "1.2.1" - -[[deps.Preferences]] -deps = ["TOML"] -git-tree-sha1 = "9306f6085165d270f7e3db02af26a400d580f5c6" -uuid = "21216c6a-2e73-6563-6e65-726566657250" -version = "1.4.3" - -[[deps.Printf]] -deps = ["Unicode"] -uuid = "de0858da-6303-5e67-8744-51eddeeeb8d7" - -[[deps.REPL]] -deps = ["InteractiveUtils", "Markdown", "Sockets", "Unicode"] -uuid = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb" - -[[deps.Random]] -deps = ["SHA"] -uuid = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" - -[[deps.RandomExtensions]] -deps = ["Random", "SparseArrays"] -git-tree-sha1 = "b8a399e95663485820000f26b6a43c794e166a49" -uuid = "fb686558-2515-59ef-acaa-46db3789a887" -version = "0.4.4" - -[[deps.Readline_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Ncurses_jll"] -git-tree-sha1 = "9d70e0c890a6c7ca3eb1ca0eaabba4d34795b7fb" -uuid = "05236dd9-4125-5232-aa7c-9ec0c9b2c25a" -version = "8.2.1+0" - -[[deps.Requires]] -deps = ["UUIDs"] -git-tree-sha1 = "838a3a4188e2ded87a4f9f184b4b0d78a1e91cb7" -uuid = "ae029012-a4dd-5104-9daa-d747884805df" -version = "1.3.0" - -[[deps.SCIP_jll]] -deps = ["Artifacts", "Bzip2_jll", "CompilerSupportLibraries_jll", "GMP_jll", "Ipopt_jll", "JLLWrappers", "Libdl", "Pkg", "Readline_jll", "Zlib_jll", "bliss_jll", "boost_jll"] -git-tree-sha1 = "cf69186eb29307fbb2319b90e6133797bad983ce" -uuid = "e5ac4fe4-a920-5659-9bf8-f9f73e9e79ce" -version = "800.0.301+0" - -[[deps.SHA]] -uuid = "ea8e919c-243c-51af-8825-aaa63cd721ce" -version = "0.7.0" - -[[deps.SIMDTypes]] -git-tree-sha1 = "330289636fb8107c5f32088d2741e9fd7a061a5c" -uuid = "94e857df-77ce-4151-89e5-788b33177be4" -version = "0.1.0" - -[[deps.SLEEFPirates]] -deps = ["IfElse", "Static", "VectorizationBase"] -git-tree-sha1 = "3aac6d68c5e57449f5b9b865c9ba50ac2970c4cf" -uuid = "476501e8-09a2-5ece-8869-fb82de89a1fa" -version = "0.6.42" - -[[deps.SPRAL_jll]] -deps = ["Artifacts", "CompilerSupportLibraries_jll", "Hwloc_jll", "JLLWrappers", "Libdl", "METIS_jll", "libblastrampoline_jll"] -git-tree-sha1 = "34b9dacd687cace8aa4d550e3e9bb8615f1a61e9" -uuid = "319450e9-13b8-58e8-aa9f-8fd1420848ab" -version = "2024.1.18+0" - -[[deps.Scratch]] -deps = ["Dates"] -git-tree-sha1 = "3bac05bc7e74a75fd9cba4295cde4045d9fe2386" -uuid = "6c6a2e73-6563-6170-7368-637461726353" -version = "1.2.1" - -[[deps.Serialization]] -uuid = "9e88b42a-f829-5b0c-bbe9-9e923198166b" - -[[deps.Singular]] -deps = ["AbstractAlgebra", "BinaryWrappers", "CxxWrap", "Libdl", "LinearAlgebra", "Nemo", "Pidfile", "Pkg", "Random", "RandomExtensions", "Singular_jll", "Statistics", "lib4ti2_jll", "libsingular_julia_jll"] -git-tree-sha1 = "a12a7028afc5960a83436c051dc98be1434014d9" -uuid = "bcd08a7b-43d2-5ff7-b6d4-c458787f915c" -version = "0.22.6" - -[[deps.Singular_jll]] -deps = ["Artifacts", "FLINT_jll", "GMP_jll", "JLLWrappers", "Libdl", "MPFR_jll", "cddlib_jll"] -git-tree-sha1 = "ecd57fb5445348183ef39d3380035d102e7054b9" -uuid = "43d676ae-4934-50ba-8046-7a96366d613b" -version = "403.216.1602+0" - -[[deps.Sockets]] -uuid = "6462fe0b-24de-5631-8697-dd941f90decc" - -[[deps.SparseArrays]] -deps = ["Libdl", "LinearAlgebra", "Random", "Serialization", "SuiteSparse_jll"] -uuid = "2f01184e-e22b-5df5-ae63-d93ebab69eaf" -version = "1.10.0" - -[[deps.SpecialFunctions]] -deps = ["IrrationalConstants", "LogExpFunctions", "OpenLibm_jll", "OpenSpecFun_jll"] -git-tree-sha1 = "e2cfc4012a19088254b3950b85c3c1d8882d864d" -uuid = "276daf66-3868-5448-9aa4-cd146d93841b" -version = "2.3.1" - - [deps.SpecialFunctions.extensions] - SpecialFunctionsChainRulesCoreExt = "ChainRulesCore" - - [deps.SpecialFunctions.weakdeps] - ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4" - -[[deps.Static]] -deps = ["IfElse"] -git-tree-sha1 = "d2fdac9ff3906e27f7a618d47b676941baa6c80c" -uuid = "aedffcd0-7271-4cad-89d0-dc628f76c6d3" -version = "0.8.10" - -[[deps.StaticArrayInterface]] -deps = ["ArrayInterface", "Compat", "IfElse", "LinearAlgebra", "PrecompileTools", "Requires", "SparseArrays", "Static", "SuiteSparse"] -git-tree-sha1 = "5d66818a39bb04bf328e92bc933ec5b4ee88e436" -uuid = "0d7ed370-da01-4f52-bd93-41d350b8b718" -version = "1.5.0" -weakdeps = ["OffsetArrays", "StaticArrays"] - - [deps.StaticArrayInterface.extensions] - StaticArrayInterfaceOffsetArraysExt = "OffsetArrays" - StaticArrayInterfaceStaticArraysExt = "StaticArrays" - -[[deps.StaticArrays]] -deps = ["LinearAlgebra", "PrecompileTools", "Random", "StaticArraysCore"] -git-tree-sha1 = "bf074c045d3d5ffd956fa0a461da38a44685d6b2" -uuid = "90137ffa-7385-5640-81b9-e52037218182" -version = "1.9.3" - - [deps.StaticArrays.extensions] - StaticArraysChainRulesCoreExt = "ChainRulesCore" - StaticArraysStatisticsExt = "Statistics" - - [deps.StaticArrays.weakdeps] - ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4" - Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2" - -[[deps.StaticArraysCore]] -git-tree-sha1 = "36b3d696ce6366023a0ea192b4cd442268995a0d" -uuid = "1e83bf80-4336-4d27-bf5d-d5a4f845583c" -version = "1.4.2" - -[[deps.Statistics]] -deps = ["LinearAlgebra", "SparseArrays"] -uuid = "10745b16-79ce-11e8-11f9-7d13ad32a3b2" -version = "1.10.0" - -[[deps.StructTypes]] -deps = ["Dates", "UUIDs"] -git-tree-sha1 = "ca4bccb03acf9faaf4137a9abc1881ed1841aa70" -uuid = "856f2bd8-1eba-4b0a-8007-ebc267875bd4" -version = "1.10.0" - -[[deps.SuiteSparse]] -deps = ["Libdl", "LinearAlgebra", "Serialization", "SparseArrays"] -uuid = "4607b0f0-06f3-5cda-b6b1-a6196a1729e9" - -[[deps.SuiteSparse_jll]] -deps = ["Artifacts", "Libdl", "libblastrampoline_jll"] -uuid = "bea87d4a-7f5b-5778-9afe-8cc45184846c" -version = "7.2.1+1" - -[[deps.TOML]] -deps = ["Dates"] -uuid = "fa267f1f-6049-4f14-aa54-33bafae1ed76" -version = "1.0.3" - -[[deps.TOPCOM_jll]] -deps = ["Artifacts", "GMP_jll", "JLLWrappers", "Libdl", "Pkg", "cddlib_jll"] -git-tree-sha1 = "adbe178144e762ae7057fcb8e26564de7ee2e36c" -uuid = "36f60fef-b880-50dc-9289-4aaecee93cc3" -version = "0.17.8+0" - -[[deps.Tar]] -deps = ["ArgTools", "SHA"] -uuid = "a4e569a6-e804-4fa4-b0f3-eef7a1d5b13e" -version = "1.10.0" - -[[deps.Test]] -deps = ["InteractiveUtils", "Logging", "Random", "Serialization"] -uuid = "8dfed614-e22c-5e08-85e1-65c5234f0b40" - -[[deps.ThreadingUtilities]] -deps = ["ManualMemory"] -git-tree-sha1 = "eda08f7e9818eb53661b3deb74e3159460dfbc27" -uuid = "8290d209-cae3-49c0-8002-c8c24d57dab5" -version = "0.5.2" - -[[deps.UUIDs]] -deps = ["Random", "SHA"] -uuid = "cf7118a7-6976-5b1a-9a39-7adc72f591a4" - -[[deps.UnPack]] -git-tree-sha1 = "387c1f73762231e86e0c9c5443ce3b4a0a9a0c2b" -uuid = "3a884ed6-31ef-47d7-9d2a-63182c4928ed" -version = "1.0.2" - -[[deps.Unicode]] -uuid = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5" - -[[deps.VectorizationBase]] -deps = ["ArrayInterface", "CPUSummary", "HostCPUFeatures", "IfElse", "LayoutPointers", "Libdl", "LinearAlgebra", "SIMDTypes", "Static", "StaticArrayInterface"] -git-tree-sha1 = "ac377f0a248753a1b1d58bbc92a64f5a726dfb71" -uuid = "3d5dd08c-fd9d-11e8-17fa-ed2836048c2f" -version = "0.21.66" - -[[deps.Zlib_jll]] -deps = ["Libdl"] -uuid = "83775a58-1f1d-513f-b197-d71354ab007a" -version = "1.2.13+1" - -[[deps.Zstd_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl"] -git-tree-sha1 = "e678132f07ddb5bfa46857f0d7620fb9be675d3b" -uuid = "3161d3a3-bdf6-5164-811a-617609db77b4" -version = "1.5.6+0" - -[[deps.bliss_jll]] -deps = ["Artifacts", "GMP_jll", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "f8b75e896a326a162a4f6e998990521d8302c810" -uuid = "508c9074-7a14-5c94-9582-3d4bc1871065" -version = "0.77.0+1" - -[[deps.boost_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Zlib_jll"] -git-tree-sha1 = "7a89efe0137720ca82f99e8daa526d23120d0d37" -uuid = "28df3c45-c428-5900-9ff8-a3135698ca75" -version = "1.76.0+1" - -[[deps.cddlib_jll]] -deps = ["Artifacts", "GMP_jll", "JLLWrappers", "Libdl"] -git-tree-sha1 = "08f5df03703af917b9bfec47b9767eb943220d08" -uuid = "f07e07eb-5685-515a-97c8-3014f6152feb" -version = "0.94.14+0" - -[[deps.cohomCalg_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "999c34925053825bfa29f54b3c00b80668b681ec" -uuid = "5558cf25-a90e-53b0-b813-cadaa3ae7ade" -version = "0.32.0+0" - -[[deps.lib4ti2_jll]] -deps = ["Artifacts", "GLPK_jll", "GMP_jll", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "79116185def638e73ea3d88ca6c10e210a1dc183" -uuid = "1493ae25-0f90-5c0e-a06c-8c5077d6d66f" -version = "1.6.10+0" - -[[deps.libblastrampoline_jll]] -deps = ["Artifacts", "Libdl"] -uuid = "8e850b90-86db-534c-a0d3-1478176c7d93" -version = "5.8.0+1" - -[[deps.libcxxwrap_julia_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl"] -git-tree-sha1 = "02d0a0a623248c709727088aaf722ab14f1463a5" -uuid = "3eaa8342-bff7-56a5-9981-c04077f7cee7" -version = "0.11.2+1" - -[[deps.libpolymake_julia_jll]] -deps = ["Artifacts", "CompilerSupportLibraries_jll", "FLINT_jll", "JLLWrappers", "Libdl", "TOPCOM_jll", "lib4ti2_jll", "libcxxwrap_julia_jll", "polymake_jll"] -git-tree-sha1 = "190d600cec352e643a201cafa7e414b93632b1e4" -uuid = "4d8266f6-2b3b-57e3-ad7a-d431eaaac945" -version = "0.11.4+0" - -[[deps.libsingular_julia_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Singular_jll", "libcxxwrap_julia_jll"] -git-tree-sha1 = "e71531083e598a7b71632858aaf36754f4b39deb" -uuid = "ae4fbd8f-ecdb-54f8-bbce-35570499b30e" -version = "0.44.2+0" - -[[deps.lrslib_jll]] -deps = ["Artifacts", "GMP_jll", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "9169c4d5823195a7a2173fc6b479468478857438" -uuid = "3873f7d0-7b7c-52c3-bdf4-8ab39b8f337a" -version = "0.3.3+0" - -[[deps.msolve_jll]] -deps = ["Artifacts", "CompilerSupportLibraries_jll", "FLINT_jll", "GMP_jll", "JLLWrappers", "LLVMOpenMP_jll", "Libdl", "MPFR_jll"] -git-tree-sha1 = "6c4026900ccd998531cfedf606f6b14b05a9cbca" -uuid = "6d01cc9a-e8f6-580e-8c54-544227e08205" -version = "0.6.5+0" - -[[deps.nauty_jll]] -deps = ["Artifacts", "GMP_jll", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "fc7dc197df0648cd5f965801bfe086abd9325add" -uuid = "55c6dc9b-343a-50ca-8ff2-b71adb3733d5" -version = "2.6.13+1" - -[[deps.nghttp2_jll]] -deps = ["Artifacts", "Libdl"] -uuid = "8e850ede-7688-5339-a07c-302acd2aaf8d" -version = "1.52.0+1" - -[[deps.normaliz_jll]] -deps = ["Artifacts", "CompilerSupportLibraries_jll", "FLINT_jll", "GMP_jll", "JLLWrappers", "LLVMOpenMP_jll", "Libdl", "MPFR_jll", "Pkg", "nauty_jll"] -git-tree-sha1 = "30bc19e1b68db7625eeeb375b7f5602337caa314" -uuid = "6690c6e9-4e12-53b8-b8fd-4bffaef8839f" -version = "300.900.301+0" - -[[deps.p7zip_jll]] -deps = ["Artifacts", "Libdl"] -uuid = "3f19e933-33d8-53b3-aaab-bd5110c3b7a0" -version = "17.4.0+2" - -[[deps.polymake_jll]] -deps = ["Artifacts", "CompilerSupportLibraries_jll", "FLINT_jll", "GMP_jll", "JLLWrappers", "LLVMOpenMP_jll", "Libdl", "MPFR_jll", "MongoC_jll", "PPL_jll", "Perl_jll", "SCIP_jll", "bliss_jll", "boost_jll", "cddlib_jll", "lrslib_jll", "normaliz_jll"] -git-tree-sha1 = "f77c91a5c44d0f54d491bc32bdcb31574d188818" -uuid = "7c209550-9012-526c-9264-55ba7a78ba2c" -version = "400.1100.1+0" - -[[deps.polymake_oscarnumber_jll]] -deps = ["Artifacts", "CompilerSupportLibraries_jll", "JLLWrappers", "LLVMOpenMP_jll", "Libdl", "libcxxwrap_julia_jll", "libpolymake_julia_jll", "polymake_jll"] -git-tree-sha1 = "412e4359b0b1ad1ea315ec96c97800feb751c1c2" -uuid = "10f31823-b687-53e6-9f29-edb9d4da9f9f" -version = "0.2.11+0" - -[[deps.snappy_jll]] -deps = ["Artifacts", "JLLWrappers", "LZO_jll", "Libdl", "Zlib_jll"] -git-tree-sha1 = "ab27636e7c8222f14b9318a983fcd89cf130d419" -uuid = "fe1e1685-f7be-5f59-ac9f-4ca204017dfd" -version = "1.1.10+0" diff --git a/src/markedGB/markedGB.jl b/src/markedGB/markedGB.jl deleted file mode 100644 index e55037135b95..000000000000 --- a/src/markedGB/markedGB.jl +++ /dev/null @@ -1,114 +0,0 @@ -#constructs a "markedGB" consisting of two lists -#gens, a vector of generators of a Gröbner basis -#markings, a vector "Markings" of G, corresponding to leading terms w.r.t some monomial ordering -#TODO: maybe initialize s.t. G is reduced/monic? - -struct markedGB - gens::Vector{<:MPolyRingElem} - markings::Vector{<:MPolyRingElem} - function markedGB(gens::Vector{<:MPolyRingElem},markings::Vector{<:MPolyRingElem}) - if length(gens)!= length(markings) - throw(ArgumentError("Inputs are of different length")) - else - if 0 in gens - throw(ArgumentError("Gröbner basis contains the zero polynomial")) - end - new(gens, markings) - end - end - -end - -#Given a polynomial p and a monomial lm -#if lm divides a term of p, return (true, q). where p = q*lm + "terms not divisible by lm" -function new_divides_walk(p::MPolyRingElem, lm::MPolyRingElem) - div = false - newpoly = 0*p - for term in terms(p) - (b, c) = divides(term, lm) - if b - newpoly += c - div = true - end - end - return div, newpoly -end - -#Given a polynomial p and a markedGB MG -#compute the normal form of p w.r.t MG2 (orderings are not necessary, it is sufficient to know the markings) -#NB: This only works if G is a reduced Marked Gröbner basis -function normal_form(p::MPolyRingElem, MG::markedGB) - #queue = Set(terms(p)) - nf = zero(parent(p)) - - markedGB = zip(MG.gens, MG.markings) - - while !iszero(p) - m = first(terms(p)) - - div = false - for (g, lm) in markedGB - (div, q) = divides(m, lm) - if div - p = p - q*g - break - end - end - - if !div - nf += m - p -= m - end - end - - return nf -end - - - -#Given a markedGB MG, reduce it by replacing each g with its normal form w.r.t G\{g} -#NB: only works if MG is inclusion minimal -#In this case upon reduction, the markings are preserved -#Question: Can I eliminate the 'if' condition? probably -function reductionalg(MG::markedGB) - newgens = Vector{typeof(first(MG.gens))}() - newlm = Vector{typeof(first(MG.gens))}() - for i in 1:length(MG.gens) - if normal_form(MG.gens[i], markedGB(MG.gens[1:end .!= i], MG.markings[1:end .!= i])) != 0 - push!(newgens, normal_form(MG.gens[i], markedGB(MG.gens[1:end .!= i], MG.markings[1:end .!= i]))) - push!(newlm, MG.markings[i]) - end - end - return markedGB(newgens, newlm) -end - -#= - -tests - -R, (x,y) = polynomial_ring(QQ, ["x","y"]) - -G = [x^3 + y^4 + y^6 + x*y^7, y^2 + 4*x^5 + x^2*y^7] -LM = [x*y^7, 4*x^5] -MG = markedGB(G, LM) -reductionalg(MG) -normal_form(x^5, MG) - -R, (x,y,z,w) = polynomial_ring(QQ, ["x","y","z","w"]) -G = [x-2*y-z-w, z+3*w] -lm = [x, z] -MG = markedGB(G, lm) -p = w -normal_form(p, MG) -normal_form(x, MG) - - -KK = GF(19) -R, (x,y) = polynomial_ring(KK, ["x", "y"]) -G = [x^2 + y^2, y] -Lm = [x^2, y] -MG = markedGB(G, Lm) -MG = reductionalg(MG) -normal_form(x^3 - 1, MG) -=# - diff --git a/src/markedGB/markedGB_generic_walk.jl b/src/markedGB/markedGB_generic_walk.jl deleted file mode 100644 index a390cde643ed..000000000000 --- a/src/markedGB/markedGB_generic_walk.jl +++ /dev/null @@ -1,56 +0,0 @@ -using Oscar -include("markedGB.jl") -include("markedGB_helpers.jl") - - - - - - -function markedGB_generic_walk(G::Oscar.IdealGens, start::MonomialOrdering, target::MonomialOrdering) - Lm = leading_term.(G, ordering = start) - MG = markedGB(gens(G), Lm) - v = markedGB_next_gamma(MG, ZZ.([0]), start, target) - - while !isempty(v) - MG = markedGB_generic_step(MG, v, target) - v = markedGB_next_gamma(MG, v, start, target) - end - return Oscar.IdealGens(MG.gens, o_t; isGB = true) - end - - - -#Given the "old markedGB" GB and the newly computed facet normal v -#compute the next markedGB by taking G.B of initial forms H w.r.t less -#and lifting it with markedGB_lift_generic. Subsequently reduce - -function markedGB_generic_step(MG::markedGB, v::Vector{ZZRingElem}, ord::MonomialOrdering) - facet_Generators = markedGB_facet_initials(MG, v) - H = groebner_basis( - ideal(facet_Generators); ordering=ord, complete_reduction=true, algorithm=:buchberger - ) - newGB = markedGB_lift_generic(MG, gens(H), ord) - newGB = reductionalg(newGB) - return newGB -end - - -#= - ------ thesis example (chap3) -R, (x,y,z) = polynomial_ring(QQ, ["x","y","z"]) - -o_s = lex(R) - -o_t= weight_ordering([1,3,0], deglex(R)) -S = canonical_matrix(o_s) -T = canonical_matrix(o_t) - -I = ideal([x^2 + y*z, x*y + z^2]) -G = groebner_basis(I, ordering = o_s, complete_reduction = true) - -markedGB_generic_walk(G, o_s, o_t) - - -#= \ No newline at end of file diff --git a/src/markedGB/markedGB_helpers.jl b/src/markedGB/markedGB_helpers.jl deleted file mode 100644 index b576b055b778..000000000000 --- a/src/markedGB/markedGB_helpers.jl +++ /dev/null @@ -1,184 +0,0 @@ - -#Auxiliary functions for the generic Gröbner walk, ordered by subroutine -#---------------------------------- - - -#------next_gamma (Goal: Get next facet normal along generic path) - -exponent_vectors = f->exponent_vector.(monomials(f), Ref(1)) #returns exponent vectors of all terms in f - - - -#returns a list of integer vectors of the form a - b -# (where a is a leading exponent and b is in the tail of some g in MG) -function markedGB_difference_lead_tail(MG::markedGB) - (G,Lm) = MG.gens, MG.markings - lead_exp = Lm .|> exponent_vectors .|> first - - v = zip(lead_exp, exponent_vectors.(G)) .|> splat((l, t) -> Ref(l).-t) - - return [ZZ.(v) for v in unique!(reduce(vcat, v))[2:end]] #temporary solution: the first element is always the zero vector? -end - -#given a marked GB, the previous weight vector w and monomial orderings -#returns the "next" facet normal -#i.e. the bounding vector v fulfilling w( - new_less_than_zero(canonical_matrix(target), ZZ.(v)) && !new_less_than_zero(canonical_matrix(start), ZZ.(v)) - ) - return unique!(filter(pred, V)) - end - - -#returns true if v <_M w , false otherwise -#i.e elements of the vectors Mv and Mw are compared until a tie is broken - -function matrix_less_than(M::ZZMatrix, v::Vector{ZZRingElem}, w::Vector{ZZRingElem}) - i = 1 - while dot(M[i, :], v) == dot(M[i, :], w) && i != number_of_rows(M) - i += 1 - end - return dot(M[i, :], v) < dot(M[i, :], w) -end - -#returns true if u < v w.r.t the Facet preorder (cf. "The generic Gröbner walk" (Fukuda et a;. 2007), pg. 10) -#Comment: It may make more sense to have the monomial orderings as inputs. -function new_facet_less_than(S::ZZMatrix, T::ZZMatrix, u::Vector{ZZRingElem}, v::Vector{ZZRingElem}) - i = 1 - while dot(T[i,:], u)v == dot(T[i,:], v)u && i != number_of_rows(T) - i += 1 - end - return matrix_less_than(S, dot(T[i,:], u)v, dot(T[i,:], v)u) -end - -#returns all elements of V smaller than w w.r.t the facet preorder -function new_filter_lf(w::Vector{ZZRingElem}, start::MonomialOrdering, target::MonomialOrdering, V::Vector{Vector{ZZRingElem}}) - btz = Vector{Vector{ZZRingElem}}() - for v in V - if new_facet_less_than(canonical_matrix(start),canonical_matrix(target),w,v) && !(v in btz) - push!(btz, v) - end - end - return btz -end - - -#returns true if u is a non-zero integer multiple of v - -function new_is_parallel(u::Vector{ZZRingElem}, v::Vector{ZZRingElem}) - count = 1 - x = 0 - for i = 1:length(u) - if u[i] == 0 - if v[count] == 0 - count += +1 - else - return false - end - else - x = v[count] // u[i] - count += 1 - break - end - end - if count > length(v) - return true - end - for i = count:length(v) - @inbounds if v[i] != x * u[i] - return false - end - end - return true - - end - -#TODO: add tests \ No newline at end of file diff --git a/src/markedGB_generic_walk.jl b/src/markedGB_generic_walk.jl deleted file mode 100644 index a390cde643ed..000000000000 --- a/src/markedGB_generic_walk.jl +++ /dev/null @@ -1,56 +0,0 @@ -using Oscar -include("markedGB.jl") -include("markedGB_helpers.jl") - - - - - - -function markedGB_generic_walk(G::Oscar.IdealGens, start::MonomialOrdering, target::MonomialOrdering) - Lm = leading_term.(G, ordering = start) - MG = markedGB(gens(G), Lm) - v = markedGB_next_gamma(MG, ZZ.([0]), start, target) - - while !isempty(v) - MG = markedGB_generic_step(MG, v, target) - v = markedGB_next_gamma(MG, v, start, target) - end - return Oscar.IdealGens(MG.gens, o_t; isGB = true) - end - - - -#Given the "old markedGB" GB and the newly computed facet normal v -#compute the next markedGB by taking G.B of initial forms H w.r.t less -#and lifting it with markedGB_lift_generic. Subsequently reduce - -function markedGB_generic_step(MG::markedGB, v::Vector{ZZRingElem}, ord::MonomialOrdering) - facet_Generators = markedGB_facet_initials(MG, v) - H = groebner_basis( - ideal(facet_Generators); ordering=ord, complete_reduction=true, algorithm=:buchberger - ) - newGB = markedGB_lift_generic(MG, gens(H), ord) - newGB = reductionalg(newGB) - return newGB -end - - -#= - ------ thesis example (chap3) -R, (x,y,z) = polynomial_ring(QQ, ["x","y","z"]) - -o_s = lex(R) - -o_t= weight_ordering([1,3,0], deglex(R)) -S = canonical_matrix(o_s) -T = canonical_matrix(o_t) - -I = ideal([x^2 + y*z, x*y + z^2]) -G = groebner_basis(I, ordering = o_s, complete_reduction = true) - -markedGB_generic_walk(G, o_s, o_t) - - -#= \ No newline at end of file diff --git a/src/markedGB_helpers.jl b/src/markedGB_helpers.jl deleted file mode 100644 index b576b055b778..000000000000 --- a/src/markedGB_helpers.jl +++ /dev/null @@ -1,184 +0,0 @@ - -#Auxiliary functions for the generic Gröbner walk, ordered by subroutine -#---------------------------------- - - -#------next_gamma (Goal: Get next facet normal along generic path) - -exponent_vectors = f->exponent_vector.(monomials(f), Ref(1)) #returns exponent vectors of all terms in f - - - -#returns a list of integer vectors of the form a - b -# (where a is a leading exponent and b is in the tail of some g in MG) -function markedGB_difference_lead_tail(MG::markedGB) - (G,Lm) = MG.gens, MG.markings - lead_exp = Lm .|> exponent_vectors .|> first - - v = zip(lead_exp, exponent_vectors.(G)) .|> splat((l, t) -> Ref(l).-t) - - return [ZZ.(v) for v in unique!(reduce(vcat, v))[2:end]] #temporary solution: the first element is always the zero vector? -end - -#given a marked GB, the previous weight vector w and monomial orderings -#returns the "next" facet normal -#i.e. the bounding vector v fulfilling w( - new_less_than_zero(canonical_matrix(target), ZZ.(v)) && !new_less_than_zero(canonical_matrix(start), ZZ.(v)) - ) - return unique!(filter(pred, V)) - end - - -#returns true if v <_M w , false otherwise -#i.e elements of the vectors Mv and Mw are compared until a tie is broken - -function matrix_less_than(M::ZZMatrix, v::Vector{ZZRingElem}, w::Vector{ZZRingElem}) - i = 1 - while dot(M[i, :], v) == dot(M[i, :], w) && i != number_of_rows(M) - i += 1 - end - return dot(M[i, :], v) < dot(M[i, :], w) -end - -#returns true if u < v w.r.t the Facet preorder (cf. "The generic Gröbner walk" (Fukuda et a;. 2007), pg. 10) -#Comment: It may make more sense to have the monomial orderings as inputs. -function new_facet_less_than(S::ZZMatrix, T::ZZMatrix, u::Vector{ZZRingElem}, v::Vector{ZZRingElem}) - i = 1 - while dot(T[i,:], u)v == dot(T[i,:], v)u && i != number_of_rows(T) - i += 1 - end - return matrix_less_than(S, dot(T[i,:], u)v, dot(T[i,:], v)u) -end - -#returns all elements of V smaller than w w.r.t the facet preorder -function new_filter_lf(w::Vector{ZZRingElem}, start::MonomialOrdering, target::MonomialOrdering, V::Vector{Vector{ZZRingElem}}) - btz = Vector{Vector{ZZRingElem}}() - for v in V - if new_facet_less_than(canonical_matrix(start),canonical_matrix(target),w,v) && !(v in btz) - push!(btz, v) - end - end - return btz -end - - -#returns true if u is a non-zero integer multiple of v - -function new_is_parallel(u::Vector{ZZRingElem}, v::Vector{ZZRingElem}) - count = 1 - x = 0 - for i = 1:length(u) - if u[i] == 0 - if v[count] == 0 - count += +1 - else - return false - end - else - x = v[count] // u[i] - count += 1 - break - end - end - if count > length(v) - return true - end - for i = count:length(v) - @inbounds if v[i] != x * u[i] - return false - end - end - return true - - end - -#TODO: add tests \ No newline at end of file From ebeebcc20c942696b8cebfecb6d4fa5509d94cbd Mon Sep 17 00:00:00 2001 From: Ortfs Date: Fri, 19 Apr 2024 16:51:53 +0200 Subject: [PATCH 043/179] Add a docstring --- src/markedGB.jl | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/markedGB.jl b/src/markedGB.jl index 9327f002c285..8f2a3894c431 100644 --- a/src/markedGB.jl +++ b/src/markedGB.jl @@ -36,9 +36,11 @@ function new_divides_walk(p::MPolyRingElem, lm::MPolyRingElem) return div, newpoly end -#Given a polynomial p and a markedGB MG -#compute the normal form of p w.r.t MG2 (orderings are not necessary, it is sufficient to know the markings) -#NB: This only works if G is a reduced Marked Gröbner basis +@doc raw""" + normal_form(p::MPolyRingElem, MG::markedGB) + +Computes the normal form of `p` with respect to the marked reduced Gröbner basis `MG`. +""" function normal_form(p::MPolyRingElem, MG::markedGB) #queue = Set(terms(p)) nf = zero(parent(p)) @@ -66,7 +68,8 @@ function normal_form(p::MPolyRingElem, MG::markedGB) return nf end - +# Calculates whether the monomial x^g divides x^f +divides(f::Vector{Int}, g::Vector{Int}) = all(g .<= f) #Given a markedGB MG, reduce it by replacing each g with its normal form w.r.t G\{g} #NB: only works if MG is inclusion minimal From 43f0f93cb7521434fabe122b38392c910cdc71cf Mon Sep 17 00:00:00 2001 From: Ortfs Date: Fri, 19 Apr 2024 17:23:27 +0200 Subject: [PATCH 044/179] Clean up --- src/generic_walk.jl | 15 +- src/walk.jl | 344 ++------------------------------------------ 2 files changed, 11 insertions(+), 348 deletions(-) diff --git a/src/generic_walk.jl b/src/generic_walk.jl index 5fc5cb9bb8a4..80683c5afaa1 100644 --- a/src/generic_walk.jl +++ b/src/generic_walk.jl @@ -17,19 +17,6 @@ function generic_walk(G::Oscar.IdealGens, start::MonomialOrdering, target::Monom return Oscar.IdealGens(MG.gens, target; isGB = true) end - -function markedGB_generic_walk(G::Oscar.IdealGens, start::MonomialOrdering, target::MonomialOrdering) - Lm = leading_term.(G, ordering = start) - MG = markedGB(gens(G), Lm) - v = markedGB_next_gamma(MG, ZZ.([0]), start, target) - - while !isempty(v) - MG = markedGB_generic_step(MG, v, target) - v = markedGB_next_gamma(MG, v, start, target) - end - return Oscar.IdealGens(MG.gens, target; isGB = true) -end - #Given the "old markedGB" GB and the newly computed facet normal v #compute the next markedGB by taking G.B of initial forms H w.r.t less #and lifting it with markedGB_lift_generic. Subsequently reduce @@ -78,7 +65,7 @@ exponent_vectors = f->exponent_vector.(monomials(f), Ref(1)) #returns exponent v #returns a list of integer vectors of the form a - b # (where a is a leading exponent and b is in the tail of some g in MG) function markedGB_difference_lead_tail(MG::markedGB) - (G,Lm) = MG.gens, MG.markings + (G,Lm) = MG.gens, MG.markings lead_exp = Lm .|> exponent_vectors .|> first v = zip(lead_exp, exponent_vectors.(G)) .|> splat((l, t) -> Ref(l).-t) diff --git a/src/walk.jl b/src/walk.jl index 38dd05c9659b..2c177e8fdd55 100644 --- a/src/walk.jl +++ b/src/walk.jl @@ -1,19 +1,12 @@ @doc raw""" groebner_walk( - I::MPolyIdeal; - targetOrder::Symbol = lex(base_ring(I)), - startOrder::MonomialOrdering = default_ordering(base_ring(I)); - walktype::Symbol = :standard, - perturbationDegree::Int = 2 + I::MPolyIdeal, + target::MonomialOrdering = lex(base_ring(I)), + start::MonomialOrdering = default_ordering(base_ring(I)); + perturbation_degree = 2, + algorithm::Symbol = :standard ) - groebner_walk( - G::Oscar.IdealGens, - targetOrder::Union{Matrix{N}, MatElem{N}}, - startOrder::Union{Matrix{N}, MatElem{N}}, - walktype::Symbol = :standard, - perturbationDegree::Int = 2 - ) where N Compute a reduced Groebner basis w.r.t. to a monomial order by converting it using the Groebner Walk. The Groebner Walk is proposed by Collart, Kalkbrener & Mall (1997). @@ -27,17 +20,16 @@ One can choose a strategy of: # Arguments - `I::MPolyIdeal`: ideal one wants to compute a Groebner basis for. -- `G::Oscar.IdealGens`: generators of an ideal one wants to compute a Groebner basis for. - `target::MonomialOrdering=:lex`: monomial order one wants to compute a Groebner basis for. - `start::MonomialOrdering=:degrevlex`: monomial order to begin the conversion. -- `walktype::Symbol=standard`: strategy of the Groebner Walk. One can choose a strategy of: +- `perturbationDegree::Int=2`: perturbationdegree for the perturbed Walk. +- `algorithm::Symbol=standard`: strategy of the Groebner Walk. One can choose a strategy of: - `standard`: Standard Walk, + - `generic`: Generic Walk, - `perturbed`: Perturbed Walk, - `tran`: Tran´s Walk, - - `generic`: Generic Walk, - `fractal`: standard-version of the Fractal Walk, - `fractalcombined`: combined Version of the Fractal Walk. Target monomial order needs to be lex, -- `perturbationDegree::Int=2`: perturbationdegree for the perturbed Walk. # Examples @@ -104,8 +96,8 @@ function groebner_walk( walk = (x) -> generic_walk(x, start, target) elseif algorithm == :perturbed walk = (x) -> perturbed_walk(x, start, target, perturbation_degree) - elseif walktype == :fractal - walk = (x) -> fractal_walk(x, start, target) + # elseif walktype == :fractal + # walk = (x) -> fractal_walk(x, start, target) else throw(NotImplementedError(:groebner_walk, algorithm)) end @@ -116,46 +108,6 @@ function groebner_walk( return Oscar.IdealGens(gens(Gb), target; isGB=true) end -function groebner_walk( - G::Union{Oscar.IdealGens,MPolyIdeal}, - T::Union{Matrix{N},MatElem{N}}, - S::Union{Matrix{N},MatElem{N}}, - walktype::Symbol=:standard, - p::Int=2, -) where {N} - if walktype == :standard - walk = (x) -> standard_walk(x, S, T) - elseif walktype == :generic - walk = (x) -> generic_walk(x, S, T) - elseif walktype == :perturbed - walk = (x) -> perturbed_walk(x, S, T, p) - elseif walktype == :fractal - walk = (x) -> fractal_walk(x, S, T) - elseif walktype == :fractal_start_order - walk = (x) -> fractal_walk_start_order(x, S, T) - # elseif walktype == :fractal_lex - # walk = (x) -> fractal_walk_lex(x, S, T) - # elseif walktype == :fractal_look_ahead - # walk = (x) -> fractal_walk_look_ahead(x, S, T) - elseif walktype == :tran - walk = (x) -> tran_walk(x, S, T) - elseif walktype == :fractal_combined - walk = (x) -> fractal_walk_combined(x, S, T) - end - delete_step_counter() - S = Matrix{Int}(S) - T = Matrix{Int}(T) - # Make sure G is a fully reduced Groebner Basis - Gb = groebner_basis( - ideal(gens(G)); ordering=matrix_ordering(base_ring(G), S), complete_reduction=true - ) - Gb = walk(Gb) - - @vprintln :groebner_walk "Cones crossed: " - delete_step_counter() - return Oscar.IdealGens(gens(Gb), matrix_ordering(base_ring(G), T); isGB=true) -end - ########################################### # Counter for the steps ########################################### @@ -178,28 +130,6 @@ end # Generic-version of the Groebner Walk. ############################################################### -# function generic_walk(G::Oscar.IdealGens, start::MonomialOrdering, target::MonomialOrdering) -# Lm = leading_term.(G; ordering=start) -# V = next_gamma(G, Lm, zeros(ZZRingElem, 1), start, target) - -# @vprintln :groebner_walk "Results for generic_walk" -# @vprintln :groebner_walk "Facets crossed for: " - -# while !isempty(V) -# G, Lm = generic_step(G, Lm, V, target) - -# # TODO: increase step_counter here -# @vprintln :groebner_walk V -# @vprintln :groebner_walk 2 G - -# G = IdealGens(G, target) -# V = next_gamma(G, Lm, V, start, target) -# end - -# return G -# end -# generic_walk(G::Oscar.IdealGens, S::Matrix{Int}, T::Matrix{Int}) = generic_walk(G, monomial_ordering(base_ring(G), S), monomial_ordering(base_ring(G), T)) - function generic_step( G::Oscar.IdealGens, Lm::Vector{T}, v::Vector{ZZRingElem}, ord::MonomialOrdering ) where {T<:MPolyRingElem} @@ -758,260 +688,6 @@ function inCone(G::Oscar.IdealGens, T::Matrix{Int}, pvecs::Vector{Vector{Int}}, return true end -################################################################# -# Procedures of the generic walk. -# The generic walk is proposed by Fukuda, Lauritzen & Thomas (2005). -################################################################# - -# returns the initials of the polynomials w.r.t. the vector v. -function facet_initials( - G::Oscar.IdealGens, lm::Vector{<:MPolyRingElem}, v::Vector{ZZRingElem} -) - initials = Vector{MPolyRingElem}() - - # TODO: this really wants marked Gröbner bases - ctx = MPolyBuildCtx(base_ring(G)) - for (g,el) in zip(G, exponent_vectors.(lm) .|> first) - for (c,e) in zip(coefficients(g), exponent_vectors(g)) - if el == e || is_parallel(ZZ.(el - e), v) - push_term!(ctx, c, e) - end - end - - push!(initials, finish(ctx)) - end - - return initials -end - -# returns the differences of the exponent vectors of the leading terms and the polynomials of the generators of I. -#Comment: I shouldn't need the ordering T here. (Lm already consists of monomials) - -function bounding_vectors( - G::Oscar.IdealGens, Lm::Vector{L}, T::MonomialOrdering -) where {L<:MPolyRingElem} - lead_exp = leading_term.(Lm; ordering=T) .|> exponent_vectors .|> first - - v = zip(lead_exp, exponent_vectors.(G)) .|> splat((l, t) -> Ref(l).-t) - - return unique!(reduce(vcat, v)) -end - -bounding_vectors(::Type{ZZRingElem}, G::Oscar.IdealGens, Lm::Vector{<:MPolyRingElem}, T::MonomialOrdering) = Vector{ZZRingElem}.(bounding_vectors(G, Lm, T)) - -# function difference_lead_tail( -# G::Oscar.IdealGens, Lm::Vector{L}, T::Union{Matrix{N},MatElem{N}} -# ) where {L<:MPolyRingElem,N} -# v = Vector{Int}[] -# for i in 1:length(G) -# ltu = collect( -# AbstractAlgebra.exponent_vectors( -# leading_term(Lm[i]; ordering=matrix_ordering(base_ring(G), T)) -# ), -# )[1] -# for e in AbstractAlgebra.exponent_vectors(G[i]) -# if ltu != e -# push!(v, ltu .- e) -# end -# end -# end -# return unique!(v) -# end - -# returns true if the vector u is parallel to the vector v. -function is_parallel(u::Vector{T}, v::Vector{T}) where T - count = 1 - x = 0 - for i in 1:length(u) - if u[i] == 0 - if v[count] == 0 - count += +1 - else - return false - end - else - x = v[count]//u[i] - count += 1 - break - end - end - if count > length(v) - return true - end - for i in count:length(v) - @inbounds if v[i] != x * u[i] - return false - end - end - return true -end - -# performs the lifting in the generic Walk like it´s proposed by Fukuda et al. (2005). -function lift_generic( - G::Vector{T}, Lm::Vector{T}, H::Vector{T}, ord::MonomialOrdering -) where {T<:MPolyRingElem} - R = parent(first(G)) - Newlm = Array{elem_type(R),1}(undef, 0) - liftPolys = Array{elem_type(R),1}(undef, 0) - for g in H - push!(Newlm, leading_term(g; ordering=ord)) - push!(liftPolys, g - reduce_walk(g, G, Lm, ord)) - end - return liftPolys, Newlm -end - -# returns all v \in V if v<0 w.r.t. the ordering represented by T and v>0 w.r.t the ordering represented by S. -function filter_by_ordering(S::ZZMatrix, T::ZZMatrix, V::Vector{Vector{ZZRingElem}}) - pred = v->( - less_than_zero(T, v) && - greater_than_zero(S, v) - ) - return unique!(filter(pred, V)) -end - -# function filter_by_ordering(S::Matrix{Int}, T::Matrix{Int}, V::Vector{Vector{Int}}) -# btz = Set{Vector{Int}}() -# for v in V -# if less_than_zero(T, v) && greater_than_zero(S, v) -# push!(btz, v) -# end -# end -# return btz -# end - -# returns all v \in V if wless_facet(w, v, start, target) - - return unique!(filter(pred, V)) -end - -# computes the next vector in the generic walk. -function next_gamma( - G::Oscar.IdealGens, - Lm::Vector{<:MPolyRingElem}, - w::Vector{ZZRingElem}, - start::MonomialOrdering, - target::MonomialOrdering -) - S = canonical_matrix(start) - T = canonical_matrix(target) - - V = filter_by_ordering(S, T, bounding_vectors(ZZRingElem, G, Lm, target)) - - if (w != zeros(ZZRingElem, 1)) - V = filter_lf(w, S, T, V) #TODO - end - - if isempty(V) - return V - end - - op = (minV,v) -> - if less_facet(v, minV, S, T) - return v - else return minV - end - - return foldl(op, V; init=first(V)) -end - -# tests if v>0 w.r.t. the ordering M. -# TODO What is the definition? -# This should be the ordering on Q^n induced by M: ( u <_M v iff Mu <_lex Mv)? -function greater_than_zero(M::ZZMatrix, v::Vector{ZZRingElem}) - nrows, _ = size(M) - - for i in 1:nrows - d = dot(M[i,:], v) - - if d != 0 - return d > 0 - end - end - - return false -end - -# tests if v<0 w.r.t. the ordering M. -# less_than_zero(M::ZZMatrix, v::Vector{ZZRingElem}) = new_less_than_zero(M, v) -function less_than_zero(M::ZZMatrix, v::Vector{ZZRingElem}) - nrows, _ = size(M) - - for i in 1:nrows - d = dot(M[i,:], v) - - if d != 0 - return d < 0 - end - end - - return false -end - -# tests if u Date: Fri, 19 Apr 2024 17:24:12 +0200 Subject: [PATCH 045/179] Separate the files --- Project.toml | 2 + examples/problematic_example_1.jl | 7 +- src/GroebnerWalk.jl | 4 + src/fractal_walk.jl | 108 ++++++++++++++++++++++++ src/perturbed_walk.jl | 7 +- src/standard_walk.jl | 61 +++++++++++++- src/walk.jl | 134 ------------------------------ 7 files changed, 183 insertions(+), 140 deletions(-) create mode 100644 src/fractal_walk.jl diff --git a/Project.toml b/Project.toml index 0049e433abf9..6608daee9f00 100644 --- a/Project.toml +++ b/Project.toml @@ -5,3 +5,5 @@ version = "0.1.0" [deps] Oscar = "f1435218-dba5-11e9-1e4d-f1a5fab5fc13" +Revise = "295af30f-e4ad-537b-8983-00126c2a3abe" +BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf" diff --git a/examples/problematic_example_1.jl b/examples/problematic_example_1.jl index 47f3265db654..eebd6d9f97f9 100644 --- a/examples/problematic_example_1.jl +++ b/examples/problematic_example_1.jl @@ -1,5 +1,5 @@ using Oscar -using Oscar.GroebnerWalk +using GroebnerWalk R, (x,y,z,u,v) = polynomial_ring(QQ, ["x","y","z","u","v"]) @@ -12,4 +12,7 @@ I1 = ideal([ -2 + 2*u^2 + 6*v - 3*u^2*v^2 - z ]) -groebner_walk(I1, o1, o2) \ No newline at end of file +set_verbosity_level(:groebner_walk, 1) +t_standard = @elapsed G = groebner_walk(I1, o2, o1; algorithm=:standard) +# t_generic = @elapsed G = groebner_walk(I1, o2, o1; algorithm=:generic) +# t_perturbed = @elapsed G = groebner_walk(I1, o2, o1; algorithm=:perturbed) \ No newline at end of file diff --git a/src/GroebnerWalk.jl b/src/GroebnerWalk.jl index 12e326fd41a4..d6363e0f70b7 100644 --- a/src/GroebnerWalk.jl +++ b/src/GroebnerWalk.jl @@ -7,6 +7,10 @@ include("markedGB.jl") include("generic_walk.jl") include("walk.jl") +include("standard_walk.jl") +include("perturbed_walk.jl") +include("fractal_walk.jl") + import Oscar: weight_ordering, ZZRingElem, MonomialOrdering, ZZMatrix, IdealGens import Oscar.Orderings: MatrixOrdering, _support_indices diff --git a/src/fractal_walk.jl b/src/fractal_walk.jl new file mode 100644 index 000000000000..205ec2595023 --- /dev/null +++ b/src/fractal_walk.jl @@ -0,0 +1,108 @@ +############################################################### +# Plain version of the Fractal Walk. +# This version checks if an entry of an intermediate weight vector is bigger than int32. In case of that the Buchberger-Algorithm is used to compute the Groebner basis of the ideal of the initialforms. +############################################################### + +function fractal_walk(G::Oscar.IdealGens, start::MonomialOrdering, target::MonomialOrdering) + @vprintln :groebner_walk "FractalWalk_standard results" + @vprintln :groebner_walk "Crossed Cones in: " + + S = canonical_matrix(start) + T = canonical_matrix(target) + + pTargetWeights = [perturbed_vector(G, T, i) for i in 1:nvars(base_ring(G))] + return fractal_recursion_step(G, S, T, S[1, :], pTargetWeights, 1) +end + +function fractal_recursion_step( + G::Oscar.IdealGens, + S::ZZMatrix, + T::ZZMatrix, + current_weight::Vector{ZZRingElem}, + pTargetWeights::Vector{Vector{ZZRingElem}}, + p::Int +) + R = base_ring(G) + G.isGB = true + w = current_weight + old_ordering = ordering(G) + while true + t = next_weight_fractal_walk(G, w, pTargetWeights[p]) + + # Handling the final step in the current depth. + # next_weight_fractal_walk may return 0 if the target vector does not lie in the cone of T while G already defines the Groebner basis w.r.t. T. + # -> Checking if G is already a Groebner basis w.r.t. T solves this problem and reduces computational effort since next_weight_fractal_walk returns 1 in the last step on every local path. if t == 1 && p != 1 + if t == 1 && p != 1 + if same_cone(G, T) + @vprintln :groebner_walk ("depth $p: in cone ", current_weight, ".")... + + # Check if a target weight of pTargetWeights[p] and pTargetWeights[p-1] lies in the wrong cone. + if !inCone(G, T, pTargetWeights, p) + global pTargetWeights = [perturbed_vector(G, T, i) for i in 1:nvars(R)] + @vprintln :groebner_walk ("depth $p: not in cone ", pTargetWeights[p], ".")... + end + return G + end + elseif t == [0] # The Groebner basis w.r.t. the target weight and T is already computed. + if inCone(G, T, pTargetWeights, p) + @vprintln :groebner_walk ("depth $p: in cone ", pTargetWeights[p], ".")... + return G + end + global pTargetWeights = [perturbed_vector(G, T, i) for i in 1:nvars(R)] + @vprintln :groebner_walk ("depth $p: not in cone ", pTargetWeights[p], ".")... + continue + end + + w = w + t * (pTargetWeights[p] - w) + w = convert_bounding_vector(w) + Gw = ideal(initial_forms(G, w)) + + # Handling the current weight with regards to Int32-entries. If an entry of w is bigger than Int32 use the Buchberger-algorithm. + if !checkInt32(w) + println( + "depth $p: Some entries of $w are bigger than Int32. Trying to find another weight," + ) + w, b = truncw(G, w, gens(Gw)) + if !b + println("depth $p: Doing a direct conversion to the target monomial ordering.") + ordNew = matrix_ordering(R, T) + w = T[1, :] + G = groebner_basis( + Gw; ordering=ordNew, complete_reduction=true, algorithm=:buchberger + ) + + if !inCone(G, T, pTargetWeights, p) + global pTargetWeights = [perturbed_vector(G, T, i) for i in 1:nvars(R)] + @vprintln :groebner_walk ("depth $p: not in cone ", pTargetWeights[p], ".")... + end + return G + end + end + ordNew = create_ordering(R, w, T) + # Converting the Groebner basis + if p == nvars(R) + H = groebner_basis( + Gw; ordering=ordNew, complete_reduction=true, algorithm=:buchberger + ) + + @vprintln :groebner_walk ("depth $p: conversion in ", w, ".")... + raise_step_counter() + else + @vprintln :groebner_walk "depth $p: recursive call in $w." + H = fractal_recursion_step( + Oscar.IdealGens(R, gens(Gw), ordAlt), + S, + T, + deepcopy(current_weight), + pTargetWeights, + p + 1, + ) + end + #H = liftGW2(G, R, Gw, H, Rn) + H = lift_fractal_walk(G, H, ordNew) + G = interreduce_walk(H) + ordAlt = ordNew + current_weight = w + end +end + diff --git a/src/perturbed_walk.jl b/src/perturbed_walk.jl index 73e5cef5b989..9df7dc151c9c 100644 --- a/src/perturbed_walk.jl +++ b/src/perturbed_walk.jl @@ -18,6 +18,10 @@ function perturbed_walk( current_weight = perturbed_vector(G, S, p) while !same_cone(G, target) + # @v_do :groebner_walk steps += 1 + @vprintln :groebner_walk current_weight + @vprintln :groebner_walk 2 G + target_weight = perturbed_vector(G, T, p) next_target = matrix_ordering(R, add_weight_vector(target_weight, T)) G = standard_walk(G, next_target, current_weight, target_weight) @@ -38,10 +42,11 @@ function perturbed_vector(G::Oscar.IdealGens, M::ZZMatrix, p::Int) rows = [M[i, :] for i in 1:p] m = maximum.(Ref(abs), rows) - m_sum = sum(m) + m_sum = sum(m[2:end]) max_deg = maximum(total_degree.(G)) # TODO: I think this is total degree e = max_deg * m_sum + 1 + w = M[1, :] * e^(p - 1) for i in 2:p w += e^(p - i) * M[i, :] diff --git a/src/standard_walk.jl b/src/standard_walk.jl index 2d5c7b797127..7a47346ffa21 100644 --- a/src/standard_walk.jl +++ b/src/standard_walk.jl @@ -153,12 +153,67 @@ The bounding vectors form an H-description of the Gröbner cone. (cf. "Using alg function bounding_vectors(I::Oscar.IdealGens) # TODO: rename this to "BoundingVectors" or something similar (as in M2 implementation/master's thesis) # TODO: Marked Gröbner basis - lead_exp = leading_term.(I; ordering=ordering(I)) .|> exponent_vectors .|> first + + # i_of_lead = index_of_leading_term.(I, Ref(ordering(I))) + + lead_exp = leading_monomial.(I; ordering=ordering(I)) .|> exponent_vectors .|> first # TODO: are leading terms being computed twice? (Once in leadexpv, once in tailexpvs) One instead could simply subtract leading terms, no? - tail_exps = zip(gens(I) .|> exponent_vectors, lead_exp) .|> splat((e, lead) -> filter(!=(lead), e)) - # tail_exps = tail.(I; ordering=ordering(I)) .|> exponent_vectors + # tail_exps = zip(gens(I) .|> exponent_vectors, lead_exp) .|> splat((e, lead) -> filter(!=(lead), e)) + tail_exps = tail.(I; ordering=ordering(I)) .|> exponent_vectors v = zip(lead_exp, tail_exps) .|> splat((l, t) -> Ref(l).-t) return unique!(reduce(vcat, v)) +end + +# TODO: Actual docstring +#= Lifting step from Proposition 3.2 of "The generic Gröbner walk" (Fukuda et al., 2005) + + Input: - G , the reduced G.B of I w.r.t current + - current, the current monomial order + - H, the reduced G.B of inw(I) w.r.t the next weight vector w + - target, the next monomial order + + Output: - an inclusion minimal G.B of target obtained by subtracting normal forms + + QUESTION: why do we need "target" in Oscar.IdealGens(...)? + + COMMENT: I think "target" is inappropriately named. It is rather "next_ordering" (i.e the target order, refined by w) +=# +@doc raw""" + lift( + G::Oscar.IdealGens, # momentane GB + current::MonomialOrdering, + H::Oscar.IdealGens, # soll GB von initial forms sein + target::MonomialOrdering, + ) + +Computes an inclusion minimal Gröbner basis with respect to `target` according to the +lifting step from Proposition 3.2 of "The generic Gröbner walk" (Fukuda et al., 2005) + +# Arguments +- `G::Oscar.IdealGens`: The reduced Gröbner basis of I +- `current::MonomialOrdering`: The current monomial order (TODO: Do we need that) +- `H::Oscar.IdealGens`: A Gröbner basis of initial forms of (TODO: what) with respect to (TODO: what) +- `target::MonomialOrdering`: The ordering for which the output is a Gröbner basis. +""" +function lift( + G::Oscar.IdealGens, # momentane GB + current::MonomialOrdering, + H::Oscar.IdealGens, # soll GB von initial forms sein + target::MonomialOrdering, +) + + + G = Oscar.IdealGens( + [ + gen - Oscar.IdealGens( + [reduce(gen, gens(G); ordering=current, complete_reduction=true)], target + )[1] for gen in gens(H) + ], + target; + isGB=true, + ) + + return G end \ No newline at end of file diff --git a/src/walk.jl b/src/walk.jl index 2c177e8fdd55..9aa1484cb231 100644 --- a/src/walk.jl +++ b/src/walk.jl @@ -288,108 +288,6 @@ end # This version checks if an entry of an intermediate weight vector is bigger than int32. In case of that the Buchberger-Algorithm is used to compute the Groebner basis of the ideal of the initialforms. ############################################################### -function fractal_walk(G::Oscar.IdealGens, S::MonomialOrdering, T::MonomialOrdering) - @vprintln :groebner_walk "FractalWalk_standard results" - @vprintln :groebner_walk "Crossed Cones in: " - - S = canonical_matrix(start) - T = canonical_matrix(target) - - pTargetWeights = [perturbed_vector(G, T, i) for i in 1:nvars(base_ring(G))] - return fractal_recursion_step(G, S, T, S[1, :], pTargetWeights, 1) -end - -function fractal_recursion_step( - G::Oscar.IdealGens, - S::ZZMatrix, - T::ZZMatrix, - current_weight::Vector{ZZRingElem}, - pTargetWeights::Vector{Vector{ZZRingElem}}, - p::Int, -) - R = base_ring(G) - G.isGB = true - w = current_weight - old_ordering = ordering(G) - while true - t = next_weight_fractal_walk(G, w, pTargetWeights[p]) - - # Handling the final step in the current depth. - # next_weight_fractal_walk may return 0 if the target vector does not lie in the cone of T while G already defines the Groebner basis w.r.t. T. - # -> Checking if G is already a Groebner basis w.r.t. T solves this problem and reduces computational effort since next_weight_fractal_walk returns 1 in the last step on every local path. if t == 1 && p != 1 - if t == 1 && p != 1 - if same_cone(G, T) - @vprintln :groebner_walk ("depth $p: in cone ", current_weight, ".")... - - # Check if a target weight of pTargetWeights[p] and pTargetWeights[p-1] lies in the wrong cone. - if !inCone(G, T, pTargetWeights, p) - global pTargetWeights = [perturbed_vector(G, T, i) for i in 1:nvars(R)] - @vprintln :groebner_walk ("depth $p: not in cone ", pTargetWeights[p], ".")... - end - return G - end - elseif t == [0] # The Groebner basis w.r.t. the target weight and T is already computed. - if inCone(G, T, pTargetWeights, p) - @vprintln :groebner_walk ("depth $p: in cone ", pTargetWeights[p], ".")... - return G - end - global pTargetWeights = [perturbed_vector(G, T, i) for i in 1:nvars(R)] - @vprintln :groebner_walk ("depth $p: not in cone ", pTargetWeights[p], ".")... - continue - end - - w = w + t * (pTargetWeights[p] - w) - w = convert_bounding_vector(w) - Gw = ideal(initial_forms(G, w)) - - # Handling the current weight with regards to Int32-entries. If an entry of w is bigger than Int32 use the Buchberger-algorithm. - if !checkInt32(w) - println( - "depth $p: Some entries of $w are bigger than Int32. Trying to find another weight," - ) - w, b = truncw(G, w, gens(Gw)) - if !b - println("depth $p: Doing a direct conversion to the target monomial ordering.") - ordNew = matrix_ordering(R, T) - w = T[1, :] - G = groebner_basis( - Gw; ordering=ordNew, complete_reduction=true, algorithm=:buchberger - ) - - if !inCone(G, T, pTargetWeights, p) - global pTargetWeights = [perturbed_vector(G, T, i) for i in 1:nvars(R)] - @vprintln :groebner_walk ("depth $p: not in cone ", pTargetWeights[p], ".")... - end - return G - end - end - ordNew = create_ordering(R, w, T) - # Converting the Groebner basis - if p == nvars(R) - H = groebner_basis( - Gw; ordering=ordNew, complete_reduction=true, algorithm=:buchberger - ) - - @vprintln :groebner_walk ("depth $p: conversion in ", w, ".")... - raise_step_counter() - else - @vprintln :groebner_walk "depth $p: recursive call in $w." - H = fractal_recursion_step( - Oscar.IdealGens(R, gens(Gw), ordAlt), - S, - T, - deepcopy(current_weight), - pTargetWeights, - p + 1, - ) - end - #H = liftGW2(G, R, Gw, H, Rn) - H = lift_fractal_walk(G, H, ordNew) - G = interreduce_walk(H) - ordAlt = ordNew - current_weight = w - end -end ############################################################### # Extends the plain Fractal Walk by checking the start order. @@ -735,38 +633,6 @@ end # returns 'true' if the leading terms of G w.r.t the matrixordering T are the same as the leading terms of G with the current ordering. same_cone(G::Oscar.IdealGens, T::MonomialOrdering) = all(leading_term.(G; ordering=T) .== leading_term.(G; ordering=ordering(G))) -# TODO: Actual docstring -#= Lifting step from Proposition 3.2 of "The generic Gröbner walk" (Fukuda et al., 2005) - - Input: - G , the reduced G.B of I w.r.t current - - current, the current monomial order - - H, the reduced G.B of inw(I) w.r.t the next weight vector w - - target, the next monomial order - - Output: - an inclusion minimal G.B of target obtained by subtracting normal forms - - QUESTION: why do we need "target" in Oscar.IdealGens(...)? - - COMMENT: I think "target" is inappropriately named. It is rather "next_ordering" (i.e the target order, refined by w) -=# -function lift( - G::Oscar.IdealGens, # momentane GB - current::MonomialOrdering, - H::Oscar.IdealGens, # soll GB von initial forms sein - target::MonomialOrdering, -) - G = Oscar.IdealGens( - [ - gen - Oscar.IdealGens( - [reduce(gen, gens(G); ordering=current, complete_reduction=true)], target - )[1] for gen in gens(H) - ], - target; - isGB=true, - ) - - return G -end # lifts the Groebner basis G to the Groebner basis w.r.t. the Ring Rn like it´s done in Collart et al. (1997). # FIXME: Needs to be fixed. From 536c2378056e8ff16494c4dfb1b4da176f4e25cb Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Fri, 19 Apr 2024 23:05:21 +0200 Subject: [PATCH 046/179] Polish words --- src/walk.jl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/walk.jl b/src/walk.jl index 9aa1484cb231..78b0e9b1d37b 100644 --- a/src/walk.jl +++ b/src/walk.jl @@ -11,7 +11,7 @@ Compute a reduced Groebner basis w.r.t. to a monomial order by converting it using the Groebner Walk. The Groebner Walk is proposed by Collart, Kalkbrener & Mall (1997). One can choose a strategy of: -- Standard Walk (:standard) computes the Walk like as presented in Cox, Little & O´Shea (2005). +- Standard Walk (:standard) computes the Walk like as presented in Cox, Little & O'Shea (2005). - Generic Walk (:generic) computes the Walk as presented in Fukuda, Jensen, Lauritzen & Thomas (2005). - Perturbed Walk (:perturbed, with p = degree of the perturbation) computes the Walk as presented in Amrhein, Gloor & Küchlin (1997). - Tran's Walk (:tran) computes the Walk like as presented in Tran (2000). @@ -22,12 +22,12 @@ One can choose a strategy of: - `I::MPolyIdeal`: ideal one wants to compute a Groebner basis for. - `target::MonomialOrdering=:lex`: monomial order one wants to compute a Groebner basis for. - `start::MonomialOrdering=:degrevlex`: monomial order to begin the conversion. -- `perturbationDegree::Int=2`: perturbationdegree for the perturbed Walk. -- `algorithm::Symbol=standard`: strategy of the Groebner Walk. One can choose a strategy of: +- `perturbationDegree::Int=2`: the perturbation degree for the perturbed Walk. +- `algorithm::Symbol=standard`: strategy of the Groebner Walk. One can choose between: - `standard`: Standard Walk, - `generic`: Generic Walk, - `perturbed`: Perturbed Walk, - - `tran`: Tran´s Walk, + - `tran`: Tran's Walk, - `fractal`: standard-version of the Fractal Walk, - `fractalcombined`: combined Version of the Fractal Walk. Target monomial order needs to be lex, From 32b73ae9b664953fe23a3238683468739fb9c1ed Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Fri, 19 Apr 2024 23:57:13 +0200 Subject: [PATCH 047/179] Add simple benchmark --- examples/benchmark/benchmarks.jl | 9 +++++++++ examples/benchmark/simple.jl | 14 ++++++++++++++ results.csv | 3 +++ 3 files changed, 26 insertions(+) create mode 100644 examples/benchmark/benchmarks.jl create mode 100644 examples/benchmark/simple.jl create mode 100644 results.csv diff --git a/examples/benchmark/benchmarks.jl b/examples/benchmark/benchmarks.jl new file mode 100644 index 000000000000..cdce4eb67d63 --- /dev/null +++ b/examples/benchmark/benchmarks.jl @@ -0,0 +1,9 @@ +using Oscar +using GroebnerWalk +using BenchmarkTools + +include("simple.jl") + +open("results.csv", "a") do io + simple(io) +end \ No newline at end of file diff --git a/examples/benchmark/simple.jl b/examples/benchmark/simple.jl new file mode 100644 index 000000000000..f1686407691a --- /dev/null +++ b/examples/benchmark/simple.jl @@ -0,0 +1,14 @@ + +function simple(io) + R,(x,y) = QQ[:x,:y] + I = ideal([y^4+ x^3-x^2+x,x^4]) + + + print(io, "simple,") + t = @belapsed groebner_walk($I; algorithm=:standard) + print(io, t, ",") + t = @belapsed groebner_walk($I; algorithm=:generic) + print(io, t, ",") + t = @belapsed groebner_basis($I; ordering=lex(R)) + println(io, t) +end \ No newline at end of file diff --git a/results.csv b/results.csv new file mode 100644 index 000000000000..10334e847dbf --- /dev/null +++ b/results.csv @@ -0,0 +1,3 @@ +name,standard_walk,generic_walk,buchberger +simple,0.002634119,0.001080056,4.670857142857143e-6 +simple,0.00262981,0.001087529,4.621e-6 From 99e87e45a93b53f5029f3d1dcb1b7b3fca0edf0d Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Sat, 20 Apr 2024 00:02:34 +0200 Subject: [PATCH 048/179] Fix typo --- src/generic_walk.jl | 2 +- src/markedGB.jl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/generic_walk.jl b/src/generic_walk.jl index 80683c5afaa1..52660d4f794a 100644 --- a/src/generic_walk.jl +++ b/src/generic_walk.jl @@ -14,7 +14,7 @@ function generic_walk(G::Oscar.IdealGens, start::MonomialOrdering, target::Monom @vprintln :groebner_walk v @vprintln :groebner_walk 2 G end - return Oscar.IdealGens(MG.gens, target; isGB = true) + return Oscar.IdealGens(MG.gens, target) #; isGB = true) end #Given the "old markedGB" GB and the newly computed facet normal v diff --git a/src/markedGB.jl b/src/markedGB.jl index 8f2a3894c431..75a6c758b484 100644 --- a/src/markedGB.jl +++ b/src/markedGB.jl @@ -69,7 +69,7 @@ function normal_form(p::MPolyRingElem, MG::markedGB) end # Calculates whether the monomial x^g divides x^f -divides(f::Vector{Int}, g::Vector{Int}) = all(g .<= f) +# divides(f::Vector{Int}, g::Vector{Int}) = all(g .<= f) #Given a markedGB MG, reduce it by replacing each g with its normal form w.r.t G\{g} #NB: only works if MG is inclusion minimal From 895300df1b459c871ab0d66c16490ee2d0aa9c3f Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Sat, 20 Apr 2024 00:03:08 +0200 Subject: [PATCH 049/179] Move agk4 --- examples/{problematic_example_1.jl => benchmark/agk4.jl} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename examples/{problematic_example_1.jl => benchmark/agk4.jl} (93%) diff --git a/examples/problematic_example_1.jl b/examples/benchmark/agk4.jl similarity index 93% rename from examples/problematic_example_1.jl rename to examples/benchmark/agk4.jl index eebd6d9f97f9..09876be0e2de 100644 --- a/examples/problematic_example_1.jl +++ b/examples/benchmark/agk4.jl @@ -1,5 +1,6 @@ using Oscar using GroebnerWalk +using BenchmarkTools R, (x,y,z,u,v) = polynomial_ring(QQ, ["x","y","z","u","v"]) @@ -12,7 +13,6 @@ I1 = ideal([ -2 + 2*u^2 + 6*v - 3*u^2*v^2 - z ]) -set_verbosity_level(:groebner_walk, 1) t_standard = @elapsed G = groebner_walk(I1, o2, o1; algorithm=:standard) # t_generic = @elapsed G = groebner_walk(I1, o2, o1; algorithm=:generic) # t_perturbed = @elapsed G = groebner_walk(I1, o2, o1; algorithm=:perturbed) \ No newline at end of file From e93470134162dd2e4b5c289b088d1e86619403b6 Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Sat, 20 Apr 2024 00:05:04 +0200 Subject: [PATCH 050/179] Change benchmark --- examples/benchmark/simple.jl | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/examples/benchmark/simple.jl b/examples/benchmark/simple.jl index f1686407691a..52d1d2e1d37a 100644 --- a/examples/benchmark/simple.jl +++ b/examples/benchmark/simple.jl @@ -2,13 +2,12 @@ function simple(io) R,(x,y) = QQ[:x,:y] I = ideal([y^4+ x^3-x^2+x,x^4]) - print(io, "simple,") t = @belapsed groebner_walk($I; algorithm=:standard) print(io, t, ",") t = @belapsed groebner_walk($I; algorithm=:generic) print(io, t, ",") - t = @belapsed groebner_basis($I; ordering=lex(R)) + t = @belapsed groebner_basis($I; ordering=lex($R)) println(io, t) end \ No newline at end of file From 0ce13334c2b2a0ce49a5de2b1249e1c196306dde Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Sat, 20 Apr 2024 01:42:19 +0200 Subject: [PATCH 051/179] Cleanup --- examples/benchmark/simple.jl | 13 ------------- examples/toy_example.jl | 15 +-------------- src/GroebnerWalk.jl | 2 +- src/standard_walk.jl | 36 ++++++++++++++++++------------------ 4 files changed, 20 insertions(+), 46 deletions(-) delete mode 100644 examples/benchmark/simple.jl diff --git a/examples/benchmark/simple.jl b/examples/benchmark/simple.jl deleted file mode 100644 index 52d1d2e1d37a..000000000000 --- a/examples/benchmark/simple.jl +++ /dev/null @@ -1,13 +0,0 @@ - -function simple(io) - R,(x,y) = QQ[:x,:y] - I = ideal([y^4+ x^3-x^2+x,x^4]) - - print(io, "simple,") - t = @belapsed groebner_walk($I; algorithm=:standard) - print(io, t, ",") - t = @belapsed groebner_walk($I; algorithm=:generic) - print(io, t, ",") - t = @belapsed groebner_basis($I; ordering=lex($R)) - println(io, t) -end \ No newline at end of file diff --git a/examples/toy_example.jl b/examples/toy_example.jl index 6d8dfe726747..38c10135cf14 100644 --- a/examples/toy_example.jl +++ b/examples/toy_example.jl @@ -7,17 +7,4 @@ I = ideal([y^4+ x^3-x^2+x,x^4]) set_verbosity_level(:groebner_walk, 1) groebner_walk(I) - -S = degrevlex(R) -T = lex(R) - -s = canonical_matrix(S)[1,:] -t = canonical_matrix(T)[1,:] - -G = groebner_basis(I; ordering=degrevlex(R), complete_reduction=true) - -G1 = standard_step(G, s, T) - -next_weight(G1, ZZ.([1,1]), ZZ.([1,0])) - -groebner_walk(I; walk_type=:generic) \ No newline at end of file +groebner_walk(I; algorithm=:generic) \ No newline at end of file diff --git a/src/GroebnerWalk.jl b/src/GroebnerWalk.jl index d6363e0f70b7..d009255d8e9e 100644 --- a/src/GroebnerWalk.jl +++ b/src/GroebnerWalk.jl @@ -1,7 +1,7 @@ module GroebnerWalk using Oscar -exponent_vectors = f->exponent_vector.(monomials(f), Ref(1)) +exponent_vectors = f->leading_exponent_vector.(monomials(f)) include("markedGB.jl") include("generic_walk.jl") diff --git a/src/standard_walk.jl b/src/standard_walk.jl index 7a47346ffa21..d8f95f221934 100644 --- a/src/standard_walk.jl +++ b/src/standard_walk.jl @@ -104,9 +104,13 @@ function initial_form(f::MPolyRingElem, w::Vector{ZZRingElem}) E = exponent_vectors(f) WE = dot.(Ref(w), Vector{ZZRingElem}.(E)) - maxw = maximum(WE) + maxw = -inf for (e, c, we) in zip(E, coefficients(f), WE) + if we > maxw + finish(ctx) + maxw = we + end if we == maxw push_term!(ctx, c, e) end @@ -136,11 +140,14 @@ as described in Algorithm 5.2 on pg. 437 of "Using algebraic geometry" (Cox, Lit """ function next_weight(G::Oscar.IdealGens, current::Vector{ZZRingElem}, target::Vector{ZZRingElem}) V = bounding_vectors(G) - tmin = minimum(c//(c-t) for (c,t) in zip(dot.(Ref(current), V), dot.(Ref(target), V)) if t<0; init=1) + C = dot.(Ref(current), V) + T = dot.(Ref(target), V) + + tmin = minimum(c//(c-t) for (c,t) in zip(C,T) if t<0; init=1) @vprintln :groebner_walk 3 (QQ.(current) + tmin * QQ.(target-current)) - return QQ.(current) + tmin * QQ.(target-current) |> convert_bounding_vector + return convert_bounding_vector(QQ.(current) + tmin * QQ.(target-current)) end @doc raw""" @@ -148,20 +155,17 @@ end Returns a list of "bounding vectors" of a Gröbner basis of `I`, as pairs of "exponent vector of leading monomial" and "exponent vector of tail monomial". -The bounding vectors form an H-description of the Gröbner cone. (cf. "Using algebraic geometry", pg. 437 (CLO, 2005)) TODO: consistent citations, compare with OSCAR +The bounding vectors form an H-description of the Gröbner cone. +(cf. "Using algebraic geometry", pg. 437 (CLO, 2005)) TODO: consistent citations, compare with OSCAR """ function bounding_vectors(I::Oscar.IdealGens) - # TODO: rename this to "BoundingVectors" or something similar (as in M2 implementation/master's thesis) # TODO: Marked Gröbner basis - - # i_of_lead = index_of_leading_term.(I, Ref(ordering(I))) - - lead_exp = leading_monomial.(I; ordering=ordering(I)) .|> exponent_vectors .|> first - # TODO: are leading terms being computed twice? (Once in leadexpv, once in tailexpvs) One instead could simply subtract leading terms, no? - # tail_exps = zip(gens(I) .|> exponent_vectors, lead_exp) .|> splat((e, lead) -> filter(!=(lead), e)) - tail_exps = tail.(I; ordering=ordering(I)) .|> exponent_vectors + gens_by_terms = terms.(I; ordering=ordering(I)) - v = zip(lead_exp, tail_exps) .|> splat((l, t) -> Ref(l).-t) + v = [ + [leading_exponent_vector(lead) - leading_exponent_vector(t) for t in tail] + for (lead, tail) in Iterators.peel.(gens_by_terms) + ] return unique!(reduce(vcat, v)) end @@ -203,13 +207,9 @@ function lift( H::Oscar.IdealGens, # soll GB von initial forms sein target::MonomialOrdering, ) - - G = Oscar.IdealGens( [ - gen - Oscar.IdealGens( - [reduce(gen, gens(G); ordering=current, complete_reduction=true)], target - )[1] for gen in gens(H) + gen - reduce(gen, gens(G); ordering=current, complete_reduction=true) for gen in gens(H) ], target; isGB=true, From 8586ab0155fb0ddbc6d3371433c81fc8574a4e58 Mon Sep 17 00:00:00 2001 From: Ortfs Date: Sat, 20 Apr 2024 11:44:12 +0200 Subject: [PATCH 052/179] clean up: commented out new "divide" --- src/markedGB.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/markedGB.jl b/src/markedGB.jl index 8f2a3894c431..a4127384decd 100644 --- a/src/markedGB.jl +++ b/src/markedGB.jl @@ -69,7 +69,7 @@ function normal_form(p::MPolyRingElem, MG::markedGB) end # Calculates whether the monomial x^g divides x^f -divides(f::Vector{Int}, g::Vector{Int}) = all(g .<= f) +#divides(f::Vector{Int}, g::Vector{Int}) = all(g .<= f) #Given a markedGB MG, reduce it by replacing each g with its normal form w.r.t G\{g} #NB: only works if MG is inclusion minimal From 4f2b3b2cb0a46b5a44bcfaf893b301be148c2f05 Mon Sep 17 00:00:00 2001 From: Ortfs Date: Sat, 20 Apr 2024 11:45:56 +0200 Subject: [PATCH 053/179] cleaning up, made lift_generic lighter --- examples/thesisexamples/chap3.jl | 86 +++----------------------------- examples/thesisexamples/chap4.jl | 8 +-- src/generic_walk.jl | 26 ++++------ src/walk.jl | 3 +- 4 files changed, 23 insertions(+), 100 deletions(-) diff --git a/examples/thesisexamples/chap3.jl b/examples/thesisexamples/chap3.jl index dc21dca04dca..003f8652d197 100644 --- a/examples/thesisexamples/chap3.jl +++ b/examples/thesisexamples/chap3.jl @@ -3,7 +3,7 @@ #Examples from chapter 3 using Oscar -using Oscar.GroebnerWalk +using GroebnerWalk #We perform computations on the same ideal throughout @@ -14,84 +14,10 @@ set_verbosity_level(:groebner_walk, 1) I = ideal([x^2 + y*z, x*y + z^2]) +os = lex(R) +ot = weight_ordering([1,3,0], deglex(R)) +Glex = groebner_basis(I; ordering = ot, complete_reduction = true) -#First example: conversion from degrevlex to lex +G1 = groebner_walk(I, ot, os, algorithm = :generic) -Gfinal = groebner_walk(I) - -#The algorithm terminates after 1 standard step. -#Check the subroutines: -G = groebner_basis(I; ordering=degrevlex(R), complete_reduction=true) - -w = next_weight(G, ZZ.([1,1,1]), ZZ.([1,0,0])) - -# I agree with the output of next_weight -# However, I think infoLevel should say "Crossed Cones in: [1,1,1]" (and not [1,0,0]) - -#First iteration -inwI = ideal(initial_forms(G,w)) -H = groebner_basis(inwI; ordering = weight_ordering(w, lex(R)), complete_reduction = true ) -Gnew = lift2(G, degrevlex(R), H, weight_ordering(w, lex(R))) - -#w != tau, so we go again, updating to Gnew, etc. - -w2 = next_weight(Gnew, ZZ.([1,1,1]), ZZ.([1,0,0])) - -inwI2 = ideal(initial_forms(Gnew, w2)) - -H2 = groebner_basis(inwI2; ordering = weight_ordering(w2, lex(R)), complete_reduction = true ) -G2new = lift2(Gnew, ordering(Gnew), H2, weight_ordering(w2, lex(R))) - -#G2new is Glex, as w = tau - - - - -#Second example (same conversion with different choice of weight vectors) - -o2 = weight_ordering([1,1,0], degrevlex(R)) - -o3 = weight_ordering([3,1,0], lex(R)) - -Gfinal2 = groebner_walk(I, o2, o3) - -#gens(Gfinal) == gens(Gfinal2) - -#the conversion works but like before I don't like that it says "Crossed cones in [3,1,0]" -#[3,1,0] lies in the interior of a cone. - - -#Third example: convert from lex to deglex, refined by [1,3,0] -o4 = weight_ordering([1,3,0], deglex(R)) - -Gfinal3 = groebner_walk(I, lex(R), o4) - -#two cones are crossed. -#Integer weight vectors is the standard choice. - - -#leading_term.(gens(Gfinal3), ordering = ordering(Gfinal3)) - - - -#= -groebner_walk(I, degrevlex(R), lex(R)) - -M = [1 3 0; 1 1 1; 1 0 0; 0 1 0; 0 0 1] - -o2 = matrix_ordering([x,y,z], M) - -result2 = groebner_walk(I, lex(R), o2) - -gens(result2) - -o3 = weight_ordering([1,3,0], deglex(R)) - -canonical_matrix(o2) - -canonical_matrix(o3) - -#leading_term.(gens(Gnew)) -#tail.(gens(Gnew))) - -=# \ No newline at end of file +G2 = groebner_walk(I, ot, os, algorithm = :standard) diff --git a/examples/thesisexamples/chap4.jl b/examples/thesisexamples/chap4.jl index cbd29355637c..c1791dc4fd0b 100644 --- a/examples/thesisexamples/chap4.jl +++ b/examples/thesisexamples/chap4.jl @@ -1,5 +1,5 @@ using Oscar -using Oscar.GroebnerWalk +using GroebnerWalk R, (x,y,z) = polynomial_ring(QQ, ["x","y","z"]) I = ideal([6 + 3*x^3+16*x^2*z+14*x^2*y^3, 6+y^3*z+17*x^2*z^2+7*x*y^2*z^2+13*x^3*z^2]) @@ -9,15 +9,15 @@ I = ideal([6 + 3*x^3+16*x^2*z+14*x^2*y^3, 6+y^3*z+17*x^2*z^2+7*x*y^2*z^2+13*x^3* # standard Gröbner Walk takes ~12s # generic Gröbner Walk takes ~2s -groebner_basis(I, ordering = lex(R)) +t_buchberger = @elapsed groebner_basis(I, ordering = lex(R)) #this takes longer than 30 mins in OSCAR, compared with ~90s in M2 #Is this to be expected? -groebner_walk(I, degrevlex(R), lex(R)) +t_standardwalk = @elapsed groebner_walk(I, lex(R), algorithm =:standard) -groebner_walk(I, degrevlex(R), lex(R), :generic) +t_generic = @elapsed groebner_walk(I, degrevlex(R), lex(R), algorithm =:generic) #takes more than 1hr... #the line above terminates in a few secs diff --git a/src/generic_walk.jl b/src/generic_walk.jl index 80683c5afaa1..1108241ebda3 100644 --- a/src/generic_walk.jl +++ b/src/generic_walk.jl @@ -22,13 +22,13 @@ end #and lifting it with markedGB_lift_generic. Subsequently reduce function markedGB_generic_step(MG::markedGB, v::Vector{ZZRingElem}, ord::MonomialOrdering) -facet_Generators = markedGB_facet_initials(MG, v) -H = groebner_basis( - ideal(facet_Generators); ordering=ord, complete_reduction=true, algorithm=:buchberger -) -newGB = markedGB_lift_generic(MG, gens(H), ord) -newGB = reductionalg(newGB) -return newGB + facet_Generators = markedGB_facet_initials(MG, v) + H = groebner_basis( + ideal(facet_Generators); ordering=ord, complete_reduction=true, algorithm=:buchberger) + H = markedGB(gens(H), leading_term.(H, ordering = ord)) + H = markedGB_lift_generic(MG, H) + H = reductionalg(H) + return H end @@ -125,15 +125,11 @@ function markedGB_facet_initials(MG::markedGB, v::Vector{ZZRingElem}) #Given a markedGB MG, a reduced GB of initial forms H w.r.t ord, and a monomial order #"lift" H to a markedGB of I (ordering unknown!) by subtracting initial forms according to Fukuda, 2007 -function markedGB_lift_generic(MG::markedGB, H::Vector{<:MPolyRingElem}, ord::MonomialOrdering) - R = parent(first(MG.gens)) - Newlm = Array{elem_type(R),1}(undef, 0) - liftPolys = Array{elem_type(R),1}(undef, 0) - for g in H - push!(Newlm, leading_term(g; ordering=ord)) - push!(liftPolys, g - normal_form(g, MG)) +function markedGB_lift_generic(MG::markedGB, H::markedGB) + for i in 1:length(H.gens) + H.gens[i] = H.gens[i] - normal_form(H.gens[i], MG) end - return markedGB(liftPolys, Newlm) + return H end diff --git a/src/walk.jl b/src/walk.jl index 9aa1484cb231..76f21f9dafc7 100644 --- a/src/walk.jl +++ b/src/walk.jl @@ -130,6 +130,7 @@ end # Generic-version of the Groebner Walk. ############################################################### +#= function generic_step( G::Oscar.IdealGens, Lm::Vector{T}, v::Vector{ZZRingElem}, ord::MonomialOrdering ) where {T<:MPolyRingElem} @@ -141,7 +142,7 @@ function generic_step( G = interreduce(H, Lm, ord) return G, Lm end - +=# ############################################################### # The Fractal Walk ############################################################### From 4b5c41e53ad4c1b4ffacacef05f0a9f8fdd6d045 Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Sun, 21 Apr 2024 21:32:55 +0200 Subject: [PATCH 054/179] Add LICENSE and README --- LICENSE | 674 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ README.md | 33 ++- 2 files changed, 704 insertions(+), 3 deletions(-) create mode 100644 LICENSE diff --git a/LICENSE b/LICENSE new file mode 100644 index 000000000000..f288702d2fa1 --- /dev/null +++ b/LICENSE @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/README.md b/README.md index d8661e6ebdac..d7c6b0398485 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,36 @@ # Gröbner walk -## Aims +GroebnerWalk.jl is a Julia package providing implementations of Gröbner walk algorithms +for computing Gröbner bases over fields on top of Oscar.jl. -This package implements a several variants of the Gröbner walk algorithm in OSCAR. +## Usage + +GroebnerWalk.jl provides its entire functionality through the function `groebner_walk`. +The following example demonstrates the usage. First, we define the ideal Oscar.jl. +```julia +using Oscar + +R, (x,y) = QQ[:x, :y] # define ring ... +I = ideal([y^4+ x^3-x^2+x,x^4]) # ... and ideal +``` + +Then, we can pass the ideal to `groebner_walk` to calculate the Gröbner basis. +Here, we want a Gröbner basis with respect to the lexicographic ordering on `R`. +```julia +using GroebnerWalk + +groebner_walk(I, lex(R)) # compute the Groebner basis +``` ## Status This repository represents the status of the code as a submission for MEGA 2024. -It is slated for inclusion into OSCAR as experimental package. \ No newline at end of file +At the moment, the standard walk (TODO: reference) and the generic walk (TODO: references) +are implemented. +It is slated for inclusion into OSCAR as experimental package. + +## Contacts +The library is maintained by Kamillo Ferry (kafe (at) kafe (dot) dev) and Francesco Nowell (francesconowell (at) gmail (dot) com). + +## Acknowledgement +The current implementation is based on an implementation by Jordi Welp. We thank him for +laying the groundwork for this package. From 8aa0caca68475dd650653ea2bdc6d2e62750089f Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Sun, 21 Apr 2024 23:54:08 +0200 Subject: [PATCH 055/179] Clean up the benchmark code --- examples/benchmark/benchmarks.jl | 76 +++++++++++++++++++++++++++++++- 1 file changed, 74 insertions(+), 2 deletions(-) diff --git a/examples/benchmark/benchmarks.jl b/examples/benchmark/benchmarks.jl index cdce4eb67d63..d648b652eddf 100644 --- a/examples/benchmark/benchmarks.jl +++ b/examples/benchmark/benchmarks.jl @@ -2,8 +2,80 @@ using Oscar using GroebnerWalk using BenchmarkTools -include("simple.jl") +function benchmark( + io, + name::String, + I::Ideal, + target::MonomialOrdering, + start::MonomialOrdering +) + print(io, name, ",") + t = @belapsed groebner_walk($I, $target, $start; algorithm=:standard) + print(io, t, ",") + t = @belapsed groebner_walk($I, $target, $start; algorithm=:generic) + print(io, t, ",") + t = @belapsed groebner_basis($I; ordering=$target) + println(io, t) +end +p = 11863279 +k = GF(p) open("results.csv", "a") do io - simple(io) + R, (x, y) = QQ[:x, :y] + I = ideal([y^4 + x^3 - x^2 + x, x^4]) + benchmark(io, "simple", I, lex(R), default_ordering(R)) + + R, (z0, z1, z2, z3, z4, z5, z6) = QQ[:z0, :z1, :z2, :z3, :z4, :z5, :z6] + F = [ + z0 + z1 + z2 + z3 + z4 + z5 + z6, + z0 * z1 + z1 * z2 + z2 * z3 + z3 * z4 + z4 * z5 + z5 * z6 + z6 * z0, + z0 * z1 * z2 + z1 * z2 * z3 + z2 * z3 * z4 + z3 * z4 * z5 + z4 * z5 * z6 + z5 * z6 * z0 + z6 * z0 * z1, + z0 * z1 * z2 * z3 + z1 * z2 * z3 * z4 + z2 * z3 * z4 * z5 + z3 * z4 * z5 * z6 + z4 * z5 * z6 * z0 + + z5 * z6 * z0 * z1 + z6 * z0 * z1 * z2, + z0 * z1 * z2 * z3 * z4 + z1 * z2 * z3 * z4 * z5 + z2 * z3 * z4 * z5 * z6 + z3 * z4 * z5 * z6 * z0 + + z4 * z5 * z6 * z0 * z1 + z5 * z6 * z0 * z1 * z2 + z6 * z0 * z1 * z2 * z3, + z0 * z1 * z2 * z3 * z4 * z5 + z1 * z2 * z3 * z4 * z5 * z6 + z2 * z3 * z4 * z5 * z6 * z0 + z3 * z4 * z5 * z6 * z0 * z1 + + z4 * z5 * z6 * z0 * z1 * z2 + z5 * z6 * z0 * z1 * z2 * z3 + z6 * z0 * z1 * z2 * z3 * z4, + z0 * z1 * z2 * z3 * z4 * z5 * z6 - 1 + ] + benchmark(io, "cyclic7-QQ", ideal(R, F), lex(R), default_ordering(R)) + + R, (z0, z1, z2, z3, z4, z5, z6) = k[:z0, :z1, :z2, :z3, :z4, :z5, :z6] + F = [ + z0 + z1 + z2 + z3 + z4 + z5 + z6, + z0 * z1 + z1 * z2 + z2 * z3 + z3 * z4 + z4 * z5 + z5 * z6 + z6 * z0, + z0 * z1 * z2 + z1 * z2 * z3 + z2 * z3 * z4 + z3 * z4 * z5 + z4 * z5 * z6 + z5 * z6 * z0 + z6 * z0 * z1, + z0 * z1 * z2 * z3 + z1 * z2 * z3 * z4 + z2 * z3 * z4 * z5 + z3 * z4 * z5 * z6 + z4 * z5 * z6 * z0 + + z5 * z6 * z0 * z1 + z6 * z0 * z1 * z2, + z0 * z1 * z2 * z3 * z4 + z1 * z2 * z3 * z4 * z5 + z2 * z3 * z4 * z5 * z6 + z3 * z4 * z5 * z6 * z0 + + z4 * z5 * z6 * z0 * z1 + z5 * z6 * z0 * z1 * z2 + z6 * z0 * z1 * z2 * z3, + z0 * z1 * z2 * z3 * z4 * z5 + z1 * z2 * z3 * z4 * z5 * z6 + z2 * z3 * z4 * z5 * z6 * z0 + z3 * z4 * z5 * z6 * z0 * z1 + + z4 * z5 * z6 * z0 * z1 * z2 + z5 * z6 * z0 * z1 * z2 * z3 + z6 * z0 * z1 * z2 * z3 * z4, + z0 * z1 * z2 * z3 * z4 * z5 * z6 - 1 + ] + benchmark(io, "cyclic7-Fp", ideal(R, F), lex(R), default_ordering(R)) + + # k = GF(11863279) + # R, (x1, x2, x3, x4, x5, x6, x7) = k[:x1, :x2, :x3, :x4, :x5, :x6, :x7] + # F = [ + # 1*x1+2*x2+2*x3+2*x4+2*x5+2*x6+2*x7-1, + # 2*x4*x3+2*x5*x2+2*x6*x1+2*x7*x2-1*x6, + # 1*x3^2+2*x4*x2+2*x5*x1+2*x6*x2+2*x7*x3-1*x5, + # 2*x3*x2+2*x4*x1+2*x5*x2+2*x6*x3+2*x7*x4-1*x4, + # 1*x2^2+2*x3*x1+2*x4*x2+2*x5*x3+2*x6*x4+2*x7*x5-1*x3, + # 2*x2*x1+2*x3*x2+2*x4*x3+2*x5*x4+2*x6*x5+2*x7*x6-1*x2, + # 1*x1^2+2*x2^2+2*x3^2+2*x4^2+2*x5^2+2*x6^2+2*x7^2-1*x1 + # ]; + # benchmark(io, "katsura6-Fp", ideal(R, F), lex(R), default_ordering(R)) + + # R, (x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21, x22, x23, x24, x25, x26, x27, x28, x29, x30, x31, x32) = QQ[ + # :x1, :x2, :x3, :x4, :x5, :x6, :x7, :x8, :x9, :x10, :x11, :x12, :x13, :x14, :x15, :x16, :x17, :x18, :x19, :x20, :x21, :x22, :x23, :x24, :x25, :x26, :x27, :x28, :x29, :x30, :x31, :x32 + # ] + # F = [ + # -x23*x32+x24*x31, -x22*x32+x24*x30, -x22*x31+x23*x30, -x21*x32+x24*x29, -x21*x31+x23*x29, -x21*x30+x22*x29, -x12*x32+x16*x28, -x19*x28+x20*x27, + # -x11*x31+x15*x27, -x18*x28+x20*x26, -x18*x27+x19*x26, -x10*x30+x14*x26, -x17*x28+x20*x25, -x17*x27+x19*x25, -x17*x26+x18*x25, -x9*x29+x13*x25, x20*x8-x24*x4, + # -x17*x20-x17*x24-2*x17*x28-x17*x32+x18*x19+x18*x23+2*x18*x27+x18*x31+x19*x22+x19*x30-x20*x21-x20*x29-x21*x24-x21*x28-2*x21*x32+x22*x23+x22*x27+2*x22*x31+x23*x26-x24*x25-x25*x28-x25*x32+x26*x27+x26*x31+x27*x30-x28*x29-x29*x32+x30*x31, + # x19*x7-x23*x3, x18*x6-x2*x22, -x1*x21+x17*x5 + # ] + # benchmark(io, "bayes148", ideal(R, F), lex(R), default_ordering(R)) end \ No newline at end of file From b9bd2ffaf66bf10d375d3c6bdfe2e736508d58ee Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Sun, 21 Apr 2024 23:54:58 +0200 Subject: [PATCH 056/179] =?UTF-8?q?Rename=20`markedGB`=20to=20`MarkedGr?= =?UTF-8?q?=C3=B6bnerBasis`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/generic_walk.jl | 44 ++++++++++-------- src/markedGB.jl | 106 +++++++++++++++++++++++++++++++++----------- 2 files changed, 106 insertions(+), 44 deletions(-) diff --git a/src/generic_walk.jl b/src/generic_walk.jl index 4f93726b105b..52b918ab232c 100644 --- a/src/generic_walk.jl +++ b/src/generic_walk.jl @@ -3,11 +3,11 @@ function generic_walk(G::Oscar.IdealGens, start::MonomialOrdering, target::Monom @vprintln :groebner_walk "Facets crossed for: " Lm = leading_term.(G, ordering = start) - MG = markedGB(gens(G), Lm) + MG = MarkedGroebnerBasis(gens(G), Lm) v = markedGB_next_gamma(MG, ZZ.([0]), start, target) while !isempty(v) - MG = markedGB_generic_step(MG, v, target) + MG = generic_step(MG, v, target) v = markedGB_next_gamma(MG, v, start, target) # TODO: increase step_counter here @@ -17,18 +17,23 @@ function generic_walk(G::Oscar.IdealGens, start::MonomialOrdering, target::Monom return Oscar.IdealGens(MG.gens, target) #; isGB = true) end -#Given the "old markedGB" GB and the newly computed facet normal v -#compute the next markedGB by taking G.B of initial forms H w.r.t less -#and lifting it with markedGB_lift_generic. Subsequently reduce +@doc raw""" + generic_step(MG::MarkedGroebnerBasis, v::Vector{ZZRingElem}, ord::MonomialOrdering) -function markedGB_generic_step(MG::markedGB, v::Vector{ZZRingElem}, ord::MonomialOrdering) - facet_Generators = markedGB_facet_initials(MG, v) +Given the marked Gröbner basis `MG` and a facet normal vector `v`, compute the next marked Gröbner basis. +""" +function generic_step(MG::MarkedGroebnerBasis, v::Vector{ZZRingElem}, ord::MonomialOrdering) + facet_Generators = facet_initials(MG, v) H = groebner_basis( - ideal(facet_Generators); ordering=ord, complete_reduction=true, algorithm=:buchberger) - H = markedGB(gens(H), leading_term.(H, ordering = ord)) + ideal(facet_Generators); ordering=ord, complete_reduction=true, algorithm=:buchberger + ) + + H = MarkedGroebnerBasis(gens(H), leading_term.(H, ordering = ord)) H = markedGB_lift_generic(MG, H) - H = reductionalg(H) - return H + + autoreduce!(H) + + return H end @@ -64,7 +69,7 @@ exponent_vectors = f->exponent_vector.(monomials(f), Ref(1)) #returns exponent v #returns a list of integer vectors of the form a - b # (where a is a leading exponent and b is in the tail of some g in MG) -function markedGB_difference_lead_tail(MG::markedGB) +function markedGB_difference_lead_tail(MG::MarkedGroebnerBasis) (G,Lm) = MG.gens, MG.markings lead_exp = Lm .|> exponent_vectors .|> first @@ -78,7 +83,7 @@ end #i.e. the bounding vector v fulfilling w Date: Sun, 21 Apr 2024 23:55:05 +0200 Subject: [PATCH 057/179] Cleanup --- src/walk.jl | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/src/walk.jl b/src/walk.jl index 8eb79599a83f..9fd2b4856ef3 100644 --- a/src/walk.jl +++ b/src/walk.jl @@ -659,32 +659,6 @@ function liftGW2( return Oscar.IdealGens(filter(!iszero, H), ordering) end -# divisionalgorithm that returns q with q_1*f_1 + ... + q_s *f_s=p. -function division_algorithm(p::T, f::Vector{T}, R::MPolyRing) where {T<:MPolyRingElem} - q = Array{Singular.elem_type(R),1}(undef, length(f)) - for i in 1:length(f) - q[i] = R(0) - end - while !isequal(p, R(0)) - i = 1 - div = false - while (div == false && i <= length(f)) - b, m = divides(leading_term(p), leading_term(f[i])) - if b - q[i] = q[i] + m - p = p - (m * f[i]) - div = true - else - i = i + 1 - end - end - if div == false - p = p - leading_term(p) - end - end - return q -end - # converts a vector wtemp by dividing the entries with gcd(wtemp). function convert_bounding_vector(w::Vector{T}) where {T<:Union{ZZRingElem, QQFieldElem}} c = gcd(w) From b8c2c616190d1ae5545b93e2c87c39f88dc59e30 Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Mon, 22 Apr 2024 00:01:33 +0200 Subject: [PATCH 058/179] Rename `markedGB` to `MarkedGroebnerBasis` --- src/generic_walk.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/generic_walk.jl b/src/generic_walk.jl index 52b918ab232c..3039b34c5c61 100644 --- a/src/generic_walk.jl +++ b/src/generic_walk.jl @@ -131,7 +131,7 @@ function facet_initials(MG::MarkedGroebnerBasis, v::Vector{ZZRingElem}) #Given a markedGB MG, a reduced GB of initial forms H w.r.t ord, and a monomial order #"lift" H to a markedGB of I (ordering unknown!) by subtracting initial forms according to Fukuda, 2007 -function markedGB_lift_generic(MG::markedGB, H::markedGB) +function markedGB_lift_generic(MG::MarkedGroebnerBasis, H::MarkedGroebnerBasis) for i in 1:length(H.gens) H.gens[i] = H.gens[i] - normal_form(H.gens[i], MG) end From 3a8adcb07108609df30d69ec6ea57c139cda2821 Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Mon, 22 Apr 2024 00:26:34 +0200 Subject: [PATCH 059/179] Avoid unnecessary copies in `facet_initials` --- src/generic_walk.jl | 41 ++++++++++++++++++++++------------------- 1 file changed, 22 insertions(+), 19 deletions(-) diff --git a/src/generic_walk.jl b/src/generic_walk.jl index 3039b34c5c61..da0f056eff49 100644 --- a/src/generic_walk.jl +++ b/src/generic_walk.jl @@ -29,7 +29,7 @@ function generic_step(MG::MarkedGroebnerBasis, v::Vector{ZZRingElem}, ord::Monom ) H = MarkedGroebnerBasis(gens(H), leading_term.(H, ordering = ord)) - H = markedGB_lift_generic(MG, H) + H = lift_generic(MG, H) autoreduce!(H) @@ -108,30 +108,33 @@ Given a marked Gröbner basis `MG` and a facet normal `v`, computes the Gröbner of `MG` by truncating to all bounding vectors parallel to `v`. """ function facet_initials(MG::MarkedGroebnerBasis, v::Vector{ZZRingElem}) - inwG = copy(MG.markings) - gens = copy(MG.gens) - - R = parent(first(gens)) - for i in 1:length(MG.markings) - a = first(exponent_vector.(monomials(MG.markings[i]), Ref(1))) - for (b, coeff) in zip(exponent_vectors(gens[i]), - [leading_coefficient(term) for term in terms(gens[i])]) - if new_is_parallel(ZZ.(a-b), v) - inwG[i] += coeff*monomial(R,b) - end + R = base_ring(MG) + inwG = Vector{MPolyRingElem}() + + ctx = MPolyBuildCtx(R) + for (i, (g, m)) in gens_and_markings(MG) |> enumerate + c, a = leading_coefficient_and_exponent(m) + push_term!(ctx, c, a) + + for (d, b) in coefficients_and_exponents(g) + if new_is_parallel(ZZ.(a - b), v) + push_term!(ctx, d, b) end end - return inwG - end + push!(inwG, finish(ctx)) + end -#---------------------------- + return inwG +end -#------ lifting step +@doc raw""" + lift_generic(MG::MarkedGroebnerBasis, H::MarkedGroebnerBasis) -#Given a markedGB MG, a reduced GB of initial forms H w.r.t ord, and a monomial order -#"lift" H to a markedGB of I (ordering unknown!) by subtracting initial forms according to Fukuda, 2007 -function markedGB_lift_generic(MG::MarkedGroebnerBasis, H::MarkedGroebnerBasis) +Given a marked Gröbner basis `MG` generating an ideal $I$ and a reduced marked Gröbner basis `H` of initial forms, +lift H to a marked Gröbner basis of I (with unknown ordering) by subtracting initial forms according to Fukuda, 2007. +""" +function lift_generic(MG::MarkedGroebnerBasis, H::MarkedGroebnerBasis) for i in 1:length(H.gens) H.gens[i] = H.gens[i] - normal_form(H.gens[i], MG) end From bbe04e63ed69bf0c26436dbc96ab825e73e40a3c Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Mon, 22 Apr 2024 00:35:59 +0200 Subject: [PATCH 060/179] Change order of arguments in example --- examples/thesisexamples/chap4.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/thesisexamples/chap4.jl b/examples/thesisexamples/chap4.jl index c1791dc4fd0b..8cb3c8a3308d 100644 --- a/examples/thesisexamples/chap4.jl +++ b/examples/thesisexamples/chap4.jl @@ -16,8 +16,8 @@ t_buchberger = @elapsed groebner_basis(I, ordering = lex(R)) t_standardwalk = @elapsed groebner_walk(I, lex(R), algorithm =:standard) +t_generic = @elapsed groebner_walk(I, lex(R), degrevlex(R), algorithm =:generic) #takes more than 1hr... -t_generic = @elapsed groebner_walk(I, degrevlex(R), lex(R), algorithm =:generic) #takes more than 1hr... #the line above terminates in a few secs From 0cd510795e765b85f74b436b213400cc8eaef74b Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Mon, 22 Apr 2024 01:03:49 +0200 Subject: [PATCH 061/179] Speed up generic_walk!! --- src/generic_walk.jl | 81 ++++++++++++++++++++++++++------------------- src/markedGB.jl | 4 +-- 2 files changed, 49 insertions(+), 36 deletions(-) diff --git a/src/generic_walk.jl b/src/generic_walk.jl index da0f056eff49..6336d2f60673 100644 --- a/src/generic_walk.jl +++ b/src/generic_walk.jl @@ -4,11 +4,11 @@ function generic_walk(G::Oscar.IdealGens, start::MonomialOrdering, target::Monom Lm = leading_term.(G, ordering = start) MG = MarkedGroebnerBasis(gens(G), Lm) - v = markedGB_next_gamma(MG, ZZ.([0]), start, target) + v = next_gamma(MG, ZZ.([0]), start, target) while !isempty(v) MG = generic_step(MG, v, target) - v = markedGB_next_gamma(MG, v, start, target) + v = next_gamma(MG, v, start, target) # TODO: increase step_counter here @vprintln :groebner_walk v @@ -63,29 +63,33 @@ markedGB_generic_walk(G, o_s, o_t) #------next_gamma (Goal: Get next facet normal along generic path) -exponent_vectors = f->exponent_vector.(monomials(f), Ref(1)) #returns exponent vectors of all terms in f - - +dropfirst(V::AbstractVector) = Iterators.drop(V, 1) +@doc raw""" + difference_lead_tail(MG::MarkedGroebnerBasis) -#returns a list of integer vectors of the form a - b -# (where a is a leading exponent and b is in the tail of some g in MG) -function markedGB_difference_lead_tail(MG::MarkedGroebnerBasis) - (G,Lm) = MG.gens, MG.markings - lead_exp = Lm .|> exponent_vectors .|> first +Computes $a - b$ for $a$ a leading exponent and $b$ in the tail of some $g\in MG$. +""" +function difference_lead_tail(MG::MarkedGroebnerBasis) + (G,Lm) = gens_and_markings(MG) + lead_exp = Lm .|> leading_exponent_vector - v = zip(lead_exp, exponent_vectors.(G)) .|> splat((l, t) -> Ref(l).-t) + v = zip(lead_exp, dropfirst.(exponent_vectors.(G))) .|> splat((l, t) -> Ref(l).-t) - return [ZZ.(v) for v in unique!(reduce(vcat, v))[2:end]] #temporary solution: the first element is always the zero vector? + return [ZZ.(v) for v in unique!(reduce(vcat, v))] end -#given a marked GB, the previous weight vector w and monomial orderings -#returns the "next" facet normal -#i.e. the bounding vector v fulfilling w( - new_less_than_zero(canonical_matrix(target), ZZ.(v)) && !new_less_than_zero(canonical_matrix(start), ZZ.(v)) - ) - return unique!(filter(pred, V)) - end +Computes all elements $v\in V$ with $0 <_{\texttt{target}} v$ and $v <_{\texttt{start}} 0$ +""" +function filter_by_ordering(start::MonomialOrdering, target::MonomialOrdering, V::Vector{Vector{ZZRingElem}}) + pred = v -> ( + new_less_than_zero(canonical_matrix(target), ZZ.(v)) && !new_less_than_zero(canonical_matrix(start), ZZ.(v)) + ) + return unique!(filter(pred, V)) +end #returns true if v <_M w , false otherwise @@ -199,10 +206,16 @@ function new_facet_less_than(S::ZZMatrix, T::ZZMatrix, u::Vector{ZZRingElem}, v: end #returns all elements of V smaller than w w.r.t the facet preorder + +@doc raw""" + filter_lf(w::Vector{ZZRingElem}, start::MonomialOrdering, target::MonomialOrdering, V::Vector{Vector{ZZRingElem}}) + +Returns all elements of `V` smaller than `w` with respect to the facet preorder. +""" function new_filter_lf(w::Vector{ZZRingElem}, start::MonomialOrdering, target::MonomialOrdering, V::Vector{Vector{ZZRingElem}}) btz = Vector{Vector{ZZRingElem}}() for v in V - if new_facet_less_than(canonical_matrix(start),canonical_matrix(target),w,v) && !(v in btz) + if new_facet_less_than(canonical_matrix(start),canonical_matrix(target),w,v) && !(v in btz) push!(btz, v) end end diff --git a/src/markedGB.jl b/src/markedGB.jl index 27184a61c792..f0ba0b8a8338 100644 --- a/src/markedGB.jl +++ b/src/markedGB.jl @@ -29,7 +29,7 @@ length(G::MarkedGroebnerBasis) = length(gens(G)) gens(G::MarkedGroebnerBasis) = G.gens markings(G::MarkedGroebnerBasis) = G.markings -gens_with_markings(G::MarkedGroebnerBasis) = zip(gens(G), markings(G)) +gens_and_markings(G::MarkedGroebnerBasis) = zip(gens(G), markings(G)) # getindex(G::MarkedGroebnerBasis, i::Int) = (G.gens[i], G.markings[i]) # function setindex!(G::MarkedGroebnerBasis, (f,m)::MarkedPolynomial, i::Int) @@ -114,7 +114,7 @@ function autoreduce(MG::MarkedGroebnerBasis) newlm = Vector{MPolyRingElem}() n = length(MG) - for (i, (g, mark)) in enumerate(gens_with_markings(MG)) + for (i, (g, mark)) in enumerate(gens_and_markings(MG)) rest = some_gens_with_markings(MG, 1:n .!= i) nf = _normal_form(g, rest...) From cdd99c0d2aa716dea5abffbff90c764a36025af4 Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Mon, 22 Apr 2024 01:07:12 +0200 Subject: [PATCH 062/179] Document code --- src/generic_walk.jl | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/generic_walk.jl b/src/generic_walk.jl index 6336d2f60673..07860f04787c 100644 --- a/src/generic_walk.jl +++ b/src/generic_walk.jl @@ -98,7 +98,7 @@ function next_gamma( end minV = first(V) for v in V - if new_facet_less_than(canonical_matrix(start), canonical_matrix(target),v, minV) + if facet_less_than(canonical_matrix(start), canonical_matrix(target),v, minV) minV = v end end @@ -195,9 +195,13 @@ function matrix_less_than(M::ZZMatrix, v::Vector{ZZRingElem}, w::Vector{ZZRingEl return dot(M[i, :], v) < dot(M[i, :], w) end -#returns true if u < v w.r.t the Facet preorder (cf. "The generic Gröbner walk" (Fukuda et a;. 2007), pg. 10) #Comment: It may make more sense to have the monomial orderings as inputs. -function new_facet_less_than(S::ZZMatrix, T::ZZMatrix, u::Vector{ZZRingElem}, v::Vector{ZZRingElem}) +@doc raw""" + facet_less_than(S::ZZMatrix, T::ZZMatrix, u::Vector{ZZRingElem}, v::Vector{ZZRingElem}) + +Returns true if $u < v$with respect to the facet preorder $<$. (cf. "The generic Gröbner walk" (Fukuda et a;. 2007), pg. 10) +""" +function facet_less_than(S::ZZMatrix, T::ZZMatrix, u::Vector{ZZRingElem}, v::Vector{ZZRingElem}) i = 1 while dot(T[i,:], u)v == dot(T[i,:], v)u && i != number_of_rows(T) i += 1 @@ -215,7 +219,7 @@ Returns all elements of `V` smaller than `w` with respect to the facet preorder. function new_filter_lf(w::Vector{ZZRingElem}, start::MonomialOrdering, target::MonomialOrdering, V::Vector{Vector{ZZRingElem}}) btz = Vector{Vector{ZZRingElem}}() for v in V - if new_facet_less_than(canonical_matrix(start),canonical_matrix(target),w,v) && !(v in btz) + if facet_less_than(canonical_matrix(start),canonical_matrix(target),w,v) && !(v in btz) push!(btz, v) end end From d178fe3d0320e3f6a857834bd9824826dd49f637 Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Mon, 22 Apr 2024 01:08:37 +0200 Subject: [PATCH 063/179] Cleanup examples --- examples/benchmark/agk4.jl | 2 +- examples/thesisexamples/chap4.jl | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/benchmark/agk4.jl b/examples/benchmark/agk4.jl index 09876be0e2de..3e7cd33cbeb6 100644 --- a/examples/benchmark/agk4.jl +++ b/examples/benchmark/agk4.jl @@ -14,5 +14,5 @@ I1 = ideal([ ]) t_standard = @elapsed G = groebner_walk(I1, o2, o1; algorithm=:standard) -# t_generic = @elapsed G = groebner_walk(I1, o2, o1; algorithm=:generic) +t_generic = @elapsed G = groebner_walk(I1, o2, o1; algorithm=:generic) # t_perturbed = @elapsed G = groebner_walk(I1, o2, o1; algorithm=:perturbed) \ No newline at end of file diff --git a/examples/thesisexamples/chap4.jl b/examples/thesisexamples/chap4.jl index 8cb3c8a3308d..c6eb77ec2d2e 100644 --- a/examples/thesisexamples/chap4.jl +++ b/examples/thesisexamples/chap4.jl @@ -14,9 +14,9 @@ t_buchberger = @elapsed groebner_basis(I, ordering = lex(R)) #Is this to be expected? -t_standardwalk = @elapsed groebner_walk(I, lex(R), algorithm =:standard) +t_standardwalk = @elapsed groebner_walk(I, lex(R); algorithm =:standard) -t_generic = @elapsed groebner_walk(I, lex(R), degrevlex(R), algorithm =:generic) #takes more than 1hr... +t_generic = @elapsed groebner_walk(I, lex(R); algorithm =:generic) #takes more than 1hr... #the line above terminates in a few secs From 9a1add4880311bbb2572d244b99dd385180fe74c Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Mon, 22 Apr 2024 01:22:03 +0200 Subject: [PATCH 064/179] Fix difference_lead_tail for good --- src/generic_walk.jl | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/generic_walk.jl b/src/generic_walk.jl index 07860f04787c..bacc4a03878f 100644 --- a/src/generic_walk.jl +++ b/src/generic_walk.jl @@ -70,11 +70,11 @@ dropfirst(V::AbstractVector) = Iterators.drop(V, 1) Computes $a - b$ for $a$ a leading exponent and $b$ in the tail of some $g\in MG$. """ function difference_lead_tail(MG::MarkedGroebnerBasis) - (G,Lm) = gens_and_markings(MG) - lead_exp = Lm .|> leading_exponent_vector + (G,Lm) = gens(MG), markings(MG) + lead_exp = leading_exponent_vector.(Lm) v = zip(lead_exp, dropfirst.(exponent_vectors.(G))) .|> splat((l, t) -> Ref(l).-t) - + return [ZZ.(v) for v in unique!(reduce(vcat, v))] end @@ -182,12 +182,14 @@ function filter_by_ordering(start::MonomialOrdering, target::MonomialOrdering, V ) return unique!(filter(pred, V)) end - -#returns true if v <_M w , false otherwise -#i.e elements of the vectors Mv and Mw are compared until a tie is broken +@doc raw""" + matrix_less_than(M::ZZMatrix, v::Vector{ZZRingElem}, w::Vector{ZZRingElem}) -function matrix_less_than(M::ZZMatrix, v::Vector{ZZRingElem}, w::Vector{ZZRingElem}) +Returns true if $Mv < Mw$ lexicographically, false otherwise. +""" +# matrix_lexicographic_less_than(M::ZZMatrix, v::Vector{ZZRingElem}, w::Vector{ZZRingElem}) = all(i -> dot(M[i, :], v) < dot(M[i, :], w), 1:size(M,1)) +function matrix_lexicographic_less_than(M::ZZMatrix, v::Vector{ZZRingElem}, w::Vector{ZZRingElem}) i = 1 while dot(M[i, :], v) == dot(M[i, :], w) && i != number_of_rows(M) i += 1 @@ -206,7 +208,7 @@ function facet_less_than(S::ZZMatrix, T::ZZMatrix, u::Vector{ZZRingElem}, v::Vec while dot(T[i,:], u)v == dot(T[i,:], v)u && i != number_of_rows(T) i += 1 end - return matrix_less_than(S, dot(T[i,:], u)v, dot(T[i,:], v)u) + return matrix_lexicographic_less_than(S, dot(T[i,:], u)v, dot(T[i,:], v)u) end #returns all elements of V smaller than w w.r.t the facet preorder From b3e414c5e9db296a1bbba9ed4eb95bddba94f521 Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Mon, 22 Apr 2024 01:33:11 +0200 Subject: [PATCH 065/179] Scale down difference_lead_tail vectors and get rid of the zero issue --- src/generic_walk.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/generic_walk.jl b/src/generic_walk.jl index bacc4a03878f..7de3fcd85294 100644 --- a/src/generic_walk.jl +++ b/src/generic_walk.jl @@ -73,9 +73,9 @@ function difference_lead_tail(MG::MarkedGroebnerBasis) (G,Lm) = gens(MG), markings(MG) lead_exp = leading_exponent_vector.(Lm) - v = zip(lead_exp, dropfirst.(exponent_vectors.(G))) .|> splat((l, t) -> Ref(l).-t) + v = zip(lead_exp, exponent_vectors.(G)) .|> splat((l, t) -> Ref(l).-t) - return [ZZ.(v) for v in unique!(reduce(vcat, v))] + return [ZZ.(v)./ZZ(gcd(v)) for v in unique!(reduce(vcat, v)) if !iszero(v)] end @doc raw""" From f80ac77b08435ad2090de44f03ab2bd7a8855d48 Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Mon, 22 Apr 2024 01:35:56 +0200 Subject: [PATCH 066/179] Add debug output --- src/generic_walk.jl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/generic_walk.jl b/src/generic_walk.jl index 7de3fcd85294..2b682d16b271 100644 --- a/src/generic_walk.jl +++ b/src/generic_walk.jl @@ -6,14 +6,18 @@ function generic_walk(G::Oscar.IdealGens, start::MonomialOrdering, target::Monom MG = MarkedGroebnerBasis(gens(G), Lm) v = next_gamma(MG, ZZ.([0]), start, target) + @v_do :groebner_walk steps = 0 while !isempty(v) MG = generic_step(MG, v, target) v = next_gamma(MG, v, start, target) - # TODO: increase step_counter here + @v_do :groebner_walk steps += 1 @vprintln :groebner_walk v @vprintln :groebner_walk 2 G end + + @vprint :groebner_walk "Cones crossed: " + @vprintln :groebner_walk steps return Oscar.IdealGens(MG.gens, target) #; isGB = true) end From d97564b9a8440631e8c6d8c7a0e7a9a1005f8bf0 Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Mon, 22 Apr 2024 01:41:51 +0200 Subject: [PATCH 067/179] Touch `convert_bounding_vector` --- src/standard_walk.jl | 7 ++++++- src/walk.jl | 9 +-------- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/standard_walk.jl b/src/standard_walk.jl index d8f95f221934..79019e1e5850 100644 --- a/src/standard_walk.jl +++ b/src/standard_walk.jl @@ -147,7 +147,12 @@ function next_weight(G::Oscar.IdealGens, current::Vector{ZZRingElem}, target::Ve @vprintln :groebner_walk 3 (QQ.(current) + tmin * QQ.(target-current)) - return convert_bounding_vector(QQ.(current) + tmin * QQ.(target-current)) + result = QQ.(current) + tmin * QQ.(target-current) + if !iszero(result) + return convert_bounding_vector(QQ.(current) + tmin * QQ.(target-current)) + else + return zeros(ZZRingElem, length(result)) + end end @doc raw""" diff --git a/src/walk.jl b/src/walk.jl index 9fd2b4856ef3..76d0935f505c 100644 --- a/src/walk.jl +++ b/src/walk.jl @@ -660,14 +660,7 @@ function liftGW2( end # converts a vector wtemp by dividing the entries with gcd(wtemp). -function convert_bounding_vector(w::Vector{T}) where {T<:Union{ZZRingElem, QQFieldElem}} - c = gcd(w) - if c != 0 - return ZZ.(floor.(w//c)) - else - w - end -end +convert_bounding_vector(w::Vector{T}) where {T<:Union{ZZRingElem, QQFieldElem}} = ZZ.(floor.(w//gcd(w))) # returns a copy of the PolynomialRing I, equipped with the ordering weight_ordering(cw)*matrix_ordering(T). create_ordering(R::MPolyRing, cw::Vector{L}, T::Matrix{Int}) where {L<:Number} = weight_ordering(cw, matrix_ordering(R, T)) From 2bd082726cc6a5e47f6bab19f1aba20282cb65d4 Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Mon, 22 Apr 2024 02:00:53 +0200 Subject: [PATCH 068/179] Expect vector of polynomials in final step of `groebner_walk` --- src/walk.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/walk.jl b/src/walk.jl index 76d0935f505c..cd1e08d9df54 100644 --- a/src/walk.jl +++ b/src/walk.jl @@ -105,7 +105,7 @@ function groebner_walk( Gb = groebner_basis(I; ordering=start, complete_reduction=true) Gb = walk(Gb) - return Oscar.IdealGens(gens(Gb), target; isGB=true) + return Oscar.IdealGens(Gb, target; isGB=true) end ########################################### From ae6597c74044040f1079fb25a2486ae57cea732d Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Mon, 22 Apr 2024 02:01:15 +0200 Subject: [PATCH 069/179] =?UTF-8?q?Return=20only=20the=20gens,=20not=20an?= =?UTF-8?q?=20entire=20Gr=C3=B6bner=20basis?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/generic_walk.jl | 58 ++++++++++++++++----------------------------- 1 file changed, 20 insertions(+), 38 deletions(-) diff --git a/src/generic_walk.jl b/src/generic_walk.jl index 2b682d16b271..675b794accc3 100644 --- a/src/generic_walk.jl +++ b/src/generic_walk.jl @@ -18,7 +18,7 @@ function generic_walk(G::Oscar.IdealGens, start::MonomialOrdering, target::Monom @vprint :groebner_walk "Cones crossed: " @vprintln :groebner_walk steps - return Oscar.IdealGens(MG.gens, target) #; isGB = true) + return gens(MG) end @doc raw""" @@ -95,7 +95,7 @@ function next_gamma( ) V = filter_by_ordering(start, target, difference_lead_tail(MG)) if w != ZZ.([0]) - V = new_filter_lf(w, start, target, V) + V = filter_lf(w, start, target, V) end if isempty(V) return V @@ -125,7 +125,7 @@ function facet_initials(MG::MarkedGroebnerBasis, v::Vector{ZZRingElem}) push_term!(ctx, c, a) for (d, b) in coefficients_and_exponents(g) - if new_is_parallel(ZZ.(a - b), v) + if is_parallel(ZZ.(a - b), v) push_term!(ctx, d, b) end end @@ -222,45 +222,27 @@ end Returns all elements of `V` smaller than `w` with respect to the facet preorder. """ -function new_filter_lf(w::Vector{ZZRingElem}, start::MonomialOrdering, target::MonomialOrdering, V::Vector{Vector{ZZRingElem}}) - btz = Vector{Vector{ZZRingElem}}() - for v in V - if facet_less_than(canonical_matrix(start),canonical_matrix(target),w,v) && !(v in btz) - push!(btz, v) - end - end - return btz +function filter_lf(w::Vector{ZZRingElem}, start::MonomialOrdering, target::MonomialOrdering, V::Vector{Vector{ZZRingElem}}) + skip_indices = facet_less_than.( + Ref(canonical_matrix(start)), + Ref(canonical_matrix(target)), + Ref(w), + V + ) + + return unique!(V[skip_indices]) end #returns true if u is a non-zero integer multiple of v -function new_is_parallel(u::Vector{ZZRingElem}, v::Vector{ZZRingElem}) - count = 1 - x = 0 - for i = 1:length(u) - if u[i] == 0 - if v[count] == 0 - count += +1 - else - return false - end - else - x = v[count] // u[i] - count += 1 - break - end - end - if count > length(v) - return true - end - for i = count:length(v) - @inbounds if v[i] != x * u[i] - return false - end - end - return true - - end +@doc raw""" + is_parallel(u::Vector{ZZRingElem}, v::Vector{ZZRingElem}) + +Determines whether $u$ and $v$ are non-zero integer multiples of each other. +""" +function is_parallel(u::Vector{ZZRingElem}, v::Vector{ZZRingElem}) + return !iszero(v) && !iszero(u) && u./gcd(u) == v./gcd(v) +end #TODO: add tests \ No newline at end of file From eed5734b725c33400133475b02e3aa33d01ab49d Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Mon, 22 Apr 2024 02:07:58 +0200 Subject: [PATCH 070/179] Rename `interreduce_walk` to `autoreduce` --- src/fractal_walk.jl | 2 +- src/standard_walk.jl | 2 +- src/walk.jl | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/fractal_walk.jl b/src/fractal_walk.jl index 205ec2595023..c5e345fea687 100644 --- a/src/fractal_walk.jl +++ b/src/fractal_walk.jl @@ -100,7 +100,7 @@ function fractal_recursion_step( end #H = liftGW2(G, R, Gw, H, Rn) H = lift_fractal_walk(G, H, ordNew) - G = interreduce_walk(H) + G = autoreduce(H) ordAlt = ordNew current_weight = w end diff --git a/src/standard_walk.jl b/src/standard_walk.jl index 79019e1e5850..5d9ab683d405 100644 --- a/src/standard_walk.jl +++ b/src/standard_walk.jl @@ -88,7 +88,7 @@ function standard_step(G::Oscar.IdealGens, w::Vector{ZZRingElem}, target::Monomi @vprintln :groebner_walk 3 Gw @vprintln :groebner_walk 3 H - return interreduce_walk(H) + return autoreduce(H) end standard_step(G::Oscar.IdealGens, w::Vector{Int}, T::Matrix{Int}) = standard_step(G, ZZ.(w), create_ordering(base_ring(G), w, T)) diff --git a/src/walk.jl b/src/walk.jl index cd1e08d9df54..409f073df4f2 100644 --- a/src/walk.jl +++ b/src/walk.jl @@ -278,7 +278,7 @@ function fractal_walk_combined( end #H = liftGW2(G, ordAlt, Gw,H, ordNew) H = lift_fractal_walk(G, H, ordNew) - G = interreduce_walk(H) + G = autoreduce(H) ordAlt = ordNew currweight = w end @@ -402,7 +402,7 @@ function fractal_walk_recursive_startorder( end #H = liftGW2(G, R, Gw, H, Rn) H = lift_fractal_walk(G, H, ordNew) - G = interreduce_walk(H) + G = autoreduce(H) ordAlt = ordNew currweight = w end @@ -471,7 +471,7 @@ function standard_step_without_int32_check( ) #H = liftGW2(G, R, Gw, H, Rn) H = lift(G, ordAlt, H, ordNew) - return interreduce_walk(H) + return autoreduce(H) end ################################################################# @@ -669,7 +669,7 @@ create_ordering(R::MPolyRing, cw::Vector{L}, T::Matrix{Int}) where {L<:Number} = # each element of G is replaced by its normal form w.r.t the other elements of G and the current monomial order # TODO reference, docstring # interreduces the Groebner basis G. -function interreduce_walk(G::Oscar.IdealGens) +function autoreduce(G::Oscar.IdealGens) generators = collect(gens(G)) I = 0 From c7353d811d28f177f2f1d387b30b63079aa3d06a Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Mon, 22 Apr 2024 02:18:36 +0200 Subject: [PATCH 071/179] Return `gens(G)` --- src/standard_walk.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/standard_walk.jl b/src/standard_walk.jl index 5d9ab683d405..4914f528d198 100644 --- a/src/standard_walk.jl +++ b/src/standard_walk.jl @@ -59,7 +59,7 @@ function standard_walk( @vprint :groebner_walk "Cones crossed: " @vprintln :groebner_walk steps - return G + return gens(G) end ############################################################### From 628921c339726be8c6023e77b67348242fae2f9a Mon Sep 17 00:00:00 2001 From: Ortfs Date: Mon, 22 Apr 2024 14:57:37 +0200 Subject: [PATCH 072/179] Add examples --- examples/cyclic5.jl | 35 ++++++++++++++++++++ examples/cyclic7.jl | 37 +++++++++++++++++++++ examples/finitefield.jl | 20 ++++++++++++ examples/implicitization/agk4.jl | 23 +++++++++++++ examples/implicitization/newellp1.jl | 22 +++++++++++++ examples/implicitization/tran3.3.jl | 21 ++++++++++++ examples/knapsack/fukuda_cuww1.jl | 28 ++++++++++++++++ examples/knapsack/fukuda_prob6.jl | 49 ++++++++++++++++++++++++++++ examples/knapsack/goodknap.jl | 35 ++++++++++++++++++++ examples/knapsack/knap.jl | 33 +++++++++++++++++++ examples/knapsack/smallknap.jl | 33 +++++++++++++++++++ examples/ku10.jl | 33 +++++++++++++++++++ examples/randomQQ.jl | 31 ++++++++++++++++++ 13 files changed, 400 insertions(+) create mode 100644 examples/cyclic5.jl create mode 100644 examples/cyclic7.jl create mode 100644 examples/finitefield.jl create mode 100644 examples/implicitization/agk4.jl create mode 100644 examples/implicitization/newellp1.jl create mode 100644 examples/implicitization/tran3.3.jl create mode 100644 examples/knapsack/fukuda_cuww1.jl create mode 100644 examples/knapsack/fukuda_prob6.jl create mode 100644 examples/knapsack/goodknap.jl create mode 100644 examples/knapsack/knap.jl create mode 100644 examples/knapsack/smallknap.jl create mode 100644 examples/ku10.jl create mode 100644 examples/randomQQ.jl diff --git a/examples/cyclic5.jl b/examples/cyclic5.jl new file mode 100644 index 000000000000..297068e77a6c --- /dev/null +++ b/examples/cyclic5.jl @@ -0,0 +1,35 @@ +using Oscar +using GroebnerWalk + +R, (a, b, c, d, x) = polynomial_ring(QQ, ["a", "b", "c", "d", "x"]) + +I = ideal([ a + b + c + d + x, +a*b + b*c + c*d + d*x + x*a, +a*b*c + b*c*d + c*d*x + d*x*a + x*a*b, +a*b*c*d + b*c*d*x + c*d*x*a + d*x*a*b + x*a*b*c, +a*b*c*d*x - 1] ) + +#G = groebner_basis(I, ordering = lex(R), complete_reduction = true) +o_s = degrevlex(R) +o_t = lex(R) +G1 = groebner_basis(I, ordering = degrevlex(R), complete_reduction = true) + + +set_verbosity_level(:groebner_walk, 1) + +t_b = @elapsed Gb = groebner_basis(I, ordering = lex(R), complete_reduction = true) + +t_s = @elapsed Gs = groebner_walk(I, lex(R), algorithm =:standard) + +t_g = @elapsed Gg = groebner_walk(I, lex(R), algorithm =:generic) + +t_p = @elapsed Gp = groebner_walk(I, lex(R), algorithm =:perturbed) + +t_f = @elapsed Gf = groebner_basis(I, ordering = lex(R), algorithm =:fglm) +#= What do we learn from this example? + +Gg1. standardwalk is fastest, but it doesn't give us a REDUCED Gröbner basis +2. the output of genericwalk and buchberger (with complete_reduction) is the same UP TO SCALING +3. The elements of the genericwalkbasis have rational coefficients (due to divides()...), whereas Buchberger's output doesnt + +=# \ No newline at end of file diff --git a/examples/cyclic7.jl b/examples/cyclic7.jl new file mode 100644 index 000000000000..5f1c16e96498 --- /dev/null +++ b/examples/cyclic7.jl @@ -0,0 +1,37 @@ +#cyclic7 + +using Oscar + +using GroebnerWalk +R, (z0, z1, z2, z3, z4, z5, z6) = polynomial_ring(QQ, ["z$index" for index in 0:6 ]) + +I = ideal([z0 + z1 + z2 + z3 + z4 + z5 + z6, + + z0*z1 + z1*z2 + z2*z3 + z3*z4 + z4*z5 + z5*z6 + z6*z0, + + z0*z1*z2 + z1*z2*z3 + z2*z3*z4 + z3*z4*z5 + z4*z5*z6 + z5*z6*z0 + z6*z0*z1, + + z0*z1*z2*z3 + z1*z2*z3*z4 + z2*z3*z4*z5 + z3*z4*z5*z6 + z4*z5*z6*z0 ++ z5*z6*z0*z1 + z6*z0*z1*z2, + + z0*z1*z2*z3*z4 + z1*z2*z3*z4*z5 + z2*z3*z4*z5*z6 + z3*z4*z5*z6*z0 ++ z4*z5*z6*z0*z1 + z5*z6*z0*z1*z2 + z6*z0*z1*z2*z3, + + z0*z1*z2*z3*z4*z5 + z1*z2*z3*z4*z5*z6 + z2*z3*z4*z5*z6*z0 + z3*z4*z5*z6*z0*z1 ++ z4*z5*z6*z0*z1*z2 + z5*z6*z0*z1*z2*z3 + z6*z0*z1*z2*z3*z4, + + z0*z1*z2*z3*z4*z5*z6 - 1]) + + Ginit = groebner_basis(I) + + set_verbosity_level(:groebner_walk, 1) + +t_b = @elapsed Gb = groebner_basis(I, ordering = lex(R), complete_reduction = true) + +t_s = @elapsed Gs = groebner_walk(I, lex(R), algorithm =:standard) + +t_g = @elapsed Gg = groebner_walk(I, lex(R), algorithm =:generic) + +t_p = @elapsed Gp = groebner_walk(I, lex(R), algorithm =:perturbed) + +t_f = @elapsed Gf = groebner_basis(I, ordering = lex(R), algorithm =:fglm) \ No newline at end of file diff --git a/examples/finitefield.jl b/examples/finitefield.jl new file mode 100644 index 000000000000..c21e94d1bf65 --- /dev/null +++ b/examples/finitefield.jl @@ -0,0 +1,20 @@ +#finite field example, from groebner.jl docstring line 1232 + +using Oscar +using GroebnerWalk +R, (x1, x2, x3, x4) = polynomial_ring(GF(32003), ["x1", "x2", "x3", "x4"]) + + +J = ideal(R, [x1+2*x2+2*x3+2*x4-1, + x1^2+2*x2^2+2*x3^2+2*x4^2-x1, + 2*x1*x2+2*x2*x3+2*x3*x4-x2, + x2^2+2*x1*x3+2*x2*x4-x3 + ]) +t_init = @elapsed G = groebner_basis(J, ordering = degrevlex(R), complete_reduction = true) +t_b = @elapsed Gb = groebner_basis(J, ordering = lex(R), complete_reduction = true) #0.4s + +t_s = @elapsed Gs = groebner_walk(J, lex(R), algorithm =:standard) #4.11 + +t_g = @elapsed Gg = groebner_walk(J, lex(R), algorithm =:generic) #0.8s + +t_p = @elapsed Gp = groebner_walk(J, lex(R), algorithm =:perturbed) #0.33s diff --git a/examples/implicitization/agk4.jl b/examples/implicitization/agk4.jl new file mode 100644 index 000000000000..dbeda96de2f7 --- /dev/null +++ b/examples/implicitization/agk4.jl @@ -0,0 +1,23 @@ +#implicitization of Bezier surface + + +using Oscar +using GroebnerWalk +using BenchmarkTools + +R, (x,y,z,u,v) = polynomial_ring(QQ, ["x","y","z","u","v"]) + +o1 = matrix_ordering(R, [1 1 1 0 0; 0 0 0 1 1; 0 0 0 1 0; 1 1 0 0 0; 1 0 0 0 0]) +o2 = matrix_ordering(R, [0 0 0 1 1; 1 1 1 0 0; 1 1 0 0 0; 1 0 0 0 0; 0 0 0 1 0]) + +I = ideal([ + u + u^2 - 2*v - 2*u^2*v + 2*u*v^2 - x, + -6*u + 2*v + v^2 - 5*v^3 + 2*u*v^2 - 4*u^2*v^2 - y, + -2 + 2*u^2 + 6*v - 3*u^2*v^2 - z +]) +set_verbosity_level(:groebner_walk, 1) + +G = groebner_basis(I, ordering = o2 ) +t_standard = @elapsed G = groebner_walk(I, o1, o2; algorithm=:standard) +# t_generic = @elapsed G = groebner_walk(I, o2, o1; algorithm=:generic) +# t_perturbed = @elapsed G = groebner_walk(I, o2, o1; algorithm=:perturbed) \ No newline at end of file diff --git a/examples/implicitization/newellp1.jl b/examples/implicitization/newellp1.jl new file mode 100644 index 000000000000..ba9e65b8c2ab --- /dev/null +++ b/examples/implicitization/newellp1.jl @@ -0,0 +1,22 @@ +#Newell's teapot, patch 1 +#a 2 dimensional ideal from tran 2004 +using Oscar + +using GroebnerWalk + +R, (x,y,z,u,v) = polynomial_ring(QQ, ["x","y","z","u","v"]) + +I = ideal([ + -x + 7//5 - 231//125 * v^2 + 39//80 * u^2 - 1//5 * u^3 + 99//400 * u * v^2 - 1287//2000 * u^2 * v^2 + 33//125 * u^3 * v^2 - 3//16 * u + 56//125 * v^3 - 3//50 * u * v^3 + 39//250 * u^2 * v^3 - 8//125 * u^3 * v^3, + -y + 63//125 * v^2 - 294//125 * v + 56//125 * v^3 - 819//1000 * u^2 * v + 42//125 * u^3 * v - 3//50 * u * v^3 + 351//2000 * u^2 * v^2 + 39//250 * u^2 * v^3 - 9//125 * u^3 * v^2 - 8//125 * u^3 * v^3, + -z + 12//5 - 63//160 * u^2 + 63//160 * u +]) +Ginit = groebner_basis(I) +#"optimal" choice of orderings, as stated in Tran 2004 +o1 = matrix_ordering(R, [1 1 1 0 0; 0 0 0 1 1; 0 0 0 1 0; 1 1 0 0 0; 1 0 0 0 0]) +o2 = matrix_ordering(R, [0 0 0 1 1; 1 1 1 0 0; 1 1 0 0 0; 1 0 0 0 0; 0 0 0 1 0]) +set_verbosity_level(:groebner_walk, 1) +t_s = @elapsed Gs = groebner_walk(I, o2, o1; algorithm=:standard) #144s +t_g = @elapsed Gg = groebner_walk(I, o2, o1; algorithm=:generic) #hangs (30+ minutes) after ~20 iterations. +t_p = @elapsed Gp = groebner_walk(I, o2, o1; algorithm=:perturbed) +t_b = @elapsed Gb = groebner_basis(I, ordering = o2) #20000s diff --git a/examples/implicitization/tran3.3.jl b/examples/implicitization/tran3.3.jl new file mode 100644 index 000000000000..63139823db62 --- /dev/null +++ b/examples/implicitization/tran3.3.jl @@ -0,0 +1,21 @@ +#Example 3.3 from Tran +# This is an example 3.3 from "A fast algorithm for Gröbner basis conversion and its applications" ( Tran 2000) +# 1-dimensional ideal (application not given) +using Oscar +using GroebnerWalk +R, (x,y,z) = polynomial_ring(QQ, ["x","y","z"]) + +I = ideal([16 + 3*x^3+16*x^2*z+14*x^2*y^3, 6+y^3*z+17*x^2*z^2+7*x*y^2*z^2+13*x^3*z^2]) + + +Gdegrevlex = groebner_basis(I, complete_reduction = true) + +set_verbosity_level(:groebner_walk, 1) + +t_b = @elapsed Gb = groebner_basis(I, ordering = lex(R), complete_reduction = true) #doesn't terminate after 90mins + +t_s = @elapsed Gs = groebner_walk(I, lex(R), algorithm =:standard) #~10s faster than m2! (but remember; no reduction! )) + +t_g = @elapsed Gg = groebner_walk(I, lex(R), algorithm =:generic) #87s. why so long? we have many conversions, maybe inflating weight vectors? + +t_p = @elapsed Gp = groebner_walk(I, lex(R), algorithm =:perturbed) #54s, long final conversion. Also, I don't understand the output diff --git a/examples/knapsack/fukuda_cuww1.jl b/examples/knapsack/fukuda_cuww1.jl new file mode 100644 index 000000000000..fa064d0b7545 --- /dev/null +++ b/examples/knapsack/fukuda_cuww1.jl @@ -0,0 +1,28 @@ +#hard integer knapsack problem + +using Oscar +using GroebnerWalk +R, (t, x1, x2, x3, x4, x5) = polynomial_ring(QQ, ["t","x1", "x2", "x3", "x4", "x5"]) + +f = 12223*x1 + 12224*x2 +36674*x3+61119*x4+85569*x5 -89643481 + +f1 = x1 - t^1223 +f2 = x2 - t^1224 +f3 = x3 - t^36674 +f4 = x4 - t^61119 +f5 = x5 - t^85569 +I = ideal([f1, f2, f3, f4, f5]) + +set_verbosity_level(:groebner_walk, 1) + +o_t = weight_ordering([1,0,0,0,0,0], degrevlex(R)) +o_s = weight_ordering([0,1,1,1,1,1], degrevlex(R)) +Ginit = groebner_basis(I, ordering = o_s, complete_reduction = true) +tg = @elapsed Gg = groebner_walk(I, o_t, o_s, algorithm =:generic) #??takes more than 9 hours! + +ts = @elapsed Gs = groebner_walk(I, o_t, o_s, algorithm =:standard) #hangs at vectors of the form [a, b, b, b, b, b] + +tp = @elapsed Gp = groebner_walk(I, o_t, o_s, algorithm =:perturbed) +tb = @elapsed Gb = groebner_basis(I; ordering=o_t, complete_reduction = true) + +tf = @elapsed Gf = groebner_basis(I, ordering = o_t, complete_reduction = true, algorithm =:fglm) #error: dimension of ideal must be zero! \ No newline at end of file diff --git a/examples/knapsack/fukuda_prob6.jl b/examples/knapsack/fukuda_prob6.jl new file mode 100644 index 000000000000..ab9519e49930 --- /dev/null +++ b/examples/knapsack/fukuda_prob6.jl @@ -0,0 +1,49 @@ +using Oscar +using GroebnerWalk +R, (t, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10) = polynomial_ring(QQ, ["t","x1","x2", "x3", "x4", "x5", "x6", "x7", "x8", "x9", "x10" ]) + +f = 12223*x1 + 12224*x2 +36674*x3+61119*x4+85569*x5 -89643481 + +f1 = x1 - t^20601 +f2 = x2 - t^40429 +f3 = x3 - t^42207 +f4 = x4 - t^45415 +f5 = x5 - t^53725 +f6 = x6 - t^61919 +f7 = x7 - t^64670 +f8 = x8 - t^69340 +f9 = x9 - t^78539 +f10 = x10 - t^95043 +I = ideal([f1, f2, f3, f4, f5, f6, f7, f8, f9, f10]) + +set_verbosity_level(:groebner_walk, 1) +o_t = matrix_ordering(R, [ +1 0 0 0 0 0 0 0 0 0 0; +0 1 1 1 1 1 1 1 1 1 1; +0 1 1 1 1 1 1 1 1 1 0; +0 1 1 1 1 1 1 1 1 0 0; +0 1 1 1 1 1 1 1 0 0 0; +0 1 1 1 1 1 1 0 0 0 0; +0 1 1 1 1 1 0 0 0 0 0; +0 1 1 1 1 0 0 0 0 0 0; +0 1 1 1 0 0 0 0 0 0 0; +0 1 1 0 0 0 0 0 0 0 0; +0 1 0 0 0 0 0 0 0 0 0]) +o_s = matrix_ordering(R, [ +0 1 1 1 1 1 1 1 1 1 1; +1 0 0 0 0 0 0 0 0 0 0; +1 1 0 0 0 0 0 0 0 0 0; +1 1 1 0 0 0 0 0 0 0 0; +1 1 1 1 0 0 0 0 0 0 0; +1 1 1 1 1 0 0 0 0 0 0; +1 1 1 1 1 1 0 0 0 0 0; +1 1 1 1 1 1 1 0 0 0 0; +1 1 1 1 1 1 1 1 0 0 0; +1 1 1 1 1 1 1 1 1 0 0; +1 1 1 1 1 1 1 1 1 1 0]) + +Ginit = groebner_basis(I, ordering = o_s) + +tg = @elapsed Gg = groebner_walk(I, o_t, o_s, algorithm =:generic) #>1hr +ts = @elapsed Gs = groebner_walk(I, o_t, o_s, algorithm =:standard) +tb = @elapsed Gb = groebner_basis(I, ordering = o_t, complete_reduction = true) #139s \ No newline at end of file diff --git a/examples/knapsack/goodknap.jl b/examples/knapsack/goodknap.jl new file mode 100644 index 000000000000..5d815921748e --- /dev/null +++ b/examples/knapsack/goodknap.jl @@ -0,0 +1,35 @@ +# "custom" integer knapsack problem + +using Oscar +using GroebnerWalk +R, (t, x1, x2, x3, x4, x5) = polynomial_ring(QQ, ["t","x1", "x2", "x3", "x4", "x5"]) + + + + + + +f1 = x1 - t^329221 +f2 = x2 - t^214884 +f3 = x3 - t^210568 +f4 = x4 - t^324307 +f5 = x5 - t^320945 + + +I = ideal([f1, f2, f3, f4,f5]) + +set_verbosity_level(:groebner_walk, 1) + +o_t = weight_ordering([1,0,0,0,0,0], degrevlex(R)) +o_s = weight_ordering([0,1,1,1,1,1], degrevlex(R)) +Ginit = groebner_basis(I, ordering = o_s, complete_reduction = true) +tg = @elapsed Gg = groebner_walk(I, o_t, o_s, algorithm =:generic) #60-70s + +ts = @elapsed Gs = groebner_walk(I, o_t, o_s, algorithm =:standard) + +tp = @elapsed Gp = groebner_walk(I, o_t, o_s, algorithm =:perturbed) +tb = @elapsed Gb = groebner_basis(I, ordering = o_t, complete_reduction = true) #140-160s + +tf = @elapsed Gf = groebner_basis(I, ordering = o_t, complete_reduction = true, algorithm =:fglm) #error: dimension of ideal must be zero! + +th = @elapsed Gh = groebner_basis(I, ordering = o_t, complete_reduction = true, algorithm =:hilbert) #throws another error \ No newline at end of file diff --git a/examples/knapsack/knap.jl b/examples/knapsack/knap.jl new file mode 100644 index 000000000000..3374e920f04b --- /dev/null +++ b/examples/knapsack/knap.jl @@ -0,0 +1,33 @@ +using Oscar +using GroebnerWalk +R, (t, x1, x2, x3, x4, x5, x6) = polynomial_ring(QQ, ["t","x1", "x2", "x3", "x4", "x5", "x6"]) + + + + + + +f1 = x1 - t^53725 +f2 = x2 - t^61919 +f3 = x3 - t^64670 +f4 = x4 - t^69340 +f5 = x5 - t^78539 +f6 = x6 - t^95043 + +I = ideal([f1, f2, f3, f4, f5, f6]) + +set_verbosity_level(:groebner_walk, 1) + +o_t = weight_ordering([1,0,0,0,0,0,0], degrevlex(R)) +o_s = weight_ordering([0,1,1,1,1,1,1], degrevlex(R)) +Ginit = groebner_basis(I, ordering = o_s, complete_reduction = true) +tg = @elapsed Gg = groebner_walk(I, o_t, o_s, algorithm =:generic) #300s + +ts = @elapsed Gs = groebner_walk(I, o_t, o_s, algorithm =:standard) #throws an error...oops + +tp = @elapsed Gp = groebner_walk(I, o_t, o_s, algorithm =:perturbed) #also throws an error +tb = @elapsed Gb = groebner_basis(I, ordering = o_t, complete_reduction = true) + +tf = @elapsed Gf = groebner_basis(I, ordering = o_t, complete_reduction = true, algorithm =:fglm) #error: dimension of ideal must be zero! + +th = @elapsed Gh = groebner_basis(I, ordering = o_t, complete_reduction = true, algorithm =:hilbert) \ No newline at end of file diff --git a/examples/knapsack/smallknap.jl b/examples/knapsack/smallknap.jl new file mode 100644 index 000000000000..8cd4eddb384b --- /dev/null +++ b/examples/knapsack/smallknap.jl @@ -0,0 +1,33 @@ +#smallknap + +using Oscar +using GroebnerWalk +R, (t, x1, x2, x3) = polynomial_ring(QQ, ["t","x1", "x2", "x3"]) + + + + + + +f1 = x1 - t^5 +f2 = x2 - t^12 +f3 = x3 - t^20 + + +I = ideal([f1, f2, f3]) + +set_verbosity_level(:groebner_walk, 1) + +o_t = weight_ordering([1,0,0,0], degrevlex(R)) +o_s = weight_ordering([0,1,1,1], degrevlex(R)) +Ginit = groebner_basis(I, ordering = o_s, complete_reduction = true) +tg = @elapsed Gg = groebner_walk(I, o_t, o_s, algorithm =:generic) #300s + +ts = @elapsed Gs = groebner_walk(I, o_t, o_s, algorithm =:standard) #throws an error...oops + +tp = @elapsed Gp = groebner_walk(I, o_t, o_s, algorithm =:perturbed) #also throws an error +tb = @elapsed Gb = groebner_basis(I, ordering = o_t, complete_reduction = true) + +tf = @elapsed Gf = groebner_basis(I, ordering = o_t, complete_reduction = true, algorithm =:fglm) #error: dimension of ideal must be zero! + +th = @elapsed Gh = groebner_basis(I, ordering = o_t, complete_reduction = true, algorithm =:hilbert) \ No newline at end of file diff --git a/examples/ku10.jl b/examples/ku10.jl new file mode 100644 index 000000000000..c56e3f5b2db4 --- /dev/null +++ b/examples/ku10.jl @@ -0,0 +1,33 @@ +#ku +using Oscar + +using GroebnerWalk + +R, (x1, x2, x3, x4, x5, x6, x7, x8, x9, x10) = polynomial_ring(QQ, ["x$index" for index in 1:10]) + + +I = ideal([5*x1*x2+ 5*x1+ 3*x2+ 55, +7*x2*x3+ 9*x2+ 9*x3+ 19, +3*x3*x4+ 6*x3+ 5*x4-4, +6*x4*x5+ 6*x4+ 7*x5+ 118, +x5*x6+ 3*x5+ 9*x6+ 27, +6*x6*x7+ 7*x6+x7+ 72, +9*x7*x8+ 7*x7+x8+ 35, +4*x8*x9+ 4*x8+ 6*x9+ 16, +8*x9*x10+ 4*x9+ 3*x10-51, +3*x1*x10-6*x1+x10+ 5]) + + +Ginit = groebner_basis(I) + +set_verbosity_level(:groebner_walk, 1) + +t_b = @elapsed Gb = groebner_basis(I, ordering = lex(R), complete_reduction = true) + +t_s = @elapsed Gs = groebner_walk(I, lex(R), algorithm =:standard) + +t_g = @elapsed Gg = groebner_walk(I, lex(R), algorithm =:generic) + +t_p = @elapsed Gp = groebner_walk(I, lex(R), algorithm =:perturbed) + +t_f = @elapsed Gf = groebner_basis(I, ordering = lex(R), algorithm =:fglm) \ No newline at end of file diff --git a/examples/randomQQ.jl b/examples/randomQQ.jl new file mode 100644 index 000000000000..479551a144d6 --- /dev/null +++ b/examples/randomQQ.jl @@ -0,0 +1,31 @@ +#random polynomial system in 4 variables over Q, computed in M2 +using Oscar +using GroebnerWalk +R, (a, b, c, d) = polynomial_ring(QQ, ["a", "b", "c", "d"]) + + +f1 = 15013d^3 + 5213*c*d^2 + 15893*c^2*d - 2837*b*d^2 - 10238*c^3 + 13538*b*c*d - 4578*a*d^2 + 5035*b*c^2 + +-9975*b^2*d - 9777*a*c*d - 2177*b^2*c + 9963*a*c^2 - 15569*a*b*d + 2513*b^3 - 3108*a*b*c - 9437*a^2*d - 5291*a*b^2 - +13120*a^2*c + 714*a^2*b + 13507*a^3 + +f2 = 2733*d^3 + 4541*c*d^2 + 4333*c^2*d - 6525*b*d^2 + 633*c^3 + 5406*b*c*d + 1762*a*d^2 + 11272*b*c^2 + 14879*b^2*d - +12968*a*c*d + 12580*b^2*c + 15050*a*c^2 + 15360*a*b*d - 2276*b^3 + 4773*a*b*c - 10499*a^2*d - 15025*a*b^2 - +9910*a^2*c - 3196*a^2*b + 1874*a^3 + +f3 = 11293*d^3 + 6929*c*d^2 - 13730*c^2*d - 7748*b*d^2 + 7572*c^3 - 9254*b*c*d + 15477*a*d^2 + 8782*b*c^2 + 7914*b^2*d + +5188*a*c*d + 15934*b^2*c - 10006*a*c^2 + 8830*a*b*d + 11842*b^3 + 7559*a*b*c + 11735*a^2*d - 7116*a*b^2 + +8771*a^2*c + 9251*a^2*b + 2099*a^3 + +I = ideal([f1, f2, f3]) + + +Gdegrevlex = groebner_basis(I, complete_reduction = true) +set_verbosity_level(:groebner_walk, 1) + +t_b = @elapsed Gb = groebner_basis(I, ordering = lex(R), complete_reduction = true) #8.6s + +t_s = @elapsed Gs = groebner_walk(I, lex(R), algorithm =:standard) #11.3, one conversion + +t_g = @elapsed Gg = groebner_walk(I, lex(R), algorithm =:generic) #14.4 + +t_p = @elapsed Gp = groebner_walk(I, lex(R), algorithm =:perturbed) #11.49 \ No newline at end of file From 00feffe2db8c490d1f4b8024ebb2c56d871e372c Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Mon, 22 Apr 2024 22:21:28 +0200 Subject: [PATCH 073/179] Push intermediate benchmarking results --- examples/benchmark/benchmarks.jl | 76 ++++++++++++-------------------- results.csv | 12 +++++ 2 files changed, 40 insertions(+), 48 deletions(-) diff --git a/examples/benchmark/benchmarks.jl b/examples/benchmark/benchmarks.jl index d648b652eddf..5ddfa9e94ea5 100644 --- a/examples/benchmark/benchmarks.jl +++ b/examples/benchmark/benchmarks.jl @@ -2,6 +2,11 @@ using Oscar using GroebnerWalk using BenchmarkTools +include("cyclic.jl") +include("katsura.jl") +include("tran3.3.jl") +include("newellp1.jl") + function benchmark( io, name::String, @@ -9,64 +14,39 @@ function benchmark( target::MonomialOrdering, start::MonomialOrdering ) - print(io, name, ",") - t = @belapsed groebner_walk($I, $target, $start; algorithm=:standard) - print(io, t, ",") - t = @belapsed groebner_walk($I, $target, $start; algorithm=:generic) - print(io, t, ",") - t = @belapsed groebner_basis($I; ordering=$target) - println(io, t) + print(io, name, ","); flush(io) + t = @belapsed groebner_walk($I, $target, $start; algorithm=:standard) seconds=20000 samples=5 + print(io, t, ","); flush(io) + t = @belapsed groebner_walk($I, $target, $start; algorithm=:generic) seconds=20000 samples=5 + print(io, t, ","); flush(io) + t = @belapsed groebner_basis($I; ordering=$target) seconds=20000 samples=5 + println(io, t); flush(io) end p = 11863279 -k = GF(p) +Fp = GF(p) open("results.csv", "a") do io R, (x, y) = QQ[:x, :y] I = ideal([y^4 + x^3 - x^2 + x, x^4]) benchmark(io, "simple", I, lex(R), default_ordering(R)) + + benchmark(io, "cyclic5-QQ", cyclic5(QQ)...) + benchmark(io, "cyclic5-Fp", cyclic5(Fp)...) - R, (z0, z1, z2, z3, z4, z5, z6) = QQ[:z0, :z1, :z2, :z3, :z4, :z5, :z6] - F = [ - z0 + z1 + z2 + z3 + z4 + z5 + z6, - z0 * z1 + z1 * z2 + z2 * z3 + z3 * z4 + z4 * z5 + z5 * z6 + z6 * z0, - z0 * z1 * z2 + z1 * z2 * z3 + z2 * z3 * z4 + z3 * z4 * z5 + z4 * z5 * z6 + z5 * z6 * z0 + z6 * z0 * z1, - z0 * z1 * z2 * z3 + z1 * z2 * z3 * z4 + z2 * z3 * z4 * z5 + z3 * z4 * z5 * z6 + z4 * z5 * z6 * z0 - + z5 * z6 * z0 * z1 + z6 * z0 * z1 * z2, - z0 * z1 * z2 * z3 * z4 + z1 * z2 * z3 * z4 * z5 + z2 * z3 * z4 * z5 * z6 + z3 * z4 * z5 * z6 * z0 - + z4 * z5 * z6 * z0 * z1 + z5 * z6 * z0 * z1 * z2 + z6 * z0 * z1 * z2 * z3, - z0 * z1 * z2 * z3 * z4 * z5 + z1 * z2 * z3 * z4 * z5 * z6 + z2 * z3 * z4 * z5 * z6 * z0 + z3 * z4 * z5 * z6 * z0 * z1 - + z4 * z5 * z6 * z0 * z1 * z2 + z5 * z6 * z0 * z1 * z2 * z3 + z6 * z0 * z1 * z2 * z3 * z4, - z0 * z1 * z2 * z3 * z4 * z5 * z6 - 1 - ] - benchmark(io, "cyclic7-QQ", ideal(R, F), lex(R), default_ordering(R)) + benchmark(io, "cyclic6-QQ", cyclic6(QQ)...) + benchmark(io, "cyclic6-Fp", cyclic6(Fp)...) - R, (z0, z1, z2, z3, z4, z5, z6) = k[:z0, :z1, :z2, :z3, :z4, :z5, :z6] - F = [ - z0 + z1 + z2 + z3 + z4 + z5 + z6, - z0 * z1 + z1 * z2 + z2 * z3 + z3 * z4 + z4 * z5 + z5 * z6 + z6 * z0, - z0 * z1 * z2 + z1 * z2 * z3 + z2 * z3 * z4 + z3 * z4 * z5 + z4 * z5 * z6 + z5 * z6 * z0 + z6 * z0 * z1, - z0 * z1 * z2 * z3 + z1 * z2 * z3 * z4 + z2 * z3 * z4 * z5 + z3 * z4 * z5 * z6 + z4 * z5 * z6 * z0 - + z5 * z6 * z0 * z1 + z6 * z0 * z1 * z2, - z0 * z1 * z2 * z3 * z4 + z1 * z2 * z3 * z4 * z5 + z2 * z3 * z4 * z5 * z6 + z3 * z4 * z5 * z6 * z0 - + z4 * z5 * z6 * z0 * z1 + z5 * z6 * z0 * z1 * z2 + z6 * z0 * z1 * z2 * z3, - z0 * z1 * z2 * z3 * z4 * z5 + z1 * z2 * z3 * z4 * z5 * z6 + z2 * z3 * z4 * z5 * z6 * z0 + z3 * z4 * z5 * z6 * z0 * z1 - + z4 * z5 * z6 * z0 * z1 * z2 + z5 * z6 * z0 * z1 * z2 * z3 + z6 * z0 * z1 * z2 * z3 * z4, - z0 * z1 * z2 * z3 * z4 * z5 * z6 - 1 - ] - benchmark(io, "cyclic7-Fp", ideal(R, F), lex(R), default_ordering(R)) + benchmark(io, "cyclic7-QQ", cyclic7(QQ)...) + benchmark(io, "cyclic7-Fp", cyclic7(Fp)...) - # k = GF(11863279) - # R, (x1, x2, x3, x4, x5, x6, x7) = k[:x1, :x2, :x3, :x4, :x5, :x6, :x7] - # F = [ - # 1*x1+2*x2+2*x3+2*x4+2*x5+2*x6+2*x7-1, - # 2*x4*x3+2*x5*x2+2*x6*x1+2*x7*x2-1*x6, - # 1*x3^2+2*x4*x2+2*x5*x1+2*x6*x2+2*x7*x3-1*x5, - # 2*x3*x2+2*x4*x1+2*x5*x2+2*x6*x3+2*x7*x4-1*x4, - # 1*x2^2+2*x3*x1+2*x4*x2+2*x5*x3+2*x6*x4+2*x7*x5-1*x3, - # 2*x2*x1+2*x3*x2+2*x4*x3+2*x5*x4+2*x6*x5+2*x7*x6-1*x2, - # 1*x1^2+2*x2^2+2*x3^2+2*x4^2+2*x5^2+2*x6^2+2*x7^2-1*x1 - # ]; - # benchmark(io, "katsura6-Fp", ideal(R, F), lex(R), default_ordering(R)) + benchmark(io, "katsura6-QQ", katsura6(QQ)...) + benchmark(io, "katsura6-Fp", katsura6(Fp)...) + + benchmark(io, "tran3.3-QQ", tran33(QQ)...) + benchmark(io, "tran3.3-Fp", tran33(Fp)...) + + benchmark(io, "newellp1-QQ", newellp1(QQ)...) + benchmark(io, "newellp1-Fp", newellp1(Fp)...) # R, (x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21, x22, x23, x24, x25, x26, x27, x28, x29, x30, x31, x32) = QQ[ # :x1, :x2, :x3, :x4, :x5, :x6, :x7, :x8, :x9, :x10, :x11, :x12, :x13, :x14, :x15, :x16, :x17, :x18, :x19, :x20, :x21, :x22, :x23, :x24, :x25, :x26, :x27, :x28, :x29, :x30, :x31, :x32 diff --git a/results.csv b/results.csv index 10334e847dbf..e5acdf73bf5b 100644 --- a/results.csv +++ b/results.csv @@ -1,3 +1,15 @@ name,standard_walk,generic_walk,buchberger simple,0.002634119,0.001080056,4.670857142857143e-6 simple,0.00262981,0.001087529,4.621e-6 +simple,0.000623,0.000195084,3.0837068965517243e-7 +cyclic5-QQ,0.01911975,0.110495292,8.884516129032258e-7 +cyclic5-Fp,0.01191775,0.251762958,8.766274509803922e-7 +simple,0.000620541,0.000199625,3.2019369369369374e-7 +cyclic5-QQ,0.019888625,0.116872417,8.674242424242424e-7 +cyclic5-Fp,0.01215325,0.268002959,8.661276595744681e-7 +cyclic7-Fp,36.670678,, +simple,0.000641,0.000202875,3.0515983606557375e-7 +cyclic5-QQ,0.020051542,0.117901583,8.731739130434783e-7 +cyclic5-Fp,0.013118917,0.261012125,8.7975e-7 +cyclic6-QQ,0.356129125,5.922552333,1.1916e-6 +cyclic6-Fp,0.130183917,11.620150625,1.15e-6 From 73f188f809f049ac38db740be1bc20a48750b0f6 Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Tue, 23 Apr 2024 12:05:42 +0200 Subject: [PATCH 074/179] Add the benchmarks --- examples/benchmark/agk.jl | 16 +++++++ examples/benchmark/benchmarks.jl | 16 ++++--- examples/benchmark/cyclic.jl | 78 ++++++++++++++++++++++++++++++++ examples/benchmark/katsura.jl | 16 +++++++ examples/benchmark/newellp1.jl | 34 ++++++++++++++ examples/benchmark/tran3.3.jl | 9 ++++ results.csv | 2 + 7 files changed, 165 insertions(+), 6 deletions(-) create mode 100644 examples/benchmark/agk.jl create mode 100644 examples/benchmark/cyclic.jl create mode 100644 examples/benchmark/katsura.jl create mode 100644 examples/benchmark/newellp1.jl create mode 100644 examples/benchmark/tran3.3.jl diff --git a/examples/benchmark/agk.jl b/examples/benchmark/agk.jl new file mode 100644 index 000000000000..92bfc4d94c62 --- /dev/null +++ b/examples/benchmark/agk.jl @@ -0,0 +1,16 @@ +using Oscar + +function agk4(k::Field) + R, (x,y,z,u,v) = polynomial_ring(k, ["x","y","z","u","v"]) + + o1 = weight_ordering([1,1,1,0,0], degrevlex(R)) + o2 = weight_ordering([0,0,0,1,1], degrevlex(R)) + + F = [ + u + u^2 - 2*v - 2*u^2*v + 2*u*v^2 - x, + -6*u + 2*v + v^2 - 5*v^3 + 2*u*v^2 - 4*u^2*v^2 - y, + -2 + 2*u^2 + 6*v - 3*u^2*v^2 - z + ] + + return ideal(F), o2, o1 +end \ No newline at end of file diff --git a/examples/benchmark/benchmarks.jl b/examples/benchmark/benchmarks.jl index 5ddfa9e94ea5..e3c8e7732f11 100644 --- a/examples/benchmark/benchmarks.jl +++ b/examples/benchmark/benchmarks.jl @@ -4,6 +4,7 @@ using BenchmarkTools include("cyclic.jl") include("katsura.jl") +include("agk.jl") include("tran3.3.jl") include("newellp1.jl") @@ -30,14 +31,17 @@ open("results.csv", "a") do io I = ideal([y^4 + x^3 - x^2 + x, x^4]) benchmark(io, "simple", I, lex(R), default_ordering(R)) - benchmark(io, "cyclic5-QQ", cyclic5(QQ)...) - benchmark(io, "cyclic5-Fp", cyclic5(Fp)...) + # benchmark(io, "cyclic5-QQ", cyclic5(QQ)...) + # benchmark(io, "cyclic5-Fp", cyclic5(Fp)...) - benchmark(io, "cyclic6-QQ", cyclic6(QQ)...) - benchmark(io, "cyclic6-Fp", cyclic6(Fp)...) + # benchmark(io, "cyclic6-QQ", cyclic6(QQ)...) + # benchmark(io, "cyclic6-Fp", cyclic6(Fp)...) - benchmark(io, "cyclic7-QQ", cyclic7(QQ)...) - benchmark(io, "cyclic7-Fp", cyclic7(Fp)...) + # benchmark(io, "cyclic7-QQ", cyclic7(QQ)...) + # benchmark(io, "cyclic7-Fp", cyclic7(Fp)...) + + benchmark(io, "agk4-QQ", agk4(QQ)...) + benchmark(io, "agk4-Fp", agk4(Fp)...) benchmark(io, "katsura6-QQ", katsura6(QQ)...) benchmark(io, "katsura6-Fp", katsura6(Fp)...) diff --git a/examples/benchmark/cyclic.jl b/examples/benchmark/cyclic.jl new file mode 100644 index 000000000000..a595dc9930f5 --- /dev/null +++ b/examples/benchmark/cyclic.jl @@ -0,0 +1,78 @@ +using Oscar + +function cyclic5(k::Field=QQ) + R, (a,b,c,d,x) = k[:a,:b,:c,:d,:x] + F = [ + a + b + c + d + x, + a*b + b*c + c*d + d*x + x*a, + a*b*c + b*c*d + c*d*x + d*x*a + x*a*b, + a*b*c*d + b*c*d*x + c*d*x*a + d*x*a*b + x*a*b*c, + a*b*c*d*x - 1 + ] + + return ideal(F), lex(R), default_ordering(R) +end + +function cyclic6(k::Field=QQ) + R, (z0,z1,z2,z3,z4,z5) = k[:z0,:z1,:z2,:z3,:z4,:z5] + F = [ + z0 + z1 + z2 + z3 + z4 + z5, + z0*z1 + z1*z2 + z2*z3 + z3*z4 + z4*z5 + z5*z0, + z0*z1*z2 + z1*z2*z3 + z2*z3*z4 + z3*z4*z5 + z4*z5*z0 + z5*z0*z1, + z0*z1*z2*z3 + z1*z2*z3*z4 + z2*z3*z4*z5 + z3*z4*z5*z0 + z4*z5*z0*z1 + + z5*z0*z1*z2, + z0*z1*z2*z3*z4 + z1*z2*z3*z4*z5 + z2*z3*z4*z5*z0 + z3*z4*z5*z0*z1 + + z4*z5*z0*z1*z2 + z5*z0*z1*z2*z3, + z0*z1*z2*z3*z4*z5 - 1 + ] + + return ideal(F), lex(R), default_ordering(R) +end + +function cyclic7(k::Field=QQ) + R, (z0, z1, z2, z3, z4, z5, z6) = QQ[:z0, :z1, :z2, :z3, :z4, :z5, :z6] + F = [ + z0 + z1 + z2 + z3 + z4 + z5 + z6, + z0 * z1 + z1 * z2 + z2 * z3 + z3 * z4 + z4 * z5 + z5 * z6 + z6 * z0, + z0 * z1 * z2 + z1 * z2 * z3 + z2 * z3 * z4 + z3 * z4 * z5 + z4 * z5 * z6 + z5 * z6 * z0 + z6 * z0 * z1, + z0 * z1 * z2 * z3 + z1 * z2 * z3 * z4 + z2 * z3 * z4 * z5 + z3 * z4 * z5 * z6 + z4 * z5 * z6 * z0 + + z5 * z6 * z0 * z1 + z6 * z0 * z1 * z2, + z0 * z1 * z2 * z3 * z4 + z1 * z2 * z3 * z4 * z5 + z2 * z3 * z4 * z5 * z6 + z3 * z4 * z5 * z6 * z0 + + z4 * z5 * z6 * z0 * z1 + z5 * z6 * z0 * z1 * z2 + z6 * z0 * z1 * z2 * z3, + z0 * z1 * z2 * z3 * z4 * z5 + z1 * z2 * z3 * z4 * z5 * z6 + z2 * z3 * z4 * z5 * z6 * z0 + z3 * z4 * z5 * z6 * z0 * z1 + + z4 * z5 * z6 * z0 * z1 * z2 + z5 * z6 * z0 * z1 * z2 * z3 + z6 * z0 * z1 * z2 * z3 * z4, + z0 * z1 * z2 * z3 * z4 * z5 * z6 - 1 + ] + + return ideal(F), lex(R), default_ordering(R) +end + +function cyclic8(k::Field=QQ) + R, (z0, z1, z2, z3, z4, z5, z6, z7) = k[:z0, :z1, :z2, :z3, :z4, :z5, :z6, :z7] + + F = [ + z0 + z1 + z2 + z3 + z4 + z5 + z6 + z7, + + z0*z1 + z1*z2 + z2*z3 + z3*z4 + z4*z5 + z5*z6 + z6*z7 + z7*z0, + + z0*z1*z2 + z1*z2*z3 + z2*z3*z4 + z3*z4*z5 + z4*z5*z6 + z5*z6*z7 + + z6*z7*z0 + z7*z0*z1, + + z0*z1*z2*z3 + z1*z2*z3*z4 + z2*z3*z4*z5 + z3*z4*z5*z6 + z4*z5*z6*z7 + + z5*z6*z7*z0 + z6*z7*z0*z1 + z7*z0*z1*z2, + + z0*z1*z2*z3*z4 + z1*z2*z3*z4*z5 + z2*z3*z4*z5*z6 + z3*z4*z5*z6*z7 + + z4*z5*z6*z7*z0 + z5*z6*z7*z0*z1 + z6*z7*z0*z1*z2 + z7*z0*z1*z2*z3, + + z0*z1*z2*z3*z4*z5 + z1*z2*z3*z4*z5*z6 + z2*z3*z4*z5*z6*z7 + z3*z4*z5*z6*z7*z0 + + z4*z5*z6*z7*z0*z1 + z5*z6*z7*z0*z1*z2 + z6*z7*z0*z1*z2*z3 + z7*z0*z1*z2*z3*z4, + + z0*z1*z2*z3*z4*z5*z6 + z1*z2*z3*z4*z5*z6*z7 + z2*z3*z4*z5*z6*z7*z0 + + z3*z4*z5*z6*z7*z0*z1 + z4*z5*z6*z7*z0*z1*z2 + z5*z6*z7*z0*z1*z2*z3 + + z6*z7*z0*z1*z2*z3*z4 + z7*z0*z1*z2*z3*z4*z5, + + z0*z1*z2*z3*z4*z5*z6*z7 - 1 + ] + + return ideal(F), lex(R), default_ordering(R) +end \ No newline at end of file diff --git a/examples/benchmark/katsura.jl b/examples/benchmark/katsura.jl new file mode 100644 index 000000000000..edc3b5e707b5 --- /dev/null +++ b/examples/benchmark/katsura.jl @@ -0,0 +1,16 @@ +using Oscar + +function katsura6(k::Field=QQ) + R, (x1, x2, x3, x4, x5, x6, x7) = k[:x1, :x2, :x3, :x4, :x5, :x6, :x7] + F = [ + 1*x1+2*x2+2*x3+2*x4+2*x5+2*x6+2*x7-1, + 2*x4*x3+2*x5*x2+2*x6*x1+2*x7*x2-1*x6, + 1*x3^2+2*x4*x2+2*x5*x1+2*x6*x2+2*x7*x3-1*x5, + 2*x3*x2+2*x4*x1+2*x5*x2+2*x6*x3+2*x7*x4-1*x4, + 1*x2^2+2*x3*x1+2*x4*x2+2*x5*x3+2*x6*x4+2*x7*x5-1*x3, + 2*x2*x1+2*x3*x2+2*x4*x3+2*x5*x4+2*x6*x5+2*x7*x6-1*x2, + 1*x1^2+2*x2^2+2*x3^2+2*x4^2+2*x5^2+2*x6^2+2*x7^2-1*x1 + ]; + + return ideal(F), lex(R), default_ordering(R) +end \ No newline at end of file diff --git a/examples/benchmark/newellp1.jl b/examples/benchmark/newellp1.jl new file mode 100644 index 000000000000..5aebd84cfe79 --- /dev/null +++ b/examples/benchmark/newellp1.jl @@ -0,0 +1,34 @@ +#Newell's teapot, patch 1 +#a 2 dimensional ideal from tran 2004 +using Oscar + +function newellp1(k::Field) + R, (x,y,z,u,v) = polynomial_ring(QQ, ["x","y","z","u","v"]) + + F = [ + -x + 7//5 - 231//125 * v^2 + 39//80 * u^2 - 1//5 * u^3 + 99//400 * u * v^2 - 1287//2000 * u^2 * v^2 + 33//125 * u^3 * v^2 - 3//16 * u + 56//125 * v^3 - 3//50 * u * v^3 + 39//250 * u^2 * v^3 - 8//125 * u^3 * v^3, + -y + 63//125 * v^2 - 294//125 * v + 56//125 * v^3 - 819//1000 * u^2 * v + 42//125 * u^3 * v - 3//50 * u * v^3 + 351//2000 * u^2 * v^2 + 39//250 * u^2 * v^3 - 9//125 * u^3 * v^2 - 8//125 * u^3 * v^3, + -z + 12//5 - 63//160 * u^2 + 63//160 * u + ] + + if k == QQ + o1 = matrix_ordering(R, [1 1 1 0 0; 0 0 0 1 1; 0 0 0 1 0; 1 1 0 0 0; 1 0 0 0 0]) + o2 = matrix_ordering(R, [0 0 0 1 1; 1 1 1 0 0; 1 1 0 0 0; 1 0 0 0 0; 0 0 0 1 0]) + + return ideal(F), o2, o1 + end + + lcm_denom = [ + lcm(numerator.(coefficients(f))) for f in F + ] + integral_F = [ + change_coefficient_ring( + k, l*f + ) for (l, f) in zip(lcm_denom, F) + ] + + R = parent(first(F)) + o1 = matrix_ordering(R, [1 1 1 0 0; 0 0 0 1 1; 0 0 0 1 0; 1 1 0 0 0; 1 0 0 0 0]) + o2 = matrix_ordering(R, [0 0 0 1 1; 1 1 1 0 0; 1 1 0 0 0; 1 0 0 0 0; 0 0 0 1 0]) + return ideal(integral_F), o2, o1 +end diff --git a/examples/benchmark/tran3.3.jl b/examples/benchmark/tran3.3.jl new file mode 100644 index 000000000000..e31d482f9b26 --- /dev/null +++ b/examples/benchmark/tran3.3.jl @@ -0,0 +1,9 @@ +using Oscar + +function tran33(k::Field) + R, (x,y,z) = k[:x,:y,:z] + + F = [16 + 3*x^3+16*x^2*z+14*x^2*y^3, 6+y^3*z+17*x^2*z^2+7*x*y^2*z^2+13*x^3*z^2] + + return ideal(F), lex(R), default_ordering(R) +end \ No newline at end of file diff --git a/results.csv b/results.csv index e5acdf73bf5b..9a80f256c4a9 100644 --- a/results.csv +++ b/results.csv @@ -13,3 +13,5 @@ cyclic5-QQ,0.020051542,0.117901583,8.731739130434783e-7 cyclic5-Fp,0.013118917,0.261012125,8.7975e-7 cyclic6-QQ,0.356129125,5.922552333,1.1916e-6 cyclic6-Fp,0.130183917,11.620150625,1.15e-6 +simple,0.000753417,0.000253458,4.2939408866995077e-7 +simple,0.000753125,0.000237833,4.0463111111111113e-7 From 7c78d045adbf3cd535dbad64420d3b4481ac3c2e Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Wed, 24 Apr 2024 12:09:01 +0200 Subject: [PATCH 075/179] Add some benchmarks --- results.csv | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/results.csv b/results.csv index 9a80f256c4a9..c1a87492c53b 100644 --- a/results.csv +++ b/results.csv @@ -15,3 +15,14 @@ cyclic6-QQ,0.356129125,5.922552333,1.1916e-6 cyclic6-Fp,0.130183917,11.620150625,1.15e-6 simple,0.000753417,0.000253458,4.2939408866995077e-7 simple,0.000753125,0.000237833,4.0463111111111113e-7 +simple,1.183723958,0.269548625,2.2375e-5 +agk4-QQ,10.771205958,55.705554,527.126850292 +agk4-Fp,3.302066417,49.991833833,0.095817208 +katsura6-QQ,1.003294291,35.098429459, +simple,1.422464625,0.274453459,2.475e-5 +agk4-QQ,11.076574625,55.562715875,543.319831 +agk4-Fp,3.492181375,51.427781875,0.094963834 +tran3.3-QQ,0.640738125,24.688099959,2323.13229425 +tran3.3-Fp,0.254231917,14.402583584,0.003486333 +newellp1-QQ,51.5992475,1529.494271334,811.051479458 +newellp1-Fp,9.365612875,1140.743606416,0.165012125 From 235c2dc4a100d41e7993d634bff306f9a17a073b Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Wed, 24 Apr 2024 12:09:24 +0200 Subject: [PATCH 076/179] Move benchmarks --- {examples/benchmark => benchmark}/agk.jl | 0 .../benchmark => benchmark}/benchmarks.jl | 13 ++++++++----- {examples/benchmark => benchmark}/cyclic.jl | 0 {examples/benchmark => benchmark}/katsura.jl | 0 {examples/benchmark => benchmark}/newellp1.jl | 0 {examples/benchmark => benchmark}/tran3.3.jl | 0 examples/benchmark/agk4.jl | 18 ------------------ 7 files changed, 8 insertions(+), 23 deletions(-) rename {examples/benchmark => benchmark}/agk.jl (100%) rename {examples/benchmark => benchmark}/benchmarks.jl (79%) rename {examples/benchmark => benchmark}/cyclic.jl (100%) rename {examples/benchmark => benchmark}/katsura.jl (100%) rename {examples/benchmark => benchmark}/newellp1.jl (100%) rename {examples/benchmark => benchmark}/tran3.3.jl (100%) delete mode 100644 examples/benchmark/agk4.jl diff --git a/examples/benchmark/agk.jl b/benchmark/agk.jl similarity index 100% rename from examples/benchmark/agk.jl rename to benchmark/agk.jl diff --git a/examples/benchmark/benchmarks.jl b/benchmark/benchmarks.jl similarity index 79% rename from examples/benchmark/benchmarks.jl rename to benchmark/benchmarks.jl index e3c8e7732f11..df7bd5494c8e 100644 --- a/examples/benchmark/benchmarks.jl +++ b/benchmark/benchmarks.jl @@ -16,11 +16,14 @@ function benchmark( start::MonomialOrdering ) print(io, name, ","); flush(io) - t = @belapsed groebner_walk($I, $target, $start; algorithm=:standard) seconds=20000 samples=5 + # t = @belapsed groebner_walk($I, $target, $start; algorithm=:standard) seconds=20000 samples=5 + t = @elapsed groebner_walk(I, target, start; algorithm=:standard) print(io, t, ","); flush(io) - t = @belapsed groebner_walk($I, $target, $start; algorithm=:generic) seconds=20000 samples=5 + # t = @belapsed groebner_walk($I, $target, $start; algorithm=:generic) seconds=20000 samples=5 + t = @elapsed groebner_walk(I, target, start; algorithm=:generic) print(io, t, ","); flush(io) - t = @belapsed groebner_basis($I; ordering=$target) seconds=20000 samples=5 + # t = @belapsed groebner_basis($I; ordering=$target) seconds=20000 samples=5 + t = @elapsed groebner_basis(I; ordering=target) println(io, t); flush(io) end @@ -43,8 +46,8 @@ open("results.csv", "a") do io benchmark(io, "agk4-QQ", agk4(QQ)...) benchmark(io, "agk4-Fp", agk4(Fp)...) - benchmark(io, "katsura6-QQ", katsura6(QQ)...) - benchmark(io, "katsura6-Fp", katsura6(Fp)...) + # benchmark(io, "katsura6-QQ", katsura6(QQ)...) + # benchmark(io, "katsura6-Fp", katsura6(Fp)...) benchmark(io, "tran3.3-QQ", tran33(QQ)...) benchmark(io, "tran3.3-Fp", tran33(Fp)...) diff --git a/examples/benchmark/cyclic.jl b/benchmark/cyclic.jl similarity index 100% rename from examples/benchmark/cyclic.jl rename to benchmark/cyclic.jl diff --git a/examples/benchmark/katsura.jl b/benchmark/katsura.jl similarity index 100% rename from examples/benchmark/katsura.jl rename to benchmark/katsura.jl diff --git a/examples/benchmark/newellp1.jl b/benchmark/newellp1.jl similarity index 100% rename from examples/benchmark/newellp1.jl rename to benchmark/newellp1.jl diff --git a/examples/benchmark/tran3.3.jl b/benchmark/tran3.3.jl similarity index 100% rename from examples/benchmark/tran3.3.jl rename to benchmark/tran3.3.jl diff --git a/examples/benchmark/agk4.jl b/examples/benchmark/agk4.jl deleted file mode 100644 index 3e7cd33cbeb6..000000000000 --- a/examples/benchmark/agk4.jl +++ /dev/null @@ -1,18 +0,0 @@ -using Oscar -using GroebnerWalk -using BenchmarkTools - -R, (x,y,z,u,v) = polynomial_ring(QQ, ["x","y","z","u","v"]) - -o1 = weight_ordering([1,1,1,0,0], degrevlex(R)) -o2 = weight_ordering([0,0,0,1,1], degrevlex(R)) - -I1 = ideal([ - u + u^2 - 2*v - 2*u^2*v + 2*u*v^2 - x, - -6*u + 2*v + v^2 - 5*v^3 + 2*u*v^2 - 4*u^2*v^2 - y, - -2 + 2*u^2 + 6*v - 3*u^2*v^2 - z -]) - -t_standard = @elapsed G = groebner_walk(I1, o2, o1; algorithm=:standard) -t_generic = @elapsed G = groebner_walk(I1, o2, o1; algorithm=:generic) -# t_perturbed = @elapsed G = groebner_walk(I1, o2, o1; algorithm=:perturbed) \ No newline at end of file From 90ae694a7175ed46faefb66bb203e5841cb031a8 Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Wed, 24 Apr 2024 14:50:35 +0200 Subject: [PATCH 077/179] Move examples around --- examples/finitefield.jl | 20 -------------------- examples/implicitization/agk4.jl | 12 ++++-------- examples/implicitization/newellp1.jl | 16 ++++++++-------- examples/implicitization/tran3.3.jl | 7 ++++--- examples/{ => zero-dimensional}/cyclic5.jl | 0 examples/{ => zero-dimensional}/cyclic7.jl | 0 examples/zero-dimensional/finitefield.jl | 22 ++++++++++++++++++++++ 7 files changed, 38 insertions(+), 39 deletions(-) delete mode 100644 examples/finitefield.jl rename examples/{ => zero-dimensional}/cyclic5.jl (100%) rename examples/{ => zero-dimensional}/cyclic7.jl (100%) create mode 100644 examples/zero-dimensional/finitefield.jl diff --git a/examples/finitefield.jl b/examples/finitefield.jl deleted file mode 100644 index c21e94d1bf65..000000000000 --- a/examples/finitefield.jl +++ /dev/null @@ -1,20 +0,0 @@ -#finite field example, from groebner.jl docstring line 1232 - -using Oscar -using GroebnerWalk -R, (x1, x2, x3, x4) = polynomial_ring(GF(32003), ["x1", "x2", "x3", "x4"]) - - -J = ideal(R, [x1+2*x2+2*x3+2*x4-1, - x1^2+2*x2^2+2*x3^2+2*x4^2-x1, - 2*x1*x2+2*x2*x3+2*x3*x4-x2, - x2^2+2*x1*x3+2*x2*x4-x3 - ]) -t_init = @elapsed G = groebner_basis(J, ordering = degrevlex(R), complete_reduction = true) -t_b = @elapsed Gb = groebner_basis(J, ordering = lex(R), complete_reduction = true) #0.4s - -t_s = @elapsed Gs = groebner_walk(J, lex(R), algorithm =:standard) #4.11 - -t_g = @elapsed Gg = groebner_walk(J, lex(R), algorithm =:generic) #0.8s - -t_p = @elapsed Gp = groebner_walk(J, lex(R), algorithm =:perturbed) #0.33s diff --git a/examples/implicitization/agk4.jl b/examples/implicitization/agk4.jl index dbeda96de2f7..597fe62e72a1 100644 --- a/examples/implicitization/agk4.jl +++ b/examples/implicitization/agk4.jl @@ -1,9 +1,8 @@ -#implicitization of Bezier surface - - +#= + Implicitization of Bezier surface. Example taken from Amrhein, Gloor, Küchlin. "On the walk" (2004) +=# using Oscar using GroebnerWalk -using BenchmarkTools R, (x,y,z,u,v) = polynomial_ring(QQ, ["x","y","z","u","v"]) @@ -17,7 +16,4 @@ I = ideal([ ]) set_verbosity_level(:groebner_walk, 1) -G = groebner_basis(I, ordering = o2 ) -t_standard = @elapsed G = groebner_walk(I, o1, o2; algorithm=:standard) -# t_generic = @elapsed G = groebner_walk(I, o2, o1; algorithm=:generic) -# t_perturbed = @elapsed G = groebner_walk(I, o2, o1; algorithm=:perturbed) \ No newline at end of file +G = groebner_walk(I, o1, o2; algorithm=:standard) diff --git a/examples/implicitization/newellp1.jl b/examples/implicitization/newellp1.jl index ba9e65b8c2ab..4331d713a258 100644 --- a/examples/implicitization/newellp1.jl +++ b/examples/implicitization/newellp1.jl @@ -1,7 +1,8 @@ -#Newell's teapot, patch 1 -#a 2 dimensional ideal from tran 2004 +#= + Newell's teapot, patch 1 + A 2-dimensional ideal from Tran. "Efficient Groebner walk conversion for implicitization of geometric objects" (2004) +=# using Oscar - using GroebnerWalk R, (x,y,z,u,v) = polynomial_ring(QQ, ["x","y","z","u","v"]) @@ -11,12 +12,11 @@ I = ideal([ -y + 63//125 * v^2 - 294//125 * v + 56//125 * v^3 - 819//1000 * u^2 * v + 42//125 * u^3 * v - 3//50 * u * v^3 + 351//2000 * u^2 * v^2 + 39//250 * u^2 * v^3 - 9//125 * u^3 * v^2 - 8//125 * u^3 * v^3, -z + 12//5 - 63//160 * u^2 + 63//160 * u ]) + Ginit = groebner_basis(I) -#"optimal" choice of orderings, as stated in Tran 2004 +# "Optimal" choice of orderings, as stated in Tran 2004 o1 = matrix_ordering(R, [1 1 1 0 0; 0 0 0 1 1; 0 0 0 1 0; 1 1 0 0 0; 1 0 0 0 0]) o2 = matrix_ordering(R, [0 0 0 1 1; 1 1 1 0 0; 1 1 0 0 0; 1 0 0 0 0; 0 0 0 1 0]) + set_verbosity_level(:groebner_walk, 1) -t_s = @elapsed Gs = groebner_walk(I, o2, o1; algorithm=:standard) #144s -t_g = @elapsed Gg = groebner_walk(I, o2, o1; algorithm=:generic) #hangs (30+ minutes) after ~20 iterations. -t_p = @elapsed Gp = groebner_walk(I, o2, o1; algorithm=:perturbed) -t_b = @elapsed Gb = groebner_basis(I, ordering = o2) #20000s +G = groebner_walk(I, o2, o1; algorithm=:standard) \ No newline at end of file diff --git a/examples/implicitization/tran3.3.jl b/examples/implicitization/tran3.3.jl index 63139823db62..70edf2f36eb6 100644 --- a/examples/implicitization/tran3.3.jl +++ b/examples/implicitization/tran3.3.jl @@ -1,6 +1,7 @@ -#Example 3.3 from Tran -# This is an example 3.3 from "A fast algorithm for Gröbner basis conversion and its applications" ( Tran 2000) -# 1-dimensional ideal (application not given) +#= + Example 3.3 from Tran. "A fast algorithm for Gröbner basis conversion and its applications" (2000) + A 1-dimensional ideal (application not given) +=# using Oscar using GroebnerWalk R, (x,y,z) = polynomial_ring(QQ, ["x","y","z"]) diff --git a/examples/cyclic5.jl b/examples/zero-dimensional/cyclic5.jl similarity index 100% rename from examples/cyclic5.jl rename to examples/zero-dimensional/cyclic5.jl diff --git a/examples/cyclic7.jl b/examples/zero-dimensional/cyclic7.jl similarity index 100% rename from examples/cyclic7.jl rename to examples/zero-dimensional/cyclic7.jl diff --git a/examples/zero-dimensional/finitefield.jl b/examples/zero-dimensional/finitefield.jl new file mode 100644 index 000000000000..dca8cbafce9e --- /dev/null +++ b/examples/zero-dimensional/finitefield.jl @@ -0,0 +1,22 @@ +#= + Example over finite field, from `Groebner.jl` docstring line 1232 +=# +using Oscar +using GroebnerWalk +R, (x1, x2, x3, x4) = polynomial_ring(GF(32003), ["x1", "x2", "x3", "x4"]) + +J = ideal(R, [ + x1 + 2 * x2 + 2 * x3 + 2 * x4 - 1, + x1^2 + 2 * x2^2 + 2 * x3^2 + 2 * x4^2 - x1, + 2 * x1 * x2 + 2 * x2 * x3 + 2 * x3 * x4 - x2, + x2^2 + 2 * x1 * x3 + 2 * x2 * x4 - x3 +]) + +t_init = @elapsed G = groebner_basis(J, ordering=degrevlex(R), complete_reduction=true) +t_b = @elapsed Gb = groebner_basis(J, ordering=lex(R), complete_reduction=true) #0.4s + +t_s = @elapsed Gs = groebner_walk(J, lex(R), algorithm=:standard) #4.11 + +t_g = @elapsed Gg = groebner_walk(J, lex(R), algorithm=:generic) #0.8s + +t_p = @elapsed Gp = groebner_walk(J, lex(R), algorithm=:perturbed) #0.33s From 5c5d01ff283430b5e9f9fd5a5b313aaa0c720ca3 Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Wed, 24 Apr 2024 14:53:03 +0200 Subject: [PATCH 078/179] Edit README.md --- README.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d7c6b0398485..81e0132ec5ab 100644 --- a/README.md +++ b/README.md @@ -24,8 +24,7 @@ groebner_walk(I, lex(R)) # compute the Groebner basis ## Status This repository represents the status of the code as a submission for MEGA 2024. -At the moment, the standard walk (TODO: reference) and the generic walk (TODO: references) -are implemented. +At the moment, the standard walk by Collart, Kalkbrener and Mall (1997) and the generic walk by Fukuda et al. are implemented. It is slated for inclusion into OSCAR as experimental package. ## Contacts @@ -34,3 +33,8 @@ The library is maintained by Kamillo Ferry (kafe (at) kafe (dot) dev) and France ## Acknowledgement The current implementation is based on an implementation by Jordi Welp. We thank him for laying the groundwork for this package. + +## References +- Collart, S., M. Kalkbrener, and D. Mall. ‘Converting Bases with the Gröbner Walk’. Journal of Symbolic Computation 24, no. 3–4 (September 1997): 465–69. https://doi.org/10.1006/jsco.1996.0145. +- Fukuda, K., A. N. Jensen, N. Lauritzen, and R. Thomas. ‘The Generic Gröbner Walk’. Journal of Symbolic Computation 42, no. 3 (1 March 2007): 298–312. https://doi.org/10.1016/j.jsc.2006.09.004. + From e4c5ef92ab81cfdbe79f196a169a3d6e09eec31f Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Thu, 25 Apr 2024 00:59:04 +0200 Subject: [PATCH 079/179] Clean up examples --- examples/implicitization/tran3.3.jl | 13 +------ examples/knapsack/fukuda_cuww1.jl | 23 +++++------- examples/knapsack/fukuda_prob6.jl | 6 +--- examples/knapsack/knap.jl | 17 ++------- examples/knapsack/smallknap.jl | 17 +-------- examples/ku10.jl | 35 +++++++----------- examples/zero-dimensional/cyclic5.jl | 35 ++++++------------ examples/zero-dimensional/cyclic7.jl | 38 ++++++++------------ examples/zero-dimensional/finitefield.jl | 7 +--- examples/zero-dimensional/katsura5.jl | 23 ++++++++++++ src/generic_walk.jl | 45 +++++++----------------- 11 files changed, 88 insertions(+), 171 deletions(-) create mode 100644 examples/zero-dimensional/katsura5.jl diff --git a/examples/implicitization/tran3.3.jl b/examples/implicitization/tran3.3.jl index 70edf2f36eb6..f333a8fc54b3 100644 --- a/examples/implicitization/tran3.3.jl +++ b/examples/implicitization/tran3.3.jl @@ -5,18 +5,7 @@ using Oscar using GroebnerWalk R, (x,y,z) = polynomial_ring(QQ, ["x","y","z"]) - I = ideal([16 + 3*x^3+16*x^2*z+14*x^2*y^3, 6+y^3*z+17*x^2*z^2+7*x*y^2*z^2+13*x^3*z^2]) - -Gdegrevlex = groebner_basis(I, complete_reduction = true) - set_verbosity_level(:groebner_walk, 1) - -t_b = @elapsed Gb = groebner_basis(I, ordering = lex(R), complete_reduction = true) #doesn't terminate after 90mins - -t_s = @elapsed Gs = groebner_walk(I, lex(R), algorithm =:standard) #~10s faster than m2! (but remember; no reduction! )) - -t_g = @elapsed Gg = groebner_walk(I, lex(R), algorithm =:generic) #87s. why so long? we have many conversions, maybe inflating weight vectors? - -t_p = @elapsed Gp = groebner_walk(I, lex(R), algorithm =:perturbed) #54s, long final conversion. Also, I don't understand the output +Gs = groebner_walk(I, lex(R), algorithm =:standard) \ No newline at end of file diff --git a/examples/knapsack/fukuda_cuww1.jl b/examples/knapsack/fukuda_cuww1.jl index fa064d0b7545..1d03dd1ad734 100644 --- a/examples/knapsack/fukuda_cuww1.jl +++ b/examples/knapsack/fukuda_cuww1.jl @@ -1,10 +1,12 @@ -#hard integer knapsack problem +#= + Hard integer knapsack problem from Aardal, Karen and Lenstra. ‘Hard Equality Constrained Integer Knapsacks’. (2004) +=# -using Oscar +using Oscar using GroebnerWalk -R, (t, x1, x2, x3, x4, x5) = polynomial_ring(QQ, ["t","x1", "x2", "x3", "x4", "x5"]) +R, (t, x1, x2, x3, x4, x5) = polynomial_ring(QQ, ["t", "x1", "x2", "x3", "x4", "x5"]) -f = 12223*x1 + 12224*x2 +36674*x3+61119*x4+85569*x5 -89643481 +f = 12223 * x1 + 12224 * x2 + 36674 * x3 + 61119 * x4 + 85569 * x5 - 89643481 f1 = x1 - t^1223 f2 = x2 - t^1224 @@ -15,14 +17,7 @@ I = ideal([f1, f2, f3, f4, f5]) set_verbosity_level(:groebner_walk, 1) -o_t = weight_ordering([1,0,0,0,0,0], degrevlex(R)) -o_s = weight_ordering([0,1,1,1,1,1], degrevlex(R)) -Ginit = groebner_basis(I, ordering = o_s, complete_reduction = true) -tg = @elapsed Gg = groebner_walk(I, o_t, o_s, algorithm =:generic) #??takes more than 9 hours! +o_t = weight_ordering([1, 0, 0, 0, 0, 0], degrevlex(R)) +o_s = weight_ordering([0, 1, 1, 1, 1, 1], degrevlex(R)) -ts = @elapsed Gs = groebner_walk(I, o_t, o_s, algorithm =:standard) #hangs at vectors of the form [a, b, b, b, b, b] - -tp = @elapsed Gp = groebner_walk(I, o_t, o_s, algorithm =:perturbed) -tb = @elapsed Gb = groebner_basis(I; ordering=o_t, complete_reduction = true) - -tf = @elapsed Gf = groebner_basis(I, ordering = o_t, complete_reduction = true, algorithm =:fglm) #error: dimension of ideal must be zero! \ No newline at end of file +ts = @elapsed Gs = groebner_walk(I, o_t, o_s, algorithm=:standard) \ No newline at end of file diff --git a/examples/knapsack/fukuda_prob6.jl b/examples/knapsack/fukuda_prob6.jl index ab9519e49930..120f2e8ec331 100644 --- a/examples/knapsack/fukuda_prob6.jl +++ b/examples/knapsack/fukuda_prob6.jl @@ -42,8 +42,4 @@ o_s = matrix_ordering(R, [ 1 1 1 1 1 1 1 1 1 0 0; 1 1 1 1 1 1 1 1 1 1 0]) -Ginit = groebner_basis(I, ordering = o_s) - -tg = @elapsed Gg = groebner_walk(I, o_t, o_s, algorithm =:generic) #>1hr -ts = @elapsed Gs = groebner_walk(I, o_t, o_s, algorithm =:standard) -tb = @elapsed Gb = groebner_basis(I, ordering = o_t, complete_reduction = true) #139s \ No newline at end of file +groebner_walk(I, o_t, o_s, algorithm =:generic) #>1hr \ No newline at end of file diff --git a/examples/knapsack/knap.jl b/examples/knapsack/knap.jl index 3374e920f04b..b95accf3e8e3 100644 --- a/examples/knapsack/knap.jl +++ b/examples/knapsack/knap.jl @@ -1,11 +1,7 @@ using Oscar using GroebnerWalk -R, (t, x1, x2, x3, x4, x5, x6) = polynomial_ring(QQ, ["t","x1", "x2", "x3", "x4", "x5", "x6"]) - - - - +R, (t, x1, x2, x3, x4, x5, x6) = polynomial_ring(QQ, ["t","x1", "x2", "x3", "x4", "x5", "x6"]) f1 = x1 - t^53725 f2 = x2 - t^61919 @@ -20,14 +16,5 @@ set_verbosity_level(:groebner_walk, 1) o_t = weight_ordering([1,0,0,0,0,0,0], degrevlex(R)) o_s = weight_ordering([0,1,1,1,1,1,1], degrevlex(R)) -Ginit = groebner_basis(I, ordering = o_s, complete_reduction = true) -tg = @elapsed Gg = groebner_walk(I, o_t, o_s, algorithm =:generic) #300s - -ts = @elapsed Gs = groebner_walk(I, o_t, o_s, algorithm =:standard) #throws an error...oops - -tp = @elapsed Gp = groebner_walk(I, o_t, o_s, algorithm =:perturbed) #also throws an error -tb = @elapsed Gb = groebner_basis(I, ordering = o_t, complete_reduction = true) - -tf = @elapsed Gf = groebner_basis(I, ordering = o_t, complete_reduction = true, algorithm =:fglm) #error: dimension of ideal must be zero! -th = @elapsed Gh = groebner_basis(I, ordering = o_t, complete_reduction = true, algorithm =:hilbert) \ No newline at end of file +Gg = groebner_walk(I, o_t, o_s, algorithm =:generic) #300s \ No newline at end of file diff --git a/examples/knapsack/smallknap.jl b/examples/knapsack/smallknap.jl index 8cd4eddb384b..1c773b7bb705 100644 --- a/examples/knapsack/smallknap.jl +++ b/examples/knapsack/smallknap.jl @@ -4,30 +4,15 @@ using Oscar using GroebnerWalk R, (t, x1, x2, x3) = polynomial_ring(QQ, ["t","x1", "x2", "x3"]) - - - - - f1 = x1 - t^5 f2 = x2 - t^12 f3 = x3 - t^20 - I = ideal([f1, f2, f3]) set_verbosity_level(:groebner_walk, 1) o_t = weight_ordering([1,0,0,0], degrevlex(R)) o_s = weight_ordering([0,1,1,1], degrevlex(R)) -Ginit = groebner_basis(I, ordering = o_s, complete_reduction = true) -tg = @elapsed Gg = groebner_walk(I, o_t, o_s, algorithm =:generic) #300s - -ts = @elapsed Gs = groebner_walk(I, o_t, o_s, algorithm =:standard) #throws an error...oops - -tp = @elapsed Gp = groebner_walk(I, o_t, o_s, algorithm =:perturbed) #also throws an error -tb = @elapsed Gb = groebner_basis(I, ordering = o_t, complete_reduction = true) - -tf = @elapsed Gf = groebner_basis(I, ordering = o_t, complete_reduction = true, algorithm =:fglm) #error: dimension of ideal must be zero! -th = @elapsed Gh = groebner_basis(I, ordering = o_t, complete_reduction = true, algorithm =:hilbert) \ No newline at end of file +Gg = groebner_walk(I, o_t, o_s, algorithm =:generic) \ No newline at end of file diff --git a/examples/ku10.jl b/examples/ku10.jl index c56e3f5b2db4..7fd46d699697 100644 --- a/examples/ku10.jl +++ b/examples/ku10.jl @@ -1,33 +1,24 @@ #ku using Oscar - using GroebnerWalk R, (x1, x2, x3, x4, x5, x6, x7, x8, x9, x10) = polynomial_ring(QQ, ["x$index" for index in 1:10]) - -I = ideal([5*x1*x2+ 5*x1+ 3*x2+ 55, -7*x2*x3+ 9*x2+ 9*x3+ 19, -3*x3*x4+ 6*x3+ 5*x4-4, -6*x4*x5+ 6*x4+ 7*x5+ 118, -x5*x6+ 3*x5+ 9*x6+ 27, -6*x6*x7+ 7*x6+x7+ 72, -9*x7*x8+ 7*x7+x8+ 35, -4*x8*x9+ 4*x8+ 6*x9+ 16, -8*x9*x10+ 4*x9+ 3*x10-51, -3*x1*x10-6*x1+x10+ 5]) - - -Ginit = groebner_basis(I) +I = ideal([ + 5*x1*x2+ 5*x1+ 3*x2+ 55, + 7*x2*x3+ 9*x2+ 9*x3+ 19, + 3*x3*x4+ 6*x3+ 5*x4-4, + 6*x4*x5+ 6*x4+ 7*x5+ 118, + x5*x6+ 3*x5+ 9*x6+ 27, + 6*x6*x7+ 7*x6+x7+ 72, + 9*x7*x8+ 7*x7+x8+ 35, + 4*x8*x9+ 4*x8+ 6*x9+ 16, + 8*x9*x10+ 4*x9+ 3*x10-51, + 3*x1*x10-6*x1+x10+ 5 +]) set_verbosity_level(:groebner_walk, 1) -t_b = @elapsed Gb = groebner_basis(I, ordering = lex(R), complete_reduction = true) - t_s = @elapsed Gs = groebner_walk(I, lex(R), algorithm =:standard) - t_g = @elapsed Gg = groebner_walk(I, lex(R), algorithm =:generic) - -t_p = @elapsed Gp = groebner_walk(I, lex(R), algorithm =:perturbed) - -t_f = @elapsed Gf = groebner_basis(I, ordering = lex(R), algorithm =:fglm) \ No newline at end of file +t_p = @elapsed Gp = groebner_walk(I, lex(R), algorithm =:perturbed) \ No newline at end of file diff --git a/examples/zero-dimensional/cyclic5.jl b/examples/zero-dimensional/cyclic5.jl index 297068e77a6c..1d206fdb3f9d 100644 --- a/examples/zero-dimensional/cyclic5.jl +++ b/examples/zero-dimensional/cyclic5.jl @@ -1,35 +1,20 @@ using Oscar using GroebnerWalk -R, (a, b, c, d, x) = polynomial_ring(QQ, ["a", "b", "c", "d", "x"]) +R, (a, b, c, d, x) = polynomial_ring(QQ, ["a", "b", "c", "d", "x"]) -I = ideal([ a + b + c + d + x, -a*b + b*c + c*d + d*x + x*a, -a*b*c + b*c*d + c*d*x + d*x*a + x*a*b, -a*b*c*d + b*c*d*x + c*d*x*a + d*x*a*b + x*a*b*c, -a*b*c*d*x - 1] ) +I = ideal([ + a + b + c + d + x, + a * b + b * c + c * d + d * x + x * a, + a * b * c + b * c * d + c * d * x + d * x * a + x * a * b, + a * b * c * d + b * c * d * x + c * d * x * a + d * x * a * b + x * a * b * c, + a * b * c * d * x - 1 +]) -#G = groebner_basis(I, ordering = lex(R), complete_reduction = true) o_s = degrevlex(R) o_t = lex(R) -G1 = groebner_basis(I, ordering = degrevlex(R), complete_reduction = true) - set_verbosity_level(:groebner_walk, 1) -t_b = @elapsed Gb = groebner_basis(I, ordering = lex(R), complete_reduction = true) - -t_s = @elapsed Gs = groebner_walk(I, lex(R), algorithm =:standard) - -t_g = @elapsed Gg = groebner_walk(I, lex(R), algorithm =:generic) - -t_p = @elapsed Gp = groebner_walk(I, lex(R), algorithm =:perturbed) - -t_f = @elapsed Gf = groebner_basis(I, ordering = lex(R), algorithm =:fglm) -#= What do we learn from this example? - -Gg1. standardwalk is fastest, but it doesn't give us a REDUCED Gröbner basis -2. the output of genericwalk and buchberger (with complete_reduction) is the same UP TO SCALING -3. The elements of the genericwalkbasis have rational coefficients (due to divides()...), whereas Buchberger's output doesnt - -=# \ No newline at end of file +Gs = groebner_walk(I, lex(R), algorithm=:standard) +Gg = groebner_walk(I, lex(R), algorithm=:generic) diff --git a/examples/zero-dimensional/cyclic7.jl b/examples/zero-dimensional/cyclic7.jl index 5f1c16e96498..d67444c18106 100644 --- a/examples/zero-dimensional/cyclic7.jl +++ b/examples/zero-dimensional/cyclic7.jl @@ -1,37 +1,29 @@ #cyclic7 using Oscar - using GroebnerWalk R, (z0, z1, z2, z3, z4, z5, z6) = polynomial_ring(QQ, ["z$index" for index in 0:6 ]) -I = ideal([z0 + z1 + z2 + z3 + z4 + z5 + z6, - - z0*z1 + z1*z2 + z2*z3 + z3*z4 + z4*z5 + z5*z6 + z6*z0, - - z0*z1*z2 + z1*z2*z3 + z2*z3*z4 + z3*z4*z5 + z4*z5*z6 + z5*z6*z0 + z6*z0*z1, - - z0*z1*z2*z3 + z1*z2*z3*z4 + z2*z3*z4*z5 + z3*z4*z5*z6 + z4*z5*z6*z0 -+ z5*z6*z0*z1 + z6*z0*z1*z2, - - z0*z1*z2*z3*z4 + z1*z2*z3*z4*z5 + z2*z3*z4*z5*z6 + z3*z4*z5*z6*z0 -+ z4*z5*z6*z0*z1 + z5*z6*z0*z1*z2 + z6*z0*z1*z2*z3, - - z0*z1*z2*z3*z4*z5 + z1*z2*z3*z4*z5*z6 + z2*z3*z4*z5*z6*z0 + z3*z4*z5*z6*z0*z1 -+ z4*z5*z6*z0*z1*z2 + z5*z6*z0*z1*z2*z3 + z6*z0*z1*z2*z3*z4, +I = ideal([ + z0 + z1 + z2 + z3 + z4 + z5 + z6, - z0*z1*z2*z3*z4*z5*z6 - 1]) + z0*z1 + z1*z2 + z2*z3 + z3*z4 + z4*z5 + z5*z6 + z6*z0, - Ginit = groebner_basis(I) + z0*z1*z2 + z1*z2*z3 + z2*z3*z4 + z3*z4*z5 + z4*z5*z6 + z5*z6*z0 + z6*z0*z1, - set_verbosity_level(:groebner_walk, 1) + z0*z1*z2*z3 + z1*z2*z3*z4 + z2*z3*z4*z5 + z3*z4*z5*z6 + z4*z5*z6*z0 + + z5*z6*z0*z1 + z6*z0*z1*z2, -t_b = @elapsed Gb = groebner_basis(I, ordering = lex(R), complete_reduction = true) + z0*z1*z2*z3*z4 + z1*z2*z3*z4*z5 + z2*z3*z4*z5*z6 + z3*z4*z5*z6*z0 + + z4*z5*z6*z0*z1 + z5*z6*z0*z1*z2 + z6*z0*z1*z2*z3, -t_s = @elapsed Gs = groebner_walk(I, lex(R), algorithm =:standard) + z0*z1*z2*z3*z4*z5 + z1*z2*z3*z4*z5*z6 + z2*z3*z4*z5*z6*z0 + z3*z4*z5*z6*z0*z1 + + z4*z5*z6*z0*z1*z2 + z5*z6*z0*z1*z2*z3 + z6*z0*z1*z2*z3*z4, -t_g = @elapsed Gg = groebner_walk(I, lex(R), algorithm =:generic) + z0*z1*z2*z3*z4*z5*z6 - 1 +]) -t_p = @elapsed Gp = groebner_walk(I, lex(R), algorithm =:perturbed) +set_verbosity_level(:groebner_walk, 1) -t_f = @elapsed Gf = groebner_basis(I, ordering = lex(R), algorithm =:fglm) \ No newline at end of file +Gs = groebner_walk(I, lex(R), algorithm =:standard) +Gg = groebner_walk(I, lex(R), algorithm =:generic) \ No newline at end of file diff --git a/examples/zero-dimensional/finitefield.jl b/examples/zero-dimensional/finitefield.jl index dca8cbafce9e..a45bd6117f20 100644 --- a/examples/zero-dimensional/finitefield.jl +++ b/examples/zero-dimensional/finitefield.jl @@ -12,11 +12,6 @@ J = ideal(R, [ x2^2 + 2 * x1 * x3 + 2 * x2 * x4 - x3 ]) -t_init = @elapsed G = groebner_basis(J, ordering=degrevlex(R), complete_reduction=true) -t_b = @elapsed Gb = groebner_basis(J, ordering=lex(R), complete_reduction=true) #0.4s - t_s = @elapsed Gs = groebner_walk(J, lex(R), algorithm=:standard) #4.11 - t_g = @elapsed Gg = groebner_walk(J, lex(R), algorithm=:generic) #0.8s - -t_p = @elapsed Gp = groebner_walk(J, lex(R), algorithm=:perturbed) #0.33s +t_p = @elapsed Gp = groebner_walk(J, lex(R), algorithm=:perturbed) #0.33s \ No newline at end of file diff --git a/examples/zero-dimensional/katsura5.jl b/examples/zero-dimensional/katsura5.jl new file mode 100644 index 000000000000..f2897179406b --- /dev/null +++ b/examples/zero-dimensional/katsura5.jl @@ -0,0 +1,23 @@ + +using Oscar +using GroebnerWalk + +R, (x,y,z,t,u,v) = QQ[:x,:y,:z,:t,:u,:v] + +I = ideal([ + 2*x^2+2*y^2+2*z^2+2*t^2+2*u^2+v^2-v, + x*y+y*z+2*z*t+2*t*u+2*u*v-u, + 2*x*z+2*y*t+2*z*u+u^2+2*t*v-t, + 2*x*t+2*y*u+2*t*u+2*z*v-z, + t^2+2*x*v+2*y*v+2*z*v-y, + 2*x+2*y+2*z+2*t+2*u+v-1 +]) + +o_s = degrevlex(R) +o_t = lex(R) + +set_verbosity_level(:groebner_walk, 0) + +t_s = @elapsed Gs = groebner_walk(I, lex(R), algorithm=:standard) +t_g = @elapsed Gg = groebner_walk(I, lex(R), algorithm=:generic) +t_b = @elapsed Gb = groebner_basis(I, ordering=lex(R)) \ No newline at end of file diff --git a/src/generic_walk.jl b/src/generic_walk.jl index 675b794accc3..c97a1b95acb9 100644 --- a/src/generic_walk.jl +++ b/src/generic_walk.jl @@ -33,48 +33,20 @@ function generic_step(MG::MarkedGroebnerBasis, v::Vector{ZZRingElem}, ord::Monom ) H = MarkedGroebnerBasis(gens(H), leading_term.(H, ordering = ord)) - H = lift_generic(MG, H) + lift_generic!(H, MG) autoreduce!(H) return H end - -#= - ------ thesis example (chap3) -R, (x,y,z) = polynomial_ring(QQ, ["x","y","z"]) - -o_s = lex(R) - -o_t= weight_ordering([1,3,0], deglex(R)) -S = canonical_matrix(o_s) -T = canonical_matrix(o_t) - -I = ideal([x^2 + y*z, x*y + z^2]) -G = groebner_basis(I, ordering = o_s, complete_reduction = true) - -markedGB_generic_walk(G, o_s, o_t) - - -=# - - -#Auxiliary functions for the generic Gröbner walk, ordered by subroutine -#---------------------------------- - - -#------next_gamma (Goal: Get next facet normal along generic path) - -dropfirst(V::AbstractVector) = Iterators.drop(V, 1) @doc raw""" difference_lead_tail(MG::MarkedGroebnerBasis) Computes $a - b$ for $a$ a leading exponent and $b$ in the tail of some $g\in MG$. """ function difference_lead_tail(MG::MarkedGroebnerBasis) - (G,Lm) = gens(MG), markings(MG) + (G,Lm) = gens(MG), markings(MG) lead_exp = leading_exponent_vector.(Lm) v = zip(lead_exp, exponent_vectors.(G)) .|> splat((l, t) -> Ref(l).-t) @@ -120,7 +92,7 @@ function facet_initials(MG::MarkedGroebnerBasis, v::Vector{ZZRingElem}) inwG = Vector{MPolyRingElem}() ctx = MPolyBuildCtx(R) - for (i, (g, m)) in gens_and_markings(MG) |> enumerate + for (g, m) in gens_and_markings(MG) c, a = leading_coefficient_and_exponent(m) push_term!(ctx, c, a) @@ -147,7 +119,14 @@ function lift_generic(MG::MarkedGroebnerBasis, H::MarkedGroebnerBasis) H.gens[i] = H.gens[i] - normal_form(H.gens[i], MG) end return H - end +end + +function lift_generic!(H::MarkedGroebnerBasis, MG::MarkedGroebnerBasis) + for i in 1:length(H.gens) + H.gens[i] = H.gens[i] - normal_form(H.gens[i], MG) + end + return H +end @@ -229,7 +208,7 @@ function filter_lf(w::Vector{ZZRingElem}, start::MonomialOrdering, target::Monom Ref(w), V ) - + return unique!(V[skip_indices]) end From 41dfa19909e4e0528a1c396a5cb16e88abb3e09b Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Thu, 25 Apr 2024 01:09:03 +0200 Subject: [PATCH 080/179] Fix typo --- examples/implicitization/agk4.jl | 2 +- results.csv | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/examples/implicitization/agk4.jl b/examples/implicitization/agk4.jl index 597fe62e72a1..6efe09bdb2c2 100644 --- a/examples/implicitization/agk4.jl +++ b/examples/implicitization/agk4.jl @@ -16,4 +16,4 @@ I = ideal([ ]) set_verbosity_level(:groebner_walk, 1) -G = groebner_walk(I, o1, o2; algorithm=:standard) +G = groebner_walk(I, o2, o1; algorithm=:standard) diff --git a/results.csv b/results.csv index c1a87492c53b..716eedf50ad6 100644 --- a/results.csv +++ b/results.csv @@ -26,3 +26,5 @@ tran3.3-QQ,0.640738125,24.688099959,2323.13229425 tran3.3-Fp,0.254231917,14.402583584,0.003486333 newellp1-QQ,51.5992475,1529.494271334,811.051479458 newellp1-Fp,9.365612875,1140.743606416,0.165012125 +simple,1.149968916,0.25867925,2.5334e-5 +katsura6-QQ,0.813826709,35.404766583, \ No newline at end of file From d106debfcbdd7467731899dcb6d409fc232d7ef4 Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Thu, 25 Apr 2024 12:07:32 +0200 Subject: [PATCH 081/179] Clean up exports --- src/GroebnerWalk.jl | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/src/GroebnerWalk.jl b/src/GroebnerWalk.jl index d009255d8e9e..c25f47e65790 100644 --- a/src/GroebnerWalk.jl +++ b/src/GroebnerWalk.jl @@ -20,21 +20,7 @@ function weight_ordering(w::Vector{ZZRingElem}, o::MonomialOrdering) return MonomialOrdering(base_ring(o), MatrixOrdering(i, m, false))*o end -#weight_ordering(w::Vector{Int}, o::MonomialOrdering) = weight_ordering(ZZ.(w), o) - - export groebner_walk -export standard_walk - -export initial_form -export initial_forms - - - -export standard_step -export next_weight -export lift2 -export difference_lead_tail function __init__() add_verbosity_scope(:groebner_walk) From 98811716b23b8a1f3f556681940d5d3d8c620e8b Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Thu, 25 Apr 2024 12:08:35 +0200 Subject: [PATCH 082/179] Clean up benchmarks --- benchmark/benchmarks.jl | 38 ++++++++++++-------------------------- 1 file changed, 12 insertions(+), 26 deletions(-) diff --git a/benchmark/benchmarks.jl b/benchmark/benchmarks.jl index df7bd5494c8e..11c7a3f4b78d 100644 --- a/benchmark/benchmarks.jl +++ b/benchmark/benchmarks.jl @@ -16,14 +16,11 @@ function benchmark( start::MonomialOrdering ) print(io, name, ","); flush(io) - # t = @belapsed groebner_walk($I, $target, $start; algorithm=:standard) seconds=20000 samples=5 - t = @elapsed groebner_walk(I, target, start; algorithm=:standard) + t = @belapsed groebner_walk($I, $target, $start; algorithm=:standard) seconds=20000 samples=10 print(io, t, ","); flush(io) - # t = @belapsed groebner_walk($I, $target, $start; algorithm=:generic) seconds=20000 samples=5 - t = @elapsed groebner_walk(I, target, start; algorithm=:generic) + t = @belapsed groebner_walk($I, $target, $start; algorithm=:generic) seconds=20000 samples=10 print(io, t, ","); flush(io) - # t = @belapsed groebner_basis($I; ordering=$target) seconds=20000 samples=5 - t = @elapsed groebner_basis(I; ordering=target) + t = @belapsed groebner_basis($I; ordering=$target) seconds=20000 samples=10 println(io, t); flush(io) end @@ -34,35 +31,24 @@ open("results.csv", "a") do io I = ideal([y^4 + x^3 - x^2 + x, x^4]) benchmark(io, "simple", I, lex(R), default_ordering(R)) - # benchmark(io, "cyclic5-QQ", cyclic5(QQ)...) - # benchmark(io, "cyclic5-Fp", cyclic5(Fp)...) + benchmark(io, "cyclic5-QQ", cyclic5(QQ)...) + benchmark(io, "cyclic5-Fp", cyclic5(Fp)...) - # benchmark(io, "cyclic6-QQ", cyclic6(QQ)...) - # benchmark(io, "cyclic6-Fp", cyclic6(Fp)...) + benchmark(io, "cyclic6-QQ", cyclic6(QQ)...) + benchmark(io, "cyclic6-Fp", cyclic6(Fp)...) + + benchmark(io, "katsura6-QQ", katsura6(QQ)...) + benchmark(io, "katsura6-Fp", katsura6(Fp)...) - # benchmark(io, "cyclic7-QQ", cyclic7(QQ)...) - # benchmark(io, "cyclic7-Fp", cyclic7(Fp)...) + benchmark(io, "cyclic7-QQ", cyclic7(QQ)...) + benchmark(io, "cyclic7-Fp", cyclic7(Fp)...) benchmark(io, "agk4-QQ", agk4(QQ)...) benchmark(io, "agk4-Fp", agk4(Fp)...) - # benchmark(io, "katsura6-QQ", katsura6(QQ)...) - # benchmark(io, "katsura6-Fp", katsura6(Fp)...) - benchmark(io, "tran3.3-QQ", tran33(QQ)...) benchmark(io, "tran3.3-Fp", tran33(Fp)...) benchmark(io, "newellp1-QQ", newellp1(QQ)...) benchmark(io, "newellp1-Fp", newellp1(Fp)...) - - # R, (x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21, x22, x23, x24, x25, x26, x27, x28, x29, x30, x31, x32) = QQ[ - # :x1, :x2, :x3, :x4, :x5, :x6, :x7, :x8, :x9, :x10, :x11, :x12, :x13, :x14, :x15, :x16, :x17, :x18, :x19, :x20, :x21, :x22, :x23, :x24, :x25, :x26, :x27, :x28, :x29, :x30, :x31, :x32 - # ] - # F = [ - # -x23*x32+x24*x31, -x22*x32+x24*x30, -x22*x31+x23*x30, -x21*x32+x24*x29, -x21*x31+x23*x29, -x21*x30+x22*x29, -x12*x32+x16*x28, -x19*x28+x20*x27, - # -x11*x31+x15*x27, -x18*x28+x20*x26, -x18*x27+x19*x26, -x10*x30+x14*x26, -x17*x28+x20*x25, -x17*x27+x19*x25, -x17*x26+x18*x25, -x9*x29+x13*x25, x20*x8-x24*x4, - # -x17*x20-x17*x24-2*x17*x28-x17*x32+x18*x19+x18*x23+2*x18*x27+x18*x31+x19*x22+x19*x30-x20*x21-x20*x29-x21*x24-x21*x28-2*x21*x32+x22*x23+x22*x27+2*x22*x31+x23*x26-x24*x25-x25*x28-x25*x32+x26*x27+x26*x31+x27*x30-x28*x29-x29*x32+x30*x31, - # x19*x7-x23*x3, x18*x6-x2*x22, -x1*x21+x17*x5 - # ] - # benchmark(io, "bayes148", ideal(R, F), lex(R), default_ordering(R)) end \ No newline at end of file From fa49ac63fec92790422f8d0121bd3f56596c9b6e Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Thu, 25 Apr 2024 12:09:12 +0200 Subject: [PATCH 083/179] Change `_normal_form` to use `MPolyBuildCtx` --- src/markedGB.jl | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/markedGB.jl b/src/markedGB.jl index f0ba0b8a8338..fde543803979 100644 --- a/src/markedGB.jl +++ b/src/markedGB.jl @@ -65,8 +65,7 @@ function divides_walk(p::MPolyRingElem, lm::MPolyRingElem) end function _normal_form(p::MPolyRingElem, G::AbstractVector{<:MPolyRingElem}, mark::AbstractVector{<:MPolyRingElem}) - #queue = Set(terms(p)) - nf = zero(parent(p)) + nf = MPolyBuildCtx(parent(p)) MG = zip(G, mark) while !iszero(p) @@ -82,12 +81,12 @@ function _normal_form(p::MPolyRingElem, G::AbstractVector{<:MPolyRingElem}, mark end if !div - nf += m + push_term!(nf, leading_coefficient_and_exponent(m)...) p -= m end end - return nf + return finish(nf) end @doc raw""" From 070a8c881685d881b1e42d1c06b01c12238998d6 Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Thu, 25 Apr 2024 12:15:23 +0200 Subject: [PATCH 084/179] Remove unnecessary if condition --- src/markedGB.jl | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/src/markedGB.jl b/src/markedGB.jl index fde543803979..80b1332d0c56 100644 --- a/src/markedGB.jl +++ b/src/markedGB.jl @@ -96,17 +96,11 @@ Computes the normal form of `p` with respect to the marked reduced Gröbner basi """ normal_form(p::MPolyRingElem, MG::MarkedGroebnerBasis) = _normal_form(p, gens(MG), markings(MG)) -# Calculates whether the monomial x^g divides x^f -# divides(f::Vector{Int}, g::Vector{Int}) = all(g .<= f) - -#Given a markedGB MG, reduce it by replacing each g with its normal form w.r.t G\{g} -#NB: only works if MG is inclusion minimal -#In this case upon reduction, the markings are preserved -#Question: Can I eliminate the 'if' condition? probably @doc raw""" autoreduce(MG::MarkedGroebnerBasis) Given a marked Gröbner basis $MG$, reduce it by replacing each $g\in MG$ with its normal form $g^G$. +This method requires `MG` to be a inclusion-minimal Gröbner basis. """ function autoreduce(MG::MarkedGroebnerBasis) newgens = Vector{MPolyRingElem}() @@ -117,10 +111,11 @@ function autoreduce(MG::MarkedGroebnerBasis) rest = some_gens_with_markings(MG, 1:n .!= i) nf = _normal_form(g, rest...) - if !iszero(nf) + #Question: Can we eliminate the 'if' condition? + # if !iszero(nf) push!(newgens, nf) push!(newlm, mark) - end + # end end return MarkedGroebnerBasis(newgens, newlm) end @@ -136,9 +131,9 @@ function autoreduce!(MG::MarkedGroebnerBasis) rest = some_gens_with_markings(MG, 1:n .!= i) nf = _normal_form(g, rest...) - if !iszero(nf) + # if !iszero(nf) MG.gens[i] = nf - end + # end end end From 6ab19dc027dd8f1d930709429da073f912726a3c Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Thu, 25 Apr 2024 12:18:47 +0200 Subject: [PATCH 085/179] Add docstrings --- src/generic_walk.jl | 20 ++++++-------------- src/markedGB.jl | 31 ------------------------------- 2 files changed, 6 insertions(+), 45 deletions(-) diff --git a/src/generic_walk.jl b/src/generic_walk.jl index c97a1b95acb9..f61a0ab87484 100644 --- a/src/generic_walk.jl +++ b/src/generic_walk.jl @@ -127,21 +127,13 @@ function lift_generic!(H::MarkedGroebnerBasis, MG::MarkedGroebnerBasis) end return H end - - - -#-------------------------- - - - - -#helper functions +@doc raw""" + less_than_zero(M::ZZMatrix, v::Vector{ZZRingElem}) -#returns 'true' if Mv <_{lex} 0 , 'false' otherwise -# <_{lex} is the lexicographic ordering on Q^n -#with the notation from my thesis, this is equivalent to v <_M 0 -function new_less_than_zero(M::ZZMatrix, v::Vector{ZZRingElem}) +Checks whether $Mv <_{\mathrm{lex}} 0$. +""" +function less_than_zero(M::ZZMatrix, v::Vector{ZZRingElem}) if is_zero(v) return false else @@ -161,7 +153,7 @@ Computes all elements $v\in V$ with $0 <_{\texttt{target}} v$ and $v <_{\texttt{ """ function filter_by_ordering(start::MonomialOrdering, target::MonomialOrdering, V::Vector{Vector{ZZRingElem}}) pred = v -> ( - new_less_than_zero(canonical_matrix(target), ZZ.(v)) && !new_less_than_zero(canonical_matrix(start), ZZ.(v)) + less_than_zero(canonical_matrix(target), ZZ.(v)) && !less_than_zero(canonical_matrix(start), ZZ.(v)) ) return unique!(filter(pred, V)) end diff --git a/src/markedGB.jl b/src/markedGB.jl index 80b1332d0c56..b1759f5497cf 100644 --- a/src/markedGB.jl +++ b/src/markedGB.jl @@ -136,34 +136,3 @@ function autoreduce!(MG::MarkedGroebnerBasis) # end end end - -#= - -tests - -R, (x,y) = polynomial_ring(QQ, ["x","y"]) - -G = [x^3 + y^4 + y^6 + x*y^7, y^2 + 4*x^5 + x^2*y^7] -LM = [x*y^7, 4*x^5] -MG = markedGB(G, LM) -reductionalg(MG) -normal_form(x^5, MG) - -R, (x,y,z,w) = polynomial_ring(QQ, ["x","y","z","w"]) -G = [x-2*y-z-w, z+3*w] -lm = [x, z] -MG = markedGB(G, lm) -p = w -normal_form(p, MG) -normal_form(x, MG) - - -KK = GF(19) -R, (x,y) = polynomial_ring(KK, ["x", "y"]) -G = [x^2 + y^2, y] -Lm = [x^2, y] -MG = markedGB(G, Lm) -MG = reductionalg(MG) -normal_form(x^3 - 1, MG) -=# - From 3fbd844f86d50e1fd85e412a60939c80e7b4bbf6 Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Thu, 25 Apr 2024 12:19:28 +0200 Subject: [PATCH 086/179] Clean up --- src/standard_walk.jl | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/src/standard_walk.jl b/src/standard_walk.jl index 4914f528d198..d87fa866f64b 100644 --- a/src/standard_walk.jl +++ b/src/standard_walk.jl @@ -66,16 +66,6 @@ end # The standard step is used for the strategies standard and perturbed. ############################################################### -@doc raw""" - standard_step(G::Oscar.IdealGens, w::Vector{ZZRingElem}, target::MonomialOrdering) - -TODO - -# Arguments -- `G::Oscar.IdealGens`: Groebner basis of an ideal. -- `w::Vector{ZZRingElem}`: TODO -- `target::MonomialOrdering`: TODO -""" function standard_step(G::Oscar.IdealGens, w::Vector{ZZRingElem}, target::MonomialOrdering) current_ordering = ordering(G) next = weight_ordering(w, target) @@ -175,20 +165,6 @@ function bounding_vectors(I::Oscar.IdealGens) return unique!(reduce(vcat, v)) end -# TODO: Actual docstring -#= Lifting step from Proposition 3.2 of "The generic Gröbner walk" (Fukuda et al., 2005) - - Input: - G , the reduced G.B of I w.r.t current - - current, the current monomial order - - H, the reduced G.B of inw(I) w.r.t the next weight vector w - - target, the next monomial order - - Output: - an inclusion minimal G.B of target obtained by subtracting normal forms - - QUESTION: why do we need "target" in Oscar.IdealGens(...)? - - COMMENT: I think "target" is inappropriately named. It is rather "next_ordering" (i.e the target order, refined by w) -=# @doc raw""" lift( G::Oscar.IdealGens, # momentane GB From 3237404dc22ff070bd7e4669a9fe43242130b2b0 Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Thu, 25 Apr 2024 14:16:26 +0200 Subject: [PATCH 087/179] Add DOI to README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 81e0132ec5ab..a0762806e7d4 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # Gröbner walk +![https://zenodo.org/badge/DOI/10.5281/zenodo.11065978.svg](https://doi.org/10.5281/zenodo.11065978) + GroebnerWalk.jl is a Julia package providing implementations of Gröbner walk algorithms for computing Gröbner bases over fields on top of Oscar.jl. From 643044770528c8addb9540ea3605556a3d2b9020 Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Thu, 25 Apr 2024 14:18:01 +0200 Subject: [PATCH 088/179] Add DOI to README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a0762806e7d4..d18349acd3d1 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Gröbner walk -![https://zenodo.org/badge/DOI/10.5281/zenodo.11065978.svg](https://doi.org/10.5281/zenodo.11065978) +[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.11065978.svg)](https://doi.org/10.5281/zenodo.11065978) GroebnerWalk.jl is a Julia package providing implementations of Gröbner walk algorithms for computing Gröbner bases over fields on top of Oscar.jl. From e5709d6a70c536ed0d9038f8aff4302cf8ee853d Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Thu, 25 Apr 2024 15:21:03 +0200 Subject: [PATCH 089/179] Bump version number --- Project.toml | 2 +- README.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Project.toml b/Project.toml index 6608daee9f00..ba2cd51f3db7 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "GroebnerWalk" uuid = "6dc8777d-2b0c-4de5-9e3c-426c1820f6f9" authors = ["Kamillo Ferry ", "Francesco Nowell "] -version = "0.1.0" +version = "1.0.0" [deps] Oscar = "f1435218-dba5-11e9-1e4d-f1a5fab5fc13" diff --git a/README.md b/README.md index d18349acd3d1..d032e1df17b4 100644 --- a/README.md +++ b/README.md @@ -25,9 +25,9 @@ groebner_walk(I, lex(R)) # compute the Groebner basis ``` ## Status -This repository represents the status of the code as a submission for MEGA 2024. +This repository represents the status of the code as a submission for MEGA 2024. It is slated for inclusion into OSCAR as experimental package. + At the moment, the standard walk by Collart, Kalkbrener and Mall (1997) and the generic walk by Fukuda et al. are implemented. -It is slated for inclusion into OSCAR as experimental package. ## Contacts The library is maintained by Kamillo Ferry (kafe (at) kafe (dot) dev) and Francesco Nowell (francesconowell (at) gmail (dot) com). From 735c0241d41b1fb564dfde21a122f2f00ba53e96 Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Wed, 29 May 2024 18:12:44 +0200 Subject: [PATCH 090/179] Change default perturbation degree to n --- src/walk.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/walk.jl b/src/walk.jl index 409f073df4f2..327e5574dd61 100644 --- a/src/walk.jl +++ b/src/walk.jl @@ -87,7 +87,7 @@ function groebner_walk( I::MPolyIdeal, target::MonomialOrdering = lex(base_ring(I)), start::MonomialOrdering = default_ordering(base_ring(I)); - perturbation_degree = 2, + perturbation_degree = length(gens(base_ring(I))), # meaning, n=#gens(R) algorithm::Symbol = :standard ) if algorithm == :standard @@ -866,4 +866,4 @@ function lift2( ) return G -end \ No newline at end of file +end From b1b033e96f5b237a5c0ce5b4a5271bb10fa9819d Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Wed, 29 May 2024 18:16:34 +0200 Subject: [PATCH 091/179] Fix perturbed walk, it actually perturbs now --- src/perturbed_walk.jl | 22 ++++++++-------------- src/standard_walk.jl | 12 ++++++++++-- 2 files changed, 18 insertions(+), 16 deletions(-) diff --git a/src/perturbed_walk.jl b/src/perturbed_walk.jl index 9df7dc151c9c..735fa0aef869 100644 --- a/src/perturbed_walk.jl +++ b/src/perturbed_walk.jl @@ -24,35 +24,29 @@ function perturbed_walk( target_weight = perturbed_vector(G, T, p) next_target = matrix_ordering(R, add_weight_vector(target_weight, T)) - G = standard_walk(G, next_target, current_weight, target_weight) + G = standard_walk(Oscar.IdealGens, G, next_target, current_weight, target_weight) p = p - 1 current_weight = target_weight S = next_target end - return G + return gens(G) end perturbed_walk(G::Oscar.IdealGens, S::Matrix{Int}, T::Matrix{Int}, p::Int) = perturbed_walk(G, matrix_ordering(base_ring(G), S), matrix_ordering(base_ring(G), T), p) # computes a p-perturbed vector from the matrix M. +# TODO: Docstring, citation of perturbation (Tran 2000, Thm. 3.1) function perturbed_vector(G::Oscar.IdealGens, M::ZZMatrix, p::Int) n = size(M, 1) rows = [M[i, :] for i in 1:p] - m = maximum.(Ref(abs), rows) - m_sum = sum(m[2:end]) - max_deg = maximum(total_degree.(G)) # TODO: I think this is total degree + m = maximum.(Ref(abs), rows) |> maximum + max_deg = maximum(total_degree.(G)) + e = max_deg * m + 1 - e = max_deg * m_sum + 1 - - w = M[1, :] * e^(p - 1) - for i in 2:p - w += e^(p - i) * M[i, :] - end - - w = sum(rows .* (p .- Vector(1:p))) + w = sum(row * e^(p-i) for (i,row) in enumerate(rows)) return convert_bounding_vector(w) -end \ No newline at end of file +end diff --git a/src/standard_walk.jl b/src/standard_walk.jl index d87fa866f64b..d0901e8aca8a 100644 --- a/src/standard_walk.jl +++ b/src/standard_walk.jl @@ -36,6 +36,7 @@ using the algorithm proposed by Collart, Kalkbrener & Mall (1997). - `target_weight::Vector{ZZRingElem}`: weight vector representing the target weight. """ function standard_walk( + ::Type{Oscar.IdealGens}, G::Oscar.IdealGens, target::MonomialOrdering, current_weight::Vector{ZZRingElem}, @@ -59,9 +60,16 @@ function standard_walk( @vprint :groebner_walk "Cones crossed: " @vprintln :groebner_walk steps - return gens(G) + return G end +standard_walk( + G::Oscar.IdealGens, + target::MonomialOrdering, + current_weight::Vector{ZZRingElem}, + target_weight::Vector{ZZRingElem}; + ) = gens(standard_walk(Oscar.IdealGens, G, target, current_weight, target_weight)) + ############################################################### # The standard step is used for the strategies standard and perturbed. ############################################################### @@ -197,4 +205,4 @@ function lift( ) return G -end \ No newline at end of file +end From 534dc01092554d8aab43a1288ed1e0d60b02aef2 Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Wed, 29 May 2024 18:23:17 +0200 Subject: [PATCH 092/179] Change some argument types --- src/perturbed_walk.jl | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/perturbed_walk.jl b/src/perturbed_walk.jl index 735fa0aef869..ce19e0d82949 100644 --- a/src/perturbed_walk.jl +++ b/src/perturbed_walk.jl @@ -34,7 +34,12 @@ function perturbed_walk( return gens(G) end -perturbed_walk(G::Oscar.IdealGens, S::Matrix{Int}, T::Matrix{Int}, p::Int) = perturbed_walk(G, matrix_ordering(base_ring(G), S), matrix_ordering(base_ring(G), T), p) +perturbed_walk( + G::Oscar.IdealGens, + S::ZZMatrix, + T::ZZMatrix, + p::Int + ) = perturbed_walk(G, matrix_ordering(base_ring(G), S), matrix_ordering(base_ring(G), T), p) # computes a p-perturbed vector from the matrix M. # TODO: Docstring, citation of perturbation (Tran 2000, Thm. 3.1) From 4dfe318ee978399f1845c4a98dd9b345564146ff Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Wed, 29 May 2024 18:48:22 +0200 Subject: [PATCH 093/179] Autoreduce returns a Groebner basis --- src/walk.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/walk.jl b/src/walk.jl index 327e5574dd61..5363986ce38f 100644 --- a/src/walk.jl +++ b/src/walk.jl @@ -662,6 +662,7 @@ end # converts a vector wtemp by dividing the entries with gcd(wtemp). convert_bounding_vector(w::Vector{T}) where {T<:Union{ZZRingElem, QQFieldElem}} = ZZ.(floor.(w//gcd(w))) +# TODO: This comment is factually not correct, it's just the weight ordering of a matrix ordering # returns a copy of the PolynomialRing I, equipped with the ordering weight_ordering(cw)*matrix_ordering(T). create_ordering(R::MPolyRing, cw::Vector{L}, T::Matrix{Int}) where {L<:Number} = weight_ordering(cw, matrix_ordering(R, T)) @@ -672,13 +673,12 @@ create_ordering(R::MPolyRing, cw::Vector{L}, T::Matrix{Int}) where {L<:Number} = function autoreduce(G::Oscar.IdealGens) generators = collect(gens(G)) - I = 0 for i in 1:length(gens(G)) generators[i] = reduce( generators[i], generators[1:end .!= i]; ordering=G.ord, complete_reduction=true ) end - return Oscar.IdealGens(generators, G.ord) + return Oscar.IdealGens(generators, G.ord; isGB=true) end ############################################# From 751243759e9fb64a42245564fb32713fc57008cb Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Wed, 29 May 2024 22:03:24 +0200 Subject: [PATCH 094/179] Add some diagnostics printing to standard_walk --- src/standard_walk.jl | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/src/standard_walk.jl b/src/standard_walk.jl index d0901e8aca8a..aef9cbf46f46 100644 --- a/src/standard_walk.jl +++ b/src/standard_walk.jl @@ -48,13 +48,14 @@ function standard_walk( @v_do :groebner_walk steps = 0 while current_weight != target_weight + @vprintln :groebner_walk current_weight G = standard_step(G, current_weight, target) current_weight = next_weight(G, current_weight, target_weight) @v_do :groebner_walk steps += 1 - @vprintln :groebner_walk current_weight @vprintln :groebner_walk 2 G + @vprintln :groebner_walk 2 "=======" end @vprint :groebner_walk "Cones crossed: " @@ -68,7 +69,7 @@ standard_walk( target::MonomialOrdering, current_weight::Vector{ZZRingElem}, target_weight::Vector{ZZRingElem}; - ) = gens(standard_walk(Oscar.IdealGens, G, target, current_weight, target_weight)) +) = gens(standard_walk(Oscar.IdealGens, G, target, current_weight, target_weight)) ############################################################### # The standard step is used for the strategies standard and perturbed. @@ -79,12 +80,14 @@ function standard_step(G::Oscar.IdealGens, w::Vector{ZZRingElem}, target::Monomi next = weight_ordering(w, target) Gw = ideal(initial_forms(G, w)) + @vprint :groebner_walk 3 "GB of initial forms: " + @vprintln :groebner_walk 3 Gw H = groebner_basis(Gw; ordering=next, complete_reduction=true) H = lift(G, current_ordering, H, next) - @vprintln :groebner_walk 3 Gw - @vprintln :groebner_walk 3 H + @vprint :groebner_walk 10 "Lifted GB of initial forms: " + @vprintln :groebner_walk 10 H return autoreduce(H) end @@ -118,7 +121,7 @@ function initial_form(f::MPolyRingElem, w::Vector{ZZRingElem}) end @doc raw""" - initial_form(G::Oscar.IdealGens, w::Vector{ZZRingElem}) + initial_forms(G::Oscar.IdealGens, w::Vector{ZZRingElem}) Returns the initial form of each element in `G` with respect to the weight vector `w`. """ @@ -138,12 +141,16 @@ as described in Algorithm 5.2 on pg. 437 of "Using algebraic geometry" (Cox, Lit """ function next_weight(G::Oscar.IdealGens, current::Vector{ZZRingElem}, target::Vector{ZZRingElem}) V = bounding_vectors(G) + @vprint :groebner_walk 5 "Bounding vectors: " + @vprintln :groebner_walk 5 V + C = dot.(Ref(current), V) T = dot.(Ref(target), V) tmin = minimum(c//(c-t) for (c,t) in zip(C,T) if t<0; init=1) - @vprintln :groebner_walk 3 (QQ.(current) + tmin * QQ.(target-current)) + @vprint :groebner_walk 5 "Next rational weights: " + @vprintln :groebner_walk 5 (QQ.(current) + tmin * QQ.(target-current)) result = QQ.(current) + tmin * QQ.(target-current) if !iszero(result) From 06712c8ac508d736e9c743e1c20f30d455cf955b Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Wed, 29 May 2024 22:03:56 +0200 Subject: [PATCH 095/179] Add perturbed_walk to benchmarks --- benchmark/benchmarks.jl | 8 +++++- results.csv | 60 ++++++++++++++++++++--------------------- src/standard_walk.jl | 3 --- 3 files changed, 37 insertions(+), 34 deletions(-) diff --git a/benchmark/benchmarks.jl b/benchmark/benchmarks.jl index 11c7a3f4b78d..319cda48ce5f 100644 --- a/benchmark/benchmarks.jl +++ b/benchmark/benchmarks.jl @@ -20,10 +20,16 @@ function benchmark( print(io, t, ","); flush(io) t = @belapsed groebner_walk($I, $target, $start; algorithm=:generic) seconds=20000 samples=10 print(io, t, ","); flush(io) + t = @belapsed groebner_walk($I, $target, $start; algorithm=:perturbed) seconds=20000 samples=10 + print(io, t, ","); flush(io) t = @belapsed groebner_basis($I; ordering=$target) seconds=20000 samples=10 println(io, t); flush(io) end +function print_header(io) + print(io, "name,standard_walk,generic_walk,perturbed_walk,buchberger\n") +end + p = 11863279 Fp = GF(p) open("results.csv", "a") do io @@ -51,4 +57,4 @@ open("results.csv", "a") do io benchmark(io, "newellp1-QQ", newellp1(QQ)...) benchmark(io, "newellp1-Fp", newellp1(Fp)...) -end \ No newline at end of file +end diff --git a/results.csv b/results.csv index 716eedf50ad6..2e9e2a2edc1a 100644 --- a/results.csv +++ b/results.csv @@ -1,30 +1,30 @@ -name,standard_walk,generic_walk,buchberger -simple,0.002634119,0.001080056,4.670857142857143e-6 -simple,0.00262981,0.001087529,4.621e-6 -simple,0.000623,0.000195084,3.0837068965517243e-7 -cyclic5-QQ,0.01911975,0.110495292,8.884516129032258e-7 -cyclic5-Fp,0.01191775,0.251762958,8.766274509803922e-7 -simple,0.000620541,0.000199625,3.2019369369369374e-7 -cyclic5-QQ,0.019888625,0.116872417,8.674242424242424e-7 -cyclic5-Fp,0.01215325,0.268002959,8.661276595744681e-7 -cyclic7-Fp,36.670678,, -simple,0.000641,0.000202875,3.0515983606557375e-7 -cyclic5-QQ,0.020051542,0.117901583,8.731739130434783e-7 -cyclic5-Fp,0.013118917,0.261012125,8.7975e-7 -cyclic6-QQ,0.356129125,5.922552333,1.1916e-6 -cyclic6-Fp,0.130183917,11.620150625,1.15e-6 -simple,0.000753417,0.000253458,4.2939408866995077e-7 -simple,0.000753125,0.000237833,4.0463111111111113e-7 -simple,1.183723958,0.269548625,2.2375e-5 -agk4-QQ,10.771205958,55.705554,527.126850292 -agk4-Fp,3.302066417,49.991833833,0.095817208 -katsura6-QQ,1.003294291,35.098429459, -simple,1.422464625,0.274453459,2.475e-5 -agk4-QQ,11.076574625,55.562715875,543.319831 -agk4-Fp,3.492181375,51.427781875,0.094963834 -tran3.3-QQ,0.640738125,24.688099959,2323.13229425 -tran3.3-Fp,0.254231917,14.402583584,0.003486333 -newellp1-QQ,51.5992475,1529.494271334,811.051479458 -newellp1-Fp,9.365612875,1140.743606416,0.165012125 -simple,1.149968916,0.25867925,2.5334e-5 -katsura6-QQ,0.813826709,35.404766583, \ No newline at end of file +name,standard_walk,generic_walk,perturbed_walk,buchberger +simple,0.002634119,0.001080056,,4.670857142857143e-6 +simple,0.00262981,0.001087529,,4.621e-6 +simple,0.000623,0.000195084,,3.0837068965517243e-7 +cyclic5-QQ,0.01911975,0.110495292,,8.884516129032258e-7 +cyclic5-Fp,0.01191775,0.251762958,,8.766274509803922e-7 +simple,0.000620541,0.000199625,,3.2019369369369374e-7 +cyclic5-QQ,0.019888625,0.116872417,,8.674242424242424e-7 +cyclic5-Fp,0.01215325,0.268002959,,8.661276595744681e-7 +cyclic7-Fp,36.670678,,, +simple,0.000641,0.000202875,,3.0515983606557375e-7 +cyclic5-QQ,0.020051542,0.117901583,,8.731739130434783e-7 +cyclic5-Fp,0.013118917,0.261012125,,8.7975e-7 +cyclic6-QQ,0.356129125,5.922552333,,1.1916e-6 +cyclic6-Fp,0.130183917,11.620150625,,1.15e-6 +simple,0.000753417,0.000253458,,4.2939408866995077e-7 +simple,0.000753125,0.000237833,,4.0463111111111113e-7 +simple,1.183723958,0.269548625,,2.2375e-5 +agk4-QQ,10.771205958,55.705554,,527.126850292 +agk4-Fp,3.302066417,49.991833833,,0.095817208 +katsura6-QQ,1.003294291,,35.098429459, +simple,1.422464625,0.274453459,,2.475e-5 +agk4-QQ,11.076574625,55.562715875,,543.319831 +agk4-Fp,3.492181375,51.427781875,,0.094963834 +tran3.3-QQ,0.640738125,24.688099959,,2323.13229425 +tran3.3-Fp,0.254231917,14.402583584,,0.003486333 +newellp1-QQ,51.5992475,1529.494271334,,811.051479458 +newellp1-Fp,9.365612875,1140.743606416,,0.165012125 +simple,1.149968916,0.25867925,,2.5334e-5 +katsura6-QQ,0.813826709,35.404766583,, diff --git a/src/standard_walk.jl b/src/standard_walk.jl index aef9cbf46f46..b37814758ed1 100644 --- a/src/standard_walk.jl +++ b/src/standard_walk.jl @@ -1,6 +1,3 @@ -############################################################### -# Implementation of the standard walk. -############################################################### @doc raw""" standard_walk(G::Oscar.IdealGens, start::MonomialOrdering, target::MonomialOrdering) From 4ffb2e4eef56a883dc3d1b41acdcff766bba69f1 Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Wed, 29 May 2024 22:22:10 +0200 Subject: [PATCH 096/179] Add diagnostic printing to generic_walk --- src/generic_walk.jl | 34 ++++++++++++++++++++++++++++++---- 1 file changed, 30 insertions(+), 4 deletions(-) diff --git a/src/generic_walk.jl b/src/generic_walk.jl index f61a0ab87484..0e1af15f6612 100644 --- a/src/generic_walk.jl +++ b/src/generic_walk.jl @@ -1,3 +1,14 @@ +@doc raw""" + generic_walk(G::Oscar.IdealGens, start::MonomialOrdering, target::MonomialOrdering) + +Compute a reduced Groebner basis w.r.t. to a monomial order by converting it using the Groebner Walk +using the algorithm proposed by Collart, Kalkbrener & Mall (1997). + +# Arguments +- `G::Oscar.IdealGens`: Groebner basis of an ideal with respect to a starting monomial order. +- `target::MonomialOrdering`: monomial order one wants to compute a Groebner basis for. +- `start::MonomialOrdering`: monomial order to begin the conversion. +""" function generic_walk(G::Oscar.IdealGens, start::MonomialOrdering, target::MonomialOrdering) @vprintln :groebner_walk "Results for generic_walk" @vprintln :groebner_walk "Facets crossed for: " @@ -8,12 +19,13 @@ function generic_walk(G::Oscar.IdealGens, start::MonomialOrdering, target::Monom @v_do :groebner_walk steps = 0 while !isempty(v) + @vprintln :groebner_walk v MG = generic_step(MG, v, target) v = next_gamma(MG, v, start, target) @v_do :groebner_walk steps += 1 - @vprintln :groebner_walk v @vprintln :groebner_walk 2 G + @vprintln :groebner_walk 2 "=======" end @vprint :groebner_walk "Cones crossed: " @@ -32,7 +44,13 @@ function generic_step(MG::MarkedGroebnerBasis, v::Vector{ZZRingElem}, ord::Monom ideal(facet_Generators); ordering=ord, complete_reduction=true, algorithm=:buchberger ) - H = MarkedGroebnerBasis(gens(H), leading_term.(H, ordering = ord)) + @vprint :groebner_walk 5 "Initials forms of facet: " + @vprintln :groebner_walk 5 facet_Generators + + @vprint :groebner_walk 3 "GB of initial forms: " + @vprintln :groebner_walk 3 H + + H = MarkedGroebnerBasis(gens(H), leading_term.(H; ordering = ord)) lift_generic!(H, MG) autoreduce!(H) @@ -49,7 +67,8 @@ function difference_lead_tail(MG::MarkedGroebnerBasis) (G,Lm) = gens(MG), markings(MG) lead_exp = leading_exponent_vector.(Lm) - v = zip(lead_exp, exponent_vectors.(G)) .|> splat((l, t) -> Ref(l).-t) + #v = zip(lead_exp, exponent_vectors.(G)) .|> splat((l, t) -> Ref(l).-t) + v = [ [l-t for t in T] for (l, T) in zip(lead_exp, exponent_vectors.(G)) ] return [ZZ.(v)./ZZ(gcd(v)) for v in unique!(reduce(vcat, v)) if !iszero(v)] end @@ -121,6 +140,13 @@ function lift_generic(MG::MarkedGroebnerBasis, H::MarkedGroebnerBasis) return H end +@doc raw""" + lift_generic(MG::MarkedGroebnerBasis, H::MarkedGroebnerBasis) + +Given a marked Gröbner basis `MG` generating an ideal $I$ and a reduced marked Gröbner basis `H` of initial forms, +lift H to a marked Gröbner basis of I (with unknown ordering) by subtracting initial forms according to Fukuda, 2007. +This changes `H` in-place. +""" function lift_generic!(H::MarkedGroebnerBasis, MG::MarkedGroebnerBasis) for i in 1:length(H.gens) H.gens[i] = H.gens[i] - normal_form(H.gens[i], MG) @@ -216,4 +242,4 @@ function is_parallel(u::Vector{ZZRingElem}, v::Vector{ZZRingElem}) return !iszero(v) && !iszero(u) && u./gcd(u) == v./gcd(v) end -#TODO: add tests \ No newline at end of file +#TODO: add tests From 8058a40bd6a7d0ddb9b82daba7de1f7443084040 Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Wed, 29 May 2024 22:55:42 +0200 Subject: [PATCH 097/179] Add diagnostic printing to perturbed_walk --- src/perturbed_walk.jl | 42 ++++++++++++++++++++++++++++++++++-------- 1 file changed, 34 insertions(+), 8 deletions(-) diff --git a/src/perturbed_walk.jl b/src/perturbed_walk.jl index ce19e0d82949..a1160ee57cf6 100644 --- a/src/perturbed_walk.jl +++ b/src/perturbed_walk.jl @@ -1,14 +1,22 @@ -############################################################### -# Perturbed-version of the Groebner Walk. -############################################################### +@doc raw""" + perturbed_walk(G::Oscar.IdealGens, start::MonomialOrdering, target::MonomialOrdering, p::Int) +Compute a reduced Groebner basis w.r.t. to a monomial order by converting it using +the Groebner Walk with the algorithm proposed by TODO: reference. + +# Arguments +- `G::Oscar.IdealGens`: Groebner basis of an ideal with respect to a starting monomial order. +- `target::MonomialOrdering`: monomial order one wants to compute a Groebner basis for. +- `start::MonomialOrdering`: monomial order to begin the conversion. +- `p::Int`: degree of perturbation +""" function perturbed_walk( G::Oscar.IdealGens, start::MonomialOrdering, target::MonomialOrdering, p::Int ) - @vprintln :groebner_walk "perturbed_walk results" + @vprintln :groebner_walk "Results for perturbed_walk" @vprintln :groebner_walk "Crossed Cones in: " R = base_ring(G) @@ -20,15 +28,19 @@ function perturbed_walk( while !same_cone(G, target) # @v_do :groebner_walk steps += 1 @vprintln :groebner_walk current_weight - @vprintln :groebner_walk 2 G + @vprintln :groebner_walk 2 "Next matrix for monomial order:" + @vprintln :groebner_walk 2 S target_weight = perturbed_vector(G, T, p) next_target = matrix_ordering(R, add_weight_vector(target_weight, T)) G = standard_walk(Oscar.IdealGens, G, next_target, current_weight, target_weight) + @vprintln :groebner_walk 2 G + @vprintln :groebner_walk "=======" + p = p - 1 current_weight = target_weight - S = next_target + S = next_target #TODO: Is this actually used? S never appears in this loop end return gens(G) @@ -41,17 +53,31 @@ perturbed_walk( p::Int ) = perturbed_walk(G, matrix_ordering(base_ring(G), S), matrix_ordering(base_ring(G), T), p) -# computes a p-perturbed vector from the matrix M. -# TODO: Docstring, citation of perturbation (Tran 2000, Thm. 3.1) +@doc raw""" + perturbed_vector(G::Oscar.IdealGens, M::ZZMatrix, p::Int) + +Computes a perturbed vector using a matrix `M` representing some monomial order +for one iteration of the Groebner walk according to Tran (2000), Thm. 3.1. + +# Arguments +- `G::Oscar.IdealGens`: Groebner basis of an ideal with respect to a starting monomial order. +- `M::ZZMatrix`: matrix representing a monomial order +- `p::Int`: number of rows of `M` to use for the perturbation +""" function perturbed_vector(G::Oscar.IdealGens, M::ZZMatrix, p::Int) n = size(M, 1) rows = [M[i, :] for i in 1:p] + # Calculate upper degree bound for the target Groebner basis m = maximum.(Ref(abs), rows) |> maximum max_deg = maximum(total_degree.(G)) e = max_deg * m + 1 + @vprint :groebner_walk 5 "Upper degree bound: " + @vprintln :groebner_walk 5 e w = sum(row * e^(p-i) for (i,row) in enumerate(rows)) + @vprint :groebner_walk 3 "Perturbed vector: " + @vprintln :groebner_walk 3 w return convert_bounding_vector(w) end From 73e7cda42fc503a23b1b6b4fbe54029905322f5a Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Mon, 3 Jun 2024 15:46:17 +0200 Subject: [PATCH 098/179] Remove redundant assignment --- src/perturbed_walk.jl | 1 - 1 file changed, 1 deletion(-) diff --git a/src/perturbed_walk.jl b/src/perturbed_walk.jl index a1160ee57cf6..84be94216167 100644 --- a/src/perturbed_walk.jl +++ b/src/perturbed_walk.jl @@ -40,7 +40,6 @@ function perturbed_walk( p = p - 1 current_weight = target_weight - S = next_target #TODO: Is this actually used? S never appears in this loop end return gens(G) From 2adc1d343eee68c13e5acd6a6171bcceae95a254 Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Mon, 3 Jun 2024 16:07:07 +0200 Subject: [PATCH 099/179] Rename walk.jl to common.jl and clean up --- src/common.jl | 148 +++++++++ src/walk.jl | 869 -------------------------------------------------- 2 files changed, 148 insertions(+), 869 deletions(-) create mode 100644 src/common.jl delete mode 100644 src/walk.jl diff --git a/src/common.jl b/src/common.jl new file mode 100644 index 000000000000..adb03b9e47d7 --- /dev/null +++ b/src/common.jl @@ -0,0 +1,148 @@ + +@doc raw""" + groebner_walk( + I::MPolyIdeal, + target::MonomialOrdering = lex(base_ring(I)), + start::MonomialOrdering = default_ordering(base_ring(I)); + perturbation_degree = 2, + algorithm::Symbol = :standard + ) + +Compute a reduced Groebner basis w.r.t. to a monomial order by converting it using the Groebner Walk. +The Groebner Walk is proposed by Collart, Kalkbrener & Mall (1997). +One can choose a strategy of: +- Standard Walk (:standard) computes the Walk like as presented in Cox, Little & O'Shea (2005). +- Generic Walk (:generic) computes the Walk as presented in Fukuda, Jensen, Lauritzen & Thomas (2005). +- Perturbed Walk (:perturbed, with p = degree of the perturbation) computes the Walk as presented in Amrhein, Gloor & Küchlin (1997). + +# Arguments +- `I::MPolyIdeal`: ideal one wants to compute a Groebner basis for. +- `target::MonomialOrdering=:lex`: monomial order one wants to compute a Groebner basis for. +- `start::MonomialOrdering=:degrevlex`: monomial order to begin the conversion. +- `perturbationDegree::Int=2`: the perturbation degree for the perturbed Walk. +- `algorithm::Symbol=standard`: strategy of the Groebner Walk. One can choose between: + - `standard`: Standard Walk, + - `generic`: Generic Walk, + - `perturbed`: Perturbed Walk, + +# Examples + +```jldoctest +julia> R,(x,y) = polynomial_ring(QQ, ["x","y"]); + +julia> I = ideal([y^4+ x^3-x^2+x,x^4]); + +julia> groebner_walk(I, lex(R)) +Gröbner basis with elements +1 -> x + y^12 - y^8 + y^4 +2 -> y^16 +with respect to the ordering +lex([x, y]) + +julia> groebner_walk(I, lex(R); algorithm=:perturbed) +Gröbner basis with elements +1 -> x + y^12 - y^8 + y^4 +2 -> y^16 +with respect to the ordering +lex([x, y]) + +julia> julia> set_verbosity_level(:groebner_walk, 1); +julia> groebner_walk(I, lex(R)) +Results for standard_walk +Crossed Cones in: +ZZRingElem[4, 3] +ZZRingElem[4, 1] +ZZRingElem[12, 1] +ZZRingElem[1, 0] +Cones crossed: 4 +Gröbner basis with elements +1 -> x + y^12 - y^8 + y^4 +2 -> y^16 +with respect to the ordering +lex([x, y]) + +julia> groebner_walk(I, lex(R); algorithm=:perturbed) +perturbed_walk results +Crossed Cones in: +[4, 3] +[4, 1] +[5, 1] +[12, 1] +[1, 0] +Cones crossed: 5 +Gröbner basis with elements +1 -> y^16 +2 -> x + y^12 - y^8 + y^4 +with respect to the ordering +matrix_ordering([x, y], [1 0; 0 1]) +``` +""" +function groebner_walk( + I::MPolyIdeal, + target::MonomialOrdering = lex(base_ring(I)), + start::MonomialOrdering = default_ordering(base_ring(I)); + perturbation_degree = length(gens(base_ring(I))), # meaning, n=#gens(R) + algorithm::Symbol = :standard +) + if algorithm == :standard + walk = (x) -> standard_walk(x, target) + elseif algorithm == :generic + walk = (x) -> generic_walk(x, start, target) + elseif algorithm == :perturbed + walk = (x) -> perturbed_walk(x, start, target, perturbation_degree) + else + throw(NotImplementedError(:groebner_walk, algorithm)) + end + + Gb = groebner_basis(I; ordering=start, complete_reduction=true) + Gb = walk(Gb) + + return Oscar.IdealGens(Gb, target; isGB=true) +end + +exponent_vectors = f->leading_exponent_vector.(monomials(f)) + +function weight_ordering(w::Vector{ZZRingElem}, o::MonomialOrdering) + i = _support_indices(o.o) + m = ZZMatrix(1, length(w), w) + return MonomialOrdering(base_ring(o), MatrixOrdering(i, m, false))*o +end + +# returns 'true' if the leading terms of G w.r.t the matrixordering T are the same as the leading terms of G with the current ordering. +same_cone(G::Oscar.IdealGens, T::MonomialOrdering) = all(leading_term.(G; ordering=T) .== leading_term.(G; ordering=ordering(G))) + +# converts a vector wtemp by dividing the entries with gcd(wtemp). +convert_bounding_vector(w::Vector{T}) where {T<:Union{ZZRingElem, QQFieldElem}} = ZZ.(floor.(w//gcd(w))) + +# TODO: This comment is factually not correct, it's just the weight ordering of a matrix ordering +# returns a copy of the PolynomialRing I, equipped with the ordering weight_ordering(cw)*matrix_ordering(T). +create_ordering(R::MPolyRing, cw::Vector{L}, T::Matrix{Int}) where {L<:Number} = weight_ordering(cw, matrix_ordering(R, T)) + +# interreduces the Groebner basis G. +# each element of G is replaced by its normal form w.r.t the other elements of G and the current monomial order +# TODO reference, docstring +# interreduces the Groebner basis G. +function autoreduce(G::Oscar.IdealGens) + generators = collect(gens(G)) + + for i in 1:length(gens(G)) + generators[i] = reduce( + generators[i], generators[1:end .!= i]; ordering=G.ord, complete_reduction=true + ) + end + return Oscar.IdealGens(generators, G.ord; isGB=true) +end + +############################################# +# unspecific help functions +############################################# + +change_weight_vector(w::Vector{Int}, M::Matrix{Int}) = vcat(w', M[2:end, :]) +change_weight_vector(w::Vector{ZZRingElem}, M::ZZMatrix) = vcat(w', M[2:end, :]) + +insert_weight_vector(w::Vector{Int}, M::Matrix{Int}) = vcat(w', M[1:end-1, :]) +insert_weight_vector(w::Vector{ZZRingElem}, M::ZZMatrix) = vcat(w', M[1:end-1, :]) + +add_weight_vector(w::Vector{Int}, M::Matrix{Int}) = vcat(w', M) +add_weight_vector(w::Vector{ZZRingElem}, M::ZZMatrix) = ZZMatrix(vcat(w), M) + diff --git a/src/walk.jl b/src/walk.jl deleted file mode 100644 index 5363986ce38f..000000000000 --- a/src/walk.jl +++ /dev/null @@ -1,869 +0,0 @@ - -@doc raw""" - groebner_walk( - I::MPolyIdeal, - target::MonomialOrdering = lex(base_ring(I)), - start::MonomialOrdering = default_ordering(base_ring(I)); - perturbation_degree = 2, - algorithm::Symbol = :standard - ) - -Compute a reduced Groebner basis w.r.t. to a monomial order by converting it using the Groebner Walk. -The Groebner Walk is proposed by Collart, Kalkbrener & Mall (1997). -One can choose a strategy of: -- Standard Walk (:standard) computes the Walk like as presented in Cox, Little & O'Shea (2005). -- Generic Walk (:generic) computes the Walk as presented in Fukuda, Jensen, Lauritzen & Thomas (2005). -- Perturbed Walk (:perturbed, with p = degree of the perturbation) computes the Walk as presented in Amrhein, Gloor & Küchlin (1997). -- Tran's Walk (:tran) computes the Walk like as presented in Tran (2000). -- Fractal Walk (:fractalcombined) computes the Walk like as presented in Amrhein & Gloor (1998) with multiple extensions. The target monomial order has to be lex. This version uses the Buchberger algorithm to skip weight vectors with entries bigger than Int32. -- Fractal Walk (:fractal) computes the Walk as presented in Amrhein & Gloor (1998). Perturbs only the target vector. - -# Arguments -- `I::MPolyIdeal`: ideal one wants to compute a Groebner basis for. -- `target::MonomialOrdering=:lex`: monomial order one wants to compute a Groebner basis for. -- `start::MonomialOrdering=:degrevlex`: monomial order to begin the conversion. -- `perturbationDegree::Int=2`: the perturbation degree for the perturbed Walk. -- `algorithm::Symbol=standard`: strategy of the Groebner Walk. One can choose between: - - `standard`: Standard Walk, - - `generic`: Generic Walk, - - `perturbed`: Perturbed Walk, - - `tran`: Tran's Walk, - - `fractal`: standard-version of the Fractal Walk, - - `fractalcombined`: combined Version of the Fractal Walk. Target monomial order needs to be lex, - -# Examples - -```jldoctest -julia> R,(x,y) = polynomial_ring(QQ, ["x","y"]); - -julia> I = ideal([y^4+ x^3-x^2+x,x^4]); - -julia> groebner_walk(I, lex(R)) -Gröbner basis with elements -1 -> x + y^12 - y^8 + y^4 -2 -> y^16 -with respect to the ordering -lex([x, y]) - -julia> groebner_walk(I, lex(R); algorithm=:perturbed) -Gröbner basis with elements -1 -> x + y^12 - y^8 + y^4 -2 -> y^16 -with respect to the ordering -lex([x, y]) - -julia> julia> set_verbosity_level(:groebner_walk, 1); -julia> groebner_walk(I, lex(R)) -Results for standard_walk -Crossed Cones in: -ZZRingElem[4, 3] -ZZRingElem[4, 1] -ZZRingElem[12, 1] -ZZRingElem[1, 0] -Cones crossed: 4 -Gröbner basis with elements -1 -> x + y^12 - y^8 + y^4 -2 -> y^16 -with respect to the ordering -lex([x, y]) - -julia> groebner_walk(I, lex(R); algorithm=:perturbed) -perturbed_walk results -Crossed Cones in: -[4, 3] -[4, 1] -[5, 1] -[12, 1] -[1, 0] -Cones crossed: 5 -Gröbner basis with elements -1 -> y^16 -2 -> x + y^12 - y^8 + y^4 -with respect to the ordering -matrix_ordering([x, y], [1 0; 0 1]) -``` -""" -function groebner_walk( - I::MPolyIdeal, - target::MonomialOrdering = lex(base_ring(I)), - start::MonomialOrdering = default_ordering(base_ring(I)); - perturbation_degree = length(gens(base_ring(I))), # meaning, n=#gens(R) - algorithm::Symbol = :standard -) - if algorithm == :standard - walk = (x) -> standard_walk(x, target) - elseif algorithm == :generic - walk = (x) -> generic_walk(x, start, target) - elseif algorithm == :perturbed - walk = (x) -> perturbed_walk(x, start, target, perturbation_degree) - # elseif walktype == :fractal - # walk = (x) -> fractal_walk(x, start, target) - else - throw(NotImplementedError(:groebner_walk, algorithm)) - end - - Gb = groebner_basis(I; ordering=start, complete_reduction=true) - Gb = walk(Gb) - - return Oscar.IdealGens(Gb, target; isGB=true) -end - -########################################### -# Counter for the steps -########################################### -counter = 0 -function delete_step_counter() - global counter - temp = counter - counter = 0 - return temp -end -function getstep_counter() - global counter - return counter -end -function raise_step_counter() - global counter = getstep_counter() + 1 -end - -############################################################### -# Generic-version of the Groebner Walk. -############################################################### - -#= -function generic_step( - G::Oscar.IdealGens, Lm::Vector{T}, v::Vector{ZZRingElem}, ord::MonomialOrdering -) where {T<:MPolyRingElem} - facet_Generators = facet_initials(G, Lm, v) - H = groebner_basis( - ideal(facet_Generators); ordering=ord, complete_reduction=true, algorithm=:buchberger - ) - H, Lm = lift_generic(gens(G), Lm, gens(H), ord) - G = interreduce(H, Lm, ord) - return G, Lm -end -=# -############################################################### -# The Fractal Walk -############################################################### - -########################################## -# global weightvectors -########################################## -pTargetWeights = [] -pStartWeights = [] -firstStepMode = false - -############################################################### -# Combined version of the extensions of the Fractal Walk. -# This version -# - checks if the starting weight vector represents the monomial order and pertubes it if necessary. -# - analyses the Groebner basis Gw of the initialforms and uses the Buchberger-algorithm if the generators of Gw are binomial or less. -# - skips a step in top level in the last step. -# - checks if an entry of an intermediate weight vector is bigger than int32. In case of that the Buchberger-Algorithm is used to compute the Groebner basis of the ideal of the initialforms. -############################################################### -function fractal_walk_combined(G::Oscar.IdealGens, S::Matrix{Int}, T::Matrix{Int}) - @vprintln :groebner_walk "fractal_walk_combined results" - @vprintln :groebner_walk "Crossed Cones in: " - - global pTargetWeights = [perturbed_vector(G, T, i) for i in 1:nvars(base_ring(G))] - return fractal_walk_combined(G, S, T, S[1, :], pTargetWeights, 1) -end - -function fractal_walk_combined( - G::Oscar.IdealGens, - S::Matrix{Int}, - T::Matrix{Int}, - currweight::Vector{Int}, - pTargetWeights::Vector{Vector{Int}}, - p::Int, -) - R = base_ring(G) - G.isGB = true - w = currweight - ordAlt = G.ord - - # Handling the weight of the start order. - if (p == 1) - if !ismonomial(initial_forms(G, w)) - global pStartWeights = [perturbed_vector(G, S, i) for i in 1:nvars(R)] - global firstStepMode = true - end - end - if firstStepMode - w = pStartWeights[p] - else - w = currweight - end - - # main loop - while true - t = next_weight_fractal_walk(G, w, pTargetWeights[p]) - - # Handling the final step in the current depth. - # next_weight_fractal_walk may return 0 if the target vector does not lie in the cone of T while G already defines the Groebner basis w.r.t. T. - # -> Checking if G is already a Groebner basis w.r.t. T solves this problem and reduces computational effort since next_weight_fractal_walk returns 1 in the last step on every local path. - if t == 1 && p != 1 - if same_cone(G, T) - @vprintln :groebner_walk ("depth $p: in cone ", currweight, ".")... - - # Check if a target weight of pTargetWeights[p] and pTargetWeights[p-1] lies in the wrong cone. - if !inCone(G, T, pTargetWeights, p) - global pTargetWeights = [perturbed_vector(G, T, i) for i in 1:nvars(R)] - @vprintln :groebner_walk ("depth $p: not in cone ", pTargetWeights[p], ".")... - end - return G - end - elseif t == [0] # The Groebner basis w.r.t. the target weight and T is already computed. - if inCone(G, T, pTargetWeights, p) - @vprintln :groebner_walk ("depth $p: in cone ", pTargetWeights[p], ".")... - return G - end - global pTargetWeights = [perturbed_vector(G, T, i) for i in 1:nvars(R)] - @vprintln :groebner_walk ("depth $p: not in cone ", pTargetWeights[p], ".")... - continue - end - - # skip a step for target monomial order lex. - if t == 1 && p == 1 - @vprintln :groebner_walk ("depth $p: recursive call in ", pTargetWeights[p])... - return fractal_walk_combined(G, S, T, w, pTargetWeights, p + 1) - else - w = w + t * (pTargetWeights[p] - w) - w = convert_bounding_vector(w) - Gw = ideal(initial_forms(G, w)) - - # handling the current weight with regards to Int32-entries. If an entry of w is bigger than Int32 use the Buchberger-algorithm. - if !checkInt32(w) - println( - "depth $p: Some entries of $w are bigger than Int32. Trying to find another weight,", - ) - w, b = truncw(G, w, gens(Gw)) - if !b - println("depth $p: Doing a direct conversion to the target monomial ordering.") - ordNew = matrix_ordering(R, T) - w = T[1, :] - G = groebner_basis( - ideal(G); ordering=ordNew, complete_reduction=true, algorithm=:buchberger - ) - - if !inCone(G, T, pTargetWeights, p) - global pTargetWeights = [perturbed_vector(G, T, i) for i in 1:nvars(R)] - @vprintln :groebner_walk ("depth $p: not in cone ", pTargetWeights[p], ".")... - end - return G - end - end - ordNew = create_ordering(R, w, T) - # converting the Groebner basis - if (p == nvars(R) || isbinomial(gens(Gw))) - H = groebner_basis( - Gw; ordering=ordNew, complete_reduction=true, algorithm=:buchberger - ) - - @vprintln :groebner_walk ("depth $p: conversion in ", w, ".")... - raise_step_counter() - else - @vprintln :groebner_walk "depth $p: recursive call in $w." - H = fractal_walk_combined( - Oscar.IdealGens(R, gens(Gw), ordAlt), - S, - T, - deepcopy(currweight), - pTargetWeights, - p + 1, - ) - global firstStepMode = false - end - end - #H = liftGW2(G, ordAlt, Gw,H, ordNew) - H = lift_fractal_walk(G, H, ordNew) - G = autoreduce(H) - ordAlt = ordNew - currweight = w - end -end - -############################################################### -# Plain version of the Fractal Walk. -# This version checks if an entry of an intermediate weight vector is bigger than int32. In case of that the Buchberger-Algorithm is used to compute the Groebner basis of the ideal of the initialforms. -############################################################### - - -############################################################### -# Extends the plain Fractal Walk by checking the start order. -############################################################### - -function fractal_walk_start_order(G::Oscar.IdealGens, S::Matrix{Int}, T::Matrix{Int}) - @vprintln :groebner_walk "fractal_walk_withStartorder results" - @vprintln :groebner_walk "Crossed Cones in: " - - - global pTargetWeights = [perturbed_vector(G, T, i) for i in 1:nvars( - Singular.base_ring(G) - )] - return fractal_walk_recursive_startorder(G, S, T, S[1, :], pTargetWeights, 1) -end - -function fractal_walk_recursive_startorder( - G::Oscar.IdealGens, - S::Matrix{Int}, - T::Matrix{Int}, - currweight::Vector{Int}, - pTargetWeights::Vector{Vector{Int}}, - p::Int, -) - R = base_ring(G) - G.isGB = true - ordAlt = G.ord - - # Handling the starting weight. - if (p == 1) - if !ismonomial(initial_forms(G, currweight)) - global pStartWeights = [perturbed_vector(G, S, i) for i in 1:nvars(R)] - global firstStepMode = true - end - end - if firstStepMode - w = pStartWeights[p] - else - w = currweight - end - - while true - t = next_weight_fractal_walk(G, w, pTargetWeights[p]) - - # Handling the final step in the current depth. - # next_weight_fractal_walk may return 0 if the target vector does not lie in the cone of T while G already defines the Groebner basis w.r.t. T. - # -> Checking if G is already a Groebner basis w.r.t. T solves this problem and reduces computational effort since next_weight_fractal_walk returns 1 in the last step on every local path. if t == 1 && p != 1 - if t == 1 && p != 1 - if same_cone(G, T) - @vprintln :groebner_walk ("depth $p: in cone ", currweight, ".")... - - # Check if a target weight of pTargetWeights[p] and pTargetWeights[p-1] lies in the wrong cone. - if !inCone(G, T, pTargetWeights, p) - global pTargetWeights = [perturbed_vector(G, T, i) for i in 1:nvars(R)] - @vprintln :groebner_walk ("depth $p: not in cone ", pTargetWeights[p], ".")... - end - return G - end - elseif t == [0] # The Groebner basis w.r.t. the target weight and T is already computed. - if inCone(G, T, pTargetWeights, p) - @vprintln :groebner_walk ("depth $p: in cone ", pTargetWeights[p], ".")... - return G - end - global pTargetWeights = [perturbed_vector(G, T, i) for i in 1:nvars(R)] - @vprintln :groebner_walk ("depth $p: not in cone ", pTargetWeights[p], ".")... - continue - end - - w = w + t * (pTargetWeights[p] - w) - w = convert_bounding_vector(w) - Gw = ideal(initial_forms(G, w)) - - # Handling the current weight with regards to Int32-entries. If an entry of w is bigger than Int32 use the Buchberger-algorithm. - if !checkInt32(w) - w, b = truncw(G, w, gens(Gw)) - if !b - ordNew = matrix_ordering(R, T) - w = T[1, :] - G = groebner_basis( - Gw; ordering=ordNew, complete_reduction=true, algorithm=:buchberger - ) - - if !inCone(G, T, pTargetWeights, p) - global pTargetWeights = [perturbed_vector(G, T, i) for i in 1:nvars(R)] - @vprintln :groebner_walk ("depth $p: not in cone ", pTargetWeights[p], ".")... - end - return G - end - end - ordNew = create_ordering(R, w, T) - - # Converting the Groebner basis - if p == nvars(R) - H = groebner_basis( - Gw; ordering=ordNew, complete_reduction=true, algorithm=:buchberger - ) - - @vprintln :groebner_walk ("depth $p: conversion in ", w, ".")... - raise_step_counter() - else - @vprintln :groebner_walk "depth $p: recursive call in $w." - H = fractal_walk_recursive_startorder( - Oscar.IdealGens(R, gens(Gw), ordAlt), - S, - T, - deepcopy(currweight), - pTargetWeights, - p + 1, - ) - global firstStepMode = false - end - #H = liftGW2(G, R, Gw, H, Rn) - H = lift_fractal_walk(G, H, ordNew) - G = autoreduce(H) - ordAlt = ordNew - currweight = w - end -end - -############################################################### -# Tran´s version of the Groebner Walk. -# Returns the intermediate Groebner basis if an entry of an intermediate weight vector is bigger than int32. -############################################################### - -function tran_walk(G::Oscar.IdealGens, S::Matrix{Int}, T::Matrix{Int}) - @vprintln :groebner_walk "tran_walk results" - @vprintln :groebner_walk "Crossed Cones in: " - - currweight = S[1, :] - tarweight = T[1, :] - R = base_ring(G) - if !ismonomial(initial_forms(G, currweight)) - currweight = perturbed_vector(G, S, nvars(R)) - end - - while true - w = next_weight(G, currweight, tarweight) - - # return the Groebner basis if an entry of w is bigger than int32. - if !checkInt32(w) - w, b = truncw(G, w, initial_forms(G, w)) - !b && throw( - error( - "Some entries of the intermediate weight-vector $w are bigger than int32. Choose an other algorithm instead.", - ), - ) - end - if w == tarweight - if same_cone(G, T) - @vprintln :groebner_walk ("Cones crossed: ", counter)... - return G - elseif inSeveralCones(initial_forms(G, tarweight)) - tarweight = representation_vector(G, T) - continue - end - end - G = standard_step_without_int32_check(G, w, T) - - @vprintln :groebner_walk w - @vprintln :groebner_walk 2 G - - currweight = w - raise_step_counter() - end -end - -############################################################### -# Standard step without checking of the entries of a given weight vector. -############################################################### - -function standard_step_without_int32_check( - G::Oscar.IdealGens, w::Vector{Int}, T::Matrix{Int} -) - R = base_ring(G) - ordAlt = G.ord - ordNew = create_ordering(R, w, T) - Gw = initial_forms(G, w) - H = groebner_basis( - ideal(Gw); ordering=ordNew, complete_reduction=true, algorithm=:buchberger - ) - #H = liftGW2(G, R, Gw, H, Rn) - H = lift(G, ordAlt, H, ordNew) - return autoreduce(H) -end - -################################################################# -# Procedures of the fractal walk. -# The fractal walk is proposed by Amrhein & Gloor (1998). -################################################################# - -# lifts the Groebner basis G to the Groebner basis w.r.t. in the Fractal Walk like it´s done in Fukuda et. al (2005). -function lift_fractal_walk( - G::Oscar.IdealGens, H::Oscar.IdealGens, orderingNew::MonomialOrdering -) - R = base_ring(G) - G.isGB = true - G = Oscar.IdealGens( - R, - [ - gen - Oscar.IdealGens( - [reduce(gen, gens(G); ordering=G.ord, complete_reduction=true)], H.ord - )[1] for gen in gens(H) - ], - orderingNew, - ) - G.isGB = true - return G -end - -# returns ´true´ if all polynomials of the given array are monomials. -function ismonomial(Gw::Vector{T}) where {T<:MPolyRingElem} - for g in Gw - if length(coefficients(g)) > 1 - return false - end - end - return true -end - -# returns ´true´ if all polynomials of the given array are binomials or less. -function isbinomial(Gw::Vector{T}) where {T<:MPolyRingElem} - for g in Gw - if length(coefficients(g)) > 2 - return false - end - end - return true -end - -# returns the next t to compute the next weight vector w(t) = w + t * (tw - w) like it´s done in Amrhein & Gloor (1998). This Method is NOT tested sufficiently. -function nextT( - G::Oscar.IdealGens, w::Array{T,1}, tw::Array{K,1} -) where {T<:Number,K<:Number} - if (w == tw) - return [0] - end - tmin = 2 - t = 0 - for g in gens(G) - a = Singular.leading_exponent_vector(g) - d = Singular.exponent_vectors(tail(g)) - for v in d - frac = (dot(w, a) - dot(w, v) + dot(tw, v) - dot(tw, a)) - if frac != 0 - t = (dot(w, a) - dot(w, v))//frac - end - if t > 0 && t < tmin - tmin = t - end - end - end - if tmin <= 1 - return tmin - else - return [0] - end -end - -# returns the next t to compute the next weight vector w(t) = w + t * (tw - w) like it´s done in Cox, Little & O'Sheao (2005). -function next_weight_fractal_walk( - G::Oscar.IdealGens, cweight::Array{T,1}, tweight::Array{K,1} -) where {T<:Number,K<:Number} - if (cweight == tweight) - return [0] - end - tmin = 1 - for v in bounding_vectors(G) - tw = dot(tweight, v) - if tw < 0 - cw = dot(cweight, v) - t = cw//(cw - tw) - if t < tmin - tmin = t - end - end - end - - # BigInt is needed to prevent overflows in the conversion of the weight vectors. - return BigInt(numerator(tmin))//BigInt(denominator(tmin)) -end - -# returns 'true' if the leading terms of G w.r.t the matrixordering T are the same as the leading terms of G w.r.t the weighted monomial ordering with weight vector of pvecs[p] (pvecs[p-1]) and the matrixordering T. -function inCone(G::Oscar.IdealGens, T::Matrix{Int}, pvecs::Vector{Vector{Int}}, p::Int) - # pvecs(1) equals the first row of T - if p == 1 - return true - end - ord = matrix_ordering(base_ring(G), T) - cvzip = zip(gens(G), initial_forms(G, pvecs[p - 1]), initial_forms(G, pvecs[p])) - for (g, in, in2) in cvzip - if !isequal(leading_term(g; ordering=ord), leading_term(in; ordering=ord)) || - !isequal(leading_term(g; ordering=ord), leading_term(in2; ordering=ord)) - return false - end - end - return true -end - -############################################################### -# Several Procedures for the Groebner Walk -############################################################### - -# multiplies every entry of the given weight w with 0.1 as long as it stays on the same halfspace as w. -function truncw(G::Oscar.IdealGens, w::Vector{Int}, inw::Vector{T}) where {T<:MPolyRingElem} - while !checkInt32(w) - for i in 1:length(w) - w[i] = round(w[i] * 0.10) - end - w = convert_bounding_vector(w) - if inw != initial_forms(G, w) - # initials are different - return unrounded weight - return w, false - end - end - # converted to Vector w of the same face - return w, true -end - -# returns 'true' if the leading terms of G w.r.t the matrixorder T are the same as the leading terms of G w.r.t the weighted monomial order with weight vector t and matrix T. -#function inCone(G::Oscar.IdealGens, T::Union{Matrix{N}, MatElem{N}}, t::Vector{Int}) -# R = change_order(G.base_ring, T) -# I = Singular.Ideal(R, [change_ring(x, R) for x in gens(G)]) -# cvzip = zip(Singular.gens(I), initials(R, Singular.gens(I), t)) -# for (g, ing) in cvzip -# if !isequal(Singular.leading_exponent_vector(g), Singular.leading_exponent_vector(ing)) -# return false -# end -# end -# return true -#end - -# returns 'true' if the leading terms of G w.r.t the matrixordering T are the same as the leading terms of G w.r.t the weighted monomial order with weight vector t and the matrix order T. -#function inCone(G::Oscar.IdealGens, t::Vector{Int}) -# cvzip = zip(Singular.gens(G), initials(base_ring(G), gens(G), t)) -# for (g, ing) in cvzip -# if !isequal(leading_exponent_vector(g), leading_exponent_vector(ing)) -# return false -# end -# end -# return true -#end - -# returns 'true' if the leading terms of G w.r.t the matrixordering T are the same as the leading terms of G with the current ordering. -same_cone(G::Oscar.IdealGens, T::MonomialOrdering) = all(leading_term.(G; ordering=T) .== leading_term.(G; ordering=ordering(G))) - - -# lifts the Groebner basis G to the Groebner basis w.r.t. the Ring Rn like it´s done in Collart et al. (1997). -# FIXME: Needs to be fixed. -function liftGW2( - G::Oscar.IdealGens, - orderingAlt::MonomialOrdering, - inG::MPolyIdeal{T}, - H::Oscar.IdealGens, - ordering::MonomialOrdering, -) where {T<:MPolyRingElem} - H = gens(H) - R = base_ring(G) - G = gens(G) - for i in 1:length(H) - q = divrem(gens(Oscar.IdealGens([H[i]], orderingAlt)), gens(inG)) - H[i] = R(0) - for j in 1:length(gens(inG)) - println(gens(inG)[j]) - println(G[j]) - H[i] = H[i] + q[1][1][j] * G[j] - end - end - return Oscar.IdealGens(filter(!iszero, H), ordering) -end - -# converts a vector wtemp by dividing the entries with gcd(wtemp). -convert_bounding_vector(w::Vector{T}) where {T<:Union{ZZRingElem, QQFieldElem}} = ZZ.(floor.(w//gcd(w))) - -# TODO: This comment is factually not correct, it's just the weight ordering of a matrix ordering -# returns a copy of the PolynomialRing I, equipped with the ordering weight_ordering(cw)*matrix_ordering(T). -create_ordering(R::MPolyRing, cw::Vector{L}, T::Matrix{Int}) where {L<:Number} = weight_ordering(cw, matrix_ordering(R, T)) - -# interreduces the Groebner basis G. -# each element of G is replaced by its normal form w.r.t the other elements of G and the current monomial order -# TODO reference, docstring -# interreduces the Groebner basis G. -function autoreduce(G::Oscar.IdealGens) - generators = collect(gens(G)) - - for i in 1:length(gens(G)) - generators[i] = reduce( - generators[i], generators[1:end .!= i]; ordering=G.ord, complete_reduction=true - ) - end - return Oscar.IdealGens(generators, G.ord; isGB=true) -end - -############################################# -# unspecific help functions -############################################# - -function ident_matrix(n::Int) - M = zeros(Int, n, n) - for i in 1:n - M[i, i] = 1 - end - return M -end - -function anti_diagonal_matrix(n::Int) - M = zeros(Int, n, n) - for i in 1:n - M[i, n + 1 - i] = -1 - end - return M -end - -# Singular.isequal depends on order of generators -function equalitytest(G::Oscar.IdealGens, K::Oscar.IdealGens) - if length(gens(G)) != length(gens(K)) - return false - end - generators = Singular.gens(G) - count = 0 - for gen in generators - for r in Singular.gens(K) - if gen * first(coefficients(leading_term(r; ordering=G.ord))) - - r * first(coefficients(leading_term(gen; ordering=G.ord))) == 0 - count += 1 - break - end - end - end - if count == length(gens(G)) - return true - end - return false -end - -function ordering_as_matrix(w::Vector{Int}, ord::Symbol) - if length(w) > 2 - if ord == :lex - return [ - w' - ident_matrix(length(w))[1:(length(w) - 1), :] - ] - end - if ord == :deglex - return [ - w' - ones(Int, length(w))' - ident_matrix(length(w))[1:(length(w) - 2), :] - ] - end - if ord == :degrevlex - return [ - w' - ones(Int, length(w))' - anti_diagonal_matrix(length(w))[1:(length(w) - 2), :] - ] - end - if ord == :revlex - return [ - w' - anti_diagonal_matrix(length(w))[1:(length(w) - 1), :] - ] - end - else - error("not implemented") - end -end - -function change_weight_vector(w::Vector{Int}, M::Matrix{Int}) - return [ - w' - M[2:length(w), :] - ] -end - -function insert_weight_vector(w::Vector{Int}, M::Matrix{Int}) - return [ - w' - M[1:(length(w) - 1), :] - ] -end - -function add_weight_vector(w::Vector{Int}, M::Matrix{Int}) - return [ - w' - M - ] -end - -add_weight_vector(w::Vector{ZZRingElem}, M::ZZMatrix) = ZZMatrix(add_weight_vector(Int.(w), Matrix{Int}(M))) - -function ordering_as_matrix(ord::Symbol, nvars::Int) - if ord == :lex - return ident_matrix(nvars) - end - if ord == :deglex - return [ - ones(Int, nvars)' - ident_matrix(nvars)[1:(nvars - 1), :] - ] - end - if ord == :degrevlex - return [ - ones(Int, nvars)' - anti_diagonal_matrix(nvars)[1:(nvars - 1), :] - ] - end - if ord == :revlex - return [ - w' - anti_diagonal_matrix(length(w))[1:(length(w) - 1), :] - ] - else - error("not implemented") - end -end - -function checkInt32(w::Vector{Int}) - for i in 1:length(w) - if tryparse(Int32, string(w[i])) == nothing - return false - end - end - return true -end - -# computes the representation of the matrixorder defined by T. -function representation_vector(G::Oscar.IdealGens, T::Matrix{Int}) - n = size(T)[1] - M = maximum(T) - - d0 = maximum(g -> deg(g, n), gens(g)) - - d = M * (2 * d0^2 + (n + 1) * d0) - w = d^(n - 1) * T[1, :] - for i in 2:n - w = w + d^(n - i) * T[i, :] - end - return w -end - -# checks if Gw is an initialform of an ideal corresponding to a face of the Groebner fan with dimension less than n-1. -function inSeveralCones(Gw::Vector{T}) where {T<:MPolyRingElem} - counter = 0 - for g in Gw - if size(collect(Singular.coefficients(g)))[1] > 2 - return true - end - if size(collect(Singular.coefficients(g)))[1] == 2 - counter = counter + 1 - end - end - if counter > 1 - return true - end - return false -end - - -#Create a copy of the "lift" function (to export it without conflicts) - -function lift2( - G::Oscar.IdealGens, # momentane GB - current::MonomialOrdering, - H::Oscar.IdealGens, # soll GB von initial forms sein - target::MonomialOrdering, -) - G = Oscar.IdealGens( - [ - gen - Oscar.IdealGens( - [reduce(gen, gens(G); ordering=current, complete_reduction=true)], target - )[1] for gen in gens(H) - ], - target; - isGB=true, - ) - - return G -end From 2b34cbcedef8b8eec2cde64470aee681f2c526a7 Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Mon, 3 Jun 2024 16:07:18 +0200 Subject: [PATCH 100/179] Clean up --- src/GroebnerWalk.jl | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/src/GroebnerWalk.jl b/src/GroebnerWalk.jl index c25f47e65790..97efd07f6937 100644 --- a/src/GroebnerWalk.jl +++ b/src/GroebnerWalk.jl @@ -1,25 +1,16 @@ module GroebnerWalk using Oscar -exponent_vectors = f->leading_exponent_vector.(monomials(f)) - include("markedGB.jl") -include("generic_walk.jl") -include("walk.jl") +include("common.jl") include("standard_walk.jl") +include("generic_walk.jl") include("perturbed_walk.jl") -include("fractal_walk.jl") import Oscar: weight_ordering, ZZRingElem, MonomialOrdering, ZZMatrix, IdealGens import Oscar.Orderings: MatrixOrdering, _support_indices -function weight_ordering(w::Vector{ZZRingElem}, o::MonomialOrdering) - i = _support_indices(o.o) - m = ZZMatrix(1, length(w), w) - return MonomialOrdering(base_ring(o), MatrixOrdering(i, m, false))*o -end - export groebner_walk function __init__() From df7010185cf1859012a01c3cd4a28c2ad44af2b0 Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Mon, 3 Jun 2024 16:48:04 +0200 Subject: [PATCH 101/179] Add comments for missing docstrings --- src/common.jl | 16 +++++-- src/fractal_walk.jl | 108 ------------------------------------------ src/generic_walk.jl | 11 +++-- src/markedGB.jl | 11 +++-- src/perturbed_walk.jl | 10 +++- 5 files changed, 33 insertions(+), 123 deletions(-) delete mode 100644 src/fractal_walk.jl diff --git a/src/common.jl b/src/common.jl index adb03b9e47d7..95eee6fdd82f 100644 --- a/src/common.jl +++ b/src/common.jl @@ -4,7 +4,7 @@ I::MPolyIdeal, target::MonomialOrdering = lex(base_ring(I)), start::MonomialOrdering = default_ordering(base_ring(I)); - perturbation_degree = 2, + perturbation_degree = length(gens(base_ring(I))), algorithm::Symbol = :standard ) @@ -100,8 +100,10 @@ function groebner_walk( return Oscar.IdealGens(Gb, target; isGB=true) end +# TODO docstring exponent_vectors = f->leading_exponent_vector.(monomials(f)) +#TODO docstring function weight_ordering(w::Vector{ZZRingElem}, o::MonomialOrdering) i = _support_indices(o.o) m = ZZMatrix(1, length(w), w) @@ -109,19 +111,18 @@ function weight_ordering(w::Vector{ZZRingElem}, o::MonomialOrdering) end # returns 'true' if the leading terms of G w.r.t the matrixordering T are the same as the leading terms of G with the current ordering. +#TODO docstring same_cone(G::Oscar.IdealGens, T::MonomialOrdering) = all(leading_term.(G; ordering=T) .== leading_term.(G; ordering=ordering(G))) # converts a vector wtemp by dividing the entries with gcd(wtemp). convert_bounding_vector(w::Vector{T}) where {T<:Union{ZZRingElem, QQFieldElem}} = ZZ.(floor.(w//gcd(w))) -# TODO: This comment is factually not correct, it's just the weight ordering of a matrix ordering -# returns a copy of the PolynomialRing I, equipped with the ordering weight_ordering(cw)*matrix_ordering(T). +# Creates a weight ordering for R with weight cw and representing matrix T create_ordering(R::MPolyRing, cw::Vector{L}, T::Matrix{Int}) where {L<:Number} = weight_ordering(cw, matrix_ordering(R, T)) # interreduces the Groebner basis G. # each element of G is replaced by its normal form w.r.t the other elements of G and the current monomial order # TODO reference, docstring -# interreduces the Groebner basis G. function autoreduce(G::Oscar.IdealGens) generators = collect(gens(G)) @@ -136,6 +137,7 @@ end ############################################# # unspecific help functions ############################################# +#TODO docstring change_weight_vector(w::Vector{Int}, M::Matrix{Int}) = vcat(w', M[2:end, :]) change_weight_vector(w::Vector{ZZRingElem}, M::ZZMatrix) = vcat(w', M[2:end, :]) @@ -143,6 +145,12 @@ change_weight_vector(w::Vector{ZZRingElem}, M::ZZMatrix) = vcat(w', M[2:end, :]) insert_weight_vector(w::Vector{Int}, M::Matrix{Int}) = vcat(w', M[1:end-1, :]) insert_weight_vector(w::Vector{ZZRingElem}, M::ZZMatrix) = vcat(w', M[1:end-1, :]) +@doc raw""" + add_weight_vector(w::Vector{ZZRingElem}, M::ZZMatrix) + +Prepends the weight vector `w` as row to the matrix `M`. + +""" add_weight_vector(w::Vector{Int}, M::Matrix{Int}) = vcat(w', M) add_weight_vector(w::Vector{ZZRingElem}, M::ZZMatrix) = ZZMatrix(vcat(w), M) diff --git a/src/fractal_walk.jl b/src/fractal_walk.jl deleted file mode 100644 index c5e345fea687..000000000000 --- a/src/fractal_walk.jl +++ /dev/null @@ -1,108 +0,0 @@ -############################################################### -# Plain version of the Fractal Walk. -# This version checks if an entry of an intermediate weight vector is bigger than int32. In case of that the Buchberger-Algorithm is used to compute the Groebner basis of the ideal of the initialforms. -############################################################### - -function fractal_walk(G::Oscar.IdealGens, start::MonomialOrdering, target::MonomialOrdering) - @vprintln :groebner_walk "FractalWalk_standard results" - @vprintln :groebner_walk "Crossed Cones in: " - - S = canonical_matrix(start) - T = canonical_matrix(target) - - pTargetWeights = [perturbed_vector(G, T, i) for i in 1:nvars(base_ring(G))] - return fractal_recursion_step(G, S, T, S[1, :], pTargetWeights, 1) -end - -function fractal_recursion_step( - G::Oscar.IdealGens, - S::ZZMatrix, - T::ZZMatrix, - current_weight::Vector{ZZRingElem}, - pTargetWeights::Vector{Vector{ZZRingElem}}, - p::Int -) - R = base_ring(G) - G.isGB = true - w = current_weight - old_ordering = ordering(G) - while true - t = next_weight_fractal_walk(G, w, pTargetWeights[p]) - - # Handling the final step in the current depth. - # next_weight_fractal_walk may return 0 if the target vector does not lie in the cone of T while G already defines the Groebner basis w.r.t. T. - # -> Checking if G is already a Groebner basis w.r.t. T solves this problem and reduces computational effort since next_weight_fractal_walk returns 1 in the last step on every local path. if t == 1 && p != 1 - if t == 1 && p != 1 - if same_cone(G, T) - @vprintln :groebner_walk ("depth $p: in cone ", current_weight, ".")... - - # Check if a target weight of pTargetWeights[p] and pTargetWeights[p-1] lies in the wrong cone. - if !inCone(G, T, pTargetWeights, p) - global pTargetWeights = [perturbed_vector(G, T, i) for i in 1:nvars(R)] - @vprintln :groebner_walk ("depth $p: not in cone ", pTargetWeights[p], ".")... - end - return G - end - elseif t == [0] # The Groebner basis w.r.t. the target weight and T is already computed. - if inCone(G, T, pTargetWeights, p) - @vprintln :groebner_walk ("depth $p: in cone ", pTargetWeights[p], ".")... - return G - end - global pTargetWeights = [perturbed_vector(G, T, i) for i in 1:nvars(R)] - @vprintln :groebner_walk ("depth $p: not in cone ", pTargetWeights[p], ".")... - continue - end - - w = w + t * (pTargetWeights[p] - w) - w = convert_bounding_vector(w) - Gw = ideal(initial_forms(G, w)) - - # Handling the current weight with regards to Int32-entries. If an entry of w is bigger than Int32 use the Buchberger-algorithm. - if !checkInt32(w) - println( - "depth $p: Some entries of $w are bigger than Int32. Trying to find another weight," - ) - w, b = truncw(G, w, gens(Gw)) - if !b - println("depth $p: Doing a direct conversion to the target monomial ordering.") - ordNew = matrix_ordering(R, T) - w = T[1, :] - G = groebner_basis( - Gw; ordering=ordNew, complete_reduction=true, algorithm=:buchberger - ) - - if !inCone(G, T, pTargetWeights, p) - global pTargetWeights = [perturbed_vector(G, T, i) for i in 1:nvars(R)] - @vprintln :groebner_walk ("depth $p: not in cone ", pTargetWeights[p], ".")... - end - return G - end - end - ordNew = create_ordering(R, w, T) - # Converting the Groebner basis - if p == nvars(R) - H = groebner_basis( - Gw; ordering=ordNew, complete_reduction=true, algorithm=:buchberger - ) - - @vprintln :groebner_walk ("depth $p: conversion in ", w, ".")... - raise_step_counter() - else - @vprintln :groebner_walk "depth $p: recursive call in $w." - H = fractal_recursion_step( - Oscar.IdealGens(R, gens(Gw), ordAlt), - S, - T, - deepcopy(current_weight), - pTargetWeights, - p + 1, - ) - end - #H = liftGW2(G, R, Gw, H, Rn) - H = lift_fractal_walk(G, H, ordNew) - G = autoreduce(H) - ordAlt = ordNew - current_weight = w - end -end - diff --git a/src/generic_walk.jl b/src/generic_walk.jl index 0e1af15f6612..d01905a66c29 100644 --- a/src/generic_walk.jl +++ b/src/generic_walk.jl @@ -67,7 +67,6 @@ function difference_lead_tail(MG::MarkedGroebnerBasis) (G,Lm) = gens(MG), markings(MG) lead_exp = leading_exponent_vector.(Lm) - #v = zip(lead_exp, exponent_vectors.(G)) .|> splat((l, t) -> Ref(l).-t) v = [ [l-t for t in T] for (l, T) in zip(lead_exp, exponent_vectors.(G)) ] return [ZZ.(v)./ZZ(gcd(v)) for v in unique!(reduce(vcat, v)) if !iszero(v)] @@ -91,6 +90,7 @@ function next_gamma( if isempty(V) return V end + minV = first(V) for v in V if facet_less_than(canonical_matrix(start), canonical_matrix(target),v, minV) @@ -219,7 +219,11 @@ end Returns all elements of `V` smaller than `w` with respect to the facet preorder. """ -function filter_lf(w::Vector{ZZRingElem}, start::MonomialOrdering, target::MonomialOrdering, V::Vector{Vector{ZZRingElem}}) +function filter_lf( + w::Vector{ZZRingElem}, + start::MonomialOrdering, target::MonomialOrdering, + V::Vector{Vector{ZZRingElem}} + ) skip_indices = facet_less_than.( Ref(canonical_matrix(start)), Ref(canonical_matrix(target)), @@ -230,9 +234,6 @@ function filter_lf(w::Vector{ZZRingElem}, start::MonomialOrdering, target::Monom return unique!(V[skip_indices]) end - -#returns true if u is a non-zero integer multiple of v - @doc raw""" is_parallel(u::Vector{ZZRingElem}, v::Vector{ZZRingElem}) diff --git a/src/markedGB.jl b/src/markedGB.jl index b1759f5497cf..aa8709a0a75d 100644 --- a/src/markedGB.jl +++ b/src/markedGB.jl @@ -7,7 +7,6 @@ import Base: length, getindex, setindex! #markings, a vector "Markings" of G, corresponding to leading terms w.r.t some monomial ordering #TODO: maybe initialize s.t. G is reduced/monic? -MarkedPolynomial = Tuple{<:MPolyRingElem, <:MPolyRingElem} struct MarkedGroebnerBasis gens::Vector{<:MPolyRingElem} markings::Vector{<:MPolyRingElem} @@ -31,12 +30,18 @@ gens(G::MarkedGroebnerBasis) = G.gens markings(G::MarkedGroebnerBasis) = G.markings gens_and_markings(G::MarkedGroebnerBasis) = zip(gens(G), markings(G)) +#MarkedPolynomial = Tuple{<:MPolyRingElem, <:MPolyRingElem} # getindex(G::MarkedGroebnerBasis, i::Int) = (G.gens[i], G.markings[i]) # function setindex!(G::MarkedGroebnerBasis, (f,m)::MarkedPolynomial, i::Int) # G.gens[i] = f # G.markings[i] = m # end +@doc raw""" + some_gens_with_markings(G::MarkedGroebnerBasis, I::AbstractVector) + +Returns a subset of generators of G indexed by I as pairs of polynomials and leading terms. +""" function some_gens_with_markings(G::MarkedGroebnerBasis, I::AbstractVector) gens_view = @view gens(G)[I] markings_view = @view markings(G)[I] @@ -131,8 +136,6 @@ function autoreduce!(MG::MarkedGroebnerBasis) rest = some_gens_with_markings(MG, 1:n .!= i) nf = _normal_form(g, rest...) - # if !iszero(nf) - MG.gens[i] = nf - # end + MG.gens[i] = nf end end diff --git a/src/perturbed_walk.jl b/src/perturbed_walk.jl index 84be94216167..a1f1bdd40574 100644 --- a/src/perturbed_walk.jl +++ b/src/perturbed_walk.jl @@ -32,7 +32,7 @@ function perturbed_walk( @vprintln :groebner_walk 2 S target_weight = perturbed_vector(G, T, p) - next_target = matrix_ordering(R, add_weight_vector(target_weight, T)) + next_target = weight_ordering(target_weight, target) G = standard_walk(Oscar.IdealGens, G, next_target, current_weight, target_weight) @vprintln :groebner_walk 2 G @@ -74,7 +74,13 @@ function perturbed_vector(G::Oscar.IdealGens, M::ZZMatrix, p::Int) @vprint :groebner_walk 5 "Upper degree bound: " @vprintln :groebner_walk 5 e - w = sum(row * e^(p-i) for (i,row) in enumerate(rows)) + w = zeros(ZZRingElem, n) + d = 1 + for i in 1:p + w += row[end+1-i] * d + d *= e + end + #w = sum(row * e^(p-i) for (i,row) in enumerate(rows)) @vprint :groebner_walk 3 "Perturbed vector: " @vprintln :groebner_walk 3 w From 3cd62f2da61f6a30ca97b451402d0f7134485425 Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Mon, 3 Jun 2024 16:48:27 +0200 Subject: [PATCH 102/179] Bump to v1.0.1 --- Project.toml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Project.toml b/Project.toml index ba2cd51f3db7..dd2e90bee89f 100644 --- a/Project.toml +++ b/Project.toml @@ -1,9 +1,8 @@ name = "GroebnerWalk" uuid = "6dc8777d-2b0c-4de5-9e3c-426c1820f6f9" authors = ["Kamillo Ferry ", "Francesco Nowell "] -version = "1.0.0" +version = "1.0.1" [deps] -Oscar = "f1435218-dba5-11e9-1e4d-f1a5fab5fc13" -Revise = "295af30f-e4ad-537b-8983-00126c2a3abe" BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf" +Oscar = "f1435218-dba5-11e9-1e4d-f1a5fab5fc13" From aedf2092b7dd37cd462c7536c5bb2b197f5adba3 Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Mon, 3 Jun 2024 17:55:16 +0200 Subject: [PATCH 103/179] Remove redundant `exponent_vectors` function --- src/common.jl | 3 --- src/generic_walk.jl | 2 +- src/standard_walk.jl | 2 +- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/common.jl b/src/common.jl index 95eee6fdd82f..f4b5a93d8c4c 100644 --- a/src/common.jl +++ b/src/common.jl @@ -100,9 +100,6 @@ function groebner_walk( return Oscar.IdealGens(Gb, target; isGB=true) end -# TODO docstring -exponent_vectors = f->leading_exponent_vector.(monomials(f)) - #TODO docstring function weight_ordering(w::Vector{ZZRingElem}, o::MonomialOrdering) i = _support_indices(o.o) diff --git a/src/generic_walk.jl b/src/generic_walk.jl index d01905a66c29..bb4c33db3e28 100644 --- a/src/generic_walk.jl +++ b/src/generic_walk.jl @@ -67,7 +67,7 @@ function difference_lead_tail(MG::MarkedGroebnerBasis) (G,Lm) = gens(MG), markings(MG) lead_exp = leading_exponent_vector.(Lm) - v = [ [l-t for t in T] for (l, T) in zip(lead_exp, exponent_vectors.(G)) ] + v = [ [l-t for t in T] for (l, T) in zip(lead_exp, exponents.(G)) ] return [ZZ.(v)./ZZ(gcd(v)) for v in unique!(reduce(vcat, v)) if !iszero(v)] end diff --git a/src/standard_walk.jl b/src/standard_walk.jl index b37814758ed1..4807333f7bc7 100644 --- a/src/standard_walk.jl +++ b/src/standard_walk.jl @@ -100,7 +100,7 @@ function initial_form(f::MPolyRingElem, w::Vector{ZZRingElem}) ctx = MPolyBuildCtx(R) - E = exponent_vectors(f) + E = exponents(f) WE = dot.(Ref(w), Vector{ZZRingElem}.(E)) maxw = -inf From fb4e777270d0ef5a5d18fb28e88580cc38d53bf7 Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Wed, 5 Jun 2024 15:19:30 +0200 Subject: [PATCH 104/179] Update docstrings --- src/common.jl | 31 ++++++++++++++++++++++++------- src/generic_walk.jl | 1 - 2 files changed, 24 insertions(+), 8 deletions(-) diff --git a/src/common.jl b/src/common.jl index f4b5a93d8c4c..22513be07a12 100644 --- a/src/common.jl +++ b/src/common.jl @@ -8,7 +8,7 @@ algorithm::Symbol = :standard ) -Compute a reduced Groebner basis w.r.t. to a monomial order by converting it using the Groebner Walk. +Compute a reduced Groebner basis w.r.t. to a monomial ordering by converting it using the Groebner Walk. The Groebner Walk is proposed by Collart, Kalkbrener & Mall (1997). One can choose a strategy of: - Standard Walk (:standard) computes the Walk like as presented in Cox, Little & O'Shea (2005). @@ -17,8 +17,8 @@ One can choose a strategy of: # Arguments - `I::MPolyIdeal`: ideal one wants to compute a Groebner basis for. -- `target::MonomialOrdering=:lex`: monomial order one wants to compute a Groebner basis for. -- `start::MonomialOrdering=:degrevlex`: monomial order to begin the conversion. +- `target::MonomialOrdering=:lex`: monomial ordering one wants to compute a Groebner basis for. +- `start::MonomialOrdering=:degrevlex`: monomial ordering to begin the conversion. - `perturbationDegree::Int=2`: the perturbation degree for the perturbed Walk. - `algorithm::Symbol=standard`: strategy of the Groebner Walk. One can choose between: - `standard`: Standard Walk, @@ -34,7 +34,7 @@ julia> I = ideal([y^4+ x^3-x^2+x,x^4]); julia> groebner_walk(I, lex(R)) Gröbner basis with elements -1 -> x + y^12 - y^8 + y^4 +1 -> x + y^12 - y^8 + y^4 r 2 -> y^16 with respect to the ordering lex([x, y]) @@ -46,7 +46,7 @@ Gröbner basis with elements with respect to the ordering lex([x, y]) -julia> julia> set_verbosity_level(:groebner_walk, 1); +julia> set_verbosity_level(:groebner_walk, 1); julia> groebner_walk(I, lex(R)) Results for standard_walk Crossed Cones in: @@ -102,16 +102,28 @@ end #TODO docstring function weight_ordering(w::Vector{ZZRingElem}, o::MonomialOrdering) + # Instead of using OSCAR's weight_ordering which requires w to be "Vector{Int64}" + # we use the following construction which also accepts ZZRingElem. i = _support_indices(o.o) m = ZZMatrix(1, length(w), w) return MonomialOrdering(base_ring(o), MatrixOrdering(i, m, false))*o end -# returns 'true' if the leading terms of G w.r.t the matrixordering T are the same as the leading terms of G with the current ordering. -#TODO docstring +@doc raw""" + same_cone(G::Oscar.IdealGens, T::MonomialOrdering) + +Checks whether the leading terms of G with respect to the matrix ordering given by T agree +with the leading terms of G with respect to the current ordering. +This means they are in the same cone of the Groebner fan. (cf. Lemma 2.2, Collart, Kalkbrener and Mall 1997) +""" same_cone(G::Oscar.IdealGens, T::MonomialOrdering) = all(leading_term.(G; ordering=T) .== leading_term.(G; ordering=ordering(G))) # converts a vector wtemp by dividing the entries with gcd(wtemp). +@doc raw""" + convert_bounding_vector(w::Vector{T}) + +Scales a rational weight vector to have co-prime integer weights. +""" convert_bounding_vector(w::Vector{T}) where {T<:Union{ZZRingElem, QQFieldElem}} = ZZ.(floor.(w//gcd(w))) # Creates a weight ordering for R with weight cw and representing matrix T @@ -120,6 +132,11 @@ create_ordering(R::MPolyRing, cw::Vector{L}, T::Matrix{Int}) where {L<:Number} = # interreduces the Groebner basis G. # each element of G is replaced by its normal form w.r.t the other elements of G and the current monomial order # TODO reference, docstring +@doc raw""" + autoreduce(G::Oscar.IdealGens) + +Replaces every element of G by the normal form with respect to the remaining elements of G and the current monomial ordering. +""" function autoreduce(G::Oscar.IdealGens) generators = collect(gens(G)) diff --git a/src/generic_walk.jl b/src/generic_walk.jl index bb4c33db3e28..1567a3191894 100644 --- a/src/generic_walk.jl +++ b/src/generic_walk.jl @@ -189,7 +189,6 @@ end Returns true if $Mv < Mw$ lexicographically, false otherwise. """ -# matrix_lexicographic_less_than(M::ZZMatrix, v::Vector{ZZRingElem}, w::Vector{ZZRingElem}) = all(i -> dot(M[i, :], v) < dot(M[i, :], w), 1:size(M,1)) function matrix_lexicographic_less_than(M::ZZMatrix, v::Vector{ZZRingElem}, w::Vector{ZZRingElem}) i = 1 while dot(M[i, :], v) == dot(M[i, :], w) && i != number_of_rows(M) From 81ac28a91c359bb8e619f84229561015db18d02d Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Sat, 8 Jun 2024 22:52:30 +0200 Subject: [PATCH 105/179] Make some iterations more readable --- src/generic_walk.jl | 40 ++++++++++++++++++++-------------------- src/markedGB.jl | 20 -------------------- src/perturbed_walk.jl | 3 ++- src/standard_walk.jl | 7 +++---- 4 files changed, 25 insertions(+), 45 deletions(-) diff --git a/src/generic_walk.jl b/src/generic_walk.jl index 1567a3191894..c50aa7fb815e 100644 --- a/src/generic_walk.jl +++ b/src/generic_walk.jl @@ -39,13 +39,13 @@ end Given the marked Gröbner basis `MG` and a facet normal vector `v`, compute the next marked Gröbner basis. """ function generic_step(MG::MarkedGroebnerBasis, v::Vector{ZZRingElem}, ord::MonomialOrdering) - facet_Generators = facet_initials(MG, v) + facet_generators = facet_initials(MG, v) H = groebner_basis( - ideal(facet_Generators); ordering=ord, complete_reduction=true, algorithm=:buchberger + ideal(facet_generators); ordering=ord, complete_reduction=true, algorithm=:buchberger ) @vprint :groebner_walk 5 "Initials forms of facet: " - @vprintln :groebner_walk 5 facet_Generators + @vprintln :groebner_walk 5 facet_generators @vprint :groebner_walk 3 "GB of initial forms: " @vprintln :groebner_walk 3 H @@ -67,7 +67,9 @@ function difference_lead_tail(MG::MarkedGroebnerBasis) (G,Lm) = gens(MG), markings(MG) lead_exp = leading_exponent_vector.(Lm) - v = [ [l-t for t in T] for (l, T) in zip(lead_exp, exponents.(G)) ] + v = map(zip(lead_exp, exponents.(G))) do (l,T) + Ref(l) .- T + end return [ZZ.(v)./ZZ(gcd(v)) for v in unique!(reduce(vcat, v)) if !iszero(v)] end @@ -91,13 +93,13 @@ function next_gamma( return V end - minV = first(V) - for v in V - if facet_less_than(canonical_matrix(start), canonical_matrix(target),v, minV) - minV = v - end - end - return minV + return reduce(V[2:end], init=first(V)) do v,w + if facet_less_than(canonical_matrix(start), canonical_matrix(target), v, w) + return v + else + return w + end + end end @doc raw""" @@ -134,14 +136,13 @@ Given a marked Gröbner basis `MG` generating an ideal $I$ and a reduced marked lift H to a marked Gröbner basis of I (with unknown ordering) by subtracting initial forms according to Fukuda, 2007. """ function lift_generic(MG::MarkedGroebnerBasis, H::MarkedGroebnerBasis) - for i in 1:length(H.gens) - H.gens[i] = H.gens[i] - normal_form(H.gens[i], MG) - end - return H + return map(1:length(H.gens)) do i + H[i] - normal_form(H[i], MG) + end end @doc raw""" - lift_generic(MG::MarkedGroebnerBasis, H::MarkedGroebnerBasis) + lift_generic!(H::MarkedGroebnerBasis, MG::MarkedGroebnerBasis) Given a marked Gröbner basis `MG` generating an ideal $I$ and a reduced marked Gröbner basis `H` of initial forms, lift H to a marked Gröbner basis of I (with unknown ordering) by subtracting initial forms according to Fukuda, 2007. @@ -150,7 +151,7 @@ This changes `H` in-place. function lift_generic!(H::MarkedGroebnerBasis, MG::MarkedGroebnerBasis) for i in 1:length(H.gens) H.gens[i] = H.gens[i] - normal_form(H.gens[i], MG) - end + end return H end @@ -178,10 +179,9 @@ end Computes all elements $v\in V$ with $0 <_{\texttt{target}} v$ and $v <_{\texttt{start}} 0$ """ function filter_by_ordering(start::MonomialOrdering, target::MonomialOrdering, V::Vector{Vector{ZZRingElem}}) - pred = v -> ( + return unique!(filter(V) do v less_than_zero(canonical_matrix(target), ZZ.(v)) && !less_than_zero(canonical_matrix(start), ZZ.(v)) - ) - return unique!(filter(pred, V)) + end) end @doc raw""" diff --git a/src/markedGB.jl b/src/markedGB.jl index aa8709a0a75d..24c6fd13b786 100644 --- a/src/markedGB.jl +++ b/src/markedGB.jl @@ -49,26 +49,6 @@ function some_gens_with_markings(G::MarkedGroebnerBasis, I::AbstractVector) return gens_view, markings_view end -@doc raw""" - divides_walk(p::MPolyRingElem, lm::MPolyRingElem) - -Given a polynomial `p` and a monomial `lm`, returns `(true, q)` when `lm` divides a term of `p`, and if so, -the factor `q` in p = q*lm + "terms not divisible by lm". Otherwise, returns `(false, 0)`. -""" -function divides_walk(p::MPolyRingElem, lm::MPolyRingElem) - div = false - newpoly = zero(parent(p)) - - for term in terms(p) - (b, c) = divides(term, lm) - if b - newpoly += c - div = true - end - end - return div, newpoly -end - function _normal_form(p::MPolyRingElem, G::AbstractVector{<:MPolyRingElem}, mark::AbstractVector{<:MPolyRingElem}) nf = MPolyBuildCtx(parent(p)) MG = zip(G, mark) diff --git a/src/perturbed_walk.jl b/src/perturbed_walk.jl index a1f1bdd40574..5fc22fc716c8 100644 --- a/src/perturbed_walk.jl +++ b/src/perturbed_walk.jl @@ -74,13 +74,14 @@ function perturbed_vector(G::Oscar.IdealGens, M::ZZMatrix, p::Int) @vprint :groebner_walk 5 "Upper degree bound: " @vprintln :groebner_walk 5 e + #w = sum(row * e^(p-i) for (i,row) in enumerate(rows)) w = zeros(ZZRingElem, n) d = 1 for i in 1:p w += row[end+1-i] * d d *= e end - #w = sum(row * e^(p-i) for (i,row) in enumerate(rows)) + @vprint :groebner_walk 3 "Perturbed vector: " @vprintln :groebner_walk 3 w diff --git a/src/standard_walk.jl b/src/standard_walk.jl index 4807333f7bc7..d6f16e06ef4d 100644 --- a/src/standard_walk.jl +++ b/src/standard_walk.jl @@ -169,10 +169,9 @@ function bounding_vectors(I::Oscar.IdealGens) # TODO: Marked Gröbner basis gens_by_terms = terms.(I; ordering=ordering(I)) - v = [ - [leading_exponent_vector(lead) - leading_exponent_vector(t) for t in tail] - for (lead, tail) in Iterators.peel.(gens_by_terms) - ] + v = map(Iterators.peel.(gens_by_terms)) do (lead,tail) + Ref(leading_exponent_vector(lead)) .- leading_exponent_vector.(tail) + end return unique!(reduce(vcat, v)) end From 999418f6795217f0e29209046921a980c5903013 Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Tue, 23 Jul 2024 14:56:31 +0200 Subject: [PATCH 106/179] Remove old large tests --- test/groebner_walk.jl | 257 ------------------------------------------ 1 file changed, 257 deletions(-) delete mode 100644 test/groebner_walk.jl diff --git a/test/groebner_walk.jl b/test/groebner_walk.jl deleted file mode 100644 index f3e5620924e4..000000000000 --- a/test/groebner_walk.jl +++ /dev/null @@ -1,257 +0,0 @@ -@testset "Testing the Groebner Walk" begin - R, (a, b, c, d) = polynomial_ring( - Singular.N_ZpField(32003), - ["a", "b", "c", "d"], - ordering = :degrevlex, - ) - id = ideal( - R, - [ - 2 * a^2 * b + - 3 * a * b^2 + - 3 * b^3 + - 4 * c^3 + - 4 * a * b * d + - c^2 * d + - 2 * b * d^2 + - 2 * d^3 + - 4 * c^2 + - 2 * c * d + - 2 * c, - 2 * a^2 * b + - 5 * a^2 * c + - 2 * b * c^2 + - c^2 * d + - a * c + - 2 * b * d + - 2 * c * d + - d^2 + - a + - 4 * d, - ], - ) - - ideals = [] - infoLevel = 1 - for i ∈ 2:nvars(R) - push!(ideals, groebner_walk(id, degrevlex(R), lex(R), :perturbed, i)) - end - push!(ideals, groebner_walk(id, degrevlex(R), lex(R), :standard)) - # push!(ideals, groebnerwalk(id, degrevlex(R), lex(R), :tran)) - - push!(ideals, groebnerwalk(id, degrevlex(R), lex(R), :fractal)) - push!(ideals, groebnerwalk(id, degrevlex(R), lex(R), :fractal_start_order)) - push!(ideals, groebnerwalk(id, degrevlex(R), lex(R), :fractal_combined)) - push!(ideals, groebnerwalk(id, degrevlex(R), lex(R), :generic)) - - s = groebner_basis(id, ordering = lex(R), complete_reduction = true) - for i in ideals - i.isGB = true - @test equalitytest( - Oscar.IdealGens(R, gens(i), lex(R)), - s, - ) - end - - R, (x, y) = polynomial_ring(QQ, ["x", "y"], ordering = :degrevlex) - I = ideal([y^4 + x^3 - x^2 + x, x^4]) - id = groebnerwalk(I, degrevlex(R), lex(R), :tran) - - s = groebner_basis(I, ordering = lex(R), complete_reduction = true) - @test equalitytest( - Oscar.IdealGens(R, gens(id), lex(R)), - s, - ) - - @testset "backend-functions for the Groebner Walk" begin - - R, (x, y, z) = polynomial_ring( - QQ, - ["x", "y", "z"], - ordering = :degrevlex, - ) - - f1 = 3 * x^2 + 16 * x^2 * z + 14 * x^2 * y^3 - f2 = y^3 * z + 17 * x^2 * z^2 + 7 * x^2 * y^2 * z^2 + 13 * x^3 * z^2 - I = Oscar.IdealGens(R, [f1, f2], degrevlex(R)) - sol = [14 * x^2 * y^3, y^3 * z + 7 * x^2 * y^2 * z^2] - @test initials(I, [1, 3, 1]) == sol - - @test difference_lead_tail(I) == - [[0, 3, -1], [0, 3, 0], [-1, 2, 0], [2, -1, 1], [0, 2, 0]] - - F = [ - 13 * x^3 * z^2, - 14 * x^2 * y^3, - 98 * x * y^5 * z^2, - y^7 * z + x^2 * z^3, - 14 * x * y^6 * z, - ] - g = y^7 * z + x^2 * z^3 + 28 * x^2 * y^4 - q = Array{elem_type(R), 1}(undef, 5) - q[1] = R(0) - q[2] = R(2 * y) - q[3] = R(0) - q[4] = R(1) - q[5] = R(0) - @test division_algorithm(g, F, R) == q - - J = Oscar.IdealGens(R, [f2, f1]) - f1 = 4 * x^2 + 16 * x^2 * z + 14 * x^2 * y^3 - f2 = y^3 * z + 17 * x^2 * z^2 + 7 * x^2 * y^2 * z^2 + 13 * x^3 * z^2 - K = Oscar.IdealGens(R, [f1, f2]) - @test equalitytest(I, J) == true - @test equalitytest(I, K) == false - - @test deg(f1, 3) == 5 - - R, (x, y, z, t, u, v) = polynomial_ring( - Singular.N_ZpField(32003), - ["x", "y", "z", "t", "u", "v"], - ordering = :degrevlex, - ) - StartOrd = ordering_as_matrix(:degrevlex, 6) - TarOrd = ordering_as_matrix(:lex, 6) - f1 = 45 * y + 35 * u - 165 * v - 36 - f2 = 36 * y + 25 * z + 40 * t - 27 * u - f3 = 25 * y * u - 165 * v^2 + 15 * x - 18 * z + 30t - f4 = 15 * y * z + 20 * t * u - 9 * x - f5 = -11 * v^3 + x * y + 2 * z * t - f6 = -11 * u * v + 3 * v^2 + 99 * x - id = ideal(R, [f1, f2, f3, f4, f5, f6]) - I = groebner_basis(id, complete_reduction = true) - @test perturbed_vector(I, StartOrd, 1) == [1, 1, 1, 1, 1, 1] - @test perturbed_vector(I, StartOrd, 2) == [4, 4, 4, 4, 4, 3] - @test perturbed_vector(I, StartOrd, 3) == [49, 49, 49, 49, 48, 42] - @test perturbed_vector(I, StartOrd, 4) == - [1000, 1000, 1000, 999, 990, 900] - @test perturbed_vector(I, TarOrd, 1) == [1, 0, 0, 0, 0, 0] - @test perturbed_vector(I, TarOrd, 2) == [4, 1, 0, 0, 0, 0] - @test perturbed_vector(I, TarOrd, 3) == [49, 7, 1, 0, 0, 0] - @test perturbed_vector(I, TarOrd, 4) == [1000, 100, 10, 1, 0, 0] - - @test same_cone(I, add_weight_vector([1000, 1000, 1000, 999, 990, 900], TarOrd)) == true - @test same_cone(I, add_weight_vector([100, 1000, 1000, 999, 990, 900], TarOrd)) == false - - @test dot([1, 2, 3, 4], [2, 2, 2, 2]) == 20 - - R, (x, y, z) = polynomial_ring( - QQ, - ["x", "y", "z"], - ordering = :degrevlex, - ) - - f1 = 3 * x^2 - f2 = y^3 * z + 17 * x^2 * z^2 - I = ideal(R, [f1, f2]) - f1 = 3 * x^2 - f2 = y^3 * z - J = ideal(R, [f1, f2]) - f1 = x^3 * y^2 + z^2 + y^2 - f2 = y^3 - K = ideal(R, [f1, f2]) - - @test ismonomial(gens(I)) == false - @test ismonomial(gens(J)) == true - @test isbinomial(gens(I)) == true - @test isbinomial(gens(J)) == true - @test isbinomial(gens(K)) == false - @test ismonomial(gens(K)) == false - - R, (x, y) = polynomial_ring( - QQ, - ["x", "y"], - ordering = :degrevlex, - ) - - f1 = x^2 - y^3 - f2 = x^3 - y^2 - x - I = ideal(R, [f1, f2]) - G = groebner_basis(I, complete_reduction = true) - - @test next_gamma( - G, - [leading_term(g) for g in gens(G)], - [0], - ordering_as_matrix(:degrevlex, 2), - ordering_as_matrix(:lex, 2), - ) == [-2, 3] - - - g = [R(y^3 - x^2), R(x^3)] - G.ord = lex(R) - @test facet_initials( - G, - [leading_term(g) for g in G], - [-2, 3], - ) == g - G.ord = degrevlex(R) - @test difference_lead_tail( - G, - [leading_term(g) for g in gens(G)], ordering_as_matrix(:lex, 2), - ) == [[-2, 3], [3, -2], [2, 0]] - - @test isparallel([1, 2], [1, 4]) == false - @test isparallel([1, 2], [2, 4]) == true - @test isparallel([-1, 0], [-2, 1]) == false - @test isparallel([-1, 0], [2, 0]) == true - - @test less_facet( - [-2, 3], - [-1, 4], - ordering_as_matrix(:degrevlex, 2), - ordering_as_matrix(:lex, 2), - ) == true - @test less_facet( - [-1, 7], - [-1, 4], - ordering_as_matrix(:degrevlex, 2), - ordering_as_matrix(:lex, 2), - ) == false - - R, (a, b, c, d, e) = PolynomialRing( - QQ, - ["a", "b", "c", "d", "e"], - ordering = :degrevlex, - ) - J = ideal( - R, - [ - b + 3 * b^3 + 2 * b * c * e + 5 * b * d * e, - 4 + b^2 + 4 * b * c + 5 * b^3 + c * d * e, - d * e + 5 * b^2 * e, - ], - ) - I = groebner_basis(J, complete_reduction = true) - f1 = R( - a^3 + - a^2 + - b^5 * a^3 * c^9 + - e^3 + - b^2 * a^2 * c^4 + - d^3 + - e^3 + - b^2 * d^2 * e^7, - ) - f2 = R(a^3 * b^3) - f3 = R(a^2 * b^4 + c^2 + a^3 * 4 + a * e^3) - f4 = R(0) - - @test (reduce(f3, gens(I), ordering = degrevlex(R), complete_reduction = true)) == - reduce_walk(f3, gens(I), [leading_term(g) for g in gens(I)], degrevlex(R)) - @test (reduce(f2, gens(I), ordering = degrevlex(R), complete_reduction = true)) == - reduce_walk(f2, gens(I), [leading_term(g) for g in gens(I)], degrevlex(R)) - @test (reduce(f2, gens(I), ordering = degrevlex(R), complete_reduction = true)) == - reduce_walk(f2, gens(I), [leading_term(g) for g in gens(I)], degrevlex(R)) - @test (reduce(f4, gens(I), ordering = degrevlex(R), complete_reduction = true)) == - reduce_walk(f4, gens(I), [leading_term(g) for g in gens(I)], degrevlex(R)) - - J = groebner_basis(J, ordering = degrevlex(R), complete_reduction = false) - @test equalitytest( - groebner_basis(ideal(R, gens(J)), complete_reduction = true), Oscar.IdealGens(interreduce( - gens(J), - [leading_term(g) for g in gens(J)], - degrevlex(R), - )), - ) - end \ No newline at end of file From 2c23b6140cbfb502934ce740cdefa60a20ec28e6 Mon Sep 17 00:00:00 2001 From: Ortfs Date: Tue, 23 Jul 2024 15:13:55 +0200 Subject: [PATCH 107/179] added standard walk tests --- test/standard_walk_tests.jl | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 test/standard_walk_tests.jl diff --git a/test/standard_walk_tests.jl b/test/standard_walk_tests.jl new file mode 100644 index 000000000000..e0ed96415d83 --- /dev/null +++ b/test/standard_walk_tests.jl @@ -0,0 +1,28 @@ + +@testset "StandardWalk" begin + +R1, (x,y,z) = polynomial_ring(QQ, ["x", "y", "z"]) + +I1 = ideal([x^2 + y*z, x*y + z^2]) + +G1 = groebner_basis(I1) + +@test bounding_vectors(G1) == ZZ.([[1,1,-2],[2,-1,-1], [-1,2,-1]) +@test next_weight(G1, ZZ.([1,1,1]), ZZ.([1,0,0])) == ZZ.([1,1,1]) + + +I2 = ideal([z^3 - z^2 - 4]) +G2 = groebner_basis(I2) + +@test bounding_vectors(G2) == ZZ.([[0,0,1],[0,0,3]]) + + +I3 = ideal([x^6 - 1]) +G3 = groebner_basis(I3) +@test bounding_vectors(G3) == ZZ.([[6,0,0]]) +@test next_weight(G3, ZZ.([1,1,1]), ZZ.([1,0,0])) == ZZ.([1,0,0]) + + + + +end From 8af2707a0e4d6a76a5f54cd5f3b8188831e9e2dd Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Tue, 23 Jul 2024 15:30:39 +0200 Subject: [PATCH 108/179] Fix errors from CI --- src/GroebnerWalk.jl | 5 ++--- test/runtests.jl | 1 + test/{standard_walk_tests.jl => standard_walk.jl} | 12 ++++-------- 3 files changed, 7 insertions(+), 11 deletions(-) create mode 100644 test/runtests.jl rename test/{standard_walk_tests.jl => standard_walk.jl} (74%) diff --git a/src/GroebnerWalk.jl b/src/GroebnerWalk.jl index 97efd07f6937..aad24a539f17 100644 --- a/src/GroebnerWalk.jl +++ b/src/GroebnerWalk.jl @@ -1,5 +1,7 @@ module GroebnerWalk using Oscar +import Oscar: weight_ordering, ZZRingElem, MonomialOrdering, ZZMatrix, IdealGens +import Oscar.Orderings: MatrixOrdering, _support_indices include("markedGB.jl") include("common.jl") @@ -8,9 +10,6 @@ include("standard_walk.jl") include("generic_walk.jl") include("perturbed_walk.jl") -import Oscar: weight_ordering, ZZRingElem, MonomialOrdering, ZZMatrix, IdealGens -import Oscar.Orderings: MatrixOrdering, _support_indices - export groebner_walk function __init__() diff --git a/test/runtests.jl b/test/runtests.jl new file mode 100644 index 000000000000..1358fd85bf25 --- /dev/null +++ b/test/runtests.jl @@ -0,0 +1 @@ +include("standard_walk.jl") diff --git a/test/standard_walk_tests.jl b/test/standard_walk.jl similarity index 74% rename from test/standard_walk_tests.jl rename to test/standard_walk.jl index e0ed96415d83..bbd97787493f 100644 --- a/test/standard_walk_tests.jl +++ b/test/standard_walk.jl @@ -1,28 +1,24 @@ - @testset "StandardWalk" begin R1, (x,y,z) = polynomial_ring(QQ, ["x", "y", "z"]) I1 = ideal([x^2 + y*z, x*y + z^2]) - G1 = groebner_basis(I1) +@test groebner_walk(I1) == groebner_basis(I1; ordering=lex(R1)) @test bounding_vectors(G1) == ZZ.([[1,1,-2],[2,-1,-1], [-1,2,-1]) @test next_weight(G1, ZZ.([1,1,1]), ZZ.([1,0,0])) == ZZ.([1,1,1]) - I2 = ideal([z^3 - z^2 - 4]) G2 = groebner_basis(I2) - +@test groebner_walk(I2) == groebner_basis(I2; ordering=lex(R1)) @test bounding_vectors(G2) == ZZ.([[0,0,1],[0,0,3]]) I3 = ideal([x^6 - 1]) G3 = groebner_basis(I3) + +@test groebner_walk(I3) == groebner_basis(I3; ordering=lex(R1)) @test bounding_vectors(G3) == ZZ.([[6,0,0]]) @test next_weight(G3, ZZ.([1,1,1]), ZZ.([1,0,0])) == ZZ.([1,0,0]) - - - - end From 4770760ccf3fb9ef2c7d88b7fdea5afb7fd0b5de Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Tue, 23 Jul 2024 15:47:04 +0200 Subject: [PATCH 109/179] Remove redundant runtests --- test/runtests.jl | 1 - test/standard_walk.jl | 23 +++++++++++------------ 2 files changed, 11 insertions(+), 13 deletions(-) delete mode 100644 test/runtests.jl diff --git a/test/runtests.jl b/test/runtests.jl deleted file mode 100644 index 1358fd85bf25..000000000000 --- a/test/runtests.jl +++ /dev/null @@ -1 +0,0 @@ -include("standard_walk.jl") diff --git a/test/standard_walk.jl b/test/standard_walk.jl index bbd97787493f..b9965b4ae0a8 100644 --- a/test/standard_walk.jl +++ b/test/standard_walk.jl @@ -1,24 +1,23 @@ -@testset "StandardWalk" begin - R1, (x,y,z) = polynomial_ring(QQ, ["x", "y", "z"]) I1 = ideal([x^2 + y*z, x*y + z^2]) G1 = groebner_basis(I1) -@test groebner_walk(I1) == groebner_basis(I1; ordering=lex(R1)) -@test bounding_vectors(G1) == ZZ.([[1,1,-2],[2,-1,-1], [-1,2,-1]) -@test next_weight(G1, ZZ.([1,1,1]), ZZ.([1,0,0])) == ZZ.([1,1,1]) - I2 = ideal([z^3 - z^2 - 4]) G2 = groebner_basis(I2) -@test groebner_walk(I2) == groebner_basis(I2; ordering=lex(R1)) -@test bounding_vectors(G2) == ZZ.([[0,0,1],[0,0,3]]) - I3 = ideal([x^6 - 1]) G3 = groebner_basis(I3) -@test groebner_walk(I3) == groebner_basis(I3; ordering=lex(R1)) -@test bounding_vectors(G3) == ZZ.([[6,0,0]]) -@test next_weight(G3, ZZ.([1,1,1]), ZZ.([1,0,0])) == ZZ.([1,0,0]) +@testset "StandardWalk" begin + @test is_groebner_basis(groebner_walk(I1); ordering=lex(R1)) + #@test bounding_vectors(G1) == Vector{ZZRingElem}.([[1,1,-2],[2,-1,-1], [-1,2,-1]]) + #@test next_weight(G1, ZZ.([1,1,1]), ZZ.([1,0,0])) == ZZ.([1,1,1]) + + @test is_groebner_basis(groebner_walk(I2); ordering=lex(R1)) + #@test bounding_vectors(G2) == ZZ.([[0,0,1],[0,0,3]]) + + @test is_groebner_basis(groebner_walk(I3); ordering=lex(R1)) + #@test bounding_vectors(G3) == ZZ.([[6,0,0]]) + #@test next_weight(G3, ZZ.([1,1,1]), ZZ.([1,0,0])) == ZZ.([1,0,0]) end From 916216f58b9daad6a475c6234be39192358109aa Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Tue, 23 Jul 2024 16:02:21 +0200 Subject: [PATCH 110/179] Move definitions into testset --- test/standard_walk.jl | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/test/standard_walk.jl b/test/standard_walk.jl index b9965b4ae0a8..cc5b74d93091 100644 --- a/test/standard_walk.jl +++ b/test/standard_walk.jl @@ -1,15 +1,15 @@ -R1, (x,y,z) = polynomial_ring(QQ, ["x", "y", "z"]) - -I1 = ideal([x^2 + y*z, x*y + z^2]) -G1 = groebner_basis(I1) +@testset "StandardWalk" begin + R1, (x,y,z) = polynomial_ring(QQ, ["x", "y", "z"]) + + I1 = ideal([x^2 + y*z, x*y + z^2]) + G1 = groebner_basis(I1) -I2 = ideal([z^3 - z^2 - 4]) -G2 = groebner_basis(I2) + I2 = ideal([z^3 - z^2 - 4]) + G2 = groebner_basis(I2) -I3 = ideal([x^6 - 1]) -G3 = groebner_basis(I3) + I3 = ideal([x^6 - 1]) + G3 = groebner_basis(I3) -@testset "StandardWalk" begin @test is_groebner_basis(groebner_walk(I1); ordering=lex(R1)) #@test bounding_vectors(G1) == Vector{ZZRingElem}.([[1,1,-2],[2,-1,-1], [-1,2,-1]]) #@test next_weight(G1, ZZ.([1,1,1]), ZZ.([1,0,0])) == ZZ.([1,1,1]) From 35bc3ff7cfdfdd5fce1710c5549299fb8b98d231 Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Tue, 23 Jul 2024 15:45:58 +0200 Subject: [PATCH 111/179] Update experimental/GroebnerWalk/src/GroebnerWalk.jl MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Lars Göttgens (cherry picked from commit d5658bd0108e6e14a0f41ea5421f37849363a884) --- src/GroebnerWalk.jl | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/GroebnerWalk.jl b/src/GroebnerWalk.jl index aad24a539f17..ef291eb088ff 100644 --- a/src/GroebnerWalk.jl +++ b/src/GroebnerWalk.jl @@ -14,8 +14,6 @@ export groebner_walk function __init__() add_verbosity_scope(:groebner_walk) - - set_verbosity_level(:groebner_walk, 0) end end From 921cfca054ad0ab0a580f788ce1d9ebea2a9abdf Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Tue, 23 Jul 2024 16:00:23 +0200 Subject: [PATCH 112/179] Update experimental/GroebnerWalk/benchmark/agk.jl MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Lars Göttgens (cherry picked from commit b70f9e7e9e29e908da7750701f73282807aecccd) --- benchmark/agk.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/benchmark/agk.jl b/benchmark/agk.jl index 92bfc4d94c62..733ee2f22570 100644 --- a/benchmark/agk.jl +++ b/benchmark/agk.jl @@ -13,4 +13,4 @@ function agk4(k::Field) ] return ideal(F), o2, o1 -end \ No newline at end of file +end From 21d1d2723e7d3a0c82dc9733dd616982a0a44110 Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Tue, 23 Jul 2024 16:03:09 +0200 Subject: [PATCH 113/179] Update experimental/GroebnerWalk/benchmark/cyclic.jl MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Lars Göttgens (cherry picked from commit 9bc4357a727f508c061f6b51719449ad587391d4) --- benchmark/cyclic.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/benchmark/cyclic.jl b/benchmark/cyclic.jl index a595dc9930f5..fd838a204019 100644 --- a/benchmark/cyclic.jl +++ b/benchmark/cyclic.jl @@ -75,4 +75,4 @@ function cyclic8(k::Field=QQ) ] return ideal(F), lex(R), default_ordering(R) -end \ No newline at end of file +end From 0b70da05c0486f453ba6f99e2c57efe6d1767d13 Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Tue, 23 Jul 2024 17:19:14 +0200 Subject: [PATCH 114/179] Add newlines to end of file --- benchmark/agk.jl | 16 ----- benchmark/benchmarks.jl | 60 ------------------ benchmark/cyclic.jl | 78 ------------------------ benchmark/katsura.jl | 16 ----- benchmark/newellp1.jl | 1 + benchmark/tran3.3.jl | 3 +- examples/implicitization/agk4.jl | 1 + examples/implicitization/newellp1.jl | 3 +- examples/implicitization/tran3.3.jl | 3 +- examples/knapsack/fukuda_cuww1.jl | 3 +- examples/knapsack/fukuda_prob6.jl | 3 +- examples/knapsack/goodknap.jl | 3 +- examples/knapsack/knap.jl | 3 +- examples/knapsack/smallknap.jl | 3 +- examples/ku10.jl | 3 +- examples/randomQQ.jl | 3 +- examples/thesisexamples/chap3.jl | 1 + examples/thesisexamples/chap5_generic.jl | 3 +- examples/toy_example.jl | 3 +- examples/zero-dimensional/cyclic5.jl | 1 + examples/zero-dimensional/cyclic7.jl | 3 +- examples/zero-dimensional/finitefield.jl | 3 +- examples/zero-dimensional/katsura5.jl | 3 +- src/GroebnerWalk.jl | 1 + src/generic_walk.jl | 1 + src/markedGB.jl | 1 + src/perturbed_walk.jl | 1 + src/standard_walk.jl | 1 + test/standard_walk.jl | 1 + 29 files changed, 40 insertions(+), 185 deletions(-) diff --git a/benchmark/agk.jl b/benchmark/agk.jl index 733ee2f22570..e69de29bb2d1 100644 --- a/benchmark/agk.jl +++ b/benchmark/agk.jl @@ -1,16 +0,0 @@ -using Oscar - -function agk4(k::Field) - R, (x,y,z,u,v) = polynomial_ring(k, ["x","y","z","u","v"]) - - o1 = weight_ordering([1,1,1,0,0], degrevlex(R)) - o2 = weight_ordering([0,0,0,1,1], degrevlex(R)) - - F = [ - u + u^2 - 2*v - 2*u^2*v + 2*u*v^2 - x, - -6*u + 2*v + v^2 - 5*v^3 + 2*u*v^2 - 4*u^2*v^2 - y, - -2 + 2*u^2 + 6*v - 3*u^2*v^2 - z - ] - - return ideal(F), o2, o1 -end diff --git a/benchmark/benchmarks.jl b/benchmark/benchmarks.jl index 319cda48ce5f..e69de29bb2d1 100644 --- a/benchmark/benchmarks.jl +++ b/benchmark/benchmarks.jl @@ -1,60 +0,0 @@ -using Oscar -using GroebnerWalk -using BenchmarkTools - -include("cyclic.jl") -include("katsura.jl") -include("agk.jl") -include("tran3.3.jl") -include("newellp1.jl") - -function benchmark( - io, - name::String, - I::Ideal, - target::MonomialOrdering, - start::MonomialOrdering -) - print(io, name, ","); flush(io) - t = @belapsed groebner_walk($I, $target, $start; algorithm=:standard) seconds=20000 samples=10 - print(io, t, ","); flush(io) - t = @belapsed groebner_walk($I, $target, $start; algorithm=:generic) seconds=20000 samples=10 - print(io, t, ","); flush(io) - t = @belapsed groebner_walk($I, $target, $start; algorithm=:perturbed) seconds=20000 samples=10 - print(io, t, ","); flush(io) - t = @belapsed groebner_basis($I; ordering=$target) seconds=20000 samples=10 - println(io, t); flush(io) -end - -function print_header(io) - print(io, "name,standard_walk,generic_walk,perturbed_walk,buchberger\n") -end - -p = 11863279 -Fp = GF(p) -open("results.csv", "a") do io - R, (x, y) = QQ[:x, :y] - I = ideal([y^4 + x^3 - x^2 + x, x^4]) - benchmark(io, "simple", I, lex(R), default_ordering(R)) - - benchmark(io, "cyclic5-QQ", cyclic5(QQ)...) - benchmark(io, "cyclic5-Fp", cyclic5(Fp)...) - - benchmark(io, "cyclic6-QQ", cyclic6(QQ)...) - benchmark(io, "cyclic6-Fp", cyclic6(Fp)...) - - benchmark(io, "katsura6-QQ", katsura6(QQ)...) - benchmark(io, "katsura6-Fp", katsura6(Fp)...) - - benchmark(io, "cyclic7-QQ", cyclic7(QQ)...) - benchmark(io, "cyclic7-Fp", cyclic7(Fp)...) - - benchmark(io, "agk4-QQ", agk4(QQ)...) - benchmark(io, "agk4-Fp", agk4(Fp)...) - - benchmark(io, "tran3.3-QQ", tran33(QQ)...) - benchmark(io, "tran3.3-Fp", tran33(Fp)...) - - benchmark(io, "newellp1-QQ", newellp1(QQ)...) - benchmark(io, "newellp1-Fp", newellp1(Fp)...) -end diff --git a/benchmark/cyclic.jl b/benchmark/cyclic.jl index fd838a204019..e69de29bb2d1 100644 --- a/benchmark/cyclic.jl +++ b/benchmark/cyclic.jl @@ -1,78 +0,0 @@ -using Oscar - -function cyclic5(k::Field=QQ) - R, (a,b,c,d,x) = k[:a,:b,:c,:d,:x] - F = [ - a + b + c + d + x, - a*b + b*c + c*d + d*x + x*a, - a*b*c + b*c*d + c*d*x + d*x*a + x*a*b, - a*b*c*d + b*c*d*x + c*d*x*a + d*x*a*b + x*a*b*c, - a*b*c*d*x - 1 - ] - - return ideal(F), lex(R), default_ordering(R) -end - -function cyclic6(k::Field=QQ) - R, (z0,z1,z2,z3,z4,z5) = k[:z0,:z1,:z2,:z3,:z4,:z5] - F = [ - z0 + z1 + z2 + z3 + z4 + z5, - z0*z1 + z1*z2 + z2*z3 + z3*z4 + z4*z5 + z5*z0, - z0*z1*z2 + z1*z2*z3 + z2*z3*z4 + z3*z4*z5 + z4*z5*z0 + z5*z0*z1, - z0*z1*z2*z3 + z1*z2*z3*z4 + z2*z3*z4*z5 + z3*z4*z5*z0 + z4*z5*z0*z1 - + z5*z0*z1*z2, - z0*z1*z2*z3*z4 + z1*z2*z3*z4*z5 + z2*z3*z4*z5*z0 + z3*z4*z5*z0*z1 - + z4*z5*z0*z1*z2 + z5*z0*z1*z2*z3, - z0*z1*z2*z3*z4*z5 - 1 - ] - - return ideal(F), lex(R), default_ordering(R) -end - -function cyclic7(k::Field=QQ) - R, (z0, z1, z2, z3, z4, z5, z6) = QQ[:z0, :z1, :z2, :z3, :z4, :z5, :z6] - F = [ - z0 + z1 + z2 + z3 + z4 + z5 + z6, - z0 * z1 + z1 * z2 + z2 * z3 + z3 * z4 + z4 * z5 + z5 * z6 + z6 * z0, - z0 * z1 * z2 + z1 * z2 * z3 + z2 * z3 * z4 + z3 * z4 * z5 + z4 * z5 * z6 + z5 * z6 * z0 + z6 * z0 * z1, - z0 * z1 * z2 * z3 + z1 * z2 * z3 * z4 + z2 * z3 * z4 * z5 + z3 * z4 * z5 * z6 + z4 * z5 * z6 * z0 - + z5 * z6 * z0 * z1 + z6 * z0 * z1 * z2, - z0 * z1 * z2 * z3 * z4 + z1 * z2 * z3 * z4 * z5 + z2 * z3 * z4 * z5 * z6 + z3 * z4 * z5 * z6 * z0 - + z4 * z5 * z6 * z0 * z1 + z5 * z6 * z0 * z1 * z2 + z6 * z0 * z1 * z2 * z3, - z0 * z1 * z2 * z3 * z4 * z5 + z1 * z2 * z3 * z4 * z5 * z6 + z2 * z3 * z4 * z5 * z6 * z0 + z3 * z4 * z5 * z6 * z0 * z1 - + z4 * z5 * z6 * z0 * z1 * z2 + z5 * z6 * z0 * z1 * z2 * z3 + z6 * z0 * z1 * z2 * z3 * z4, - z0 * z1 * z2 * z3 * z4 * z5 * z6 - 1 - ] - - return ideal(F), lex(R), default_ordering(R) -end - -function cyclic8(k::Field=QQ) - R, (z0, z1, z2, z3, z4, z5, z6, z7) = k[:z0, :z1, :z2, :z3, :z4, :z5, :z6, :z7] - - F = [ - z0 + z1 + z2 + z3 + z4 + z5 + z6 + z7, - - z0*z1 + z1*z2 + z2*z3 + z3*z4 + z4*z5 + z5*z6 + z6*z7 + z7*z0, - - z0*z1*z2 + z1*z2*z3 + z2*z3*z4 + z3*z4*z5 + z4*z5*z6 + z5*z6*z7 - + z6*z7*z0 + z7*z0*z1, - - z0*z1*z2*z3 + z1*z2*z3*z4 + z2*z3*z4*z5 + z3*z4*z5*z6 + z4*z5*z6*z7 - + z5*z6*z7*z0 + z6*z7*z0*z1 + z7*z0*z1*z2, - - z0*z1*z2*z3*z4 + z1*z2*z3*z4*z5 + z2*z3*z4*z5*z6 + z3*z4*z5*z6*z7 - + z4*z5*z6*z7*z0 + z5*z6*z7*z0*z1 + z6*z7*z0*z1*z2 + z7*z0*z1*z2*z3, - - z0*z1*z2*z3*z4*z5 + z1*z2*z3*z4*z5*z6 + z2*z3*z4*z5*z6*z7 + z3*z4*z5*z6*z7*z0 - + z4*z5*z6*z7*z0*z1 + z5*z6*z7*z0*z1*z2 + z6*z7*z0*z1*z2*z3 + z7*z0*z1*z2*z3*z4, - - z0*z1*z2*z3*z4*z5*z6 + z1*z2*z3*z4*z5*z6*z7 + z2*z3*z4*z5*z6*z7*z0 - + z3*z4*z5*z6*z7*z0*z1 + z4*z5*z6*z7*z0*z1*z2 + z5*z6*z7*z0*z1*z2*z3 - + z6*z7*z0*z1*z2*z3*z4 + z7*z0*z1*z2*z3*z4*z5, - - z0*z1*z2*z3*z4*z5*z6*z7 - 1 - ] - - return ideal(F), lex(R), default_ordering(R) -end diff --git a/benchmark/katsura.jl b/benchmark/katsura.jl index edc3b5e707b5..e69de29bb2d1 100644 --- a/benchmark/katsura.jl +++ b/benchmark/katsura.jl @@ -1,16 +0,0 @@ -using Oscar - -function katsura6(k::Field=QQ) - R, (x1, x2, x3, x4, x5, x6, x7) = k[:x1, :x2, :x3, :x4, :x5, :x6, :x7] - F = [ - 1*x1+2*x2+2*x3+2*x4+2*x5+2*x6+2*x7-1, - 2*x4*x3+2*x5*x2+2*x6*x1+2*x7*x2-1*x6, - 1*x3^2+2*x4*x2+2*x5*x1+2*x6*x2+2*x7*x3-1*x5, - 2*x3*x2+2*x4*x1+2*x5*x2+2*x6*x3+2*x7*x4-1*x4, - 1*x2^2+2*x3*x1+2*x4*x2+2*x5*x3+2*x6*x4+2*x7*x5-1*x3, - 2*x2*x1+2*x3*x2+2*x4*x3+2*x5*x4+2*x6*x5+2*x7*x6-1*x2, - 1*x1^2+2*x2^2+2*x3^2+2*x4^2+2*x5^2+2*x6^2+2*x7^2-1*x1 - ]; - - return ideal(F), lex(R), default_ordering(R) -end \ No newline at end of file diff --git a/benchmark/newellp1.jl b/benchmark/newellp1.jl index 5aebd84cfe79..4fd8945403ea 100644 --- a/benchmark/newellp1.jl +++ b/benchmark/newellp1.jl @@ -32,3 +32,4 @@ function newellp1(k::Field) o2 = matrix_ordering(R, [0 0 0 1 1; 1 1 1 0 0; 1 1 0 0 0; 1 0 0 0 0; 0 0 0 1 0]) return ideal(integral_F), o2, o1 end + diff --git a/benchmark/tran3.3.jl b/benchmark/tran3.3.jl index e31d482f9b26..565a108a482a 100644 --- a/benchmark/tran3.3.jl +++ b/benchmark/tran3.3.jl @@ -6,4 +6,5 @@ function tran33(k::Field) F = [16 + 3*x^3+16*x^2*z+14*x^2*y^3, 6+y^3*z+17*x^2*z^2+7*x*y^2*z^2+13*x^3*z^2] return ideal(F), lex(R), default_ordering(R) -end \ No newline at end of file +end + diff --git a/examples/implicitization/agk4.jl b/examples/implicitization/agk4.jl index 6efe09bdb2c2..41a54c6adf90 100644 --- a/examples/implicitization/agk4.jl +++ b/examples/implicitization/agk4.jl @@ -17,3 +17,4 @@ I = ideal([ set_verbosity_level(:groebner_walk, 1) G = groebner_walk(I, o2, o1; algorithm=:standard) + diff --git a/examples/implicitization/newellp1.jl b/examples/implicitization/newellp1.jl index 4331d713a258..28820f3fe012 100644 --- a/examples/implicitization/newellp1.jl +++ b/examples/implicitization/newellp1.jl @@ -19,4 +19,5 @@ o1 = matrix_ordering(R, [1 1 1 0 0; 0 0 0 1 1; 0 0 0 1 0; 1 1 0 0 0; 1 0 0 0 0]) o2 = matrix_ordering(R, [0 0 0 1 1; 1 1 1 0 0; 1 1 0 0 0; 1 0 0 0 0; 0 0 0 1 0]) set_verbosity_level(:groebner_walk, 1) -G = groebner_walk(I, o2, o1; algorithm=:standard) \ No newline at end of file +G = groebner_walk(I, o2, o1; algorithm=:standard) + diff --git a/examples/implicitization/tran3.3.jl b/examples/implicitization/tran3.3.jl index f333a8fc54b3..b7218f90e964 100644 --- a/examples/implicitization/tran3.3.jl +++ b/examples/implicitization/tran3.3.jl @@ -8,4 +8,5 @@ R, (x,y,z) = polynomial_ring(QQ, ["x","y","z"]) I = ideal([16 + 3*x^3+16*x^2*z+14*x^2*y^3, 6+y^3*z+17*x^2*z^2+7*x*y^2*z^2+13*x^3*z^2]) set_verbosity_level(:groebner_walk, 1) -Gs = groebner_walk(I, lex(R), algorithm =:standard) \ No newline at end of file +Gs = groebner_walk(I, lex(R), algorithm =:standard) + diff --git a/examples/knapsack/fukuda_cuww1.jl b/examples/knapsack/fukuda_cuww1.jl index 1d03dd1ad734..b6c8a3f763e0 100644 --- a/examples/knapsack/fukuda_cuww1.jl +++ b/examples/knapsack/fukuda_cuww1.jl @@ -20,4 +20,5 @@ set_verbosity_level(:groebner_walk, 1) o_t = weight_ordering([1, 0, 0, 0, 0, 0], degrevlex(R)) o_s = weight_ordering([0, 1, 1, 1, 1, 1], degrevlex(R)) -ts = @elapsed Gs = groebner_walk(I, o_t, o_s, algorithm=:standard) \ No newline at end of file +ts = @elapsed Gs = groebner_walk(I, o_t, o_s, algorithm=:standard) + diff --git a/examples/knapsack/fukuda_prob6.jl b/examples/knapsack/fukuda_prob6.jl index 120f2e8ec331..8fad02af77f8 100644 --- a/examples/knapsack/fukuda_prob6.jl +++ b/examples/knapsack/fukuda_prob6.jl @@ -42,4 +42,5 @@ o_s = matrix_ordering(R, [ 1 1 1 1 1 1 1 1 1 0 0; 1 1 1 1 1 1 1 1 1 1 0]) -groebner_walk(I, o_t, o_s, algorithm =:generic) #>1hr \ No newline at end of file +groebner_walk(I, o_t, o_s, algorithm =:generic) #>1hr + diff --git a/examples/knapsack/goodknap.jl b/examples/knapsack/goodknap.jl index 5d815921748e..0846f79fa0a3 100644 --- a/examples/knapsack/goodknap.jl +++ b/examples/knapsack/goodknap.jl @@ -32,4 +32,5 @@ tb = @elapsed Gb = groebner_basis(I, ordering = o_t, complete_reduction = true) tf = @elapsed Gf = groebner_basis(I, ordering = o_t, complete_reduction = true, algorithm =:fglm) #error: dimension of ideal must be zero! -th = @elapsed Gh = groebner_basis(I, ordering = o_t, complete_reduction = true, algorithm =:hilbert) #throws another error \ No newline at end of file +th = @elapsed Gh = groebner_basis(I, ordering = o_t, complete_reduction = true, algorithm =:hilbert) #throws another error + diff --git a/examples/knapsack/knap.jl b/examples/knapsack/knap.jl index b95accf3e8e3..55861bce121a 100644 --- a/examples/knapsack/knap.jl +++ b/examples/knapsack/knap.jl @@ -17,4 +17,5 @@ set_verbosity_level(:groebner_walk, 1) o_t = weight_ordering([1,0,0,0,0,0,0], degrevlex(R)) o_s = weight_ordering([0,1,1,1,1,1,1], degrevlex(R)) -Gg = groebner_walk(I, o_t, o_s, algorithm =:generic) #300s \ No newline at end of file +Gg = groebner_walk(I, o_t, o_s, algorithm =:generic) #300s + diff --git a/examples/knapsack/smallknap.jl b/examples/knapsack/smallknap.jl index 1c773b7bb705..542bf27bd0b5 100644 --- a/examples/knapsack/smallknap.jl +++ b/examples/knapsack/smallknap.jl @@ -15,4 +15,5 @@ set_verbosity_level(:groebner_walk, 1) o_t = weight_ordering([1,0,0,0], degrevlex(R)) o_s = weight_ordering([0,1,1,1], degrevlex(R)) -Gg = groebner_walk(I, o_t, o_s, algorithm =:generic) \ No newline at end of file +Gg = groebner_walk(I, o_t, o_s, algorithm =:generic) + diff --git a/examples/ku10.jl b/examples/ku10.jl index 7fd46d699697..29b49d9d040e 100644 --- a/examples/ku10.jl +++ b/examples/ku10.jl @@ -21,4 +21,5 @@ set_verbosity_level(:groebner_walk, 1) t_s = @elapsed Gs = groebner_walk(I, lex(R), algorithm =:standard) t_g = @elapsed Gg = groebner_walk(I, lex(R), algorithm =:generic) -t_p = @elapsed Gp = groebner_walk(I, lex(R), algorithm =:perturbed) \ No newline at end of file +t_p = @elapsed Gp = groebner_walk(I, lex(R), algorithm =:perturbed) + diff --git a/examples/randomQQ.jl b/examples/randomQQ.jl index 479551a144d6..580c181bc165 100644 --- a/examples/randomQQ.jl +++ b/examples/randomQQ.jl @@ -28,4 +28,5 @@ t_s = @elapsed Gs = groebner_walk(I, lex(R), algorithm =:standard) #11.3, one co t_g = @elapsed Gg = groebner_walk(I, lex(R), algorithm =:generic) #14.4 -t_p = @elapsed Gp = groebner_walk(I, lex(R), algorithm =:perturbed) #11.49 \ No newline at end of file +t_p = @elapsed Gp = groebner_walk(I, lex(R), algorithm =:perturbed) #11.49 + diff --git a/examples/thesisexamples/chap3.jl b/examples/thesisexamples/chap3.jl index 003f8652d197..d3189e4f4870 100644 --- a/examples/thesisexamples/chap3.jl +++ b/examples/thesisexamples/chap3.jl @@ -21,3 +21,4 @@ Glex = groebner_basis(I; ordering = ot, complete_reduction = true) G1 = groebner_walk(I, ot, os, algorithm = :generic) G2 = groebner_walk(I, ot, os, algorithm = :standard) + diff --git a/examples/thesisexamples/chap5_generic.jl b/examples/thesisexamples/chap5_generic.jl index 24c5cb2acd00..efbe16b12244 100644 --- a/examples/thesisexamples/chap5_generic.jl +++ b/examples/thesisexamples/chap5_generic.jl @@ -35,4 +35,5 @@ R2, (x,y) = polynomial_ring(QQ, ["x","y"]) I2 = ideal([x^2-y^3, x^3 -y^2 - x]) G2 = groebner_basis(I2) -#= Fukuda Jensen example \ No newline at end of file +#= Fukuda Jensen example + diff --git a/examples/toy_example.jl b/examples/toy_example.jl index 38c10135cf14..8b95c6ea3336 100644 --- a/examples/toy_example.jl +++ b/examples/toy_example.jl @@ -7,4 +7,5 @@ I = ideal([y^4+ x^3-x^2+x,x^4]) set_verbosity_level(:groebner_walk, 1) groebner_walk(I) -groebner_walk(I; algorithm=:generic) \ No newline at end of file +groebner_walk(I; algorithm=:generic) + diff --git a/examples/zero-dimensional/cyclic5.jl b/examples/zero-dimensional/cyclic5.jl index 1d206fdb3f9d..f9c72c729fb7 100644 --- a/examples/zero-dimensional/cyclic5.jl +++ b/examples/zero-dimensional/cyclic5.jl @@ -18,3 +18,4 @@ set_verbosity_level(:groebner_walk, 1) Gs = groebner_walk(I, lex(R), algorithm=:standard) Gg = groebner_walk(I, lex(R), algorithm=:generic) + diff --git a/examples/zero-dimensional/cyclic7.jl b/examples/zero-dimensional/cyclic7.jl index d67444c18106..ae998cd33997 100644 --- a/examples/zero-dimensional/cyclic7.jl +++ b/examples/zero-dimensional/cyclic7.jl @@ -26,4 +26,5 @@ I = ideal([ set_verbosity_level(:groebner_walk, 1) Gs = groebner_walk(I, lex(R), algorithm =:standard) -Gg = groebner_walk(I, lex(R), algorithm =:generic) \ No newline at end of file +Gg = groebner_walk(I, lex(R), algorithm =:generic) + diff --git a/examples/zero-dimensional/finitefield.jl b/examples/zero-dimensional/finitefield.jl index a45bd6117f20..e26f77e3818b 100644 --- a/examples/zero-dimensional/finitefield.jl +++ b/examples/zero-dimensional/finitefield.jl @@ -14,4 +14,5 @@ J = ideal(R, [ t_s = @elapsed Gs = groebner_walk(J, lex(R), algorithm=:standard) #4.11 t_g = @elapsed Gg = groebner_walk(J, lex(R), algorithm=:generic) #0.8s -t_p = @elapsed Gp = groebner_walk(J, lex(R), algorithm=:perturbed) #0.33s \ No newline at end of file +t_p = @elapsed Gp = groebner_walk(J, lex(R), algorithm=:perturbed) #0.33s + diff --git a/examples/zero-dimensional/katsura5.jl b/examples/zero-dimensional/katsura5.jl index f2897179406b..3f429806b1b5 100644 --- a/examples/zero-dimensional/katsura5.jl +++ b/examples/zero-dimensional/katsura5.jl @@ -20,4 +20,5 @@ set_verbosity_level(:groebner_walk, 0) t_s = @elapsed Gs = groebner_walk(I, lex(R), algorithm=:standard) t_g = @elapsed Gg = groebner_walk(I, lex(R), algorithm=:generic) -t_b = @elapsed Gb = groebner_basis(I, ordering=lex(R)) \ No newline at end of file +t_b = @elapsed Gb = groebner_basis(I, ordering=lex(R)) + diff --git a/src/GroebnerWalk.jl b/src/GroebnerWalk.jl index ef291eb088ff..bede5b227857 100644 --- a/src/GroebnerWalk.jl +++ b/src/GroebnerWalk.jl @@ -17,3 +17,4 @@ function __init__() end end + diff --git a/src/generic_walk.jl b/src/generic_walk.jl index c50aa7fb815e..4676c6a527f1 100644 --- a/src/generic_walk.jl +++ b/src/generic_walk.jl @@ -243,3 +243,4 @@ function is_parallel(u::Vector{ZZRingElem}, v::Vector{ZZRingElem}) end #TODO: add tests + diff --git a/src/markedGB.jl b/src/markedGB.jl index 24c6fd13b786..7606cb47aa3a 100644 --- a/src/markedGB.jl +++ b/src/markedGB.jl @@ -119,3 +119,4 @@ function autoreduce!(MG::MarkedGroebnerBasis) MG.gens[i] = nf end end + diff --git a/src/perturbed_walk.jl b/src/perturbed_walk.jl index 5fc22fc716c8..93da4e4a104f 100644 --- a/src/perturbed_walk.jl +++ b/src/perturbed_walk.jl @@ -87,3 +87,4 @@ function perturbed_vector(G::Oscar.IdealGens, M::ZZMatrix, p::Int) return convert_bounding_vector(w) end + diff --git a/src/standard_walk.jl b/src/standard_walk.jl index d6f16e06ef4d..7363aab77101 100644 --- a/src/standard_walk.jl +++ b/src/standard_walk.jl @@ -209,3 +209,4 @@ function lift( return G end + diff --git a/test/standard_walk.jl b/test/standard_walk.jl index cc5b74d93091..590c2bf6556f 100644 --- a/test/standard_walk.jl +++ b/test/standard_walk.jl @@ -21,3 +21,4 @@ #@test bounding_vectors(G3) == ZZ.([[6,0,0]]) #@test next_weight(G3, ZZ.([1,1,1]), ZZ.([1,0,0])) == ZZ.([1,0,0]) end + From 5ea1f2321bd128cadc5e6e9b0406a5f3d07d4fcf Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Tue, 23 Jul 2024 17:45:09 +0200 Subject: [PATCH 115/179] Add Manifest.toml for reproducibility of examples and benchmarks --- Manifest.toml | 866 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 866 insertions(+) create mode 100644 Manifest.toml diff --git a/Manifest.toml b/Manifest.toml new file mode 100644 index 000000000000..958e0df8dfc6 --- /dev/null +++ b/Manifest.toml @@ -0,0 +1,866 @@ +# This file is machine-generated - editing it directly is not advised + +julia_version = "1.10.4" +manifest_format = "2.0" +project_hash = "7b8b7fa40622a7447c252b8f8df9e2af9252c76a" + +[[deps.ASL_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "6252039f98492252f9e47c312c8ffda0e3b9e78d" +uuid = "ae81ac8f-d209-56e5-92de-9978fef736f9" +version = "0.1.3+0" + +[[deps.AbstractAlgebra]] +deps = ["InteractiveUtils", "LinearAlgebra", "MacroTools", "Preferences", "Random", "RandomExtensions", "SparseArrays", "Test"] +git-tree-sha1 = "841dd303b9c7b06fd0e01fd04664a75bccc543ab" +uuid = "c3fe647b-3220-5bb0-a1ea-a7954cac585d" +version = "0.41.10" + +[[deps.Adapt]] +deps = ["LinearAlgebra", "Requires"] +git-tree-sha1 = "6a55b747d1812e699320963ffde36f1ebdda4099" +uuid = "79e6a3ab-5dfb-504d-930d-738a2a938a0e" +version = "4.0.4" +weakdeps = ["StaticArrays"] + + [deps.Adapt.extensions] + AdaptStaticArraysExt = "StaticArrays" + +[[deps.AlgebraicSolving]] +deps = ["LinearAlgebra", "Logging", "LoopVectorization", "Markdown", "Nemo", "Printf", "Random", "StaticArrays", "Test", "msolve_jll"] +git-tree-sha1 = "6ed4d44c604045dae661c5971bbfa964fbc93b5f" +uuid = "66b61cbe-0446-4d5d-9090-1ff510639f9d" +version = "0.4.16" + +[[deps.ArgTools]] +uuid = "0dad84c5-d112-42e6-8d28-ef12dabb789f" +version = "1.1.1" + +[[deps.ArrayInterface]] +deps = ["Adapt", "LinearAlgebra", "SparseArrays", "SuiteSparse"] +git-tree-sha1 = "5c9b74c973181571deb6442d41e5c902e6b9f38e" +uuid = "4fba245c-0d91-5ea0-9b3e-6abc04ee57a9" +version = "7.12.0" + + [deps.ArrayInterface.extensions] + ArrayInterfaceBandedMatricesExt = "BandedMatrices" + ArrayInterfaceBlockBandedMatricesExt = "BlockBandedMatrices" + ArrayInterfaceCUDAExt = "CUDA" + ArrayInterfaceCUDSSExt = "CUDSS" + ArrayInterfaceChainRulesExt = "ChainRules" + ArrayInterfaceGPUArraysCoreExt = "GPUArraysCore" + ArrayInterfaceReverseDiffExt = "ReverseDiff" + ArrayInterfaceStaticArraysCoreExt = "StaticArraysCore" + ArrayInterfaceTrackerExt = "Tracker" + + [deps.ArrayInterface.weakdeps] + BandedMatrices = "aae01518-5342-5314-be14-df237901396f" + BlockBandedMatrices = "ffab5731-97b5-5995-9138-79e8c1846df0" + CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba" + CUDSS = "45b445bb-4962-46a0-9369-b4df9d0f772e" + ChainRules = "082447d4-558c-5d27-93f4-14fc19e9eca2" + GPUArraysCore = "46192b85-c4d5-4398-a991-12ede77f4527" + ReverseDiff = "37e2e3b7-166d-5795-8a7a-e32c996b4267" + StaticArraysCore = "1e83bf80-4336-4d27-bf5d-d5a4f845583c" + Tracker = "9f7883ad-71c0-57eb-9f7f-b5c9e6d3789c" + +[[deps.Artifacts]] +uuid = "56f22d72-fd6d-98f1-02f0-08ddc0907c33" + +[[deps.Base64]] +uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f" + +[[deps.BenchmarkTools]] +deps = ["JSON", "Logging", "Printf", "Profile", "Statistics", "UUIDs"] +git-tree-sha1 = "f1dff6729bc61f4d49e140da1af55dcd1ac97b2f" +uuid = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf" +version = "1.5.0" + +[[deps.BinaryWrappers]] +deps = ["JLLWrappers", "Scratch"] +git-tree-sha1 = "7fea8f658689fa5062b23f4400eda888b7ae2aaa" +uuid = "f01c122e-0ea1-4f85-ad8f-907073ad7a9f" +version = "0.1.3" + +[[deps.BitTwiddlingConvenienceFunctions]] +deps = ["Static"] +git-tree-sha1 = "f21cfd4950cb9f0587d5067e69405ad2acd27b87" +uuid = "62783981-4cbd-42fc-bca8-16325de8dc4b" +version = "0.1.6" + +[[deps.Bzip2_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "9e2a6b69137e6969bab0152632dcb3bc108c8bdd" +uuid = "6e34b625-4abd-537c-b88f-471c36dfa7a0" +version = "1.0.8+1" + +[[deps.CPUSummary]] +deps = ["CpuId", "IfElse", "PrecompileTools", "Static"] +git-tree-sha1 = "5a97e67919535d6841172016c9530fd69494e5ec" +uuid = "2a0fbf3d-bb9c-48f3-b0a9-814d99fd7ab9" +version = "0.2.6" + +[[deps.CloseOpenIntervals]] +deps = ["Static", "StaticArrayInterface"] +git-tree-sha1 = "05ba0d07cd4fd8b7a39541e31a7b0254704ea581" +uuid = "fb6a15b2-703c-40df-9091-08a04967cfa9" +version = "0.1.13" + +[[deps.CommonWorldInvalidations]] +git-tree-sha1 = "ae52d1c52048455e85a387fbee9be553ec2b68d0" +uuid = "f70d9fcc-98c5-4d4a-abd7-e4cdeebd8ca8" +version = "1.0.0" + +[[deps.Compat]] +deps = ["TOML", "UUIDs"] +git-tree-sha1 = "b1c55339b7c6c350ee89f2c1604299660525b248" +uuid = "34da2185-b29b-5c13-b0c7-acf172513d20" +version = "4.15.0" +weakdeps = ["Dates", "LinearAlgebra"] + + [deps.Compat.extensions] + CompatLinearAlgebraExt = "LinearAlgebra" + +[[deps.CompilerSupportLibraries_jll]] +deps = ["Artifacts", "Libdl"] +uuid = "e66e0078-7015-5450-92f7-15fbd957f2ae" +version = "1.1.1+0" + +[[deps.CpuId]] +deps = ["Markdown"] +git-tree-sha1 = "fcbb72b032692610bfbdb15018ac16a36cf2e406" +uuid = "adafc99b-e345-5852-983c-f28acb93d879" +version = "0.3.1" + +[[deps.CxxWrap]] +deps = ["Libdl", "MacroTools", "libcxxwrap_julia_jll"] +git-tree-sha1 = "3345cb637ca1efb2ebf7f5145558522b92660d1f" +uuid = "1f15a43c-97ca-5a2a-ae31-89f07a497df4" +version = "0.14.2" + +[[deps.Dates]] +deps = ["Printf"] +uuid = "ade2ca70-3891-5945-98fb-dc099432e06a" + +[[deps.DecFP]] +deps = ["DecFP_jll", "Printf", "Random", "SpecialFunctions"] +git-tree-sha1 = "4a10cec664e26d9d63597daf9e62147e79d636e3" +uuid = "55939f99-70c6-5e9b-8bb0-5071ed7d61fd" +version = "1.3.2" + +[[deps.DecFP_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "e9a8da19f847bbfed4076071f6fef8665a30d9e5" +uuid = "47200ebd-12ce-5be5-abb7-8e082af23329" +version = "2.0.3+1" + +[[deps.Distributed]] +deps = ["Random", "Serialization", "Sockets"] +uuid = "8ba89e20-285c-5b6f-9357-94700520ee1b" + +[[deps.DocStringExtensions]] +deps = ["LibGit2"] +git-tree-sha1 = "2fb1e02f2b635d0845df5d7c167fec4dd739b00d" +uuid = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae" +version = "0.9.3" + +[[deps.Downloads]] +deps = ["ArgTools", "FileWatching", "LibCURL", "NetworkOptions"] +uuid = "f43a241f-c20a-4ad4-852c-f6b1247861c6" +version = "1.6.0" + +[[deps.FLINT_jll]] +deps = ["Artifacts", "GMP_jll", "JLLWrappers", "Libdl", "MPFR_jll", "OpenBLAS32_jll"] +git-tree-sha1 = "4bde447e7bc6de73de36870fc942df02f4dd44b5" +uuid = "e134572f-a0d5-539d-bddf-3cad8db41a82" +version = "300.100.300+0" + +[[deps.FileWatching]] +uuid = "7b1f6079-737a-58dc-b8bc-7a2ca5c1b5ee" + +[[deps.GAP]] +deps = ["Artifacts", "Compat", "Downloads", "GAP_jll", "GAP_lib_jll", "GAP_pkg_juliainterface_jll", "InteractiveUtils", "Libdl", "MacroTools", "Markdown", "Ncurses_jll", "Pidfile", "Pkg", "REPL", "Random", "Scratch"] +git-tree-sha1 = "fcaf50e1874719fdec62c3646351e52007ad63aa" +uuid = "c863536a-3901-11e9-33e7-d5cd0df7b904" +version = "0.10.4" + +[[deps.GAP_jll]] +deps = ["Artifacts", "GMP_jll", "JLLWrappers", "Libdl", "Pkg", "Readline_jll", "Zlib_jll"] +git-tree-sha1 = "c3a00b8f8ced0887d52104d0a0df233d9efc79d4" +uuid = "5cd7a574-2c56-5be2-91dc-c8bc375b9ddf" +version = "400.1200.200+9" + +[[deps.GAP_lib_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "473b619163e30d9cc58d4a8f9d412e6ea8910fcf" +uuid = "de1ad85e-c930-5cd4-919d-ccd3fcafd1a3" +version = "400.1201.200+0" + +[[deps.GAP_pkg_juliainterface_jll]] +deps = ["Artifacts", "GAP_jll", "GAP_lib_jll", "JLLWrappers", "Libdl"] +git-tree-sha1 = "c5a0f16f0478ab067752861d3c9339f335832459" +uuid = "ba154793-3a7d-51ee-8800-e295b0cf7374" +version = "0.800.300+3" + +[[deps.GLPK_jll]] +deps = ["Artifacts", "GMP_jll", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "fe68622f32828aa92275895fdb324a85894a5b1b" +uuid = "e8aa6df9-e6ca-548a-97ff-1f85fc5b8b98" +version = "5.0.1+0" + +[[deps.GMP_jll]] +deps = ["Artifacts", "Libdl"] +uuid = "781609d7-10c4-51f6-84f2-b8444358ff6d" +version = "6.2.1+6" + +[[deps.Hecke]] +deps = ["AbstractAlgebra", "Dates", "Distributed", "InteractiveUtils", "LazyArtifacts", "Libdl", "LinearAlgebra", "Markdown", "Nemo", "Pkg", "Printf", "Random", "RandomExtensions", "Serialization", "SparseArrays"] +git-tree-sha1 = "f89af7272ac9585fe73c1f0d810970b025ddc345" +uuid = "3e1990a7-5d81-5526-99ce-9ba3ff248f21" +version = "0.32.3" +weakdeps = ["GAP", "Polymake"] + + [deps.Hecke.extensions] + GAPExt = "GAP" + PolymakeExt = "Polymake" + +[[deps.HostCPUFeatures]] +deps = ["BitTwiddlingConvenienceFunctions", "IfElse", "Libdl", "Static"] +git-tree-sha1 = "8e070b599339d622e9a081d17230d74a5c473293" +uuid = "3e5b6fbb-0976-4d2c-9146-d79de83f2fb0" +version = "0.1.17" + +[[deps.Hwloc_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl"] +git-tree-sha1 = "5e19e1e4fa3e71b774ce746274364aef0234634e" +uuid = "e33a78d0-f292-5ffc-b300-72abe9b543c8" +version = "2.11.1+0" + +[[deps.IfElse]] +git-tree-sha1 = "debdd00ffef04665ccbb3e150747a77560e8fad1" +uuid = "615f187c-cbe4-4ef1-ba3b-2fcf58d6d173" +version = "0.1.1" + +[[deps.InteractiveUtils]] +deps = ["Markdown"] +uuid = "b77e0a4c-d291-57a0-90e8-8db25a27a240" + +[[deps.Ipopt_jll]] +deps = ["ASL_jll", "Artifacts", "CompilerSupportLibraries_jll", "JLLWrappers", "Libdl", "MUMPS_seq_jll", "SPRAL_jll", "libblastrampoline_jll"] +git-tree-sha1 = "546c40fd3718c65d48296dd6cec98af9904e3ca4" +uuid = "9cc047cb-c261-5740-88fc-0cf96f7bdcc7" +version = "300.1400.1400+0" + +[[deps.IrrationalConstants]] +git-tree-sha1 = "630b497eafcc20001bba38a4651b327dcfc491d2" +uuid = "92d709cd-6900-40b7-9082-c6be49f344b6" +version = "0.2.2" + +[[deps.JLLWrappers]] +deps = ["Artifacts", "Preferences"] +git-tree-sha1 = "7e5d6779a1e09a36db2a7b6cff50942a0a7d0fca" +uuid = "692b3bcd-3c85-4b1f-b108-f13ce0eb3210" +version = "1.5.0" + +[[deps.JSON]] +deps = ["Dates", "Mmap", "Parsers", "Unicode"] +git-tree-sha1 = "31e996f0a15c7b280ba9f76636b3ff9e2ae58c9a" +uuid = "682c06a0-de6a-54ab-a142-c8b1cf79cde6" +version = "0.21.4" + +[[deps.JSON3]] +deps = ["Dates", "Mmap", "Parsers", "PrecompileTools", "StructTypes", "UUIDs"] +git-tree-sha1 = "eb3edce0ed4fa32f75a0a11217433c31d56bd48b" +uuid = "0f8b85d8-7281-11e9-16c2-39a750bddbf1" +version = "1.14.0" + + [deps.JSON3.extensions] + JSON3ArrowExt = ["ArrowTypes"] + + [deps.JSON3.weakdeps] + ArrowTypes = "31f734f8-188a-4ce0-8406-c8a06bd891cd" + +[[deps.LLVMOpenMP_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl"] +git-tree-sha1 = "d986ce2d884d49126836ea94ed5bfb0f12679713" +uuid = "1d63c593-3942-5779-bab2-d838dc0a180e" +version = "15.0.7+0" + +[[deps.LZO_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl"] +git-tree-sha1 = "70c5da094887fd2cae843b8db33920bac4b6f07d" +uuid = "dd4b983a-f0e5-5f8d-a1b7-129d4a5fb1ac" +version = "2.10.2+0" + +[[deps.LayoutPointers]] +deps = ["ArrayInterface", "LinearAlgebra", "ManualMemory", "SIMDTypes", "Static", "StaticArrayInterface"] +git-tree-sha1 = "a9eaadb366f5493a5654e843864c13d8b107548c" +uuid = "10f19ff3-798f-405d-979b-55457f8fc047" +version = "0.1.17" + +[[deps.LazyArtifacts]] +deps = ["Artifacts", "Pkg"] +uuid = "4af54fe1-eca0-43a8-85a7-787d91b784e3" + +[[deps.LibCURL]] +deps = ["LibCURL_jll", "MozillaCACerts_jll"] +uuid = "b27032c2-a3e7-50c8-80cd-2d36dbcbfd21" +version = "0.6.4" + +[[deps.LibCURL_jll]] +deps = ["Artifacts", "LibSSH2_jll", "Libdl", "MbedTLS_jll", "Zlib_jll", "nghttp2_jll"] +uuid = "deac9b47-8bc7-5906-a0fe-35ac56dc84c0" +version = "8.4.0+0" + +[[deps.LibGit2]] +deps = ["Base64", "LibGit2_jll", "NetworkOptions", "Printf", "SHA"] +uuid = "76f85450-5226-5b5a-8eaa-529ad045b433" + +[[deps.LibGit2_jll]] +deps = ["Artifacts", "LibSSH2_jll", "Libdl", "MbedTLS_jll"] +uuid = "e37daf67-58a4-590a-8e99-b0245dd2ffc5" +version = "1.6.4+0" + +[[deps.LibSSH2_jll]] +deps = ["Artifacts", "Libdl", "MbedTLS_jll"] +uuid = "29816b5a-b9ab-546f-933c-edad1886dfa8" +version = "1.11.0+1" + +[[deps.Libdl]] +uuid = "8f399da3-3557-5675-b5ff-fb832c97cbdb" + +[[deps.LinearAlgebra]] +deps = ["Libdl", "OpenBLAS_jll", "libblastrampoline_jll"] +uuid = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" + +[[deps.LogExpFunctions]] +deps = ["DocStringExtensions", "IrrationalConstants", "LinearAlgebra"] +git-tree-sha1 = "a2d09619db4e765091ee5c6ffe8872849de0feea" +uuid = "2ab3a3ac-af41-5b50-aa03-7779005ae688" +version = "0.3.28" + + [deps.LogExpFunctions.extensions] + LogExpFunctionsChainRulesCoreExt = "ChainRulesCore" + LogExpFunctionsChangesOfVariablesExt = "ChangesOfVariables" + LogExpFunctionsInverseFunctionsExt = "InverseFunctions" + + [deps.LogExpFunctions.weakdeps] + ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4" + ChangesOfVariables = "9e997f8a-9a97-42d5-a9f1-ce6bfc15e2c0" + InverseFunctions = "3587e190-3f89-42d0-90ee-14403ec27112" + +[[deps.Logging]] +uuid = "56ddb016-857b-54e1-b83d-db4d58db5568" + +[[deps.LoopVectorization]] +deps = ["ArrayInterface", "CPUSummary", "CloseOpenIntervals", "DocStringExtensions", "HostCPUFeatures", "IfElse", "LayoutPointers", "LinearAlgebra", "OffsetArrays", "PolyesterWeave", "PrecompileTools", "SIMDTypes", "SLEEFPirates", "Static", "StaticArrayInterface", "ThreadingUtilities", "UnPack", "VectorizationBase"] +git-tree-sha1 = "8084c25a250e00ae427a379a5b607e7aed96a2dd" +uuid = "bdcacae8-1622-11e9-2a5c-532679323890" +version = "0.12.171" + + [deps.LoopVectorization.extensions] + ForwardDiffExt = ["ChainRulesCore", "ForwardDiff"] + SpecialFunctionsExt = "SpecialFunctions" + + [deps.LoopVectorization.weakdeps] + ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4" + ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210" + SpecialFunctions = "276daf66-3868-5448-9aa4-cd146d93841b" + +[[deps.Lz4_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl"] +git-tree-sha1 = "6c26c5e8a4203d43b5497be3ec5d4e0c3cde240a" +uuid = "5ced341a-0733-55b8-9ab6-a4889d929147" +version = "1.9.4+0" + +[[deps.METIS_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "1fd0a97409e418b78c53fac671cf4622efdf0f21" +uuid = "d00139f3-1899-568f-a2f0-47f597d42d70" +version = "5.1.2+0" + +[[deps.MPFR_jll]] +deps = ["Artifacts", "GMP_jll", "Libdl"] +uuid = "3a97d323-0669-5f0c-9066-3539efd106a3" +version = "4.2.0+1" + +[[deps.MUMPS_seq_jll]] +deps = ["Artifacts", "CompilerSupportLibraries_jll", "JLLWrappers", "Libdl", "METIS_jll", "libblastrampoline_jll"] +git-tree-sha1 = "840b83c65b27e308095c139a457373850b2f5977" +uuid = "d7ed1dd3-d0ae-5e8e-bfb4-87a502085b8d" +version = "500.600.201+0" + +[[deps.MacroTools]] +deps = ["Markdown", "Random"] +git-tree-sha1 = "2fa9ee3e63fd3a4f7a9a4f4744a52f4856de82df" +uuid = "1914dd2f-81c6-5fcd-8719-6d5c9610ff09" +version = "0.5.13" + +[[deps.ManualMemory]] +git-tree-sha1 = "bcaef4fc7a0cfe2cba636d84cda54b5e4e4ca3cd" +uuid = "d125e4d3-2237-4719-b19c-fa641b8a4667" +version = "0.1.8" + +[[deps.Markdown]] +deps = ["Base64"] +uuid = "d6f4376e-aef5-505a-96c1-9c027394607a" + +[[deps.MbedTLS_jll]] +deps = ["Artifacts", "Libdl"] +uuid = "c8ffd9c3-330d-5841-b78e-0817d7145fa1" +version = "2.28.2+1" + +[[deps.Mmap]] +uuid = "a63ad114-7e13-5084-954f-fe012c677804" + +[[deps.MongoC_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "OpenSSL_jll", "Zlib_jll", "Zstd_jll", "snappy_jll"] +git-tree-sha1 = "5a0f9f14a8186eae48608ff7922ac0c00ff52cdc" +uuid = "90100e71-7732-535a-9be7-2e9affd1cfc1" +version = "1.25.1+0" + +[[deps.Mongoc]] +deps = ["Dates", "DecFP", "MongoC_jll", "Serialization"] +git-tree-sha1 = "f47bf7ed9d9c1da0a632777ca7dc406e3ad5f923" +uuid = "4fe8b98c-fc19-5c23-8ec2-168ff83495f2" +version = "0.9.0" + +[[deps.MozillaCACerts_jll]] +uuid = "14a3606d-f60d-562e-9121-12d972cd8159" +version = "2023.1.10" + +[[deps.Ncurses_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl"] +git-tree-sha1 = "3ac1ca10bae513c9cc8f83d7734b921b8007b574" +uuid = "68e3532b-a499-55ff-9963-d1c0c0748b3a" +version = "6.5.0+0" + +[[deps.Nemo]] +deps = ["AbstractAlgebra", "FLINT_jll", "Libdl", "LinearAlgebra", "Pkg", "Random", "RandomExtensions", "SHA"] +git-tree-sha1 = "bae0f1452c648d84535b581103ab8a59cf10a32a" +uuid = "2edaba10-b0f1-5616-af89-8c11ac63239a" +version = "0.45.7" + +[[deps.NetworkOptions]] +uuid = "ca575930-c2e3-43a9-ace4-1e988b2c1908" +version = "1.2.0" + +[[deps.Ninja_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl"] +git-tree-sha1 = "d9c6d1dca818768f1671244dcdf8e8e08b2b8937" +uuid = "76642167-d241-5cee-8c94-7a494e8cb7b7" +version = "1.12.1+0" + +[[deps.OffsetArrays]] +git-tree-sha1 = "1a27764e945a152f7ca7efa04de513d473e9542e" +uuid = "6fe1bfb0-de20-5000-8ca7-80f57d26f881" +version = "1.14.1" +weakdeps = ["Adapt"] + + [deps.OffsetArrays.extensions] + OffsetArraysAdaptExt = "Adapt" + +[[deps.OpenBLAS32_jll]] +deps = ["Artifacts", "CompilerSupportLibraries_jll", "JLLWrappers", "Libdl"] +git-tree-sha1 = "6065c4cff8fee6c6770b277af45d5082baacdba1" +uuid = "656ef2d0-ae68-5445-9ca0-591084a874a2" +version = "0.3.24+0" + +[[deps.OpenBLAS_jll]] +deps = ["Artifacts", "CompilerSupportLibraries_jll", "Libdl"] +uuid = "4536629a-c528-5b80-bd46-f80d51c5b363" +version = "0.3.23+4" + +[[deps.OpenLibm_jll]] +deps = ["Artifacts", "Libdl"] +uuid = "05823500-19ac-5b8b-9628-191a04bc5112" +version = "0.8.1+2" + +[[deps.OpenSSL_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl"] +git-tree-sha1 = "a12e56c72edee3ce6b96667745e6cbbe5498f200" +uuid = "458c3c95-2e84-50aa-8efc-19380b2a3a95" +version = "1.1.23+0" + +[[deps.OpenSpecFun_jll]] +deps = ["Artifacts", "CompilerSupportLibraries_jll", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "13652491f6856acfd2db29360e1bbcd4565d04f1" +uuid = "efe28fd5-8261-553b-a9e1-b2916fc3738e" +version = "0.5.5+0" + +[[deps.Oscar]] +deps = ["AbstractAlgebra", "AlgebraicSolving", "Distributed", "GAP", "Hecke", "JSON", "JSON3", "LazyArtifacts", "Markdown", "Nemo", "Pkg", "Polymake", "Random", "RandomExtensions", "Serialization", "Singular", "TOPCOM_jll", "UUIDs", "cohomCalg_jll"] +git-tree-sha1 = "6d86eb479c0afaebad9c00e862d91f3ae1de3c4f" +uuid = "f1435218-dba5-11e9-1e4d-f1a5fab5fc13" +version = "1.1.1" + +[[deps.PPL_jll]] +deps = ["Artifacts", "GMP_jll", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "dc69ba2b374b5bd6e876fa3a8441563c0eeafb9e" +uuid = "80dd9cbb-8b87-5171-a280-372cc418f402" +version = "1.2.1+0" + +[[deps.Parsers]] +deps = ["Dates", "PrecompileTools", "UUIDs"] +git-tree-sha1 = "8489905bcdbcfac64d1daa51ca07c0d8f0283821" +uuid = "69de0a69-1ddd-5017-9359-2bf0b02dc9f0" +version = "2.8.1" + +[[deps.Perl_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Readline_jll"] +git-tree-sha1 = "7ab65a258bcf6da373cab49af462aead452d3960" +uuid = "83958c19-0796-5285-893e-a1267f8ec499" +version = "5.34.1+0" + +[[deps.Pidfile]] +deps = ["FileWatching", "Test"] +git-tree-sha1 = "2d8aaf8ee10df53d0dfb9b8ee44ae7c04ced2b03" +uuid = "fa939f87-e72e-5be4-a000-7fc836dbe307" +version = "1.3.0" + +[[deps.Pkg]] +deps = ["Artifacts", "Dates", "Downloads", "FileWatching", "LibGit2", "Libdl", "Logging", "Markdown", "Printf", "REPL", "Random", "SHA", "Serialization", "TOML", "Tar", "UUIDs", "p7zip_jll"] +uuid = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" +version = "1.10.0" + +[[deps.PolyesterWeave]] +deps = ["BitTwiddlingConvenienceFunctions", "CPUSummary", "IfElse", "Static", "ThreadingUtilities"] +git-tree-sha1 = "645bed98cd47f72f67316fd42fc47dee771aefcd" +uuid = "1d0040c9-8b98-4ee7-8388-3f51789ca0ad" +version = "0.2.2" + +[[deps.Polymake]] +deps = ["AbstractAlgebra", "BinaryWrappers", "CxxWrap", "Downloads", "JSON", "Libdl", "Mongoc", "NetworkOptions", "Ninja_jll", "Perl_jll", "Pidfile", "Pkg", "REPL", "Scratch", "SparseArrays", "TOPCOM_jll", "lib4ti2_jll", "libpolymake_julia_jll", "polymake_jll", "polymake_oscarnumber_jll"] +git-tree-sha1 = "4ae104b2d9eb68fdd1b013411b3eccd234d28406" +uuid = "d720cf60-89b5-51f5-aff5-213f193123e7" +version = "0.11.19" + +[[deps.PrecompileTools]] +deps = ["Preferences"] +git-tree-sha1 = "5aa36f7049a63a1528fe8f7c3f2113413ffd4e1f" +uuid = "aea7be01-6a6a-4083-8856-8a6e6704d82a" +version = "1.2.1" + +[[deps.Preferences]] +deps = ["TOML"] +git-tree-sha1 = "9306f6085165d270f7e3db02af26a400d580f5c6" +uuid = "21216c6a-2e73-6563-6e65-726566657250" +version = "1.4.3" + +[[deps.Printf]] +deps = ["Unicode"] +uuid = "de0858da-6303-5e67-8744-51eddeeeb8d7" + +[[deps.Profile]] +deps = ["Printf"] +uuid = "9abbd945-dff8-562f-b5e8-e1ebf5ef1b79" + +[[deps.REPL]] +deps = ["InteractiveUtils", "Markdown", "Sockets", "Unicode"] +uuid = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb" + +[[deps.Random]] +deps = ["SHA"] +uuid = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" + +[[deps.RandomExtensions]] +deps = ["Random", "SparseArrays"] +git-tree-sha1 = "b8a399e95663485820000f26b6a43c794e166a49" +uuid = "fb686558-2515-59ef-acaa-46db3789a887" +version = "0.4.4" + +[[deps.Readline_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Ncurses_jll"] +git-tree-sha1 = "9d70e0c890a6c7ca3eb1ca0eaabba4d34795b7fb" +uuid = "05236dd9-4125-5232-aa7c-9ec0c9b2c25a" +version = "8.2.1+0" + +[[deps.Requires]] +deps = ["UUIDs"] +git-tree-sha1 = "838a3a4188e2ded87a4f9f184b4b0d78a1e91cb7" +uuid = "ae029012-a4dd-5104-9daa-d747884805df" +version = "1.3.0" + +[[deps.SCIP_jll]] +deps = ["Artifacts", "Bzip2_jll", "CompilerSupportLibraries_jll", "GMP_jll", "Ipopt_jll", "JLLWrappers", "Libdl", "Pkg", "Readline_jll", "Zlib_jll", "bliss_jll", "boost_jll"] +git-tree-sha1 = "cf69186eb29307fbb2319b90e6133797bad983ce" +uuid = "e5ac4fe4-a920-5659-9bf8-f9f73e9e79ce" +version = "800.0.301+0" + +[[deps.SHA]] +uuid = "ea8e919c-243c-51af-8825-aaa63cd721ce" +version = "0.7.0" + +[[deps.SIMDTypes]] +git-tree-sha1 = "330289636fb8107c5f32088d2741e9fd7a061a5c" +uuid = "94e857df-77ce-4151-89e5-788b33177be4" +version = "0.1.0" + +[[deps.SLEEFPirates]] +deps = ["IfElse", "Static", "VectorizationBase"] +git-tree-sha1 = "456f610ca2fbd1c14f5fcf31c6bfadc55e7d66e0" +uuid = "476501e8-09a2-5ece-8869-fb82de89a1fa" +version = "0.6.43" + +[[deps.SPRAL_jll]] +deps = ["Artifacts", "CompilerSupportLibraries_jll", "Hwloc_jll", "JLLWrappers", "Libdl", "METIS_jll", "libblastrampoline_jll"] +git-tree-sha1 = "34b9dacd687cace8aa4d550e3e9bb8615f1a61e9" +uuid = "319450e9-13b8-58e8-aa9f-8fd1420848ab" +version = "2024.1.18+0" + +[[deps.Scratch]] +deps = ["Dates"] +git-tree-sha1 = "3bac05bc7e74a75fd9cba4295cde4045d9fe2386" +uuid = "6c6a2e73-6563-6170-7368-637461726353" +version = "1.2.1" + +[[deps.Serialization]] +uuid = "9e88b42a-f829-5b0c-bbe9-9e923198166b" + +[[deps.Singular]] +deps = ["AbstractAlgebra", "BinaryWrappers", "CxxWrap", "Libdl", "LinearAlgebra", "Nemo", "Pidfile", "Pkg", "Random", "RandomExtensions", "Singular_jll", "Statistics", "lib4ti2_jll", "libsingular_julia_jll"] +git-tree-sha1 = "a55baf3aac647d50799ecd963e9026c472f003c0" +uuid = "bcd08a7b-43d2-5ff7-b6d4-c458787f915c" +version = "0.23.4" + +[[deps.Singular_jll]] +deps = ["Artifacts", "FLINT_jll", "GMP_jll", "JLLWrappers", "Libdl", "MPFR_jll", "cddlib_jll"] +git-tree-sha1 = "398b1d72ad1c12e8a8b8ce54a11d0bb9fa6bfb89" +uuid = "43d676ae-4934-50ba-8046-7a96366d613b" +version = "404.0.301+0" + +[[deps.Sockets]] +uuid = "6462fe0b-24de-5631-8697-dd941f90decc" + +[[deps.SparseArrays]] +deps = ["Libdl", "LinearAlgebra", "Random", "Serialization", "SuiteSparse_jll"] +uuid = "2f01184e-e22b-5df5-ae63-d93ebab69eaf" +version = "1.10.0" + +[[deps.SpecialFunctions]] +deps = ["IrrationalConstants", "LogExpFunctions", "OpenLibm_jll", "OpenSpecFun_jll"] +git-tree-sha1 = "2f5d4697f21388cbe1ff299430dd169ef97d7e14" +uuid = "276daf66-3868-5448-9aa4-cd146d93841b" +version = "2.4.0" + + [deps.SpecialFunctions.extensions] + SpecialFunctionsChainRulesCoreExt = "ChainRulesCore" + + [deps.SpecialFunctions.weakdeps] + ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4" + +[[deps.Static]] +deps = ["CommonWorldInvalidations", "IfElse", "PrecompileTools"] +git-tree-sha1 = "87d51a3ee9a4b0d2fe054bdd3fc2436258db2603" +uuid = "aedffcd0-7271-4cad-89d0-dc628f76c6d3" +version = "1.1.1" + +[[deps.StaticArrayInterface]] +deps = ["ArrayInterface", "Compat", "IfElse", "LinearAlgebra", "PrecompileTools", "Requires", "SparseArrays", "Static", "SuiteSparse"] +git-tree-sha1 = "8963e5a083c837531298fc41599182a759a87a6d" +uuid = "0d7ed370-da01-4f52-bd93-41d350b8b718" +version = "1.5.1" +weakdeps = ["OffsetArrays", "StaticArrays"] + + [deps.StaticArrayInterface.extensions] + StaticArrayInterfaceOffsetArraysExt = "OffsetArrays" + StaticArrayInterfaceStaticArraysExt = "StaticArrays" + +[[deps.StaticArrays]] +deps = ["LinearAlgebra", "PrecompileTools", "Random", "StaticArraysCore"] +git-tree-sha1 = "eeafab08ae20c62c44c8399ccb9354a04b80db50" +uuid = "90137ffa-7385-5640-81b9-e52037218182" +version = "1.9.7" + + [deps.StaticArrays.extensions] + StaticArraysChainRulesCoreExt = "ChainRulesCore" + StaticArraysStatisticsExt = "Statistics" + + [deps.StaticArrays.weakdeps] + ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4" + Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2" + +[[deps.StaticArraysCore]] +git-tree-sha1 = "192954ef1208c7019899fbf8049e717f92959682" +uuid = "1e83bf80-4336-4d27-bf5d-d5a4f845583c" +version = "1.4.3" + +[[deps.Statistics]] +deps = ["LinearAlgebra", "SparseArrays"] +uuid = "10745b16-79ce-11e8-11f9-7d13ad32a3b2" +version = "1.10.0" + +[[deps.StructTypes]] +deps = ["Dates", "UUIDs"] +git-tree-sha1 = "ca4bccb03acf9faaf4137a9abc1881ed1841aa70" +uuid = "856f2bd8-1eba-4b0a-8007-ebc267875bd4" +version = "1.10.0" + +[[deps.SuiteSparse]] +deps = ["Libdl", "LinearAlgebra", "Serialization", "SparseArrays"] +uuid = "4607b0f0-06f3-5cda-b6b1-a6196a1729e9" + +[[deps.SuiteSparse_jll]] +deps = ["Artifacts", "Libdl", "libblastrampoline_jll"] +uuid = "bea87d4a-7f5b-5778-9afe-8cc45184846c" +version = "7.2.1+1" + +[[deps.TOML]] +deps = ["Dates"] +uuid = "fa267f1f-6049-4f14-aa54-33bafae1ed76" +version = "1.0.3" + +[[deps.TOPCOM_jll]] +deps = ["Artifacts", "GMP_jll", "JLLWrappers", "Libdl", "Pkg", "cddlib_jll"] +git-tree-sha1 = "adbe178144e762ae7057fcb8e26564de7ee2e36c" +uuid = "36f60fef-b880-50dc-9289-4aaecee93cc3" +version = "0.17.8+0" + +[[deps.Tar]] +deps = ["ArgTools", "SHA"] +uuid = "a4e569a6-e804-4fa4-b0f3-eef7a1d5b13e" +version = "1.10.0" + +[[deps.Test]] +deps = ["InteractiveUtils", "Logging", "Random", "Serialization"] +uuid = "8dfed614-e22c-5e08-85e1-65c5234f0b40" + +[[deps.ThreadingUtilities]] +deps = ["ManualMemory"] +git-tree-sha1 = "eda08f7e9818eb53661b3deb74e3159460dfbc27" +uuid = "8290d209-cae3-49c0-8002-c8c24d57dab5" +version = "0.5.2" + +[[deps.UUIDs]] +deps = ["Random", "SHA"] +uuid = "cf7118a7-6976-5b1a-9a39-7adc72f591a4" + +[[deps.UnPack]] +git-tree-sha1 = "387c1f73762231e86e0c9c5443ce3b4a0a9a0c2b" +uuid = "3a884ed6-31ef-47d7-9d2a-63182c4928ed" +version = "1.0.2" + +[[deps.Unicode]] +uuid = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5" + +[[deps.VectorizationBase]] +deps = ["ArrayInterface", "CPUSummary", "HostCPUFeatures", "IfElse", "LayoutPointers", "Libdl", "LinearAlgebra", "SIMDTypes", "Static", "StaticArrayInterface"] +git-tree-sha1 = "e7f5b81c65eb858bed630fe006837b935518aca5" +uuid = "3d5dd08c-fd9d-11e8-17fa-ed2836048c2f" +version = "0.21.70" + +[[deps.Zlib_jll]] +deps = ["Libdl"] +uuid = "83775a58-1f1d-513f-b197-d71354ab007a" +version = "1.2.13+1" + +[[deps.Zstd_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl"] +git-tree-sha1 = "e678132f07ddb5bfa46857f0d7620fb9be675d3b" +uuid = "3161d3a3-bdf6-5164-811a-617609db77b4" +version = "1.5.6+0" + +[[deps.bliss_jll]] +deps = ["Artifacts", "GMP_jll", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "f8b75e896a326a162a4f6e998990521d8302c810" +uuid = "508c9074-7a14-5c94-9582-3d4bc1871065" +version = "0.77.0+1" + +[[deps.boost_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Zlib_jll"] +git-tree-sha1 = "7a89efe0137720ca82f99e8daa526d23120d0d37" +uuid = "28df3c45-c428-5900-9ff8-a3135698ca75" +version = "1.76.0+1" + +[[deps.cddlib_jll]] +deps = ["Artifacts", "GMP_jll", "JLLWrappers", "Libdl"] +git-tree-sha1 = "08f5df03703af917b9bfec47b9767eb943220d08" +uuid = "f07e07eb-5685-515a-97c8-3014f6152feb" +version = "0.94.14+0" + +[[deps.cohomCalg_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "999c34925053825bfa29f54b3c00b80668b681ec" +uuid = "5558cf25-a90e-53b0-b813-cadaa3ae7ade" +version = "0.32.0+0" + +[[deps.lib4ti2_jll]] +deps = ["Artifacts", "GLPK_jll", "GMP_jll", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "79116185def638e73ea3d88ca6c10e210a1dc183" +uuid = "1493ae25-0f90-5c0e-a06c-8c5077d6d66f" +version = "1.6.10+0" + +[[deps.libblastrampoline_jll]] +deps = ["Artifacts", "Libdl"] +uuid = "8e850b90-86db-534c-a0d3-1478176c7d93" +version = "5.8.0+1" + +[[deps.libcxxwrap_julia_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl"] +git-tree-sha1 = "02d0a0a623248c709727088aaf722ab14f1463a5" +uuid = "3eaa8342-bff7-56a5-9981-c04077f7cee7" +version = "0.11.2+1" + +[[deps.libpolymake_julia_jll]] +deps = ["Artifacts", "CompilerSupportLibraries_jll", "FLINT_jll", "JLLWrappers", "Libdl", "TOPCOM_jll", "lib4ti2_jll", "libcxxwrap_julia_jll", "polymake_jll"] +git-tree-sha1 = "87edbe6bc0171e6918b25dced309db6cba43cc97" +uuid = "4d8266f6-2b3b-57e3-ad7a-d431eaaac945" +version = "0.12.0+0" + +[[deps.libsingular_julia_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Singular_jll", "libcxxwrap_julia_jll"] +git-tree-sha1 = "efd81d3e0a881293b7123357d1db4b0d5cd159cb" +uuid = "ae4fbd8f-ecdb-54f8-bbce-35570499b30e" +version = "0.45.2+0" + +[[deps.lrslib_jll]] +deps = ["Artifacts", "GMP_jll", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "9169c4d5823195a7a2173fc6b479468478857438" +uuid = "3873f7d0-7b7c-52c3-bdf4-8ab39b8f337a" +version = "0.3.3+0" + +[[deps.msolve_jll]] +deps = ["Artifacts", "CompilerSupportLibraries_jll", "FLINT_jll", "GMP_jll", "JLLWrappers", "LLVMOpenMP_jll", "Libdl", "MPFR_jll"] +git-tree-sha1 = "d6b643f97075ff6d7342fca2bcf8acca7b6282e7" +uuid = "6d01cc9a-e8f6-580e-8c54-544227e08205" +version = "0.600.700+0" + +[[deps.nauty_jll]] +deps = ["Artifacts", "GMP_jll", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "fc7dc197df0648cd5f965801bfe086abd9325add" +uuid = "55c6dc9b-343a-50ca-8ff2-b71adb3733d5" +version = "2.6.13+1" + +[[deps.nghttp2_jll]] +deps = ["Artifacts", "Libdl"] +uuid = "8e850ede-7688-5339-a07c-302acd2aaf8d" +version = "1.52.0+1" + +[[deps.normaliz_jll]] +deps = ["Artifacts", "CompilerSupportLibraries_jll", "FLINT_jll", "GMP_jll", "JLLWrappers", "LLVMOpenMP_jll", "Libdl", "MPFR_jll", "nauty_jll"] +git-tree-sha1 = "b84641c3add3c9e435546b1f2867105ce209791f" +uuid = "6690c6e9-4e12-53b8-b8fd-4bffaef8839f" +version = "300.1000.200+0" + +[[deps.p7zip_jll]] +deps = ["Artifacts", "Libdl"] +uuid = "3f19e933-33d8-53b3-aaab-bd5110c3b7a0" +version = "17.4.0+2" + +[[deps.polymake_jll]] +deps = ["Artifacts", "CompilerSupportLibraries_jll", "FLINT_jll", "GMP_jll", "JLLWrappers", "LLVMOpenMP_jll", "Libdl", "MPFR_jll", "MongoC_jll", "PPL_jll", "Perl_jll", "SCIP_jll", "bliss_jll", "boost_jll", "cddlib_jll", "lrslib_jll", "normaliz_jll"] +git-tree-sha1 = "bd0b5a3dd1f0d1309d6314b207d5e2bc51d42c29" +uuid = "7c209550-9012-526c-9264-55ba7a78ba2c" +version = "400.1200.1+0" + +[[deps.polymake_oscarnumber_jll]] +deps = ["Artifacts", "CompilerSupportLibraries_jll", "JLLWrappers", "LLVMOpenMP_jll", "Libdl", "libcxxwrap_julia_jll", "libpolymake_julia_jll", "polymake_jll"] +git-tree-sha1 = "ccba21af52e431ffa889965693daf98a8699dbbb" +uuid = "10f31823-b687-53e6-9f29-edb9d4da9f9f" +version = "0.3.0+0" + +[[deps.snappy_jll]] +deps = ["Artifacts", "JLLWrappers", "LZO_jll", "Libdl", "Lz4_jll", "Zlib_jll"] +git-tree-sha1 = "8bc7ddafc0a7339b82a06c1dde849cd5039324d6" +uuid = "fe1e1685-f7be-5f59-ac9f-4ca204017dfd" +version = "1.2.0+0" From 950a1f924d7f863c7441a00a2e5ec9e4e80663a5 Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Wed, 5 Jun 2024 14:23:39 +0200 Subject: [PATCH 116/179] Remove standalone Julia package files --- experimental/GroebnerWalk/LICENSE | 674 ------------------ experimental/GroebnerWalk/Manifest.toml | 866 ------------------------ experimental/GroebnerWalk/Project.toml | 8 - 3 files changed, 1548 deletions(-) delete mode 100644 experimental/GroebnerWalk/LICENSE delete mode 100644 experimental/GroebnerWalk/Manifest.toml delete mode 100644 experimental/GroebnerWalk/Project.toml diff --git a/experimental/GroebnerWalk/LICENSE b/experimental/GroebnerWalk/LICENSE deleted file mode 100644 index f288702d2fa1..000000000000 --- a/experimental/GroebnerWalk/LICENSE +++ /dev/null @@ -1,674 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU General Public License is a free, copyleft license for -software and other kinds of works. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they -know their rights. - - Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. - - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - - Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Use with the GNU Affero General Public License. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - -Also add information on how to contact you by electronic and paper mail. - - If the program does terminal interaction, make it output a short -notice like this when it starts in an interactive mode: - - Copyright (C) - This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, your program's commands -might be different; for a GUI interface, you would use an "about box". - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU GPL, see -. - - The GNU General Public License does not permit incorporating your program -into proprietary programs. If your program is a subroutine library, you -may consider it more useful to permit linking proprietary applications with -the library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. But first, please read -. diff --git a/experimental/GroebnerWalk/Manifest.toml b/experimental/GroebnerWalk/Manifest.toml deleted file mode 100644 index 958e0df8dfc6..000000000000 --- a/experimental/GroebnerWalk/Manifest.toml +++ /dev/null @@ -1,866 +0,0 @@ -# This file is machine-generated - editing it directly is not advised - -julia_version = "1.10.4" -manifest_format = "2.0" -project_hash = "7b8b7fa40622a7447c252b8f8df9e2af9252c76a" - -[[deps.ASL_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "6252039f98492252f9e47c312c8ffda0e3b9e78d" -uuid = "ae81ac8f-d209-56e5-92de-9978fef736f9" -version = "0.1.3+0" - -[[deps.AbstractAlgebra]] -deps = ["InteractiveUtils", "LinearAlgebra", "MacroTools", "Preferences", "Random", "RandomExtensions", "SparseArrays", "Test"] -git-tree-sha1 = "841dd303b9c7b06fd0e01fd04664a75bccc543ab" -uuid = "c3fe647b-3220-5bb0-a1ea-a7954cac585d" -version = "0.41.10" - -[[deps.Adapt]] -deps = ["LinearAlgebra", "Requires"] -git-tree-sha1 = "6a55b747d1812e699320963ffde36f1ebdda4099" -uuid = "79e6a3ab-5dfb-504d-930d-738a2a938a0e" -version = "4.0.4" -weakdeps = ["StaticArrays"] - - [deps.Adapt.extensions] - AdaptStaticArraysExt = "StaticArrays" - -[[deps.AlgebraicSolving]] -deps = ["LinearAlgebra", "Logging", "LoopVectorization", "Markdown", "Nemo", "Printf", "Random", "StaticArrays", "Test", "msolve_jll"] -git-tree-sha1 = "6ed4d44c604045dae661c5971bbfa964fbc93b5f" -uuid = "66b61cbe-0446-4d5d-9090-1ff510639f9d" -version = "0.4.16" - -[[deps.ArgTools]] -uuid = "0dad84c5-d112-42e6-8d28-ef12dabb789f" -version = "1.1.1" - -[[deps.ArrayInterface]] -deps = ["Adapt", "LinearAlgebra", "SparseArrays", "SuiteSparse"] -git-tree-sha1 = "5c9b74c973181571deb6442d41e5c902e6b9f38e" -uuid = "4fba245c-0d91-5ea0-9b3e-6abc04ee57a9" -version = "7.12.0" - - [deps.ArrayInterface.extensions] - ArrayInterfaceBandedMatricesExt = "BandedMatrices" - ArrayInterfaceBlockBandedMatricesExt = "BlockBandedMatrices" - ArrayInterfaceCUDAExt = "CUDA" - ArrayInterfaceCUDSSExt = "CUDSS" - ArrayInterfaceChainRulesExt = "ChainRules" - ArrayInterfaceGPUArraysCoreExt = "GPUArraysCore" - ArrayInterfaceReverseDiffExt = "ReverseDiff" - ArrayInterfaceStaticArraysCoreExt = "StaticArraysCore" - ArrayInterfaceTrackerExt = "Tracker" - - [deps.ArrayInterface.weakdeps] - BandedMatrices = "aae01518-5342-5314-be14-df237901396f" - BlockBandedMatrices = "ffab5731-97b5-5995-9138-79e8c1846df0" - CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba" - CUDSS = "45b445bb-4962-46a0-9369-b4df9d0f772e" - ChainRules = "082447d4-558c-5d27-93f4-14fc19e9eca2" - GPUArraysCore = "46192b85-c4d5-4398-a991-12ede77f4527" - ReverseDiff = "37e2e3b7-166d-5795-8a7a-e32c996b4267" - StaticArraysCore = "1e83bf80-4336-4d27-bf5d-d5a4f845583c" - Tracker = "9f7883ad-71c0-57eb-9f7f-b5c9e6d3789c" - -[[deps.Artifacts]] -uuid = "56f22d72-fd6d-98f1-02f0-08ddc0907c33" - -[[deps.Base64]] -uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f" - -[[deps.BenchmarkTools]] -deps = ["JSON", "Logging", "Printf", "Profile", "Statistics", "UUIDs"] -git-tree-sha1 = "f1dff6729bc61f4d49e140da1af55dcd1ac97b2f" -uuid = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf" -version = "1.5.0" - -[[deps.BinaryWrappers]] -deps = ["JLLWrappers", "Scratch"] -git-tree-sha1 = "7fea8f658689fa5062b23f4400eda888b7ae2aaa" -uuid = "f01c122e-0ea1-4f85-ad8f-907073ad7a9f" -version = "0.1.3" - -[[deps.BitTwiddlingConvenienceFunctions]] -deps = ["Static"] -git-tree-sha1 = "f21cfd4950cb9f0587d5067e69405ad2acd27b87" -uuid = "62783981-4cbd-42fc-bca8-16325de8dc4b" -version = "0.1.6" - -[[deps.Bzip2_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "9e2a6b69137e6969bab0152632dcb3bc108c8bdd" -uuid = "6e34b625-4abd-537c-b88f-471c36dfa7a0" -version = "1.0.8+1" - -[[deps.CPUSummary]] -deps = ["CpuId", "IfElse", "PrecompileTools", "Static"] -git-tree-sha1 = "5a97e67919535d6841172016c9530fd69494e5ec" -uuid = "2a0fbf3d-bb9c-48f3-b0a9-814d99fd7ab9" -version = "0.2.6" - -[[deps.CloseOpenIntervals]] -deps = ["Static", "StaticArrayInterface"] -git-tree-sha1 = "05ba0d07cd4fd8b7a39541e31a7b0254704ea581" -uuid = "fb6a15b2-703c-40df-9091-08a04967cfa9" -version = "0.1.13" - -[[deps.CommonWorldInvalidations]] -git-tree-sha1 = "ae52d1c52048455e85a387fbee9be553ec2b68d0" -uuid = "f70d9fcc-98c5-4d4a-abd7-e4cdeebd8ca8" -version = "1.0.0" - -[[deps.Compat]] -deps = ["TOML", "UUIDs"] -git-tree-sha1 = "b1c55339b7c6c350ee89f2c1604299660525b248" -uuid = "34da2185-b29b-5c13-b0c7-acf172513d20" -version = "4.15.0" -weakdeps = ["Dates", "LinearAlgebra"] - - [deps.Compat.extensions] - CompatLinearAlgebraExt = "LinearAlgebra" - -[[deps.CompilerSupportLibraries_jll]] -deps = ["Artifacts", "Libdl"] -uuid = "e66e0078-7015-5450-92f7-15fbd957f2ae" -version = "1.1.1+0" - -[[deps.CpuId]] -deps = ["Markdown"] -git-tree-sha1 = "fcbb72b032692610bfbdb15018ac16a36cf2e406" -uuid = "adafc99b-e345-5852-983c-f28acb93d879" -version = "0.3.1" - -[[deps.CxxWrap]] -deps = ["Libdl", "MacroTools", "libcxxwrap_julia_jll"] -git-tree-sha1 = "3345cb637ca1efb2ebf7f5145558522b92660d1f" -uuid = "1f15a43c-97ca-5a2a-ae31-89f07a497df4" -version = "0.14.2" - -[[deps.Dates]] -deps = ["Printf"] -uuid = "ade2ca70-3891-5945-98fb-dc099432e06a" - -[[deps.DecFP]] -deps = ["DecFP_jll", "Printf", "Random", "SpecialFunctions"] -git-tree-sha1 = "4a10cec664e26d9d63597daf9e62147e79d636e3" -uuid = "55939f99-70c6-5e9b-8bb0-5071ed7d61fd" -version = "1.3.2" - -[[deps.DecFP_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "e9a8da19f847bbfed4076071f6fef8665a30d9e5" -uuid = "47200ebd-12ce-5be5-abb7-8e082af23329" -version = "2.0.3+1" - -[[deps.Distributed]] -deps = ["Random", "Serialization", "Sockets"] -uuid = "8ba89e20-285c-5b6f-9357-94700520ee1b" - -[[deps.DocStringExtensions]] -deps = ["LibGit2"] -git-tree-sha1 = "2fb1e02f2b635d0845df5d7c167fec4dd739b00d" -uuid = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae" -version = "0.9.3" - -[[deps.Downloads]] -deps = ["ArgTools", "FileWatching", "LibCURL", "NetworkOptions"] -uuid = "f43a241f-c20a-4ad4-852c-f6b1247861c6" -version = "1.6.0" - -[[deps.FLINT_jll]] -deps = ["Artifacts", "GMP_jll", "JLLWrappers", "Libdl", "MPFR_jll", "OpenBLAS32_jll"] -git-tree-sha1 = "4bde447e7bc6de73de36870fc942df02f4dd44b5" -uuid = "e134572f-a0d5-539d-bddf-3cad8db41a82" -version = "300.100.300+0" - -[[deps.FileWatching]] -uuid = "7b1f6079-737a-58dc-b8bc-7a2ca5c1b5ee" - -[[deps.GAP]] -deps = ["Artifacts", "Compat", "Downloads", "GAP_jll", "GAP_lib_jll", "GAP_pkg_juliainterface_jll", "InteractiveUtils", "Libdl", "MacroTools", "Markdown", "Ncurses_jll", "Pidfile", "Pkg", "REPL", "Random", "Scratch"] -git-tree-sha1 = "fcaf50e1874719fdec62c3646351e52007ad63aa" -uuid = "c863536a-3901-11e9-33e7-d5cd0df7b904" -version = "0.10.4" - -[[deps.GAP_jll]] -deps = ["Artifacts", "GMP_jll", "JLLWrappers", "Libdl", "Pkg", "Readline_jll", "Zlib_jll"] -git-tree-sha1 = "c3a00b8f8ced0887d52104d0a0df233d9efc79d4" -uuid = "5cd7a574-2c56-5be2-91dc-c8bc375b9ddf" -version = "400.1200.200+9" - -[[deps.GAP_lib_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "473b619163e30d9cc58d4a8f9d412e6ea8910fcf" -uuid = "de1ad85e-c930-5cd4-919d-ccd3fcafd1a3" -version = "400.1201.200+0" - -[[deps.GAP_pkg_juliainterface_jll]] -deps = ["Artifacts", "GAP_jll", "GAP_lib_jll", "JLLWrappers", "Libdl"] -git-tree-sha1 = "c5a0f16f0478ab067752861d3c9339f335832459" -uuid = "ba154793-3a7d-51ee-8800-e295b0cf7374" -version = "0.800.300+3" - -[[deps.GLPK_jll]] -deps = ["Artifacts", "GMP_jll", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "fe68622f32828aa92275895fdb324a85894a5b1b" -uuid = "e8aa6df9-e6ca-548a-97ff-1f85fc5b8b98" -version = "5.0.1+0" - -[[deps.GMP_jll]] -deps = ["Artifacts", "Libdl"] -uuid = "781609d7-10c4-51f6-84f2-b8444358ff6d" -version = "6.2.1+6" - -[[deps.Hecke]] -deps = ["AbstractAlgebra", "Dates", "Distributed", "InteractiveUtils", "LazyArtifacts", "Libdl", "LinearAlgebra", "Markdown", "Nemo", "Pkg", "Printf", "Random", "RandomExtensions", "Serialization", "SparseArrays"] -git-tree-sha1 = "f89af7272ac9585fe73c1f0d810970b025ddc345" -uuid = "3e1990a7-5d81-5526-99ce-9ba3ff248f21" -version = "0.32.3" -weakdeps = ["GAP", "Polymake"] - - [deps.Hecke.extensions] - GAPExt = "GAP" - PolymakeExt = "Polymake" - -[[deps.HostCPUFeatures]] -deps = ["BitTwiddlingConvenienceFunctions", "IfElse", "Libdl", "Static"] -git-tree-sha1 = "8e070b599339d622e9a081d17230d74a5c473293" -uuid = "3e5b6fbb-0976-4d2c-9146-d79de83f2fb0" -version = "0.1.17" - -[[deps.Hwloc_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl"] -git-tree-sha1 = "5e19e1e4fa3e71b774ce746274364aef0234634e" -uuid = "e33a78d0-f292-5ffc-b300-72abe9b543c8" -version = "2.11.1+0" - -[[deps.IfElse]] -git-tree-sha1 = "debdd00ffef04665ccbb3e150747a77560e8fad1" -uuid = "615f187c-cbe4-4ef1-ba3b-2fcf58d6d173" -version = "0.1.1" - -[[deps.InteractiveUtils]] -deps = ["Markdown"] -uuid = "b77e0a4c-d291-57a0-90e8-8db25a27a240" - -[[deps.Ipopt_jll]] -deps = ["ASL_jll", "Artifacts", "CompilerSupportLibraries_jll", "JLLWrappers", "Libdl", "MUMPS_seq_jll", "SPRAL_jll", "libblastrampoline_jll"] -git-tree-sha1 = "546c40fd3718c65d48296dd6cec98af9904e3ca4" -uuid = "9cc047cb-c261-5740-88fc-0cf96f7bdcc7" -version = "300.1400.1400+0" - -[[deps.IrrationalConstants]] -git-tree-sha1 = "630b497eafcc20001bba38a4651b327dcfc491d2" -uuid = "92d709cd-6900-40b7-9082-c6be49f344b6" -version = "0.2.2" - -[[deps.JLLWrappers]] -deps = ["Artifacts", "Preferences"] -git-tree-sha1 = "7e5d6779a1e09a36db2a7b6cff50942a0a7d0fca" -uuid = "692b3bcd-3c85-4b1f-b108-f13ce0eb3210" -version = "1.5.0" - -[[deps.JSON]] -deps = ["Dates", "Mmap", "Parsers", "Unicode"] -git-tree-sha1 = "31e996f0a15c7b280ba9f76636b3ff9e2ae58c9a" -uuid = "682c06a0-de6a-54ab-a142-c8b1cf79cde6" -version = "0.21.4" - -[[deps.JSON3]] -deps = ["Dates", "Mmap", "Parsers", "PrecompileTools", "StructTypes", "UUIDs"] -git-tree-sha1 = "eb3edce0ed4fa32f75a0a11217433c31d56bd48b" -uuid = "0f8b85d8-7281-11e9-16c2-39a750bddbf1" -version = "1.14.0" - - [deps.JSON3.extensions] - JSON3ArrowExt = ["ArrowTypes"] - - [deps.JSON3.weakdeps] - ArrowTypes = "31f734f8-188a-4ce0-8406-c8a06bd891cd" - -[[deps.LLVMOpenMP_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl"] -git-tree-sha1 = "d986ce2d884d49126836ea94ed5bfb0f12679713" -uuid = "1d63c593-3942-5779-bab2-d838dc0a180e" -version = "15.0.7+0" - -[[deps.LZO_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl"] -git-tree-sha1 = "70c5da094887fd2cae843b8db33920bac4b6f07d" -uuid = "dd4b983a-f0e5-5f8d-a1b7-129d4a5fb1ac" -version = "2.10.2+0" - -[[deps.LayoutPointers]] -deps = ["ArrayInterface", "LinearAlgebra", "ManualMemory", "SIMDTypes", "Static", "StaticArrayInterface"] -git-tree-sha1 = "a9eaadb366f5493a5654e843864c13d8b107548c" -uuid = "10f19ff3-798f-405d-979b-55457f8fc047" -version = "0.1.17" - -[[deps.LazyArtifacts]] -deps = ["Artifacts", "Pkg"] -uuid = "4af54fe1-eca0-43a8-85a7-787d91b784e3" - -[[deps.LibCURL]] -deps = ["LibCURL_jll", "MozillaCACerts_jll"] -uuid = "b27032c2-a3e7-50c8-80cd-2d36dbcbfd21" -version = "0.6.4" - -[[deps.LibCURL_jll]] -deps = ["Artifacts", "LibSSH2_jll", "Libdl", "MbedTLS_jll", "Zlib_jll", "nghttp2_jll"] -uuid = "deac9b47-8bc7-5906-a0fe-35ac56dc84c0" -version = "8.4.0+0" - -[[deps.LibGit2]] -deps = ["Base64", "LibGit2_jll", "NetworkOptions", "Printf", "SHA"] -uuid = "76f85450-5226-5b5a-8eaa-529ad045b433" - -[[deps.LibGit2_jll]] -deps = ["Artifacts", "LibSSH2_jll", "Libdl", "MbedTLS_jll"] -uuid = "e37daf67-58a4-590a-8e99-b0245dd2ffc5" -version = "1.6.4+0" - -[[deps.LibSSH2_jll]] -deps = ["Artifacts", "Libdl", "MbedTLS_jll"] -uuid = "29816b5a-b9ab-546f-933c-edad1886dfa8" -version = "1.11.0+1" - -[[deps.Libdl]] -uuid = "8f399da3-3557-5675-b5ff-fb832c97cbdb" - -[[deps.LinearAlgebra]] -deps = ["Libdl", "OpenBLAS_jll", "libblastrampoline_jll"] -uuid = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" - -[[deps.LogExpFunctions]] -deps = ["DocStringExtensions", "IrrationalConstants", "LinearAlgebra"] -git-tree-sha1 = "a2d09619db4e765091ee5c6ffe8872849de0feea" -uuid = "2ab3a3ac-af41-5b50-aa03-7779005ae688" -version = "0.3.28" - - [deps.LogExpFunctions.extensions] - LogExpFunctionsChainRulesCoreExt = "ChainRulesCore" - LogExpFunctionsChangesOfVariablesExt = "ChangesOfVariables" - LogExpFunctionsInverseFunctionsExt = "InverseFunctions" - - [deps.LogExpFunctions.weakdeps] - ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4" - ChangesOfVariables = "9e997f8a-9a97-42d5-a9f1-ce6bfc15e2c0" - InverseFunctions = "3587e190-3f89-42d0-90ee-14403ec27112" - -[[deps.Logging]] -uuid = "56ddb016-857b-54e1-b83d-db4d58db5568" - -[[deps.LoopVectorization]] -deps = ["ArrayInterface", "CPUSummary", "CloseOpenIntervals", "DocStringExtensions", "HostCPUFeatures", "IfElse", "LayoutPointers", "LinearAlgebra", "OffsetArrays", "PolyesterWeave", "PrecompileTools", "SIMDTypes", "SLEEFPirates", "Static", "StaticArrayInterface", "ThreadingUtilities", "UnPack", "VectorizationBase"] -git-tree-sha1 = "8084c25a250e00ae427a379a5b607e7aed96a2dd" -uuid = "bdcacae8-1622-11e9-2a5c-532679323890" -version = "0.12.171" - - [deps.LoopVectorization.extensions] - ForwardDiffExt = ["ChainRulesCore", "ForwardDiff"] - SpecialFunctionsExt = "SpecialFunctions" - - [deps.LoopVectorization.weakdeps] - ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4" - ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210" - SpecialFunctions = "276daf66-3868-5448-9aa4-cd146d93841b" - -[[deps.Lz4_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl"] -git-tree-sha1 = "6c26c5e8a4203d43b5497be3ec5d4e0c3cde240a" -uuid = "5ced341a-0733-55b8-9ab6-a4889d929147" -version = "1.9.4+0" - -[[deps.METIS_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "1fd0a97409e418b78c53fac671cf4622efdf0f21" -uuid = "d00139f3-1899-568f-a2f0-47f597d42d70" -version = "5.1.2+0" - -[[deps.MPFR_jll]] -deps = ["Artifacts", "GMP_jll", "Libdl"] -uuid = "3a97d323-0669-5f0c-9066-3539efd106a3" -version = "4.2.0+1" - -[[deps.MUMPS_seq_jll]] -deps = ["Artifacts", "CompilerSupportLibraries_jll", "JLLWrappers", "Libdl", "METIS_jll", "libblastrampoline_jll"] -git-tree-sha1 = "840b83c65b27e308095c139a457373850b2f5977" -uuid = "d7ed1dd3-d0ae-5e8e-bfb4-87a502085b8d" -version = "500.600.201+0" - -[[deps.MacroTools]] -deps = ["Markdown", "Random"] -git-tree-sha1 = "2fa9ee3e63fd3a4f7a9a4f4744a52f4856de82df" -uuid = "1914dd2f-81c6-5fcd-8719-6d5c9610ff09" -version = "0.5.13" - -[[deps.ManualMemory]] -git-tree-sha1 = "bcaef4fc7a0cfe2cba636d84cda54b5e4e4ca3cd" -uuid = "d125e4d3-2237-4719-b19c-fa641b8a4667" -version = "0.1.8" - -[[deps.Markdown]] -deps = ["Base64"] -uuid = "d6f4376e-aef5-505a-96c1-9c027394607a" - -[[deps.MbedTLS_jll]] -deps = ["Artifacts", "Libdl"] -uuid = "c8ffd9c3-330d-5841-b78e-0817d7145fa1" -version = "2.28.2+1" - -[[deps.Mmap]] -uuid = "a63ad114-7e13-5084-954f-fe012c677804" - -[[deps.MongoC_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "OpenSSL_jll", "Zlib_jll", "Zstd_jll", "snappy_jll"] -git-tree-sha1 = "5a0f9f14a8186eae48608ff7922ac0c00ff52cdc" -uuid = "90100e71-7732-535a-9be7-2e9affd1cfc1" -version = "1.25.1+0" - -[[deps.Mongoc]] -deps = ["Dates", "DecFP", "MongoC_jll", "Serialization"] -git-tree-sha1 = "f47bf7ed9d9c1da0a632777ca7dc406e3ad5f923" -uuid = "4fe8b98c-fc19-5c23-8ec2-168ff83495f2" -version = "0.9.0" - -[[deps.MozillaCACerts_jll]] -uuid = "14a3606d-f60d-562e-9121-12d972cd8159" -version = "2023.1.10" - -[[deps.Ncurses_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl"] -git-tree-sha1 = "3ac1ca10bae513c9cc8f83d7734b921b8007b574" -uuid = "68e3532b-a499-55ff-9963-d1c0c0748b3a" -version = "6.5.0+0" - -[[deps.Nemo]] -deps = ["AbstractAlgebra", "FLINT_jll", "Libdl", "LinearAlgebra", "Pkg", "Random", "RandomExtensions", "SHA"] -git-tree-sha1 = "bae0f1452c648d84535b581103ab8a59cf10a32a" -uuid = "2edaba10-b0f1-5616-af89-8c11ac63239a" -version = "0.45.7" - -[[deps.NetworkOptions]] -uuid = "ca575930-c2e3-43a9-ace4-1e988b2c1908" -version = "1.2.0" - -[[deps.Ninja_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl"] -git-tree-sha1 = "d9c6d1dca818768f1671244dcdf8e8e08b2b8937" -uuid = "76642167-d241-5cee-8c94-7a494e8cb7b7" -version = "1.12.1+0" - -[[deps.OffsetArrays]] -git-tree-sha1 = "1a27764e945a152f7ca7efa04de513d473e9542e" -uuid = "6fe1bfb0-de20-5000-8ca7-80f57d26f881" -version = "1.14.1" -weakdeps = ["Adapt"] - - [deps.OffsetArrays.extensions] - OffsetArraysAdaptExt = "Adapt" - -[[deps.OpenBLAS32_jll]] -deps = ["Artifacts", "CompilerSupportLibraries_jll", "JLLWrappers", "Libdl"] -git-tree-sha1 = "6065c4cff8fee6c6770b277af45d5082baacdba1" -uuid = "656ef2d0-ae68-5445-9ca0-591084a874a2" -version = "0.3.24+0" - -[[deps.OpenBLAS_jll]] -deps = ["Artifacts", "CompilerSupportLibraries_jll", "Libdl"] -uuid = "4536629a-c528-5b80-bd46-f80d51c5b363" -version = "0.3.23+4" - -[[deps.OpenLibm_jll]] -deps = ["Artifacts", "Libdl"] -uuid = "05823500-19ac-5b8b-9628-191a04bc5112" -version = "0.8.1+2" - -[[deps.OpenSSL_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl"] -git-tree-sha1 = "a12e56c72edee3ce6b96667745e6cbbe5498f200" -uuid = "458c3c95-2e84-50aa-8efc-19380b2a3a95" -version = "1.1.23+0" - -[[deps.OpenSpecFun_jll]] -deps = ["Artifacts", "CompilerSupportLibraries_jll", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "13652491f6856acfd2db29360e1bbcd4565d04f1" -uuid = "efe28fd5-8261-553b-a9e1-b2916fc3738e" -version = "0.5.5+0" - -[[deps.Oscar]] -deps = ["AbstractAlgebra", "AlgebraicSolving", "Distributed", "GAP", "Hecke", "JSON", "JSON3", "LazyArtifacts", "Markdown", "Nemo", "Pkg", "Polymake", "Random", "RandomExtensions", "Serialization", "Singular", "TOPCOM_jll", "UUIDs", "cohomCalg_jll"] -git-tree-sha1 = "6d86eb479c0afaebad9c00e862d91f3ae1de3c4f" -uuid = "f1435218-dba5-11e9-1e4d-f1a5fab5fc13" -version = "1.1.1" - -[[deps.PPL_jll]] -deps = ["Artifacts", "GMP_jll", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "dc69ba2b374b5bd6e876fa3a8441563c0eeafb9e" -uuid = "80dd9cbb-8b87-5171-a280-372cc418f402" -version = "1.2.1+0" - -[[deps.Parsers]] -deps = ["Dates", "PrecompileTools", "UUIDs"] -git-tree-sha1 = "8489905bcdbcfac64d1daa51ca07c0d8f0283821" -uuid = "69de0a69-1ddd-5017-9359-2bf0b02dc9f0" -version = "2.8.1" - -[[deps.Perl_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Readline_jll"] -git-tree-sha1 = "7ab65a258bcf6da373cab49af462aead452d3960" -uuid = "83958c19-0796-5285-893e-a1267f8ec499" -version = "5.34.1+0" - -[[deps.Pidfile]] -deps = ["FileWatching", "Test"] -git-tree-sha1 = "2d8aaf8ee10df53d0dfb9b8ee44ae7c04ced2b03" -uuid = "fa939f87-e72e-5be4-a000-7fc836dbe307" -version = "1.3.0" - -[[deps.Pkg]] -deps = ["Artifacts", "Dates", "Downloads", "FileWatching", "LibGit2", "Libdl", "Logging", "Markdown", "Printf", "REPL", "Random", "SHA", "Serialization", "TOML", "Tar", "UUIDs", "p7zip_jll"] -uuid = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" -version = "1.10.0" - -[[deps.PolyesterWeave]] -deps = ["BitTwiddlingConvenienceFunctions", "CPUSummary", "IfElse", "Static", "ThreadingUtilities"] -git-tree-sha1 = "645bed98cd47f72f67316fd42fc47dee771aefcd" -uuid = "1d0040c9-8b98-4ee7-8388-3f51789ca0ad" -version = "0.2.2" - -[[deps.Polymake]] -deps = ["AbstractAlgebra", "BinaryWrappers", "CxxWrap", "Downloads", "JSON", "Libdl", "Mongoc", "NetworkOptions", "Ninja_jll", "Perl_jll", "Pidfile", "Pkg", "REPL", "Scratch", "SparseArrays", "TOPCOM_jll", "lib4ti2_jll", "libpolymake_julia_jll", "polymake_jll", "polymake_oscarnumber_jll"] -git-tree-sha1 = "4ae104b2d9eb68fdd1b013411b3eccd234d28406" -uuid = "d720cf60-89b5-51f5-aff5-213f193123e7" -version = "0.11.19" - -[[deps.PrecompileTools]] -deps = ["Preferences"] -git-tree-sha1 = "5aa36f7049a63a1528fe8f7c3f2113413ffd4e1f" -uuid = "aea7be01-6a6a-4083-8856-8a6e6704d82a" -version = "1.2.1" - -[[deps.Preferences]] -deps = ["TOML"] -git-tree-sha1 = "9306f6085165d270f7e3db02af26a400d580f5c6" -uuid = "21216c6a-2e73-6563-6e65-726566657250" -version = "1.4.3" - -[[deps.Printf]] -deps = ["Unicode"] -uuid = "de0858da-6303-5e67-8744-51eddeeeb8d7" - -[[deps.Profile]] -deps = ["Printf"] -uuid = "9abbd945-dff8-562f-b5e8-e1ebf5ef1b79" - -[[deps.REPL]] -deps = ["InteractiveUtils", "Markdown", "Sockets", "Unicode"] -uuid = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb" - -[[deps.Random]] -deps = ["SHA"] -uuid = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" - -[[deps.RandomExtensions]] -deps = ["Random", "SparseArrays"] -git-tree-sha1 = "b8a399e95663485820000f26b6a43c794e166a49" -uuid = "fb686558-2515-59ef-acaa-46db3789a887" -version = "0.4.4" - -[[deps.Readline_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Ncurses_jll"] -git-tree-sha1 = "9d70e0c890a6c7ca3eb1ca0eaabba4d34795b7fb" -uuid = "05236dd9-4125-5232-aa7c-9ec0c9b2c25a" -version = "8.2.1+0" - -[[deps.Requires]] -deps = ["UUIDs"] -git-tree-sha1 = "838a3a4188e2ded87a4f9f184b4b0d78a1e91cb7" -uuid = "ae029012-a4dd-5104-9daa-d747884805df" -version = "1.3.0" - -[[deps.SCIP_jll]] -deps = ["Artifacts", "Bzip2_jll", "CompilerSupportLibraries_jll", "GMP_jll", "Ipopt_jll", "JLLWrappers", "Libdl", "Pkg", "Readline_jll", "Zlib_jll", "bliss_jll", "boost_jll"] -git-tree-sha1 = "cf69186eb29307fbb2319b90e6133797bad983ce" -uuid = "e5ac4fe4-a920-5659-9bf8-f9f73e9e79ce" -version = "800.0.301+0" - -[[deps.SHA]] -uuid = "ea8e919c-243c-51af-8825-aaa63cd721ce" -version = "0.7.0" - -[[deps.SIMDTypes]] -git-tree-sha1 = "330289636fb8107c5f32088d2741e9fd7a061a5c" -uuid = "94e857df-77ce-4151-89e5-788b33177be4" -version = "0.1.0" - -[[deps.SLEEFPirates]] -deps = ["IfElse", "Static", "VectorizationBase"] -git-tree-sha1 = "456f610ca2fbd1c14f5fcf31c6bfadc55e7d66e0" -uuid = "476501e8-09a2-5ece-8869-fb82de89a1fa" -version = "0.6.43" - -[[deps.SPRAL_jll]] -deps = ["Artifacts", "CompilerSupportLibraries_jll", "Hwloc_jll", "JLLWrappers", "Libdl", "METIS_jll", "libblastrampoline_jll"] -git-tree-sha1 = "34b9dacd687cace8aa4d550e3e9bb8615f1a61e9" -uuid = "319450e9-13b8-58e8-aa9f-8fd1420848ab" -version = "2024.1.18+0" - -[[deps.Scratch]] -deps = ["Dates"] -git-tree-sha1 = "3bac05bc7e74a75fd9cba4295cde4045d9fe2386" -uuid = "6c6a2e73-6563-6170-7368-637461726353" -version = "1.2.1" - -[[deps.Serialization]] -uuid = "9e88b42a-f829-5b0c-bbe9-9e923198166b" - -[[deps.Singular]] -deps = ["AbstractAlgebra", "BinaryWrappers", "CxxWrap", "Libdl", "LinearAlgebra", "Nemo", "Pidfile", "Pkg", "Random", "RandomExtensions", "Singular_jll", "Statistics", "lib4ti2_jll", "libsingular_julia_jll"] -git-tree-sha1 = "a55baf3aac647d50799ecd963e9026c472f003c0" -uuid = "bcd08a7b-43d2-5ff7-b6d4-c458787f915c" -version = "0.23.4" - -[[deps.Singular_jll]] -deps = ["Artifacts", "FLINT_jll", "GMP_jll", "JLLWrappers", "Libdl", "MPFR_jll", "cddlib_jll"] -git-tree-sha1 = "398b1d72ad1c12e8a8b8ce54a11d0bb9fa6bfb89" -uuid = "43d676ae-4934-50ba-8046-7a96366d613b" -version = "404.0.301+0" - -[[deps.Sockets]] -uuid = "6462fe0b-24de-5631-8697-dd941f90decc" - -[[deps.SparseArrays]] -deps = ["Libdl", "LinearAlgebra", "Random", "Serialization", "SuiteSparse_jll"] -uuid = "2f01184e-e22b-5df5-ae63-d93ebab69eaf" -version = "1.10.0" - -[[deps.SpecialFunctions]] -deps = ["IrrationalConstants", "LogExpFunctions", "OpenLibm_jll", "OpenSpecFun_jll"] -git-tree-sha1 = "2f5d4697f21388cbe1ff299430dd169ef97d7e14" -uuid = "276daf66-3868-5448-9aa4-cd146d93841b" -version = "2.4.0" - - [deps.SpecialFunctions.extensions] - SpecialFunctionsChainRulesCoreExt = "ChainRulesCore" - - [deps.SpecialFunctions.weakdeps] - ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4" - -[[deps.Static]] -deps = ["CommonWorldInvalidations", "IfElse", "PrecompileTools"] -git-tree-sha1 = "87d51a3ee9a4b0d2fe054bdd3fc2436258db2603" -uuid = "aedffcd0-7271-4cad-89d0-dc628f76c6d3" -version = "1.1.1" - -[[deps.StaticArrayInterface]] -deps = ["ArrayInterface", "Compat", "IfElse", "LinearAlgebra", "PrecompileTools", "Requires", "SparseArrays", "Static", "SuiteSparse"] -git-tree-sha1 = "8963e5a083c837531298fc41599182a759a87a6d" -uuid = "0d7ed370-da01-4f52-bd93-41d350b8b718" -version = "1.5.1" -weakdeps = ["OffsetArrays", "StaticArrays"] - - [deps.StaticArrayInterface.extensions] - StaticArrayInterfaceOffsetArraysExt = "OffsetArrays" - StaticArrayInterfaceStaticArraysExt = "StaticArrays" - -[[deps.StaticArrays]] -deps = ["LinearAlgebra", "PrecompileTools", "Random", "StaticArraysCore"] -git-tree-sha1 = "eeafab08ae20c62c44c8399ccb9354a04b80db50" -uuid = "90137ffa-7385-5640-81b9-e52037218182" -version = "1.9.7" - - [deps.StaticArrays.extensions] - StaticArraysChainRulesCoreExt = "ChainRulesCore" - StaticArraysStatisticsExt = "Statistics" - - [deps.StaticArrays.weakdeps] - ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4" - Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2" - -[[deps.StaticArraysCore]] -git-tree-sha1 = "192954ef1208c7019899fbf8049e717f92959682" -uuid = "1e83bf80-4336-4d27-bf5d-d5a4f845583c" -version = "1.4.3" - -[[deps.Statistics]] -deps = ["LinearAlgebra", "SparseArrays"] -uuid = "10745b16-79ce-11e8-11f9-7d13ad32a3b2" -version = "1.10.0" - -[[deps.StructTypes]] -deps = ["Dates", "UUIDs"] -git-tree-sha1 = "ca4bccb03acf9faaf4137a9abc1881ed1841aa70" -uuid = "856f2bd8-1eba-4b0a-8007-ebc267875bd4" -version = "1.10.0" - -[[deps.SuiteSparse]] -deps = ["Libdl", "LinearAlgebra", "Serialization", "SparseArrays"] -uuid = "4607b0f0-06f3-5cda-b6b1-a6196a1729e9" - -[[deps.SuiteSparse_jll]] -deps = ["Artifacts", "Libdl", "libblastrampoline_jll"] -uuid = "bea87d4a-7f5b-5778-9afe-8cc45184846c" -version = "7.2.1+1" - -[[deps.TOML]] -deps = ["Dates"] -uuid = "fa267f1f-6049-4f14-aa54-33bafae1ed76" -version = "1.0.3" - -[[deps.TOPCOM_jll]] -deps = ["Artifacts", "GMP_jll", "JLLWrappers", "Libdl", "Pkg", "cddlib_jll"] -git-tree-sha1 = "adbe178144e762ae7057fcb8e26564de7ee2e36c" -uuid = "36f60fef-b880-50dc-9289-4aaecee93cc3" -version = "0.17.8+0" - -[[deps.Tar]] -deps = ["ArgTools", "SHA"] -uuid = "a4e569a6-e804-4fa4-b0f3-eef7a1d5b13e" -version = "1.10.0" - -[[deps.Test]] -deps = ["InteractiveUtils", "Logging", "Random", "Serialization"] -uuid = "8dfed614-e22c-5e08-85e1-65c5234f0b40" - -[[deps.ThreadingUtilities]] -deps = ["ManualMemory"] -git-tree-sha1 = "eda08f7e9818eb53661b3deb74e3159460dfbc27" -uuid = "8290d209-cae3-49c0-8002-c8c24d57dab5" -version = "0.5.2" - -[[deps.UUIDs]] -deps = ["Random", "SHA"] -uuid = "cf7118a7-6976-5b1a-9a39-7adc72f591a4" - -[[deps.UnPack]] -git-tree-sha1 = "387c1f73762231e86e0c9c5443ce3b4a0a9a0c2b" -uuid = "3a884ed6-31ef-47d7-9d2a-63182c4928ed" -version = "1.0.2" - -[[deps.Unicode]] -uuid = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5" - -[[deps.VectorizationBase]] -deps = ["ArrayInterface", "CPUSummary", "HostCPUFeatures", "IfElse", "LayoutPointers", "Libdl", "LinearAlgebra", "SIMDTypes", "Static", "StaticArrayInterface"] -git-tree-sha1 = "e7f5b81c65eb858bed630fe006837b935518aca5" -uuid = "3d5dd08c-fd9d-11e8-17fa-ed2836048c2f" -version = "0.21.70" - -[[deps.Zlib_jll]] -deps = ["Libdl"] -uuid = "83775a58-1f1d-513f-b197-d71354ab007a" -version = "1.2.13+1" - -[[deps.Zstd_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl"] -git-tree-sha1 = "e678132f07ddb5bfa46857f0d7620fb9be675d3b" -uuid = "3161d3a3-bdf6-5164-811a-617609db77b4" -version = "1.5.6+0" - -[[deps.bliss_jll]] -deps = ["Artifacts", "GMP_jll", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "f8b75e896a326a162a4f6e998990521d8302c810" -uuid = "508c9074-7a14-5c94-9582-3d4bc1871065" -version = "0.77.0+1" - -[[deps.boost_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Zlib_jll"] -git-tree-sha1 = "7a89efe0137720ca82f99e8daa526d23120d0d37" -uuid = "28df3c45-c428-5900-9ff8-a3135698ca75" -version = "1.76.0+1" - -[[deps.cddlib_jll]] -deps = ["Artifacts", "GMP_jll", "JLLWrappers", "Libdl"] -git-tree-sha1 = "08f5df03703af917b9bfec47b9767eb943220d08" -uuid = "f07e07eb-5685-515a-97c8-3014f6152feb" -version = "0.94.14+0" - -[[deps.cohomCalg_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "999c34925053825bfa29f54b3c00b80668b681ec" -uuid = "5558cf25-a90e-53b0-b813-cadaa3ae7ade" -version = "0.32.0+0" - -[[deps.lib4ti2_jll]] -deps = ["Artifacts", "GLPK_jll", "GMP_jll", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "79116185def638e73ea3d88ca6c10e210a1dc183" -uuid = "1493ae25-0f90-5c0e-a06c-8c5077d6d66f" -version = "1.6.10+0" - -[[deps.libblastrampoline_jll]] -deps = ["Artifacts", "Libdl"] -uuid = "8e850b90-86db-534c-a0d3-1478176c7d93" -version = "5.8.0+1" - -[[deps.libcxxwrap_julia_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl"] -git-tree-sha1 = "02d0a0a623248c709727088aaf722ab14f1463a5" -uuid = "3eaa8342-bff7-56a5-9981-c04077f7cee7" -version = "0.11.2+1" - -[[deps.libpolymake_julia_jll]] -deps = ["Artifacts", "CompilerSupportLibraries_jll", "FLINT_jll", "JLLWrappers", "Libdl", "TOPCOM_jll", "lib4ti2_jll", "libcxxwrap_julia_jll", "polymake_jll"] -git-tree-sha1 = "87edbe6bc0171e6918b25dced309db6cba43cc97" -uuid = "4d8266f6-2b3b-57e3-ad7a-d431eaaac945" -version = "0.12.0+0" - -[[deps.libsingular_julia_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Singular_jll", "libcxxwrap_julia_jll"] -git-tree-sha1 = "efd81d3e0a881293b7123357d1db4b0d5cd159cb" -uuid = "ae4fbd8f-ecdb-54f8-bbce-35570499b30e" -version = "0.45.2+0" - -[[deps.lrslib_jll]] -deps = ["Artifacts", "GMP_jll", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "9169c4d5823195a7a2173fc6b479468478857438" -uuid = "3873f7d0-7b7c-52c3-bdf4-8ab39b8f337a" -version = "0.3.3+0" - -[[deps.msolve_jll]] -deps = ["Artifacts", "CompilerSupportLibraries_jll", "FLINT_jll", "GMP_jll", "JLLWrappers", "LLVMOpenMP_jll", "Libdl", "MPFR_jll"] -git-tree-sha1 = "d6b643f97075ff6d7342fca2bcf8acca7b6282e7" -uuid = "6d01cc9a-e8f6-580e-8c54-544227e08205" -version = "0.600.700+0" - -[[deps.nauty_jll]] -deps = ["Artifacts", "GMP_jll", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "fc7dc197df0648cd5f965801bfe086abd9325add" -uuid = "55c6dc9b-343a-50ca-8ff2-b71adb3733d5" -version = "2.6.13+1" - -[[deps.nghttp2_jll]] -deps = ["Artifacts", "Libdl"] -uuid = "8e850ede-7688-5339-a07c-302acd2aaf8d" -version = "1.52.0+1" - -[[deps.normaliz_jll]] -deps = ["Artifacts", "CompilerSupportLibraries_jll", "FLINT_jll", "GMP_jll", "JLLWrappers", "LLVMOpenMP_jll", "Libdl", "MPFR_jll", "nauty_jll"] -git-tree-sha1 = "b84641c3add3c9e435546b1f2867105ce209791f" -uuid = "6690c6e9-4e12-53b8-b8fd-4bffaef8839f" -version = "300.1000.200+0" - -[[deps.p7zip_jll]] -deps = ["Artifacts", "Libdl"] -uuid = "3f19e933-33d8-53b3-aaab-bd5110c3b7a0" -version = "17.4.0+2" - -[[deps.polymake_jll]] -deps = ["Artifacts", "CompilerSupportLibraries_jll", "FLINT_jll", "GMP_jll", "JLLWrappers", "LLVMOpenMP_jll", "Libdl", "MPFR_jll", "MongoC_jll", "PPL_jll", "Perl_jll", "SCIP_jll", "bliss_jll", "boost_jll", "cddlib_jll", "lrslib_jll", "normaliz_jll"] -git-tree-sha1 = "bd0b5a3dd1f0d1309d6314b207d5e2bc51d42c29" -uuid = "7c209550-9012-526c-9264-55ba7a78ba2c" -version = "400.1200.1+0" - -[[deps.polymake_oscarnumber_jll]] -deps = ["Artifacts", "CompilerSupportLibraries_jll", "JLLWrappers", "LLVMOpenMP_jll", "Libdl", "libcxxwrap_julia_jll", "libpolymake_julia_jll", "polymake_jll"] -git-tree-sha1 = "ccba21af52e431ffa889965693daf98a8699dbbb" -uuid = "10f31823-b687-53e6-9f29-edb9d4da9f9f" -version = "0.3.0+0" - -[[deps.snappy_jll]] -deps = ["Artifacts", "JLLWrappers", "LZO_jll", "Libdl", "Lz4_jll", "Zlib_jll"] -git-tree-sha1 = "8bc7ddafc0a7339b82a06c1dde849cd5039324d6" -uuid = "fe1e1685-f7be-5f59-ac9f-4ca204017dfd" -version = "1.2.0+0" diff --git a/experimental/GroebnerWalk/Project.toml b/experimental/GroebnerWalk/Project.toml deleted file mode 100644 index dd2e90bee89f..000000000000 --- a/experimental/GroebnerWalk/Project.toml +++ /dev/null @@ -1,8 +0,0 @@ -name = "GroebnerWalk" -uuid = "6dc8777d-2b0c-4de5-9e3c-426c1820f6f9" -authors = ["Kamillo Ferry ", "Francesco Nowell "] -version = "1.0.1" - -[deps] -BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf" -Oscar = "f1435218-dba5-11e9-1e4d-f1a5fab5fc13" From d12ab9e8fee4e7a569c9fa75e1a5e1e5d1e8d0be Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Wed, 5 Jun 2024 14:23:39 +0200 Subject: [PATCH 117/179] Remove standalone Julia package files --- LICENSE | 674 --------------------------------------- Manifest.toml | 866 -------------------------------------------------- Project.toml | 8 - 3 files changed, 1548 deletions(-) delete mode 100644 LICENSE delete mode 100644 Manifest.toml delete mode 100644 Project.toml diff --git a/LICENSE b/LICENSE deleted file mode 100644 index f288702d2fa1..000000000000 --- a/LICENSE +++ /dev/null @@ -1,674 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU General Public License is a free, copyleft license for -software and other kinds of works. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they -know their rights. - - Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. - - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - - Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Use with the GNU Affero General Public License. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - -Also add information on how to contact you by electronic and paper mail. - - If the program does terminal interaction, make it output a short -notice like this when it starts in an interactive mode: - - Copyright (C) - This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, your program's commands -might be different; for a GUI interface, you would use an "about box". - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU GPL, see -. - - The GNU General Public License does not permit incorporating your program -into proprietary programs. If your program is a subroutine library, you -may consider it more useful to permit linking proprietary applications with -the library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. But first, please read -. diff --git a/Manifest.toml b/Manifest.toml deleted file mode 100644 index 958e0df8dfc6..000000000000 --- a/Manifest.toml +++ /dev/null @@ -1,866 +0,0 @@ -# This file is machine-generated - editing it directly is not advised - -julia_version = "1.10.4" -manifest_format = "2.0" -project_hash = "7b8b7fa40622a7447c252b8f8df9e2af9252c76a" - -[[deps.ASL_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "6252039f98492252f9e47c312c8ffda0e3b9e78d" -uuid = "ae81ac8f-d209-56e5-92de-9978fef736f9" -version = "0.1.3+0" - -[[deps.AbstractAlgebra]] -deps = ["InteractiveUtils", "LinearAlgebra", "MacroTools", "Preferences", "Random", "RandomExtensions", "SparseArrays", "Test"] -git-tree-sha1 = "841dd303b9c7b06fd0e01fd04664a75bccc543ab" -uuid = "c3fe647b-3220-5bb0-a1ea-a7954cac585d" -version = "0.41.10" - -[[deps.Adapt]] -deps = ["LinearAlgebra", "Requires"] -git-tree-sha1 = "6a55b747d1812e699320963ffde36f1ebdda4099" -uuid = "79e6a3ab-5dfb-504d-930d-738a2a938a0e" -version = "4.0.4" -weakdeps = ["StaticArrays"] - - [deps.Adapt.extensions] - AdaptStaticArraysExt = "StaticArrays" - -[[deps.AlgebraicSolving]] -deps = ["LinearAlgebra", "Logging", "LoopVectorization", "Markdown", "Nemo", "Printf", "Random", "StaticArrays", "Test", "msolve_jll"] -git-tree-sha1 = "6ed4d44c604045dae661c5971bbfa964fbc93b5f" -uuid = "66b61cbe-0446-4d5d-9090-1ff510639f9d" -version = "0.4.16" - -[[deps.ArgTools]] -uuid = "0dad84c5-d112-42e6-8d28-ef12dabb789f" -version = "1.1.1" - -[[deps.ArrayInterface]] -deps = ["Adapt", "LinearAlgebra", "SparseArrays", "SuiteSparse"] -git-tree-sha1 = "5c9b74c973181571deb6442d41e5c902e6b9f38e" -uuid = "4fba245c-0d91-5ea0-9b3e-6abc04ee57a9" -version = "7.12.0" - - [deps.ArrayInterface.extensions] - ArrayInterfaceBandedMatricesExt = "BandedMatrices" - ArrayInterfaceBlockBandedMatricesExt = "BlockBandedMatrices" - ArrayInterfaceCUDAExt = "CUDA" - ArrayInterfaceCUDSSExt = "CUDSS" - ArrayInterfaceChainRulesExt = "ChainRules" - ArrayInterfaceGPUArraysCoreExt = "GPUArraysCore" - ArrayInterfaceReverseDiffExt = "ReverseDiff" - ArrayInterfaceStaticArraysCoreExt = "StaticArraysCore" - ArrayInterfaceTrackerExt = "Tracker" - - [deps.ArrayInterface.weakdeps] - BandedMatrices = "aae01518-5342-5314-be14-df237901396f" - BlockBandedMatrices = "ffab5731-97b5-5995-9138-79e8c1846df0" - CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba" - CUDSS = "45b445bb-4962-46a0-9369-b4df9d0f772e" - ChainRules = "082447d4-558c-5d27-93f4-14fc19e9eca2" - GPUArraysCore = "46192b85-c4d5-4398-a991-12ede77f4527" - ReverseDiff = "37e2e3b7-166d-5795-8a7a-e32c996b4267" - StaticArraysCore = "1e83bf80-4336-4d27-bf5d-d5a4f845583c" - Tracker = "9f7883ad-71c0-57eb-9f7f-b5c9e6d3789c" - -[[deps.Artifacts]] -uuid = "56f22d72-fd6d-98f1-02f0-08ddc0907c33" - -[[deps.Base64]] -uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f" - -[[deps.BenchmarkTools]] -deps = ["JSON", "Logging", "Printf", "Profile", "Statistics", "UUIDs"] -git-tree-sha1 = "f1dff6729bc61f4d49e140da1af55dcd1ac97b2f" -uuid = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf" -version = "1.5.0" - -[[deps.BinaryWrappers]] -deps = ["JLLWrappers", "Scratch"] -git-tree-sha1 = "7fea8f658689fa5062b23f4400eda888b7ae2aaa" -uuid = "f01c122e-0ea1-4f85-ad8f-907073ad7a9f" -version = "0.1.3" - -[[deps.BitTwiddlingConvenienceFunctions]] -deps = ["Static"] -git-tree-sha1 = "f21cfd4950cb9f0587d5067e69405ad2acd27b87" -uuid = "62783981-4cbd-42fc-bca8-16325de8dc4b" -version = "0.1.6" - -[[deps.Bzip2_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "9e2a6b69137e6969bab0152632dcb3bc108c8bdd" -uuid = "6e34b625-4abd-537c-b88f-471c36dfa7a0" -version = "1.0.8+1" - -[[deps.CPUSummary]] -deps = ["CpuId", "IfElse", "PrecompileTools", "Static"] -git-tree-sha1 = "5a97e67919535d6841172016c9530fd69494e5ec" -uuid = "2a0fbf3d-bb9c-48f3-b0a9-814d99fd7ab9" -version = "0.2.6" - -[[deps.CloseOpenIntervals]] -deps = ["Static", "StaticArrayInterface"] -git-tree-sha1 = "05ba0d07cd4fd8b7a39541e31a7b0254704ea581" -uuid = "fb6a15b2-703c-40df-9091-08a04967cfa9" -version = "0.1.13" - -[[deps.CommonWorldInvalidations]] -git-tree-sha1 = "ae52d1c52048455e85a387fbee9be553ec2b68d0" -uuid = "f70d9fcc-98c5-4d4a-abd7-e4cdeebd8ca8" -version = "1.0.0" - -[[deps.Compat]] -deps = ["TOML", "UUIDs"] -git-tree-sha1 = "b1c55339b7c6c350ee89f2c1604299660525b248" -uuid = "34da2185-b29b-5c13-b0c7-acf172513d20" -version = "4.15.0" -weakdeps = ["Dates", "LinearAlgebra"] - - [deps.Compat.extensions] - CompatLinearAlgebraExt = "LinearAlgebra" - -[[deps.CompilerSupportLibraries_jll]] -deps = ["Artifacts", "Libdl"] -uuid = "e66e0078-7015-5450-92f7-15fbd957f2ae" -version = "1.1.1+0" - -[[deps.CpuId]] -deps = ["Markdown"] -git-tree-sha1 = "fcbb72b032692610bfbdb15018ac16a36cf2e406" -uuid = "adafc99b-e345-5852-983c-f28acb93d879" -version = "0.3.1" - -[[deps.CxxWrap]] -deps = ["Libdl", "MacroTools", "libcxxwrap_julia_jll"] -git-tree-sha1 = "3345cb637ca1efb2ebf7f5145558522b92660d1f" -uuid = "1f15a43c-97ca-5a2a-ae31-89f07a497df4" -version = "0.14.2" - -[[deps.Dates]] -deps = ["Printf"] -uuid = "ade2ca70-3891-5945-98fb-dc099432e06a" - -[[deps.DecFP]] -deps = ["DecFP_jll", "Printf", "Random", "SpecialFunctions"] -git-tree-sha1 = "4a10cec664e26d9d63597daf9e62147e79d636e3" -uuid = "55939f99-70c6-5e9b-8bb0-5071ed7d61fd" -version = "1.3.2" - -[[deps.DecFP_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "e9a8da19f847bbfed4076071f6fef8665a30d9e5" -uuid = "47200ebd-12ce-5be5-abb7-8e082af23329" -version = "2.0.3+1" - -[[deps.Distributed]] -deps = ["Random", "Serialization", "Sockets"] -uuid = "8ba89e20-285c-5b6f-9357-94700520ee1b" - -[[deps.DocStringExtensions]] -deps = ["LibGit2"] -git-tree-sha1 = "2fb1e02f2b635d0845df5d7c167fec4dd739b00d" -uuid = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae" -version = "0.9.3" - -[[deps.Downloads]] -deps = ["ArgTools", "FileWatching", "LibCURL", "NetworkOptions"] -uuid = "f43a241f-c20a-4ad4-852c-f6b1247861c6" -version = "1.6.0" - -[[deps.FLINT_jll]] -deps = ["Artifacts", "GMP_jll", "JLLWrappers", "Libdl", "MPFR_jll", "OpenBLAS32_jll"] -git-tree-sha1 = "4bde447e7bc6de73de36870fc942df02f4dd44b5" -uuid = "e134572f-a0d5-539d-bddf-3cad8db41a82" -version = "300.100.300+0" - -[[deps.FileWatching]] -uuid = "7b1f6079-737a-58dc-b8bc-7a2ca5c1b5ee" - -[[deps.GAP]] -deps = ["Artifacts", "Compat", "Downloads", "GAP_jll", "GAP_lib_jll", "GAP_pkg_juliainterface_jll", "InteractiveUtils", "Libdl", "MacroTools", "Markdown", "Ncurses_jll", "Pidfile", "Pkg", "REPL", "Random", "Scratch"] -git-tree-sha1 = "fcaf50e1874719fdec62c3646351e52007ad63aa" -uuid = "c863536a-3901-11e9-33e7-d5cd0df7b904" -version = "0.10.4" - -[[deps.GAP_jll]] -deps = ["Artifacts", "GMP_jll", "JLLWrappers", "Libdl", "Pkg", "Readline_jll", "Zlib_jll"] -git-tree-sha1 = "c3a00b8f8ced0887d52104d0a0df233d9efc79d4" -uuid = "5cd7a574-2c56-5be2-91dc-c8bc375b9ddf" -version = "400.1200.200+9" - -[[deps.GAP_lib_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "473b619163e30d9cc58d4a8f9d412e6ea8910fcf" -uuid = "de1ad85e-c930-5cd4-919d-ccd3fcafd1a3" -version = "400.1201.200+0" - -[[deps.GAP_pkg_juliainterface_jll]] -deps = ["Artifacts", "GAP_jll", "GAP_lib_jll", "JLLWrappers", "Libdl"] -git-tree-sha1 = "c5a0f16f0478ab067752861d3c9339f335832459" -uuid = "ba154793-3a7d-51ee-8800-e295b0cf7374" -version = "0.800.300+3" - -[[deps.GLPK_jll]] -deps = ["Artifacts", "GMP_jll", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "fe68622f32828aa92275895fdb324a85894a5b1b" -uuid = "e8aa6df9-e6ca-548a-97ff-1f85fc5b8b98" -version = "5.0.1+0" - -[[deps.GMP_jll]] -deps = ["Artifacts", "Libdl"] -uuid = "781609d7-10c4-51f6-84f2-b8444358ff6d" -version = "6.2.1+6" - -[[deps.Hecke]] -deps = ["AbstractAlgebra", "Dates", "Distributed", "InteractiveUtils", "LazyArtifacts", "Libdl", "LinearAlgebra", "Markdown", "Nemo", "Pkg", "Printf", "Random", "RandomExtensions", "Serialization", "SparseArrays"] -git-tree-sha1 = "f89af7272ac9585fe73c1f0d810970b025ddc345" -uuid = "3e1990a7-5d81-5526-99ce-9ba3ff248f21" -version = "0.32.3" -weakdeps = ["GAP", "Polymake"] - - [deps.Hecke.extensions] - GAPExt = "GAP" - PolymakeExt = "Polymake" - -[[deps.HostCPUFeatures]] -deps = ["BitTwiddlingConvenienceFunctions", "IfElse", "Libdl", "Static"] -git-tree-sha1 = "8e070b599339d622e9a081d17230d74a5c473293" -uuid = "3e5b6fbb-0976-4d2c-9146-d79de83f2fb0" -version = "0.1.17" - -[[deps.Hwloc_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl"] -git-tree-sha1 = "5e19e1e4fa3e71b774ce746274364aef0234634e" -uuid = "e33a78d0-f292-5ffc-b300-72abe9b543c8" -version = "2.11.1+0" - -[[deps.IfElse]] -git-tree-sha1 = "debdd00ffef04665ccbb3e150747a77560e8fad1" -uuid = "615f187c-cbe4-4ef1-ba3b-2fcf58d6d173" -version = "0.1.1" - -[[deps.InteractiveUtils]] -deps = ["Markdown"] -uuid = "b77e0a4c-d291-57a0-90e8-8db25a27a240" - -[[deps.Ipopt_jll]] -deps = ["ASL_jll", "Artifacts", "CompilerSupportLibraries_jll", "JLLWrappers", "Libdl", "MUMPS_seq_jll", "SPRAL_jll", "libblastrampoline_jll"] -git-tree-sha1 = "546c40fd3718c65d48296dd6cec98af9904e3ca4" -uuid = "9cc047cb-c261-5740-88fc-0cf96f7bdcc7" -version = "300.1400.1400+0" - -[[deps.IrrationalConstants]] -git-tree-sha1 = "630b497eafcc20001bba38a4651b327dcfc491d2" -uuid = "92d709cd-6900-40b7-9082-c6be49f344b6" -version = "0.2.2" - -[[deps.JLLWrappers]] -deps = ["Artifacts", "Preferences"] -git-tree-sha1 = "7e5d6779a1e09a36db2a7b6cff50942a0a7d0fca" -uuid = "692b3bcd-3c85-4b1f-b108-f13ce0eb3210" -version = "1.5.0" - -[[deps.JSON]] -deps = ["Dates", "Mmap", "Parsers", "Unicode"] -git-tree-sha1 = "31e996f0a15c7b280ba9f76636b3ff9e2ae58c9a" -uuid = "682c06a0-de6a-54ab-a142-c8b1cf79cde6" -version = "0.21.4" - -[[deps.JSON3]] -deps = ["Dates", "Mmap", "Parsers", "PrecompileTools", "StructTypes", "UUIDs"] -git-tree-sha1 = "eb3edce0ed4fa32f75a0a11217433c31d56bd48b" -uuid = "0f8b85d8-7281-11e9-16c2-39a750bddbf1" -version = "1.14.0" - - [deps.JSON3.extensions] - JSON3ArrowExt = ["ArrowTypes"] - - [deps.JSON3.weakdeps] - ArrowTypes = "31f734f8-188a-4ce0-8406-c8a06bd891cd" - -[[deps.LLVMOpenMP_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl"] -git-tree-sha1 = "d986ce2d884d49126836ea94ed5bfb0f12679713" -uuid = "1d63c593-3942-5779-bab2-d838dc0a180e" -version = "15.0.7+0" - -[[deps.LZO_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl"] -git-tree-sha1 = "70c5da094887fd2cae843b8db33920bac4b6f07d" -uuid = "dd4b983a-f0e5-5f8d-a1b7-129d4a5fb1ac" -version = "2.10.2+0" - -[[deps.LayoutPointers]] -deps = ["ArrayInterface", "LinearAlgebra", "ManualMemory", "SIMDTypes", "Static", "StaticArrayInterface"] -git-tree-sha1 = "a9eaadb366f5493a5654e843864c13d8b107548c" -uuid = "10f19ff3-798f-405d-979b-55457f8fc047" -version = "0.1.17" - -[[deps.LazyArtifacts]] -deps = ["Artifacts", "Pkg"] -uuid = "4af54fe1-eca0-43a8-85a7-787d91b784e3" - -[[deps.LibCURL]] -deps = ["LibCURL_jll", "MozillaCACerts_jll"] -uuid = "b27032c2-a3e7-50c8-80cd-2d36dbcbfd21" -version = "0.6.4" - -[[deps.LibCURL_jll]] -deps = ["Artifacts", "LibSSH2_jll", "Libdl", "MbedTLS_jll", "Zlib_jll", "nghttp2_jll"] -uuid = "deac9b47-8bc7-5906-a0fe-35ac56dc84c0" -version = "8.4.0+0" - -[[deps.LibGit2]] -deps = ["Base64", "LibGit2_jll", "NetworkOptions", "Printf", "SHA"] -uuid = "76f85450-5226-5b5a-8eaa-529ad045b433" - -[[deps.LibGit2_jll]] -deps = ["Artifacts", "LibSSH2_jll", "Libdl", "MbedTLS_jll"] -uuid = "e37daf67-58a4-590a-8e99-b0245dd2ffc5" -version = "1.6.4+0" - -[[deps.LibSSH2_jll]] -deps = ["Artifacts", "Libdl", "MbedTLS_jll"] -uuid = "29816b5a-b9ab-546f-933c-edad1886dfa8" -version = "1.11.0+1" - -[[deps.Libdl]] -uuid = "8f399da3-3557-5675-b5ff-fb832c97cbdb" - -[[deps.LinearAlgebra]] -deps = ["Libdl", "OpenBLAS_jll", "libblastrampoline_jll"] -uuid = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" - -[[deps.LogExpFunctions]] -deps = ["DocStringExtensions", "IrrationalConstants", "LinearAlgebra"] -git-tree-sha1 = "a2d09619db4e765091ee5c6ffe8872849de0feea" -uuid = "2ab3a3ac-af41-5b50-aa03-7779005ae688" -version = "0.3.28" - - [deps.LogExpFunctions.extensions] - LogExpFunctionsChainRulesCoreExt = "ChainRulesCore" - LogExpFunctionsChangesOfVariablesExt = "ChangesOfVariables" - LogExpFunctionsInverseFunctionsExt = "InverseFunctions" - - [deps.LogExpFunctions.weakdeps] - ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4" - ChangesOfVariables = "9e997f8a-9a97-42d5-a9f1-ce6bfc15e2c0" - InverseFunctions = "3587e190-3f89-42d0-90ee-14403ec27112" - -[[deps.Logging]] -uuid = "56ddb016-857b-54e1-b83d-db4d58db5568" - -[[deps.LoopVectorization]] -deps = ["ArrayInterface", "CPUSummary", "CloseOpenIntervals", "DocStringExtensions", "HostCPUFeatures", "IfElse", "LayoutPointers", "LinearAlgebra", "OffsetArrays", "PolyesterWeave", "PrecompileTools", "SIMDTypes", "SLEEFPirates", "Static", "StaticArrayInterface", "ThreadingUtilities", "UnPack", "VectorizationBase"] -git-tree-sha1 = "8084c25a250e00ae427a379a5b607e7aed96a2dd" -uuid = "bdcacae8-1622-11e9-2a5c-532679323890" -version = "0.12.171" - - [deps.LoopVectorization.extensions] - ForwardDiffExt = ["ChainRulesCore", "ForwardDiff"] - SpecialFunctionsExt = "SpecialFunctions" - - [deps.LoopVectorization.weakdeps] - ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4" - ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210" - SpecialFunctions = "276daf66-3868-5448-9aa4-cd146d93841b" - -[[deps.Lz4_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl"] -git-tree-sha1 = "6c26c5e8a4203d43b5497be3ec5d4e0c3cde240a" -uuid = "5ced341a-0733-55b8-9ab6-a4889d929147" -version = "1.9.4+0" - -[[deps.METIS_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "1fd0a97409e418b78c53fac671cf4622efdf0f21" -uuid = "d00139f3-1899-568f-a2f0-47f597d42d70" -version = "5.1.2+0" - -[[deps.MPFR_jll]] -deps = ["Artifacts", "GMP_jll", "Libdl"] -uuid = "3a97d323-0669-5f0c-9066-3539efd106a3" -version = "4.2.0+1" - -[[deps.MUMPS_seq_jll]] -deps = ["Artifacts", "CompilerSupportLibraries_jll", "JLLWrappers", "Libdl", "METIS_jll", "libblastrampoline_jll"] -git-tree-sha1 = "840b83c65b27e308095c139a457373850b2f5977" -uuid = "d7ed1dd3-d0ae-5e8e-bfb4-87a502085b8d" -version = "500.600.201+0" - -[[deps.MacroTools]] -deps = ["Markdown", "Random"] -git-tree-sha1 = "2fa9ee3e63fd3a4f7a9a4f4744a52f4856de82df" -uuid = "1914dd2f-81c6-5fcd-8719-6d5c9610ff09" -version = "0.5.13" - -[[deps.ManualMemory]] -git-tree-sha1 = "bcaef4fc7a0cfe2cba636d84cda54b5e4e4ca3cd" -uuid = "d125e4d3-2237-4719-b19c-fa641b8a4667" -version = "0.1.8" - -[[deps.Markdown]] -deps = ["Base64"] -uuid = "d6f4376e-aef5-505a-96c1-9c027394607a" - -[[deps.MbedTLS_jll]] -deps = ["Artifacts", "Libdl"] -uuid = "c8ffd9c3-330d-5841-b78e-0817d7145fa1" -version = "2.28.2+1" - -[[deps.Mmap]] -uuid = "a63ad114-7e13-5084-954f-fe012c677804" - -[[deps.MongoC_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "OpenSSL_jll", "Zlib_jll", "Zstd_jll", "snappy_jll"] -git-tree-sha1 = "5a0f9f14a8186eae48608ff7922ac0c00ff52cdc" -uuid = "90100e71-7732-535a-9be7-2e9affd1cfc1" -version = "1.25.1+0" - -[[deps.Mongoc]] -deps = ["Dates", "DecFP", "MongoC_jll", "Serialization"] -git-tree-sha1 = "f47bf7ed9d9c1da0a632777ca7dc406e3ad5f923" -uuid = "4fe8b98c-fc19-5c23-8ec2-168ff83495f2" -version = "0.9.0" - -[[deps.MozillaCACerts_jll]] -uuid = "14a3606d-f60d-562e-9121-12d972cd8159" -version = "2023.1.10" - -[[deps.Ncurses_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl"] -git-tree-sha1 = "3ac1ca10bae513c9cc8f83d7734b921b8007b574" -uuid = "68e3532b-a499-55ff-9963-d1c0c0748b3a" -version = "6.5.0+0" - -[[deps.Nemo]] -deps = ["AbstractAlgebra", "FLINT_jll", "Libdl", "LinearAlgebra", "Pkg", "Random", "RandomExtensions", "SHA"] -git-tree-sha1 = "bae0f1452c648d84535b581103ab8a59cf10a32a" -uuid = "2edaba10-b0f1-5616-af89-8c11ac63239a" -version = "0.45.7" - -[[deps.NetworkOptions]] -uuid = "ca575930-c2e3-43a9-ace4-1e988b2c1908" -version = "1.2.0" - -[[deps.Ninja_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl"] -git-tree-sha1 = "d9c6d1dca818768f1671244dcdf8e8e08b2b8937" -uuid = "76642167-d241-5cee-8c94-7a494e8cb7b7" -version = "1.12.1+0" - -[[deps.OffsetArrays]] -git-tree-sha1 = "1a27764e945a152f7ca7efa04de513d473e9542e" -uuid = "6fe1bfb0-de20-5000-8ca7-80f57d26f881" -version = "1.14.1" -weakdeps = ["Adapt"] - - [deps.OffsetArrays.extensions] - OffsetArraysAdaptExt = "Adapt" - -[[deps.OpenBLAS32_jll]] -deps = ["Artifacts", "CompilerSupportLibraries_jll", "JLLWrappers", "Libdl"] -git-tree-sha1 = "6065c4cff8fee6c6770b277af45d5082baacdba1" -uuid = "656ef2d0-ae68-5445-9ca0-591084a874a2" -version = "0.3.24+0" - -[[deps.OpenBLAS_jll]] -deps = ["Artifacts", "CompilerSupportLibraries_jll", "Libdl"] -uuid = "4536629a-c528-5b80-bd46-f80d51c5b363" -version = "0.3.23+4" - -[[deps.OpenLibm_jll]] -deps = ["Artifacts", "Libdl"] -uuid = "05823500-19ac-5b8b-9628-191a04bc5112" -version = "0.8.1+2" - -[[deps.OpenSSL_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl"] -git-tree-sha1 = "a12e56c72edee3ce6b96667745e6cbbe5498f200" -uuid = "458c3c95-2e84-50aa-8efc-19380b2a3a95" -version = "1.1.23+0" - -[[deps.OpenSpecFun_jll]] -deps = ["Artifacts", "CompilerSupportLibraries_jll", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "13652491f6856acfd2db29360e1bbcd4565d04f1" -uuid = "efe28fd5-8261-553b-a9e1-b2916fc3738e" -version = "0.5.5+0" - -[[deps.Oscar]] -deps = ["AbstractAlgebra", "AlgebraicSolving", "Distributed", "GAP", "Hecke", "JSON", "JSON3", "LazyArtifacts", "Markdown", "Nemo", "Pkg", "Polymake", "Random", "RandomExtensions", "Serialization", "Singular", "TOPCOM_jll", "UUIDs", "cohomCalg_jll"] -git-tree-sha1 = "6d86eb479c0afaebad9c00e862d91f3ae1de3c4f" -uuid = "f1435218-dba5-11e9-1e4d-f1a5fab5fc13" -version = "1.1.1" - -[[deps.PPL_jll]] -deps = ["Artifacts", "GMP_jll", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "dc69ba2b374b5bd6e876fa3a8441563c0eeafb9e" -uuid = "80dd9cbb-8b87-5171-a280-372cc418f402" -version = "1.2.1+0" - -[[deps.Parsers]] -deps = ["Dates", "PrecompileTools", "UUIDs"] -git-tree-sha1 = "8489905bcdbcfac64d1daa51ca07c0d8f0283821" -uuid = "69de0a69-1ddd-5017-9359-2bf0b02dc9f0" -version = "2.8.1" - -[[deps.Perl_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Readline_jll"] -git-tree-sha1 = "7ab65a258bcf6da373cab49af462aead452d3960" -uuid = "83958c19-0796-5285-893e-a1267f8ec499" -version = "5.34.1+0" - -[[deps.Pidfile]] -deps = ["FileWatching", "Test"] -git-tree-sha1 = "2d8aaf8ee10df53d0dfb9b8ee44ae7c04ced2b03" -uuid = "fa939f87-e72e-5be4-a000-7fc836dbe307" -version = "1.3.0" - -[[deps.Pkg]] -deps = ["Artifacts", "Dates", "Downloads", "FileWatching", "LibGit2", "Libdl", "Logging", "Markdown", "Printf", "REPL", "Random", "SHA", "Serialization", "TOML", "Tar", "UUIDs", "p7zip_jll"] -uuid = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" -version = "1.10.0" - -[[deps.PolyesterWeave]] -deps = ["BitTwiddlingConvenienceFunctions", "CPUSummary", "IfElse", "Static", "ThreadingUtilities"] -git-tree-sha1 = "645bed98cd47f72f67316fd42fc47dee771aefcd" -uuid = "1d0040c9-8b98-4ee7-8388-3f51789ca0ad" -version = "0.2.2" - -[[deps.Polymake]] -deps = ["AbstractAlgebra", "BinaryWrappers", "CxxWrap", "Downloads", "JSON", "Libdl", "Mongoc", "NetworkOptions", "Ninja_jll", "Perl_jll", "Pidfile", "Pkg", "REPL", "Scratch", "SparseArrays", "TOPCOM_jll", "lib4ti2_jll", "libpolymake_julia_jll", "polymake_jll", "polymake_oscarnumber_jll"] -git-tree-sha1 = "4ae104b2d9eb68fdd1b013411b3eccd234d28406" -uuid = "d720cf60-89b5-51f5-aff5-213f193123e7" -version = "0.11.19" - -[[deps.PrecompileTools]] -deps = ["Preferences"] -git-tree-sha1 = "5aa36f7049a63a1528fe8f7c3f2113413ffd4e1f" -uuid = "aea7be01-6a6a-4083-8856-8a6e6704d82a" -version = "1.2.1" - -[[deps.Preferences]] -deps = ["TOML"] -git-tree-sha1 = "9306f6085165d270f7e3db02af26a400d580f5c6" -uuid = "21216c6a-2e73-6563-6e65-726566657250" -version = "1.4.3" - -[[deps.Printf]] -deps = ["Unicode"] -uuid = "de0858da-6303-5e67-8744-51eddeeeb8d7" - -[[deps.Profile]] -deps = ["Printf"] -uuid = "9abbd945-dff8-562f-b5e8-e1ebf5ef1b79" - -[[deps.REPL]] -deps = ["InteractiveUtils", "Markdown", "Sockets", "Unicode"] -uuid = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb" - -[[deps.Random]] -deps = ["SHA"] -uuid = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" - -[[deps.RandomExtensions]] -deps = ["Random", "SparseArrays"] -git-tree-sha1 = "b8a399e95663485820000f26b6a43c794e166a49" -uuid = "fb686558-2515-59ef-acaa-46db3789a887" -version = "0.4.4" - -[[deps.Readline_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Ncurses_jll"] -git-tree-sha1 = "9d70e0c890a6c7ca3eb1ca0eaabba4d34795b7fb" -uuid = "05236dd9-4125-5232-aa7c-9ec0c9b2c25a" -version = "8.2.1+0" - -[[deps.Requires]] -deps = ["UUIDs"] -git-tree-sha1 = "838a3a4188e2ded87a4f9f184b4b0d78a1e91cb7" -uuid = "ae029012-a4dd-5104-9daa-d747884805df" -version = "1.3.0" - -[[deps.SCIP_jll]] -deps = ["Artifacts", "Bzip2_jll", "CompilerSupportLibraries_jll", "GMP_jll", "Ipopt_jll", "JLLWrappers", "Libdl", "Pkg", "Readline_jll", "Zlib_jll", "bliss_jll", "boost_jll"] -git-tree-sha1 = "cf69186eb29307fbb2319b90e6133797bad983ce" -uuid = "e5ac4fe4-a920-5659-9bf8-f9f73e9e79ce" -version = "800.0.301+0" - -[[deps.SHA]] -uuid = "ea8e919c-243c-51af-8825-aaa63cd721ce" -version = "0.7.0" - -[[deps.SIMDTypes]] -git-tree-sha1 = "330289636fb8107c5f32088d2741e9fd7a061a5c" -uuid = "94e857df-77ce-4151-89e5-788b33177be4" -version = "0.1.0" - -[[deps.SLEEFPirates]] -deps = ["IfElse", "Static", "VectorizationBase"] -git-tree-sha1 = "456f610ca2fbd1c14f5fcf31c6bfadc55e7d66e0" -uuid = "476501e8-09a2-5ece-8869-fb82de89a1fa" -version = "0.6.43" - -[[deps.SPRAL_jll]] -deps = ["Artifacts", "CompilerSupportLibraries_jll", "Hwloc_jll", "JLLWrappers", "Libdl", "METIS_jll", "libblastrampoline_jll"] -git-tree-sha1 = "34b9dacd687cace8aa4d550e3e9bb8615f1a61e9" -uuid = "319450e9-13b8-58e8-aa9f-8fd1420848ab" -version = "2024.1.18+0" - -[[deps.Scratch]] -deps = ["Dates"] -git-tree-sha1 = "3bac05bc7e74a75fd9cba4295cde4045d9fe2386" -uuid = "6c6a2e73-6563-6170-7368-637461726353" -version = "1.2.1" - -[[deps.Serialization]] -uuid = "9e88b42a-f829-5b0c-bbe9-9e923198166b" - -[[deps.Singular]] -deps = ["AbstractAlgebra", "BinaryWrappers", "CxxWrap", "Libdl", "LinearAlgebra", "Nemo", "Pidfile", "Pkg", "Random", "RandomExtensions", "Singular_jll", "Statistics", "lib4ti2_jll", "libsingular_julia_jll"] -git-tree-sha1 = "a55baf3aac647d50799ecd963e9026c472f003c0" -uuid = "bcd08a7b-43d2-5ff7-b6d4-c458787f915c" -version = "0.23.4" - -[[deps.Singular_jll]] -deps = ["Artifacts", "FLINT_jll", "GMP_jll", "JLLWrappers", "Libdl", "MPFR_jll", "cddlib_jll"] -git-tree-sha1 = "398b1d72ad1c12e8a8b8ce54a11d0bb9fa6bfb89" -uuid = "43d676ae-4934-50ba-8046-7a96366d613b" -version = "404.0.301+0" - -[[deps.Sockets]] -uuid = "6462fe0b-24de-5631-8697-dd941f90decc" - -[[deps.SparseArrays]] -deps = ["Libdl", "LinearAlgebra", "Random", "Serialization", "SuiteSparse_jll"] -uuid = "2f01184e-e22b-5df5-ae63-d93ebab69eaf" -version = "1.10.0" - -[[deps.SpecialFunctions]] -deps = ["IrrationalConstants", "LogExpFunctions", "OpenLibm_jll", "OpenSpecFun_jll"] -git-tree-sha1 = "2f5d4697f21388cbe1ff299430dd169ef97d7e14" -uuid = "276daf66-3868-5448-9aa4-cd146d93841b" -version = "2.4.0" - - [deps.SpecialFunctions.extensions] - SpecialFunctionsChainRulesCoreExt = "ChainRulesCore" - - [deps.SpecialFunctions.weakdeps] - ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4" - -[[deps.Static]] -deps = ["CommonWorldInvalidations", "IfElse", "PrecompileTools"] -git-tree-sha1 = "87d51a3ee9a4b0d2fe054bdd3fc2436258db2603" -uuid = "aedffcd0-7271-4cad-89d0-dc628f76c6d3" -version = "1.1.1" - -[[deps.StaticArrayInterface]] -deps = ["ArrayInterface", "Compat", "IfElse", "LinearAlgebra", "PrecompileTools", "Requires", "SparseArrays", "Static", "SuiteSparse"] -git-tree-sha1 = "8963e5a083c837531298fc41599182a759a87a6d" -uuid = "0d7ed370-da01-4f52-bd93-41d350b8b718" -version = "1.5.1" -weakdeps = ["OffsetArrays", "StaticArrays"] - - [deps.StaticArrayInterface.extensions] - StaticArrayInterfaceOffsetArraysExt = "OffsetArrays" - StaticArrayInterfaceStaticArraysExt = "StaticArrays" - -[[deps.StaticArrays]] -deps = ["LinearAlgebra", "PrecompileTools", "Random", "StaticArraysCore"] -git-tree-sha1 = "eeafab08ae20c62c44c8399ccb9354a04b80db50" -uuid = "90137ffa-7385-5640-81b9-e52037218182" -version = "1.9.7" - - [deps.StaticArrays.extensions] - StaticArraysChainRulesCoreExt = "ChainRulesCore" - StaticArraysStatisticsExt = "Statistics" - - [deps.StaticArrays.weakdeps] - ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4" - Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2" - -[[deps.StaticArraysCore]] -git-tree-sha1 = "192954ef1208c7019899fbf8049e717f92959682" -uuid = "1e83bf80-4336-4d27-bf5d-d5a4f845583c" -version = "1.4.3" - -[[deps.Statistics]] -deps = ["LinearAlgebra", "SparseArrays"] -uuid = "10745b16-79ce-11e8-11f9-7d13ad32a3b2" -version = "1.10.0" - -[[deps.StructTypes]] -deps = ["Dates", "UUIDs"] -git-tree-sha1 = "ca4bccb03acf9faaf4137a9abc1881ed1841aa70" -uuid = "856f2bd8-1eba-4b0a-8007-ebc267875bd4" -version = "1.10.0" - -[[deps.SuiteSparse]] -deps = ["Libdl", "LinearAlgebra", "Serialization", "SparseArrays"] -uuid = "4607b0f0-06f3-5cda-b6b1-a6196a1729e9" - -[[deps.SuiteSparse_jll]] -deps = ["Artifacts", "Libdl", "libblastrampoline_jll"] -uuid = "bea87d4a-7f5b-5778-9afe-8cc45184846c" -version = "7.2.1+1" - -[[deps.TOML]] -deps = ["Dates"] -uuid = "fa267f1f-6049-4f14-aa54-33bafae1ed76" -version = "1.0.3" - -[[deps.TOPCOM_jll]] -deps = ["Artifacts", "GMP_jll", "JLLWrappers", "Libdl", "Pkg", "cddlib_jll"] -git-tree-sha1 = "adbe178144e762ae7057fcb8e26564de7ee2e36c" -uuid = "36f60fef-b880-50dc-9289-4aaecee93cc3" -version = "0.17.8+0" - -[[deps.Tar]] -deps = ["ArgTools", "SHA"] -uuid = "a4e569a6-e804-4fa4-b0f3-eef7a1d5b13e" -version = "1.10.0" - -[[deps.Test]] -deps = ["InteractiveUtils", "Logging", "Random", "Serialization"] -uuid = "8dfed614-e22c-5e08-85e1-65c5234f0b40" - -[[deps.ThreadingUtilities]] -deps = ["ManualMemory"] -git-tree-sha1 = "eda08f7e9818eb53661b3deb74e3159460dfbc27" -uuid = "8290d209-cae3-49c0-8002-c8c24d57dab5" -version = "0.5.2" - -[[deps.UUIDs]] -deps = ["Random", "SHA"] -uuid = "cf7118a7-6976-5b1a-9a39-7adc72f591a4" - -[[deps.UnPack]] -git-tree-sha1 = "387c1f73762231e86e0c9c5443ce3b4a0a9a0c2b" -uuid = "3a884ed6-31ef-47d7-9d2a-63182c4928ed" -version = "1.0.2" - -[[deps.Unicode]] -uuid = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5" - -[[deps.VectorizationBase]] -deps = ["ArrayInterface", "CPUSummary", "HostCPUFeatures", "IfElse", "LayoutPointers", "Libdl", "LinearAlgebra", "SIMDTypes", "Static", "StaticArrayInterface"] -git-tree-sha1 = "e7f5b81c65eb858bed630fe006837b935518aca5" -uuid = "3d5dd08c-fd9d-11e8-17fa-ed2836048c2f" -version = "0.21.70" - -[[deps.Zlib_jll]] -deps = ["Libdl"] -uuid = "83775a58-1f1d-513f-b197-d71354ab007a" -version = "1.2.13+1" - -[[deps.Zstd_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl"] -git-tree-sha1 = "e678132f07ddb5bfa46857f0d7620fb9be675d3b" -uuid = "3161d3a3-bdf6-5164-811a-617609db77b4" -version = "1.5.6+0" - -[[deps.bliss_jll]] -deps = ["Artifacts", "GMP_jll", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "f8b75e896a326a162a4f6e998990521d8302c810" -uuid = "508c9074-7a14-5c94-9582-3d4bc1871065" -version = "0.77.0+1" - -[[deps.boost_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Zlib_jll"] -git-tree-sha1 = "7a89efe0137720ca82f99e8daa526d23120d0d37" -uuid = "28df3c45-c428-5900-9ff8-a3135698ca75" -version = "1.76.0+1" - -[[deps.cddlib_jll]] -deps = ["Artifacts", "GMP_jll", "JLLWrappers", "Libdl"] -git-tree-sha1 = "08f5df03703af917b9bfec47b9767eb943220d08" -uuid = "f07e07eb-5685-515a-97c8-3014f6152feb" -version = "0.94.14+0" - -[[deps.cohomCalg_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "999c34925053825bfa29f54b3c00b80668b681ec" -uuid = "5558cf25-a90e-53b0-b813-cadaa3ae7ade" -version = "0.32.0+0" - -[[deps.lib4ti2_jll]] -deps = ["Artifacts", "GLPK_jll", "GMP_jll", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "79116185def638e73ea3d88ca6c10e210a1dc183" -uuid = "1493ae25-0f90-5c0e-a06c-8c5077d6d66f" -version = "1.6.10+0" - -[[deps.libblastrampoline_jll]] -deps = ["Artifacts", "Libdl"] -uuid = "8e850b90-86db-534c-a0d3-1478176c7d93" -version = "5.8.0+1" - -[[deps.libcxxwrap_julia_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl"] -git-tree-sha1 = "02d0a0a623248c709727088aaf722ab14f1463a5" -uuid = "3eaa8342-bff7-56a5-9981-c04077f7cee7" -version = "0.11.2+1" - -[[deps.libpolymake_julia_jll]] -deps = ["Artifacts", "CompilerSupportLibraries_jll", "FLINT_jll", "JLLWrappers", "Libdl", "TOPCOM_jll", "lib4ti2_jll", "libcxxwrap_julia_jll", "polymake_jll"] -git-tree-sha1 = "87edbe6bc0171e6918b25dced309db6cba43cc97" -uuid = "4d8266f6-2b3b-57e3-ad7a-d431eaaac945" -version = "0.12.0+0" - -[[deps.libsingular_julia_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Singular_jll", "libcxxwrap_julia_jll"] -git-tree-sha1 = "efd81d3e0a881293b7123357d1db4b0d5cd159cb" -uuid = "ae4fbd8f-ecdb-54f8-bbce-35570499b30e" -version = "0.45.2+0" - -[[deps.lrslib_jll]] -deps = ["Artifacts", "GMP_jll", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "9169c4d5823195a7a2173fc6b479468478857438" -uuid = "3873f7d0-7b7c-52c3-bdf4-8ab39b8f337a" -version = "0.3.3+0" - -[[deps.msolve_jll]] -deps = ["Artifacts", "CompilerSupportLibraries_jll", "FLINT_jll", "GMP_jll", "JLLWrappers", "LLVMOpenMP_jll", "Libdl", "MPFR_jll"] -git-tree-sha1 = "d6b643f97075ff6d7342fca2bcf8acca7b6282e7" -uuid = "6d01cc9a-e8f6-580e-8c54-544227e08205" -version = "0.600.700+0" - -[[deps.nauty_jll]] -deps = ["Artifacts", "GMP_jll", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "fc7dc197df0648cd5f965801bfe086abd9325add" -uuid = "55c6dc9b-343a-50ca-8ff2-b71adb3733d5" -version = "2.6.13+1" - -[[deps.nghttp2_jll]] -deps = ["Artifacts", "Libdl"] -uuid = "8e850ede-7688-5339-a07c-302acd2aaf8d" -version = "1.52.0+1" - -[[deps.normaliz_jll]] -deps = ["Artifacts", "CompilerSupportLibraries_jll", "FLINT_jll", "GMP_jll", "JLLWrappers", "LLVMOpenMP_jll", "Libdl", "MPFR_jll", "nauty_jll"] -git-tree-sha1 = "b84641c3add3c9e435546b1f2867105ce209791f" -uuid = "6690c6e9-4e12-53b8-b8fd-4bffaef8839f" -version = "300.1000.200+0" - -[[deps.p7zip_jll]] -deps = ["Artifacts", "Libdl"] -uuid = "3f19e933-33d8-53b3-aaab-bd5110c3b7a0" -version = "17.4.0+2" - -[[deps.polymake_jll]] -deps = ["Artifacts", "CompilerSupportLibraries_jll", "FLINT_jll", "GMP_jll", "JLLWrappers", "LLVMOpenMP_jll", "Libdl", "MPFR_jll", "MongoC_jll", "PPL_jll", "Perl_jll", "SCIP_jll", "bliss_jll", "boost_jll", "cddlib_jll", "lrslib_jll", "normaliz_jll"] -git-tree-sha1 = "bd0b5a3dd1f0d1309d6314b207d5e2bc51d42c29" -uuid = "7c209550-9012-526c-9264-55ba7a78ba2c" -version = "400.1200.1+0" - -[[deps.polymake_oscarnumber_jll]] -deps = ["Artifacts", "CompilerSupportLibraries_jll", "JLLWrappers", "LLVMOpenMP_jll", "Libdl", "libcxxwrap_julia_jll", "libpolymake_julia_jll", "polymake_jll"] -git-tree-sha1 = "ccba21af52e431ffa889965693daf98a8699dbbb" -uuid = "10f31823-b687-53e6-9f29-edb9d4da9f9f" -version = "0.3.0+0" - -[[deps.snappy_jll]] -deps = ["Artifacts", "JLLWrappers", "LZO_jll", "Libdl", "Lz4_jll", "Zlib_jll"] -git-tree-sha1 = "8bc7ddafc0a7339b82a06c1dde849cd5039324d6" -uuid = "fe1e1685-f7be-5f59-ac9f-4ca204017dfd" -version = "1.2.0+0" diff --git a/Project.toml b/Project.toml deleted file mode 100644 index dd2e90bee89f..000000000000 --- a/Project.toml +++ /dev/null @@ -1,8 +0,0 @@ -name = "GroebnerWalk" -uuid = "6dc8777d-2b0c-4de5-9e3c-426c1820f6f9" -authors = ["Kamillo Ferry ", "Francesco Nowell "] -version = "1.0.1" - -[deps] -BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf" -Oscar = "f1435218-dba5-11e9-1e4d-f1a5fab5fc13" From c8e6625c3ec7b4ae617caaade5550dc97f9ba7ad Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Tue, 23 Jul 2024 15:57:56 +0200 Subject: [PATCH 118/179] Move weight_ordering --- experimental/GroebnerWalk/src/common.jl | 9 --------- 1 file changed, 9 deletions(-) diff --git a/experimental/GroebnerWalk/src/common.jl b/experimental/GroebnerWalk/src/common.jl index 22513be07a12..5024f7b3ff7e 100644 --- a/experimental/GroebnerWalk/src/common.jl +++ b/experimental/GroebnerWalk/src/common.jl @@ -100,15 +100,6 @@ function groebner_walk( return Oscar.IdealGens(Gb, target; isGB=true) end -#TODO docstring -function weight_ordering(w::Vector{ZZRingElem}, o::MonomialOrdering) - # Instead of using OSCAR's weight_ordering which requires w to be "Vector{Int64}" - # we use the following construction which also accepts ZZRingElem. - i = _support_indices(o.o) - m = ZZMatrix(1, length(w), w) - return MonomialOrdering(base_ring(o), MatrixOrdering(i, m, false))*o -end - @doc raw""" same_cone(G::Oscar.IdealGens, T::MonomialOrdering) From 0de61a3585b267d918c3a065a0eec52607fbc3c5 Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Tue, 23 Jul 2024 15:57:56 +0200 Subject: [PATCH 119/179] Move weight_ordering --- src/common.jl | 9 --------- 1 file changed, 9 deletions(-) diff --git a/src/common.jl b/src/common.jl index 22513be07a12..5024f7b3ff7e 100644 --- a/src/common.jl +++ b/src/common.jl @@ -100,15 +100,6 @@ function groebner_walk( return Oscar.IdealGens(Gb, target; isGB=true) end -#TODO docstring -function weight_ordering(w::Vector{ZZRingElem}, o::MonomialOrdering) - # Instead of using OSCAR's weight_ordering which requires w to be "Vector{Int64}" - # we use the following construction which also accepts ZZRingElem. - i = _support_indices(o.o) - m = ZZMatrix(1, length(w), w) - return MonomialOrdering(base_ring(o), MatrixOrdering(i, m, false))*o -end - @doc raw""" same_cone(G::Oscar.IdealGens, T::MonomialOrdering) From b13af3f731f948bfd8e065fa90bd70e8a6a397d7 Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Tue, 23 Jul 2024 15:50:10 +0200 Subject: [PATCH 120/179] Change parameter type for weight_ordering to `<:IntegerUnion` --- src/Rings/orderings.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Rings/orderings.jl b/src/Rings/orderings.jl index 245dea1061cc..42fecc6e41ad 100644 --- a/src/Rings/orderings.jl +++ b/src/Rings/orderings.jl @@ -1232,7 +1232,7 @@ function matrix_ordering(v::AbstractVector{<:MPolyRingElem}, M::Union{Matrix{T}, end @doc raw""" - weight_ordering(W::Vector{Int}, ord::MonomialOrdering) -> MonomialOrdering + weight_ordering(W::Vector{<:IntegerUnion}, ord::MonomialOrdering) -> MonomialOrdering Given an integer vector `W` and a monomial ordering `ord` on a set of monomials in `length(W)` variables, return the monomial ordering `ord_W` on this set of monomials @@ -1280,7 +1280,7 @@ julia> canonical_matrix(o2) [0 0 1] ``` """ -function weight_ordering(w::Vector{Int}, o::MonomialOrdering) +function weight_ordering(w::Vector{<:IntegerUnion}, o::MonomialOrdering) i = _support_indices(o.o) m = ZZMatrix(1, length(w), w) return MonomialOrdering(base_ring(o), MatrixOrdering(i, m, false))*o From 91e1ce18494a5ba92a326c1493724758d49ecfef Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Mon, 29 Jul 2024 23:47:19 +0200 Subject: [PATCH 121/179] Update common.jl MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Lars Göttgens --- src/common.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common.jl b/src/common.jl index 5024f7b3ff7e..9bd1b6601b28 100644 --- a/src/common.jl +++ b/src/common.jl @@ -81,7 +81,7 @@ function groebner_walk( I::MPolyIdeal, target::MonomialOrdering = lex(base_ring(I)), start::MonomialOrdering = default_ordering(base_ring(I)); - perturbation_degree = length(gens(base_ring(I))), # meaning, n=#gens(R) + perturbation_degree = ngens(base_ring(I)), # meaning, n=#gens(R) algorithm::Symbol = :standard ) if algorithm == :standard From f4e192f7351d2b07badd281e29cef0eb277baac9 Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Mon, 29 Jul 2024 23:47:19 +0200 Subject: [PATCH 122/179] Update common.jl MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Lars Göttgens --- experimental/GroebnerWalk/src/common.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/experimental/GroebnerWalk/src/common.jl b/experimental/GroebnerWalk/src/common.jl index 5024f7b3ff7e..9bd1b6601b28 100644 --- a/experimental/GroebnerWalk/src/common.jl +++ b/experimental/GroebnerWalk/src/common.jl @@ -81,7 +81,7 @@ function groebner_walk( I::MPolyIdeal, target::MonomialOrdering = lex(base_ring(I)), start::MonomialOrdering = default_ordering(base_ring(I)); - perturbation_degree = length(gens(base_ring(I))), # meaning, n=#gens(R) + perturbation_degree = ngens(base_ring(I)), # meaning, n=#gens(R) algorithm::Symbol = :standard ) if algorithm == :standard From 0add3aa499dd69cf1703df586862c5155950bdf0 Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Tue, 30 Jul 2024 14:24:41 +0200 Subject: [PATCH 123/179] Preliminary version of documentation --- docs/doc.main | 13 +++++-------- docs/src/introduction.md | 20 ++++++++++++++++++++ src/common.jl | 15 +++++---------- 3 files changed, 30 insertions(+), 18 deletions(-) create mode 100644 docs/src/introduction.md diff --git a/docs/doc.main b/docs/doc.main index c42ec6a31cee..c2415b45ca28 100644 --- a/docs/doc.main +++ b/docs/doc.main @@ -1,8 +1,5 @@ -# An example documentation - -This is a sample text to outline the structure of the packages in the `Experimental` folder. -You can show docstrings like this: -```@docs - my_access_func(S::ExampleStruct) -``` - +[ + "Gröbner walk" => [ + "introduction.md", + ] +] diff --git a/docs/src/introduction.md b/docs/src/introduction.md new file mode 100644 index 000000000000..eb63dc9db625 --- /dev/null +++ b/docs/src/introduction.md @@ -0,0 +1,20 @@ +```@meta +CurrentModule = Oscar +``` + +# Gröbner walk + +This is a sample text to outline the structure of the packages in the `Experimental` folder. +You can show docstrings like this: + +The general idea of the Gröbner walk was proposed by [AGK97](@cite). +```@docs + groebner_walk( + I::MPolyIdeal, + target::MonomialOrdering = lex(base_ring(I)), + start::MonomialOrdering = default_ordering(base_ring(I)); + perturbation_degree = ngens(base_ring(I)), + algorithm::Symbol = :standard + ) +``` + diff --git a/src/common.jl b/src/common.jl index 9bd1b6601b28..59bf748cd9e4 100644 --- a/src/common.jl +++ b/src/common.jl @@ -4,26 +4,21 @@ I::MPolyIdeal, target::MonomialOrdering = lex(base_ring(I)), start::MonomialOrdering = default_ordering(base_ring(I)); - perturbation_degree = length(gens(base_ring(I))), + perturbation_degree = ngens(base_ring(I)), algorithm::Symbol = :standard ) Compute a reduced Groebner basis w.r.t. to a monomial ordering by converting it using the Groebner Walk. -The Groebner Walk is proposed by Collart, Kalkbrener & Mall (1997). -One can choose a strategy of: -- Standard Walk (:standard) computes the Walk like as presented in Cox, Little & O'Shea (2005). -- Generic Walk (:generic) computes the Walk as presented in Fukuda, Jensen, Lauritzen & Thomas (2005). -- Perturbed Walk (:perturbed, with p = degree of the perturbation) computes the Walk as presented in Amrhein, Gloor & Küchlin (1997). # Arguments - `I::MPolyIdeal`: ideal one wants to compute a Groebner basis for. - `target::MonomialOrdering=:lex`: monomial ordering one wants to compute a Groebner basis for. - `start::MonomialOrdering=:degrevlex`: monomial ordering to begin the conversion. - `perturbationDegree::Int=2`: the perturbation degree for the perturbed Walk. -- `algorithm::Symbol=standard`: strategy of the Groebner Walk. One can choose between: - - `standard`: Standard Walk, - - `generic`: Generic Walk, - - `perturbed`: Perturbed Walk, +- `algorithm::Symbol=:standard`: strategy of the Groebner Walk. One can choose between: + - `standard`: Standard Walk [CLO05](@cite), + - `generic`: Generic Walk [FJLT07](@cite), + - `perturbed`: Perturbed Walk [AGK96](@cite). # Examples From 32c61e0cd461ddc15756e2e10094a49e1ddde92d Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Tue, 30 Jul 2024 14:24:41 +0200 Subject: [PATCH 124/179] Preliminary version of documentation --- docs/oscar_references.bib | 51 +++++++++++++++++++ experimental/GroebnerWalk/docs/doc.main | 13 ++--- .../GroebnerWalk/docs/src/introduction.md | 20 ++++++++ experimental/GroebnerWalk/src/common.jl | 15 ++---- 4 files changed, 81 insertions(+), 18 deletions(-) create mode 100644 experimental/GroebnerWalk/docs/src/introduction.md diff --git a/docs/oscar_references.bib b/docs/oscar_references.bib index e7963429c25b..53b224e10f2b 100644 --- a/docs/oscar_references.bib +++ b/docs/oscar_references.bib @@ -37,6 +37,33 @@ @Article{AG10 eprint = {0810.1148} } + +@InProceedings{AGK96, + title = {Walking faster}, + pages = {150--161}, + booktitle = {Design and Implementation of Symbolic Computation Systems}, + series = {DISCO 1996}, + address = {Heidelberg, Germany}, + publisher = {Springer Berlin, Heidelberg}, + author = {Amrhein, Beatrice and Gloor, Oliver and Küchlin, Wolfgang}, + year = {1996}, + doi = {10.1007/3-540-61697-7_14}, + location = {Karlsruhe, Germany} +} + + +@Article{AGK97, + title = {On the walk}, + volume = {187}, + doi = {10.1016/s0304-3975(97)00064-9}, + pages = {179--202}, + number = {1}, + journal = {Theoretical Computer Science}, + author = {Amrhein, Beatrice and Gloor, Oliver and Küchlin, Wolfgang}, + year = {1997}, +} + + @Article{AHK18, author = {Adiprasito, Karim and Huh, June and Katz, Eric}, title = {Hodge theory for combinatorial geometries}, @@ -548,6 +575,18 @@ @InCollection{Chr91 doi = {10.1007/BFb0086376} } + +@book{CLO05, + author = {Cox, David A. and Little, John and O'Shea, Donal}, + title = {Using Algebraic Geometry}, + series = {Graduate Texts in Mathematics}, + volume = {185}, + publisher = {Springer-Verlag}, + year = {2005}, + doi = {10.1007/b138611}, +} + + @Book{Coh00, author = {Cohen, Henri}, title = {Advanced topics in computational number theory}, @@ -910,6 +949,18 @@ @Article{FGLM93 doi = {10.1006/jsco.1993.1051} } + +@article{FJLT07, + title = {The generic Gröbner walk}, + volume = {42}, + doi = {10.1016/j.jsc.2006.09.004}, + pages = {298--312}, + number = {3}, + journal = {Journal of Symbolic Computation}, + author = {Fukuda, K. and Jensen, A. N. and Lauritzen, N. and Thomas, R.}, + year = {2007}, +} + @Article{FJR17, author = {Fan, Huijun and Jarvis, Tyler and Ruan, Yongbin}, title = {A mathematical theory of the gauged linear sigma model}, diff --git a/experimental/GroebnerWalk/docs/doc.main b/experimental/GroebnerWalk/docs/doc.main index c42ec6a31cee..c2415b45ca28 100644 --- a/experimental/GroebnerWalk/docs/doc.main +++ b/experimental/GroebnerWalk/docs/doc.main @@ -1,8 +1,5 @@ -# An example documentation - -This is a sample text to outline the structure of the packages in the `Experimental` folder. -You can show docstrings like this: -```@docs - my_access_func(S::ExampleStruct) -``` - +[ + "Gröbner walk" => [ + "introduction.md", + ] +] diff --git a/experimental/GroebnerWalk/docs/src/introduction.md b/experimental/GroebnerWalk/docs/src/introduction.md new file mode 100644 index 000000000000..eb63dc9db625 --- /dev/null +++ b/experimental/GroebnerWalk/docs/src/introduction.md @@ -0,0 +1,20 @@ +```@meta +CurrentModule = Oscar +``` + +# Gröbner walk + +This is a sample text to outline the structure of the packages in the `Experimental` folder. +You can show docstrings like this: + +The general idea of the Gröbner walk was proposed by [AGK97](@cite). +```@docs + groebner_walk( + I::MPolyIdeal, + target::MonomialOrdering = lex(base_ring(I)), + start::MonomialOrdering = default_ordering(base_ring(I)); + perturbation_degree = ngens(base_ring(I)), + algorithm::Symbol = :standard + ) +``` + diff --git a/experimental/GroebnerWalk/src/common.jl b/experimental/GroebnerWalk/src/common.jl index 9bd1b6601b28..59bf748cd9e4 100644 --- a/experimental/GroebnerWalk/src/common.jl +++ b/experimental/GroebnerWalk/src/common.jl @@ -4,26 +4,21 @@ I::MPolyIdeal, target::MonomialOrdering = lex(base_ring(I)), start::MonomialOrdering = default_ordering(base_ring(I)); - perturbation_degree = length(gens(base_ring(I))), + perturbation_degree = ngens(base_ring(I)), algorithm::Symbol = :standard ) Compute a reduced Groebner basis w.r.t. to a monomial ordering by converting it using the Groebner Walk. -The Groebner Walk is proposed by Collart, Kalkbrener & Mall (1997). -One can choose a strategy of: -- Standard Walk (:standard) computes the Walk like as presented in Cox, Little & O'Shea (2005). -- Generic Walk (:generic) computes the Walk as presented in Fukuda, Jensen, Lauritzen & Thomas (2005). -- Perturbed Walk (:perturbed, with p = degree of the perturbation) computes the Walk as presented in Amrhein, Gloor & Küchlin (1997). # Arguments - `I::MPolyIdeal`: ideal one wants to compute a Groebner basis for. - `target::MonomialOrdering=:lex`: monomial ordering one wants to compute a Groebner basis for. - `start::MonomialOrdering=:degrevlex`: monomial ordering to begin the conversion. - `perturbationDegree::Int=2`: the perturbation degree for the perturbed Walk. -- `algorithm::Symbol=standard`: strategy of the Groebner Walk. One can choose between: - - `standard`: Standard Walk, - - `generic`: Generic Walk, - - `perturbed`: Perturbed Walk, +- `algorithm::Symbol=:standard`: strategy of the Groebner Walk. One can choose between: + - `standard`: Standard Walk [CLO05](@cite), + - `generic`: Generic Walk [FJLT07](@cite), + - `perturbed`: Perturbed Walk [AGK96](@cite). # Examples From 5f0d7a64ef36f6974dae98a07896c88fa31e109a Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Tue, 30 Jul 2024 14:40:37 +0200 Subject: [PATCH 125/179] Add citations --- src/common.jl | 5 +++-- src/standard_walk.jl | 8 ++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/common.jl b/src/common.jl index 59bf748cd9e4..c094effd91a1 100644 --- a/src/common.jl +++ b/src/common.jl @@ -8,7 +8,8 @@ algorithm::Symbol = :standard ) -Compute a reduced Groebner basis w.r.t. to a monomial ordering by converting it using the Groebner Walk. +Compute a reduced Groebner basis w.r.t. to the monomial ordering `target` by converting it +from a Groebner basis with respect to the ordering `start` using the Groebner Walk. # Arguments - `I::MPolyIdeal`: ideal one wants to compute a Groebner basis for. @@ -126,7 +127,7 @@ Replaces every element of G by the normal form with respect to the remaining ele function autoreduce(G::Oscar.IdealGens) generators = collect(gens(G)) - for i in 1:length(gens(G)) + for i in 1:ngens(G) generators[i] = reduce( generators[i], generators[1:end .!= i]; ordering=G.ord, complete_reduction=true ) diff --git a/src/standard_walk.jl b/src/standard_walk.jl index 7363aab77101..eda0a602abdb 100644 --- a/src/standard_walk.jl +++ b/src/standard_walk.jl @@ -2,7 +2,7 @@ standard_walk(G::Oscar.IdealGens, start::MonomialOrdering, target::MonomialOrdering) Compute a reduced Groebner basis w.r.t. to a monomial order by converting it using the Groebner Walk -using the algorithm proposed by Collart, Kalkbrener & Mall (1997). +using the algorithm proposed by [CKM97](@cite). # Arguments - `G::Oscar.IdealGens`: Groebner basis of an ideal with respect to a starting monomial order. @@ -24,7 +24,7 @@ end standard_walk(G::Oscar.IdealGens, target::MonomialOrdering, current_weight::Vector{ZZRingElem}, target_weight::Vector{ZZRingElem}) Compute a reduced Groebner basis w.r.t. to the monomial order `target` by converting it using the Groebner Walk -using the algorithm proposed by Collart, Kalkbrener & Mall (1997). +using the algorithm proposed by [CKM97](@cite). # Arguments - `G::Oscar.IdealGens`: Groebner basis of an ideal with respect to a starting monomial order. @@ -163,7 +163,7 @@ end Returns a list of "bounding vectors" of a Gröbner basis of `I`, as pairs of "exponent vector of leading monomial" and "exponent vector of tail monomial". The bounding vectors form an H-description of the Gröbner cone. -(cf. "Using algebraic geometry", pg. 437 (CLO, 2005)) TODO: consistent citations, compare with OSCAR +(cf. p. 437 [CLO05](@cite)) """ function bounding_vectors(I::Oscar.IdealGens) # TODO: Marked Gröbner basis @@ -185,7 +185,7 @@ end ) Computes an inclusion minimal Gröbner basis with respect to `target` according to the -lifting step from Proposition 3.2 of "The generic Gröbner walk" (Fukuda et al., 2005) +lifting step from Proposition 3.2 of [FJLT07](@cite). # Arguments - `G::Oscar.IdealGens`: The reduced Gröbner basis of I From 29c76c5aff13e6c1301535324d58cf731fadb23b Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Tue, 30 Jul 2024 14:40:37 +0200 Subject: [PATCH 126/179] Add citations --- experimental/GroebnerWalk/src/common.jl | 5 +++-- experimental/GroebnerWalk/src/standard_walk.jl | 8 ++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/experimental/GroebnerWalk/src/common.jl b/experimental/GroebnerWalk/src/common.jl index 59bf748cd9e4..c094effd91a1 100644 --- a/experimental/GroebnerWalk/src/common.jl +++ b/experimental/GroebnerWalk/src/common.jl @@ -8,7 +8,8 @@ algorithm::Symbol = :standard ) -Compute a reduced Groebner basis w.r.t. to a monomial ordering by converting it using the Groebner Walk. +Compute a reduced Groebner basis w.r.t. to the monomial ordering `target` by converting it +from a Groebner basis with respect to the ordering `start` using the Groebner Walk. # Arguments - `I::MPolyIdeal`: ideal one wants to compute a Groebner basis for. @@ -126,7 +127,7 @@ Replaces every element of G by the normal form with respect to the remaining ele function autoreduce(G::Oscar.IdealGens) generators = collect(gens(G)) - for i in 1:length(gens(G)) + for i in 1:ngens(G) generators[i] = reduce( generators[i], generators[1:end .!= i]; ordering=G.ord, complete_reduction=true ) diff --git a/experimental/GroebnerWalk/src/standard_walk.jl b/experimental/GroebnerWalk/src/standard_walk.jl index 7363aab77101..eda0a602abdb 100644 --- a/experimental/GroebnerWalk/src/standard_walk.jl +++ b/experimental/GroebnerWalk/src/standard_walk.jl @@ -2,7 +2,7 @@ standard_walk(G::Oscar.IdealGens, start::MonomialOrdering, target::MonomialOrdering) Compute a reduced Groebner basis w.r.t. to a monomial order by converting it using the Groebner Walk -using the algorithm proposed by Collart, Kalkbrener & Mall (1997). +using the algorithm proposed by [CKM97](@cite). # Arguments - `G::Oscar.IdealGens`: Groebner basis of an ideal with respect to a starting monomial order. @@ -24,7 +24,7 @@ end standard_walk(G::Oscar.IdealGens, target::MonomialOrdering, current_weight::Vector{ZZRingElem}, target_weight::Vector{ZZRingElem}) Compute a reduced Groebner basis w.r.t. to the monomial order `target` by converting it using the Groebner Walk -using the algorithm proposed by Collart, Kalkbrener & Mall (1997). +using the algorithm proposed by [CKM97](@cite). # Arguments - `G::Oscar.IdealGens`: Groebner basis of an ideal with respect to a starting monomial order. @@ -163,7 +163,7 @@ end Returns a list of "bounding vectors" of a Gröbner basis of `I`, as pairs of "exponent vector of leading monomial" and "exponent vector of tail monomial". The bounding vectors form an H-description of the Gröbner cone. -(cf. "Using algebraic geometry", pg. 437 (CLO, 2005)) TODO: consistent citations, compare with OSCAR +(cf. p. 437 [CLO05](@cite)) """ function bounding_vectors(I::Oscar.IdealGens) # TODO: Marked Gröbner basis @@ -185,7 +185,7 @@ end ) Computes an inclusion minimal Gröbner basis with respect to `target` according to the -lifting step from Proposition 3.2 of "The generic Gröbner walk" (Fukuda et al., 2005) +lifting step from Proposition 3.2 of [FJLT07](@cite). # Arguments - `G::Oscar.IdealGens`: The reduced Gröbner basis of I From e1ffd647de0a696aa501a71d8d84e1edf7c93569 Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Tue, 30 Jul 2024 23:42:34 +0200 Subject: [PATCH 127/179] Update doctests --- src/GroebnerWalk.jl | 15 +++++++++++++-- src/common.jl | 37 ++++++++++++------------------------- 2 files changed, 25 insertions(+), 27 deletions(-) diff --git a/src/GroebnerWalk.jl b/src/GroebnerWalk.jl index bede5b227857..fa970a973bbc 100644 --- a/src/GroebnerWalk.jl +++ b/src/GroebnerWalk.jl @@ -1,7 +1,18 @@ module GroebnerWalk using Oscar -import Oscar: weight_ordering, ZZRingElem, MonomialOrdering, ZZMatrix, IdealGens -import Oscar.Orderings: MatrixOrdering, _support_indices + +import Oscar: + IdealGens, + MonomialOrdering, + ngens, + weight_ordering, + ZZMatrix, + ZZRingElem + + +import Oscar.Orderings: + MatrixOrdering, + _support_indices include("markedGB.jl") include("common.jl") diff --git a/src/common.jl b/src/common.jl index c094effd91a1..d9b2b79c2f8f 100644 --- a/src/common.jl +++ b/src/common.jl @@ -30,19 +30,20 @@ julia> I = ideal([y^4+ x^3-x^2+x,x^4]); julia> groebner_walk(I, lex(R)) Gröbner basis with elements -1 -> x + y^12 - y^8 + y^4 r -2 -> y^16 + 1 -> x + y^12 - y^8 + y^4 + 2 -> y^16 with respect to the ordering -lex([x, y]) + lex([x, y]) -julia> groebner_walk(I, lex(R); algorithm=:perturbed) +julia> groebner_walk(I, lex(R); algorithm=:generic) Gröbner basis with elements -1 -> x + y^12 - y^8 + y^4 -2 -> y^16 + 1 -> y^16 + 2 -> x + y^12 - y^8 + y^4 with respect to the ordering -lex([x, y]) + lex([x, y]) julia> set_verbosity_level(:groebner_walk, 1); + julia> groebner_walk(I, lex(R)) Results for standard_walk Crossed Cones in: @@ -52,25 +53,11 @@ ZZRingElem[12, 1] ZZRingElem[1, 0] Cones crossed: 4 Gröbner basis with elements -1 -> x + y^12 - y^8 + y^4 -2 -> y^16 + 1 -> x + y^12 - y^8 + y^4 + 2 -> y^16 with respect to the ordering -lex([x, y]) + lex([x, y]) -julia> groebner_walk(I, lex(R); algorithm=:perturbed) -perturbed_walk results -Crossed Cones in: -[4, 3] -[4, 1] -[5, 1] -[12, 1] -[1, 0] -Cones crossed: 5 -Gröbner basis with elements -1 -> y^16 -2 -> x + y^12 - y^8 + y^4 -with respect to the ordering -matrix_ordering([x, y], [1 0; 0 1]) ``` """ function groebner_walk( @@ -127,7 +114,7 @@ Replaces every element of G by the normal form with respect to the remaining ele function autoreduce(G::Oscar.IdealGens) generators = collect(gens(G)) - for i in 1:ngens(G) + for i in 1:length(G) generators[i] = reduce( generators[i], generators[1:end .!= i]; ordering=G.ord, complete_reduction=true ) From d622ad2319925328a7bce1a3c3d145eae99aaa5a Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Tue, 30 Jul 2024 23:42:34 +0200 Subject: [PATCH 128/179] Update doctests --- experimental/GroebnerWalk/src/GroebnerWalk.jl | 15 +++++++- experimental/GroebnerWalk/src/common.jl | 37 ++++++------------- 2 files changed, 25 insertions(+), 27 deletions(-) diff --git a/experimental/GroebnerWalk/src/GroebnerWalk.jl b/experimental/GroebnerWalk/src/GroebnerWalk.jl index bede5b227857..fa970a973bbc 100644 --- a/experimental/GroebnerWalk/src/GroebnerWalk.jl +++ b/experimental/GroebnerWalk/src/GroebnerWalk.jl @@ -1,7 +1,18 @@ module GroebnerWalk using Oscar -import Oscar: weight_ordering, ZZRingElem, MonomialOrdering, ZZMatrix, IdealGens -import Oscar.Orderings: MatrixOrdering, _support_indices + +import Oscar: + IdealGens, + MonomialOrdering, + ngens, + weight_ordering, + ZZMatrix, + ZZRingElem + + +import Oscar.Orderings: + MatrixOrdering, + _support_indices include("markedGB.jl") include("common.jl") diff --git a/experimental/GroebnerWalk/src/common.jl b/experimental/GroebnerWalk/src/common.jl index c094effd91a1..d9b2b79c2f8f 100644 --- a/experimental/GroebnerWalk/src/common.jl +++ b/experimental/GroebnerWalk/src/common.jl @@ -30,19 +30,20 @@ julia> I = ideal([y^4+ x^3-x^2+x,x^4]); julia> groebner_walk(I, lex(R)) Gröbner basis with elements -1 -> x + y^12 - y^8 + y^4 r -2 -> y^16 + 1 -> x + y^12 - y^8 + y^4 + 2 -> y^16 with respect to the ordering -lex([x, y]) + lex([x, y]) -julia> groebner_walk(I, lex(R); algorithm=:perturbed) +julia> groebner_walk(I, lex(R); algorithm=:generic) Gröbner basis with elements -1 -> x + y^12 - y^8 + y^4 -2 -> y^16 + 1 -> y^16 + 2 -> x + y^12 - y^8 + y^4 with respect to the ordering -lex([x, y]) + lex([x, y]) julia> set_verbosity_level(:groebner_walk, 1); + julia> groebner_walk(I, lex(R)) Results for standard_walk Crossed Cones in: @@ -52,25 +53,11 @@ ZZRingElem[12, 1] ZZRingElem[1, 0] Cones crossed: 4 Gröbner basis with elements -1 -> x + y^12 - y^8 + y^4 -2 -> y^16 + 1 -> x + y^12 - y^8 + y^4 + 2 -> y^16 with respect to the ordering -lex([x, y]) + lex([x, y]) -julia> groebner_walk(I, lex(R); algorithm=:perturbed) -perturbed_walk results -Crossed Cones in: -[4, 3] -[4, 1] -[5, 1] -[12, 1] -[1, 0] -Cones crossed: 5 -Gröbner basis with elements -1 -> y^16 -2 -> x + y^12 - y^8 + y^4 -with respect to the ordering -matrix_ordering([x, y], [1 0; 0 1]) ``` """ function groebner_walk( @@ -127,7 +114,7 @@ Replaces every element of G by the normal form with respect to the remaining ele function autoreduce(G::Oscar.IdealGens) generators = collect(gens(G)) - for i in 1:ngens(G) + for i in 1:length(G) generators[i] = reduce( generators[i], generators[1:end .!= i]; ordering=G.ord, complete_reduction=true ) From fc2a7dcfe5888fc343322c8366251c8017aba9c3 Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Tue, 30 Jul 2024 23:11:00 +0200 Subject: [PATCH 129/179] Rename is_same_groebner_cone --- src/common.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common.jl b/src/common.jl index d9b2b79c2f8f..b08c5ff65d6e 100644 --- a/src/common.jl +++ b/src/common.jl @@ -84,13 +84,13 @@ function groebner_walk( end @doc raw""" - same_cone(G::Oscar.IdealGens, T::MonomialOrdering) + is_same_groebner_cone(G::Oscar.IdealGens, T::MonomialOrdering) Checks whether the leading terms of G with respect to the matrix ordering given by T agree with the leading terms of G with respect to the current ordering. This means they are in the same cone of the Groebner fan. (cf. Lemma 2.2, Collart, Kalkbrener and Mall 1997) """ -same_cone(G::Oscar.IdealGens, T::MonomialOrdering) = all(leading_term.(G; ordering=T) .== leading_term.(G; ordering=ordering(G))) +is_same_groebner_cone(G::Oscar.IdealGens, T::MonomialOrdering) = all(leading_term.(G; ordering=T) .== leading_term.(G; ordering=ordering(G))) # converts a vector wtemp by dividing the entries with gcd(wtemp). @doc raw""" From 96e4a4df555db88aa5747ebad6827214df035793 Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Tue, 30 Jul 2024 23:11:00 +0200 Subject: [PATCH 130/179] Rename is_same_groebner_cone --- experimental/GroebnerWalk/src/common.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/experimental/GroebnerWalk/src/common.jl b/experimental/GroebnerWalk/src/common.jl index d9b2b79c2f8f..b08c5ff65d6e 100644 --- a/experimental/GroebnerWalk/src/common.jl +++ b/experimental/GroebnerWalk/src/common.jl @@ -84,13 +84,13 @@ function groebner_walk( end @doc raw""" - same_cone(G::Oscar.IdealGens, T::MonomialOrdering) + is_same_groebner_cone(G::Oscar.IdealGens, T::MonomialOrdering) Checks whether the leading terms of G with respect to the matrix ordering given by T agree with the leading terms of G with respect to the current ordering. This means they are in the same cone of the Groebner fan. (cf. Lemma 2.2, Collart, Kalkbrener and Mall 1997) """ -same_cone(G::Oscar.IdealGens, T::MonomialOrdering) = all(leading_term.(G; ordering=T) .== leading_term.(G; ordering=ordering(G))) +is_same_groebner_cone(G::Oscar.IdealGens, T::MonomialOrdering) = all(leading_term.(G; ordering=T) .== leading_term.(G; ordering=ordering(G))) # converts a vector wtemp by dividing the entries with gcd(wtemp). @doc raw""" From 654d999634112cf6bb93ebe856f157f34dcf18a4 Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Wed, 31 Jul 2024 03:18:52 +0200 Subject: [PATCH 131/179] Fix docstring --- src/GroebnerWalk.jl | 12 ++++++------ src/common.jl | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/GroebnerWalk.jl b/src/GroebnerWalk.jl index fa970a973bbc..c5f4e00d2afe 100644 --- a/src/GroebnerWalk.jl +++ b/src/GroebnerWalk.jl @@ -2,16 +2,16 @@ module GroebnerWalk using Oscar import Oscar: - IdealGens, - MonomialOrdering, - ngens, - weight_ordering, - ZZMatrix, + IdealGens, + MonomialOrdering, + ngens + weight_ordering, + ZZMatrix, ZZRingElem import Oscar.Orderings: - MatrixOrdering, + MatrixOrdering, _support_indices include("markedGB.jl") diff --git a/src/common.jl b/src/common.jl index b08c5ff65d6e..089703a7d284 100644 --- a/src/common.jl +++ b/src/common.jl @@ -47,10 +47,10 @@ julia> set_verbosity_level(:groebner_walk, 1); julia> groebner_walk(I, lex(R)) Results for standard_walk Crossed Cones in: +ZZRingElem[1, 1] ZZRingElem[4, 3] ZZRingElem[4, 1] ZZRingElem[12, 1] -ZZRingElem[1, 0] Cones crossed: 4 Gröbner basis with elements 1 -> x + y^12 - y^8 + y^4 From 652d437e68c2beab74fcedc93aeca9a48d2c70d6 Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Wed, 31 Jul 2024 03:18:52 +0200 Subject: [PATCH 132/179] Fix docstring --- experimental/GroebnerWalk/src/GroebnerWalk.jl | 12 ++++++------ experimental/GroebnerWalk/src/common.jl | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/experimental/GroebnerWalk/src/GroebnerWalk.jl b/experimental/GroebnerWalk/src/GroebnerWalk.jl index fa970a973bbc..c5f4e00d2afe 100644 --- a/experimental/GroebnerWalk/src/GroebnerWalk.jl +++ b/experimental/GroebnerWalk/src/GroebnerWalk.jl @@ -2,16 +2,16 @@ module GroebnerWalk using Oscar import Oscar: - IdealGens, - MonomialOrdering, - ngens, - weight_ordering, - ZZMatrix, + IdealGens, + MonomialOrdering, + ngens + weight_ordering, + ZZMatrix, ZZRingElem import Oscar.Orderings: - MatrixOrdering, + MatrixOrdering, _support_indices include("markedGB.jl") diff --git a/experimental/GroebnerWalk/src/common.jl b/experimental/GroebnerWalk/src/common.jl index b08c5ff65d6e..089703a7d284 100644 --- a/experimental/GroebnerWalk/src/common.jl +++ b/experimental/GroebnerWalk/src/common.jl @@ -47,10 +47,10 @@ julia> set_verbosity_level(:groebner_walk, 1); julia> groebner_walk(I, lex(R)) Results for standard_walk Crossed Cones in: +ZZRingElem[1, 1] ZZRingElem[4, 3] ZZRingElem[4, 1] ZZRingElem[12, 1] -ZZRingElem[1, 0] Cones crossed: 4 Gröbner basis with elements 1 -> x + y^12 - y^8 + y^4 From 890971f8dfae4dfb00958614eb77f14cbc52b1fc Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Mon, 29 Jul 2024 23:50:04 +0200 Subject: [PATCH 133/179] Export groebner_walk from experimental module MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Lars Göttgens --- src/GroebnerWalk.jl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/GroebnerWalk.jl b/src/GroebnerWalk.jl index c5f4e00d2afe..0629ab6e6269 100644 --- a/src/GroebnerWalk.jl +++ b/src/GroebnerWalk.jl @@ -29,3 +29,6 @@ end end +using .GroebnerWalk +export groebner_walk + From ac2216a22ae3345897e00d2bb98225c6e6e3d5a3 Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Mon, 29 Jul 2024 23:50:04 +0200 Subject: [PATCH 134/179] Export groebner_walk from experimental module MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Lars Göttgens --- experimental/GroebnerWalk/src/GroebnerWalk.jl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/experimental/GroebnerWalk/src/GroebnerWalk.jl b/experimental/GroebnerWalk/src/GroebnerWalk.jl index c5f4e00d2afe..0629ab6e6269 100644 --- a/experimental/GroebnerWalk/src/GroebnerWalk.jl +++ b/experimental/GroebnerWalk/src/GroebnerWalk.jl @@ -29,3 +29,6 @@ end end +using .GroebnerWalk +export groebner_walk + From c1afb3c5a2cfb8cc2723702aa9085dee9ad916db Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Wed, 31 Jul 2024 11:36:17 +0200 Subject: [PATCH 135/179] Make use of TropicalGeometry/groebner_lift --- src/standard_walk.jl | 38 ++------------------------------------ 1 file changed, 2 insertions(+), 36 deletions(-) diff --git a/src/standard_walk.jl b/src/standard_walk.jl index eda0a602abdb..b054931fbcb8 100644 --- a/src/standard_walk.jl +++ b/src/standard_walk.jl @@ -81,12 +81,12 @@ function standard_step(G::Oscar.IdealGens, w::Vector{ZZRingElem}, target::Monomi @vprintln :groebner_walk 3 Gw H = groebner_basis(Gw; ordering=next, complete_reduction=true) - H = lift(G, current_ordering, H, next) + H = Oscar.groebner_lift(gens(H), next, gens(G), current_ordering) @vprint :groebner_walk 10 "Lifted GB of initial forms: " @vprintln :groebner_walk 10 H - return autoreduce(H) + return Oscar.IdealGens(H, next) end standard_step(G::Oscar.IdealGens, w::Vector{Int}, T::Matrix{Int}) = standard_step(G, ZZ.(w), create_ordering(base_ring(G), w, T)) @@ -176,37 +176,3 @@ function bounding_vectors(I::Oscar.IdealGens) return unique!(reduce(vcat, v)) end -@doc raw""" - lift( - G::Oscar.IdealGens, # momentane GB - current::MonomialOrdering, - H::Oscar.IdealGens, # soll GB von initial forms sein - target::MonomialOrdering, - ) - -Computes an inclusion minimal Gröbner basis with respect to `target` according to the -lifting step from Proposition 3.2 of [FJLT07](@cite). - -# Arguments -- `G::Oscar.IdealGens`: The reduced Gröbner basis of I -- `current::MonomialOrdering`: The current monomial order (TODO: Do we need that) -- `H::Oscar.IdealGens`: A Gröbner basis of initial forms of (TODO: what) with respect to (TODO: what) -- `target::MonomialOrdering`: The ordering for which the output is a Gröbner basis. -""" -function lift( - G::Oscar.IdealGens, # momentane GB - current::MonomialOrdering, - H::Oscar.IdealGens, # soll GB von initial forms sein - target::MonomialOrdering, -) - G = Oscar.IdealGens( - [ - gen - reduce(gen, gens(G); ordering=current, complete_reduction=true) for gen in gens(H) - ], - target; - isGB=true, - ) - - return G -end - From 9a7ed943efa113e14c03bc3ecca54eb656fa7a9e Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Wed, 31 Jul 2024 11:36:17 +0200 Subject: [PATCH 136/179] Make use of TropicalGeometry/groebner_lift --- .../GroebnerWalk/src/standard_walk.jl | 38 +------------------ 1 file changed, 2 insertions(+), 36 deletions(-) diff --git a/experimental/GroebnerWalk/src/standard_walk.jl b/experimental/GroebnerWalk/src/standard_walk.jl index eda0a602abdb..b054931fbcb8 100644 --- a/experimental/GroebnerWalk/src/standard_walk.jl +++ b/experimental/GroebnerWalk/src/standard_walk.jl @@ -81,12 +81,12 @@ function standard_step(G::Oscar.IdealGens, w::Vector{ZZRingElem}, target::Monomi @vprintln :groebner_walk 3 Gw H = groebner_basis(Gw; ordering=next, complete_reduction=true) - H = lift(G, current_ordering, H, next) + H = Oscar.groebner_lift(gens(H), next, gens(G), current_ordering) @vprint :groebner_walk 10 "Lifted GB of initial forms: " @vprintln :groebner_walk 10 H - return autoreduce(H) + return Oscar.IdealGens(H, next) end standard_step(G::Oscar.IdealGens, w::Vector{Int}, T::Matrix{Int}) = standard_step(G, ZZ.(w), create_ordering(base_ring(G), w, T)) @@ -176,37 +176,3 @@ function bounding_vectors(I::Oscar.IdealGens) return unique!(reduce(vcat, v)) end -@doc raw""" - lift( - G::Oscar.IdealGens, # momentane GB - current::MonomialOrdering, - H::Oscar.IdealGens, # soll GB von initial forms sein - target::MonomialOrdering, - ) - -Computes an inclusion minimal Gröbner basis with respect to `target` according to the -lifting step from Proposition 3.2 of [FJLT07](@cite). - -# Arguments -- `G::Oscar.IdealGens`: The reduced Gröbner basis of I -- `current::MonomialOrdering`: The current monomial order (TODO: Do we need that) -- `H::Oscar.IdealGens`: A Gröbner basis of initial forms of (TODO: what) with respect to (TODO: what) -- `target::MonomialOrdering`: The ordering for which the output is a Gröbner basis. -""" -function lift( - G::Oscar.IdealGens, # momentane GB - current::MonomialOrdering, - H::Oscar.IdealGens, # soll GB von initial forms sein - target::MonomialOrdering, -) - G = Oscar.IdealGens( - [ - gen - reduce(gen, gens(G); ordering=current, complete_reduction=true) for gen in gens(H) - ], - target; - isGB=true, - ) - - return G -end - From 191382f758549fcaf2c0506e90156e02daf8f08a Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Mon, 29 Jul 2024 23:51:38 +0200 Subject: [PATCH 137/179] Update generic_walk.jl MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Lars Göttgens --- src/generic_walk.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/generic_walk.jl b/src/generic_walk.jl index 4676c6a527f1..c7b658904543 100644 --- a/src/generic_walk.jl +++ b/src/generic_walk.jl @@ -110,7 +110,7 @@ of `MG` by truncating to all bounding vectors parallel to `v`. """ function facet_initials(MG::MarkedGroebnerBasis, v::Vector{ZZRingElem}) R = base_ring(MG) - inwG = Vector{MPolyRingElem}() + inwG = elem_type(R)[] ctx = MPolyBuildCtx(R) for (g, m) in gens_and_markings(MG) From 4c4556c0b1d5609af8e346eb7d0c7ff562caf9d9 Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Mon, 29 Jul 2024 23:51:38 +0200 Subject: [PATCH 138/179] Update generic_walk.jl MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Lars Göttgens --- experimental/GroebnerWalk/src/generic_walk.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/experimental/GroebnerWalk/src/generic_walk.jl b/experimental/GroebnerWalk/src/generic_walk.jl index 4676c6a527f1..c7b658904543 100644 --- a/experimental/GroebnerWalk/src/generic_walk.jl +++ b/experimental/GroebnerWalk/src/generic_walk.jl @@ -110,7 +110,7 @@ of `MG` by truncating to all bounding vectors parallel to `v`. """ function facet_initials(MG::MarkedGroebnerBasis, v::Vector{ZZRingElem}) R = base_ring(MG) - inwG = Vector{MPolyRingElem}() + inwG = elem_type(R)[] ctx = MPolyBuildCtx(R) for (g, m) in gens_and_markings(MG) From b4b483f32173843138797f3fcab9b7508600aae9 Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Mon, 29 Jul 2024 23:51:45 +0200 Subject: [PATCH 139/179] Update generic_walk.jl MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Lars Göttgens --- src/generic_walk.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/generic_walk.jl b/src/generic_walk.jl index c7b658904543..808d7fa67bcd 100644 --- a/src/generic_walk.jl +++ b/src/generic_walk.jl @@ -137,7 +137,7 @@ lift H to a marked Gröbner basis of I (with unknown ordering) by subtracting in """ function lift_generic(MG::MarkedGroebnerBasis, H::MarkedGroebnerBasis) return map(1:length(H.gens)) do i - H[i] - normal_form(H[i], MG) + H[i] - normal_form(H[i], MG) end end From 23771320bb3671a2fce4459dae9751d7ef047884 Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Mon, 29 Jul 2024 23:51:45 +0200 Subject: [PATCH 140/179] Update generic_walk.jl MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Lars Göttgens --- experimental/GroebnerWalk/src/generic_walk.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/experimental/GroebnerWalk/src/generic_walk.jl b/experimental/GroebnerWalk/src/generic_walk.jl index c7b658904543..808d7fa67bcd 100644 --- a/experimental/GroebnerWalk/src/generic_walk.jl +++ b/experimental/GroebnerWalk/src/generic_walk.jl @@ -137,7 +137,7 @@ lift H to a marked Gröbner basis of I (with unknown ordering) by subtracting in """ function lift_generic(MG::MarkedGroebnerBasis, H::MarkedGroebnerBasis) return map(1:length(H.gens)) do i - H[i] - normal_form(H[i], MG) + H[i] - normal_form(H[i], MG) end end From 26b3c3b302e8e80460f1ea304964443e85251344 Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Tue, 30 Jul 2024 14:48:21 +0200 Subject: [PATCH 141/179] Add citations --- src/generic_walk.jl | 6 +++--- src/perturbed_walk.jl | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/generic_walk.jl b/src/generic_walk.jl index 808d7fa67bcd..83a1b2e2d90c 100644 --- a/src/generic_walk.jl +++ b/src/generic_walk.jl @@ -2,7 +2,7 @@ generic_walk(G::Oscar.IdealGens, start::MonomialOrdering, target::MonomialOrdering) Compute a reduced Groebner basis w.r.t. to a monomial order by converting it using the Groebner Walk -using the algorithm proposed by Collart, Kalkbrener & Mall (1997). +using the algorithm proposed by [CKM97](@cite). # Arguments - `G::Oscar.IdealGens`: Groebner basis of an ideal with respect to a starting monomial order. @@ -133,7 +133,7 @@ end lift_generic(MG::MarkedGroebnerBasis, H::MarkedGroebnerBasis) Given a marked Gröbner basis `MG` generating an ideal $I$ and a reduced marked Gröbner basis `H` of initial forms, -lift H to a marked Gröbner basis of I (with unknown ordering) by subtracting initial forms according to Fukuda, 2007. +lift H to a marked Gröbner basis of I (with unknown ordering) by subtracting initial forms according to [FJT07](@cite). """ function lift_generic(MG::MarkedGroebnerBasis, H::MarkedGroebnerBasis) return map(1:length(H.gens)) do i @@ -145,7 +145,7 @@ end lift_generic!(H::MarkedGroebnerBasis, MG::MarkedGroebnerBasis) Given a marked Gröbner basis `MG` generating an ideal $I$ and a reduced marked Gröbner basis `H` of initial forms, -lift H to a marked Gröbner basis of I (with unknown ordering) by subtracting initial forms according to Fukuda, 2007. +lift H to a marked Gröbner basis of I (with unknown ordering) by subtracting initial forms according to [FJT07](@cite). This changes `H` in-place. """ function lift_generic!(H::MarkedGroebnerBasis, MG::MarkedGroebnerBasis) diff --git a/src/perturbed_walk.jl b/src/perturbed_walk.jl index 93da4e4a104f..206244be3a19 100644 --- a/src/perturbed_walk.jl +++ b/src/perturbed_walk.jl @@ -2,7 +2,7 @@ perturbed_walk(G::Oscar.IdealGens, start::MonomialOrdering, target::MonomialOrdering, p::Int) Compute a reduced Groebner basis w.r.t. to a monomial order by converting it using -the Groebner Walk with the algorithm proposed by TODO: reference. +the Groebner Walk with the algorithm proposed by [Tra00](@cite). # Arguments - `G::Oscar.IdealGens`: Groebner basis of an ideal with respect to a starting monomial order. @@ -56,7 +56,7 @@ perturbed_walk( perturbed_vector(G::Oscar.IdealGens, M::ZZMatrix, p::Int) Computes a perturbed vector using a matrix `M` representing some monomial order -for one iteration of the Groebner walk according to Tran (2000), Thm. 3.1. +for one iteration of the Groebner walk according to [Tra00](@cite), Thm. 3.1. # Arguments - `G::Oscar.IdealGens`: Groebner basis of an ideal with respect to a starting monomial order. From 571aa9de85d8d35cf11d551a9ed9881be43c5173 Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Tue, 30 Jul 2024 14:48:21 +0200 Subject: [PATCH 142/179] Add citations --- docs/oscar_references.bib | 114 +++++++++++------- experimental/GroebnerWalk/src/generic_walk.jl | 6 +- .../GroebnerWalk/src/perturbed_walk.jl | 4 +- 3 files changed, 76 insertions(+), 48 deletions(-) diff --git a/docs/oscar_references.bib b/docs/oscar_references.bib index 53b224e10f2b..92c18d5d0efe 100644 --- a/docs/oscar_references.bib +++ b/docs/oscar_references.bib @@ -37,33 +37,30 @@ @Article{AG10 eprint = {0810.1148} } - @InProceedings{AGK96, - title = {Walking faster}, - pages = {150--161}, - booktitle = {Design and Implementation of Symbolic Computation Systems}, - series = {DISCO 1996}, - address = {Heidelberg, Germany}, - publisher = {Springer Berlin, Heidelberg}, - author = {Amrhein, Beatrice and Gloor, Oliver and Küchlin, Wolfgang}, - year = {1996}, - doi = {10.1007/3-540-61697-7_14}, - location = {Karlsruhe, Germany} + author = {Amrhein, Beatrice and Gloor, Oliver and Küchlin, Wolfgang}, + title = {Walking faster}, + booktitle = {Design and Implementation of Symbolic Computation Systems}, + series = {DISCO 1996}, + address = {Heidelberg, Germany}, + publisher = {Springer Berlin, Heidelberg}, + pages = {150--161}, + year = {1996}, + doi = {10.1007/3-540-61697-7_14}, + location = {Karlsruhe, Germany} } - @Article{AGK97, - title = {On the walk}, - volume = {187}, - doi = {10.1016/s0304-3975(97)00064-9}, - pages = {179--202}, - number = {1}, - journal = {Theoretical Computer Science}, - author = {Amrhein, Beatrice and Gloor, Oliver and Küchlin, Wolfgang}, - year = {1997}, + author = {Amrhein, Beatrice and Gloor, Oliver and Küchlin, Wolfgang}, + title = {On the walk}, + journal = {Theoretical Computer Science}, + volume = {187}, + number = {1}, + pages = {179--202}, + year = {1997}, + doi = {10.1016/s0304-3975(97)00064-9} } - @Article{AHK18, author = {Adiprasito, Karim and Huh, June and Katz, Eric}, title = {Hodge theory for combinatorial geometries}, @@ -480,6 +477,27 @@ @Article{CHM98 doi = {10.1112/S1461157000000115} } +@Article{CKM97, + author = {Collart, S. and Kalkbrener, M. and Mall, D.}, + title = {Converting Bases with the Gröbner Walk}, + journal = {Journal of Symbolic Computation}, + volume = {24}, + number = {3}, + pages = {465--469}, + year = {1997}, + doi = {10.1006/jsco.1996.0145} +} + +@Book{CLO05, + author = {Cox, David A. and Little, John and O'Shea, Donal}, + title = {Using Algebraic Geometry}, + series = {Graduate Texts in Mathematics}, + volume = {185}, + publisher = {Springer-Verlag}, + year = {2005}, + doi = {10.1007/b138611} +} + @Book{CLS11, author = {Cox, David A. and Little, John B. and Schenck, Henry K.}, title = {Toric varieties}, @@ -575,18 +593,6 @@ @InCollection{Chr91 doi = {10.1007/BFb0086376} } - -@book{CLO05, - author = {Cox, David A. and Little, John and O'Shea, Donal}, - title = {Using Algebraic Geometry}, - series = {Graduate Texts in Mathematics}, - volume = {185}, - publisher = {Springer-Verlag}, - year = {2005}, - doi = {10.1007/b138611}, -} - - @Book{Coh00, author = {Cohen, Henri}, title = {Advanced topics in computational number theory}, @@ -949,16 +955,15 @@ @Article{FGLM93 doi = {10.1006/jsco.1993.1051} } - -@article{FJLT07, - title = {The generic Gröbner walk}, - volume = {42}, - doi = {10.1016/j.jsc.2006.09.004}, - pages = {298--312}, - number = {3}, - journal = {Journal of Symbolic Computation}, - author = {Fukuda, K. and Jensen, A. N. and Lauritzen, N. and Thomas, R.}, - year = {2007}, +@Article{FJLT07, + author = {Fukuda, K. and Jensen, A. N. and Lauritzen, N. and Thomas, R.}, + title = {The generic Gröbner walk}, + journal = {Journal of Symbolic Computation}, + volume = {42}, + number = {3}, + pages = {298--312}, + year = {2007}, + doi = {10.1016/j.jsc.2006.09.004} } @Article{FJR17, @@ -974,6 +979,18 @@ @Article{FJR17 doi = {10.2140/gt.2018.22.235} } +@Article{FJT07, + author = {Fukuda, Komei and Jensen, Anders N. and Thomas, Rekha R.}, + title = {Computing Groebner Fans}, + journal = {Math. Comp.}, + fjournal = {Mathematics of Computation}, + volume = {76}, + number = {260}, + pages = {2189--2213}, + year = {2007}, + doi = {10.1090/S0025-5718-07-01986-2} +} + @InProceedings{FLINT, bibkey = {FLINT}, author = {W. B. Hart}, @@ -2212,6 +2229,17 @@ @Article{Tay87 primaryclass = {math.GR} } +@Article{Tra00, + author = {Tran, Quoc-Nam}, + title = {A Fast Algorithm for Gröbner Basis Conversion and its Applications}, + journal = {Journal of Symbolic Computation}, + volume = {30}, + number = {4}, + pages = {451--467}, + year = {2000}, + doi = {10.1006/jsco.1999.0416} +} + @Misc{VE22, author = {Vaughan-Lee, Michael and Eick, Bettina}, title = {SglPPow, Database of groups of prime-power order for some prime-powers, Version 2.3}, diff --git a/experimental/GroebnerWalk/src/generic_walk.jl b/experimental/GroebnerWalk/src/generic_walk.jl index 808d7fa67bcd..83a1b2e2d90c 100644 --- a/experimental/GroebnerWalk/src/generic_walk.jl +++ b/experimental/GroebnerWalk/src/generic_walk.jl @@ -2,7 +2,7 @@ generic_walk(G::Oscar.IdealGens, start::MonomialOrdering, target::MonomialOrdering) Compute a reduced Groebner basis w.r.t. to a monomial order by converting it using the Groebner Walk -using the algorithm proposed by Collart, Kalkbrener & Mall (1997). +using the algorithm proposed by [CKM97](@cite). # Arguments - `G::Oscar.IdealGens`: Groebner basis of an ideal with respect to a starting monomial order. @@ -133,7 +133,7 @@ end lift_generic(MG::MarkedGroebnerBasis, H::MarkedGroebnerBasis) Given a marked Gröbner basis `MG` generating an ideal $I$ and a reduced marked Gröbner basis `H` of initial forms, -lift H to a marked Gröbner basis of I (with unknown ordering) by subtracting initial forms according to Fukuda, 2007. +lift H to a marked Gröbner basis of I (with unknown ordering) by subtracting initial forms according to [FJT07](@cite). """ function lift_generic(MG::MarkedGroebnerBasis, H::MarkedGroebnerBasis) return map(1:length(H.gens)) do i @@ -145,7 +145,7 @@ end lift_generic!(H::MarkedGroebnerBasis, MG::MarkedGroebnerBasis) Given a marked Gröbner basis `MG` generating an ideal $I$ and a reduced marked Gröbner basis `H` of initial forms, -lift H to a marked Gröbner basis of I (with unknown ordering) by subtracting initial forms according to Fukuda, 2007. +lift H to a marked Gröbner basis of I (with unknown ordering) by subtracting initial forms according to [FJT07](@cite). This changes `H` in-place. """ function lift_generic!(H::MarkedGroebnerBasis, MG::MarkedGroebnerBasis) diff --git a/experimental/GroebnerWalk/src/perturbed_walk.jl b/experimental/GroebnerWalk/src/perturbed_walk.jl index 93da4e4a104f..206244be3a19 100644 --- a/experimental/GroebnerWalk/src/perturbed_walk.jl +++ b/experimental/GroebnerWalk/src/perturbed_walk.jl @@ -2,7 +2,7 @@ perturbed_walk(G::Oscar.IdealGens, start::MonomialOrdering, target::MonomialOrdering, p::Int) Compute a reduced Groebner basis w.r.t. to a monomial order by converting it using -the Groebner Walk with the algorithm proposed by TODO: reference. +the Groebner Walk with the algorithm proposed by [Tra00](@cite). # Arguments - `G::Oscar.IdealGens`: Groebner basis of an ideal with respect to a starting monomial order. @@ -56,7 +56,7 @@ perturbed_walk( perturbed_vector(G::Oscar.IdealGens, M::ZZMatrix, p::Int) Computes a perturbed vector using a matrix `M` representing some monomial order -for one iteration of the Groebner walk according to Tran (2000), Thm. 3.1. +for one iteration of the Groebner walk according to [Tra00](@cite), Thm. 3.1. # Arguments - `G::Oscar.IdealGens`: Groebner basis of an ideal with respect to a starting monomial order. From 43010c7f4020d957fd10c695004e486a3914cc6b Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Mon, 29 Jul 2024 23:51:55 +0200 Subject: [PATCH 143/179] Update generic_walk.jl MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Lars Göttgens --- src/generic_walk.jl | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/generic_walk.jl b/src/generic_walk.jl index 83a1b2e2d90c..7ad890f12d70 100644 --- a/src/generic_walk.jl +++ b/src/generic_walk.jl @@ -163,9 +163,8 @@ Checks whether $Mv <_{\mathrm{lex}} 0$. function less_than_zero(M::ZZMatrix, v::Vector{ZZRingElem}) if is_zero(v) return false - else - i = 1 end + i = 1 while dot(M[i, :], v) == 0 i += 1 end From b141a8f562bfd6ed41a6a698b55cc9ec4a9f4543 Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Mon, 29 Jul 2024 23:51:55 +0200 Subject: [PATCH 144/179] Update generic_walk.jl MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Lars Göttgens --- experimental/GroebnerWalk/src/generic_walk.jl | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/experimental/GroebnerWalk/src/generic_walk.jl b/experimental/GroebnerWalk/src/generic_walk.jl index 83a1b2e2d90c..7ad890f12d70 100644 --- a/experimental/GroebnerWalk/src/generic_walk.jl +++ b/experimental/GroebnerWalk/src/generic_walk.jl @@ -163,9 +163,8 @@ Checks whether $Mv <_{\mathrm{lex}} 0$. function less_than_zero(M::ZZMatrix, v::Vector{ZZRingElem}) if is_zero(v) return false - else - i = 1 end + i = 1 while dot(M[i, :], v) == 0 i += 1 end From 239ad7b2102a4523b22b9576ddd77fcd209b5fd4 Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Mon, 29 Jul 2024 23:52:08 +0200 Subject: [PATCH 145/179] Update markedGB.jl MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Lars Göttgens --- src/markedGB.jl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/markedGB.jl b/src/markedGB.jl index 7606cb47aa3a..32d70b58634e 100644 --- a/src/markedGB.jl +++ b/src/markedGB.jl @@ -24,7 +24,8 @@ struct MarkedGroebnerBasis end base_ring(G::MarkedGroebnerBasis) = parent(first(G.gens)) -length(G::MarkedGroebnerBasis) = length(gens(G)) +length(G::MarkedGroebnerBasis) = ngens(G) +ngens(G::MarkedGroebnerBasis) = length(gens(G)) gens(G::MarkedGroebnerBasis) = G.gens markings(G::MarkedGroebnerBasis) = G.markings From 394b200c21845a9a7097cf9ed6c51db650ac13d5 Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Mon, 29 Jul 2024 23:52:08 +0200 Subject: [PATCH 146/179] Update markedGB.jl MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Lars Göttgens --- experimental/GroebnerWalk/src/markedGB.jl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/experimental/GroebnerWalk/src/markedGB.jl b/experimental/GroebnerWalk/src/markedGB.jl index 7606cb47aa3a..32d70b58634e 100644 --- a/experimental/GroebnerWalk/src/markedGB.jl +++ b/experimental/GroebnerWalk/src/markedGB.jl @@ -24,7 +24,8 @@ struct MarkedGroebnerBasis end base_ring(G::MarkedGroebnerBasis) = parent(first(G.gens)) -length(G::MarkedGroebnerBasis) = length(gens(G)) +length(G::MarkedGroebnerBasis) = ngens(G) +ngens(G::MarkedGroebnerBasis) = length(gens(G)) gens(G::MarkedGroebnerBasis) = G.gens markings(G::MarkedGroebnerBasis) = G.markings From fbd690bba586e56b305fec7cd51c8f0518dc3150 Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Wed, 31 Jul 2024 11:12:48 +0200 Subject: [PATCH 147/179] Separate a statement --- src/generic_walk.jl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/generic_walk.jl b/src/generic_walk.jl index 7ad890f12d70..858922787831 100644 --- a/src/generic_walk.jl +++ b/src/generic_walk.jl @@ -67,7 +67,8 @@ function difference_lead_tail(MG::MarkedGroebnerBasis) (G,Lm) = gens(MG), markings(MG) lead_exp = leading_exponent_vector.(Lm) - v = map(zip(lead_exp, exponents.(G))) do (l,T) + l_T = zip(lead_exp, exponents.(G)) + v = map(l_T) do (l,T) Ref(l) .- T end From e6a5e836b77836a5782657d4570208dafe69a9fe Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Wed, 31 Jul 2024 11:12:48 +0200 Subject: [PATCH 148/179] Separate a statement --- experimental/GroebnerWalk/src/generic_walk.jl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/experimental/GroebnerWalk/src/generic_walk.jl b/experimental/GroebnerWalk/src/generic_walk.jl index 7ad890f12d70..858922787831 100644 --- a/experimental/GroebnerWalk/src/generic_walk.jl +++ b/experimental/GroebnerWalk/src/generic_walk.jl @@ -67,7 +67,8 @@ function difference_lead_tail(MG::MarkedGroebnerBasis) (G,Lm) = gens(MG), markings(MG) lead_exp = leading_exponent_vector.(Lm) - v = map(zip(lead_exp, exponents.(G))) do (l,T) + l_T = zip(lead_exp, exponents.(G)) + v = map(l_T) do (l,T) Ref(l) .- T end From afcbbeea0acea4a199aa6c4da5f75fde9324b971 Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Fri, 2 Aug 2024 22:29:32 +0200 Subject: [PATCH 149/179] Remove 'using GroebnerWalk' --- examples/implicitization/agk4.jl | 1 - examples/implicitization/newellp1.jl | 1 - examples/implicitization/tran3.3.jl | 1 - examples/knapsack/fukuda_cuww1.jl | 1 - examples/knapsack/fukuda_prob6.jl | 1 - examples/knapsack/goodknap.jl | 1 - examples/knapsack/knap.jl | 1 - examples/knapsack/smallknap.jl | 1 - examples/ku10.jl | 1 - examples/randomQQ.jl | 1 - examples/thesisexamples/chap3.jl | 1 - examples/thesisexamples/chap4.jl | 1 - examples/zero-dimensional/cyclic5.jl | 1 - examples/zero-dimensional/cyclic7.jl | 1 - examples/zero-dimensional/finitefield.jl | 1 - examples/zero-dimensional/katsura5.jl | 1 - 16 files changed, 16 deletions(-) diff --git a/examples/implicitization/agk4.jl b/examples/implicitization/agk4.jl index 41a54c6adf90..cfc243a63788 100644 --- a/examples/implicitization/agk4.jl +++ b/examples/implicitization/agk4.jl @@ -2,7 +2,6 @@ Implicitization of Bezier surface. Example taken from Amrhein, Gloor, Küchlin. "On the walk" (2004) =# using Oscar -using GroebnerWalk R, (x,y,z,u,v) = polynomial_ring(QQ, ["x","y","z","u","v"]) diff --git a/examples/implicitization/newellp1.jl b/examples/implicitization/newellp1.jl index 28820f3fe012..b17783d3c14c 100644 --- a/examples/implicitization/newellp1.jl +++ b/examples/implicitization/newellp1.jl @@ -3,7 +3,6 @@ A 2-dimensional ideal from Tran. "Efficient Groebner walk conversion for implicitization of geometric objects" (2004) =# using Oscar -using GroebnerWalk R, (x,y,z,u,v) = polynomial_ring(QQ, ["x","y","z","u","v"]) diff --git a/examples/implicitization/tran3.3.jl b/examples/implicitization/tran3.3.jl index b7218f90e964..f5dab55b5468 100644 --- a/examples/implicitization/tran3.3.jl +++ b/examples/implicitization/tran3.3.jl @@ -3,7 +3,6 @@ A 1-dimensional ideal (application not given) =# using Oscar -using GroebnerWalk R, (x,y,z) = polynomial_ring(QQ, ["x","y","z"]) I = ideal([16 + 3*x^3+16*x^2*z+14*x^2*y^3, 6+y^3*z+17*x^2*z^2+7*x*y^2*z^2+13*x^3*z^2]) diff --git a/examples/knapsack/fukuda_cuww1.jl b/examples/knapsack/fukuda_cuww1.jl index b6c8a3f763e0..c36928d90d77 100644 --- a/examples/knapsack/fukuda_cuww1.jl +++ b/examples/knapsack/fukuda_cuww1.jl @@ -3,7 +3,6 @@ =# using Oscar -using GroebnerWalk R, (t, x1, x2, x3, x4, x5) = polynomial_ring(QQ, ["t", "x1", "x2", "x3", "x4", "x5"]) f = 12223 * x1 + 12224 * x2 + 36674 * x3 + 61119 * x4 + 85569 * x5 - 89643481 diff --git a/examples/knapsack/fukuda_prob6.jl b/examples/knapsack/fukuda_prob6.jl index 8fad02af77f8..fe65605a33f6 100644 --- a/examples/knapsack/fukuda_prob6.jl +++ b/examples/knapsack/fukuda_prob6.jl @@ -1,5 +1,4 @@ using Oscar -using GroebnerWalk R, (t, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10) = polynomial_ring(QQ, ["t","x1","x2", "x3", "x4", "x5", "x6", "x7", "x8", "x9", "x10" ]) f = 12223*x1 + 12224*x2 +36674*x3+61119*x4+85569*x5 -89643481 diff --git a/examples/knapsack/goodknap.jl b/examples/knapsack/goodknap.jl index 0846f79fa0a3..3ced896ba1fa 100644 --- a/examples/knapsack/goodknap.jl +++ b/examples/knapsack/goodknap.jl @@ -1,7 +1,6 @@ # "custom" integer knapsack problem using Oscar -using GroebnerWalk R, (t, x1, x2, x3, x4, x5) = polynomial_ring(QQ, ["t","x1", "x2", "x3", "x4", "x5"]) diff --git a/examples/knapsack/knap.jl b/examples/knapsack/knap.jl index 55861bce121a..6e1872d250d1 100644 --- a/examples/knapsack/knap.jl +++ b/examples/knapsack/knap.jl @@ -1,5 +1,4 @@ using Oscar -using GroebnerWalk R, (t, x1, x2, x3, x4, x5, x6) = polynomial_ring(QQ, ["t","x1", "x2", "x3", "x4", "x5", "x6"]) diff --git a/examples/knapsack/smallknap.jl b/examples/knapsack/smallknap.jl index 542bf27bd0b5..9de58993e984 100644 --- a/examples/knapsack/smallknap.jl +++ b/examples/knapsack/smallknap.jl @@ -1,7 +1,6 @@ #smallknap using Oscar -using GroebnerWalk R, (t, x1, x2, x3) = polynomial_ring(QQ, ["t","x1", "x2", "x3"]) f1 = x1 - t^5 diff --git a/examples/ku10.jl b/examples/ku10.jl index 29b49d9d040e..33b51b108e36 100644 --- a/examples/ku10.jl +++ b/examples/ku10.jl @@ -1,6 +1,5 @@ #ku using Oscar -using GroebnerWalk R, (x1, x2, x3, x4, x5, x6, x7, x8, x9, x10) = polynomial_ring(QQ, ["x$index" for index in 1:10]) diff --git a/examples/randomQQ.jl b/examples/randomQQ.jl index 580c181bc165..ab907b3b0a89 100644 --- a/examples/randomQQ.jl +++ b/examples/randomQQ.jl @@ -1,6 +1,5 @@ #random polynomial system in 4 variables over Q, computed in M2 using Oscar -using GroebnerWalk R, (a, b, c, d) = polynomial_ring(QQ, ["a", "b", "c", "d"]) diff --git a/examples/thesisexamples/chap3.jl b/examples/thesisexamples/chap3.jl index d3189e4f4870..6535cd3527a9 100644 --- a/examples/thesisexamples/chap3.jl +++ b/examples/thesisexamples/chap3.jl @@ -3,7 +3,6 @@ #Examples from chapter 3 using Oscar -using GroebnerWalk #We perform computations on the same ideal throughout diff --git a/examples/thesisexamples/chap4.jl b/examples/thesisexamples/chap4.jl index c6eb77ec2d2e..bd3a3648aef9 100644 --- a/examples/thesisexamples/chap4.jl +++ b/examples/thesisexamples/chap4.jl @@ -1,5 +1,4 @@ using Oscar -using GroebnerWalk R, (x,y,z) = polynomial_ring(QQ, ["x","y","z"]) I = ideal([6 + 3*x^3+16*x^2*z+14*x^2*y^3, 6+y^3*z+17*x^2*z^2+7*x*y^2*z^2+13*x^3*z^2]) diff --git a/examples/zero-dimensional/cyclic5.jl b/examples/zero-dimensional/cyclic5.jl index f9c72c729fb7..f7ea458eb86d 100644 --- a/examples/zero-dimensional/cyclic5.jl +++ b/examples/zero-dimensional/cyclic5.jl @@ -1,5 +1,4 @@ using Oscar -using GroebnerWalk R, (a, b, c, d, x) = polynomial_ring(QQ, ["a", "b", "c", "d", "x"]) diff --git a/examples/zero-dimensional/cyclic7.jl b/examples/zero-dimensional/cyclic7.jl index ae998cd33997..8f134ec6017f 100644 --- a/examples/zero-dimensional/cyclic7.jl +++ b/examples/zero-dimensional/cyclic7.jl @@ -1,7 +1,6 @@ #cyclic7 using Oscar -using GroebnerWalk R, (z0, z1, z2, z3, z4, z5, z6) = polynomial_ring(QQ, ["z$index" for index in 0:6 ]) I = ideal([ diff --git a/examples/zero-dimensional/finitefield.jl b/examples/zero-dimensional/finitefield.jl index e26f77e3818b..8397dd032a0a 100644 --- a/examples/zero-dimensional/finitefield.jl +++ b/examples/zero-dimensional/finitefield.jl @@ -2,7 +2,6 @@ Example over finite field, from `Groebner.jl` docstring line 1232 =# using Oscar -using GroebnerWalk R, (x1, x2, x3, x4) = polynomial_ring(GF(32003), ["x1", "x2", "x3", "x4"]) J = ideal(R, [ diff --git a/examples/zero-dimensional/katsura5.jl b/examples/zero-dimensional/katsura5.jl index 3f429806b1b5..f5e9b31847f3 100644 --- a/examples/zero-dimensional/katsura5.jl +++ b/examples/zero-dimensional/katsura5.jl @@ -1,6 +1,5 @@ using Oscar -using GroebnerWalk R, (x,y,z,t,u,v) = QQ[:x,:y,:z,:t,:u,:v] From a6281213bb5f9bdb509a70587fedfcdcafa3f9ed Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Fri, 2 Aug 2024 22:29:32 +0200 Subject: [PATCH 150/179] Remove 'using GroebnerWalk' --- experimental/GroebnerWalk/examples/implicitization/agk4.jl | 1 - experimental/GroebnerWalk/examples/implicitization/newellp1.jl | 1 - experimental/GroebnerWalk/examples/implicitization/tran3.3.jl | 1 - experimental/GroebnerWalk/examples/knapsack/fukuda_cuww1.jl | 1 - experimental/GroebnerWalk/examples/knapsack/fukuda_prob6.jl | 1 - experimental/GroebnerWalk/examples/knapsack/goodknap.jl | 1 - experimental/GroebnerWalk/examples/knapsack/knap.jl | 1 - experimental/GroebnerWalk/examples/knapsack/smallknap.jl | 1 - experimental/GroebnerWalk/examples/ku10.jl | 1 - experimental/GroebnerWalk/examples/randomQQ.jl | 1 - experimental/GroebnerWalk/examples/thesisexamples/chap3.jl | 1 - experimental/GroebnerWalk/examples/thesisexamples/chap4.jl | 1 - experimental/GroebnerWalk/examples/zero-dimensional/cyclic5.jl | 1 - experimental/GroebnerWalk/examples/zero-dimensional/cyclic7.jl | 1 - .../GroebnerWalk/examples/zero-dimensional/finitefield.jl | 1 - experimental/GroebnerWalk/examples/zero-dimensional/katsura5.jl | 1 - 16 files changed, 16 deletions(-) diff --git a/experimental/GroebnerWalk/examples/implicitization/agk4.jl b/experimental/GroebnerWalk/examples/implicitization/agk4.jl index 41a54c6adf90..cfc243a63788 100644 --- a/experimental/GroebnerWalk/examples/implicitization/agk4.jl +++ b/experimental/GroebnerWalk/examples/implicitization/agk4.jl @@ -2,7 +2,6 @@ Implicitization of Bezier surface. Example taken from Amrhein, Gloor, Küchlin. "On the walk" (2004) =# using Oscar -using GroebnerWalk R, (x,y,z,u,v) = polynomial_ring(QQ, ["x","y","z","u","v"]) diff --git a/experimental/GroebnerWalk/examples/implicitization/newellp1.jl b/experimental/GroebnerWalk/examples/implicitization/newellp1.jl index 28820f3fe012..b17783d3c14c 100644 --- a/experimental/GroebnerWalk/examples/implicitization/newellp1.jl +++ b/experimental/GroebnerWalk/examples/implicitization/newellp1.jl @@ -3,7 +3,6 @@ A 2-dimensional ideal from Tran. "Efficient Groebner walk conversion for implicitization of geometric objects" (2004) =# using Oscar -using GroebnerWalk R, (x,y,z,u,v) = polynomial_ring(QQ, ["x","y","z","u","v"]) diff --git a/experimental/GroebnerWalk/examples/implicitization/tran3.3.jl b/experimental/GroebnerWalk/examples/implicitization/tran3.3.jl index b7218f90e964..f5dab55b5468 100644 --- a/experimental/GroebnerWalk/examples/implicitization/tran3.3.jl +++ b/experimental/GroebnerWalk/examples/implicitization/tran3.3.jl @@ -3,7 +3,6 @@ A 1-dimensional ideal (application not given) =# using Oscar -using GroebnerWalk R, (x,y,z) = polynomial_ring(QQ, ["x","y","z"]) I = ideal([16 + 3*x^3+16*x^2*z+14*x^2*y^3, 6+y^3*z+17*x^2*z^2+7*x*y^2*z^2+13*x^3*z^2]) diff --git a/experimental/GroebnerWalk/examples/knapsack/fukuda_cuww1.jl b/experimental/GroebnerWalk/examples/knapsack/fukuda_cuww1.jl index b6c8a3f763e0..c36928d90d77 100644 --- a/experimental/GroebnerWalk/examples/knapsack/fukuda_cuww1.jl +++ b/experimental/GroebnerWalk/examples/knapsack/fukuda_cuww1.jl @@ -3,7 +3,6 @@ =# using Oscar -using GroebnerWalk R, (t, x1, x2, x3, x4, x5) = polynomial_ring(QQ, ["t", "x1", "x2", "x3", "x4", "x5"]) f = 12223 * x1 + 12224 * x2 + 36674 * x3 + 61119 * x4 + 85569 * x5 - 89643481 diff --git a/experimental/GroebnerWalk/examples/knapsack/fukuda_prob6.jl b/experimental/GroebnerWalk/examples/knapsack/fukuda_prob6.jl index 8fad02af77f8..fe65605a33f6 100644 --- a/experimental/GroebnerWalk/examples/knapsack/fukuda_prob6.jl +++ b/experimental/GroebnerWalk/examples/knapsack/fukuda_prob6.jl @@ -1,5 +1,4 @@ using Oscar -using GroebnerWalk R, (t, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10) = polynomial_ring(QQ, ["t","x1","x2", "x3", "x4", "x5", "x6", "x7", "x8", "x9", "x10" ]) f = 12223*x1 + 12224*x2 +36674*x3+61119*x4+85569*x5 -89643481 diff --git a/experimental/GroebnerWalk/examples/knapsack/goodknap.jl b/experimental/GroebnerWalk/examples/knapsack/goodknap.jl index 0846f79fa0a3..3ced896ba1fa 100644 --- a/experimental/GroebnerWalk/examples/knapsack/goodknap.jl +++ b/experimental/GroebnerWalk/examples/knapsack/goodknap.jl @@ -1,7 +1,6 @@ # "custom" integer knapsack problem using Oscar -using GroebnerWalk R, (t, x1, x2, x3, x4, x5) = polynomial_ring(QQ, ["t","x1", "x2", "x3", "x4", "x5"]) diff --git a/experimental/GroebnerWalk/examples/knapsack/knap.jl b/experimental/GroebnerWalk/examples/knapsack/knap.jl index 55861bce121a..6e1872d250d1 100644 --- a/experimental/GroebnerWalk/examples/knapsack/knap.jl +++ b/experimental/GroebnerWalk/examples/knapsack/knap.jl @@ -1,5 +1,4 @@ using Oscar -using GroebnerWalk R, (t, x1, x2, x3, x4, x5, x6) = polynomial_ring(QQ, ["t","x1", "x2", "x3", "x4", "x5", "x6"]) diff --git a/experimental/GroebnerWalk/examples/knapsack/smallknap.jl b/experimental/GroebnerWalk/examples/knapsack/smallknap.jl index 542bf27bd0b5..9de58993e984 100644 --- a/experimental/GroebnerWalk/examples/knapsack/smallknap.jl +++ b/experimental/GroebnerWalk/examples/knapsack/smallknap.jl @@ -1,7 +1,6 @@ #smallknap using Oscar -using GroebnerWalk R, (t, x1, x2, x3) = polynomial_ring(QQ, ["t","x1", "x2", "x3"]) f1 = x1 - t^5 diff --git a/experimental/GroebnerWalk/examples/ku10.jl b/experimental/GroebnerWalk/examples/ku10.jl index 29b49d9d040e..33b51b108e36 100644 --- a/experimental/GroebnerWalk/examples/ku10.jl +++ b/experimental/GroebnerWalk/examples/ku10.jl @@ -1,6 +1,5 @@ #ku using Oscar -using GroebnerWalk R, (x1, x2, x3, x4, x5, x6, x7, x8, x9, x10) = polynomial_ring(QQ, ["x$index" for index in 1:10]) diff --git a/experimental/GroebnerWalk/examples/randomQQ.jl b/experimental/GroebnerWalk/examples/randomQQ.jl index 580c181bc165..ab907b3b0a89 100644 --- a/experimental/GroebnerWalk/examples/randomQQ.jl +++ b/experimental/GroebnerWalk/examples/randomQQ.jl @@ -1,6 +1,5 @@ #random polynomial system in 4 variables over Q, computed in M2 using Oscar -using GroebnerWalk R, (a, b, c, d) = polynomial_ring(QQ, ["a", "b", "c", "d"]) diff --git a/experimental/GroebnerWalk/examples/thesisexamples/chap3.jl b/experimental/GroebnerWalk/examples/thesisexamples/chap3.jl index d3189e4f4870..6535cd3527a9 100644 --- a/experimental/GroebnerWalk/examples/thesisexamples/chap3.jl +++ b/experimental/GroebnerWalk/examples/thesisexamples/chap3.jl @@ -3,7 +3,6 @@ #Examples from chapter 3 using Oscar -using GroebnerWalk #We perform computations on the same ideal throughout diff --git a/experimental/GroebnerWalk/examples/thesisexamples/chap4.jl b/experimental/GroebnerWalk/examples/thesisexamples/chap4.jl index c6eb77ec2d2e..bd3a3648aef9 100644 --- a/experimental/GroebnerWalk/examples/thesisexamples/chap4.jl +++ b/experimental/GroebnerWalk/examples/thesisexamples/chap4.jl @@ -1,5 +1,4 @@ using Oscar -using GroebnerWalk R, (x,y,z) = polynomial_ring(QQ, ["x","y","z"]) I = ideal([6 + 3*x^3+16*x^2*z+14*x^2*y^3, 6+y^3*z+17*x^2*z^2+7*x*y^2*z^2+13*x^3*z^2]) diff --git a/experimental/GroebnerWalk/examples/zero-dimensional/cyclic5.jl b/experimental/GroebnerWalk/examples/zero-dimensional/cyclic5.jl index f9c72c729fb7..f7ea458eb86d 100644 --- a/experimental/GroebnerWalk/examples/zero-dimensional/cyclic5.jl +++ b/experimental/GroebnerWalk/examples/zero-dimensional/cyclic5.jl @@ -1,5 +1,4 @@ using Oscar -using GroebnerWalk R, (a, b, c, d, x) = polynomial_ring(QQ, ["a", "b", "c", "d", "x"]) diff --git a/experimental/GroebnerWalk/examples/zero-dimensional/cyclic7.jl b/experimental/GroebnerWalk/examples/zero-dimensional/cyclic7.jl index ae998cd33997..8f134ec6017f 100644 --- a/experimental/GroebnerWalk/examples/zero-dimensional/cyclic7.jl +++ b/experimental/GroebnerWalk/examples/zero-dimensional/cyclic7.jl @@ -1,7 +1,6 @@ #cyclic7 using Oscar -using GroebnerWalk R, (z0, z1, z2, z3, z4, z5, z6) = polynomial_ring(QQ, ["z$index" for index in 0:6 ]) I = ideal([ diff --git a/experimental/GroebnerWalk/examples/zero-dimensional/finitefield.jl b/experimental/GroebnerWalk/examples/zero-dimensional/finitefield.jl index e26f77e3818b..8397dd032a0a 100644 --- a/experimental/GroebnerWalk/examples/zero-dimensional/finitefield.jl +++ b/experimental/GroebnerWalk/examples/zero-dimensional/finitefield.jl @@ -2,7 +2,6 @@ Example over finite field, from `Groebner.jl` docstring line 1232 =# using Oscar -using GroebnerWalk R, (x1, x2, x3, x4) = polynomial_ring(GF(32003), ["x1", "x2", "x3", "x4"]) J = ideal(R, [ diff --git a/experimental/GroebnerWalk/examples/zero-dimensional/katsura5.jl b/experimental/GroebnerWalk/examples/zero-dimensional/katsura5.jl index 3f429806b1b5..f5e9b31847f3 100644 --- a/experimental/GroebnerWalk/examples/zero-dimensional/katsura5.jl +++ b/experimental/GroebnerWalk/examples/zero-dimensional/katsura5.jl @@ -1,6 +1,5 @@ using Oscar -using GroebnerWalk R, (x,y,z,t,u,v) = QQ[:x,:y,:z,:t,:u,:v] From 112be07e795a9eafeac674ceab9ec083099d2981 Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Fri, 2 Aug 2024 22:35:28 +0200 Subject: [PATCH 151/179] Add tests for generic_walk --- test/generic_walk.jl | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 test/generic_walk.jl diff --git a/test/generic_walk.jl b/test/generic_walk.jl new file mode 100644 index 000000000000..f793d04f03ea --- /dev/null +++ b/test/generic_walk.jl @@ -0,0 +1,27 @@ +@testset "GenericWalk" begin + R1, (x,y,z) = polynomial_ring(QQ, ["x", "y", "z"]) + + I1 = ideal([x^2 + y*z, x*y + z^2]) + G1 = groebner_basis(I1) + + I2 = ideal([z^3 - z^2 - 4]) + G2 = groebner_basis(I2) + + I3 = ideal([x^6 - 1]) + G3 = groebner_basis(I3) + + GW1 = groebner_walk(I1; algorithm=:generic) + @test is_groebner_basis(GW1; ordering=lex(R1)) + #@test bounding_vectors(G1) == Vector{ZZRingElem}.([[1,1,-2],[2,-1,-1], [-1,2,-1]]) + #@test next_weight(G1, ZZ.([1,1,1]), ZZ.([1,0,0])) == ZZ.([1,1,1]) + + GW2 = groebner_walk(I2; algorithm=:generic) + @test is_groebner_basis(GW2; ordering=lex(R1)) + #@test bounding_vectors(G2) == ZZ.([[0,0,1],[0,0,3]]) + + GW3 = groebner_walk(I3; algorithm=:generic) + @test is_groebner_basis(GW3; ordering=lex(R1)) + #@test bounding_vectors(G3) == ZZ.([[6,0,0]]) + #@test next_weight(G3, ZZ.([1,1,1]), ZZ.([1,0,0])) == ZZ.([1,0,0]) +end + From f5a55581b2ba7917344567b0bcbe31305fef79e7 Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Fri, 2 Aug 2024 22:35:28 +0200 Subject: [PATCH 152/179] Add tests for generic_walk --- .../GroebnerWalk/test/generic_walk.jl | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 experimental/GroebnerWalk/test/generic_walk.jl diff --git a/experimental/GroebnerWalk/test/generic_walk.jl b/experimental/GroebnerWalk/test/generic_walk.jl new file mode 100644 index 000000000000..f793d04f03ea --- /dev/null +++ b/experimental/GroebnerWalk/test/generic_walk.jl @@ -0,0 +1,27 @@ +@testset "GenericWalk" begin + R1, (x,y,z) = polynomial_ring(QQ, ["x", "y", "z"]) + + I1 = ideal([x^2 + y*z, x*y + z^2]) + G1 = groebner_basis(I1) + + I2 = ideal([z^3 - z^2 - 4]) + G2 = groebner_basis(I2) + + I3 = ideal([x^6 - 1]) + G3 = groebner_basis(I3) + + GW1 = groebner_walk(I1; algorithm=:generic) + @test is_groebner_basis(GW1; ordering=lex(R1)) + #@test bounding_vectors(G1) == Vector{ZZRingElem}.([[1,1,-2],[2,-1,-1], [-1,2,-1]]) + #@test next_weight(G1, ZZ.([1,1,1]), ZZ.([1,0,0])) == ZZ.([1,1,1]) + + GW2 = groebner_walk(I2; algorithm=:generic) + @test is_groebner_basis(GW2; ordering=lex(R1)) + #@test bounding_vectors(G2) == ZZ.([[0,0,1],[0,0,3]]) + + GW3 = groebner_walk(I3; algorithm=:generic) + @test is_groebner_basis(GW3; ordering=lex(R1)) + #@test bounding_vectors(G3) == ZZ.([[6,0,0]]) + #@test next_weight(G3, ZZ.([1,1,1]), ZZ.([1,0,0])) == ZZ.([1,0,0]) +end + From 777e6d816170057d396fc2ec05a195e229b5b690 Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Fri, 2 Aug 2024 22:47:25 +0200 Subject: [PATCH 153/179] Modify benchmarks --- benchmark/agk.jl | 17 +++++++++ benchmark/benchmarks.jl | 68 +++++++++++++++++++++++++++++++++++ benchmark/cyclic.jl | 78 +++++++++++++++++++++++++++++++++++++++++ benchmark/newellp1.jl | 1 - benchmark/tran3.3.jl | 3 +- 5 files changed, 164 insertions(+), 3 deletions(-) diff --git a/benchmark/agk.jl b/benchmark/agk.jl index e69de29bb2d1..61d9c2a5dc99 100644 --- a/benchmark/agk.jl +++ b/benchmark/agk.jl @@ -0,0 +1,17 @@ +using Oscar + +function agk4(k::Field) + R, (x,y,z,u,v) = polynomial_ring(k, ["x","y","z","u","v"]) + + o1 = weight_ordering([1,1,1,0,0], degrevlex(R)) + o2 = weight_ordering([0,0,0,1,1], degrevlex(R)) + + F = [ + u + u^2 - 2*v - 2*u^2*v + 2*u*v^2 - x, + -6*u + 2*v + v^2 - 5*v^3 + 2*u*v^2 - 4*u^2*v^2 - y, + -2 + 2*u^2 + 6*v - 3*u^2*v^2 - z + ] + + return ideal(F), o2, o1 +end + diff --git a/benchmark/benchmarks.jl b/benchmark/benchmarks.jl index e69de29bb2d1..f1f2d87faa26 100644 --- a/benchmark/benchmarks.jl +++ b/benchmark/benchmarks.jl @@ -0,0 +1,68 @@ +using Oscar +using GroebnerWalk +using BenchmarkTools + +include("cyclic.jl") +include("katsura.jl") +include("agk.jl") +include("tran3.3.jl") +include("newellp1.jl") + +function benchmark( + io, + name::String, + I::Ideal, + target::MonomialOrdering, + start::MonomialOrdering +) + print(io, name, ","); flush(io) + t = @belapsed groebner_walk($I, $target, $start; algorithm=:standard) seconds=20000 samples=10 + print(io, t, ","); flush(io) + t = @belapsed groebner_walk($I, $target, $start; algorithm=:generic) seconds=20000 samples=10 + print(io, t, ","); flush(io) + t = @belapsed groebner_walk($I, $target, $start; algorithm=:perturbed) seconds=20000 samples=10 + print(io, t, ","); flush(io) + t = @belapsed groebner_basis($I; ordering=$target) seconds=20000 samples=10 + println(io, t); flush(io) +end + +function print_header(io) + print(io, "name,standard_walk,generic_walk,perturbed_walk,buchberger\n") +end + +p = 11863279 +Fp = GF(p) +open("results.csv", "a") do io + R, (x, y) = QQ[:x, :y] + I = ideal([y^4 + x^3 - x^2 + x, x^4]) + benchmark(io, "simple", I, lex(R), default_ordering(R)) + + benchmark(io, "cyclic5-QQ", cyclic5(QQ)...) + benchmark(io, "cyclic5-Fp", cyclic5(Fp)...) + + benchmark(io, "cyclic6-QQ", cyclic6(QQ)...) + benchmark(io, "cyclic6-Fp", cyclic6(Fp)...) + + I = katsura(6) + R = base_ring(I) + benchmark(io, "katsura6-QQ", I, lex(R), default_ordering(R)) + + Ip = map(gens(I)) do f + change_coefficient_ring(Fp, f) + end |> ideal + Rp = base_ring(Ip) + benchmark(io, "katsura6-Fp", Ip, lex(Rp), default_ordering(Rp)) + + benchmark(io, "cyclic7-QQ", cyclic7(QQ)...) + benchmark(io, "cyclic7-Fp", cyclic7(Fp)...) + + benchmark(io, "agk4-QQ", agk4(QQ)...) + benchmark(io, "agk4-Fp", agk4(Fp)...) + + benchmark(io, "tran3.3-QQ", tran33(QQ)...) + benchmark(io, "tran3.3-Fp", tran33(Fp)...) + + benchmark(io, "newellp1-QQ", newellp1(QQ)...) + benchmark(io, "newellp1-Fp", newellp1(Fp)...) +end + diff --git a/benchmark/cyclic.jl b/benchmark/cyclic.jl index e69de29bb2d1..fd838a204019 100644 --- a/benchmark/cyclic.jl +++ b/benchmark/cyclic.jl @@ -0,0 +1,78 @@ +using Oscar + +function cyclic5(k::Field=QQ) + R, (a,b,c,d,x) = k[:a,:b,:c,:d,:x] + F = [ + a + b + c + d + x, + a*b + b*c + c*d + d*x + x*a, + a*b*c + b*c*d + c*d*x + d*x*a + x*a*b, + a*b*c*d + b*c*d*x + c*d*x*a + d*x*a*b + x*a*b*c, + a*b*c*d*x - 1 + ] + + return ideal(F), lex(R), default_ordering(R) +end + +function cyclic6(k::Field=QQ) + R, (z0,z1,z2,z3,z4,z5) = k[:z0,:z1,:z2,:z3,:z4,:z5] + F = [ + z0 + z1 + z2 + z3 + z4 + z5, + z0*z1 + z1*z2 + z2*z3 + z3*z4 + z4*z5 + z5*z0, + z0*z1*z2 + z1*z2*z3 + z2*z3*z4 + z3*z4*z5 + z4*z5*z0 + z5*z0*z1, + z0*z1*z2*z3 + z1*z2*z3*z4 + z2*z3*z4*z5 + z3*z4*z5*z0 + z4*z5*z0*z1 + + z5*z0*z1*z2, + z0*z1*z2*z3*z4 + z1*z2*z3*z4*z5 + z2*z3*z4*z5*z0 + z3*z4*z5*z0*z1 + + z4*z5*z0*z1*z2 + z5*z0*z1*z2*z3, + z0*z1*z2*z3*z4*z5 - 1 + ] + + return ideal(F), lex(R), default_ordering(R) +end + +function cyclic7(k::Field=QQ) + R, (z0, z1, z2, z3, z4, z5, z6) = QQ[:z0, :z1, :z2, :z3, :z4, :z5, :z6] + F = [ + z0 + z1 + z2 + z3 + z4 + z5 + z6, + z0 * z1 + z1 * z2 + z2 * z3 + z3 * z4 + z4 * z5 + z5 * z6 + z6 * z0, + z0 * z1 * z2 + z1 * z2 * z3 + z2 * z3 * z4 + z3 * z4 * z5 + z4 * z5 * z6 + z5 * z6 * z0 + z6 * z0 * z1, + z0 * z1 * z2 * z3 + z1 * z2 * z3 * z4 + z2 * z3 * z4 * z5 + z3 * z4 * z5 * z6 + z4 * z5 * z6 * z0 + + z5 * z6 * z0 * z1 + z6 * z0 * z1 * z2, + z0 * z1 * z2 * z3 * z4 + z1 * z2 * z3 * z4 * z5 + z2 * z3 * z4 * z5 * z6 + z3 * z4 * z5 * z6 * z0 + + z4 * z5 * z6 * z0 * z1 + z5 * z6 * z0 * z1 * z2 + z6 * z0 * z1 * z2 * z3, + z0 * z1 * z2 * z3 * z4 * z5 + z1 * z2 * z3 * z4 * z5 * z6 + z2 * z3 * z4 * z5 * z6 * z0 + z3 * z4 * z5 * z6 * z0 * z1 + + z4 * z5 * z6 * z0 * z1 * z2 + z5 * z6 * z0 * z1 * z2 * z3 + z6 * z0 * z1 * z2 * z3 * z4, + z0 * z1 * z2 * z3 * z4 * z5 * z6 - 1 + ] + + return ideal(F), lex(R), default_ordering(R) +end + +function cyclic8(k::Field=QQ) + R, (z0, z1, z2, z3, z4, z5, z6, z7) = k[:z0, :z1, :z2, :z3, :z4, :z5, :z6, :z7] + + F = [ + z0 + z1 + z2 + z3 + z4 + z5 + z6 + z7, + + z0*z1 + z1*z2 + z2*z3 + z3*z4 + z4*z5 + z5*z6 + z6*z7 + z7*z0, + + z0*z1*z2 + z1*z2*z3 + z2*z3*z4 + z3*z4*z5 + z4*z5*z6 + z5*z6*z7 + + z6*z7*z0 + z7*z0*z1, + + z0*z1*z2*z3 + z1*z2*z3*z4 + z2*z3*z4*z5 + z3*z4*z5*z6 + z4*z5*z6*z7 + + z5*z6*z7*z0 + z6*z7*z0*z1 + z7*z0*z1*z2, + + z0*z1*z2*z3*z4 + z1*z2*z3*z4*z5 + z2*z3*z4*z5*z6 + z3*z4*z5*z6*z7 + + z4*z5*z6*z7*z0 + z5*z6*z7*z0*z1 + z6*z7*z0*z1*z2 + z7*z0*z1*z2*z3, + + z0*z1*z2*z3*z4*z5 + z1*z2*z3*z4*z5*z6 + z2*z3*z4*z5*z6*z7 + z3*z4*z5*z6*z7*z0 + + z4*z5*z6*z7*z0*z1 + z5*z6*z7*z0*z1*z2 + z6*z7*z0*z1*z2*z3 + z7*z0*z1*z2*z3*z4, + + z0*z1*z2*z3*z4*z5*z6 + z1*z2*z3*z4*z5*z6*z7 + z2*z3*z4*z5*z6*z7*z0 + + z3*z4*z5*z6*z7*z0*z1 + z4*z5*z6*z7*z0*z1*z2 + z5*z6*z7*z0*z1*z2*z3 + + z6*z7*z0*z1*z2*z3*z4 + z7*z0*z1*z2*z3*z4*z5, + + z0*z1*z2*z3*z4*z5*z6*z7 - 1 + ] + + return ideal(F), lex(R), default_ordering(R) +end diff --git a/benchmark/newellp1.jl b/benchmark/newellp1.jl index 4fd8945403ea..5aebd84cfe79 100644 --- a/benchmark/newellp1.jl +++ b/benchmark/newellp1.jl @@ -32,4 +32,3 @@ function newellp1(k::Field) o2 = matrix_ordering(R, [0 0 0 1 1; 1 1 1 0 0; 1 1 0 0 0; 1 0 0 0 0; 0 0 0 1 0]) return ideal(integral_F), o2, o1 end - diff --git a/benchmark/tran3.3.jl b/benchmark/tran3.3.jl index 565a108a482a..e31d482f9b26 100644 --- a/benchmark/tran3.3.jl +++ b/benchmark/tran3.3.jl @@ -6,5 +6,4 @@ function tran33(k::Field) F = [16 + 3*x^3+16*x^2*z+14*x^2*y^3, 6+y^3*z+17*x^2*z^2+7*x*y^2*z^2+13*x^3*z^2] return ideal(F), lex(R), default_ordering(R) -end - +end \ No newline at end of file From d18672f16dbfe065c0bbef5a808f24351510847d Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Fri, 2 Aug 2024 22:47:25 +0200 Subject: [PATCH 154/179] Modify benchmarks --- experimental/GroebnerWalk/benchmark/agk.jl | 17 ++++ .../GroebnerWalk/benchmark/benchmarks.jl | 68 ++++++++++++++++ experimental/GroebnerWalk/benchmark/cyclic.jl | 78 +++++++++++++++++++ .../GroebnerWalk/benchmark/newellp1.jl | 1 - .../GroebnerWalk/benchmark/tran3.3.jl | 3 +- 5 files changed, 164 insertions(+), 3 deletions(-) diff --git a/experimental/GroebnerWalk/benchmark/agk.jl b/experimental/GroebnerWalk/benchmark/agk.jl index e69de29bb2d1..61d9c2a5dc99 100644 --- a/experimental/GroebnerWalk/benchmark/agk.jl +++ b/experimental/GroebnerWalk/benchmark/agk.jl @@ -0,0 +1,17 @@ +using Oscar + +function agk4(k::Field) + R, (x,y,z,u,v) = polynomial_ring(k, ["x","y","z","u","v"]) + + o1 = weight_ordering([1,1,1,0,0], degrevlex(R)) + o2 = weight_ordering([0,0,0,1,1], degrevlex(R)) + + F = [ + u + u^2 - 2*v - 2*u^2*v + 2*u*v^2 - x, + -6*u + 2*v + v^2 - 5*v^3 + 2*u*v^2 - 4*u^2*v^2 - y, + -2 + 2*u^2 + 6*v - 3*u^2*v^2 - z + ] + + return ideal(F), o2, o1 +end + diff --git a/experimental/GroebnerWalk/benchmark/benchmarks.jl b/experimental/GroebnerWalk/benchmark/benchmarks.jl index e69de29bb2d1..f1f2d87faa26 100644 --- a/experimental/GroebnerWalk/benchmark/benchmarks.jl +++ b/experimental/GroebnerWalk/benchmark/benchmarks.jl @@ -0,0 +1,68 @@ +using Oscar +using GroebnerWalk +using BenchmarkTools + +include("cyclic.jl") +include("katsura.jl") +include("agk.jl") +include("tran3.3.jl") +include("newellp1.jl") + +function benchmark( + io, + name::String, + I::Ideal, + target::MonomialOrdering, + start::MonomialOrdering +) + print(io, name, ","); flush(io) + t = @belapsed groebner_walk($I, $target, $start; algorithm=:standard) seconds=20000 samples=10 + print(io, t, ","); flush(io) + t = @belapsed groebner_walk($I, $target, $start; algorithm=:generic) seconds=20000 samples=10 + print(io, t, ","); flush(io) + t = @belapsed groebner_walk($I, $target, $start; algorithm=:perturbed) seconds=20000 samples=10 + print(io, t, ","); flush(io) + t = @belapsed groebner_basis($I; ordering=$target) seconds=20000 samples=10 + println(io, t); flush(io) +end + +function print_header(io) + print(io, "name,standard_walk,generic_walk,perturbed_walk,buchberger\n") +end + +p = 11863279 +Fp = GF(p) +open("results.csv", "a") do io + R, (x, y) = QQ[:x, :y] + I = ideal([y^4 + x^3 - x^2 + x, x^4]) + benchmark(io, "simple", I, lex(R), default_ordering(R)) + + benchmark(io, "cyclic5-QQ", cyclic5(QQ)...) + benchmark(io, "cyclic5-Fp", cyclic5(Fp)...) + + benchmark(io, "cyclic6-QQ", cyclic6(QQ)...) + benchmark(io, "cyclic6-Fp", cyclic6(Fp)...) + + I = katsura(6) + R = base_ring(I) + benchmark(io, "katsura6-QQ", I, lex(R), default_ordering(R)) + + Ip = map(gens(I)) do f + change_coefficient_ring(Fp, f) + end |> ideal + Rp = base_ring(Ip) + benchmark(io, "katsura6-Fp", Ip, lex(Rp), default_ordering(Rp)) + + benchmark(io, "cyclic7-QQ", cyclic7(QQ)...) + benchmark(io, "cyclic7-Fp", cyclic7(Fp)...) + + benchmark(io, "agk4-QQ", agk4(QQ)...) + benchmark(io, "agk4-Fp", agk4(Fp)...) + + benchmark(io, "tran3.3-QQ", tran33(QQ)...) + benchmark(io, "tran3.3-Fp", tran33(Fp)...) + + benchmark(io, "newellp1-QQ", newellp1(QQ)...) + benchmark(io, "newellp1-Fp", newellp1(Fp)...) +end + diff --git a/experimental/GroebnerWalk/benchmark/cyclic.jl b/experimental/GroebnerWalk/benchmark/cyclic.jl index e69de29bb2d1..fd838a204019 100644 --- a/experimental/GroebnerWalk/benchmark/cyclic.jl +++ b/experimental/GroebnerWalk/benchmark/cyclic.jl @@ -0,0 +1,78 @@ +using Oscar + +function cyclic5(k::Field=QQ) + R, (a,b,c,d,x) = k[:a,:b,:c,:d,:x] + F = [ + a + b + c + d + x, + a*b + b*c + c*d + d*x + x*a, + a*b*c + b*c*d + c*d*x + d*x*a + x*a*b, + a*b*c*d + b*c*d*x + c*d*x*a + d*x*a*b + x*a*b*c, + a*b*c*d*x - 1 + ] + + return ideal(F), lex(R), default_ordering(R) +end + +function cyclic6(k::Field=QQ) + R, (z0,z1,z2,z3,z4,z5) = k[:z0,:z1,:z2,:z3,:z4,:z5] + F = [ + z0 + z1 + z2 + z3 + z4 + z5, + z0*z1 + z1*z2 + z2*z3 + z3*z4 + z4*z5 + z5*z0, + z0*z1*z2 + z1*z2*z3 + z2*z3*z4 + z3*z4*z5 + z4*z5*z0 + z5*z0*z1, + z0*z1*z2*z3 + z1*z2*z3*z4 + z2*z3*z4*z5 + z3*z4*z5*z0 + z4*z5*z0*z1 + + z5*z0*z1*z2, + z0*z1*z2*z3*z4 + z1*z2*z3*z4*z5 + z2*z3*z4*z5*z0 + z3*z4*z5*z0*z1 + + z4*z5*z0*z1*z2 + z5*z0*z1*z2*z3, + z0*z1*z2*z3*z4*z5 - 1 + ] + + return ideal(F), lex(R), default_ordering(R) +end + +function cyclic7(k::Field=QQ) + R, (z0, z1, z2, z3, z4, z5, z6) = QQ[:z0, :z1, :z2, :z3, :z4, :z5, :z6] + F = [ + z0 + z1 + z2 + z3 + z4 + z5 + z6, + z0 * z1 + z1 * z2 + z2 * z3 + z3 * z4 + z4 * z5 + z5 * z6 + z6 * z0, + z0 * z1 * z2 + z1 * z2 * z3 + z2 * z3 * z4 + z3 * z4 * z5 + z4 * z5 * z6 + z5 * z6 * z0 + z6 * z0 * z1, + z0 * z1 * z2 * z3 + z1 * z2 * z3 * z4 + z2 * z3 * z4 * z5 + z3 * z4 * z5 * z6 + z4 * z5 * z6 * z0 + + z5 * z6 * z0 * z1 + z6 * z0 * z1 * z2, + z0 * z1 * z2 * z3 * z4 + z1 * z2 * z3 * z4 * z5 + z2 * z3 * z4 * z5 * z6 + z3 * z4 * z5 * z6 * z0 + + z4 * z5 * z6 * z0 * z1 + z5 * z6 * z0 * z1 * z2 + z6 * z0 * z1 * z2 * z3, + z0 * z1 * z2 * z3 * z4 * z5 + z1 * z2 * z3 * z4 * z5 * z6 + z2 * z3 * z4 * z5 * z6 * z0 + z3 * z4 * z5 * z6 * z0 * z1 + + z4 * z5 * z6 * z0 * z1 * z2 + z5 * z6 * z0 * z1 * z2 * z3 + z6 * z0 * z1 * z2 * z3 * z4, + z0 * z1 * z2 * z3 * z4 * z5 * z6 - 1 + ] + + return ideal(F), lex(R), default_ordering(R) +end + +function cyclic8(k::Field=QQ) + R, (z0, z1, z2, z3, z4, z5, z6, z7) = k[:z0, :z1, :z2, :z3, :z4, :z5, :z6, :z7] + + F = [ + z0 + z1 + z2 + z3 + z4 + z5 + z6 + z7, + + z0*z1 + z1*z2 + z2*z3 + z3*z4 + z4*z5 + z5*z6 + z6*z7 + z7*z0, + + z0*z1*z2 + z1*z2*z3 + z2*z3*z4 + z3*z4*z5 + z4*z5*z6 + z5*z6*z7 + + z6*z7*z0 + z7*z0*z1, + + z0*z1*z2*z3 + z1*z2*z3*z4 + z2*z3*z4*z5 + z3*z4*z5*z6 + z4*z5*z6*z7 + + z5*z6*z7*z0 + z6*z7*z0*z1 + z7*z0*z1*z2, + + z0*z1*z2*z3*z4 + z1*z2*z3*z4*z5 + z2*z3*z4*z5*z6 + z3*z4*z5*z6*z7 + + z4*z5*z6*z7*z0 + z5*z6*z7*z0*z1 + z6*z7*z0*z1*z2 + z7*z0*z1*z2*z3, + + z0*z1*z2*z3*z4*z5 + z1*z2*z3*z4*z5*z6 + z2*z3*z4*z5*z6*z7 + z3*z4*z5*z6*z7*z0 + + z4*z5*z6*z7*z0*z1 + z5*z6*z7*z0*z1*z2 + z6*z7*z0*z1*z2*z3 + z7*z0*z1*z2*z3*z4, + + z0*z1*z2*z3*z4*z5*z6 + z1*z2*z3*z4*z5*z6*z7 + z2*z3*z4*z5*z6*z7*z0 + + z3*z4*z5*z6*z7*z0*z1 + z4*z5*z6*z7*z0*z1*z2 + z5*z6*z7*z0*z1*z2*z3 + + z6*z7*z0*z1*z2*z3*z4 + z7*z0*z1*z2*z3*z4*z5, + + z0*z1*z2*z3*z4*z5*z6*z7 - 1 + ] + + return ideal(F), lex(R), default_ordering(R) +end diff --git a/experimental/GroebnerWalk/benchmark/newellp1.jl b/experimental/GroebnerWalk/benchmark/newellp1.jl index 4fd8945403ea..5aebd84cfe79 100644 --- a/experimental/GroebnerWalk/benchmark/newellp1.jl +++ b/experimental/GroebnerWalk/benchmark/newellp1.jl @@ -32,4 +32,3 @@ function newellp1(k::Field) o2 = matrix_ordering(R, [0 0 0 1 1; 1 1 1 0 0; 1 1 0 0 0; 1 0 0 0 0; 0 0 0 1 0]) return ideal(integral_F), o2, o1 end - diff --git a/experimental/GroebnerWalk/benchmark/tran3.3.jl b/experimental/GroebnerWalk/benchmark/tran3.3.jl index 565a108a482a..e31d482f9b26 100644 --- a/experimental/GroebnerWalk/benchmark/tran3.3.jl +++ b/experimental/GroebnerWalk/benchmark/tran3.3.jl @@ -6,5 +6,4 @@ function tran33(k::Field) F = [16 + 3*x^3+16*x^2*z+14*x^2*y^3, 6+y^3*z+17*x^2*z^2+7*x*y^2*z^2+13*x^3*z^2] return ideal(F), lex(R), default_ordering(R) -end - +end \ No newline at end of file From 66d08918afc215735c86d1070af4ddda6c70e85f Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Fri, 2 Aug 2024 23:21:27 +0200 Subject: [PATCH 155/179] Move benchmark polynomial systems --- benchmark/benchmarks.jl | 15 +++++------ benchmark/katsura.jl | 0 src/GroebnerWalk.jl | 4 +++ src/special-ideals.jl | 59 +++++++++++++++++++++++++++++++++++++++++ 4 files changed, 69 insertions(+), 9 deletions(-) delete mode 100644 benchmark/katsura.jl create mode 100644 src/special-ideals.jl diff --git a/benchmark/benchmarks.jl b/benchmark/benchmarks.jl index f1f2d87faa26..6feb716153b4 100644 --- a/benchmark/benchmarks.jl +++ b/benchmark/benchmarks.jl @@ -1,12 +1,9 @@ using Oscar -using GroebnerWalk -using BenchmarkTools include("cyclic.jl") include("katsura.jl") include("agk.jl") include("tran3.3.jl") -include("newellp1.jl") function benchmark( io, @@ -16,13 +13,13 @@ function benchmark( start::MonomialOrdering ) print(io, name, ","); flush(io) - t = @belapsed groebner_walk($I, $target, $start; algorithm=:standard) seconds=20000 samples=10 + t = @elapsed groebner_walk($I, $target, $start; algorithm=:standard) print(io, t, ","); flush(io) - t = @belapsed groebner_walk($I, $target, $start; algorithm=:generic) seconds=20000 samples=10 + t = @elapsed groebner_walk($I, $target, $start; algorithm=:generic) print(io, t, ","); flush(io) - t = @belapsed groebner_walk($I, $target, $start; algorithm=:perturbed) seconds=20000 samples=10 + t = @elapsed groebner_walk($I, $target, $start; algorithm=:perturbed) print(io, t, ","); flush(io) - t = @belapsed groebner_basis($I; ordering=$target) seconds=20000 samples=10 + t = @elapsed groebner_basis($I; ordering=$target) println(io, t); flush(io) end @@ -62,7 +59,7 @@ open("results.csv", "a") do io benchmark(io, "tran3.3-QQ", tran33(QQ)...) benchmark(io, "tran3.3-Fp", tran33(Fp)...) - benchmark(io, "newellp1-QQ", newellp1(QQ)...) - benchmark(io, "newellp1-Fp", newellp1(Fp)...) + benchmark(io, "newellp1-QQ", Oscar.newell_patch_with_orderings(QQ)...) + benchmark(io, "newellp1-Fp", Oscar.newell_patch_with_orderings(Fp)...) end diff --git a/benchmark/katsura.jl b/benchmark/katsura.jl deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/src/GroebnerWalk.jl b/src/GroebnerWalk.jl index 0629ab6e6269..f1bb525b8e88 100644 --- a/src/GroebnerWalk.jl +++ b/src/GroebnerWalk.jl @@ -17,12 +17,16 @@ import Oscar.Orderings: include("markedGB.jl") include("common.jl") +include("special-ideals.jl") + include("standard_walk.jl") include("generic_walk.jl") include("perturbed_walk.jl") export groebner_walk +export newell_patch + function __init__() add_verbosity_scope(:groebner_walk) end diff --git a/src/special-ideals.jl b/src/special-ideals.jl new file mode 100644 index 000000000000..6f1a0d4da97b --- /dev/null +++ b/src/special-ideals.jl @@ -0,0 +1,59 @@ + +@doc raw""" + newell_patch(k::Union{QQField, QQBarFieldElem}, n::Int=1) + +Let $n$ be an integer between 1 and 32. Returns the ideal corresponding to +the implicitization of the $n$-th bi-cubic patch describing +the Newell's teapot as a parametric surface. +""" +function newell_patch(k::Union{QQField, QQBarFieldElem}, n::Int=1) + return get_newell_patch_generators(n) |> ideal +end + +@doc raw""" + newell_patch(k::Field, n::Int=1) + +Let $n$ be an integer between 1 and 32. Returns the ideal corresponding to +the implicitization of the $n$-th bi-cubic patch describing +the Newell's teapot as a parametric surface. + +For fields $k\neq\mathbb{Q},\bar{\mathbb{Q}}$, this gives a variant of the ideal with +integer coefficients. +""" +function newell_patch(k::Field, n::Int=1) + F = get_newell_patch_generators(n) + + lcm_denom = [ + lcm(numerator.(coefficients(f))) for f in F + ] + integral_F = [ + change_coefficient_ring( + k, l*f + ) for (l, f) in zip(lcm_denom, F) + ] + + return ideal(integral_F) +end + +function newell_patch_with_orderings(k::Field, n::Int=1) + I = newell_patch(k, n) + R = base_ring(I) + o1 = matrix_ordering(R, [1 1 1 0 0; 0 0 0 1 1; 0 0 0 1 0; 1 1 0 0 0; 1 0 0 0 0]) + o2 = matrix_ordering(R, [0 0 0 1 1; 1 1 1 0 0; 1 1 0 0 0; 1 0 0 0 0; 0 0 0 1 0]) + return I, o2, o1 +end + +function get_newell_patch_generators(n::Int) + R, (x,y,z,u,v) = polynomial_ring(QQ, ["x","y","z","u","v"]) + + if n == 1 + return [ + -x + 7//5 - 231//125 * v^2 + 39//80 * u^2 - 1//5 * u^3 + 99//400 * u * v^2 - 1287//2000 * u^2 * v^2 + 33//125 * u^3 * v^2 - 3//16 * u + 56//125 * v^3 - 3//50 * u * v^3 + 39//250 * u^2 * v^3 - 8//125 * u^3 * v^3, + -y + 63//125 * v^2 - 294//125 * v + 56//125 * v^3 - 819//1000 * u^2 * v + 42//125 * u^3 * v - 3//50 * u * v^3 + 351//2000 * u^2 * v^2 + 39//250 * u^2 * v^3 - 9//125 * u^3 * v^2 - 8//125 * u^3 * v^3, + -z + 12//5 - 63//160 * u^2 + 63//160 * u + ] + else + # TODO: Throw error + end +end + From 2630f6cd2526c0e3d0fcb2d11f23be1d6430699b Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Fri, 2 Aug 2024 23:21:27 +0200 Subject: [PATCH 156/179] Move benchmark polynomial systems --- .../GroebnerWalk/benchmark/benchmarks.jl | 15 ++--- .../GroebnerWalk/benchmark/katsura.jl | 0 experimental/GroebnerWalk/src/GroebnerWalk.jl | 4 ++ .../GroebnerWalk/src/special-ideals.jl | 59 +++++++++++++++++++ 4 files changed, 69 insertions(+), 9 deletions(-) delete mode 100644 experimental/GroebnerWalk/benchmark/katsura.jl create mode 100644 experimental/GroebnerWalk/src/special-ideals.jl diff --git a/experimental/GroebnerWalk/benchmark/benchmarks.jl b/experimental/GroebnerWalk/benchmark/benchmarks.jl index f1f2d87faa26..6feb716153b4 100644 --- a/experimental/GroebnerWalk/benchmark/benchmarks.jl +++ b/experimental/GroebnerWalk/benchmark/benchmarks.jl @@ -1,12 +1,9 @@ using Oscar -using GroebnerWalk -using BenchmarkTools include("cyclic.jl") include("katsura.jl") include("agk.jl") include("tran3.3.jl") -include("newellp1.jl") function benchmark( io, @@ -16,13 +13,13 @@ function benchmark( start::MonomialOrdering ) print(io, name, ","); flush(io) - t = @belapsed groebner_walk($I, $target, $start; algorithm=:standard) seconds=20000 samples=10 + t = @elapsed groebner_walk($I, $target, $start; algorithm=:standard) print(io, t, ","); flush(io) - t = @belapsed groebner_walk($I, $target, $start; algorithm=:generic) seconds=20000 samples=10 + t = @elapsed groebner_walk($I, $target, $start; algorithm=:generic) print(io, t, ","); flush(io) - t = @belapsed groebner_walk($I, $target, $start; algorithm=:perturbed) seconds=20000 samples=10 + t = @elapsed groebner_walk($I, $target, $start; algorithm=:perturbed) print(io, t, ","); flush(io) - t = @belapsed groebner_basis($I; ordering=$target) seconds=20000 samples=10 + t = @elapsed groebner_basis($I; ordering=$target) println(io, t); flush(io) end @@ -62,7 +59,7 @@ open("results.csv", "a") do io benchmark(io, "tran3.3-QQ", tran33(QQ)...) benchmark(io, "tran3.3-Fp", tran33(Fp)...) - benchmark(io, "newellp1-QQ", newellp1(QQ)...) - benchmark(io, "newellp1-Fp", newellp1(Fp)...) + benchmark(io, "newellp1-QQ", Oscar.newell_patch_with_orderings(QQ)...) + benchmark(io, "newellp1-Fp", Oscar.newell_patch_with_orderings(Fp)...) end diff --git a/experimental/GroebnerWalk/benchmark/katsura.jl b/experimental/GroebnerWalk/benchmark/katsura.jl deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/experimental/GroebnerWalk/src/GroebnerWalk.jl b/experimental/GroebnerWalk/src/GroebnerWalk.jl index 0629ab6e6269..f1bb525b8e88 100644 --- a/experimental/GroebnerWalk/src/GroebnerWalk.jl +++ b/experimental/GroebnerWalk/src/GroebnerWalk.jl @@ -17,12 +17,16 @@ import Oscar.Orderings: include("markedGB.jl") include("common.jl") +include("special-ideals.jl") + include("standard_walk.jl") include("generic_walk.jl") include("perturbed_walk.jl") export groebner_walk +export newell_patch + function __init__() add_verbosity_scope(:groebner_walk) end diff --git a/experimental/GroebnerWalk/src/special-ideals.jl b/experimental/GroebnerWalk/src/special-ideals.jl new file mode 100644 index 000000000000..6f1a0d4da97b --- /dev/null +++ b/experimental/GroebnerWalk/src/special-ideals.jl @@ -0,0 +1,59 @@ + +@doc raw""" + newell_patch(k::Union{QQField, QQBarFieldElem}, n::Int=1) + +Let $n$ be an integer between 1 and 32. Returns the ideal corresponding to +the implicitization of the $n$-th bi-cubic patch describing +the Newell's teapot as a parametric surface. +""" +function newell_patch(k::Union{QQField, QQBarFieldElem}, n::Int=1) + return get_newell_patch_generators(n) |> ideal +end + +@doc raw""" + newell_patch(k::Field, n::Int=1) + +Let $n$ be an integer between 1 and 32. Returns the ideal corresponding to +the implicitization of the $n$-th bi-cubic patch describing +the Newell's teapot as a parametric surface. + +For fields $k\neq\mathbb{Q},\bar{\mathbb{Q}}$, this gives a variant of the ideal with +integer coefficients. +""" +function newell_patch(k::Field, n::Int=1) + F = get_newell_patch_generators(n) + + lcm_denom = [ + lcm(numerator.(coefficients(f))) for f in F + ] + integral_F = [ + change_coefficient_ring( + k, l*f + ) for (l, f) in zip(lcm_denom, F) + ] + + return ideal(integral_F) +end + +function newell_patch_with_orderings(k::Field, n::Int=1) + I = newell_patch(k, n) + R = base_ring(I) + o1 = matrix_ordering(R, [1 1 1 0 0; 0 0 0 1 1; 0 0 0 1 0; 1 1 0 0 0; 1 0 0 0 0]) + o2 = matrix_ordering(R, [0 0 0 1 1; 1 1 1 0 0; 1 1 0 0 0; 1 0 0 0 0; 0 0 0 1 0]) + return I, o2, o1 +end + +function get_newell_patch_generators(n::Int) + R, (x,y,z,u,v) = polynomial_ring(QQ, ["x","y","z","u","v"]) + + if n == 1 + return [ + -x + 7//5 - 231//125 * v^2 + 39//80 * u^2 - 1//5 * u^3 + 99//400 * u * v^2 - 1287//2000 * u^2 * v^2 + 33//125 * u^3 * v^2 - 3//16 * u + 56//125 * v^3 - 3//50 * u * v^3 + 39//250 * u^2 * v^3 - 8//125 * u^3 * v^3, + -y + 63//125 * v^2 - 294//125 * v + 56//125 * v^3 - 819//1000 * u^2 * v + 42//125 * u^3 * v - 3//50 * u * v^3 + 351//2000 * u^2 * v^2 + 39//250 * u^2 * v^3 - 9//125 * u^3 * v^2 - 8//125 * u^3 * v^3, + -z + 12//5 - 63//160 * u^2 + 63//160 * u + ] + else + # TODO: Throw error + end +end + From 354ea0a8ecd6d547bacf50cf81de67a1208c771c Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Fri, 2 Aug 2024 23:32:33 +0200 Subject: [PATCH 157/179] Remove thesisexamples --- examples/thesisexamples/chap3.jl | 23 -------------- examples/thesisexamples/chap4.jl | 27 ---------------- examples/thesisexamples/chap5_generic.jl | 39 ------------------------ 3 files changed, 89 deletions(-) delete mode 100644 examples/thesisexamples/chap3.jl delete mode 100644 examples/thesisexamples/chap4.jl delete mode 100644 examples/thesisexamples/chap5_generic.jl diff --git a/examples/thesisexamples/chap3.jl b/examples/thesisexamples/chap3.jl deleted file mode 100644 index 6535cd3527a9..000000000000 --- a/examples/thesisexamples/chap3.jl +++ /dev/null @@ -1,23 +0,0 @@ -#Testing welpj's Groebner walk with my examples - -#Examples from chapter 3 - -using Oscar - - -#We perform computations on the same ideal throughout - -R, (x,y,z) = polynomial_ring(QQ, ["x","y","z"]) - -set_verbosity_level(:groebner_walk, 1) - - -I = ideal([x^2 + y*z, x*y + z^2]) -os = lex(R) -ot = weight_ordering([1,3,0], deglex(R)) -Glex = groebner_basis(I; ordering = ot, complete_reduction = true) - -G1 = groebner_walk(I, ot, os, algorithm = :generic) - -G2 = groebner_walk(I, ot, os, algorithm = :standard) - diff --git a/examples/thesisexamples/chap4.jl b/examples/thesisexamples/chap4.jl deleted file mode 100644 index bd3a3648aef9..000000000000 --- a/examples/thesisexamples/chap4.jl +++ /dev/null @@ -1,27 +0,0 @@ -using Oscar -R, (x,y,z) = polynomial_ring(QQ, ["x","y","z"]) - -I = ideal([6 + 3*x^3+16*x^2*z+14*x^2*y^3, 6+y^3*z+17*x^2*z^2+7*x*y^2*z^2+13*x^3*z^2]) - -# This is an example 3.8 from Tran 2004. -# In M2, "gb I" takes ~90s -# standard Gröbner Walk takes ~12s -# generic Gröbner Walk takes ~2s - -t_buchberger = @elapsed groebner_basis(I, ordering = lex(R)) -#this takes longer than 30 mins in OSCAR, compared with ~90s in M2 -#Is this to be expected? - - -t_standardwalk = @elapsed groebner_walk(I, lex(R); algorithm =:standard) - -t_generic = @elapsed groebner_walk(I, lex(R); algorithm =:generic) #takes more than 1hr... - - -#the line above terminates in a few secs - -#you should count the number of conversions - -#problem: the two functions above appear to do exactly the same thing! -#"Results for standard_walk....etc. - diff --git a/examples/thesisexamples/chap5_generic.jl b/examples/thesisexamples/chap5_generic.jl deleted file mode 100644 index efbe16b12244..000000000000 --- a/examples/thesisexamples/chap5_generic.jl +++ /dev/null @@ -1,39 +0,0 @@ -using Oscar -using Oscar.GroebnerWalk - - -#The generic walk currently doesn't work (type conflicts) -#This example tests "new_next_gamma" -#We perform computations on the same ideal throughout - -R, (x,y,z) = polynomial_ring(QQ, ["x","y","z"]) - -set_verbosity_level(:groebner_walk, 1) - - -I = ideal([x^2 + y*z, x*y + z^2]) - -o_s = lex(R) - -o_t = weight_ordering([1,3,0], deglex(R)) - -G = groebner_basis(I, ordering = o_s) -S = canonical_matrix(o_s) -T = canonical_matrix(o_t) - -new_next_gamma(G, ZZ.([0]), o_s, o_t) - -Gfinal = groebner_walk(I, lex(R), o_t; walk_type = :generic) #throws an error - - - - -#= - -R2, (x,y) = polynomial_ring(QQ, ["x","y"]) - -I2 = ideal([x^2-y^3, x^3 -y^2 - x]) - -G2 = groebner_basis(I2) -#= Fukuda Jensen example - From 29b1ad476d09315b06ce10f9622ad014f5bf4a2f Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Fri, 2 Aug 2024 23:32:33 +0200 Subject: [PATCH 158/179] Remove thesisexamples --- .../examples/thesisexamples/chap3.jl | 23 ----------- .../examples/thesisexamples/chap4.jl | 27 ------------- .../examples/thesisexamples/chap5_generic.jl | 39 ------------------- 3 files changed, 89 deletions(-) delete mode 100644 experimental/GroebnerWalk/examples/thesisexamples/chap3.jl delete mode 100644 experimental/GroebnerWalk/examples/thesisexamples/chap4.jl delete mode 100644 experimental/GroebnerWalk/examples/thesisexamples/chap5_generic.jl diff --git a/experimental/GroebnerWalk/examples/thesisexamples/chap3.jl b/experimental/GroebnerWalk/examples/thesisexamples/chap3.jl deleted file mode 100644 index 6535cd3527a9..000000000000 --- a/experimental/GroebnerWalk/examples/thesisexamples/chap3.jl +++ /dev/null @@ -1,23 +0,0 @@ -#Testing welpj's Groebner walk with my examples - -#Examples from chapter 3 - -using Oscar - - -#We perform computations on the same ideal throughout - -R, (x,y,z) = polynomial_ring(QQ, ["x","y","z"]) - -set_verbosity_level(:groebner_walk, 1) - - -I = ideal([x^2 + y*z, x*y + z^2]) -os = lex(R) -ot = weight_ordering([1,3,0], deglex(R)) -Glex = groebner_basis(I; ordering = ot, complete_reduction = true) - -G1 = groebner_walk(I, ot, os, algorithm = :generic) - -G2 = groebner_walk(I, ot, os, algorithm = :standard) - diff --git a/experimental/GroebnerWalk/examples/thesisexamples/chap4.jl b/experimental/GroebnerWalk/examples/thesisexamples/chap4.jl deleted file mode 100644 index bd3a3648aef9..000000000000 --- a/experimental/GroebnerWalk/examples/thesisexamples/chap4.jl +++ /dev/null @@ -1,27 +0,0 @@ -using Oscar -R, (x,y,z) = polynomial_ring(QQ, ["x","y","z"]) - -I = ideal([6 + 3*x^3+16*x^2*z+14*x^2*y^3, 6+y^3*z+17*x^2*z^2+7*x*y^2*z^2+13*x^3*z^2]) - -# This is an example 3.8 from Tran 2004. -# In M2, "gb I" takes ~90s -# standard Gröbner Walk takes ~12s -# generic Gröbner Walk takes ~2s - -t_buchberger = @elapsed groebner_basis(I, ordering = lex(R)) -#this takes longer than 30 mins in OSCAR, compared with ~90s in M2 -#Is this to be expected? - - -t_standardwalk = @elapsed groebner_walk(I, lex(R); algorithm =:standard) - -t_generic = @elapsed groebner_walk(I, lex(R); algorithm =:generic) #takes more than 1hr... - - -#the line above terminates in a few secs - -#you should count the number of conversions - -#problem: the two functions above appear to do exactly the same thing! -#"Results for standard_walk....etc. - diff --git a/experimental/GroebnerWalk/examples/thesisexamples/chap5_generic.jl b/experimental/GroebnerWalk/examples/thesisexamples/chap5_generic.jl deleted file mode 100644 index efbe16b12244..000000000000 --- a/experimental/GroebnerWalk/examples/thesisexamples/chap5_generic.jl +++ /dev/null @@ -1,39 +0,0 @@ -using Oscar -using Oscar.GroebnerWalk - - -#The generic walk currently doesn't work (type conflicts) -#This example tests "new_next_gamma" -#We perform computations on the same ideal throughout - -R, (x,y,z) = polynomial_ring(QQ, ["x","y","z"]) - -set_verbosity_level(:groebner_walk, 1) - - -I = ideal([x^2 + y*z, x*y + z^2]) - -o_s = lex(R) - -o_t = weight_ordering([1,3,0], deglex(R)) - -G = groebner_basis(I, ordering = o_s) -S = canonical_matrix(o_s) -T = canonical_matrix(o_t) - -new_next_gamma(G, ZZ.([0]), o_s, o_t) - -Gfinal = groebner_walk(I, lex(R), o_t; walk_type = :generic) #throws an error - - - - -#= - -R2, (x,y) = polynomial_ring(QQ, ["x","y"]) - -I2 = ideal([x^2-y^3, x^3 -y^2 - x]) - -G2 = groebner_basis(I2) -#= Fukuda Jensen example - From 014397ace9d184a418bf064eeb0a0001498a7d85 Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Fri, 2 Aug 2024 23:32:53 +0200 Subject: [PATCH 159/179] Expose newell_patch --- src/GroebnerWalk.jl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/GroebnerWalk.jl b/src/GroebnerWalk.jl index f1bb525b8e88..4767c24153c0 100644 --- a/src/GroebnerWalk.jl +++ b/src/GroebnerWalk.jl @@ -33,6 +33,9 @@ end end -using .GroebnerWalk +import .GroebnerWalk: + newell_patch, + groebner_walk + export groebner_walk From 197d8953b307eeca25b48d2b684c80ea69081560 Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Fri, 2 Aug 2024 23:32:53 +0200 Subject: [PATCH 160/179] Expose newell_patch --- experimental/GroebnerWalk/src/GroebnerWalk.jl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/experimental/GroebnerWalk/src/GroebnerWalk.jl b/experimental/GroebnerWalk/src/GroebnerWalk.jl index f1bb525b8e88..4767c24153c0 100644 --- a/experimental/GroebnerWalk/src/GroebnerWalk.jl +++ b/experimental/GroebnerWalk/src/GroebnerWalk.jl @@ -33,6 +33,9 @@ end end -using .GroebnerWalk +import .GroebnerWalk: + newell_patch, + groebner_walk + export groebner_walk From 396a30c870c689a490efd13d3af3a0d91c816fef Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Wed, 31 Jul 2024 11:03:20 +0200 Subject: [PATCH 161/179] Update GroebnerWalk/README.md --- README.md | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index d032e1df17b4..b84ab79d6a00 100644 --- a/README.md +++ b/README.md @@ -15,19 +15,23 @@ using Oscar R, (x,y) = QQ[:x, :y] # define ring ... I = ideal([y^4+ x^3-x^2+x,x^4]) # ... and ideal ``` - Then, we can pass the ideal to `groebner_walk` to calculate the Gröbner basis. -Here, we want a Gröbner basis with respect to the lexicographic ordering on `R`. + +By default, `groebner_walk` starts with a Gröbner basis with respect to the default ordering on `R` +and converts this into a Gröbner basis with respect to the lexicographic ordering on `R`. +This is what the following code block accomplishes. ```julia -using GroebnerWalk +using Oscar -groebner_walk(I, lex(R)) # compute the Groebner basis +groebner_walk(I) # compute the Groebner basis +``` +If one wants to specify `target` and `start` orderings explicitly, above function call needs to be written as follows. +```julia +groebner_walk(I, lex(R), default_ordering(R)) # compute the Groebner basis ``` ## Status -This repository represents the status of the code as a submission for MEGA 2024. It is slated for inclusion into OSCAR as experimental package. - -At the moment, the standard walk by Collart, Kalkbrener and Mall (1997) and the generic walk by Fukuda et al. are implemented. +At the moment, the standard walk by Collart, Kalkbrener and Mall (1997) and the generic walk by Fukuda et al. (2007) are implemented. ## Contacts The library is maintained by Kamillo Ferry (kafe (at) kafe (dot) dev) and Francesco Nowell (francesconowell (at) gmail (dot) com). From 0c0d5c61fdca76e2b0c2d851d4989f496b3c6b8c Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Wed, 31 Jul 2024 11:03:20 +0200 Subject: [PATCH 162/179] Update GroebnerWalk/README.md --- experimental/GroebnerWalk/README.md | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/experimental/GroebnerWalk/README.md b/experimental/GroebnerWalk/README.md index d032e1df17b4..b84ab79d6a00 100644 --- a/experimental/GroebnerWalk/README.md +++ b/experimental/GroebnerWalk/README.md @@ -15,19 +15,23 @@ using Oscar R, (x,y) = QQ[:x, :y] # define ring ... I = ideal([y^4+ x^3-x^2+x,x^4]) # ... and ideal ``` - Then, we can pass the ideal to `groebner_walk` to calculate the Gröbner basis. -Here, we want a Gröbner basis with respect to the lexicographic ordering on `R`. + +By default, `groebner_walk` starts with a Gröbner basis with respect to the default ordering on `R` +and converts this into a Gröbner basis with respect to the lexicographic ordering on `R`. +This is what the following code block accomplishes. ```julia -using GroebnerWalk +using Oscar -groebner_walk(I, lex(R)) # compute the Groebner basis +groebner_walk(I) # compute the Groebner basis +``` +If one wants to specify `target` and `start` orderings explicitly, above function call needs to be written as follows. +```julia +groebner_walk(I, lex(R), default_ordering(R)) # compute the Groebner basis ``` ## Status -This repository represents the status of the code as a submission for MEGA 2024. It is slated for inclusion into OSCAR as experimental package. - -At the moment, the standard walk by Collart, Kalkbrener and Mall (1997) and the generic walk by Fukuda et al. are implemented. +At the moment, the standard walk by Collart, Kalkbrener and Mall (1997) and the generic walk by Fukuda et al. (2007) are implemented. ## Contacts The library is maintained by Kamillo Ferry (kafe (at) kafe (dot) dev) and Francesco Nowell (francesconowell (at) gmail (dot) com). From 63889f5b97f7617d5196f40575e052762be924e7 Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Fri, 2 Aug 2024 23:47:42 +0200 Subject: [PATCH 163/179] Update README.md --- README.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b84ab79d6a00..b9132345d236 100644 --- a/README.md +++ b/README.md @@ -2,12 +2,12 @@ [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.11065978.svg)](https://doi.org/10.5281/zenodo.11065978) -GroebnerWalk.jl is a Julia package providing implementations of Gröbner walk algorithms +`GroebnerWalk` provides implementations of Gröbner walk algorithms for computing Gröbner bases over fields on top of Oscar.jl. ## Usage -GroebnerWalk.jl provides its entire functionality through the function `groebner_walk`. +This module provides the function `groebner_walk` as interface to the algorithms. The following example demonstrates the usage. First, we define the ideal Oscar.jl. ```julia using Oscar @@ -30,6 +30,9 @@ If one wants to specify `target` and `start` orderings explicitly, above functio groebner_walk(I, lex(R), default_ordering(R)) # compute the Groebner basis ``` +Additionally, there are certain special ideals provided that are used for benchmarking +of this module. + ## Status At the moment, the standard walk by Collart, Kalkbrener and Mall (1997) and the generic walk by Fukuda et al. (2007) are implemented. From 6607667a72ac4dc9ac2f26106b0280ee60e9ee55 Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Fri, 2 Aug 2024 23:47:42 +0200 Subject: [PATCH 164/179] Update README.md --- experimental/GroebnerWalk/README.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/experimental/GroebnerWalk/README.md b/experimental/GroebnerWalk/README.md index b84ab79d6a00..b9132345d236 100644 --- a/experimental/GroebnerWalk/README.md +++ b/experimental/GroebnerWalk/README.md @@ -2,12 +2,12 @@ [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.11065978.svg)](https://doi.org/10.5281/zenodo.11065978) -GroebnerWalk.jl is a Julia package providing implementations of Gröbner walk algorithms +`GroebnerWalk` provides implementations of Gröbner walk algorithms for computing Gröbner bases over fields on top of Oscar.jl. ## Usage -GroebnerWalk.jl provides its entire functionality through the function `groebner_walk`. +This module provides the function `groebner_walk` as interface to the algorithms. The following example demonstrates the usage. First, we define the ideal Oscar.jl. ```julia using Oscar @@ -30,6 +30,9 @@ If one wants to specify `target` and `start` orderings explicitly, above functio groebner_walk(I, lex(R), default_ordering(R)) # compute the Groebner basis ``` +Additionally, there are certain special ideals provided that are used for benchmarking +of this module. + ## Status At the moment, the standard walk by Collart, Kalkbrener and Mall (1997) and the generic walk by Fukuda et al. (2007) are implemented. From 4bf43f1b45320a1739627789b050889fa0c49077 Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Fri, 2 Aug 2024 23:52:33 +0200 Subject: [PATCH 165/179] Update example to use exported ideal --- examples/implicitization/newellp1.jl | 13 +------------ src/GroebnerWalk.jl | 1 + 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/examples/implicitization/newellp1.jl b/examples/implicitization/newellp1.jl index b17783d3c14c..feaf316bf6dc 100644 --- a/examples/implicitization/newellp1.jl +++ b/examples/implicitization/newellp1.jl @@ -4,18 +4,7 @@ =# using Oscar -R, (x,y,z,u,v) = polynomial_ring(QQ, ["x","y","z","u","v"]) - -I = ideal([ - -x + 7//5 - 231//125 * v^2 + 39//80 * u^2 - 1//5 * u^3 + 99//400 * u * v^2 - 1287//2000 * u^2 * v^2 + 33//125 * u^3 * v^2 - 3//16 * u + 56//125 * v^3 - 3//50 * u * v^3 + 39//250 * u^2 * v^3 - 8//125 * u^3 * v^3, - -y + 63//125 * v^2 - 294//125 * v + 56//125 * v^3 - 819//1000 * u^2 * v + 42//125 * u^3 * v - 3//50 * u * v^3 + 351//2000 * u^2 * v^2 + 39//250 * u^2 * v^3 - 9//125 * u^3 * v^2 - 8//125 * u^3 * v^3, - -z + 12//5 - 63//160 * u^2 + 63//160 * u -]) - -Ginit = groebner_basis(I) -# "Optimal" choice of orderings, as stated in Tran 2004 -o1 = matrix_ordering(R, [1 1 1 0 0; 0 0 0 1 1; 0 0 0 1 0; 1 1 0 0 0; 1 0 0 0 0]) -o2 = matrix_ordering(R, [0 0 0 1 1; 1 1 1 0 0; 1 1 0 0 0; 1 0 0 0 0; 0 0 0 1 0]) +I, o1, o2 = Oscar.newell_patch_with_orderings(QQ, 1) set_verbosity_level(:groebner_walk, 1) G = groebner_walk(I, o2, o1; algorithm=:standard) diff --git a/src/GroebnerWalk.jl b/src/GroebnerWalk.jl index 4767c24153c0..45afd488d4ef 100644 --- a/src/GroebnerWalk.jl +++ b/src/GroebnerWalk.jl @@ -35,6 +35,7 @@ end import .GroebnerWalk: newell_patch, + newell_patch_with_orderings, groebner_walk export groebner_walk From 32ae296136f58071c98ecae1b3a22fc809d4f204 Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Fri, 2 Aug 2024 23:52:33 +0200 Subject: [PATCH 166/179] Update example to use exported ideal --- .../examples/implicitization/newellp1.jl | 13 +------------ experimental/GroebnerWalk/src/GroebnerWalk.jl | 1 + 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/experimental/GroebnerWalk/examples/implicitization/newellp1.jl b/experimental/GroebnerWalk/examples/implicitization/newellp1.jl index b17783d3c14c..feaf316bf6dc 100644 --- a/experimental/GroebnerWalk/examples/implicitization/newellp1.jl +++ b/experimental/GroebnerWalk/examples/implicitization/newellp1.jl @@ -4,18 +4,7 @@ =# using Oscar -R, (x,y,z,u,v) = polynomial_ring(QQ, ["x","y","z","u","v"]) - -I = ideal([ - -x + 7//5 - 231//125 * v^2 + 39//80 * u^2 - 1//5 * u^3 + 99//400 * u * v^2 - 1287//2000 * u^2 * v^2 + 33//125 * u^3 * v^2 - 3//16 * u + 56//125 * v^3 - 3//50 * u * v^3 + 39//250 * u^2 * v^3 - 8//125 * u^3 * v^3, - -y + 63//125 * v^2 - 294//125 * v + 56//125 * v^3 - 819//1000 * u^2 * v + 42//125 * u^3 * v - 3//50 * u * v^3 + 351//2000 * u^2 * v^2 + 39//250 * u^2 * v^3 - 9//125 * u^3 * v^2 - 8//125 * u^3 * v^3, - -z + 12//5 - 63//160 * u^2 + 63//160 * u -]) - -Ginit = groebner_basis(I) -# "Optimal" choice of orderings, as stated in Tran 2004 -o1 = matrix_ordering(R, [1 1 1 0 0; 0 0 0 1 1; 0 0 0 1 0; 1 1 0 0 0; 1 0 0 0 0]) -o2 = matrix_ordering(R, [0 0 0 1 1; 1 1 1 0 0; 1 1 0 0 0; 1 0 0 0 0; 0 0 0 1 0]) +I, o1, o2 = Oscar.newell_patch_with_orderings(QQ, 1) set_verbosity_level(:groebner_walk, 1) G = groebner_walk(I, o2, o1; algorithm=:standard) diff --git a/experimental/GroebnerWalk/src/GroebnerWalk.jl b/experimental/GroebnerWalk/src/GroebnerWalk.jl index 4767c24153c0..45afd488d4ef 100644 --- a/experimental/GroebnerWalk/src/GroebnerWalk.jl +++ b/experimental/GroebnerWalk/src/GroebnerWalk.jl @@ -35,6 +35,7 @@ end import .GroebnerWalk: newell_patch, + newell_patch_with_orderings, groebner_walk export groebner_walk From bc596e2da4ac0fdc64a2e728104f8efeff98fd56 Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Fri, 2 Aug 2024 23:57:28 +0200 Subject: [PATCH 167/179] Add newline at end of file --- benchmark/tran3.3.jl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/benchmark/tran3.3.jl b/benchmark/tran3.3.jl index e31d482f9b26..565a108a482a 100644 --- a/benchmark/tran3.3.jl +++ b/benchmark/tran3.3.jl @@ -6,4 +6,5 @@ function tran33(k::Field) F = [16 + 3*x^3+16*x^2*z+14*x^2*y^3, 6+y^3*z+17*x^2*z^2+7*x*y^2*z^2+13*x^3*z^2] return ideal(F), lex(R), default_ordering(R) -end \ No newline at end of file +end + From fd45cc0c855a962bb5590da1b2eb0e62390ebe22 Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Fri, 2 Aug 2024 23:57:28 +0200 Subject: [PATCH 168/179] Add newline at end of file --- experimental/GroebnerWalk/benchmark/tran3.3.jl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/experimental/GroebnerWalk/benchmark/tran3.3.jl b/experimental/GroebnerWalk/benchmark/tran3.3.jl index e31d482f9b26..565a108a482a 100644 --- a/experimental/GroebnerWalk/benchmark/tran3.3.jl +++ b/experimental/GroebnerWalk/benchmark/tran3.3.jl @@ -6,4 +6,5 @@ function tran33(k::Field) F = [16 + 3*x^3+16*x^2*z+14*x^2*y^3, 6+y^3*z+17*x^2*z^2+7*x*y^2*z^2+13*x^3*z^2] return ideal(F), lex(R), default_ordering(R) -end \ No newline at end of file +end + From 9f626677a470545ffd0cb69e8ef9c324dea08728 Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Sat, 3 Aug 2024 00:19:51 +0200 Subject: [PATCH 169/179] Properly export newell_patch_with_orderings --- src/GroebnerWalk.jl | 1 + 1 file changed, 1 insertion(+) diff --git a/src/GroebnerWalk.jl b/src/GroebnerWalk.jl index 45afd488d4ef..5d68fb6a8ea8 100644 --- a/src/GroebnerWalk.jl +++ b/src/GroebnerWalk.jl @@ -26,6 +26,7 @@ include("perturbed_walk.jl") export groebner_walk export newell_patch +export newell_patch_with_orderings function __init__() add_verbosity_scope(:groebner_walk) From 37832b395dea2232ef79fbec57035632e40667f4 Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Sat, 3 Aug 2024 00:19:51 +0200 Subject: [PATCH 170/179] Properly export newell_patch_with_orderings --- experimental/GroebnerWalk/src/GroebnerWalk.jl | 1 + 1 file changed, 1 insertion(+) diff --git a/experimental/GroebnerWalk/src/GroebnerWalk.jl b/experimental/GroebnerWalk/src/GroebnerWalk.jl index 45afd488d4ef..5d68fb6a8ea8 100644 --- a/experimental/GroebnerWalk/src/GroebnerWalk.jl +++ b/experimental/GroebnerWalk/src/GroebnerWalk.jl @@ -26,6 +26,7 @@ include("perturbed_walk.jl") export groebner_walk export newell_patch +export newell_patch_with_orderings function __init__() add_verbosity_scope(:groebner_walk) From 3ade7a5207953cee0b24fd781fa5c87ac75df731 Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Sat, 3 Aug 2024 02:35:36 +0200 Subject: [PATCH 171/179] Add documentation --- docs/src/introduction.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/docs/src/introduction.md b/docs/src/introduction.md index eb63dc9db625..2583cb9056cd 100644 --- a/docs/src/introduction.md +++ b/docs/src/introduction.md @@ -2,12 +2,14 @@ CurrentModule = Oscar ``` -# Gröbner walk +# Usage -This is a sample text to outline the structure of the packages in the `Experimental` folder. -You can show docstrings like this: +The Gröbner walk is an approach to reduce the computational complexity of Gröbner basis computations as proposed by [AGK97](@cite). +These incarnations of the Gröbner walk refer to a family of algorithms that perform a reverse local search on the cones of the Gröbner fan. +Then, a Gröbner basis is calculated for each encountered cone while reusing the generators obtained from the previous cone. + +The implemented algorithms may be accessed using the following function. -The general idea of the Gröbner walk was proposed by [AGK97](@cite). ```@docs groebner_walk( I::MPolyIdeal, From 5b81d119cd65bedf83c1991654c49ae6642dd7b1 Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Sat, 3 Aug 2024 02:35:36 +0200 Subject: [PATCH 172/179] Add documentation --- experimental/GroebnerWalk/docs/src/introduction.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/experimental/GroebnerWalk/docs/src/introduction.md b/experimental/GroebnerWalk/docs/src/introduction.md index eb63dc9db625..2583cb9056cd 100644 --- a/experimental/GroebnerWalk/docs/src/introduction.md +++ b/experimental/GroebnerWalk/docs/src/introduction.md @@ -2,12 +2,14 @@ CurrentModule = Oscar ``` -# Gröbner walk +# Usage -This is a sample text to outline the structure of the packages in the `Experimental` folder. -You can show docstrings like this: +The Gröbner walk is an approach to reduce the computational complexity of Gröbner basis computations as proposed by [AGK97](@cite). +These incarnations of the Gröbner walk refer to a family of algorithms that perform a reverse local search on the cones of the Gröbner fan. +Then, a Gröbner basis is calculated for each encountered cone while reusing the generators obtained from the previous cone. + +The implemented algorithms may be accessed using the following function. -The general idea of the Gröbner walk was proposed by [AGK97](@cite). ```@docs groebner_walk( I::MPolyIdeal, From 6f4cfff68ee71b133ceeab7ef4cbf3f3ff9233e3 Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Sat, 3 Aug 2024 02:44:30 +0200 Subject: [PATCH 173/179] Better input sanitation --- src/markedGB.jl | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/markedGB.jl b/src/markedGB.jl index 32d70b58634e..24f42029de59 100644 --- a/src/markedGB.jl +++ b/src/markedGB.jl @@ -12,14 +12,10 @@ struct MarkedGroebnerBasis markings::Vector{<:MPolyRingElem} function MarkedGroebnerBasis(gens::Vector{<:MPolyRingElem}, markings::Vector{<:MPolyRingElem}) - if length(gens) != length(markings) - throw(ArgumentError("Inputs are of different length")) - else - if 0 in gens - throw(ArgumentError("Gröbner basis contains the zero polynomial")) - end - new(gens, markings) - end + @req (length(gens) == length(markings)) "Inputs are of different length" + @req !(0 in gens) "Gröbner basis contains the zero polynomial" + + new(gens, markings) end end From 042852645e185ddfca410f7357170d64165743ad Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Sat, 3 Aug 2024 02:44:30 +0200 Subject: [PATCH 174/179] Better input sanitation --- experimental/GroebnerWalk/src/markedGB.jl | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/experimental/GroebnerWalk/src/markedGB.jl b/experimental/GroebnerWalk/src/markedGB.jl index 32d70b58634e..24f42029de59 100644 --- a/experimental/GroebnerWalk/src/markedGB.jl +++ b/experimental/GroebnerWalk/src/markedGB.jl @@ -12,14 +12,10 @@ struct MarkedGroebnerBasis markings::Vector{<:MPolyRingElem} function MarkedGroebnerBasis(gens::Vector{<:MPolyRingElem}, markings::Vector{<:MPolyRingElem}) - if length(gens) != length(markings) - throw(ArgumentError("Inputs are of different length")) - else - if 0 in gens - throw(ArgumentError("Gröbner basis contains the zero polynomial")) - end - new(gens, markings) - end + @req (length(gens) == length(markings)) "Inputs are of different length" + @req !(0 in gens) "Gröbner basis contains the zero polynomial" + + new(gens, markings) end end From e7c1bb607d5f18cf87e81af12007d327aa840fc0 Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Fri, 2 Aug 2024 19:08:15 +0200 Subject: [PATCH 175/179] Add type parameter to MarkedGroebnerBasis --- src/markedGB.jl | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/markedGB.jl b/src/markedGB.jl index 24f42029de59..d27fbc398881 100644 --- a/src/markedGB.jl +++ b/src/markedGB.jl @@ -7,11 +7,11 @@ import Base: length, getindex, setindex! #markings, a vector "Markings" of G, corresponding to leading terms w.r.t some monomial ordering #TODO: maybe initialize s.t. G is reduced/monic? -struct MarkedGroebnerBasis - gens::Vector{<:MPolyRingElem} - markings::Vector{<:MPolyRingElem} +struct MarkedGroebnerBasis{S} + gens::Vector{S} + markings::Vector{S} - function MarkedGroebnerBasis(gens::Vector{<:MPolyRingElem}, markings::Vector{<:MPolyRingElem}) + function MarkedGroebnerBasis(gens::Vector{T}, markings::Vector{T}) where {T<:MPolyRingElem} @req (length(gens) == length(markings)) "Inputs are of different length" @req !(0 in gens) "Gröbner basis contains the zero polynomial" @@ -51,7 +51,7 @@ function _normal_form(p::MPolyRingElem, G::AbstractVector{<:MPolyRingElem}, mark MG = zip(G, mark) while !iszero(p) - m = first(terms(p)) + m = first(AbstractAlgebra.terms(p)) div = false for (g, lm) in MG From 2465ebeeaf0688caa1b9553693c5a4bfd3e3cc91 Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Sun, 4 Aug 2024 17:05:52 +0200 Subject: [PATCH 176/179] Add missing type parameter for MarkedGroebnerBasis --- experimental/GroebnerWalk/src/markedGB.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/experimental/GroebnerWalk/src/markedGB.jl b/experimental/GroebnerWalk/src/markedGB.jl index d27fbc398881..eefab08ef29d 100644 --- a/experimental/GroebnerWalk/src/markedGB.jl +++ b/experimental/GroebnerWalk/src/markedGB.jl @@ -15,7 +15,7 @@ struct MarkedGroebnerBasis{S} @req (length(gens) == length(markings)) "Inputs are of different length" @req !(0 in gens) "Gröbner basis contains the zero polynomial" - new(gens, markings) + new{T}(gens, markings) end end From 074f1607b00ff4016c581c2a454e09c60d01e7ed Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Mon, 5 Aug 2024 00:06:45 +0200 Subject: [PATCH 177/179] Clean up benchmarks --- experimental/GroebnerWalk/benchmark/cyclic.jl | 1 + .../GroebnerWalk/benchmark/newellp1.jl | 34 ------------------- .../GroebnerWalk/examples/toy_example.jl | 1 - 3 files changed, 1 insertion(+), 35 deletions(-) delete mode 100644 experimental/GroebnerWalk/benchmark/newellp1.jl diff --git a/experimental/GroebnerWalk/benchmark/cyclic.jl b/experimental/GroebnerWalk/benchmark/cyclic.jl index fd838a204019..4e1c829459e7 100644 --- a/experimental/GroebnerWalk/benchmark/cyclic.jl +++ b/experimental/GroebnerWalk/benchmark/cyclic.jl @@ -76,3 +76,4 @@ function cyclic8(k::Field=QQ) return ideal(F), lex(R), default_ordering(R) end + diff --git a/experimental/GroebnerWalk/benchmark/newellp1.jl b/experimental/GroebnerWalk/benchmark/newellp1.jl deleted file mode 100644 index 5aebd84cfe79..000000000000 --- a/experimental/GroebnerWalk/benchmark/newellp1.jl +++ /dev/null @@ -1,34 +0,0 @@ -#Newell's teapot, patch 1 -#a 2 dimensional ideal from tran 2004 -using Oscar - -function newellp1(k::Field) - R, (x,y,z,u,v) = polynomial_ring(QQ, ["x","y","z","u","v"]) - - F = [ - -x + 7//5 - 231//125 * v^2 + 39//80 * u^2 - 1//5 * u^3 + 99//400 * u * v^2 - 1287//2000 * u^2 * v^2 + 33//125 * u^3 * v^2 - 3//16 * u + 56//125 * v^3 - 3//50 * u * v^3 + 39//250 * u^2 * v^3 - 8//125 * u^3 * v^3, - -y + 63//125 * v^2 - 294//125 * v + 56//125 * v^3 - 819//1000 * u^2 * v + 42//125 * u^3 * v - 3//50 * u * v^3 + 351//2000 * u^2 * v^2 + 39//250 * u^2 * v^3 - 9//125 * u^3 * v^2 - 8//125 * u^3 * v^3, - -z + 12//5 - 63//160 * u^2 + 63//160 * u - ] - - if k == QQ - o1 = matrix_ordering(R, [1 1 1 0 0; 0 0 0 1 1; 0 0 0 1 0; 1 1 0 0 0; 1 0 0 0 0]) - o2 = matrix_ordering(R, [0 0 0 1 1; 1 1 1 0 0; 1 1 0 0 0; 1 0 0 0 0; 0 0 0 1 0]) - - return ideal(F), o2, o1 - end - - lcm_denom = [ - lcm(numerator.(coefficients(f))) for f in F - ] - integral_F = [ - change_coefficient_ring( - k, l*f - ) for (l, f) in zip(lcm_denom, F) - ] - - R = parent(first(F)) - o1 = matrix_ordering(R, [1 1 1 0 0; 0 0 0 1 1; 0 0 0 1 0; 1 1 0 0 0; 1 0 0 0 0]) - o2 = matrix_ordering(R, [0 0 0 1 1; 1 1 1 0 0; 1 1 0 0 0; 1 0 0 0 0; 0 0 0 1 0]) - return ideal(integral_F), o2, o1 -end diff --git a/experimental/GroebnerWalk/examples/toy_example.jl b/experimental/GroebnerWalk/examples/toy_example.jl index 8b95c6ea3336..ccfd4b8c5224 100644 --- a/experimental/GroebnerWalk/examples/toy_example.jl +++ b/experimental/GroebnerWalk/examples/toy_example.jl @@ -1,5 +1,4 @@ using Oscar -using Oscar.GroebnerWalk R,(x,y) = polynomial_ring(QQ, ["x","y"]) I = ideal([y^4+ x^3-x^2+x,x^4]) From e462768bc6ab8c317960573df376d9892de92144 Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Mon, 5 Aug 2024 00:24:33 +0200 Subject: [PATCH 178/179] Add documentation for a special ideal --- docs/oscar_references.bib | 11 +++++++ experimental/GroebnerWalk/docs/doc.main | 1 + .../GroebnerWalk/docs/src/special-ideals.md | 16 ++++++++++ .../GroebnerWalk/src/special-ideals.jl | 31 ++++++++++++------- 4 files changed, 48 insertions(+), 11 deletions(-) create mode 100644 experimental/GroebnerWalk/docs/src/special-ideals.md diff --git a/docs/oscar_references.bib b/docs/oscar_references.bib index 92c18d5d0efe..ec4cd965b01f 100644 --- a/docs/oscar_references.bib +++ b/docs/oscar_references.bib @@ -2240,6 +2240,17 @@ @Article{Tra00 doi = {10.1006/jsco.1999.0416} } +@Article{Tra04, + author = {Tran, Quoc-Nam}, + title = {Efficient Groebner walk conversion for implicitization of geometric objects}, + journal = {Computer Aided Geometric Design}, + volume = {21}, + number = {9}, + pages = {837--857}, + year = {2004}, + doi = {10.1016/j.cagd.2004.07.001} +} + @Misc{VE22, author = {Vaughan-Lee, Michael and Eick, Bettina}, title = {SglPPow, Database of groups of prime-power order for some prime-powers, Version 2.3}, diff --git a/experimental/GroebnerWalk/docs/doc.main b/experimental/GroebnerWalk/docs/doc.main index c2415b45ca28..0264d8306ed9 100644 --- a/experimental/GroebnerWalk/docs/doc.main +++ b/experimental/GroebnerWalk/docs/doc.main @@ -1,5 +1,6 @@ [ "Gröbner walk" => [ "introduction.md", + "special-ideals.md" ] ] diff --git a/experimental/GroebnerWalk/docs/src/special-ideals.md b/experimental/GroebnerWalk/docs/src/special-ideals.md new file mode 100644 index 000000000000..6c58ef1fe75a --- /dev/null +++ b/experimental/GroebnerWalk/docs/src/special-ideals.md @@ -0,0 +1,16 @@ +```@meta +CurrentModule = Oscar +``` + +# Special ideals used for benchmarking + +We bundle a couple of special ideals useful for benchmarking of the Gröbner walk. + +```@docs + newell_patch(k::Union{QQField, QQBarFieldElem}, n::Int=1) + newell_patch(k::Field, n::Int=1) +``` + +```@docs + newell_patch_with_orderings(k::Field, n::Int=1) +``` diff --git a/experimental/GroebnerWalk/src/special-ideals.jl b/experimental/GroebnerWalk/src/special-ideals.jl index 6f1a0d4da97b..786b40b0bc54 100644 --- a/experimental/GroebnerWalk/src/special-ideals.jl +++ b/experimental/GroebnerWalk/src/special-ideals.jl @@ -1,25 +1,21 @@ @doc raw""" newell_patch(k::Union{QQField, QQBarFieldElem}, n::Int=1) - -Let $n$ be an integer between 1 and 32. Returns the ideal corresponding to -the implicitization of the $n$-th bi-cubic patch describing -the Newell's teapot as a parametric surface. -""" -function newell_patch(k::Union{QQField, QQBarFieldElem}, n::Int=1) - return get_newell_patch_generators(n) |> ideal -end - -@doc raw""" newell_patch(k::Field, n::Int=1) Let $n$ be an integer between 1 and 32. Returns the ideal corresponding to the implicitization of the $n$-th bi-cubic patch describing the Newell's teapot as a parametric surface. +The specific generators for each patch have been taken from [Tra04](@cite). + For fields $k\neq\mathbb{Q},\bar{\mathbb{Q}}$, this gives a variant of the ideal with integer coefficients. """ +function newell_patch(k::Union{QQField, QQBarFieldElem}, n::Int=1) + return get_newell_patch_generators(n) |> ideal +end + function newell_patch(k::Field, n::Int=1) F = get_newell_patch_generators(n) @@ -35,6 +31,19 @@ function newell_patch(k::Field, n::Int=1) return ideal(integral_F) end +@doc raw""" + newell_patch_with_orderings(k::Field, n::Int=1) + +Let $n$ be an integer between 1 and 32. Returns the ideal corresponding to +the implicitization of the $n$-th bi-cubic patch describing +the Newell's teapot as a parametric surface. +Additionally returns suitable start and target orderings, e.g. for use with the Gröbner walk. + +The specific generators for each patch have been taken from [Tra04](@cite). + +For fields $k\neq\mathbb{Q},\bar{\mathbb{Q}}$, this gives a variant of the ideal with +integer coefficients. +""" function newell_patch_with_orderings(k::Field, n::Int=1) I = newell_patch(k, n) R = base_ring(I) @@ -52,7 +61,7 @@ function get_newell_patch_generators(n::Int) -y + 63//125 * v^2 - 294//125 * v + 56//125 * v^3 - 819//1000 * u^2 * v + 42//125 * u^3 * v - 3//50 * u * v^3 + 351//2000 * u^2 * v^2 + 39//250 * u^2 * v^3 - 9//125 * u^3 * v^2 - 8//125 * u^3 * v^3, -z + 12//5 - 63//160 * u^2 + 63//160 * u ] - else + else # TODO: Add the other patches # TODO: Throw error end end From c4d9d681f467f347c7bb691c6850795559affb10 Mon Sep 17 00:00:00 2001 From: Kamillo Ferry Date: Mon, 5 Aug 2024 11:22:04 +0200 Subject: [PATCH 179/179] Fix missing docstring --- experimental/GroebnerWalk/src/special-ideals.jl | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/experimental/GroebnerWalk/src/special-ideals.jl b/experimental/GroebnerWalk/src/special-ideals.jl index 786b40b0bc54..56f7b6226fe6 100644 --- a/experimental/GroebnerWalk/src/special-ideals.jl +++ b/experimental/GroebnerWalk/src/special-ideals.jl @@ -1,21 +1,29 @@ @doc raw""" newell_patch(k::Union{QQField, QQBarFieldElem}, n::Int=1) - newell_patch(k::Field, n::Int=1) Let $n$ be an integer between 1 and 32. Returns the ideal corresponding to the implicitization of the $n$-th bi-cubic patch describing the Newell's teapot as a parametric surface. The specific generators for each patch have been taken from [Tra04](@cite). - -For fields $k\neq\mathbb{Q},\bar{\mathbb{Q}}$, this gives a variant of the ideal with -integer coefficients. """ function newell_patch(k::Union{QQField, QQBarFieldElem}, n::Int=1) return get_newell_patch_generators(n) |> ideal end +@doc raw""" + newell_patch(k::Field, n::Int=1) + +Let $n$ be an integer between 1 and 32. Returns the ideal corresponding to +the implicitization of the $n$-th bi-cubic patch describing +the Newell's teapot as a parametric surface. + +The specific generators for each patch have been taken from [Tra04](@cite). + +For fields $k\neq\mathbb{Q},\bar{\mathbb{Q}}$, this gives a variant of the ideal with +integer coefficients. +""" function newell_patch(k::Field, n::Int=1) F = get_newell_patch_generators(n)