Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Renaming for localizations #3174

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@
an appropriate sense for ``R``.
"""
function has_nonempty_intersection(U::AbsMultSet, I::Ideal)
R = ambient_ring(U)
R = ring(U)

Check warning on line 159 in src/Modules/Posur.jl

View check run for this annotation

Codecov / codecov/patch

src/Modules/Posur.jl#L159

Added line #L159 was not covered by tests
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 @@
}
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 @@
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 @@
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 @@

function has_nonempty_intersection(U::MPolyProductOfMultSets, I::MPolyIdeal; check::Bool=true)
J = I
R = ambient_ring(U)
R = ring(U)

Check warning on line 62 in src/Modules/mpoly-localizations.jl

View check run for this annotation

Codecov / codecov/patch

src/Modules/mpoly-localizations.jl#L62

Added line #L62 was not covered by tests
R == base_ring(I) || error("rings not compatible")
Usets = sets(U)
if length(Usets) == 1
Expand Down Expand Up @@ -202,4 +202,4 @@
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 @@

### 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))")

Check warning on line 27 in src/Rings/localization_interface.jl

View check run for this annotation

Codecov / codecov/patch

src/Rings/localization_interface.jl#L26-L27

Added lines #L26 - L27 were not covered by tests
end

### required functionality
Expand All @@ -41,7 +41,7 @@
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 @@
# 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> 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> 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> 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 @@
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
Loading