Skip to content

Commit

Permalink
Bump dependencies (#3667)
Browse files Browse the repository at this point in the history
* Bump dependencies

* Remove moved aliases

* Add `base_ring_type` methods

* React to Nemocas/AbstractAlgebra.jl#1675

* React to Nemocas/Nemo.jl#1720

* Add QQBarField disambiguation method

* Require AA 0.41.2 with `Generic.hom` fix

* Add `base_ring(::QQAbField)`

* Fix doctests

* Fix booktests
  • Loading branch information
lgoettgens authored May 4, 2024
1 parent 7791e40 commit c6300cf
Show file tree
Hide file tree
Showing 53 changed files with 150 additions and 245 deletions.
8 changes: 4 additions & 4 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,22 +25,22 @@ UUIDs = "cf7118a7-6976-5b1a-9a39-7adc72f591a4"
cohomCalg_jll = "5558cf25-a90e-53b0-b813-cadaa3ae7ade"

[compat]
AbstractAlgebra = "0.40.8"
AbstractAlgebra = "0.41.3"
AlgebraicSolving = "0.4.11"
Distributed = "1.6"
DocStringExtensions = "0.8, 0.9"
GAP = "0.10.2"
Hecke = "0.30.11"
Hecke = "0.31.3"
JSON = "^0.20, ^0.21"
JSON3 = "1.13.2"
LazyArtifacts = "1.6"
Nemo = "0.43.3"
Nemo = "0.44.0"
Pkg = "1.6"
Polymake = "0.11.14"
Random = "1.6"
RandomExtensions = "0.4.3"
Serialization = "1.6"
Singular = "0.22.4"
Singular = "0.23.0"
TOPCOM_jll = "0.17.8"
UUIDs = "1.6"
cohomCalg_jll = "0.32.0"
Expand Down
2 changes: 1 addition & 1 deletion docs/src/CommutativeAlgebra/rings.md
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ julia> R, (x, y) = polynomial_ring(QQ, ["x", "y"])
(Multivariate polynomial ring in 2 variables over QQ, QQMPolyRingElem[x, y])
julia> B = MPolyBuildCtx(R)
Builder for an element of Multivariate polynomial ring in 2 variables over QQ
Builder for an element of multivariate polynomial ring
julia> for i = 1:5 push_term!(B, QQ(i), [i, i-1]) end
Expand Down
8 changes: 4 additions & 4 deletions docs/src/NumberTheory/galois.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,10 @@ julia> F, a = function_field(x^6 + 108*t^2 + 108*t + 27);
julia> subfields(F)
4-element Vector{Any}:
(Function Field over Rational field with defining polynomial a^3 + 54*t + 27, (1//12*_a^4 + (3//2*t + 3//4)*_a)//(t + 1//2))
(Function Field over Rational field with defining polynomial a^2 + 108*t^2 + 108*t + 27, _a^3)
(Function Field over Rational field with defining polynomial a^3 - 108*t^2 - 108*t - 27, -_a^2)
(Function Field over Rational field with defining polynomial a^3 - 54*t - 27, (-1//12*_a^4 + (3//2*t + 3//4)*_a)//(t + 1//2))
(Function Field over QQ with defining polynomial a^3 + 54*t + 27, (1//12*_a^4 + (3//2*t + 3//4)*_a)//(t + 1//2))
(Function Field over QQ with defining polynomial a^2 + 108*t^2 + 108*t + 27, _a^3)
(Function Field over QQ with defining polynomial a^3 - 108*t^2 - 108*t - 27, -_a^2)
(Function Field over QQ with defining polynomial a^3 - 54*t - 27, (-1//12*_a^4 + (3//2*t + 3//4)*_a)//(t + 1//2))
julia> galois_group(F)
(Permutation group of degree 6 and order 6, Galois context for s^6 + 108*t^2 + 540*t + 675)
Expand Down
7 changes: 4 additions & 3 deletions experimental/GModule/Cohomology.jl
Original file line number Diff line number Diff line change
Expand Up @@ -380,8 +380,8 @@ function Oscar.direct_product(C::GModule...; task::Symbol = :none)
@assert all(x->x.G == G, C)
mM, pro, inj = direct_product([x.M for x = C]..., task = :both)

mC = gmodule(G, [direct_sum(mM, mM, [action(C[i], g) for i=1:length(C)]) for g = gens(G)])
mC.iac = [direct_sum(mM, mM, [action(C[i], inv(g)) for i=1:length(C)]) for g = gens(G)]
mC = gmodule(G, [hom_direct_sum(mM, mM, [action(C[i], g) for i=1:length(C)]) for g = gens(G)])
mC.iac = [hom_direct_sum(mM, mM, [action(C[i], inv(g)) for i=1:length(C)]) for g = gens(G)]

if task == :none
return mC
Expand All @@ -403,7 +403,7 @@ function Oscar.tensor_product(C::GModule{<:Any, FinGenAbGroup}...; task::Symbol
@assert all(x->x.G == C[1].G, C)

T, mT = Oscar.tensor_product([x.M for x = C]...; task = :map)
TT = gmodule(T, C[1].G, [hom(T, T, [action(C[i], g) for i=1:length(C)]) for g = gens(C[1].G)])
TT = gmodule(T, C[1].G, [hom_tensor(T, T, [action(C[i], g) for i=1:length(C)]) for g = gens(C[1].G)])
if task == :map
return TT, mT
else
Expand Down Expand Up @@ -492,6 +492,7 @@ _rank(M) = rank(M)

Oscar.dim(C::GModule) = _rank(C.M)
Oscar.base_ring(C::GModule) = base_ring(C.M)
Oscar.base_ring_type(::Type{GModule{gT, mT}}) where {gT, mT} = base_ring_type(mT)
Oscar.group(C::GModule) = C.G

###########################################################
Expand Down
4 changes: 2 additions & 2 deletions experimental/GModule/GModule.jl
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ julia> C = gmodule(CyclotomicField, C);
julia> h = subfields(base_ring(C), degree = 2)[1][2];
julia> restriction_of_scalars(C, h)
G-module for G acting on vector space of dimension 4 over number field of degree 2 over QQ
G-module for G acting on vector space of dimension 4 over number field
julia> restriction_of_scalars(C, QQ)
G-module for G acting on vector space of dimension 8 over rational field
G-module for G acting on vector space of dimension 8 over QQ
```
"""
Expand Down
143 changes: 0 additions & 143 deletions experimental/GModule/Misc.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ module Misc
using Oscar
import Base: ==, parent

export coimage
export relative_field

Hecke.minpoly(a::QQBarFieldElem) = minpoly(Hecke.Globals.Qx, a)
Expand Down Expand Up @@ -194,11 +193,6 @@ end
## functions that will eventually get defined in Hecke.jl,
## and then should get removed here

function Hecke.roots(a::FinFieldElem, i::Int)
kx, x = polynomial_ring(parent(a), cached = false)
return roots(x^i-a)
end

function Oscar.dual(h::Map{FinGenAbGroup, FinGenAbGroup})
A = domain(h)
B = codomain(h)
Expand Down Expand Up @@ -253,27 +247,6 @@ Hecke.extend(::Hecke.QQEmb, mp::MapFromFunc{QQField, AbsSimpleNumField}) = compl

Hecke.restrict(::Hecke.NumFieldEmb, ::Map{QQField, AbsSimpleNumField}) = complex_embeddings(QQ)[1]

"""
direct_sum(G::FinGenAbGroup, H::FinGenAbGroup, V::Vector{<:Map{FinGenAbGroup, FinGenAbGroup}})
For groups `G = prod G_i` and `H = prod H_i` as well as maps `V_i: G_i -> H_i`,
build the induced map from `G -> H`.
"""
function Oscar.direct_sum(G::FinGenAbGroup, H::FinGenAbGroup, V::Vector{<:Map{FinGenAbGroup, FinGenAbGroup}})
dG = get_attribute(G, :direct_product)
dH = get_attribute(H, :direct_product)

if dG === nothing || dH === nothing
error("both groups need to be direct products")
end
@assert length(V) == length(dG) == length(dH)

@assert all(i -> domain(V[i]) == dG[i] && codomain(V[i]) == dH[i], 1:length(V))
h = hom(G, H, cat([matrix(V[i]) for i=1:length(V)]..., dims=(1,2)), check = !true)
return h

end

#XXX: have a type for an implicit field - in Hecke?
# add all(?) the other functions to it
function relative_field(m::Map{<:AbstractAlgebra.Field, <:AbstractAlgebra.Field})
Expand Down Expand Up @@ -387,133 +360,17 @@ function Hecke.induce_rational_reconstruction(a::ZZMatrix, pg::ZZRingElem; Error
end


#############################################################################
##
## functions that will eventually get defined in Nemo.jl,
## and then should get removed here

function (k::Nemo.fpField)(a::Vector)
@assert length(a) == 1
return k(a[1])
end

function (k::fqPolyRepField)(a::Vector)
return k(polynomial(Native.GF(Int(characteristic(k))), a))
end


#############################################################################
##
## functions that will eventually get defined in AbstractAlgebra.jl,
## and then should get removed here

Base.pairs(M::MatElem) = Base.pairs(IndexCartesian(), M)
Base.pairs(::IndexCartesian, M::MatElem) = Base.Iterators.Pairs(M, CartesianIndices(axes(M)))

Oscar.matrix(phi::Generic.IdentityMap{<:AbstractAlgebra.FPModule}) = identity_matrix(base_ring(domain(phi)), dim(domain(phi)))

Oscar.gen(M::AbstractAlgebra.FPModule, i::Int) = M[i]

Oscar.is_free(M::Generic.FreeModule) = true
Oscar.is_free(M::Generic.DirectSumModule) = all(is_free, M.m)

function Base.iterate(M::AbstractAlgebra.FPModule{T}) where T <: FinFieldElem
k = base_ring(M)
if dim(M) == 0
return zero(M), iterate([1])
end
p = Base.Iterators.ProductIterator(Tuple([k for i=1:dim(M)]))
f = iterate(p)
return M(elem_type(k)[f[1][i] for i=1:dim(M)]), (f[2], p)
end

function Base.iterate(::AbstractAlgebra.FPModule{<:FinFieldElem}, ::Tuple{Int64, Int64})
return nothing
end

Oscar.issubset(M::AbstractAlgebra.FPModule{T}, N::AbstractAlgebra.FPModule{T}) where T<:RingElement = is_submodule(M, N)

function is_sub_with_data(M::AbstractAlgebra.FPModule{T}, N::AbstractAlgebra.FPModule{T}) where T<:RingElement
fl = is_submodule(N, M)
if fl
return fl, hom(M, N, elem_type(N)[N(m) for m = gens(M)])
else
return fl, hom(M, N, elem_type(N)[zero(N) for m = gens(M)])
end
end

function Oscar.hom(V::AbstractAlgebra.Module, W::AbstractAlgebra.Module, v::Vector{<:ModuleElem}; check::Bool = true)
if ngens(V) == 0
return Generic.ModuleHomomorphism(V, W, zero_matrix(base_ring(V), ngens(V), ngens(W)))
end
return Generic.ModuleHomomorphism(V, W, reduce(vcat, [x.v for x = v]))
end
function Oscar.hom(V::AbstractAlgebra.Module, W::AbstractAlgebra.Module, v::MatElem; check::Bool = true)
return Generic.ModuleHomomorphism(V, W, v)
end
function Oscar.inv(M::Generic.ModuleHomomorphism)
return hom(codomain(M), domain(M), inv(matrix(M)))
end

Oscar.is_finite(M::AbstractAlgebra.FPModule{<:FinFieldElem}) = true

function Oscar.order(F::AbstractAlgebra.FPModule{<:FinFieldElem})
return order(base_ring(F))^dim(F)
end

function Base.iterate(M::AbstractAlgebra.FPModule{T}, st::Tuple{<:Tuple, <:Base.Iterators.ProductIterator}) where T <: FinFieldElem
n = iterate(st[2], st[1])
if n === nothing
return n
end
return M(elem_type(base_ring(M))[n[1][i] for i=1:dim(M)]), (n[2], st[2])
end

function Base.length(M::AbstractAlgebra.FPModule{T}) where T <: FinFieldElem
return Int(order(M))
end

function Base.eltype(M::AbstractAlgebra.FPModule{T}) where T <: FinFieldElem
return elem_type(M)
end

function Oscar.dim(M::AbstractAlgebra.Generic.DirectSumModule{<:FieldElem})
return sum(dim(x) for x = M.m)
end

Base.:*(a::T, b::Generic.ModuleHomomorphism{T}) where {T} = hom(domain(b), codomain(b), a * matrix(b))
Base.:*(a::T, b::Generic.ModuleIsomorphism{T}) where {T} = hom(domain(b), codomain(b), a * matrix(b))
Base.:+(a::Generic.ModuleHomomorphism, b::Generic.ModuleHomomorphism) = hom(domain(a), codomain(a), matrix(a) + matrix(b))
Base.:-(a::Generic.ModuleHomomorphism, b::Generic.ModuleHomomorphism) = hom(domain(a), codomain(a), matrix(a) - matrix(b))
Base.:-(a::Generic.ModuleHomomorphism) = hom(domain(a), codomain(a), -matrix(a))

function Base.:(==)(a::Union{Generic.ModuleHomomorphism, Generic.ModuleIsomorphism}, b::Union{Generic.ModuleHomomorphism, Generic.ModuleIsomorphism})
domain(a) === domain(b) || return false
codomain(a) === codomain(b) || return false
return matrix(a) == matrix(b)
end

function Base.hash(a::Union{Generic.ModuleHomomorphism, Generic.ModuleIsomorphism}, h::UInt)
h = hash(domain(a), h)
h = hash(codomain(a), h)
h = hash(matrix(a), h)
return h
end

function Oscar.pseudo_inv(h::Generic.ModuleHomomorphism)
return MapFromFunc(codomain(h), domain(h), x->preimage(h, x))
end

function Oscar.direct_sum(M::AbstractAlgebra.Generic.DirectSumModule{T}, N::AbstractAlgebra.Generic.DirectSumModule{T}, mp::Vector{AbstractAlgebra.Generic.ModuleHomomorphism{T}}) where T
@assert length(M.m) == length(mp) == length(N.m)
return hom(M, N, cat(map(matrix, mp)..., dims = (1,2)))
end

function coimage(h::Map)
return quo(domain(h), kernel(h)[1])
end

end # module
using .Misc
export coimage
export relative_field
5 changes: 2 additions & 3 deletions experimental/LieAlgebras/src/LieAlgebras.jl
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,9 @@ import ..Oscar:
gen,
gens,
height,
hom_tensor,
hom,
hom_direct_sum,
hom_tensor,
ideal,
identity_map,
image,
Expand Down Expand Up @@ -131,7 +132,6 @@ export exterior_power
export fundamental_weight
export fundamental_weights
export general_linear_lie_algebra
export hom_direct_sum
export induced_map_on_symmetric_power
export induced_map_on_tensor_power
export is_cartan_matrix
Expand Down Expand Up @@ -260,7 +260,6 @@ export exterior_power
export fundamental_weight
export fundamental_weights
export general_linear_lie_algebra
export hom_direct_sum
export induced_map_on_symmetric_power
export induced_map_on_tensor_power
export is_cartan_matrix
Expand Down
4 changes: 4 additions & 0 deletions experimental/LinearQuotients/src/cox_rings.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@

base_ring(HBB::HomBasisBuilder) = HBB.R

base_ring_type(
::Type{HomBasisBuilder{RingType,RingElemType}}
) where {RingType,RingElemType} = RingType

power_product_cache(HBB::HomBasisBuilder) = HBB.C

group(HBB::HomBasisBuilder) = HBB.G
Expand Down
1 change: 1 addition & 0 deletions experimental/LinearQuotients/src/linear_quotients.jl
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ end

group(L::LinearQuotient) = L.group
base_ring(L::LinearQuotient) = base_ring(group(L))
base_ring_type(::Type{LinearQuotient{S,T}}) where {S,T} = base_ring_type(MatrixGroup{S,T})

function fixed_root_of_unity(L::LinearQuotient)
if isdefined(L, :root_of_unity)
Expand Down
2 changes: 1 addition & 1 deletion experimental/ModStd/src/ModStdQt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,7 @@ julia> f = factor_absolute((X[1]^2+a[1]*X[2]^2)*(X[1]+2*X[2]+3*a[1]+4*a[2]))
julia> parent(f[3][1])
Multivariate polynomial ring in 2 variables X[1], X[2]
over fraction field of multivariate polynomial ring
over fraction field of Qa
julia> parent(f[2][1])
Multivariate polynomial ring in 2 variables X[1], X[2]
Expand Down
2 changes: 1 addition & 1 deletion experimental/Schemes/CoveredProjectiveSchemes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ julia> R, (x,y,z) = QQ["x", "y", "z"];
julia> Oscar.empty_covered_projective_scheme(R)
Relative projective scheme
over empty covered scheme over multivariate polynomial ring
over empty covered scheme over R
covered with 0 projective patches
```
"""
Expand Down
6 changes: 3 additions & 3 deletions experimental/Schemes/duValSing.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Ideal generated by
x^2 + y^3 + z^4
julia> Rq, _ = quo(R,I)
(Quotient of multivariate polynomial ring by ideal (w, x^2 + y^3 + z^4), Map: multivariate polynomial ring -> Rq)
(Quotient of multivariate polynomial ring by ideal (w, x^2 + y^3 + z^4), Map: R -> Rq)
julia> X = spec(Rq)
Spectrum
Expand Down Expand Up @@ -78,7 +78,7 @@ Ideal generated by
x^2 + y^3 + z^4
julia> Rq, _ = quo(R,I)
(Quotient of multivariate polynomial ring by ideal (w, x^2 + y^3 + z^4), Map: multivariate polynomial ring -> Rq)
(Quotient of multivariate polynomial ring by ideal (w, x^2 + y^3 + z^4), Map: R -> Rq)
julia> J = ideal(R,[x,y,z,w])
Ideal generated by
Expand Down Expand Up @@ -158,7 +158,7 @@ Ideal generated by
x^2 + y^3 + z^4
julia> Rq, _ = quo(R,I)
(Quotient of multivariate polynomial ring by ideal (w, x^2 + y^3 + z^4), Map: multivariate polynomial ring -> Rq)
(Quotient of multivariate polynomial ring by ideal (w, x^2 + y^3 + z^4), Map: R -> Rq)
julia> J = ideal(R,[x,y,z,w])
Ideal generated by
Expand Down
2 changes: 1 addition & 1 deletion src/Combinatorics/SimplicialComplexes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ Return the Stanley-Reisner ring of the abstract simplicial complex `K`, as a quo
julia> R, _ = ZZ["a","b","c","d","e","f"];
julia> stanley_reisner_ring(R, real_projective_plane())
(Quotient of multivariate polynomial ring by ideal (a*b*c, a*b*d, a*e*f, b*e*f, a*c*f, a*d*e, c*d*e, c*d*f, b*c*e, b*d*f), Map: multivariate polynomial ring -> quotient of multivariate polynomial ring)
(Quotient of multivariate polynomial ring by ideal (a*b*c, a*b*d, a*e*f, b*e*f, a*c*f, a*d*e, c*d*e, c*d*f, b*c*e, b*d*f), Map: R -> quotient of multivariate polynomial ring)
```
"""
stanley_reisner_ring(R::MPolyRing, K::SimplicialComplex) = quo(R, stanley_reisner_ideal(R, K))
Expand Down
4 changes: 4 additions & 0 deletions src/Groups/matrices/MatGrp.jl
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,8 @@ Return the base ring of the underlying matrix of `x`.
"""
base_ring(x::MatrixGroupElem) = x.parent.ring

base_ring_type(::Type{<:MatrixGroupElem{RE}}) where {RE} = parent_type(RE)

parent(x::MatrixGroupElem) = x.parent

"""
Expand Down Expand Up @@ -512,6 +514,8 @@ Return the base ring of the matrix group `G`.
"""
base_ring(G::MatrixGroup{RE}) where RE <: RingElem = G.ring::parent_type(RE)

base_ring_type(::Type{<:MatrixGroup{RE}}) where {RE} = parent_type(RE)

"""
degree(G::MatrixGroup)
Expand Down
Loading

0 comments on commit c6300cf

Please sign in to comment.