Skip to content

Commit

Permalink
pretty printing for quotients, graded and localized multivariate poly…
Browse files Browse the repository at this point in the history
…nomial rings (#2184)
  • Loading branch information
simonbrandhorst authored May 27, 2023
1 parent b350dd1 commit 04820d1
Show file tree
Hide file tree
Showing 44 changed files with 847 additions and 672 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ UUIDs = "cf7118a7-6976-5b1a-9a39-7adc72f591a4"
cohomCalg_jll = "5558cf25-a90e-53b0-b813-cadaa3ae7ade"

[compat]
AbstractAlgebra = "0.30.2"
AbstractAlgebra = "0.30.7"
AlgebraicSolving = "0.3.0"
DocStringExtensions = "0.8, 0.9"
GAP = "0.9.4"
Expand Down
5 changes: 1 addition & 4 deletions docs/src/CommutativeAlgebra/GroebnerBases/groebner_bases.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,7 @@ julia> default_ordering(F)
degrevlex([x, y, z])*lex([gen(1), gen(2)])
julia> S, _ = grade(R, [1, 2, 3])
(Multivariate polynomial ring in 3 variables over QQ graded by
x -> [1]
y -> [2]
z -> [3], MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x, y, z])
(Graded multivariate polynomial ring in 3 variables over QQ, MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x, y, z])
julia> default_ordering(S)
wdegrevlex([x, y, z], [1, 2, 3])
Expand Down
35 changes: 12 additions & 23 deletions docs/src/CommutativeAlgebra/affine_algebras.md
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,9 @@ julia> a = ideal(A, [x-y, z^4])
ideal(x - y, z^4)
julia> base_ring(a)
Quotient of Multivariate polynomial ring in 3 variables over QQ by ideal(-x^2 + y, -x^3 + z)
Quotient
of multivariate polynomial ring in 3 variables over QQ
by ideal(-x^2 + y, -x^3 + z)
julia> gens(a)
2-element Vector{MPolyQuoRingElem{QQMPolyRingElem}}:
Expand Down Expand Up @@ -350,16 +352,10 @@ julia> para = hom(D1, C1, V1)
Map with following data
Domain:
=======
Multivariate polynomial ring in 4 variables over QQ graded by
w -> [1]
x -> [1]
y -> [1]
z -> [1]
Graded multivariate polynomial ring in 4 variables over QQ
Codomain:
=========
Multivariate polynomial ring in 2 variables over QQ graded by
s -> [1]
t -> [1]
Graded multivariate polynomial ring in 2 variables over QQ
julia> twistedCubic = kernel(para)
ideal(-x*z + y^2, -w*z + x*y, -w*y + x^2)
Expand All @@ -374,17 +370,10 @@ julia> proj = hom(D2, C2, V2)
Map with following data
Domain:
=======
Multivariate polynomial ring in 3 variables over QQ graded by
a -> [1]
b -> [1]
c -> [1]
Graded multivariate polynomial ring in 3 variables over QQ
Codomain:
=========
Quotient of Multivariate polynomial ring in 4 variables over QQ graded by
w -> [1]
x -> [1]
y -> [1]
z -> [1] by ideal(-x*z + y^2, -w*z + x*y, -w*y + x^2)
Quotient of multivariate polynomial ring by ideal with 3 generators
julia> nodalCubic = kernel(proj)
ideal(-a^2*c + b^3 - 2*b^2*c + b*c^2)
Expand Down Expand Up @@ -443,7 +432,7 @@ Domain:
Multivariate polynomial ring in 3 variables over QQ
Codomain:
=========
Quotient of Multivariate polynomial ring in 3 variables over QQ by ideal(-b^3 + c)
Quotient of multivariate polynomial ring by ideal with 1 generator
julia> is_surjective(F)
true
Expand Down Expand Up @@ -523,19 +512,19 @@ julia> L[2]
Map with following data
Domain:
=======
Quotient of Multivariate polynomial ring in 3 variables over QQ by ideal(x*y, x*z)
Quotient of multivariate polynomial ring by ideal with 2 generators
Codomain:
=========
Quotient of Multivariate polynomial ring in 3 variables over QQ by ideal(2*x^2 + x*y, 10*x^2 + 5*x*y + x*z)
Quotient of multivariate polynomial ring by ideal with 2 generators
julia> L[3]
Map with following data
Domain:
=======
Quotient of Multivariate polynomial ring in 3 variables over QQ by ideal(2*x^2 + x*y, 10*x^2 + 5*x*y + x*z)
Quotient of multivariate polynomial ring by ideal with 2 generators
Codomain:
=========
Quotient of Multivariate polynomial ring in 3 variables over QQ by ideal(x*y, x*z)
Quotient of multivariate polynomial ring by ideal with 2 generators
```
## Normalization
Expand Down
38 changes: 29 additions & 9 deletions docs/src/CommutativeAlgebra/localizations.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,9 @@ julia> P = ideal(R, [x])
ideal(x)
julia> U = complement_of_prime_ideal(P)
complement of ideal(x)
Complement
of prime ideal(x)
in multivariate polynomial ring in 3 variables over QQ
julia> Rloc, _ = localization(U);
Expand All @@ -139,7 +141,9 @@ julia> P = ideal(R, [y-1, x-a])
ideal(y - 1, x - a)
julia> U = complement_of_prime_ideal(P)
complement of ideal(y - 1, x - a)
Complement
of prime ideal(y - 1, x - a)
in multivariate polynomial ring in 2 variables over number field
julia> RQ, _ = quo(R, I);
Expand Down Expand Up @@ -180,7 +184,9 @@ julia> P = ideal(R, [x])
ideal(x)
julia> U = complement_of_prime_ideal(P)
complement of ideal(x)
Complement
of prime ideal(x)
in multivariate polynomial ring in 3 variables over QQ
julia> Rloc, iota = localization(U);
Expand Down Expand Up @@ -225,7 +231,9 @@ julia> P = ideal(R, [y-1, x-a])
ideal(y - 1, x - a)
julia> U = complement_of_prime_ideal(P)
complement of ideal(y - 1, x - a)
Complement
of prime ideal(y - 1, x - a)
in multivariate polynomial ring in 2 variables over number field
julia> RQ, p = quo(R, I);
Expand Down Expand Up @@ -284,15 +292,19 @@ julia> P = ideal(R, [x])
ideal(x)
julia> U = complement_of_prime_ideal(P)
complement of ideal(x)
Complement
of prime ideal(x)
in multivariate polynomial ring in 3 variables over QQ
julia> Rloc, iota = localization(U);
julia> f = iota(x)/iota(y)
x/y
julia> parent(f)
localization of Multivariate polynomial ring in 3 variables over QQ at the complement of ideal(x)
Localization
of multivariate polynomial ring in 3 variables over QQ
at complement of prime ideal(x)
julia> g = iota(y)/iota(z)
y/z
Expand Down Expand Up @@ -321,7 +333,9 @@ julia> P = ideal(R, [y-1, x-a])
ideal(y - 1, x - a)
julia> U = complement_of_prime_ideal(P)
complement of ideal(y - 1, x - a)
Complement
of prime ideal(y - 1, x - a)
in multivariate polynomial ring in 2 variables over number field
julia> RQ, p = quo(R, I);
Expand All @@ -333,7 +347,9 @@ julia> f = phi(x)
x
julia> parent(f)
Localization of Quotient of Multivariate polynomial ring in 2 variables over number field by ideal(2*x^2 - y^3, 2*x^2 - y^5) at the multiplicative set complement of ideal(y - 1, x - a)
Localization
of quotient of multivariate polynomial ring by ideal with 2 generators
at complement of prime ideal(y - 1, x - a)
julia> g = f/phi(y)
x/y
Expand Down Expand Up @@ -421,7 +437,11 @@ julia> U = complement_of_point_ideal(R, [0, 0]);
julia> Rloc, _ = localization(R, U);
julia> MI = ideal(Rloc, V)
ideal in localization of Multivariate polynomial ring in 2 variables over QQ at the complement of maximal ideal corresponding to point with coordinates QQFieldElem[0, 0] generated by [3*x^2, 4*y^3]
Ideal
of localized ring
with 2 generators
3*x^2
4*y^3
```

### Data Associated to Ideals
Expand Down
5 changes: 1 addition & 4 deletions docs/src/CommutativeAlgebra/rings.md
Original file line number Diff line number Diff line change
Expand Up @@ -356,10 +356,7 @@ julia> typeof(f)
QQMPolyRingElem
julia> S, (x, y, z) = grade(R)
(Multivariate polynomial ring in 3 variables over QQ graded by
x -> [1]
y -> [1]
z -> [1], MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x, y, z])
(Graded multivariate polynomial ring in 3 variables over QQ, MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x, y, z])
julia> g = 3*x^2+y*z
3*x^2 + y*z
Expand Down
10 changes: 2 additions & 8 deletions experimental/PlaneCurve/docs/src/elliptic_curves.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,7 @@ julia> S, (x, y, z) = polynomial_ring(QQ, ["x", "y", "z"])
(Multivariate polynomial ring in 3 variables over QQ, QQMPolyRingElem[x, y, z])
julia> T, _ = grade(S)
(Multivariate polynomial ring in 3 variables over QQ graded by
x -> [1]
y -> [1]
z -> [1], MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x, y, z])
(Graded multivariate polynomial ring in 3 variables over QQ, MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x, y, z])
julia> E = Oscar.ProjEllipticCurve(T(y^2*z - x^3 + 2*x*z^2))
Projective elliptic curve defined by -x^3 + 2*x*z^2 + y^2*z
Expand Down Expand Up @@ -124,10 +121,7 @@ julia> S, (x,y,z) = polynomial_ring(A, ["x", "y", "z"])
(Multivariate polynomial ring in 3 variables over ZZ/(4453), AbstractAlgebra.Generic.MPoly{ZZModRingElem}[x, y, z])
julia> T, _ = grade(S)
(Multivariate polynomial ring in 3 variables over ZZ/(4453) graded by
x -> [1]
y -> [1]
z -> [1], MPolyDecRingElem{ZZModRingElem, AbstractAlgebra.Generic.MPoly{ZZModRingElem}}[x, y, z])
(Graded multivariate polynomial ring in 3 variables over ZZ/(4453), MPolyDecRingElem{ZZModRingElem, AbstractAlgebra.Generic.MPoly{ZZModRingElem}}[x, y, z])
julia> E = Oscar.ProjEllipticCurve(T(y^2*z - x^3 - 10*x*z^2 + 2*z^3))
Projective elliptic curve defined by 4452*x^3 + 4443*x*z^2 + y^2*z + 2*z^3
Expand Down
35 changes: 7 additions & 28 deletions experimental/PlaneCurve/src/DivisorCurve.jl
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,7 @@ julia> S, (x,y,z) = polynomial_ring(QQ, ["x", "y", "z"])
(Multivariate polynomial ring in 3 variables over QQ, QQMPolyRingElem[x, y, z])
julia> T, _ = grade(S)
(Multivariate polynomial ring in 3 variables over QQ graded by
x -> [1]
y -> [1]
z -> [1], MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x, y, z])
(Graded multivariate polynomial ring in 3 variables over QQ, MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x, y, z])
julia> C = Oscar.ProjPlaneCurve(T(y^2 + y*z + x^2))
Projective plane curve defined by x^2 + y^2 + y*z
Expand Down Expand Up @@ -305,10 +302,7 @@ julia> S, (x,y,z) = polynomial_ring(QQ, ["x", "y", "z"])
(Multivariate polynomial ring in 3 variables over QQ, QQMPolyRingElem[x, y, z])
julia> T, _ = grade(S)
(Multivariate polynomial ring in 3 variables over QQ graded by
x -> [1]
y -> [1]
z -> [1], MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x, y, z])
(Graded multivariate polynomial ring in 3 variables over QQ, MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x, y, z])
julia> C = Oscar.ProjPlaneCurve(T(y^2 + y*z + x^2))
Projective plane curve defined by x^2 + y^2 + y*z
Expand Down Expand Up @@ -452,10 +446,7 @@ julia> S, (x,y,z) = polynomial_ring(QQ, ["x", "y", "z"])
(Multivariate polynomial ring in 3 variables over QQ, QQMPolyRingElem[x, y, z])
julia> T, _ = grade(S)
(Multivariate polynomial ring in 3 variables over QQ graded by
x -> [1]
y -> [1]
z -> [1], MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x, y, z])
(Graded multivariate polynomial ring in 3 variables over QQ, MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x, y, z])
julia> C = Oscar.ProjPlaneCurve(T(y^2 + y*z + x^2))
Projective plane curve defined by x^2 + y^2 + y*z
Expand Down Expand Up @@ -600,10 +591,7 @@ julia> S, (x, y, z) = polynomial_ring(QQ, ["x", "y", "z"])
(Multivariate polynomial ring in 3 variables over QQ, QQMPolyRingElem[x, y, z])
julia> T, _ = grade(S)
(Multivariate polynomial ring in 3 variables over QQ graded by
x -> [1]
y -> [1]
z -> [1], MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x, y, z])
(Graded multivariate polynomial ring in 3 variables over QQ, MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x, y, z])
julia> C = Oscar.ProjPlaneCurve(T(y^2*z - x*(x-z)*(x+3*z)))
Projective plane curve defined by -x^3 - 2*x^2*z + 3*x*z^2 + y^2*z
Expand Down Expand Up @@ -699,10 +687,7 @@ julia> S, (x, y, z) = polynomial_ring(QQ, ["x", "y", "z"])
(Multivariate polynomial ring in 3 variables over QQ, QQMPolyRingElem[x, y, z])
julia> T, _ = grade(S)
(Multivariate polynomial ring in 3 variables over QQ graded by
x -> [1]
y -> [1]
z -> [1], MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x, y, z])
(Graded multivariate polynomial ring in 3 variables over QQ, MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x, y, z])
julia> C = Oscar.ProjPlaneCurve(T(y^2*z - x*(x-z)*(x+3*z)))
Projective plane curve defined by -x^3 - 2*x^2*z + 3*x*z^2 + y^2*z
Expand Down Expand Up @@ -743,10 +728,7 @@ julia> S, (x, y, z) = polynomial_ring(QQ, ["x", "y", "z"])
(Multivariate polynomial ring in 3 variables over QQ, QQMPolyRingElem[x, y, z])
julia> T, _ = grade(S)
(Multivariate polynomial ring in 3 variables over QQ graded by
x -> [1]
y -> [1]
z -> [1], MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x, y, z])
(Graded multivariate polynomial ring in 3 variables over QQ, MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x, y, z])
julia> C = Oscar.ProjPlaneCurve(T(y^2*z - x*(x-z)*(x+3*z)))
Projective plane curve defined by -x^3 - 2*x^2*z + 3*x*z^2 + y^2*z
Expand Down Expand Up @@ -785,10 +767,7 @@ julia> S, (x, y, z) = polynomial_ring(QQ, ["x", "y", "z"])
(Multivariate polynomial ring in 3 variables over QQ, QQMPolyRingElem[x, y, z])
julia> T, _ = grade(S)
(Multivariate polynomial ring in 3 variables over QQ graded by
x -> [1]
y -> [1]
z -> [1], MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x, y, z])
(Graded multivariate polynomial ring in 3 variables over QQ, MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x, y, z])
julia> C = Oscar.ProjPlaneCurve(T(y^2*z - x*(x-z)*(x+3*z)))
Projective plane curve defined by -x^3 - 2*x^2*z + 3*x*z^2 + y^2*z
Expand Down
7 changes: 1 addition & 6 deletions experimental/PlaneCurve/src/ParaPlaneCurves.jl
Original file line number Diff line number Diff line change
Expand Up @@ -186,12 +186,7 @@ where R is the basering.
# Examples
```jldoctest
julia> R, (v, w, x, y, z) = graded_polynomial_ring(QQ, ["v", "w", "x", "y", "z"])
(Multivariate polynomial ring in 5 variables over QQ graded by
v -> [1]
w -> [1]
x -> [1]
y -> [1]
z -> [1], MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[v, w, x, y, z])
(Graded multivariate polynomial ring in 5 variables over QQ, MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[v, w, x, y, z])
julia> M = matrix(R, 2, 4, [v w x y; w x y z])
[v w x y]
Expand Down
14 changes: 4 additions & 10 deletions experimental/PlaneCurve/src/PlaneCurve.jl
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,7 @@ julia> R, (x,y,z) = polynomial_ring(QQ, ["x", "y", "z"])
(Multivariate polynomial ring in 3 variables over QQ, QQMPolyRingElem[x, y, z])
julia> T, _ = grade(R)
(Multivariate polynomial ring in 3 variables over QQ graded by
x -> [1]
y -> [1]
z -> [1], MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x, y, z])
(Graded multivariate polynomial ring in 3 variables over QQ, MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x, y, z])
julia> F = T(y^3*x^6 - y^6*x^2*z)
x^6*y^3 - x^2*y^6*z
Expand Down Expand Up @@ -185,10 +182,7 @@ create the projective plane curve defined by `f`.
# Examples
```jldoctest
julia> R, (x,y,z) = graded_polynomial_ring(QQ, ["x", "y", "z"])
(Multivariate polynomial ring in 3 variables over QQ graded by
x -> [1]
y -> [1]
z -> [1], MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x, y, z])
(Graded multivariate polynomial ring in 3 variables over QQ, MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x, y, z])
julia> C = ProjPlaneCurve(z*x^2-y^3)
Projective plane curve defined by x^2*z - y^3
Expand Down Expand Up @@ -475,8 +469,8 @@ julia> C = Oscar.AffinePlaneCurve(y^2+x-x^3)
Affine plane curve defined by -x^3 + x + y^2
julia> Oscar.ring(C)
(Quotient of Multivariate polynomial ring in 2 variables over QQ by ideal(-x^3 + x + y^2), Map from
Multivariate polynomial ring in 2 variables over QQ to Quotient of Multivariate polynomial ring in 2 variables over QQ by ideal(-x^3 + x + y^2) defined by a julia-function with inverse)
(Quotient of multivariate polynomial ring by ideal with 1 generator, Map from
Multivariate polynomial ring in 2 variables over QQ to Quotient of multivariate polynomial ring by ideal with 1 generator defined by a julia-function with inverse)
```
"""
function ring(C::PlaneCurve)
Expand Down
Loading

0 comments on commit 04820d1

Please sign in to comment.