Skip to content

Commit

Permalink
Bugfix for printing of affine schemes (oscar-system#3437)
Browse files Browse the repository at this point in the history
* Fix printing of of affine schemes.
  • Loading branch information
HechtiDerLachs authored and mjrodgers committed Feb 28, 2024
1 parent 972e355 commit a8335b0
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 9 deletions.
2 changes: 1 addition & 1 deletion experimental/Schemes/MorphismFromRationalFunctions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ julia> realizations = Oscar.realize_on_patch(Phi, U);
julia> realizations[3]
Affine scheme morphism
from [(t//s)] AA^1 \ scheme()
from [(t//s)] AA^1
to [(x//z), (y//z)] affine 2-space
given by the pullback function
(x//z) -> (t//s)^2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@ Spectrum
of localization
of multivariate polynomial ring in 3 variables x1, x2, x3
over rational field
at products of (x1,x2)
at products of (x1, x2)
```
"""
function hypersurface_complement(X::AbsAffineScheme, f::Vector{<:RingElem})
Expand Down
24 changes: 18 additions & 6 deletions src/AlgebraicGeometry/Schemes/AffineSchemes/Objects/Methods.jl
Original file line number Diff line number Diff line change
Expand Up @@ -76,18 +76,30 @@ function _show(io::IO, X::AbsAffineScheme{<:Any, <:MPolyQuoLocRing{<:Any, <:Any,
I = modulus(OO(X))
S = inverted_set(OO(X))
join(io, gens(I), ", ")
print(io, raw") \ scheme(")
join(io, denominators(S), ",")
print(io, ")")
if is_empty(denominators(S))
print(io, raw")")
elseif isone(length(denominators(S)))
print(io, raw") \ scheme(", first(denominators(S)), ")")
else
print(io, raw") \ scheme((")
join(io, denominators(S), ")*(")
print(io, "))")
end
end

function _show(io::IO, X::AbsAffineScheme{<:Any, <:MPolyLocRing{<:Any, <:Any, <:Any, <:Any, <:MPolyPowersOfElement}})
io = pretty(io)
print(io, LowercaseOff(), "AA^", ngens(OO(X)))
S = inverted_set(OO(X))
print(io, raw" \ scheme(")
join(io, denominators(S), ",")
print(io, ")")
if is_empty(denominators(S))
# do nothing more
elseif isone(length(denominators(S)))
print(io, raw" \ scheme(", first(denominators(S)), ")")
else
print(io, raw" \ scheme((")
join(io, denominators(S), ")*(")
print(io, "))")
end
end

########################################################
Expand Down
2 changes: 1 addition & 1 deletion src/Rings/mpoly-localizations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ function Base.show(io::IO, S::MPolyPowersOfElement)
print(io, ItemQuantity(length(denominators(S)), "element"))
else
print(io, "Products of (")
join(io, denominators(S), ",")
join(io, denominators(S), ", ")
print(io, ")")
end
end
Expand Down

0 comments on commit a8335b0

Please sign in to comment.