Skip to content

Commit

Permalink
Merge branch 'master' into EP/RenameJacobian
Browse files Browse the repository at this point in the history
  • Loading branch information
lgoettgens committed Jan 12, 2024
2 parents b1b316c + 673924c commit cf8621d
Show file tree
Hide file tree
Showing 21 changed files with 234 additions and 259 deletions.
2 changes: 1 addition & 1 deletion experimental/MatroidRealizationSpaces/test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ end
@test X isa AbsSpec
@test !isdefined(X, :underlying_scheme)
R = OO(X)
@test R isa MPolyQuoLocRing
@test R isa Oscar.MPolyQuoLocRing
f = sum(gens(R))
U = PrincipalOpenSubset(X, f)
@test U isa AbsSpec
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,7 @@ Spectrum
over rational field
by ideal(x^2 - 2*x*y + y^2)
julia> U = MPolyComplementOfKPointIdeal(R,[0,0])
julia> U = complement_of_point_ideal(R, [0,0])
Complement
of maximal ideal corresponding to rational point with coordinates (0, 0)
in multivariate polynomial ring in 2 variables over QQ
Expand Down Expand Up @@ -646,7 +646,7 @@ julia> singular_locus(A3)
julia> singular_locus(X)
(V(x^2 - y^2 + z^2, z, y, x), Hom: V(x^2 - y^2 + z^2, z, y, x) -> V(x^2 - y^2 + z^2))
julia> U = MPolyComplementOfKPointIdeal(R,[0,0,0])
julia> U = complement_of_point_ideal(R, [0,0,0])
Complement
of maximal ideal corresponding to rational point with coordinates (0, 0, 0)
in multivariate polynomial ring in 3 variables over QQ
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -666,7 +666,7 @@ Spectrum
julia> is_smooth(Y)
false
julia> U = MPolyComplementOfKPointIdeal(R,[1,1])
julia> U = complement_of_point_ideal(R, [1,1])
Complement
of maximal ideal corresponding to rational point with coordinates (1, 1)
in multivariate polynomial ring in 2 variables over QQ
Expand Down
4 changes: 2 additions & 2 deletions src/Modules/Posur.jl
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ recommended to choose ``f`` to be the 'least complex' in
an appropriate sense for ``R``.
"""
function has_nonempty_intersection(U::AbsMultSet, I::Ideal)
R = ambient_ring(U)
R = ring(U)
R == base_ring(I) || error("the multiplicative set and the ideal must be defined over the same ring")
error("this method is not implemented for multiplicative sets of type $(typeof(U)) and ideals of type $(typeof(I)); see Posur: Linear systems over localizations of rings, arXiv:1709.08180v2, Definition 3.8 for the requirements of the implementation")
end
Expand Down Expand Up @@ -201,7 +201,7 @@ function has_solution(
}
R = base_ring(A)
R === base_ring(b) || error("matrices must be defined over the same ring")
R === ambient_ring(U) || error("multiplicative set must be defined over the same ring as the matrices")
R === ring(U) || error("multiplicative set must be defined over the same ring as the matrices")
m = nrows(A)
nrows(b) == 1 || error("can not solve for more than one row vector")
n = ncols(A)
Expand Down
10 changes: 5 additions & 5 deletions src/Modules/mpoly-localizations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@


function has_nonempty_intersection(U::MPolyPowersOfElement, I::MPolyIdeal; check::Bool=true)
R = ambient_ring(U)
R = ring(U)
R == base_ring(I) || error("the multiplicative set and the ideal must be defined over the same ring")

d = prod(denominators(U); init=one(R))
Expand All @@ -22,7 +22,7 @@ function has_nonempty_intersection(U::MPolyPowersOfElement, I::MPolyIdeal; check
end

function has_nonempty_intersection(U::MPolyComplementOfPrimeIdeal, I::MPolyIdeal; check::Bool=true)
R = ambient_ring(U)
R = ring(U)
R == base_ring(I) || error("the multiplicative set and the ideal must be defined over the same ring")
P = prime_ideal(U)
candidates = [(f, i) for (f, i) in zip(gens(I), 1:ngens(I)) if !(f in P)]
Expand All @@ -40,7 +40,7 @@ function has_nonempty_intersection(U::MPolyComplementOfPrimeIdeal, I::MPolyIdeal
end

function has_nonempty_intersection(U::MPolyComplementOfKPointIdeal, I::MPolyIdeal; check::Bool=true)
R = ambient_ring(U)
R = ring(U)
R == base_ring(I) || error("the multiplicative set and the ideal must be defined over the same ring")
a = point_coordinates(U)
candidates = [(f, i) for (f, i) in zip(gens(I), 1:ngens(I)) if !(iszero(evaluate(f, a)))]
Expand All @@ -59,7 +59,7 @@ end

function has_nonempty_intersection(U::MPolyProductOfMultSets, I::MPolyIdeal; check::Bool=true)
J = I
R = ambient_ring(U)
R = ring(U)
R == base_ring(I) || error("rings not compatible")
Usets = sets(U)
if length(Usets) == 1
Expand Down Expand Up @@ -202,4 +202,4 @@ the shift map ``Φ : R → R`` which is moving the point of ``𝔪`` to the orig
Mp_gens_shift = shift.(gens(Mp))
result = SubModuleOfFreeModule(F_shifted,Mp_gens_shift)
return result
end
end
21 changes: 12 additions & 9 deletions src/Rings/localization_interface.jl
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ abstract type AbsMultSet{RingType<:Ring, RingElemType<:RingElem} end

### required getter functions
@doc raw"""
ambient_ring(S::AbsMultSet)
ring(S::AbsMultSet)
Return the ambient ring `R` for a multiplicatively closed set `S ⊂ R`.
"""
function ambient_ring(S::AbsMultSet)
error("method `ambient_ring` not implemented for multiplicatively closed sets of type $(typeof(S))")
function ring(S::AbsMultSet)
error("method `ring` not implemented for multiplicatively closed sets of type $(typeof(S))")
end

### required functionality
Expand All @@ -41,7 +41,7 @@ julia> R, (x, y, z) = polynomial_ring(QQ, ["x", "y", "z"])
julia> P = ideal(R, [x])
ideal(x)
julia> U = MPolyComplementOfPrimeIdeal(P)
julia> U = complement_of_prime_ideal(P)
Complement
of prime ideal(x)
in multivariate polynomial ring in 3 variables over QQ
Expand All @@ -59,7 +59,7 @@ end
# of the multiplicative set whenever possible. For instance, this is
# used to check well-definedness of homomorphisms from localized rings.
# By default, however, this iteration does nothing.
Base.iterate(U::T) where {T<:AbsMultSet} = (one(ambient_ring(U)), 1)
Base.iterate(U::T) where {T<:AbsMultSet} = (one(ring(U)), 1)
Base.iterate(U::T, a::Tuple{<:RingElem, Int}) where {T<:AbsMultSet} = nothing
Base.iterate(U::T, i::Int) where {T<:AbsMultSet} = nothing

Expand Down Expand Up @@ -98,13 +98,14 @@ julia> R, (x, y, z) = polynomial_ring(QQ, ["x", "y", "z"])
julia> P = ideal(R, [x])
ideal(x)
julia> U = MPolyComplementOfPrimeIdeal(P)
julia> U = complement_of_prime_ideal(P)
Complement
of prime ideal(x)
in multivariate polynomial ring in 3 variables over QQ
julia> Rloc, _ = localization(U);
julia> R === base_ring(Rloc)
true
```
Expand All @@ -126,13 +127,14 @@ julia> R, (x, y, z) = polynomial_ring(QQ, ["x", "y", "z"])
julia> P = ideal(R, [x])
ideal(x)
julia> U = MPolyComplementOfPrimeIdeal(P)
julia> U = complement_of_prime_ideal(P)
Complement
of prime ideal(x)
in multivariate polynomial ring in 3 variables over QQ
julia> Rloc, _ = localization(U);
julia> U === inverted_set(Rloc)
true
```
Expand Down Expand Up @@ -160,13 +162,14 @@ julia> R, (x, y, z) = polynomial_ring(QQ, ["x", "y", "z"])
julia> P = ideal(R, [x])
ideal(x)
julia> U = MPolyComplementOfPrimeIdeal(P)
julia> U = complement_of_prime_ideal(P)
Complement
of prime ideal(x)
in multivariate polynomial ring in 3 variables over QQ
julia> Rloc, iota = localization(R, U);
julia> Rloc
Localization
of multivariate polynomial ring in 3 variables x, y, z
Expand All @@ -188,7 +191,7 @@ function localization(S::AbsMultSet)
end

function localization(R::Ring, U::AbsMultSet)
R == ambient_ring(U) || error("ring and multiplicative set are incompatible")
R == ring(U) || error("ring and multiplicative set are incompatible")
return localization(U)
end

Expand Down
Loading

0 comments on commit cf8621d

Please sign in to comment.