diff --git a/Project.toml b/Project.toml index c6331f956dd7..c15f772c51b9 100644 --- a/Project.toml +++ b/Project.toml @@ -26,23 +26,23 @@ UUIDs = "cf7118a7-6976-5b1a-9a39-7adc72f591a4" cohomCalg_jll = "5558cf25-a90e-53b0-b813-cadaa3ae7ade" [compat] -AbstractAlgebra = "0.39.0" -AlgebraicSolving = "0.4.10" +AbstractAlgebra = "0.40.0" +AlgebraicSolving = "0.4.11" Distributed = "1.6" DocStringExtensions = "0.8, 0.9" GAP = "0.10.2" -Hecke = "0.28.0" +Hecke = "0.29.0" JSON = "^0.20, ^0.21" JSON3 = "1.13.2" LazyArtifacts = "1.6" -Nemo = "0.42.1" +Nemo = "0.43.0" Pkg = "1.6" Polymake = "0.11.13" Preferences = "1" Random = "1.6" RandomExtensions = "0.4.3" Serialization = "1.6" -Singular = "0.22.0" +Singular = "0.22.3" TOPCOM_jll = "0.17.8" UUIDs = "1.6" cohomCalg_jll = "0.32.0" diff --git a/docs/src/CommutativeAlgebra/rings.md b/docs/src/CommutativeAlgebra/rings.md index 8878bb8e0b9b..60c6d5f35e73 100644 --- a/docs/src/CommutativeAlgebra/rings.md +++ b/docs/src/CommutativeAlgebra/rings.md @@ -25,15 +25,13 @@ of the coefficient ring of the polynomial ring. The basic constructor below allows one to build multivariate polynomial rings: ```@julia -polynomial_ring(C::Ring, V::Vector{String}; ordering=:lex, cached::Bool = true) +polynomial_ring(C::Ring, V::Vector{String}; cached::Bool = true) ``` Its return value is a tuple, say `R, vars`, consisting of a polynomial ring `R` with coefficient ring `C` and a vector `vars` of generators (variables) which print according to the strings in the vector `V` . -The input `ordering=:lex` refers to the lexicograpical monomial ordering which specifies the default way of storing and displaying polynomials in OSCAR (terms are sorted in descending -order). The other possible choices are `:deglex` and `:degrevlex`. Gröbner bases, however, can be computed with respect to any monomial ordering. See the section on Gröbner bases. !!! note - Caching is used to ensure that a given ring constructed from given parameters is unique in the system. For example, there is only one ring of multivariate polynomials over $\mathbb{Z}$ with variables printing as x, y, z, and with `ordering=:lex`. + Caching is used to ensure that a given ring constructed from given parameters is unique in the system. For example, there is only one ring of multivariate polynomials over $\mathbb{Z}$ with variables printing as x, y, z. ###### Examples @@ -264,7 +262,7 @@ grade(R::MPolyRing, W::Vector{<:Vector{<:IntegerUnion}}) grade(R::MPolyRing, W::Vector{<:IntegerUnion}) ``` ```@docs -graded_polynomial_ring(C::Ring, V::Vector{String}, W; ordering=:lex) +graded_polynomial_ring(C::Ring, V::Vector{String}, W) ``` ## Tests on Graded Rings diff --git a/examples/ZeroDec.jl b/examples/ZeroDec.jl index bd4afd851801..2df78ad172af 100644 --- a/examples/ZeroDec.jl +++ b/examples/ZeroDec.jl @@ -27,7 +27,7 @@ before returning the primary decomposition. #OUTPUT: Primary decomposition of I with associated primes in a list function zerodecomp(I::Singular.sideal, outputReduced::Bool = false, usefglm::Bool = false) - if ordering(I.base_ring) != :lex + if Singular.ordering(I.base_ring) != :lex Icopy = changeOrderOfBasering(I, :lex); else Icopy = Singular.deepcopy(I) diff --git a/experimental/GModule/GaloisCohomology.jl b/experimental/GModule/GaloisCohomology.jl index c610f5c32505..7a8e8e928798 100644 --- a/experimental/GModule/GaloisCohomology.jl +++ b/experimental/GModule/GaloisCohomology.jl @@ -88,8 +88,8 @@ end The natural `ZZ[H]` module where `H`, a subgroup of the automorphism group acts on the ray class group. """ -function Oscar.gmodule(H::PermGroup, mR::MapRayClassGrp, mG = automorphism_group(PermGroup, nf(order(codomain((mR)))))[2]) - k = nf(order(codomain(mR))) +function Oscar.gmodule(H::PermGroup, mR::MapRayClassGrp, mG = automorphism_group(PermGroup, Hecke.nf(order(codomain((mR)))))[2]) + k = Hecke.nf(order(codomain(mR))) G = domain(mG) ac = Hecke.induce_action(mR, [image(mG, G(g)) for g = gens(H)]) @@ -145,14 +145,14 @@ function Oscar.gmodule(H::PermGroup, mu::Map{FinGenAbGroup, FacElemMon{AbsSimple return _gmodule(base_ring(codomain(mu)), H, mu, mG) end -function Oscar.gmodule(H::PermGroup, mu::Map{FinGenAbGroup, AbsSimpleNumFieldOrder}, mG = automorphism_group(PermGroup, nf(codomain(mu)))[2]) +function Oscar.gmodule(H::PermGroup, mu::Map{FinGenAbGroup, AbsSimpleNumFieldOrder}, mG = automorphism_group(PermGroup, Hecke.nf(codomain(mu)))[2]) #TODO: preimage for sunits can fail (inf. loop) if # (experimentally) the ideals in S are not coprime or include 1 # or if the s-unit is not in the image (eg. action and not closed set S) u = domain(mu) U = [mu(g) for g = gens(u)] zk = codomain(mu) - k = nf(zk) + k = Hecke.nf(zk) G = domain(mG) ac = [hom(u, u, [preimage(mu, zk(mG(G(g))(k(x)))) for x = U]) for g = gens(H)] return gmodule(H, ac) @@ -1045,7 +1045,7 @@ function Oscar.galois_group(A::ClassField, ::QQField; idel_parent::Union{IdelPar mR = A.rayclassgroupmap mQ = A.quotientmap zk = order(m0) - @req order(automorphism_group(nf(zk))[1]) == degree(zk) "base field must be normal" + @req order(automorphism_group(Hecke.nf(zk))[1]) == degree(zk) "base field must be normal" if gcd(degree(A), degree(base_field(A))) == 1 s, ms = split_extension(gmodule(A)) return permutation_group(s), ms @@ -1060,7 +1060,7 @@ function Oscar.galois_group(A::ClassField, ::QQField; idel_parent::Union{IdelPar @assert Oscar.GrpCoh.istwo_cocycle(a) gA = gmodule(A, idel_parent.mG) qA = cohomology_group(gA, 2) - n = degree(nf(zk)) + n = degree(Hecke.nf(zk)) aa = map_entries(a, parent = gA) do x x = parent(x)(Hecke.mod_sym(x.coeff, gcd(n, degree(A)))) J = ideal(idel_parent, x, coprime = m0) @@ -1125,15 +1125,15 @@ For a 2-cochain with with values in the multiplicative group of a number field, compute the local invariant of the algebra at the completion at the prime ideal or embeddings given. """ -function local_index(CC::GrpCoh.CoChain{2, PermGroupElem, GrpCoh.MultGrpElem{AbsSimpleNumFieldElem}}, P::AbsSimpleNumFieldOrderIdeal, mG::Map = automorphism_group(PermGroup, nf(order(P)))[2]; B = nothing, index_only::Bool = false) +function local_index(CC::GrpCoh.CoChain{2, PermGroupElem, GrpCoh.MultGrpElem{AbsSimpleNumFieldElem}}, P::AbsSimpleNumFieldOrderIdeal, mG::Map = automorphism_group(PermGroup, Hecke.nf(order(P)))[2]; B = nothing, index_only::Bool = false) return local_index([CC], P, mG, B = B, index_only = index_only)[1] end -function local_index(C::GrpCoh.CoChain{2, PermGroupElem, GrpCoh.MultGrpElem{AbsSimpleNumFieldElem}}, emb::Hecke.NumFieldEmb, mG::Map = automorphism_group(PermGroup, nf(order(P)))[2]; index_only::Bool = false) +function local_index(C::GrpCoh.CoChain{2, PermGroupElem, GrpCoh.MultGrpElem{AbsSimpleNumFieldElem}}, emb::Hecke.NumFieldEmb, mG::Map = automorphism_group(PermGroup, Hecke.nf(order(P)))[2]; index_only::Bool = false) return local_index([C], emb, mG)[1] end -function local_index(CC::Vector{GrpCoh.CoChain{2, PermGroupElem, GrpCoh.MultGrpElem{AbsSimpleNumFieldElem}}}, emb::Hecke.NumFieldEmb, mG::Map = automorphism_group(PermGroup, nf(order(P)))[2]; index_only::Bool = false) +function local_index(CC::Vector{GrpCoh.CoChain{2, PermGroupElem, GrpCoh.MultGrpElem{AbsSimpleNumFieldElem}}}, emb::Hecke.NumFieldEmb, mG::Map = automorphism_group(PermGroup, Hecke.nf(order(P)))[2]; index_only::Bool = false) if is_real(emb) return [Hecke.QmodnZ()(0) for x = CC] end @@ -1198,8 +1198,8 @@ function induce_hom(ml::Hecke.CompletionMap, mL::Hecke.CompletionMap, mkK::NumFi return hom(l, L, hom(bl, bL, rt), im_data) end -function local_index(CC::Vector{GrpCoh.CoChain{2, PermGroupElem, GrpCoh.MultGrpElem{AbsSimpleNumFieldElem}}}, P::AbsSimpleNumFieldOrderIdeal, mG::Map = automorphism_group(PermGroup, nf(order(P)))[2]; B::Any = nothing, index_only::Bool = false) - k = nf(order(P)) +function local_index(CC::Vector{GrpCoh.CoChain{2, PermGroupElem, GrpCoh.MultGrpElem{AbsSimpleNumFieldElem}}}, P::AbsSimpleNumFieldOrderIdeal, mG::Map = automorphism_group(PermGroup, Hecke.nf(order(P)))[2]; B::Any = nothing, index_only::Bool = false) + k = Hecke.nf(order(P)) if B !== nothing && haskey(B.lp, P) data = B.lp[P] diff --git a/experimental/GaloisGrp/src/Subfields.jl b/experimental/GaloisGrp/src/Subfields.jl index 7250538a3565..50674544e219 100644 --- a/experimental/GaloisGrp/src/Subfields.jl +++ b/experimental/GaloisGrp/src/Subfields.jl @@ -314,8 +314,8 @@ function _subfields(K::AbsSimpleNumField; pStart = 2*degree(K)+1, prime = 0) @show pr = clog(B, p) @show pr *= div(n,2) @show pr += 2*clog(2*n, p) - H = factor_mod_pk_init(f, p) - @show factor_mod_pk(H, 1) + H = Hecke.factor_mod_pk_init(f, p) + @show Hecke.factor_mod_pk(H, 1) b = basis(K) b .*= inv(derivative(f)(gen(K))) @@ -324,7 +324,7 @@ function _subfields(K::AbsSimpleNumField; pStart = 2*degree(K)+1, prime = 0) bz = [Zx(bd[i]*bt[i]) for i=1:length(bd)] @assert parent(f) == parent(bz[1]) - lf = factor_mod_pk(Array, H, 1) + lf = Hecke.factor_mod_pk(Array, H, 1) #the roots in G are of course roots of the lf[i] #roots that belong to the same factor would give rise #to the same principal subfield. So we can save on LLL calls. @@ -334,7 +334,7 @@ function _subfields(K::AbsSimpleNumField; pStart = 2*degree(K)+1, prime = 0) rt_to_lf = [findall(x->iszero(f[1](x)), r) for f = lf] done = zeros(Int, length(lf)) while true - lf = factor_mod_pk(Array, H, pr) + lf = Hecke.factor_mod_pk(Array, H, pr) ppr = ZZRingElem(p)^pr @assert parent(lf[1][1]) == parent(f) @assert all(x->is_monic(x[1]), lf) diff --git a/experimental/QuadFormAndIsom/src/embeddings.jl b/experimental/QuadFormAndIsom/src/embeddings.jl index dd10d558fdff..98bd143fde62 100644 --- a/experimental/QuadFormAndIsom/src/embeddings.jl +++ b/experimental/QuadFormAndIsom/src/embeddings.jl @@ -170,7 +170,7 @@ function _overlattice(gamma::TorQuadModuleMap, z = zero_matrix(QQ, 0, degree(A)) glue = reduce(vcat, QQMatrix[matrix(QQ, 1, degree(A), g) for g in _glue]; init=z) glue = vcat(basis_matrix(A+B), glue) - Fakeglue = FakeFmpqMat(glue) + Fakeglue = Hecke.FakeFmpqMat(glue) _FakeB = hnf(Fakeglue) _B = QQ(1, denominator(Fakeglue))*change_base_ring(QQ, numerator(_FakeB)) C = lattice(ambient_space(A), _B[end-rank(A)-rank(B)+1:end, :]) @@ -182,7 +182,7 @@ function _overlattice(gamma::TorQuadModuleMap, z = zero_matrix(QQ, 0, degree(cover(D))) glue = reduce(vcat, QQMatrix[matrix(QQ, 1, degree(cover(D)), g) for g in _glue]; init=z) glue = vcat(block_diagonal_matrix(basis_matrix.(ZZLat[A, B])), glue) - Fakeglue = FakeFmpqMat(glue) + Fakeglue = Hecke.FakeFmpqMat(glue) _FakeB = hnf(Fakeglue) _B = QQ(1, denominator(Fakeglue))*change_base_ring(QQ, numerator(_FakeB)) C = lattice(ambient_space(cover(D)), _B[end-rank(A)-rank(B)+1:end, :]) diff --git a/experimental/QuadFormAndIsom/src/hermitian_miranda_morrison.jl b/experimental/QuadFormAndIsom/src/hermitian_miranda_morrison.jl index 6a51c1c18f40..081022e284d7 100644 --- a/experimental/QuadFormAndIsom/src/hermitian_miranda_morrison.jl +++ b/experimental/QuadFormAndIsom/src/hermitian_miranda_morrison.jl @@ -12,7 +12,7 @@ function _get_quotient_split(P::Hecke.RelNumFieldOrderIdeal, i::Int) OE = order(P) - E = nf(OE) + E = Hecke.nf(OE) Eabs, EabstoE = absolute_simple_field(E) Pabs = EabstoE\P @@ -57,7 +57,7 @@ end function _get_quotient_inert(P::Hecke.RelNumFieldOrderIdeal, i::Int) OE = order(P) OK = base_ring(OE) - E = nf(OE) + E = Hecke.nf(OE) K = base_field(E) p = minimum(P) @@ -109,7 +109,7 @@ end function _get_quotient_ramified(P::Hecke.RelNumFieldOrderIdeal, i::Int) OE = order(P) - E = nf(OE) + E = Hecke.nf(OE) p = minimum(P) e = valuation(different(OE), P) @@ -182,7 +182,7 @@ function _get_quotient(O::Hecke.RelNumFieldOrder, p::Hecke.AbsSimpleNumFieldOrde @hassert :ZZLatWithIsom 1 is_prime(p) @hassert :ZZLatWithIsom 1 is_maximal(order(p)) @hassert :ZZLatWithIsom 1 order(p) === base_ring(O) - E = nf(O) + E = Hecke.nf(O) F = prime_decomposition(O, p) P = F[1][1] if i == 0 @@ -489,7 +489,7 @@ end function _is_special(L::HermLat, p::AbsSimpleNumFieldOrderIdeal) OE = base_ring(L) - E = nf(OE) + E = Hecke.nf(OE) lp = prime_decomposition(OE, p) if lp[1][2] != 2 || !iseven(rank(L)) return false @@ -588,14 +588,14 @@ end # the minimum P-valuation among all the non-zero entries of M function _scale_valuation(M::T, P::Hecke.RelNumFieldOrderIdeal) where T <: MatrixElem{Hecke.RelSimpleNumFieldElem{AbsSimpleNumFieldElem}} - @hassert :ZZLatWithIsom 1 nf(order(P)) === base_ring(M) + @hassert :ZZLatWithIsom 1 Hecke.nf(order(P)) === base_ring(M) iszero(M) && return inf return minimum(valuation(v, P) for v in collect(M) if !iszero(v)) end # the minimum P-valuation among all the non-zero diagonal entries of M function _norm_valuation(M::T, P::Hecke.RelNumFieldOrderIdeal) where T <: MatrixElem{Hecke.RelSimpleNumFieldElem{AbsSimpleNumFieldElem}} - @hassert :ZZLatWithIsom 1 nf(order(P)) === base_ring(M) + @hassert :ZZLatWithIsom 1 Hecke.nf(order(P)) === base_ring(M) iszero(diagonal(M)) && return inf r = minimum(valuation(v, P) for v in diagonal(M) if !iszero(v)) return r @@ -671,7 +671,7 @@ end # function _approximate_isometry(H::HermLat, H2::HermLat, g::AutomorphismGroupElem{TorQuadModule}, P::Hecke.RelNumFieldOrderIdeal, e::Int, a::Int, k::Int, res::AbstractSpaceRes) E = base_field(H) - @hassert :ZZLatWithIsom 1 nf(order(P)) === E + @hassert :ZZLatWithIsom 1 Hecke.nf(order(P)) === E ok, b = is_modular(H, minimum(P)) if ok && b == -a return identity_matrix(E, 1) @@ -743,7 +743,7 @@ end # that part is taken from the Sage implementation of Simon Brandhorst function _find_rho(P::Hecke.RelNumFieldOrderIdeal, e::Int) OE = order(P) - E = nf(OE) + E = Hecke.nf(OE) lp = prime_decomposition(OE, minimum(P)) dya = is_dyadic(P) if !dya diff --git a/experimental/Schemes/elliptic_surface.jl b/experimental/Schemes/elliptic_surface.jl index 57ff77e54e91..a4aa8147302e 100644 --- a/experimental/Schemes/elliptic_surface.jl +++ b/experimental/Schemes/elliptic_surface.jl @@ -338,7 +338,7 @@ function weierstrass_model(X::EllipticSurface) @assert has_decomposition_info(default_covering(P)) # Create the singular Weierstrass model S of the elliptic K3 surface X - a = a_invars(E) + a = a_invariants(E) U = affine_charts(P)[1] # the standard Weierstrass chart (x, y, t) = gens(OO(U)) @assert all(denominator(i)==1 for i in a) @@ -1639,7 +1639,7 @@ function _elliptic_parameter_conversion(X::EllipticSurface, u::VarietyFunctionFi f_loc = first(gens(modulus(OO(U)))) @assert f == R_to_kkt_frac_XY(f_loc) && _is_in_weierstrass_form(f) "local equation is not in Weierstrass form" - a = a_invars(E) + a = a_invariants(E) u_loc = u[U]::AbstractAlgebra.Generic.FracFieldElem # the representative on the Weierstrass chart diff --git a/src/AlgebraicGeometry/Surfaces/K3Auto.jl b/src/AlgebraicGeometry/Surfaces/K3Auto.jl index ce64ad6677b8..084a97972961 100644 --- a/src/AlgebraicGeometry/Surfaces/K3Auto.jl +++ b/src/AlgebraicGeometry/Surfaces/K3Auto.jl @@ -561,7 +561,7 @@ end function short_vectors_affine(gram::MatrixElem, v::MatrixElem, alpha::QQFieldElem, d) # find a solution = alpha with x in L if it exists w = gram*transpose(v) - tmp = FakeFmpqMat(w) + tmp = Hecke.FakeFmpqMat(w) wn = numerator(tmp) wd = denominator(tmp) b, x = can_solve_with_solution(transpose(wn), matrix(ZZ, 1, 1, [alpha*wd]); side = :right) @@ -1074,7 +1074,7 @@ function _alg58_close_vector(data::BorcherdsCtx, w::ZZMatrix) # to avoid repeated calculation of the same stuff e.g. K and Q # find a solution = alpha with x in L if it exists ww = transpose(wS) - tmp = FakeFmpqMat(ww) + tmp = Hecke.FakeFmpqMat(ww) wn = numerator(tmp) wd = denominator(tmp) K = kernel(wn; side = :left) @@ -1156,7 +1156,7 @@ function _walls_of_chamber(data::BorcherdsCtx, weyl_vector, algorithm::Symbol=:s d = rank(data.S) walls = Vector{ZZMatrix}(undef,d) for i in 1:d - vs = numerator(FakeFmpqMat(walls1[i])) + vs = numerator(Hecke.FakeFmpqMat(walls1[i])) g = gcd(_vec(vs)) if g != 1 vs = divexact(vs, g) @@ -1174,7 +1174,7 @@ function _walls_of_chamber(data::BorcherdsCtx, weyl_vector, algorithm::Symbol=:s for i in 1:d v = matrix(QQ, 1, degree(data.SS), r[i]) # rescale v to be primitive in S - vs = numerator(FakeFmpqMat(v)) + vs = numerator(Hecke.FakeFmpqMat(v)) g = gcd(_vec(vs)) if g!=1 vs = divexact(vs, g) diff --git a/src/Groups/matrices/iso_nf_fq.jl b/src/Groups/matrices/iso_nf_fq.jl index d839f268c980..2e7457e741cd 100644 --- a/src/Groups/matrices/iso_nf_fq.jl +++ b/src/Groups/matrices/iso_nf_fq.jl @@ -54,7 +54,7 @@ end # Small helper function to make the reduction call uniform function _reduce(M::MatrixElem{AbsSimpleNumFieldElem}, OtoFq) - e = extend(OtoFq, nf(domain(OtoFq))) + e = extend(OtoFq, Hecke.nf(domain(OtoFq))) return map_entries(e, M) end diff --git a/src/InvariantTheory/types.jl b/src/InvariantTheory/types.jl index 299a63eff4a7..c300cff9853f 100644 --- a/src/InvariantTheory/types.jl +++ b/src/InvariantTheory/types.jl @@ -53,8 +53,9 @@ mutable struct InvRing{FldT, GrpT, PolyRingElemT, PolyRingT, ActionT} field::FldT poly_ring::PolyRingT - # The underlying polynomial ring needs to be created with ordering = :degrevlex - # for the application of divrem in the secondary and fundamental invariants. + # The underlying polynomial ring needs to be created with + # internal_ordering = :degrevlex for the application of divrem in the secondary + # and fundamental invariants. # If the user gave us a polynomial ring (which is stored in poly_ring), this # might not be the case. poly_ring_internal::PolyRingT @@ -78,7 +79,7 @@ mutable struct InvRing{FldT, GrpT, PolyRingElemT, PolyRingT, ActionT} n = degree(G) # We want to use divrem w.r.t. degrevlex for the computation of secondary # invariants and fundamental invariants - R, = graded_polynomial_ring(K, "x" => 1:n, cached = false, ordering = :degrevlex) + R, = graded_polynomial_ring(K, "x" => 1:n, cached = false, internal_ordering = :degrevlex) return InvRing(K, G, action, R) end @@ -103,8 +104,8 @@ mutable struct InvRing{FldT, GrpT, PolyRingElemT, PolyRingT, ActionT} # We want to use divrem w.r.t. degrevlex for the computation of secondary # invariants and fundamental invariants - if ordering(poly_ring) != :degrevlex - z.poly_ring_internal, _ = graded_polynomial_ring(K, ngens(poly_ring), cached = false, ordering = :degrevlex) + if internal_ordering(poly_ring) != :degrevlex + z.poly_ring_internal, _ = graded_polynomial_ring(K, ngens(poly_ring), cached = false, internal_ordering = :degrevlex) end return z diff --git a/src/Modules/UngradedModules/FreeResolutions.jl b/src/Modules/UngradedModules/FreeResolutions.jl index 088a9c9bb7e4..de1e53c24f87 100644 --- a/src/Modules/UngradedModules/FreeResolutions.jl +++ b/src/Modules/UngradedModules/FreeResolutions.jl @@ -229,7 +229,7 @@ function _extend_free_resolution(cc::Hecke.ComplexOfMorphisms, idx::Int) # Finalize maps. if slen < len Z = FreeMod(br, 0) - set_attribute!(Z, :name => "0") + AbstractAlgebra.set_name!(Z, "0") pushfirst!(cc, hom(Z, domain(cc.maps[1]), Vector{elem_type(domain(cc.maps[1]))}(); check=false)) cc.complete = true end @@ -382,7 +382,7 @@ function free_resolution(M::SubquoModule{<:MPolyRingElem}; dom = free_module(br, rk) SM = SubModuleOfFreeModule(codom, res[j]) #generator_matrix(SM) - set_attribute!(dom, :name => "$br_name^$rk") + AbstractAlgebra.set_name!(dom, "$br_name^$rk") insert!(maps, 1, hom(dom, codom, gens(SM); check=false)) j += 1 end @@ -394,7 +394,7 @@ function free_resolution(M::SubquoModule{<:MPolyRingElem}; else Z = FreeMod(br, 0) end - set_attribute!(Z, :name => "0") + AbstractAlgebra.set_name!(Z, "0") insert!(maps, 1, hom(Z, domain(maps[1]), Vector{elem_type(domain(maps[1]))}(); check=false)) end @@ -430,7 +430,7 @@ function free_resolution(M::SubquoModule{T}) where {T<:RingElem} K, inc = kernel(map(C, i)) nz = findall(x->!iszero(x), gens(K)) F = FreeMod(R, length(nz)) - iszero(length(nz)) && set_attribute!(F, :name => "0") + iszero(length(nz)) && AbstractAlgebra.set_name!(F, "0") phi = hom(F, C[i], iszero(length(nz)) ? elem_type(C[i])[] : inc.(gens(K)[nz]); check=false) pushfirst!(C.maps, phi) end @@ -461,7 +461,7 @@ function free_resolution_via_kernels(M::SubquoModule, limit::Int = -1) h = graded_map(domain(mp[1]), Vector{elem_type(domain(mp[1]))}(); check=false) else Z = FreeMod(base_ring(M), 0) - set_attribute!(Z, :name => "0") + AbstractAlgebra.set_name!(Z, "0") h = hom(Z, domain(mp[1]), Vector{elem_type(domain(mp[1]))}(); check=false) end insert!(mp, 1, h) diff --git a/src/Modules/UngradedModules/Presentation.jl b/src/Modules/UngradedModules/Presentation.jl index 9f6af19307e0..b538351f8245 100644 --- a/src/Modules/UngradedModules/Presentation.jl +++ b/src/Modules/UngradedModules/Presentation.jl @@ -100,7 +100,7 @@ function _presentation_graded(SQ::SubquoModule) R = base_ring(SQ) # Prepare to set some names - br_name = AbstractAlgebra.find_name(R) + br_name = AbstractAlgebra.get_name(R) if br_name === nothing br_name = "br" end @@ -117,14 +117,14 @@ function _presentation_graded(SQ::SubquoModule) F0_to_SQ = graded_map(SQ, gens(SQ); check=false) F0_to_SQ.generators_map_to_generators = true F0 = domain(F0_to_SQ) - set_attribute!(F0, :name => "$br_name^$(ngens(SQ.sub))") + AbstractAlgebra.set_name!(F0, "$br_name^$(ngens(SQ.sub))") K, inc_K = kernel(F0_to_SQ) F1_to_F0 = graded_map(F0, images_of_generators(inc_K)) F1 = domain(F1_to_F0) #F1 = graded_free_module(R, [degree(x; check=false) for x in images_of_generators(inc_K)]) #F1_to_F0 = hom(F1, F0, images_of_generators(inc_K), check=false) - set_attribute!(F1, :name => "$br_name^$(ngens(F1))") + AbstractAlgebra.set_name!(F1, "$br_name^$(ngens(F1))") # When there is no kernel, clean things up if is_zero(F1) @@ -134,7 +134,7 @@ function _presentation_graded(SQ::SubquoModule) # prepare the end of the presentation Z = graded_free_module(R, elem_type(grading_group(R))[]) - set_attribute!(Z, :name => "0") + AbstractAlgebra.set_name!(Z, "0") SQ_to_Z = hom(SQ, Z, elem_type(Z)[zero(Z) for i in 1:ngens(SQ)]; check=false) # compile the presentation complex @@ -149,7 +149,7 @@ function _presentation_simple(SQ::SubquoModule) R = base_ring(SQ) # Prepare to set some names - br_name = AbstractAlgebra.find_name(R) + br_name = AbstractAlgebra.get_name(R) if br_name === nothing br_name = "br" end @@ -158,14 +158,14 @@ function _presentation_simple(SQ::SubquoModule) F0 = FreeMod(R, length(gens(SQ))) F0_to_SQ = hom(F0, SQ, gens(SQ); check=false) F0_to_SQ.generators_map_to_generators = true - set_attribute!(F0, :name => "$br_name^$(ngens(SQ.sub))") + AbstractAlgebra.set_name!(F0, "$br_name^$(ngens(SQ.sub))") K, inc_K = kernel(F0_to_SQ) @assert codomain(inc_K) === F0 @assert all(x->parent(x) === F0, images_of_generators(inc_K)) F1 = FreeMod(R, ngens(K)) F1_to_F0 = hom(F1, F0, images_of_generators(inc_K), check=false) - set_attribute!(F1, :name => "$br_name^$(ngens(F1))") + AbstractAlgebra.set_name!(F1, "$br_name^$(ngens(F1))") # When there is no kernel, clean things up if is_zero(F1) @@ -175,7 +175,7 @@ function _presentation_simple(SQ::SubquoModule) # prepare the end of the presentation Z = FreeMod(R, 0) - set_attribute!(Z, :name => "0") + AbstractAlgebra.set_name!(Z, "0") SQ_to_Z = hom(SQ, Z, elem_type(Z)[zero(Z) for i in 1:ngens(SQ)]; check=false) # compile the presentation complex diff --git a/src/NumberTheory/GaloisGrp/RelGalois.jl b/src/NumberTheory/GaloisGrp/RelGalois.jl index a7da59bb1744..440916886fbb 100644 --- a/src/NumberTheory/GaloisGrp/RelGalois.jl +++ b/src/NumberTheory/GaloisGrp/RelGalois.jl @@ -16,7 +16,7 @@ end function GaloisCtx(f::PolyRingElem{AbsSimpleNumFieldElem}, P::AbsSimpleNumFieldOrderIdeal) k = base_ring(f) - @assert k == nf(order(P)) + @assert k == Hecke.nf(order(P)) zk = order(P) C, mC = Hecke.completion_easy(k, P) setprecision!(C, 10) @@ -174,7 +174,7 @@ function isinteger(C::GaloisCtx{Hecke.vanHoeijCtx}, y::BoundRingElem{ZZRingElem} P = C.C.P zk = order(P) if any(i->!iszero(coeff(x, i)), 1:length(x)-1) - return false, zero(nf(zk)) + return false, zero(Hecke.nf(zk)) end mkc = C.data[1] c = codomain(mkc) @@ -183,7 +183,7 @@ function isinteger(C::GaloisCtx{Hecke.vanHoeijCtx}, y::BoundRingElem{ZZRingElem} P = C.C.P zk = order(P) x *= map_coeff(C, C.data[5]) #the den - a = nf(zk)(Hecke.reco(zk(preimage(mkc, c(coeff(x, 0)))), C.C.Ml, C.C.pMr)) + a = Hecke.nf(zk)(Hecke.reco(zk(preimage(mkc, c(coeff(x, 0)))), C.C.Ml, C.C.pMr)) a = a*inv(C.data[5]) if ceil(ZZRingElem, length(a)) <= value(y)^2 return true, a @@ -210,7 +210,7 @@ function bound_to_precision(C::GaloisCtx{Hecke.vanHoeijCtx}, y::BoundRingElem{ZZ #step 2: copy the precision estimate from NumField/NfAbs/PolyFactor.jl P = C.C.P zk = order(P) - k = nf(zk) + k = Hecke.nf(zk) N = ceil(Int, degree(k)/2/log(norm(P))*(log(c1*c2) + 2*log(v))) return N end diff --git a/src/NumberTheory/NmbThy.jl b/src/NumberTheory/NmbThy.jl index 50a04d723f84..ea2f8a3f30ab 100644 --- a/src/NumberTheory/NmbThy.jl +++ b/src/NumberTheory/NmbThy.jl @@ -44,10 +44,10 @@ norm_equation(R::AbsNumFieldOrder, k::Base.Integer; abs::Bool = false) = norm_eq function norm_equation_fac_elem(R::Hecke.RelNumFieldOrder{AbsSimpleNumFieldElem,Hecke.AbsSimpleNumFieldOrderFractionalIdeal}, a::AbsNumFieldOrderElem{AbsSimpleNumField,AbsSimpleNumFieldElem}) @assert Hecke.is_maximal(R) - Ka, mKa, mkK = absolute_field(nf(R)) + Ka, mKa, mkK = absolute_field(Hecke.nf(R)) Ra = maximal_order(Ka) class_group(Ra) - k = nf(parent(a)) + k = Hecke.nf(parent(a)) class_group(parent(a)) lp = factor(Ra(mkK(k(a)))*Ra) @@ -253,5 +253,5 @@ julia> disc_log(gen(F), a) """ function disc_log(b::T, x::T) where {T <: FinFieldElem} @assert parent(b) === parent(x) - return disc_log_bs_gs(b, x, order(parent(b))) + return Hecke.disc_log_bs_gs(b, x, order(parent(b))) end diff --git a/src/Rings/NumberField.jl b/src/Rings/NumberField.jl index 66c98ceb6afd..1e57dedb3dff 100644 --- a/src/Rings/NumberField.jl +++ b/src/Rings/NumberField.jl @@ -522,7 +522,7 @@ for t in [Base.Integer, Base.Rational{<:Base.Integer}, ZZRingElem, QQFieldElem] end function (K::NfNSGen{T, S})(x::AbsNumFieldOrderElem{NfNSGen{T, S}, <:Any}) where {T, S} - @req nf(parent(x)) === K "Parent of element must be an order of the number field" + @req Hecke.nf(parent(x)) === K "Parent of element must be an order of the number field" return elem_in_nf(x) end @@ -619,13 +619,13 @@ function elem_to_mat_row!(M::ZZMatrix, i::Int, d::ZZRingElem, a::NfNSGenElem{QQF end function basis_matrix(v::Vector{NfNSGenElem{QQFieldElem, QQMPolyRingElem}}, - ::Type{FakeFmpqMat}) + ::Type{Hecke.FakeFmpqMat}) d = degree(parent(v[1])) z = zero_matrix(FlintQQ, length(v), d) for i in 1:length(v) elem_to_mat_row!(z, i, v[i]) end - return FakeFmpqMat(z) + return Hecke.FakeFmpqMat(z) end ################################################################################ diff --git a/src/Rings/PBWAlgebra.jl b/src/Rings/PBWAlgebra.jl index 01336c8bd689..d7f9d7afd4a4 100644 --- a/src/Rings/PBWAlgebra.jl +++ b/src/Rings/PBWAlgebra.jl @@ -529,7 +529,7 @@ function _opposite(a::PBWAlgRing{T, S}) where {T, S} n = length(revs) bsring = Singular.PluralRing{S}(ptr, a.sring.base_ring, revs) bspolyring, _ = Singular.polynomial_ring(a.sring.base_ring, - revs, ordering = ordering(bsring)) + revs, ordering = Singular.ordering(bsring)) bsrel = Singular.zero_matrix(bspolyring, n, n) for i in 1:n-1, j in i+1:n bsrel[i,j] = _unsafe_coerce(bspolyring, a.relations[n+1-j,n+1-i], true) diff --git a/src/Rings/groebner.jl b/src/Rings/groebner.jl index 8e197377a66c..27f78a457047 100644 --- a/src/Rings/groebner.jl +++ b/src/Rings/groebner.jl @@ -318,13 +318,13 @@ See [Fau99](@cite) for more information. # Examples ```jldoctest -julia> R,(x,y,z) = polynomial_ring(GF(101), ["x","y","z"], ordering=:degrevlex) +julia> R,(x,y,z) = polynomial_ring(GF(101), ["x","y","z"]) (Multivariate polynomial ring in 3 variables over GF(101), FqMPolyRingElem[x, y, z]) julia> I = ideal(R, [x+2*y+2*z-1, x^2+2*y^2+2*z^2-x, 2*x*y+2*y*z-y]) Ideal generated by x + 2*y + 2*z + 100 - x^2 + 2*y^2 + 2*z^2 + 100*x + x^2 + 100*x + 2*y^2 + 2*z^2 2*x*y + 2*y*z + 100*y julia> groebner_basis_f4(I) diff --git a/src/Rings/mpoly-graded.jl b/src/Rings/mpoly-graded.jl index de98e5464319..782383a31a51 100644 --- a/src/Rings/mpoly-graded.jl +++ b/src/Rings/mpoly-graded.jl @@ -2163,7 +2163,7 @@ Return the ideal in the underlying ungraded ring. """ forget_grading(I::MPolyIdeal{<:MPolyDecRingElem}) = forget_decoration(I) -Generic.ordering(S::MPolyDecRing) = ordering(S.R) +Generic.internal_ordering(S::MPolyDecRing) = internal_ordering(S.R) #############truncation############# diff --git a/src/Rings/mpoly-ideals.jl b/src/Rings/mpoly-ideals.jl index 2e9b7d7a9281..16924fec7bc5 100644 --- a/src/Rings/mpoly-ideals.jl +++ b/src/Rings/mpoly-ideals.jl @@ -1959,7 +1959,6 @@ julia> grassmann_pluecker_ideal(R, 2, 4) Ideal generated by x[1, 1]*x[2, 3] + 6*x[2, 1]*x[1, 3] + x[1, 2]*x[2, 2] ``` - """ function grassmann_pluecker_ideal(ring::MPolyRing, subspace_dimension::Int, diff --git a/src/Rings/mpoly.jl b/src/Rings/mpoly.jl index 7e0b185185cb..c4864147b7e0 100644 --- a/src/Rings/mpoly.jl +++ b/src/Rings/mpoly.jl @@ -158,7 +158,7 @@ mutable struct IdealGens{S} r.isGB = S.isGB r.isReduced = isReduced if T <: Union{MPolyRing, MPolyRingLoc} - r.ord = monomial_ordering(Ox, ordering(base_ring(S))) + r.ord = monomial_ordering(Ox, Singular.ordering(base_ring(S))) end r.keep_ordering = true return r @@ -311,7 +311,7 @@ function singular_generators(B::IdealGens, monorder::MonomialOrdering=default_or singular_assure(B) # in case of quotient rings, monomial ordering is ignored so far in singular_poly_ring isa(B.gens.Ox, MPolyQuoRing) && return B.gens.S - isdefined(B, :ord) && B.ord == monorder && monomial_ordering(B.Ox, ordering(base_ring(B.S))) == B.ord && return B.gens.S + isdefined(B, :ord) && B.ord == monorder && monomial_ordering(B.Ox, Singular.ordering(base_ring(B.S))) == B.ord && return B.gens.S SR = singular_poly_ring(B.Ox, monorder) f = Singular.AlgebraHomomorphism(B.Sx, SR, gens(SR)) return Singular.map_ideal(f, B.gens.S) @@ -544,7 +544,7 @@ function singular_poly_ring(Rx::MPolyRing{T}; keep_ordering::Bool = false) where if keep_ordering return Singular.polynomial_ring(singular_coeff_ring(base_ring(Rx)), _variables_for_singular(symbols(Rx)), - ordering = ordering(Rx), + ordering = internal_ordering(Rx), cached = false)[1] else return Singular.polynomial_ring(singular_coeff_ring(base_ring(Rx)), @@ -613,7 +613,7 @@ Fields: function MPolyIdeal(Ox::T, s::Singular.sideal) where {T <: MPolyRing} r = MPolyIdeal(IdealGens(Ox, s)) #=if s.isGB - ord = monomial_ordering(Ox, ordering(base_ring(s))) + ord = monomial_ordering(Ox, Singular.ordering(base_ring(s))) r.ord = ord r.isGB = true r.gb[ord] = r.gens diff --git a/src/exports.jl b/src/exports.jl index d326c628d8e4..df002cd2f7f0 100644 --- a/src/exports.jl +++ b/src/exports.jl @@ -1117,6 +1117,7 @@ export orbit_polytope export orbit_representatives_and_stabilizers export orbits export order, has_order, set_order +export ordering export order_field_of_definition export orders_centralizers export orders_class_representatives diff --git a/src/imports.jl b/src/imports.jl index b17da7fc48b9..f2df7ed9bc66 100644 --- a/src/imports.jl +++ b/src/imports.jl @@ -101,7 +101,7 @@ import AbstractAlgebra: NCRingElem, number_of_generators, number_of_variables, - ordering, + internal_ordering, parent_type, polynomial_ring, PolyRing, diff --git a/test/InvariantTheory/fundamental_invariants.jl b/test/InvariantTheory/fundamental_invariants.jl index 58a6ac09dd1e..609c8ea57a53 100644 --- a/test/InvariantTheory/fundamental_invariants.jl +++ b/test/InvariantTheory/fundamental_invariants.jl @@ -1,8 +1,8 @@ @testset "Fundamental invariants (for matrix groups)" begin # Char 0 K, a = cyclotomic_field(3, "a") - # Force use of internal polynomial_ring with ordering = :lex - R, _ = graded_polynomial_ring(K, 3, ordering = :lex) + # Force use of internal polynomial_ring with internal_ordering = :lex + R, _ = graded_polynomial_ring(K, 3, internal_ordering = :lex) M1 = matrix(K, 3, 3, [ 0, 1, 0, 0, 0, 1, 1, 0, 0 ]) M2 = matrix(K, 3, 3, [ 1, 0, 0, 0, a, 0, 0, 0, -a - 1 ]) RG0 = invariant_ring(R, matrix_group(M1, M2)) diff --git a/test/InvariantTheory/invariant_rings.jl b/test/InvariantTheory/invariant_rings.jl index d1f135b371f8..b6999af78eed 100644 --- a/test/InvariantTheory/invariant_rings.jl +++ b/test/InvariantTheory/invariant_rings.jl @@ -9,7 +9,7 @@ invariant_ring(K, [ M1, M2 ]) invariant_ring(matrix_group([ M1, M2 ])) - R, _ = graded_polynomial_ring(K, 3, "x", ones(Int, 3), ordering = :degrevlex) + R, _ = graded_polynomial_ring(K, 3, "x", ones(Int, 3), internal_ordering = :degrevlex) @test polynomial_ring(invariant_ring(R, [ M1, M2 ])) === R @test polynomial_ring(invariant_ring(R, M1, M2)) === R @test polynomial_ring(invariant_ring(R, matrix_group(M1, M2))) === R @@ -118,7 +118,7 @@ end F3 = GF(3) RGM = invariant_ring(F3, G) # char. p, modular - R, _ = graded_polynomial_ring(K, 3, "x", ones(Int, 3), ordering = :degrevlex) + R, _ = graded_polynomial_ring(K, 3, "x", ones(Int, 3), internal_ordering = :degrevlex) @test polynomial_ring(invariant_ring(R, G)) === R @test coefficient_ring(RGQ) == QQ diff --git a/test/InvariantTheory/secondary_invariants.jl b/test/InvariantTheory/secondary_invariants.jl index 105a07fe4d36..d60f8b141dd8 100644 --- a/test/InvariantTheory/secondary_invariants.jl +++ b/test/InvariantTheory/secondary_invariants.jl @@ -1,7 +1,7 @@ @testset "Secondary invariants (for matrix groups)" begin K, a = cyclotomic_field(3, "a") - # Force use of internal polynomial_ring with ordering = :lex - R, _ = graded_polynomial_ring(K, 3, ordering = :lex) + # Force use of internal polynomial_ring with internal_ordering = :lex + R, _ = graded_polynomial_ring(K, 3, internal_ordering = :lex) M1 = matrix(K, 3, 3, [ 0, 1, 0, 1, 0, 0, 0, 0, 1 ]) M2 = matrix(K, 3, 3, [ 1, 0, 0, 0, a, 0, 0, 0, -a - 1 ]) RG0 = invariant_ring(R, matrix_group(M1, M2)) diff --git a/test/Rings/NumberField.jl b/test/Rings/NumberField.jl index 5f4a3edb9ea3..5e7c20b65c50 100644 --- a/test/Rings/NumberField.jl +++ b/test/Rings/NumberField.jl @@ -206,7 +206,7 @@ if Bk == FlintQQ for i in 1:10 BB = [rand(K, -2:2) for j in 1:rand(1:10)] - M = @inferred basis_matrix(BB, FakeFmpqMat) + M = @inferred basis_matrix(BB, Hecke.FakeFmpqMat) @test nrows(M) == length(BB) @test ncols(M) == degree(K) for n in 1:nrows(M) diff --git a/test/Rings/groebner.jl b/test/Rings/groebner.jl index 5005d865b830..a06d2e390259 100644 --- a/test/Rings/groebner.jl +++ b/test/Rings/groebner.jl @@ -147,7 +147,7 @@ end end @testset "f4" begin - R, (x1,x2,x3,x4) = polynomial_ring(GF(next_prime(2^28)), ["x1", "x2", "x3", "x4"], ordering=:degrevlex) + R, (x1,x2,x3,x4) = polynomial_ring(GF(next_prime(2^28)), ["x1", "x2", "x3", "x4"]) I = 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, diff --git a/test/Rings/mpoly.jl b/test/Rings/mpoly.jl index 01eceacb8aee..7d46fd7ce031 100644 --- a/test/Rings/mpoly.jl +++ b/test/Rings/mpoly.jl @@ -232,14 +232,16 @@ end # are native to singular while FpFieldElem now has a proper wrapper for Zn in [residue_ring(ZZ, 11)[1], residue_ring(ZZ, ZZRingElem(10)^50+151)[1], GF(11), GF(ZZRingElem(10)^50+151)] - R, (x, y) = polynomial_ring(Zn, ["x", "y"], ordering = :degrevlex) + # Setting the internal_ordering is necessary for divrem to use the correct ordering + R, (x, y) = polynomial_ring(Zn, ["x", "y"], internal_ordering = :degrevlex) l = [x*y+x^3+1, x*y^2+x^2+1] g = gens(groebner_basis(ideal(R, l); ordering = degrevlex(gens(R)))) @test iszero(divrem(l[1] + l[2], g)[2]) end F, a = finite_field(11, 2, "a") - R, (x, y, z) = polynomial_ring(F, ["x", "y", "z"], ordering = :degrevlex) + # Setting the internal_ordering is necessary for divrem to use the correct ordering + R, (x, y, z) = polynomial_ring(F, ["x", "y", "z"], internal_ordering = :degrevlex) l = [3*x^5 + a*x*y^2 + a^2*z^2, z^3*x^2 + 7*y^3 + z] gb = gens(groebner_basis(ideal(R, l); ordering = degrevlex(gens(R)))) @test iszero(divrem(l[1] + l[2], gb)[2]) @@ -298,7 +300,7 @@ end end @testset "Grassmann Plücker Relations" begin - R, x = polynomial_ring(residue_ring(ZZ, 7)[1], "x" => (1:2, 1:3), ordering=:degrevlex) + R, x = polynomial_ring(residue_ring(ZZ, 7)[1], "x" => (1:2, 1:3)) test_ideal = ideal([x[1, 2]*x[2, 2] + 6*x[2, 1]*x[1, 3] + x[1, 1]*x[2, 3]]) @test grassmann_pluecker_ideal(R, 2, 4) == test_ideal end diff --git a/test/Rings/orderings.jl b/test/Rings/orderings.jl index a0f7c397db45..522d2373e6b5 100644 --- a/test/Rings/orderings.jl +++ b/test/Rings/orderings.jl @@ -168,7 +168,8 @@ end (leading_coefficient(f), leading_exponent(f)) Fp = GF(7) - R, (x, y, z) = polynomial_ring(Fp, 3, ordering = :deglex) + # Explicitly using an ordering different from the internal_ordering + R, (x, y, z) = polynomial_ring(Fp, 3, internal_ordering = :deglex) f = x*y + 5*z^3 @test collect(monomials(f; ordering = lex(R))) == [ x*y, z^3 ] @test leading_monomial(f; ordering = lex(R)) == x*y @@ -322,7 +323,7 @@ end negdeglex([x,y,s])*negdegrevlex([t,u]), negwdeglex([x,y,s],[1,2,3])*negwdegrevlex([t,u],[1,2])) @test O == monomial_ordering(R, singular(O)) - @test O == monomial_ordering(R, ordering(singular_poly_ring(R, O))) + @test O == monomial_ordering(R, Singular.ordering(singular_poly_ring(R, O))) end @test_throws ErrorException monomial_ordering(R, Singular.ordering_lp(4))