From ef8c2b76e31f308b7da2b382a6c1f33d67143bae Mon Sep 17 00:00:00 2001 From: Wolfram Decker Date: Mon, 6 May 2024 11:37:35 +0200 Subject: [PATCH 1/7] First version of adjunction theory (surfaces) (#3684) * First version of adjunction theory (surfaces) * move exports to export.jl * pleasing doctests * adds reference * add tests * correction --- docs/doc.main | 2 + docs/oscar_references.bib | 14 + .../AlgebraicVarieties/ProjectiveVariety.md | 18 +- .../Surfaces/AdjunctionProcess.md | 47 +++ .../Surfaces/ParametrizationSurfaces.md | 9 + .../AlgebraicGeometry/Surfaces/SurfacesP4.md | 2 +- src/AlgebraicGeometry/AlgebraicGeometry.jl | 2 + .../ProjectiveVariety/Objects/Constructors.jl | 2 +- .../AdjunctionProcess/AdjunctionProcess.jl | 359 ++++++++++++++++++ .../ParametrizationSurfaces.jl | 79 ++++ src/AlgebraicGeometry/Surfaces/SurfacesP4.jl | 3 +- src/exports.jl | 3 + test/AlgebraicGeometry/Surfaces/adjunction.jl | 13 + 13 files changed, 547 insertions(+), 6 deletions(-) create mode 100644 docs/src/AlgebraicGeometry/Surfaces/AdjunctionProcess.md create mode 100644 docs/src/AlgebraicGeometry/Surfaces/ParametrizationSurfaces.md create mode 100644 src/AlgebraicGeometry/Surfaces/AdjunctionProcess/AdjunctionProcess.jl create mode 100644 src/AlgebraicGeometry/Surfaces/ParaRatSurfaces/ParametrizationSurfaces.jl create mode 100644 test/AlgebraicGeometry/Surfaces/adjunction.jl diff --git a/docs/doc.main b/docs/doc.main index 34364343f08..0f280083a9e 100644 --- a/docs/doc.main +++ b/docs/doc.main @@ -208,6 +208,8 @@ ], "Surfaces" => [ "AlgebraicGeometry/Surfaces/K3Surfaces.md", + "AlgebraicGeometry/Surfaces/AdjunctionProcess.md", + "AlgebraicGeometry/Surfaces/ParametrizationSurfaces.md", "AlgebraicGeometry/Surfaces/SurfacesP4.md", ], "Miscellaneous" => [ diff --git a/docs/oscar_references.bib b/docs/oscar_references.bib index 129060519e7..7e6c3a503d6 100644 --- a/docs/oscar_references.bib +++ b/docs/oscar_references.bib @@ -1813,6 +1813,20 @@ @Article{SS12 doi = {10.1016/j.jcta.2011.12.005} } +@Article{SV-D-V87, + author = {Sommese, Andrew John and Van de Ven, A.}, + title = {On the adjunction mapping}, + zbl = {0655.14001}, + journal = {Math. Ann.}, + fjournal = {Mathematische Annalen}, + volume = {278}, + pages = {593--603}, + year = {1987}, + doi = {10.1007/BF01458083}, + language = {English}, + zbmath = {4069055} +} + @Article{SY96, author = {Shimoyama, Takeshi and Yokoyama, Kazuhiro}, title = {Localization and primary decomposition of polynomial ideals}, diff --git a/docs/src/AlgebraicGeometry/AlgebraicVarieties/ProjectiveVariety.md b/docs/src/AlgebraicGeometry/AlgebraicVarieties/ProjectiveVariety.md index 94808177856..c754a8878ce 100644 --- a/docs/src/AlgebraicGeometry/AlgebraicVarieties/ProjectiveVariety.md +++ b/docs/src/AlgebraicGeometry/AlgebraicVarieties/ProjectiveVariety.md @@ -28,10 +28,22 @@ variety(f::MPolyDecRingElem; check=true) ``` ## Attributes -So far all are inherited from [Projective Algebraic Sets](@ref) and [Projective schemes](@ref). +In addition to what is inherited from [Projective Algebraic Sets](@ref) and [Projective schemes](@ref), we currently have: + +```@docs +sectional_genus(X::AbsProjectiveVariety) +``` ## Properties -So far all are inherited from [Projective Algebraic Sets](@ref) and [Projective schemes](@ref). +In addition to what is inherited from [Projective Algebraic Sets](@ref) and [Projective schemes](@ref), we currently have: + +```@docs +is_linearly_normal(X::AbsProjectiveVariety) +``` ## Methods -So far all are inherited from [Projective Algebraic Sets](@ref) and [Projective schemes](@ref). +In addition to what is inherited from [Projective Algebraic Sets](@ref) and [Projective schemes](@ref), we currently have: + +```@docs +canonical_bundle(X::AbsProjectiveVariety) +``` diff --git a/docs/src/AlgebraicGeometry/Surfaces/AdjunctionProcess.md b/docs/src/AlgebraicGeometry/Surfaces/AdjunctionProcess.md new file mode 100644 index 00000000000..d84b4d61888 --- /dev/null +++ b/docs/src/AlgebraicGeometry/Surfaces/AdjunctionProcess.md @@ -0,0 +1,47 @@ +```@meta +CurrentModule = Oscar +``` + +# Adjunction Process for Surfaces + +A surface in this section is a smooth projective surface over $\mathbb C$. + +Blowing up a surface in a point means to replace the point by an exceptional curve. Each such curve $E$ is a smooth, rational +curve with self-intersection number $E^{2}=-1$. We speak of a *$(-1)$-curve*. A surface is *minimal* if it contains no +$(-1)$-curves. That is, the surface cannot be obtained by blowing up a point on another surface. A surface $X_{\text{min}}$ +is called a *minimal model* of a surface $X$ if $X_{\text{min}}$ is minimal and $X$ can be obtained from $X_{\text{min}}$ +by repeatedly blowing up a point. Each surface $X$ has a minimal model which is unique if $X$ has non-negative Kodaira dimension. +The Enriques-Kodaira classification classifies surfaces according to their minimal models. See ... for more on this. + +Given a surface, we may apply the *adjunction process* of Van de Ven and Sommese [SV-D-V87](@cite) to discover a minimal model. +To describe this process, consider a surface $X \subset \mathbb P^{n}$ of codimension $c$. Let $S$ and $S_{X}$ +denote the homogeneous coordinate rings of $\mathbb P^{n}$ and $X$, respectively. Consider $\omega_{X}=\text{Ext}^{c}_{S}(S_{X},S(-n-1)),$ +the graded *dualizing module* of $S_{X}$. A basis of the graded piece $(\omega_{X})_{{1}}$ corresponds to the linear system $|K_X +H|$, where $K_X$ is a canonical +divisor on $X$ and $H$ is the hyperplane class. Except for some exceptional cases, this linear system defines a birational morphism $\varphi_{|K_X+H|}\colon X \to X'$ +onto another smooth projective surface $X'$ such that $\varphi_{|K_X+H|}$ blows down precisely all $(-1)$-lines on $X$. +As shown by Van de Ven and Sommese, in the exceptional cases, + +- ``X`` is a linearly or quadratically embedded $ \mathbb P^{2}$ or $X$ is ruled by lines, in which case $|K_X+H| = \emptyset$, +- ``X`` is an anti-canonically embedded del Pezzo surface, in which case $\varphi_{|K_X+H|}$ maps $X$ to a point, +- ``X`` is a conic bundle, in which case $\varphi_{|K_{X}+H|}\colon X \to B$ maps $X$ to a curve $B$ such that the fibers of $\varphi_{|K_{X}+H|}$ are the conics, or +- ``X`` is a surface in one of four explicit families identified by Sommese and Van de Ven, and $\varphi_{|K_X+H|}\colon X \to X'$ is not birational, but finite to one. + +If we are not in one of these cases, a $(-1)$-conic $C$ in $X$ is mapped to a $(-1)$-line in $X'$ since $(K_X+H)\;\!. \;\! C=-1+2=1$. +Thus, the *adjunction process*, which consists of applying the *adjunction maps* $\varphi_{|K_X+H|}$, $\varphi_{|K_{X'}+H'|}$ and so on, yields finitely many surfaces +$X \rightarrow X^{\prime} \rightarrow X^{\prime\prime} \rightarrow \dots$ which are called the *adjoint surfaces* of $X$. The last adjoint surface is either minimal or belongs to one of the +exceptional cases. In particular, if $X$ has non-negative Kodaira dimension, the adjunction process yields the uniquely determined minimal model of $X$. + +!!! note + If $X$ is rational, the last adjoint surface is either $\mathbb P^{2}$, the Veronese surface, a Hirzebruch surface, a Del Pezzo surface, a conic bundle, or one of the four explicit families identified by Sommese and Van de Ven. + +!!! note + In explicit computations, we consider surfaces which are defined by polynomial equations with coefficients in a subfield of $\mathbb C$ which can be handled by OSCAR. + +!!! note + The surfaces in the examples below are taken from the OSCAR data base of nongeneral type surfaces in $\mathbb P^4$. To ease subsequent computations, the surfaces in the data base where constructed over finite fields. Note, however, that the recipes used in the constructions also work in characteristic zero. So all computations can be confirmed in characteristic zero, although this may be time consuming. + +```@docs +adjunction_process(X::AbsProjectiveVariety, steps::Int=0) +``` + + diff --git a/docs/src/AlgebraicGeometry/Surfaces/ParametrizationSurfaces.md b/docs/src/AlgebraicGeometry/Surfaces/ParametrizationSurfaces.md new file mode 100644 index 00000000000..d016f38ded2 --- /dev/null +++ b/docs/src/AlgebraicGeometry/Surfaces/ParametrizationSurfaces.md @@ -0,0 +1,9 @@ +```@meta +CurrentModule = Oscar +``` + +# Rational Parametrization of Rational Surfaces + +```@docs +parametrization(X::AbsProjectiveVariety) +``` diff --git a/docs/src/AlgebraicGeometry/Surfaces/SurfacesP4.md b/docs/src/AlgebraicGeometry/Surfaces/SurfacesP4.md index 675e8d65dab..887a7d2f3ef 100644 --- a/docs/src/AlgebraicGeometry/Surfaces/SurfacesP4.md +++ b/docs/src/AlgebraicGeometry/Surfaces/SurfacesP4.md @@ -29,7 +29,7 @@ and the references given there. Below, we present functions which return one hard coded example for each family presented in the first two papers above. Based on these papers, the existence of further families has -been shown. Explicit examples to be included here are under construction. +been shown. Hard coded OSCAR examples for these surfaces are under construction. !!! note To ease subsequent computations, all hard coded examples are defined over a finite prime field. diff --git a/src/AlgebraicGeometry/AlgebraicGeometry.jl b/src/AlgebraicGeometry/AlgebraicGeometry.jl index 00c12222f8f..f222d7d9133 100644 --- a/src/AlgebraicGeometry/AlgebraicGeometry.jl +++ b/src/AlgebraicGeometry/AlgebraicGeometry.jl @@ -5,6 +5,8 @@ include("Curves/ProjectivePlaneCurve.jl") include("Curves/ProjectiveCurve.jl") include("Curves/ParametrizationPlaneCurves.jl") include("Surfaces/K3Auto.jl") +include("Surfaces/AdjunctionProcess/AdjunctionProcess.jl") +include("Surfaces/ParaRatSurfaces/ParametrizationSurfaces.jl") include("Surfaces/SurfacesP4.jl") include("RationalPoint/Types.jl") include("RationalPoint/PointSet.jl") diff --git a/src/AlgebraicGeometry/Schemes/ProjectiveVariety/Objects/Constructors.jl b/src/AlgebraicGeometry/Schemes/ProjectiveVariety/Objects/Constructors.jl index fb89c13e55e..68e0f7ad853 100644 --- a/src/AlgebraicGeometry/Schemes/ProjectiveVariety/Objects/Constructors.jl +++ b/src/AlgebraicGeometry/Schemes/ProjectiveVariety/Objects/Constructors.jl @@ -13,7 +13,7 @@ end @doc raw""" - variety(I::MPolyIdeal; is_prime::Bool, check::Bool=true) -> ProjectiveVariety + variety(I::MPolyIdeal{<:MPolyDecRingElem}; check::Bool=true, is_radical::Bool=false) -> ProjectiveVariety Return the projective variety defined by the homogeneous prime ideal ``I``. diff --git a/src/AlgebraicGeometry/Surfaces/AdjunctionProcess/AdjunctionProcess.jl b/src/AlgebraicGeometry/Surfaces/AdjunctionProcess/AdjunctionProcess.jl new file mode 100644 index 00000000000..279b190441b --- /dev/null +++ b/src/AlgebraicGeometry/Surfaces/AdjunctionProcess/AdjunctionProcess.jl @@ -0,0 +1,359 @@ + +############################################################################## +# +# adjunction process for surfaces +# +############################################################################## + +#function _random_vector(m::Int, I::MPolyIdeal, bound::Int = 30000) +# @assert m>0 +# R = base_ring(I) +# SM = Singular.LibRandom.randommat(m, 1, Oscar.singular_generators(I), bound) +# return [R(SM[i,1]) for i=1:nrows(SM)] +#end + +#function _random_matrix(m::Int, n::Int, I::MPolyIdeal, bound::Int = 30000) +# @assert n>0 +# @assert m>0 +# R = base_ring(I) +# SM = Singular.LibRandom.randommat(m, n, Oscar.singular_generators(I), bound) +# return Matrix(matrix(R, nrows(SM), ncols(SM), [R(SM[i,j]) for i=1:nrows(SM) for j=1:ncols(SM)])) +#end + +function _random_vector(R::MPolyDecRing, m::Int, d::Int) + @assert m>0 + rd = _random_matrix(R, m, 1, d) + return [R(rd[i,1]) for i=1:nrows(rd)] +end + +function _random_matrix(R::MPolyDecRing, m::Int, n::Int, d::Int) + @assert n>0 + @assert m>0 + F = graded_free_module(R, m) + G = graded_free_module(R, n) + G = twist(G, d) + H, h = hom(F, G) + phi = rand_homogeneous(H, 0) + return matrix(h(phi)) +end + +function _arithmetic_genus(I::MPolyIdeal) + S = base_ring(I) + #req is_standard_graded(S) "The base ring must be standard graded." + A, _ = quo(S, I) + H = hilbert_polynomial(A) + return (-1)^(dim(A)-1)*(ZZ(coeff(H, 0)) - 1) +end + +@doc raw""" + sectional_genus(X::AbsProjectiveVariety) + +Given a subvariety `X` of some $\mathbb P^n$, return the arithmetic genus of the intersection of `X` +with a general linear subspace of $\mathbb P^n$ of dimension $c+1$. + +# Examples +```jldoctest +julia> X = bordiga() +[ Info: upgrading serialized data.... +Projective variety + in projective 4-space over GF(31991) with coordinates [x, y, z, u, v] +defined by ideal with 4 generators + +julia> dim(X) +2 + +julia> codim(X) +2 + +julia> degree(X) +6 + +julia> sectional_genus(X) +3 +``` +""" +function sectional_genus(X::AbsProjectiveVariety) + I = defining_ideal(X) + S = base_ring(I) + nl = length(gens(S))-codim(I)-2 + rd = _random_vector(S, nl, 1) + J = ideal(S, rd)+I + dd = dim(J) + while !(dd == 2) + rd = _random_vector(S, nl, 1) + J = ideal(S, rd)+I + dd = dim(J) + end + return _arithmetic_genus(J) +end + +@doc raw""" + is_linearly_normal(X::AbsProjectiveVariety) + +Return `true` if `X` is linearly normal, and `false` otherwise. + +# Examples +```jldoctest +julia> X = bordiga() +[ Info: upgrading serialized data.... +Projective variety + in projective 4-space over GF(31991) with coordinates [x, y, z, u, v] +defined by ideal with 4 generators + +julia> dim(X) +2 + +julia> codim(X) +2 + +julia> is_linearly_normal(X) +true +``` +""" +function is_linearly_normal(X::AbsProjectiveVariety) + I = defining_ideal(X) + M = ideal_as_module(I) + n = length(gens(base_ring(I))) + tbl = sheaf_cohomology(M, -2, 1) + return tbl[1, 1] == 0 +end + +function _adjoint_matrix(D::AbstractAlgebra.Generic.MatSpaceElem) + #@req !any(x->is_zero(x) ? true : degree(Int, x) > 1, Oscar._vec(D)) "The code assumes that the input matrix has linear entries." + R = base_ring(D) + K = coefficient_ring(R) + r = ncols(D) + P, _ = graded_polynomial_ring(K, :z => 1:r) + RP, _ = graded_polynomial_ring(K, vcat(symbols(R), symbols(P))) + embRRP = hom(R, RP, gens(RP)[1:ngens(R)]) + projRPP = hom(RP, P, vcat([zero(P) for i = 1:ngens(R)], gens(P))) + M = map(embRRP, D)*matrix(gens(RP)[(ngens(R)+1):ngens(RP)]) + DM = [map_entries(x->derivative(x,i), M) for i = 1:ngens(R)] + MM = transpose(hcat(DM...)); + return transpose(map(projRPP, MM)) +end + +@doc raw""" + canonical_bundle(X::AbsProjectiveVariety) + +Given a smooth projective variety `X`, return a module whose sheafification is the canonical bundle of `X`. + +!!! note + The function does not check smoothness. If you are uncertain, enter `is_smooth(X)` first. + +# Examples + +``` +julia> R, x = graded_polynomial_ring(QQ, "x" => (1:6)); + +julia> I = ideal(R, [x[1]*x[6] - x[2]*x[5] + x[3]*x[4]]); + +julia> GRASSMANNIAN = variety(I); + +julia> Omega = canonical_bundle(GRASSMANNIAN) +Graded subquotient of submodule of R^1 generated by +1 -> e[1] +by submodule of R^1 generated by +1 -> (x[1]*x[6] - x[2]*x[5] + x[3]*x[4])*e[1] + +julia> degrees_of_generators(Omega) +1-element Vector{FinGenAbGroupElem}: + [4] +``` + +``` +julia> R, (x, y, z) = graded_polynomial_ring(QQ,["x", "y", "z"]); + +julia> I = ideal(R, [y^2*z + x*y*z - x^3 - x*z^2 - z^3]); + +julia> ELLCurve = variety(I); + +julia> Omega = canonical_bundle(ELLCurve) +Graded subquotient of submodule of R^1 generated by +1 -> e[1] +by submodule of R^1 generated by +1 -> (x^3 - x*y*z + x*z^2 - y^2*z + z^3)*e[1] + +julia> degrees_of_generators(Omega) +1-element Vector{FinGenAbGroupElem}: + [0] +``` + +```jldoctest +julia> X = bordiga() +[ Info: upgrading serialized data.... +Projective variety + in projective 4-space over GF(31991) with coordinates [x, y, z, u, v] +defined by ideal with 4 generators + +julia> dim(X) +2 + +julia> codim(X) +2 + +julia> Omega = canonical_bundle(X); + +julia> typeof(Omega) +SubquoModule{MPolyDecRingElem{fpFieldElem, fpMPolyRingElem}} +``` +""" +function canonical_bundle(X::AbsProjectiveVariety) + Pn = ambient_coordinate_ring(X) + n = ngens(Pn)-1 + I = defining_ideal(X) + c = codim(I) + A, _ = quo(Pn, I) + FA = free_resolution(A, algorithm = :mres) + FAC = FA.C + r = range(FAC) + C = shift(FAC[first(r):-1:1], -c) + F = free_module(Pn, 1) + OmegaPn = grade(F, [n+1]) + D = hom(C, OmegaPn); + Omega = homology(D, 0); + Omega, _ = prune_with_map(Omega); + return Omega +end + +@doc raw""" + adjunction_process(X::AbsProjectiveVariety, steps::Int=0) + +Given a smooth surface `X` and a non-negative integer `steps`, return data which describes the adjunction process for `X`: +If `steps == 0`, carry out the complete process. Otherwise, carry out the indicated number of steps only. + +More precisely, if $X^{(0)} = X \rightarrow X^{(1)}\rightarrow \dots \rightarrow X^{(r)}$ is the sequence of successive adjunction maps and +adjoint surfaces in the completed adjunction process, return a quadruple `L`, say, where: + +`L[1]` is a vector of tuples of numerical data: For each step $X^{(i)}\rightarrow X^{(i+1)}$, return the tuple $(n^{(i)}, d^{(i)}, \pi^{(i)}, s^{(i)}),$ +where $n^{(i)}$ is the dimension of the ambient projective space of $X^{(i)}$, $d^{(i)}$ is the degree of $X^{(i)}$, $\pi^{(i)}$ is the sectional genus of $X^{(i)}$, +and $s^{(i)}$ is the number of exceptional $(-1)$-lines on $X^{(i)}$ which are blown down to points in $ X^{(i+1)}$. + +`L[2]` is a vector of adjoint matrices: For each step $X^{(i)}\rightarrow X^{(i+1)}$, return a presentation matrix of $S_X^{(i)}(1)$ considered +as a module over $S_X^{(i+1)}$, where the $S_X^{(i)}$ are the homogeneous coordinate rings of the $X^{(i)}$. If `X` is rational, these matrices +can be used to compute a rational parametrization of `X`. + +`L[3]` is a vector of zero-dimensional projective algebraic sets: For each step $X^{(i)}\rightarrow X^{(i+1)}$, return the union of points in $ X^{(i+1)}$ +which are obtained by blowing down the exceptional $(-1)$-lines on $X^{(i)}$. + +`L[4]` is a projective variety: Return the last adjoint surface $X^{(r)}$. + + +!!! note + The function does not check whether `X` is smooth. If you are uncertain, enter `is_smooth(X)` first. + +!!! warning + At current state, the adjunction process is only implemented for rational surfaces which are linearly normal in the given embedding. The function does not check rationality. In fact, at current state, `OSCAR` does not offer a direct check for this. Note, however, that rationality will be clear a posteriori if the adjunction process terminates with a surface which is known to be rational. + +# Examples +```jldoctest +julia> X = bordiga() +[ Info: upgrading serialized data.... +Projective variety + in projective 4-space over GF(31991) with coordinates [x, y, z, u, v] +defined by ideal with 4 generators + + +julia> dim(X) +2 + +julia> codim(X) +2 + +julia> L = adjunction_process(X); + +julia> L[1] +2-element Vector{NTuple{4, ZZRingElem}}: + (4, 6, 3, 0) + (2, 1, 0, 10) + +julia> L[4] +Projective variety + in projective 2-space over GF(31991) with coordinates [z[1], z[2], z[3]] +defined by ideal (0) + +julia> L[3][1] +Projective algebraic set + in projective 2-space over GF(31991) with coordinates [z[1], z[2], z[3]] +defined by ideal with 5 generators + +julia> dim(L[3][1]) +0 + +julia> degree(L[3][1]) +10 +``` + +``` +julia> X = rational_d9_pi7(); +[ Info: upgrading serialized data.... + +julia> L = adjunction_process(X); + +julia> L[1] +3-element Vector{NTuple{4, ZZRingElem}}: + (4, 9, 7, 0) + (6, 9, 4, 6) + (3, 3, 1, 3) +``` + +!!! note + Inspecting the returned numerical data in the first example above, we see that the Bordiga surface is the blow-up of the projective plane in 10 points, embedded into projective 4-space by the linear system $H = 4L -\sum_{i=1}^{10} E_i$. Here, $L$ is the preimage of a line and the $E_i$ are the exceptional divisors. In the second example, we see from the output that the terminal object of the adjunction process is a Del Pezzo surface in projective 3-space, that is, the blow-up of the projective plane in 6 points. In sum, we see that `X` is the blow-up of the projective plane in 15 points, embedded into projective 4-space by the linear system $H = 9L - \sum_{i=1}^{6} 3E_i - \sum_{i=7}^{9} 2E_i - \sum_{i=10}^{15} E_i$. +""" +function adjunction_process(X::AbsProjectiveVariety, steps::Int = 0) + @assert steps >= 0 + Pn = ambient_coordinate_ring(X) + I = defining_ideal(X) + ### @assert is_standard_graded(Pn) + @req dim(I) == 3 "The given variety is not a surface." + @req is_linearly_normal(X) "The given variety is not linearly normal." + # TODO If X is not linear normal, embed it as a linearly normal variety first. + numlist = [(ZZ(ngens(Pn)-1), degree(X), sectional_genus(X), zero(ZZ))] + ptslist = ProjectiveAlgebraicSet[] + adjlist = AbstractAlgebra.Generic.MatSpaceElem[] + Omega = canonical_bundle(X) + FOmega = free_resolution(Omega, length = 1, algorithm = :mres) + D = matrix(map(FOmega,1)) + count = 1 + while nrows(D) > 2 && (steps == 0 || count <= steps) + #if !any(x->is_zero(x) ? true : degree(Int, x) > 1, Oscar._vec(D)) + if !any(x -> total_degree(x) > 1, Oscar._vec(D)) + adj = _adjoint_matrix(D) + else + return (numlist, adjlist, ptslist, variety(I, check = false, is_radical = false)) + end + rd = _random_matrix(Pn, 3, ncols(adj), 0) + dd = dim(ideal(Pn, rd*gens(Pn))+I) + while !(dd == 0) + rd = _random_matrix(Pn, 3, ncols(adj), 0) + dd = dim(ideal(Pn, rd*gens(Pn))+I) + end + + I = annihilator(cokernel(adj)) + Pn = base_ring(I) + + Ipts = ideal(Pn, [zero(Pn)]) + RD = map_entries(constant_coefficient, rd) + for i = 1:3 + KKi = map_entries(Pn, kernel(matrix(RD[i,:]))) + AAi = annihilator(cokernel(adj*transpose(KKi))) + Ipts = Ipts+AAi + end + Ipts = saturation(Ipts, ideal(Pn, gens(Pn))) + pts = algebraic_set(Ipts, is_radical = false, check = false) + push!(ptslist, pts) + if dim(pts) == 0 + l = degree(pts) + else + l = zero(ZZ) + end + push!(adjlist, adj) + push!(numlist, (ZZ(ngens(Pn)-1), degree(I), sectional_genus(variety(I, check = false, is_radical = false)), l)) + Omega = canonical_bundle(variety(I, check = false, is_radical = false)) + FOmega = free_resolution(Omega, length = 1, algorithm = :mres) + D = matrix(map(FOmega,1)) + count = count+1 + end + return (numlist, adjlist, ptslist, variety(I, check = false, is_radical = false)) +end + diff --git a/src/AlgebraicGeometry/Surfaces/ParaRatSurfaces/ParametrizationSurfaces.jl b/src/AlgebraicGeometry/Surfaces/ParaRatSurfaces/ParametrizationSurfaces.jl new file mode 100644 index 00000000000..98dd1123d24 --- /dev/null +++ b/src/AlgebraicGeometry/Surfaces/ParaRatSurfaces/ParametrizationSurfaces.jl @@ -0,0 +1,79 @@ + +############################################################################## +# +# Rational Parametrizations of rational surfaces +# +############################################################################## + +@doc raw""" + parametrization(X::AbsProjectiveVariety) + +Given a smooth rational surface `X` which is linearly normal in the given embedding, return a rational parametrization of `X`. + +!!! note + The function does not check whether `X` is smooth. If you are uncertain, enter `is_smooth(X)` first. + +!!! note + The function does not check rationality. In fact, at current state, `OSCAR` does not offer a direct check for this. + +!!! note + The function makes use of the adjunction process. It returns an error message if the terminal object of the adjunction process is not the projective plane. See the OSCAR documentation for information on the adjunction process. + +# Examples +```jldoctest +julia> X = bordiga() +[ Info: upgrading serialized data.... +Projective variety + in projective 4-space over GF(31991) with coordinates [x, y, z, u, v] +defined by ideal with 4 generators + +julia> dim(X) +2 + +julia> codim(X) +2 + +julia> phi = parametrization(X); + +julia> domain(phi) +Multivariate polynomial ring in 5 variables over GF(31991) graded by + x -> [1] + y -> [1] + z -> [1] + u -> [1] + v -> [1] + +julia> codomain(phi) +Multivariate polynomial ring in 3 variables over GF(31991) graded by + z[1] -> [1] + z[2] -> [1] + z[3] -> [1] + +julia> [degree(phi(x)) for x in gens(ambient_coordinate_ring(X))] +5-element Vector{FinGenAbGroupElem}: + [4] + [4] + [4] + [4] + [4] +``` +""" +function parametrization(X::AbsProjectiveVariety) + L = adjunction_process(X); + @req is_zero(defining_ideal(L[4])) "The terminal object of the adjunction process is not the projective plane." + RX = ambient_coordinate_ring(X) + if L[2] == [] + return hom(RX, RX, gens(RX)) + end + n = length(L[2]) + RXterminal = base_ring(L[2][n]) + H = gens(RXterminal) + while n > 0 + S = base_ring(L[2][n]) + phi = hom(S, RXterminal, H) + M = syz(transpose(map_entries(x->phi(x), L[2][n]))) + H = M[1, :] + n = n-1 + end + return hom(RX, RXterminal, H) +end diff --git a/src/AlgebraicGeometry/Surfaces/SurfacesP4.jl b/src/AlgebraicGeometry/Surfaces/SurfacesP4.jl index dd951659487..c694dc82e48 100644 --- a/src/AlgebraicGeometry/Surfaces/SurfacesP4.jl +++ b/src/AlgebraicGeometry/Surfaces/SurfacesP4.jl @@ -52,7 +52,8 @@ function surface(n::String) I = load(n) S = base_ring(I) R = grade(S)[1] - return proj(R, ideal(R, map(R, gens(I)))) + #return proj(R, ideal(R, map(R, gens(I)))) + return variety(ideal(R, map(R, gens(I))), check = false, is_radical = false,) end ############################### diff --git a/src/exports.jl b/src/exports.jl index 76640a9ef92..fc11bce84d7 100644 --- a/src/exports.jl +++ b/src/exports.jl @@ -190,6 +190,7 @@ export add_vertices! export adjacency_tree export adjacent_chamber export adjoint_ideal +export adjunction_process export affine_algebra export affine_charts export affine_cone @@ -797,6 +798,7 @@ export is_johnson_solid export is_k_separation export is_lattice_polytope export is_left +export is_linearly_normal export is_local export is_loopless export is_manifold @@ -1317,6 +1319,7 @@ export schur_polynomial export secondary_cone export secondary_invariants export secondary_polytope +export sectional_genus export semi_invariants export semidirect_product export semistandard_tableaux diff --git a/test/AlgebraicGeometry/Surfaces/adjunction.jl b/test/AlgebraicGeometry/Surfaces/adjunction.jl new file mode 100644 index 00000000000..6df1b8f49ce --- /dev/null +++ b/test/AlgebraicGeometry/Surfaces/adjunction.jl @@ -0,0 +1,13 @@ +@testset "adjunction theory for surfaces" begin + X = rational_d7_pi4(); + L = adjunction_process(X) + @test L[1][2][1] == L[1][2][2] == 3 + @test L[1][2][3] == sectional_genus(L[4]) == 1 +end + +@testset "parametrization" begin + X = bordiga() + H = parametrization(X) + R = domain(H) + @test total_degree(H(gens(R)[1])) == 4 +end From d2330fa063f4de0e22fca1b70f58f55f824f501f Mon Sep 17 00:00:00 2001 From: Matthias Zach <85350711+HechtiDerLachs@users.noreply.github.com> Date: Mon, 6 May 2024 14:21:25 +0200 Subject: [PATCH 2/7] Some fix for hypercomplexes (#3686) * Fix kernel computation. * Add tests. * Use Schreyer's resolution. * Add tests. * Fix tests. --- .../src/Morphisms/Types.jl | 1 + .../src/Morphisms/free_resolutions.jl | 38 ++++++++++++++++++- .../src/Morphisms/simplified_complexes.jl | 4 +- .../DoubleAndHyperComplexes/test/ext.jl | 26 +++++++++++++ 4 files changed, 66 insertions(+), 3 deletions(-) diff --git a/experimental/DoubleAndHyperComplexes/src/Morphisms/Types.jl b/experimental/DoubleAndHyperComplexes/src/Morphisms/Types.jl index 13df077cce5..9e5a5c1ac05 100644 --- a/experimental/DoubleAndHyperComplexes/src/Morphisms/Types.jl +++ b/experimental/DoubleAndHyperComplexes/src/Morphisms/Types.jl @@ -122,6 +122,7 @@ end underlying_complex(c::SimplifiedComplex) = c.complex map_to_original_complex(c::SimplifiedComplex) = c.map_to_original map_from_original_complex(c::SimplifiedComplex) = c.map_from_original +original_complex(c::SimplifiedComplex) = c.original_complex @attributes mutable struct SimpleFreeResolution{ChainType, MorphismType, ModuleType} <: AbsSimpleComplex{ChainType, MorphismType} M::ModuleType # The original module to be resolved diff --git a/experimental/DoubleAndHyperComplexes/src/Morphisms/free_resolutions.jl b/experimental/DoubleAndHyperComplexes/src/Morphisms/free_resolutions.jl index 98a7df28c25..4b1339aadad 100644 --- a/experimental/DoubleAndHyperComplexes/src/Morphisms/free_resolutions.jl +++ b/experimental/DoubleAndHyperComplexes/src/Morphisms/free_resolutions.jl @@ -17,7 +17,6 @@ function (fac::ResolutionModuleFactory{ChainType})(c::AbsHyperComplex, I::Tuple) R = base_ring(fac.orig_mod) if iszero(i) - n = ngens(fac.orig_mod) return _make_free_module(fac.orig_mod, gens(fac.orig_mod)) end @@ -52,6 +51,43 @@ function (fac::ResolutionModuleFactory{ChainType})(c::AbsHyperComplex, I::Tuple) return next end +# Modified version to use Schreyer's resolution where applicable +function (fac::ResolutionModuleFactory{ChainType})( + c::AbsHyperComplex, I::Tuple + ) where {ChainType <: ModuleFP{<:MPolyRingElem{<:FieldElem}}} + i = first(I) + R = base_ring(fac.orig_mod) + + is_zero(i) && return _make_free_module(fac.orig_mod, gens(fac.orig_mod)) + + if is_empty(fac.map_cache) + # start the resolution from scratch + # It turns out to usually be better to compute the full Schreyer resolution at once + # instead of incrementally. + res = free_resolution(fac.orig_mod; algorithm=:fres) + phi = map(res, 1) + F = c[0] # caught above + id = hom(codomain(phi), F, gens(F)) + push!(fac.map_cache, compose(phi, id)) + r = first(range(res.C)) # the index of the last module + for j in 2:r + push!(fac.map_cache, map(res, j)) + end + @assert is_zero(domain(last(fac.map_cache))) + end + + m = length(fac.map_cache) + i == 0 && return codomain(first(fac.map_cache)) + i <= m && return domain(fac.map_cache[i]) + + for j in m+1:i + next, inc = zero_object(domain(last(fac.map_cache))) + push!(fac.map_cache, inc) + end + return domain(last(fac.map_cache)) +end + + function zero_object(M::ModuleFP) if is_graded(M) result = graded_free_module(base_ring(M), []) diff --git a/experimental/DoubleAndHyperComplexes/src/Morphisms/simplified_complexes.jl b/experimental/DoubleAndHyperComplexes/src/Morphisms/simplified_complexes.jl index 75090903869..4ca3ef16edc 100644 --- a/experimental/DoubleAndHyperComplexes/src/Morphisms/simplified_complexes.jl +++ b/experimental/DoubleAndHyperComplexes/src/Morphisms/simplified_complexes.jl @@ -658,8 +658,8 @@ function kernel(simp::SimplifiedComplex{ChainType}, p::Int, i::Tuple) where {Cha return K, inc end - psi = map_to_original(simp)[i] - phi = map(c, p, i) + psi = map_to_original_complex(simp)[i] + phi = map(original_complex(simp), p, i) K, inc = kernel(compose(psi, phi)) c.kernel_cache[(i, p)] = inc return K, inc diff --git a/experimental/DoubleAndHyperComplexes/test/ext.jl b/experimental/DoubleAndHyperComplexes/test/ext.jl index 339f299cf16..b326ee0140b 100644 --- a/experimental/DoubleAndHyperComplexes/test/ext.jl +++ b/experimental/DoubleAndHyperComplexes/test/ext.jl @@ -352,3 +352,29 @@ end @test double_ind[-2, 1] isa ModuleFPHom end + +@testset "canonical bundle" begin + R, z = polynomial_ring(GF(3), "z" => 1:10) + S, z = grade(R) + V = [z[1]*z[7] + z[1]*z[9] + 2*z[1]*z[10] + z[2]*z[7] + 2*z[2]*z[8] + 2*z[2]*z[9] + z[2]*z[10] + z[3]*z[7] + 2*z[3]*z[8] + 2*z[3]*z[10] + 2*z[4]*z[7] + z[5]*z[6] + z[5]*z[7] + 2*z[5]*z[8] + z[5]*z[10] + 2*z[6]^2 + 2*z[6]*z[7] + z[7]^2 + 2*z[7]*z[8] + z[7]*z[9] + 2*z[7]*z[10] + z[8]^2 + 2*z[8]*z[9] + 2*z[8]*z[10] + z[9]*z[10] + z[10]^2, z[1]*z[7] + z[1]*z[8] + z[1]*z[9] + z[2]*z[6] + z[2]*z[7] + 2*z[2]*z[8] + z[2]*z[9] + z[2]*z[10] + 2*z[3]*z[6] + 2*z[3]*z[7] + z[3]*z[8] + z[3]*z[9] + 2*z[4]*z[6] + z[4]*z[7] + 2*z[4]*z[9] + 2*z[4]*z[10] + z[5]*z[9] + z[5]*z[10] + z[6]^2 + z[6]*z[7] + z[6]*z[9] + z[7]^2 + 2*z[7]*z[8] + z[7]*z[9] + 2*z[7]*z[10] + 2*z[8]^2 + z[8]*z[9] + 2*z[8]*z[10] + z[10]^2, z[1]*z[6] + z[1]*z[8] + z[1]*z[9] + z[1]*z[10] + 2*z[2]*z[7] + 2*z[2]*z[8] + 2*z[2]*z[9] + 2*z[3]*z[7] + 2*z[3]*z[10] + 2*z[4]*z[6] + z[4]*z[7] + 2*z[4]*z[9] + z[4]*z[10] + z[5]*z[7] + 2*z[5]*z[9] + 2*z[5]*z[10] + 2*z[6]^2 + z[6]*z[7] + z[6]*z[8] + 2*z[6]*z[9] + 2*z[7]^2 + z[7]*z[8] + z[7]*z[10] + z[8]*z[9] + z[8]*z[10] + z[9]^2 + 2*z[9]*z[10] + 2*z[10]^2, z[1]*z[7] + 2*z[1]*z[8] + z[1]*z[9] + z[1]*z[10] + z[2]*z[8] + z[2]*z[10] + 2*z[3]*z[8] + 2*z[3]*z[10] + z[4]*z[7] + 2*z[4]*z[10] + z[5]^2 + 2*z[5]*z[7] + 2*z[5]*z[8] + 2*z[5]*z[10] + 2*z[6]^2 + z[6]*z[8] + 2*z[6]*z[9] + 2*z[6]*z[10] + z[7]*z[8] + 2*z[7]*z[9] + 2*z[7]*z[10] + z[8]*z[9] + 2*z[9]^2 + 2*z[9]*z[10] + 2*z[10]^2, z[1]*z[8] + 2*z[2]*z[7] + 2*z[2]*z[8] + 2*z[2]*z[9] + 2*z[2]*z[10] + z[3]*z[7] + z[3]*z[8] + 2*z[3]*z[9] + z[4]*z[5] + 2*z[4]*z[6] + 2*z[4]*z[10] + 2*z[5]*z[7] + z[5]*z[9] + z[5]*z[10] + 2*z[6]^2 + z[6]*z[7] + z[6]*z[10] + 2*z[7]^2 + 2*z[7]*z[8] + z[7]*z[9] + 2*z[7]*z[10] + z[8]^2 + 2*z[8]*z[9] + 2*z[8]*z[10] + z[9]^2, z[1]*z[7] + z[1]*z[9] + 2*z[1]*z[10] + z[2]*z[8] + z[2]*z[9] + z[2]*z[10] + z[3]*z[5] + z[3]*z[6] + 2*z[3]*z[7] + z[3]*z[9] + 2*z[4]*z[8] + 2*z[4]*z[9] + z[5]*z[7] + 2*z[5]*z[8] + 2*z[5]*z[9] + 2*z[5]*z[10] + 2*z[6]^2 + z[6]*z[8] + 2*z[6]*z[9] + 2*z[6]*z[10] + 2*z[7]*z[8] + z[7]*z[9] + z[7]*z[10] + z[9]*z[10] + z[10]^2, z[1]*z[9] + z[1]*z[10] + z[2]*z[5] + z[2]*z[7] + z[2]*z[8] + 2*z[2]*z[10] + z[3]*z[6] + 2*z[3]*z[7] + z[3]*z[8] + z[4]*z[9] + z[5]*z[7] + 2*z[6]^2 + 2*z[6]*z[8] + z[6]*z[10] + z[7]^2 + 2*z[7]*z[8] + 2*z[7]*z[9] + z[7]*z[10] + 2*z[8]*z[10] + z[9]*z[10], z[1]*z[5] + 2*z[1]*z[10] + 2*z[2]*z[7] + 2*z[2]*z[8] + z[3]*z[8] + 2*z[4]*z[7] + 2*z[4]*z[8] + 2*z[4]*z[9] + z[4]*z[10] + z[5]*z[9] + 2*z[5]*z[10] + z[6]*z[7] + z[6]*z[9] + z[6]*z[10] + 2*z[7]^2 + z[7]*z[8] + z[7]*z[9] + z[7]*z[10] + 2*z[8]^2 + 2*z[8]*z[10] + 2*z[9]^2 + 2*z[9]*z[10] + 2*z[10]^2, 2*z[1]*z[8] + 2*z[1]*z[9] + 2*z[1]*z[10] + z[2]*z[7] + 2*z[2]*z[8] + 2*z[2]*z[9] + 2*z[2]*z[10] + z[3]*z[8] + 2*z[3]*z[9] + z[4]^2 + z[4]*z[6] + 2*z[4]*z[7] + z[4]*z[10] + z[5]*z[7] + 2*z[5]*z[8] + 2*z[5]*z[9] + 2*z[6]^2 + 2*z[6]*z[7] + z[6]*z[8] + 2*z[6]*z[9] + 2*z[6]*z[10] + z[7]^2 + 2*z[7]*z[8] + z[7]*z[9] + 2*z[7]*z[10] + z[8]^2 + z[8]*z[9] + 2*z[9]*z[10] + z[10]^2, z[1]*z[7] + z[1]*z[8] + z[2]*z[7] + 2*z[2]*z[8] + z[3]*z[4] + 2*z[3]*z[6] + 2*z[3]*z[7] + z[3]*z[8] + z[3]*z[9] + z[4]*z[6] + z[4]*z[7] + 2*z[4]*z[8] + z[4]*z[10] + z[5]*z[7] + 2*z[5]*z[8] + 2*z[5]*z[9] + z[5]*z[10] + 2*z[6]^2 + z[6]*z[7] + 2*z[6]*z[8] + 2*z[6]*z[9] + z[7]^2 + 2*z[7]*z[8] + z[7]*z[10] + z[8]^2 + z[8]*z[10] + 2*z[9]^2, 2*z[1]*z[8] + 2*z[1]*z[9] + z[1]*z[10] + z[2]*z[4] + z[2]*z[7] + z[2]*z[8] + z[2]*z[9] + 2*z[3]*z[6] + z[3]*z[8] + z[3]*z[10] + z[4]*z[6] + z[4]*z[7] + 2*z[4]*z[9] + z[4]*z[10] + z[5]*z[7] + z[5]*z[9] + z[6]^2 + 2*z[6]*z[7] + z[7]^2 + z[7]*z[10] + 2*z[8]^2 + 2*z[8]*z[9] + 2*z[8]*z[10] + 2*z[9]^2 + z[9]*z[10], z[1]*z[4] + z[1]*z[8] + z[2]*z[7] + z[2]*z[8] + z[2]*z[10] + z[3]*z[7] + 2*z[3]*z[8] + 2*z[3]*z[10] + 2*z[4]*z[6] + z[4]*z[7] + z[4]*z[8] + 2*z[4]*z[9] + 2*z[4]*z[10] + 2*z[5]*z[9] + z[5]*z[10] + 2*z[6]^2 + 2*z[6]*z[7] + 2*z[6]*z[9] + z[6]*z[10] + z[7]^2 + 2*z[7]*z[8] + z[7]*z[9] + z[8]^2 + z[8]*z[10] + z[9]^2 + 2*z[10]^2, 2*z[1]*z[7] + z[1]*z[8] + 2*z[1]*z[9] + z[1]*z[10] + z[2]*z[3] + z[2]*z[7] + 2*z[2]*z[9] + 2*z[2]*z[10] + 2*z[3]^2 + 2*z[3]*z[7] + 2*z[3]*z[8] + 2*z[3]*z[9] + z[3]*z[10] + 2*z[4]*z[7] + 2*z[4]*z[8] + 2*z[4]*z[9] + z[4]*z[10] + z[5]*z[7] + z[5]*z[8] + z[5]*z[9] + z[5]*z[10] + z[6]*z[7] + 2*z[6]*z[8] + z[6]*z[10] + z[7]^2 + 2*z[7]*z[9] + z[7]*z[10] + 2*z[9]^2 + z[9]*z[10], z[1]*z[3] + 2*z[1]*z[7] + z[1]*z[8] + 2*z[1]*z[9] + 2*z[1]*z[10] + z[2]*z[7] + z[2]*z[8] + z[2]*z[9] + 2*z[3]*z[6] + 2*z[3]*z[7] + 2*z[3]*z[8] + 2*z[3]*z[9] + 2*z[3]*z[10] + 2*z[4]*z[6] + z[4]*z[8] + z[4]*z[10] + 2*z[5]*z[7] + 2*z[5]*z[8] + z[5]*z[9] + z[6]*z[7] + 2*z[6]*z[10] + z[7]^2 + z[7]*z[8] + z[7]*z[9] + 2*z[7]*z[10] + 2*z[8]^2 + 2*z[8]*z[9] + 2*z[8]*z[10] + z[9]^2 + 2*z[9]*z[10] + z[10]^2, z[1]*z[7] + 2*z[1]*z[8] + z[1]*z[9] + z[2]^2 + 2*z[2]*z[7] + 2*z[2]*z[9] + 2*z[3]^2 + 2*z[3]*z[7] + 2*z[3]*z[8] + 2*z[3]*z[10] + 2*z[4]*z[6] + z[4]*z[8] + z[4]*z[10] + 2*z[5]*z[7] + 2*z[5]*z[9] + z[5]*z[10] + z[6]^2 + z[6]*z[7] + z[7]^2 + z[7]*z[9] + z[7]*z[10] + 2*z[8]^2 + z[8]*z[10] + 2*z[9]^2, z[1]*z[2] + 2*z[1]*z[7] + 2*z[1]*z[9] + z[1]*z[10] + z[2]*z[9] + z[2]*z[10] + 2*z[3]*z[6] + 2*z[3]*z[7] + z[3]*z[8] + z[3]*z[9] + z[3]*z[10] + z[4]*z[6] + z[4]*z[7] + z[4]*z[10] + 2*z[5]*z[8] + 2*z[5]*z[9] + 2*z[6]^2 + 2*z[6]*z[7] + z[6]*z[8] + z[7]*z[9] + 2*z[7]*z[10] + z[8]^2 + z[8]*z[9] + 2*z[9]^2 + z[9]*z[10] + 2*z[10]^2, z[1]^2 + 2*z[1]*z[7] + 2*z[1]*z[8] + 2*z[1]*z[9] + 2*z[1]*z[10] + z[2]*z[7] + 2*z[2]*z[8] + 2*z[2]*z[9] + z[3]*z[7] + 2*z[3]*z[8] + z[3]*z[9] + 2*z[3]*z[10] + 2*z[4]*z[6] + z[4]*z[7] + 2*z[4]*z[8] + z[5]*z[7] + z[5]*z[9] + z[5]*z[10] + z[6]^2 + 2*z[6]*z[7] + z[6]*z[8] + 2*z[6]*z[9] + 2*z[6]*z[10] + z[7]^2 + 2*z[7]*z[8] + z[7]*z[9] + 2*z[7]*z[10] + z[8]^2 + 2*z[8]*z[9] + 2*z[8]*z[10] + 2*z[9]*z[10] + z[10]^2, z[1]*z[7]*z[8] + 2*z[1]*z[7]*z[10] + 2*z[1]*z[8]*z[9] + z[1]*z[9]*z[10] + 2*z[1]*z[10]^2 + 2*z[2]*z[7]*z[9] + z[2]*z[8]^2 + z[2]*z[8]*z[10] + z[2]*z[9]^2 + z[2]*z[9]*z[10] + 2*z[2]*z[10]^2 + 2*z[3]*z[7]*z[8] + z[3]*z[7]*z[9] + z[3]*z[7]*z[10] + 2*z[3]*z[8]*z[9] + z[3]*z[8]*z[10] + 2*z[3]*z[9]^2 + z[3]*z[9]*z[10] + z[4]*z[6]*z[9] + z[4]*z[6]*z[10] + 2*z[4]*z[7]*z[8] + z[4]*z[8]^2 + z[4]*z[8]*z[10] + z[4]*z[9]^2 + z[4]*z[9]*z[10] + z[4]*z[10]^2 + z[5]*z[7]*z[8] + z[5]*z[7]*z[9] + 2*z[5]*z[7]*z[10] + 2*z[5]*z[8]^2 + z[5]*z[8]*z[10] + 2*z[5]*z[9]^2 + z[5]*z[9]*z[10] + z[6]^2*z[8] + z[6]^2*z[9] + 2*z[6]^2*z[10] + 2*z[6]*z[7]*z[8] + z[6]*z[7]*z[9] + z[6]*z[8]*z[9] + 2*z[6]*z[9]^2 + z[6]*z[10]^2 + 2*z[7]^2*z[8] + z[7]^2*z[9] + z[7]^2*z[10] + z[7]*z[8]^2 + z[7]*z[8]*z[10] + 2*z[7]*z[9]^2 + z[7]*z[10]^2 + 2*z[8]^3 + z[8]^2*z[9] + 2*z[8]^2*z[10] + z[8]*z[9]^2 + z[8]*z[9]*z[10] + 2*z[8]*z[10]^2 + 2*z[9]^2*z[10] + 2*z[9]*z[10]^2, 2*z[1]*z[7]*z[8] + 2*z[1]*z[7]*z[9] + z[1]*z[7]*z[10] + 2*z[1]*z[8]^2 + 2*z[1]*z[10]^2 + z[2]*z[7]*z[8] + 2*z[2]*z[7]*z[9] + z[2]*z[7]*z[10] + 2*z[2]*z[8]^2 + 2*z[2]*z[8]*z[10] + z[2]*z[9]^2 + z[2]*z[10]^2 + z[3]*z[6]*z[9] + 2*z[3]*z[6]*z[10] + z[3]*z[7]*z[9] + 2*z[3]*z[8]^2 + 2*z[3]*z[8]*z[9] + z[3]*z[9]^2 + 2*z[3]*z[9]*z[10] + 2*z[3]*z[10]^2 + z[4]*z[6]*z[8] + 2*z[4]*z[6]*z[9] + z[4]*z[6]*z[10] + 2*z[4]*z[7]*z[8] + 2*z[4]*z[8]^2 + z[4]*z[9]^2 + 2*z[4]*z[9]*z[10] + z[5]*z[7]*z[8] + z[5]*z[7]*z[9] + z[5]*z[7]*z[10] + 2*z[5]*z[8]^2 + z[5]*z[8]*z[9] + 2*z[5]*z[8]*z[10] + 2*z[5]*z[9]^2 + z[5]*z[9]*z[10] + z[5]*z[10]^2 + z[6]^2*z[10] + z[6]*z[7]*z[9] + z[6]*z[7]*z[10] + 2*z[6]*z[8]^2 + z[6]*z[8]*z[9] + 2*z[6]*z[9]*z[10] + z[6]*z[10]^2 + 2*z[7]^2*z[8] + z[7]*z[8]^2 + z[7]*z[8]*z[9] + 2*z[7]*z[9]*z[10] + 2*z[7]*z[10]^2 + 2*z[8]^3 + z[8]^2*z[9] + z[8]*z[9]*z[10] + 2*z[8]*z[10]^2 + 2*z[9]^3 + 2*z[9]^2*z[10] + 2*z[10]^3, 2*z[1]*z[7]*z[8] + 2*z[1]*z[7]*z[10] + z[1]*z[8]^2 + z[1]*z[8]*z[9] + 2*z[1]*z[9]^2 + 2*z[1]*z[9]*z[10] + z[1]*z[10]^2 + 2*z[2]*z[7]*z[8] + 2*z[2]*z[7]*z[9] + 2*z[2]*z[7]*z[10] + 2*z[2]*z[8]*z[9] + 2*z[2]*z[8]*z[10] + 2*z[2]*z[9]^2 + z[2]*z[9]*z[10] + z[3]^2*z[9] + 2*z[3]^2*z[10] + z[3]*z[6]*z[8] + 2*z[3]*z[6]*z[10] + z[3]*z[7]*z[8] + 2*z[3]*z[7]*z[10] + z[3]*z[8]*z[10] + 2*z[3]*z[9]^2 + 2*z[3]*z[9]*z[10] + z[3]*z[10]^2 + z[4]*z[6]*z[9] + z[4]*z[6]*z[10] + 2*z[4]*z[7]*z[8] + 2*z[4]*z[7]*z[9] + z[4]*z[7]*z[10] + 2*z[4]*z[8]*z[10] + z[4]*z[9]^2 + 2*z[4]*z[9]*z[10] + 2*z[4]*z[10]^2 + z[5]*z[7]*z[9] + z[5]*z[8]*z[9] + 2*z[5]*z[8]*z[10] + 2*z[5]*z[9]^2 + 2*z[5]*z[9]*z[10] + z[5]*z[10]^2 + z[6]^2*z[9] + z[6]^2*z[10] + 2*z[6]*z[7]*z[8] + 2*z[6]*z[8]*z[9] + 2*z[6]*z[8]*z[10] + 2*z[6]*z[9]^2 + z[6]*z[9]*z[10] + 2*z[7]^2*z[8] + 2*z[7]^2*z[9] + 2*z[7]^2*z[10] + z[7]*z[8]^2 + 2*z[7]*z[8]*z[9] + z[7]*z[8]*z[10] + z[7]*z[9]*z[10] + z[7]*z[10]^2 + z[8]^3 + z[8]^2*z[10] + z[8]*z[9]*z[10] + 2*z[9]^3 + z[9]*z[10]^2 + 2*z[10]^3, z[1]*z[7]*z[9] + z[1]*z[7]*z[10] + 2*z[1]*z[8]^2 + 2*z[1]*z[8]*z[10] + z[2]*z[7]*z[8] + 2*z[2]*z[7]*z[9] + z[2]*z[7]*z[10] + z[2]*z[8]^2 + z[2]*z[8]*z[9] + 2*z[2]*z[9]*z[10] + z[2]*z[10]^2 + 2*z[3]*z[7]*z[8] + 2*z[3]*z[8]^2 + z[3]*z[8]*z[10] + 2*z[3]*z[9]*z[10] + 2*z[3]*z[10]^2 + z[4]*z[6]*z[9] + 2*z[4]*z[7]*z[8] + 2*z[4]*z[8]^2 + 2*z[4]*z[10]^2 + z[5]*z[7]*z[8] + z[5]*z[7]*z[10] + 2*z[5]*z[8]^2 + 2*z[5]*z[8]*z[9] + 2*z[5]*z[9]^2 + z[5]*z[9]*z[10] + z[5]*z[10]^2 + 2*z[6]^2*z[9] + z[6]^2*z[10] + z[6]*z[7]^2 + z[6]*z[7]*z[8] + z[6]*z[7]*z[9] + 2*z[6]*z[7]*z[10] + z[6]*z[8]^2 + 2*z[6]*z[8]*z[9] + z[6]*z[9]^2 + 2*z[6]*z[10]^2 + z[7]^2*z[9] + 2*z[7]^2*z[10] + z[7]*z[8]^2 + 2*z[7]*z[8]*z[9] + 2*z[7]*z[8]*z[10] + 2*z[7]*z[9]*z[10] + z[8]^3 + z[8]^2*z[9] + 2*z[8]^2*z[10] + z[8]*z[9]^2 + z[8]*z[10]^2 + z[9]^3 + z[9]^2*z[10] + 2*z[9]*z[10]^2 + z[10]^3, 2*z[1]*z[7]*z[8] + z[1]*z[8]^2 + z[1]*z[8]*z[9] + z[1]*z[8]*z[10] + z[1]*z[9]^2 + z[1]*z[10]^2 + z[2]*z[7]*z[8] + z[2]*z[7]*z[9] + 2*z[2]*z[7]*z[10] + 2*z[2]*z[8]^2 + 2*z[2]*z[8]*z[9] + 2*z[2]*z[9]^2 + 2*z[2]*z[9]*z[10] + z[2]*z[10]^2 + z[3]*z[7]*z[9] + z[3]*z[7]*z[10] + z[3]*z[8]^2 + 2*z[3]*z[8]*z[10] + z[3]*z[9]^2 + 2*z[3]*z[10]^2 + z[4]*z[6]*z[8] + 2*z[4]*z[7]*z[8] + 2*z[4]*z[7]*z[9] + 2*z[4]*z[7]*z[10] + z[4]*z[8]^2 + 2*z[4]*z[8]*z[9] + z[4]*z[8]*z[10] + 2*z[4]*z[9]^2 + 2*z[4]*z[9]*z[10] + z[5]*z[7]^2 + 2*z[5]*z[7]*z[8] + 2*z[5]*z[7]*z[9] + 2*z[5]*z[8]*z[9] + z[5]*z[9]*z[10] + 2*z[5]*z[10]^2 + z[6]^2*z[9] + 2*z[6]*z[7]*z[8] + 2*z[6]*z[7]*z[9] + z[6]*z[8]^2 + z[6]*z[8]*z[9] + 2*z[6]*z[8]*z[10] + 2*z[6]*z[9]^2 + z[7]^2*z[8] + z[7]^2*z[9] + 2*z[7]^2*z[10] + 2*z[7]*z[8]*z[9] + 2*z[7]*z[8]*z[10] + 2*z[7]*z[10]^2 + z[8]^3 + 2*z[8]^2*z[10] + 2*z[8]*z[9]^2 + z[8]*z[9]*z[10] + z[8]*z[10]^2 + z[9]^3, 2*z[1]*z[7]*z[9] + 2*z[1]*z[7]*z[10] + 2*z[1]*z[8]^2 + 2*z[1]*z[8]*z[10] + z[1]*z[9]^2 + z[1]*z[9]*z[10] + 2*z[1]*z[10]^2 + 2*z[2]*z[7]*z[9] + 2*z[2]*z[7]*z[10] + z[2]*z[8]^2 + 2*z[2]*z[8]*z[9] + 2*z[2]*z[8]*z[10] + 2*z[2]*z[10]^2 + z[3]*z[7]*z[8] + 2*z[3]*z[7]*z[9] + 2*z[3]*z[7]*z[10] + z[3]*z[8]^2 + 2*z[3]*z[8]*z[9] + z[3]*z[8]*z[10] + 2*z[3]*z[9]^2 + 2*z[3]*z[9]*z[10] + 2*z[4]*z[6]*z[9] + z[4]*z[7]^2 + 2*z[4]*z[7]*z[9] + z[4]*z[7]*z[10] + 2*z[4]*z[8]^2 + z[4]*z[8]*z[9] + z[4]*z[8]*z[10] + z[4]*z[9]^2 + 2*z[4]*z[9]*z[10] + 2*z[5]*z[7]*z[8] + z[5]*z[7]*z[9] + z[5]*z[8]^2 + 2*z[5]*z[8]*z[9] + z[5]*z[9]^2 + 2*z[5]*z[9]*z[10] + 2*z[6]^2*z[8] + 2*z[6]^2*z[9] + z[6]^2*z[10] + 2*z[6]*z[7]^2 + 2*z[6]*z[7]*z[8] + z[6]*z[7]*z[9] + z[6]*z[8]^2 + 2*z[6]*z[8]*z[9] + z[6]*z[10]^2 + 2*z[7]^2*z[8] + 2*z[7]^2*z[9] + z[7]*z[8]^2 + 2*z[7]*z[8]*z[9] + z[7]*z[8]*z[10] + 2*z[7]*z[9]^2 + z[7]*z[10]^2 + z[8]^2*z[9] + 2*z[8]*z[9]^2 + z[8]*z[9]*z[10] + z[9]^3 + 2*z[9]^2*z[10] + 2*z[9]*z[10]^2 + z[10]^3, 2*z[1]*z[7]*z[9] + 2*z[1]*z[7]*z[10] + z[1]*z[8]^2 + z[1]*z[8]*z[10] + z[1]*z[10]^2 + 2*z[2]*z[7]*z[8] + z[2]*z[7]*z[9] + 2*z[2]*z[9]^2 + 2*z[2]*z[9]*z[10] + z[2]*z[10]^2 + 2*z[3]*z[6]*z[9] + z[3]*z[6]*z[10] + z[3]*z[7]^2 + 2*z[3]*z[7]*z[8] + 2*z[3]*z[7]*z[9] + z[3]*z[7]*z[10] + 2*z[3]*z[8]^2 + 2*z[3]*z[10]^2 + z[4]*z[6]*z[8] + z[4]*z[6]*z[9] + 2*z[4]*z[6]*z[10] + 2*z[4]*z[7]*z[8] + z[4]*z[7]*z[9] + 2*z[4]*z[7]*z[10] + z[4]*z[8]^2 + z[4]*z[8]*z[10] + z[4]*z[9]^2 + 2*z[4]*z[9]*z[10] + 2*z[4]*z[10]^2 + 2*z[5]*z[7]^2 + z[5]*z[7]*z[8] + z[5]*z[7]*z[9] + 2*z[5]*z[7]*z[10] + z[5]*z[8]^2 + z[5]*z[8]*z[9] + 2*z[5]*z[8]*z[10] + z[5]*z[10]^2 + 2*z[6]^2*z[8] + 2*z[6]^2*z[9] + 2*z[6]^2*z[10] + 2*z[6]*z[7]^2 + z[6]*z[7]*z[8] + 2*z[6]*z[7]*z[9] + 2*z[6]*z[7]*z[10] + z[6]*z[8]^2 + z[6]*z[8]*z[9] + z[6]*z[9]^2 + z[7]^2*z[9] + 2*z[7]^2*z[10] + z[7]*z[8]^2 + z[7]*z[8]*z[9] + z[7]*z[9]^2 + 2*z[7]*z[9]*z[10] + z[7]*z[10]^2 + z[8]^3 + z[8]^2*z[9] + z[8]^2*z[10] + 2*z[8]*z[9]^2 + 2*z[8]*z[10]^2 + 2*z[9]^2*z[10] + 2*z[10]^3, 2*z[1]*z[7]*z[8] + 2*z[1]*z[7]*z[9] + 2*z[1]*z[9]*z[10] + z[2]*z[7]^2 + 2*z[2]*z[7]*z[8] + 2*z[2]*z[7]*z[10] + z[2]*z[8]^2 + z[2]*z[8]*z[9] + 2*z[2]*z[9]^2 + z[2]*z[9]*z[10] + z[3]*z[6]*z[9] + 2*z[3]*z[6]*z[10] + z[3]*z[7]^2 + 2*z[3]*z[7]*z[8] + z[3]*z[7]*z[9] + 2*z[3]*z[7]*z[10] + 2*z[3]*z[8]^2 + z[3]*z[8]*z[9] + z[3]*z[10]^2 + z[4]*z[6]*z[10] + 2*z[4]*z[7]^2 + 2*z[4]*z[7]*z[8] + 2*z[4]*z[7]*z[9] + z[4]*z[7]*z[10] + 2*z[4]*z[8]^2 + 2*z[4]*z[8]*z[10] + 2*z[4]*z[9]*z[10] + 2*z[5]*z[7]^2 + 2*z[5]*z[7]*z[8] + 2*z[5]*z[7]*z[9] + z[5]*z[7]*z[10] + z[5]*z[8]*z[9] + z[5]*z[9]^2 + 2*z[5]*z[9]*z[10] + 2*z[5]*z[10]^2 + z[6]^2*z[9] + 2*z[6]^2*z[10] + 2*z[6]*z[7]^2 + 2*z[6]*z[7]*z[8] + z[6]*z[7]*z[9] + 2*z[6]*z[8]^2 + z[6]*z[9]^2 + 2*z[6]*z[10]^2 + z[7]^3 + 2*z[7]^2*z[9] + z[7]^2*z[10] + z[7]*z[8]^2 + z[7]*z[9]^2 + 2*z[7]*z[9]*z[10] + z[7]*z[10]^2 + 2*z[8]^3 + 2*z[8]^2*z[9] + z[8]^2*z[10] + z[8]*z[10]^2 + 2*z[9]^3 + 2*z[9]^2*z[10] + z[9]*z[10]^2 + z[10]^3, z[1]*z[7]^2 + 2*z[1]*z[7]*z[8] + z[1]*z[7]*z[9] + z[1]*z[7]*z[10] + 2*z[1]*z[8]^2 + z[1]*z[8]*z[9] + z[1]*z[9]*z[10] + 2*z[1]*z[10]^2 + z[2]*z[7]^2 + z[2]*z[7]*z[9] + 2*z[2]*z[7]*z[10] + 2*z[2]*z[8]^2 + 2*z[2]*z[8]*z[9] + z[2]*z[8]*z[10] + z[2]*z[9]^2 + z[3]*z[6]*z[9] + 2*z[3]*z[6]*z[10] + z[3]*z[7]^2 + z[3]*z[7]*z[10] + z[3]*z[8]^2 + 2*z[3]*z[8]*z[10] + z[3]*z[9]*z[10] + 2*z[3]*z[10]^2 + z[4]*z[6]*z[8] + 2*z[4]*z[6]*z[9] + z[4]*z[6]*z[10] + 2*z[4]*z[7]^2 + z[4]*z[7]*z[8] + 2*z[4]*z[7]*z[9] + 2*z[4]*z[7]*z[10] + z[4]*z[8]*z[9] + 2*z[4]*z[8]*z[10] + z[4]*z[9]^2 + 2*z[4]*z[9]*z[10] + z[4]*z[10]^2 + 2*z[5]*z[7]^2 + 2*z[5]*z[7]*z[8] + 2*z[5]*z[7]*z[9] + z[5]*z[7]*z[10] + 2*z[5]*z[8]^2 + 2*z[5]*z[8]*z[9] + 2*z[5]*z[8]*z[10] + z[5]*z[9]*z[10] + 2*z[5]*z[10]^2 + z[6]^2*z[8] + z[6]^2*z[9] + 2*z[6]^2*z[10] + 2*z[6]*z[7]^2 + 2*z[6]*z[7]*z[9] + 2*z[6]*z[7]*z[10] + 2*z[6]*z[8]^2 + z[6]*z[8]*z[9] + 2*z[6]*z[8]*z[10] + z[6]*z[9]^2 + z[6]*z[9]*z[10] + z[6]*z[10]^2 + z[7]^3 + z[7]^2*z[8] + z[7]^2*z[9] + 2*z[7]^2*z[10] + 2*z[7]*z[8]^2 + z[7]*z[8]*z[9] + z[7]*z[9]^2 + z[8]^3 + 2*z[8]*z[9]^2 + z[9]^2*z[10] + z[9]*z[10]^2 + 2*z[10]^3, z[1]*z[7]*z[9] + z[1]*z[7]*z[10] + 2*z[1]*z[9]*z[10] + 2*z[1]*z[10]^2 + 2*z[2]*z[7]^2 + 2*z[2]*z[7]*z[8] + z[2]*z[8]*z[10] + 2*z[2]*z[9]^2 + z[2]*z[9]*z[10] + 2*z[2]*z[10]^2 + 2*z[3]*z[6]*z[9] + z[3]*z[6]*z[10] + z[3]*z[7]*z[8] + z[3]*z[7]*z[9] + z[3]*z[7]*z[10] + 2*z[3]*z[8]^2 + z[3]*z[8]*z[9] + 2*z[4]*z[7]^2 + z[4]*z[7]*z[8] + z[4]*z[7]*z[10] + z[4]*z[9]^2 + z[4]*z[9]*z[10] + 2*z[4]*z[10]^2 + z[5]*z[7]*z[8] + 2*z[5]*z[7]*z[9] + z[5]*z[7]*z[10] + 2*z[5]*z[8]^2 + 2*z[5]*z[8]*z[9] + z[5]*z[9]^2 + 2*z[5]*z[10]^2 + z[6]^2*z[7] + 2*z[6]^2*z[8] + z[6]^2*z[9] + 2*z[6]^2*z[10] + 2*z[6]*z[7]^2 + z[6]*z[7]*z[8] + 2*z[6]*z[7]*z[9] + z[6]*z[8]*z[9] + 2*z[6]*z[9]*z[10] + 2*z[6]*z[10]^2 + 2*z[7]^3 + 2*z[7]^2*z[8] + 2*z[7]^2*z[9] + z[7]*z[8]*z[10] + 2*z[7]*z[9]*z[10] + 2*z[8]^2*z[9] + z[8]^2*z[10] + 2*z[8]*z[9]*z[10] + 2*z[9]^3 + z[9]*z[10]^2 + 2*z[10]^3, 2*z[1]*z[7]^2 + 2*z[1]*z[7]*z[8] + 2*z[1]*z[7]*z[9] + 2*z[1]*z[7]*z[10] + 2*z[1]*z[8]*z[9] + 2*z[1]*z[9]^2 + z[1]*z[9]*z[10] + z[2]*z[7]*z[9] + 2*z[2]*z[7]*z[10] + 2*z[2]*z[8]^2 + 2*z[2]*z[8]*z[9] + z[2]*z[8]*z[10] + z[2]*z[9]^2 + z[2]*z[9]*z[10] + 2*z[2]*z[10]^2 + z[3]*z[7]*z[9] + z[3]*z[7]*z[10] + 2*z[3]*z[8]^2 + z[3]*z[8]*z[9] + z[3]*z[9]^2 + z[3]*z[9]*z[10] + z[3]*z[10]^2 + z[4]*z[6]*z[7] + 2*z[4]*z[6]*z[8] + 2*z[4]*z[6]*z[9] + 2*z[4]*z[6]*z[10] + z[4]*z[7]*z[8] + z[4]*z[7]*z[9] + 2*z[4]*z[7]*z[10] + 2*z[4]*z[8]^2 + z[4]*z[9]^2 + 2*z[4]*z[9]*z[10] + z[4]*z[10]^2 + z[5]*z[7]^2 + 2*z[5]*z[7]*z[8] + 2*z[5]*z[7]*z[9] + 2*z[5]*z[7]*z[10] + 2*z[5]*z[8]^2 + z[5]*z[8]*z[9] + 2*z[5]*z[8]*z[10] + z[5]*z[9]*z[10] + 2*z[5]*z[10]^2 + z[6]^2*z[7] + 2*z[6]^2*z[8] + z[6]^2*z[9] + 2*z[6]^2*z[10] + z[6]*z[7]^2 + z[6]*z[7]*z[8] + 2*z[6]*z[7]*z[9] + z[6]*z[8]^2 + z[6]*z[8]*z[9] + z[6]*z[8]*z[10] + z[6]*z[9]^2 + z[6]*z[9]*z[10] + 2*z[6]*z[10]^2 + 2*z[7]^2*z[8] + 2*z[7]^2*z[9] + 2*z[7]^2*z[10] + z[7]*z[8]^2 + 2*z[7]*z[8]*z[9] + 2*z[7]*z[8]*z[10] + 2*z[7]*z[9]^2 + 2*z[7]*z[10]^2 + z[8]^3 + 2*z[8]^2*z[9] + 2*z[8]^2*z[10] + 2*z[8]*z[9]^2 + z[8]*z[9]*z[10] + z[8]*z[10]^2 + z[9]^3 + z[9]^2*z[10] + z[9]*z[10]^2, z[1]*z[7]*z[9] + z[1]*z[7]*z[10] + 2*z[1]*z[8]^2 + z[1]*z[8]*z[10] + 2*z[1]*z[9]^2 + 2*z[1]*z[9]*z[10] + z[1]*z[10]^2 + z[2]*z[7]^2 + z[2]*z[7]*z[8] + 2*z[2]*z[7]*z[9] + z[2]*z[8]*z[9] + 2*z[2]*z[8]*z[10] + z[2]*z[9]^2 + z[2]*z[9]*z[10] + z[3]*z[6]*z[7] + z[3]*z[6]*z[8] + 2*z[3]*z[6]*z[10] + z[3]*z[7]^2 + 2*z[3]*z[7]*z[8] + z[3]*z[7]*z[9] + z[3]*z[7]*z[10] + 2*z[3]*z[8]*z[10] + 2*z[3]*z[9]^2 + 2*z[4]*z[6]*z[8] + 2*z[4]*z[6]*z[9] + z[4]*z[7]*z[8] + z[4]*z[7]*z[9] + z[4]*z[7]*z[10] + z[4]*z[9]^2 + z[4]*z[9]*z[10] + z[4]*z[10]^2 + z[5]*z[7]^2 + z[5]*z[7]*z[9] + z[5]*z[8]^2 + z[5]*z[8]*z[9] + 2*z[5]*z[8]*z[10] + 2*z[5]*z[9]*z[10] + 2*z[5]*z[10]^2 + 2*z[6]^2*z[8] + 2*z[6]^2*z[9] + z[6]*z[7]*z[9] + z[6]*z[7]*z[10] + 2*z[6]*z[8]^2 + 2*z[6]*z[8]*z[9] + z[6]*z[8]*z[10] + 2*z[6]*z[9]*z[10] + z[7]^3 + z[7]^2*z[8] + z[7]^2*z[9] + 2*z[7]*z[8]^2 + z[7]*z[8]*z[9] + z[7]*z[8]*z[10] + 2*z[7]*z[9]^2 + z[7]*z[9]*z[10] + z[7]*z[10]^2 + 2*z[8]^2*z[9] + z[8]^2*z[10] + z[8]*z[9]^2 + 2*z[8]*z[9]*z[10] + z[8]*z[10]^2 + 2*z[9]^3 + 2*z[9]^2*z[10] + 2*z[9]*z[10]^2 + 2*z[10]^3, z[1]*z[7]*z[8] + 2*z[1]*z[7]*z[9] + z[1]*z[7]*z[10] + z[1]*z[8]^2 + z[1]*z[8]*z[9] + z[1]*z[8]*z[10] + z[1]*z[9]^2 + z[1]*z[9]*z[10] + 2*z[1]*z[10]^2 + 2*z[2]*z[7]*z[9] + 2*z[2]*z[8]*z[10] + z[2]*z[9]*z[10] + z[3]^2*z[7] + z[3]^2*z[8] + 2*z[3]^2*z[9] + 2*z[3]*z[6]*z[8] + 2*z[3]*z[6]*z[9] + 2*z[3]*z[6]*z[10] + 2*z[3]*z[7]*z[8] + z[3]*z[7]*z[9] + z[3]*z[7]*z[10] + z[3]*z[8]^2 + z[3]*z[8]*z[9] + 2*z[3]*z[9]^2 + z[3]*z[9]*z[10] + 2*z[3]*z[10]^2 + 2*z[4]*z[6]*z[8] + z[4]*z[6]*z[10] + z[4]*z[7]*z[8] + z[4]*z[8]^2 + 2*z[4]*z[8]*z[10] + 2*z[4]*z[9]*z[10] + 2*z[5]*z[7]*z[8] + z[5]*z[7]*z[9] + 2*z[5]*z[8]^2 + 2*z[5]*z[8]*z[9] + z[5]*z[8]*z[10] + z[5]*z[9]*z[10] + 2*z[5]*z[10]^2 + 2*z[6]^2*z[10] + 2*z[6]*z[7]*z[9] + z[6]*z[7]*z[10] + 2*z[6]*z[8]^2 + z[6]*z[8]*z[9] + z[6]*z[9]^2 + 2*z[6]*z[10]^2 + 2*z[7]^2*z[8] + z[7]^2*z[9] + z[7]^2*z[10] + z[7]*z[8]^2 + z[7]*z[8]*z[10] + 2*z[7]*z[9]^2 + z[7]*z[9]*z[10] + z[7]*z[10]^2 + z[8]^3 + z[8]^2*z[9] + z[8]^2*z[10] + 2*z[8]*z[9]^2 + z[8]*z[9]*z[10] + z[9]^2*z[10], 2*z[1]*z[7]*z[8] + z[1]*z[7]*z[9] + z[1]*z[8]^2 + 2*z[1]*z[8]*z[9] + 2*z[1]*z[9]^2 + z[1]*z[9]*z[10] + z[1]*z[10]^2 + 2*z[2]*z[7]*z[9] + 2*z[2]*z[7]*z[10] + 2*z[2]*z[8]^2 + z[2]*z[8]*z[9] + z[2]*z[8]*z[10] + 2*z[2]*z[9]^2 + 2*z[2]*z[10]^2 + 2*z[3]*z[6]*z[7] + z[3]*z[6]*z[8] + z[3]*z[6]*z[9] + z[3]*z[6]*z[10] + 2*z[3]*z[7]^2 + 2*z[3]*z[7]*z[8] + 2*z[3]*z[7]*z[9] + 2*z[3]*z[7]*z[10] + 2*z[3]*z[8]^2 + 2*z[3]*z[8]*z[9] + 2*z[3]*z[8]*z[10] + 2*z[3]*z[9]^2 + 2*z[3]*z[9]*z[10] + z[4]*z[6]*z[7] + z[4]*z[6]*z[8] + 2*z[4]*z[6]*z[10] + z[4]*z[7]*z[8] + 2*z[4]*z[7]*z[9] + 2*z[4]*z[8]*z[10] + z[4]*z[9]^2 + 2*z[4]*z[9]*z[10] + 2*z[4]*z[10]^2 + 2*z[5]*z[7]^2 + 2*z[5]*z[8]^2 + z[5]*z[8]*z[9] + z[5]*z[8]*z[10] + z[5]*z[9]^2 + z[5]*z[10]^2 + z[6]^3 + z[6]^2*z[10] + z[6]*z[7]*z[8] + 2*z[6]*z[7]*z[10] + 2*z[6]*z[8]^2 + z[6]*z[8]*z[9] + z[6]*z[8]*z[10] + 2*z[6]*z[9]^2 + 2*z[6]*z[9]*z[10] + 2*z[7]^2*z[10] + 2*z[7]*z[8]^2 + z[7]*z[8]*z[9] + z[7]*z[8]*z[10] + 2*z[7]*z[9]^2 + z[7]*z[9]*z[10] + z[7]*z[10]^2 + 2*z[8]^3 + z[8]^2*z[9] + 2*z[8]^2*z[10] + z[8]*z[9]*z[10] + 2*z[8]*z[10]^2 + z[9]^3 + 2*z[9]^2*z[10] + z[9]*z[10]^2 + 2*z[10]^3, z[1]*z[7]*z[8] + z[1]*z[7]*z[9] + z[1]*z[7]*z[10] + 2*z[1]*z[8]^2 + z[1]*z[8]*z[9] + 2*z[1]*z[8]*z[10] + z[2]*z[7]^2 + 2*z[2]*z[7]*z[10] + 2*z[2]*z[8]^2 + 2*z[2]*z[8]*z[9] + 2*z[2]*z[8]*z[10] + 2*z[3]*z[6]*z[8] + z[3]*z[6]*z[10] + 2*z[3]*z[7]*z[8] + z[3]*z[7]*z[9] + 2*z[3]*z[7]*z[10] + 2*z[3]*z[8]*z[9] + 2*z[3]*z[8]*z[10] + 2*z[3]*z[9]^2 + 2*z[3]*z[9]*z[10] + z[3]*z[10]^2 + z[4]*z[6]^2 + 2*z[4]*z[6]*z[10] + 2*z[4]*z[7]^2 + 2*z[4]*z[7]*z[8] + z[4]*z[7]*z[9] + z[4]*z[8]^2 + z[4]*z[8]*z[9] + 2*z[4]*z[8]*z[10] + z[4]*z[9]*z[10] + 2*z[4]*z[10]^2 + z[5]*z[7]^2 + z[5]*z[7]*z[8] + 2*z[5]*z[8]^2 + z[5]*z[8]*z[10] + 2*z[5]*z[9]^2 + 2*z[6]^2*z[8] + 2*z[6]^2*z[9] + z[6]^2*z[10] + 2*z[6]*z[7]^2 + 2*z[6]*z[7]*z[8] + z[6]*z[7]*z[9] + 2*z[6]*z[7]*z[10] + z[6]*z[8]*z[9] + 2*z[6]*z[8]*z[10] + z[6]*z[9]*z[10] + z[7]^3 + 2*z[7]^2*z[8] + z[7]^2*z[9] + 2*z[7]*z[8]*z[9] + 2*z[7]*z[8]*z[10] + z[7]*z[9]^2 + z[7]*z[10]^2 + 2*z[8]^2*z[10] + z[8]*z[9]^2 + 2*z[9]^2*z[10] + z[9]*z[10]^2 + 2*z[10]^3, z[1]*z[7]*z[8] + 2*z[1]*z[7]*z[9] + z[1]*z[8]^2 + z[1]*z[8]*z[10] + 2*z[1]*z[9]^2 + z[1]*z[9]*z[10] + z[1]*z[10]^2 + 2*z[2]*z[7]^2 + 2*z[2]*z[7]*z[8] + 2*z[2]*z[8]^2 + 2*z[2]*z[8]*z[9] + z[2]*z[10]^2 + 2*z[3]^2*z[7] + z[3]^2*z[8] + 2*z[3]^2*z[9] + z[3]*z[6]^2 + 2*z[3]*z[6]*z[8] + z[3]*z[6]*z[9] + 2*z[3]*z[6]*z[10] + z[3]*z[7]^2 + z[3]*z[7]*z[8] + z[3]*z[7]*z[9] + z[3]*z[7]*z[10] + z[3]*z[8]*z[10] + 2*z[3]*z[9]^2 + z[3]*z[9]*z[10] + z[3]*z[10]^2 + 2*z[4]*z[6]*z[8] + 2*z[4]*z[7]^2 + z[4]*z[7]*z[9] + 2*z[4]*z[7]*z[10] + z[4]*z[8]^2 + z[4]*z[8]*z[9] + z[4]*z[8]*z[10] + 2*z[4]*z[9]^2 + 2*z[4]*z[10]^2 + 2*z[5]*z[7]*z[9] + 2*z[5]*z[7]*z[10] + 2*z[5]*z[8]^2 + 2*z[5]*z[8]*z[10] + 2*z[5]*z[9]^2 + z[6]^2*z[7] + 2*z[6]^2*z[9] + z[6]^2*z[10] + 2*z[6]*z[7]^2 + z[6]*z[7]*z[9] + 2*z[6]*z[7]*z[10] + z[6]*z[8]^2 + 2*z[6]*z[8]*z[9] + z[6]*z[8]*z[10] + z[6]*z[9]^2 + 2*z[6]*z[9]*z[10] + z[6]*z[10]^2 + 2*z[7]^3 + 2*z[7]^2*z[9] + 2*z[7]^2*z[10] + z[7]*z[8]*z[10] + 2*z[7]*z[9]^2 + 2*z[7]*z[9]*z[10] + 2*z[7]*z[10]^2 + 2*z[8]^3 + z[8]^2*z[10] + 2*z[8]*z[9]*z[10] + z[9]^3 + 2*z[9]^2*z[10] + 2*z[10]^3, 2*z[1]*z[7]*z[8]*z[9] + z[1]*z[7]*z[8]*z[10] + 2*z[1]*z[7]*z[9]^2 + 2*z[1]*z[7]*z[9]*z[10] + 2*z[1]*z[7]*z[10]^2 + 2*z[1]*z[8]^2*z[10] + 2*z[1]*z[8]*z[9]^2 + z[1]*z[8]*z[10]^2 + 2*z[1]*z[9]^3 + 2*z[1]*z[10]^3 + z[2]*z[7]*z[8]^2 + z[2]*z[7]*z[9]*z[10] + z[2]*z[8]^3 + z[2]*z[8]^2*z[9] + 2*z[2]*z[8]^2*z[10] + 2*z[2]*z[8]*z[9]^2 + 2*z[2]*z[8]*z[10]^2 + 2*z[2]*z[9]^3 + 2*z[2]*z[9]^2*z[10] + z[2]*z[10]^3 + z[3]^2*z[6]*z[9] + 2*z[3]^2*z[6]*z[10] + z[3]^2*z[8]^2 + z[3]^2*z[8]*z[10] + z[3]^2*z[9]^2 + z[3]*z[6]*z[9]*z[10] + 2*z[3]*z[7]*z[8]*z[9] + z[3]*z[7]*z[8]*z[10] + z[3]*z[7]*z[9]^2 + z[3]*z[7]*z[9]*z[10] + 2*z[3]*z[7]*z[10]^2 + z[3]*z[8]^2*z[9] + z[3]*z[8]^2*z[10] + z[3]*z[8]*z[9]^2 + 2*z[3]*z[8]*z[9]*z[10] + z[3]*z[8]*z[10]^2 + 2*z[3]*z[9]^3 + z[3]*z[9]^2*z[10] + z[3]*z[9]*z[10]^2 + z[4]*z[6]*z[9]^2 + z[4]*z[6]*z[9]*z[10] + z[4]*z[6]*z[10]^2 + z[4]*z[7]*z[8]*z[9] + 2*z[4]*z[7]*z[8]*z[10] + z[4]*z[8]^3 + 2*z[4]*z[8]^2*z[10] + z[4]*z[8]*z[9]^2 + z[4]*z[8]*z[10]^2 + 2*z[4]*z[9]*z[10]^2 + 2*z[5]*z[7]*z[8]^2 + 2*z[5]*z[7]*z[8]*z[10] + 2*z[5]*z[7]*z[9]^2 + z[5]*z[7]*z[9]*z[10] + 2*z[5]*z[8]^3 + z[5]*z[8]^2*z[9] + 2*z[5]*z[8]^2*z[10] + z[5]*z[8]*z[9]*z[10] + z[5]*z[9]^3 + 2*z[5]*z[9]^2*z[10] + z[5]*z[9]*z[10]^2 + 2*z[6]^2*z[9]*z[10] + 2*z[6]*z[7]*z[8]^2 + 2*z[6]*z[7]*z[8]*z[9] + z[6]*z[7]*z[8]*z[10] + 2*z[6]*z[7]*z[9]^2 + 2*z[6]*z[7]*z[9]*z[10] + z[6]*z[8]^2*z[9] + 2*z[6]*z[8]^2*z[10] + z[6]*z[8]*z[9]*z[10] + z[6]*z[9]^3 + 2*z[6]*z[9]*z[10]^2 + 2*z[6]*z[10]^3 + 2*z[7]^2*z[8]^2 + z[7]^2*z[8]*z[9] + 2*z[7]^2*z[9]*z[10] + 2*z[7]^2*z[10]^2 + z[7]*z[8]^3 + z[7]*z[8]^2*z[9] + 2*z[7]*z[8]^2*z[10] + z[7]*z[8]*z[10]^2 + 2*z[7]*z[9]^2*z[10] + z[7]*z[9]*z[10]^2 + z[7]*z[10]^3 + z[8]^4 + z[8]^3*z[9] + 2*z[8]^3*z[10] + z[8]^2*z[9]^2 + 2*z[8]^2*z[9]*z[10] + 2*z[8]*z[9]*z[10]^2 + z[9]^3*z[10] + z[9]^2*z[10]^2 + 2*z[10]^4, z[1]*z[7]*z[8]*z[9] + z[1]*z[7]*z[9]^2 + z[1]*z[8]^3 + 2*z[1]*z[8]^2*z[9] + z[1]*z[8]^2*z[10] + z[1]*z[8]*z[9]*z[10] + z[1]*z[8]*z[10]^2 + 2*z[1]*z[9]^3 + 2*z[1]*z[9]^2*z[10] + 2*z[1]*z[10]^3 + z[2]*z[7]*z[8]^2 + 2*z[2]*z[7]*z[8]*z[9] + z[2]*z[8]^3 + z[2]*z[8]^2*z[10] + z[2]*z[8]*z[9]^2 + z[2]*z[9]^2*z[10] + 2*z[2]*z[10]^3 + 2*z[3]*z[6]*z[9]*z[10] + z[3]*z[6]*z[10]^2 + 2*z[3]*z[7]*z[8]^2 + z[3]*z[7]*z[8]*z[10] + 2*z[3]*z[7]*z[9]^2 + 2*z[3]*z[7]*z[10]^2 + 2*z[3]*z[8]^3 + z[3]*z[8]^2*z[10] + 2*z[3]*z[8]*z[9]^2 + z[3]*z[8]*z[9]*z[10] + z[3]*z[8]*z[10]^2 + z[3]*z[9]^3 + z[3]*z[9]^2*z[10] + 2*z[3]*z[9]*z[10]^2 + z[3]*z[10]^3 + z[4]*z[7]*z[8]*z[9] + z[4]*z[7]*z[8]*z[10] + 2*z[4]*z[7]*z[9]*z[10] + z[4]*z[8]^3 + z[4]*z[8]*z[9]*z[10] + 2*z[4]*z[8]*z[10]^2 + z[4]*z[9]^3 + 2*z[4]*z[9]^2*z[10] + 2*z[4]*z[9]*z[10]^2 + z[4]*z[10]^3 + z[5]*z[7]*z[8]^2 + z[5]*z[7]*z[8]*z[9] + 2*z[5]*z[7]*z[9]*z[10] + 2*z[5]*z[7]*z[10]^2 + 2*z[5]*z[8]^2*z[9] + 2*z[5]*z[8]^2*z[10] + 2*z[5]*z[8]*z[9]^2 + z[5]*z[8]*z[10]^2 + z[5]*z[9]^3 + z[5]*z[9]*z[10]^2 + 2*z[6]^2*z[9]^2 + 2*z[6]^2*z[9]*z[10] + 2*z[6]*z[7]*z[8]^2 + z[6]*z[7]*z[8]*z[10] + z[6]*z[7]*z[9]^2 + 2*z[6]*z[7]*z[9]*z[10] + z[6]*z[7]*z[10]^2 + z[6]*z[8]^2*z[10] + 2*z[6]*z[8]*z[9]^2 + 2*z[6]*z[9]^3 + z[6]*z[9]^2*z[10] + z[6]*z[9]*z[10]^2 + 2*z[6]*z[10]^3 + z[7]^3*z[8] + z[7]^3*z[9] + 2*z[7]^3*z[10] + z[7]^2*z[8]^2 + 2*z[7]^2*z[8]*z[9] + 2*z[7]^2*z[9]*z[10] + z[7]^2*z[10]^2 + 2*z[7]*z[8]^3 + 2*z[7]*z[8]^2*z[9] + z[7]*z[8]*z[9]*z[10] + 2*z[7]*z[8]*z[10]^2 + 2*z[7]*z[9]^3 + z[7]*z[9]^2*z[10] + 2*z[7]*z[9]*z[10]^2 + 2*z[7]*z[10]^3 + 2*z[8]^4 + 2*z[8]^3*z[10] + z[8]^2*z[9]*z[10] + z[8]*z[9]^2*z[10] + 2*z[8]*z[9]*z[10]^2 + z[8]*z[10]^3 + 2*z[9]^3*z[10]]; + + I = ideal(S, V); + X = variety(I, check = false, is_radical = false); + + function canonical_bundle(X::AbsProjectiveVariety) + SX = homogeneous_coordinate_ring(X) + n = ngens(SX)-1 + c = codim(X) + res, _ = free_resolution(Oscar.SimpleFreeResolution, SX) + C_simp = simplify(res); + C_shift = shift(C_simp, c); + S = base_ring(SX) + OmegaPn = graded_free_module(S, [n+1]) + D = hom(C_shift, OmegaPn); + D_simp = simplify(D); + return homology(D_simp, 0)[1] + end + + @test !is_zero(canonical_bundle(X)) +end + From 4842b690babf5f4cc752432cf176776ce5a151d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lars=20G=C3=B6ttgens?= Date: Mon, 6 May 2024 16:08:31 +0200 Subject: [PATCH 3/7] Remove dep `DocStringExtensions` (#3691) --- Project.toml | 2 -- 1 file changed, 2 deletions(-) diff --git a/Project.toml b/Project.toml index 20c87bfdafc..94bfdafef68 100644 --- a/Project.toml +++ b/Project.toml @@ -7,7 +7,6 @@ version = "1.1.0-DEV" AbstractAlgebra = "c3fe647b-3220-5bb0-a1ea-a7954cac585d" AlgebraicSolving = "66b61cbe-0446-4d5d-9090-1ff510639f9d" Distributed = "8ba89e20-285c-5b6f-9357-94700520ee1b" -DocStringExtensions = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae" GAP = "c863536a-3901-11e9-33e7-d5cd0df7b904" Hecke = "3e1990a7-5d81-5526-99ce-9ba3ff248f21" JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6" @@ -28,7 +27,6 @@ cohomCalg_jll = "5558cf25-a90e-53b0-b813-cadaa3ae7ade" AbstractAlgebra = "0.41.3" AlgebraicSolving = "0.4.15" Distributed = "1.6" -DocStringExtensions = "0.8, 0.9" GAP = "0.10.2" Hecke = "0.31.5" JSON = "^0.20, ^0.21" From 498afce41f47983400d242098f1f0d96edf50909 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mi=C4=B7elis=20Em=C4=ABls=20Mi=C4=B7elsons?= <164499508+emikelsons@users.noreply.github.com> Date: Mon, 6 May 2024 19:07:38 +0200 Subject: [PATCH 4/7] Reparametrized literature models (#3693) [FTheoryTools] Reparametrized literature models from F-theory on all toric hypersurfaces --- .../Models/model1408_4808-1.json | 2 +- .../Models/model1408_4808-10-WSF.json | 10 +++++----- .../Models/model1408_4808-10.json | 16 +++++++-------- .../Models/model1408_4808-11-WSF.json | 10 +++++----- .../Models/model1408_4808-11.json | 16 +++++++-------- .../Models/model1408_4808-13-WSF.json | 10 +++++----- .../Models/model1408_4808-13.json | 16 +++++++-------- .../Models/model1408_4808-6-WSF.json | 10 +++++----- .../Models/model1408_4808-6.json | 14 ++++++------- .../Models/model1408_4808-8-WSF.json | 10 +++++----- .../Models/model1408_4808-8.json | 16 +++++++-------- .../FTheoryTools/test/literature_models.jl | 20 +++++++++---------- 12 files changed, 75 insertions(+), 75 deletions(-) diff --git a/experimental/FTheoryTools/src/LiteratureModels/Models/model1408_4808-1.json b/experimental/FTheoryTools/src/LiteratureModels/Models/model1408_4808-1.json index 01e9c6ad02d..709247509d6 100644 --- a/experimental/FTheoryTools/src/LiteratureModels/Models/model1408_4808-1.json +++ b/experimental/FTheoryTools/src/LiteratureModels/Models/model1408_4808-1.json @@ -49,7 +49,7 @@ "divisors_user_must_specify": ["s7", "s9"], "divisors_parametrized_by_user_specified_divisors": ["s1", "s2", "s3", "s4", "s5", "s6", "s8", "s10"], "parametrization_of_parametrized_divisors_by_Kbar_and_user_specified_divisors": [ - [3, 2, 1, 0, 2, 1, 1, 0], + [3, 2, 1, 0, 2, 1, 1, 0], [-1, 0, 1, 2, -1, 0, -1, -1], [-1, -1, -1, -1, 0, 0, 1, 2] ], diff --git a/experimental/FTheoryTools/src/LiteratureModels/Models/model1408_4808-10-WSF.json b/experimental/FTheoryTools/src/LiteratureModels/Models/model1408_4808-10-WSF.json index ba731b332aa..ca651b1c275 100644 --- a/experimental/FTheoryTools/src/LiteratureModels/Models/model1408_4808-10-WSF.json +++ b/experimental/FTheoryTools/src/LiteratureModels/Models/model1408_4808-10-WSF.json @@ -45,14 +45,14 @@ }, "model_data": { "base_dim": 3, - "divisors_user_must_specify": ["s5", "s2"], - "divisors_parametrized_by_user_specified_divisors": ["s1", "s3", "s4", "s6", "s8"], + "divisors_user_must_specify": ["s7", "s9"], + "divisors_parametrized_by_user_specified_divisors": ["s1", "s2", "s3", "s4", "s5", "s6", "s8"], "f": "1//48*(48*s2*s4*s8^2 - ( - s6^2 + 4*s3*s8)^2 - 24*s4*s5*s6*s8)", "g": "1//864*((2*s2*s4*s8^2 - s4*s5*s6*s8)*( - 36*s6^2 + 144*s3*s8) - ( - s6^2 + 4*s3*s8)^3 - 864*s1*s4^2*s8^3 + 216*s4^2*s5^2*s8^2)", "parametrization_of_parametrized_divisors_by_Kbar_and_user_specified_divisors": [ - [-1, 1, 2, 1, 1], - [1, -1, -2, 0, 1], - [1, 1, 1, 0, -1] + [ 3, 2, 1, 0, 2, 1, 1], + [-1, 0, 1, 2, -1, 0, -1], + [-1, -1, -1, -1, 0, 0, 1] ], "zero_section": ["0", "0", "1"] }, diff --git a/experimental/FTheoryTools/src/LiteratureModels/Models/model1408_4808-10.json b/experimental/FTheoryTools/src/LiteratureModels/Models/model1408_4808-10.json index 2cab894d742..9aa83005680 100644 --- a/experimental/FTheoryTools/src/LiteratureModels/Models/model1408_4808-10.json +++ b/experimental/FTheoryTools/src/LiteratureModels/Models/model1408_4808-10.json @@ -45,21 +45,21 @@ }, "model_data": { "base_dim": 3, - "divisors_user_must_specify": ["s5", "s2"], - "divisors_parametrized_by_user_specified_divisors": ["s1", "s3", "s4", "s6", "s8"], + "divisors_user_must_specify": ["s7", "s9"], + "divisors_parametrized_by_user_specified_divisors": ["s1", "s2", "s3", "s4", "s5", "s6", "s8"], "parametrization_of_parametrized_divisors_by_Kbar_and_user_specified_divisors": [ - [-1, 1, 2, 1, 1], - [1, -1, -2, 0, 1], - [1, 1, 1, 0, -1] + [ 3, 2, 1, 0, 2, 1, 1], + [-1, 0, 1, 2, -1, 0, -1], + [-1, -1, -1, -1, 0, 0, 1] ], "fiber_ambient_space_rays": [[-1, -1], [0, 1], [1, 0], [-1, 0], [-2, -1], [-3, -2]], "fiber_ambient_space_max_cones": [[1, 6], [5, 6], [4, 5], [2, 4], [2, 3], [1, 3]], "fiber_ambient_space_coordinates": ["u", "v", "w", "e1", "e2", "e3"], "fiber_ambient_space_name": "P^{F_10}", "fiber_twist_matrix": [ - [1, 0, 0, 0, 0, 0], - [0, 1, 0, 0, 0, 0], - [-1, -1, 0, 0, 0, 0] + [1, 0, 0, 0, 0, 0], + [0, -1, 0, 0, 0, 0], + [-1, 1, 0, 0, 0, 0] ], "hypersurface_equation": "s1*e1^2*e2^4*e3^6*u^3 + s2*e1^2*e2^3*e3^4*u^2*v + s3*e1^2*e2^2*e3^2*u*v^2 + s4*e1^2*e2*v^3 + s5*e1*e2^2*e3^3*u^2*w + s6*e1*e2*e3*u*v*w + s8*u*w^2", "zero_section": ["s4", "1", "1", "1", "-s8", "0"] diff --git a/experimental/FTheoryTools/src/LiteratureModels/Models/model1408_4808-11-WSF.json b/experimental/FTheoryTools/src/LiteratureModels/Models/model1408_4808-11-WSF.json index bbc4fa07571..324fd7e6a09 100644 --- a/experimental/FTheoryTools/src/LiteratureModels/Models/model1408_4808-11-WSF.json +++ b/experimental/FTheoryTools/src/LiteratureModels/Models/model1408_4808-11-WSF.json @@ -46,14 +46,14 @@ }, "model_data": { "base_dim": 3, - "divisors_user_must_specify": ["s5", "s9"], - "divisors_parametrized_by_user_specified_divisors": ["s1", "s2", "s3", "s6"], + "divisors_user_must_specify": ["s7", "s9"], + "divisors_parametrized_by_user_specified_divisors": ["s1", "s2", "s3", "s5", "s6"], "f": "1//48*(48*s1*s3*s9^2 - ( - s6^2 + 4*s2*s9)^2 - 24*s3*s5*s6*s9)", "g": "1//864*((2*s1*s3*s9^2 - s3*s5*s6*s9)*( - 36*s6^2 + 144*s2*s9) - ( - s6^2 + 4*s2*s9)^3 + 216*s3^2*s5^2*s9^2)", "parametrization_of_parametrized_divisors_by_Kbar_and_user_specified_divisors": [ - [1, 2, 3, 1], - [1, 0, -1, 0], - [-1, -1, -1, 0] + [ 3, 2, 1, 2, 1], + [-1, 0, 1, -1, 0], + [-1, -1, -1, 0, 0] ], "zero_section": ["0", "0", "1"], "generating_sections": [ diff --git a/experimental/FTheoryTools/src/LiteratureModels/Models/model1408_4808-11.json b/experimental/FTheoryTools/src/LiteratureModels/Models/model1408_4808-11.json index 981854fb843..d318dfb7d80 100644 --- a/experimental/FTheoryTools/src/LiteratureModels/Models/model1408_4808-11.json +++ b/experimental/FTheoryTools/src/LiteratureModels/Models/model1408_4808-11.json @@ -46,21 +46,21 @@ }, "model_data": { "base_dim": 3, - "divisors_user_must_specify": ["s5", "s9"], - "divisors_parametrized_by_user_specified_divisors": ["s1", "s2", "s3", "s6"], + "divisors_user_must_specify": ["s7", "s9"], + "divisors_parametrized_by_user_specified_divisors": ["s1", "s2", "s3", "s5", "s6"], "parametrization_of_parametrized_divisors_by_Kbar_and_user_specified_divisors": [ - [1, 2, 3, 1], - [1, 0, -1, 0], - [-1, -1, -1, 0] + [ 3, 2, 1, 2, 1], + [-1, 0, 1, -1, 0], + [-1, -1, -1, 0, 0] ], "fiber_ambient_space_rays": [[-1, 1], [0, -1], [1, 0], [0, 1], [-1, 0], [-1, -1], [-1, 2]], "fiber_ambient_space_max_cones": [[1, 7], [4, 7], [3, 4], [2, 3], [2, 6], [5, 6], [1, 5]], "fiber_ambient_space_coordinates": ["u", "v", "w", "e1", "e2", "e3", "e4"], "fiber_ambient_space_name": "P^{F_11}", "fiber_twist_matrix": [ - [-1, -2, 0, 0, 0, 0, 0], - [0, 1, 0, 0, 0, 0, 0], - [1, 1, 0, 0, 0, 0, 0] + [-1, 0, 0, 0, 0, 0, 0], + [ 0, -1, 0, 0, 0, 0, 0], + [ 1, 1, 0, 0, 0, 0, 0] ], "hypersurface_equation": "s1*e1^2*e2^2*e3*e4^4*u^3 + s2*e1*e2^2*e3^2*e4^2*u^2*v + s3*e2^2*e3^2*u*v^2 + s5*e1^2*e2*e4^3*u^2*w + s6*e1*e2*e3*e4*u*v*w + s9*e1*v*w^2", "zero_section": ["1", "0", "s5", "1", "1", "-s5", "1"], diff --git a/experimental/FTheoryTools/src/LiteratureModels/Models/model1408_4808-13-WSF.json b/experimental/FTheoryTools/src/LiteratureModels/Models/model1408_4808-13-WSF.json index ca12f2fc9b9..64baf4531ef 100644 --- a/experimental/FTheoryTools/src/LiteratureModels/Models/model1408_4808-13-WSF.json +++ b/experimental/FTheoryTools/src/LiteratureModels/Models/model1408_4808-13-WSF.json @@ -46,14 +46,14 @@ }, "model_data": { "base_dim": 3, - "divisors_user_must_specify": ["s1", "s9"], - "divisors_parametrized_by_user_specified_divisors": ["s2", "s3", "s6"], + "divisors_user_must_specify": ["s7", "s9"], + "divisors_parametrized_by_user_specified_divisors": ["s1", "s2", "s3", "s6"], "f": "1//48*( - 16*s2^2*s9^2 + 8*s2*s6^2*s9 - s6^4 + 48*s1*s3*s9^2)", "g": "1//864*( - 64*s2^3*s9^3 + 48*s2^2*s6^2*s9^2 - 12*s2*s6^4*s9 + 288*s1*s3*s2*s9^3 + s6^6 - 72*s1*s3*s6^2*s9^2)", "parametrization_of_parametrized_divisors_by_Kbar_and_user_specified_divisors": [ - [2, 4, 1], - [0, -1, 0], - [-1, -2, 0] + [ 3, 2, 1, 1], + [-1, 0, 1, 0], + [-1, -1, -1, 0] ], "zero_section": ["0", "0", "1"], "torsion_sections": [ diff --git a/experimental/FTheoryTools/src/LiteratureModels/Models/model1408_4808-13.json b/experimental/FTheoryTools/src/LiteratureModels/Models/model1408_4808-13.json index d17bdeacc6f..31f2edac945 100644 --- a/experimental/FTheoryTools/src/LiteratureModels/Models/model1408_4808-13.json +++ b/experimental/FTheoryTools/src/LiteratureModels/Models/model1408_4808-13.json @@ -46,21 +46,21 @@ }, "model_data": { "base_dim": 3, - "divisors_user_must_specify": ["s1", "s9"], - "divisors_parametrized_by_user_specified_divisors": ["s2", "s3", "s6"], + "divisors_user_must_specify": ["s7", "s9"], + "divisors_parametrized_by_user_specified_divisors": ["s1", "s2", "s3", "s6"], "parametrization_of_parametrized_divisors_by_Kbar_and_user_specified_divisors": [ - [2, 4, 1], - [0, -1, 0], - [-1, -2, 0] + [ 3, 2, 1, 1], + [-1, 0, 1, 0], + [-1, -1, -1, 0] ], "fiber_ambient_space_rays": [[-1, 1], [0, -1], [1, 0], [0, 1], [-1, 0], [-1, -1], [-1, -2], [-1, 2]], "fiber_ambient_space_max_cones": [[1, 8], [4, 8], [3, 4], [2, 3], [2, 7], [6, 7], [5, 6], [1, 5]], "fiber_ambient_space_coordinates": ["u", "v", "w", "e1", "e2", "e3", "e4", "e5"], "fiber_ambient_space_name": "P^{F_13}", "fiber_twist_matrix": [ - [-1, -3, 0, 0, 0, 0, 0, 0], - [0, 1, 0, 0, 0, 0, 0, 0], - [1, 2, 0, 0, 0, 0, 0, 0] + [-1, 0, 0, 0, 0, 0, 0, 0], + [0, -1, 0, 0, 0, 0, 0, 0], + [1, 1, 0, 0, 0, 0, 0, 0] ], "hypersurface_equation": "s1*e1^2*e2^2*e3*e5^4*u^3 + s2*e1*e2^2*e3^2*e4^2*e5^2*u^2*v + s3*e2^2*e3^3*e4^4*u*v^2 + s6*e1*e2*e3*e4*e5*u*v*w + s9*e1*v*w^2", "zero_section": ["1", "s1", "1", "1", "1", "-s9", "0", "1"], diff --git a/experimental/FTheoryTools/src/LiteratureModels/Models/model1408_4808-6-WSF.json b/experimental/FTheoryTools/src/LiteratureModels/Models/model1408_4808-6-WSF.json index b3f122a0db2..0ca66e1d1df 100644 --- a/experimental/FTheoryTools/src/LiteratureModels/Models/model1408_4808-6-WSF.json +++ b/experimental/FTheoryTools/src/LiteratureModels/Models/model1408_4808-6-WSF.json @@ -46,14 +46,14 @@ }, "model_data": { "base_dim": 3, - "divisors_user_must_specify": ["s7", "s4"], - "divisors_parametrized_by_user_specified_divisors": ["s1", "s2", "s3", "s5", "s6", "s8"], + "divisors_user_must_specify": ["s7", "s9"], + "divisors_parametrized_by_user_specified_divisors": ["s1", "s2", "s3", "s4", "s5", "s6", "s8"], "f": "1//48*(48*s2*s4*s8^2 - 24*s6*(s2*s7*s8 + s4*s5*s8) - ( - s6^2 + 4*s3*s8 + 4*s5*s7)^2 + 48*s1*s7^2*s8 + 48*s3*s5*s7*s8)", "g": "1//864*(216*(s2*s7*s8 + s4*s5*s8)^2 - ( - s6^2 + 4*s3*s8 + 4*s5*s7)^3 + ( - 36*s6^2 + 144*s3*s8 + 144*s5*s7)*(2*s2*s4*s8^2 - s6*(s2*s7*s8 + s4*s5*s8) + 2*s1*s7^2*s8 + 2*s3*s5*s7*s8) - 864*s1*s4^2*s8^3 + 864*s4*s7*s8*(s1*s6*s8 - s2*s5*s8) - 864*s1*s3*s7^2*s8^2)", "parametrization_of_parametrized_divisors_by_Kbar_and_user_specified_divisors": [ - [3, 2, 1, 2, 1, 1], - [-3, -2, -1, -1, 0, 1], - [1, 1, 1, 0, 0, -1] + [ 3, 2, 1, 0, 2, 1, 1], + [-1, 0, 1, 2, -1, 0, -1], + [-1, -1, -1, -1, 0, 0, 1] ], "zero_section": ["0", "0", "1"], "generating_sections": [ diff --git a/experimental/FTheoryTools/src/LiteratureModels/Models/model1408_4808-6.json b/experimental/FTheoryTools/src/LiteratureModels/Models/model1408_4808-6.json index 7494cac07b8..9923d6d27a2 100644 --- a/experimental/FTheoryTools/src/LiteratureModels/Models/model1408_4808-6.json +++ b/experimental/FTheoryTools/src/LiteratureModels/Models/model1408_4808-6.json @@ -46,12 +46,12 @@ }, "model_data": { "base_dim": 3, - "divisors_user_must_specify": ["s7", "s4"], - "divisors_parametrized_by_user_specified_divisors": ["s1", "s2", "s3", "s5", "s6", "s8"], + "divisors_user_must_specify": ["s7", "s9"], + "divisors_parametrized_by_user_specified_divisors": ["s1", "s2", "s3", "s4", "s5", "s6", "s8"], "parametrization_of_parametrized_divisors_by_Kbar_and_user_specified_divisors": [ - [3, 2, 1, 2, 1, 1], - [-3, -2, -1, -1, 0, 1], - [1, 1, 1, 0, 0, -1] + [ 3, 2, 1, 0, 2, 1, 1], + [-1, 0, 1, 2, -1, 0, -1], + [-1, -1, -1, -1, 0, 0, 1] ], "fiber_ambient_space_rays": [[0, 1], [-1, -1], [1, 0], [-1, 0], [-1, 1]], "fiber_ambient_space_max_cones": [[1, 3], [2, 3], [2, 4], [4, 5], [1, 5]], @@ -59,8 +59,8 @@ "fiber_ambient_space_name": "P^{F_6}", "fiber_twist_matrix": [ [-1, 0, 0, 0, 0], - [2, 1, 0, 0, 0], - [-1, -1, 0, 0, 0] + [0, -1, 0, 0, 0], + [1, 1, 0, 0, 0] ], "hypersurface_equation": "s1*e1^2*e2^4*u^3 + s2*e1^2*e2^3*u^2*v + s3*e1^2*e2^2*u*v^2 + s4*e1^2*e2*v^3 + s5*e1*e2^2*u^2*w + s6*e1*e2*u*v*w + s7*e1*v^2*w + s8*u*w^2", "zero_section": ["-s7", "1", "s8", "1", "0"], diff --git a/experimental/FTheoryTools/src/LiteratureModels/Models/model1408_4808-8-WSF.json b/experimental/FTheoryTools/src/LiteratureModels/Models/model1408_4808-8-WSF.json index 7759c6cbadd..ad1d0b054db 100644 --- a/experimental/FTheoryTools/src/LiteratureModels/Models/model1408_4808-8-WSF.json +++ b/experimental/FTheoryTools/src/LiteratureModels/Models/model1408_4808-8-WSF.json @@ -46,14 +46,14 @@ }, "model_data": { "base_dim": 3, - "divisors_user_must_specify": ["s7", "s2"], - "divisors_parametrized_by_user_specified_divisors": ["s1", "s3", "s5", "s6", "s8"], + "divisors_user_must_specify": ["s7", "s9"], + "divisors_parametrized_by_user_specified_divisors": ["s1", "s2", "s3", "s5", "s6", "s8"], "f": "1//48*(48*s1*s7^2*s8 - ( - s6^2 + 4*s3*s8 + 4*s5*s7)^2 - 24*s2*s6*s7*s8 + 48*s3*s5*s7*s8)", "g": "1//864*(( - 36*s6^2 + 144*s3*s8 + 144*s5*s7)*(2*s1*s7^2*s8 - s2*s6*s7*s8 + 2*s3*s5*s7*s8) - ( - s6^2 + 4*s3*s8 + 4*s5*s7)^3 + 216*s2^2*s7^2*s8^2 - 864*s1*s3*s7^2*s8^2)", "parametrization_of_parametrized_divisors_by_Kbar_and_user_specified_divisors": [ - [1, -1, 2, 1, 3], - [-1, 1, -1, 0, -1], - [1, 1, 0, 0, -1] + [ 3, 2, 1, 2, 1, 1], + [-1, 0, 1, -1, 0, -1], + [-1, -1, -1, 0, 0, 1] ], "zero_section": ["0", "0", "1"], "generating_sections": [ diff --git a/experimental/FTheoryTools/src/LiteratureModels/Models/model1408_4808-8.json b/experimental/FTheoryTools/src/LiteratureModels/Models/model1408_4808-8.json index ee27479788b..ac648a2a5f0 100644 --- a/experimental/FTheoryTools/src/LiteratureModels/Models/model1408_4808-8.json +++ b/experimental/FTheoryTools/src/LiteratureModels/Models/model1408_4808-8.json @@ -46,21 +46,21 @@ }, "model_data": { "base_dim": 3, - "divisors_user_must_specify": ["s7", "s2"], - "divisors_parametrized_by_user_specified_divisors": ["s1", "s3", "s5", "s6", "s8"], + "divisors_user_must_specify": ["s7", "s9"], + "divisors_parametrized_by_user_specified_divisors": ["s1", "s2", "s3", "s5", "s6", "s8"], "parametrization_of_parametrized_divisors_by_Kbar_and_user_specified_divisors": [ - [1, -1, 2, 1, 3], - [-1, 1, -1, 0, -1], - [1, 1, 0, 0, -1] + [ 3, 2, 1, 2, 1, 1], + [-1, 0, 1, -1, 0, -1], + [-1, -1, -1, 0, 0, 1] ], "fiber_ambient_space_rays": [[0, 1], [-1, -1], [1, 0], [-1, 0], [-1, 1], [1, 1]], "fiber_ambient_space_max_cones": [[1, 6], [3, 6], [2, 3], [2, 4], [4, 5], [1, 5]], "fiber_ambient_space_coordinates": ["u", "v", "w", "e1", "e2", "e3"], "fiber_ambient_space_name": "P^{F_8}", "fiber_twist_matrix": [ - [1, 2, 0, 0, 0, 0], - [0, -1, 0, 0, 0, 0], - [-1, -1, 0, 0, 0, 0] + [ 1, 0, 0, 0, 0, 0], + [ 0, -1, 0, 0, 0, 0], + [-1, 1, 0, 0, 0, 0] ], "hypersurface_equation": "s1*e1^2*e2^4*e3^2*u^3 + s2*e1^2*e2^3*e3*u^2*v + s3*e1^2*e2^2*u*v^2 + s5*e1*e2^2*e3^2*u^2*w + s6*e1*e2*e3*u*v*w + s7*e1*v^2*w + s8*e3^2*u*w^2", "zero_section": ["s7", "1", "1", "-s8", "0", "1"], diff --git a/experimental/FTheoryTools/test/literature_models.jl b/experimental/FTheoryTools/test/literature_models.jl index d11d31cbe34..9869f61f230 100644 --- a/experimental/FTheoryTools/test/literature_models.jl +++ b/experimental/FTheoryTools/test/literature_models.jl @@ -471,14 +471,14 @@ foah2_B3 = literature_model(arxiv_id = "1408.4808v2", equation = "3.12", type = foah3_B3 = literature_model(arxiv_id = "1408.4808v2", equation = "3.54", type = "hypersurface", base_space = B3, model_sections = Dict("s7" => Kbar, "s9" => Kbar), completeness_check = false) foah4_B3 = literature_model(arxiv_id = "1408.4808v2", equation = "3.17", type = "hypersurface", base_space = B3, model_sections = Dict("s7" => Kbar, "s9" => Kbar), completeness_check = false) foah5_B3 = literature_model(arxiv_id = "1408.4808v2", equation = "3.73", type = "hypersurface", base_space = B3, model_sections = Dict("s7" => Kbar, "s9" => Kbar), completeness_check = false) -foah6_B3 = literature_model(arxiv_id = "1408.4808v2", equation = "3.82", type = "hypersurface", base_space = B3, model_sections = Dict("s7" => Kbar, "s4" => Kbar), completeness_check = false) +foah6_B3 = literature_model(arxiv_id = "1408.4808v2", equation = "3.82", type = "hypersurface", base_space = B3, model_sections = Dict("s7" => Kbar, "s9" => Kbar), completeness_check = false) foah7_B3 = literature_model(arxiv_id = "1408.4808v2", equation = "3.96", type = "hypersurface", base_space = B3, model_sections = Dict("s7" => Kbar, "s9" => Kbar), completeness_check = false) -foah8_B3 = literature_model(arxiv_id = "1408.4808v2", equation = "3.106", type = "hypersurface", base_space = B3, model_sections = Dict("s7" => Kbar, "s2" => Kbar), completeness_check = false) +foah8_B3 = literature_model(arxiv_id = "1408.4808v2", equation = "3.106", type = "hypersurface", base_space = B3, model_sections = Dict("s7" => Kbar, "s9" => Kbar), completeness_check = false) foah9_B3 = literature_model(arxiv_id = "1408.4808v2", equation = "3.118", type = "hypersurface", base_space = B3, model_sections = Dict("s7" => Kbar, "s9" => Kbar), completeness_check = false) -foah10_B3 = literature_model(arxiv_id = "1408.4808v2", equation = "3.130", type = "hypersurface", base_space = B3, model_sections = Dict("s5" => Kbar, "s2" => Kbar), completeness_check = false) -foah11_B3 = literature_model(arxiv_id = "1408.4808v2", equation = "3.142", type = "hypersurface", base_space = B3, model_sections = Dict("s5" => Kbar, "s9" => Kbar), completeness_check = false) +foah10_B3 = literature_model(arxiv_id = "1408.4808v2", equation = "3.130", type = "hypersurface", base_space = B3, model_sections = Dict("s7" => Kbar, "s9" => Kbar), completeness_check = false) +foah11_B3 = literature_model(arxiv_id = "1408.4808v2", equation = "3.142", type = "hypersurface", base_space = B3, model_sections = Dict("s7" => Kbar, "s9" => Kbar), completeness_check = false) foah12_B3 = literature_model(arxiv_id = "1408.4808v2", equation = "3.155", type = "hypersurface", base_space = B3, model_sections = Dict("s7" => Kbar, "s9" => Kbar), completeness_check = false) -foah13_B3 = literature_model(arxiv_id = "1408.4808v2", equation = "3.181", type = "hypersurface", base_space = B3, model_sections = Dict("s1" => Kbar, "s9" => Kbar), completeness_check = false) +foah13_B3 = literature_model(arxiv_id = "1408.4808v2", equation = "3.181", type = "hypersurface", base_space = B3, model_sections = Dict("s7" => Kbar, "s9" => Kbar), completeness_check = false) foah14_B3 = literature_model(arxiv_id = "1408.4808v2", equation = "3.168", type = "hypersurface", base_space = B3, model_sections = Dict("s7" => Kbar, "s9" => Kbar), completeness_check = false) foah15_B3 = literature_model(arxiv_id = "1408.4808v2", equation = "3.190", type = "hypersurface", base_space = B3, model_sections = Dict("s7" => Kbar, "s9" => Kbar), completeness_check = false) foah16_B3 = literature_model(arxiv_id = "1408.4808v2", equation = "3.203", type = "hypersurface", base_space = B3, model_sections = Dict("s7" => Kbar, "s9" => Kbar), completeness_check = false) @@ -670,14 +670,14 @@ foah2_B3_weier = literature_model(arxiv_id = "1408.4808v2", equation = "3.12", t foah3_B3_weier = literature_model(arxiv_id = "1408.4808v2", equation = "3.54", type = "weierstrass", base_space = B3, model_sections = Dict("s7" => Kbar, "s9" => Kbar), completeness_check = false) foah4_B3_weier = literature_model(arxiv_id = "1408.4808v2", equation = "3.17", type = "weierstrass", base_space = B3, model_sections = Dict("s7" => Kbar, "s9" => Kbar), completeness_check = false) foah5_B3_weier = literature_model(arxiv_id = "1408.4808v2", equation = "3.73", type = "weierstrass", base_space = B3, model_sections = Dict("s7" => Kbar, "s9" => Kbar), completeness_check = false) -foah6_B3_weier = literature_model(arxiv_id = "1408.4808v2", equation = "3.82", type = "weierstrass", base_space = B3, model_sections = Dict("s7" => Kbar, "s4" => Kbar), completeness_check = false) +foah6_B3_weier = literature_model(arxiv_id = "1408.4808v2", equation = "3.82", type = "weierstrass", base_space = B3, model_sections = Dict("s7" => Kbar, "s9" => Kbar), completeness_check = false) foah7_B3_weier = literature_model(arxiv_id = "1408.4808v2", equation = "3.96", type = "weierstrass", base_space = B3, model_sections = Dict("s7" => Kbar, "s9" => Kbar), completeness_check = false) -foah8_B3_weier = literature_model(arxiv_id = "1408.4808v2", equation = "3.106", type = "weierstrass", base_space = B3, model_sections = Dict("s7" => Kbar, "s2" => Kbar), completeness_check = false) +foah8_B3_weier = literature_model(arxiv_id = "1408.4808v2", equation = "3.106", type = "weierstrass", base_space = B3, model_sections = Dict("s7" => Kbar, "s9" => Kbar), completeness_check = false) foah9_B3_weier = literature_model(arxiv_id = "1408.4808v2", equation = "3.118", type = "weierstrass", base_space = B3, model_sections = Dict("s7" => Kbar, "s9" => Kbar), completeness_check = false) -foah10_B3_weier = literature_model(arxiv_id = "1408.4808v2", equation = "3.130", type = "weierstrass", base_space = B3, model_sections = Dict("s5" => Kbar, "s2" => Kbar), completeness_check = false) -foah11_B3_weier = literature_model(arxiv_id = "1408.4808v2", equation = "3.142", type = "weierstrass", base_space = B3, model_sections = Dict("s5" => Kbar, "s9" => Kbar), completeness_check = false) +foah10_B3_weier = literature_model(arxiv_id = "1408.4808v2", equation = "3.130", type = "weierstrass", base_space = B3, model_sections = Dict("s7" => Kbar, "s9" => Kbar), completeness_check = false) +foah11_B3_weier = literature_model(arxiv_id = "1408.4808v2", equation = "3.142", type = "weierstrass", base_space = B3, model_sections = Dict("s7" => Kbar, "s9" => Kbar), completeness_check = false) foah12_B3_weier = literature_model(arxiv_id = "1408.4808v2", equation = "3.155", type = "weierstrass", base_space = B3, model_sections = Dict("s7" => Kbar, "s9" => Kbar), completeness_check = false) -foah13_B3_weier = literature_model(arxiv_id = "1408.4808v2", equation = "3.181", type = "weierstrass", base_space = B3, model_sections = Dict("s1" => Kbar, "s9" => Kbar), completeness_check = false) +foah13_B3_weier = literature_model(arxiv_id = "1408.4808v2", equation = "3.181", type = "weierstrass", base_space = B3, model_sections = Dict("s7" => Kbar, "s9" => Kbar), completeness_check = false) foah14_B3_weier = literature_model(arxiv_id = "1408.4808v2", equation = "3.168", type = "weierstrass", base_space = B3, model_sections = Dict("s7" => Kbar, "s9" => Kbar), completeness_check = false) foah15_B3_weier = literature_model(arxiv_id = "1408.4808v2", equation = "3.190", type = "weierstrass", base_space = B3, model_sections = Dict("s7" => Kbar, "s9" => Kbar), completeness_check = false) foah16_B3_weier = literature_model(arxiv_id = "1408.4808v2", equation = "3.203", type = "weierstrass", base_space = B3, model_sections = Dict("s7" => Kbar, "s9" => Kbar), completeness_check = false) From 7d7bb9b4fb84de2caa775831d50d8f65f0246dcd Mon Sep 17 00:00:00 2001 From: Max Horn Date: Tue, 7 May 2024 10:08:41 +0200 Subject: [PATCH 5/7] Use new is_terse and terse functions (#3690) --- .../printing_details.md | 44 +++++++++---------- docs/src/DeveloperDocumentation/styleguide.md | 12 ++--- .../src/MonomialBasis.jl | 4 +- experimental/GModule/GaloisCohomology.jl | 5 ++- .../InvariantTheory/src/InvariantTheory.jl | 2 +- .../src/TorusInvariantsFast.jl | 4 +- .../LieAlgebras/src/AbstractLieAlgebra.jl | 4 +- experimental/LieAlgebras/src/LieAlgebraHom.jl | 4 +- .../LieAlgebras/src/LieAlgebraIdeal.jl | 4 +- .../LieAlgebras/src/LieAlgebraModule.jl | 4 +- .../LieAlgebras/src/LieAlgebraModuleHom.jl | 4 +- experimental/LieAlgebras/src/LieSubalgebra.jl | 4 +- .../LieAlgebras/src/LinearLieAlgebra.jl | 4 +- experimental/LieAlgebras/src/RootSystem.jl | 2 +- experimental/QuadFormAndIsom/src/printings.jl | 4 +- experimental/Schemes/AlgebraicCycles.jl | 2 +- experimental/Schemes/BlowupMorphism.jl | 2 +- experimental/Schemes/CartierDivisor.jl | 4 +- experimental/Schemes/CoherentSheaves.jl | 4 +- .../Schemes/CoveredProjectiveSchemes.jl | 2 +- experimental/Schemes/CoveredScheme.jl | 2 +- experimental/Schemes/FunctionFields.jl | 4 +- experimental/Schemes/IdealSheaves.jl | 2 +- .../Schemes/MorphismFromRationalFunctions.jl | 2 +- experimental/Schemes/Sheaves.jl | 4 +- experimental/Schemes/WeilDivisor.jl | 4 +- experimental/Schemes/elliptic_surface.jl | 2 +- .../SymmetricIntersections/src/printings.jl | 20 ++++----- .../AffineAlgebraicSet/Objects/Methods.jl | 8 ++-- .../Morphisms/Methods.jl | 2 +- .../Objects/Methods.jl | 2 +- .../Rings/Methods.jl | 4 +- .../AffineSchemes/Morphisms/Methods.jl | 2 +- .../Schemes/AffineSchemes/Objects/Methods.jl | 2 +- .../Schemes/AffineVariety/Objects/Methods.jl | 16 +++---- .../CoveredSchemes/Morphisms/Methods.jl | 4 +- .../Schemes/CoveredSchemes/Objects/Methods.jl | 4 +- .../Schemes/Covering/Morphisms/Methods.jl | 2 +- .../Schemes/Covering/Objects/Methods.jl | 4 +- .../Schemes/Gluing/Methods.jl | 2 +- .../ProjectiveAlgebraicSet/Objects/Methods.jl | 2 +- .../ProjectiveSchemes/Morphisms/Methods.jl | 2 +- .../ProjectiveSchemes/Objects/Methods.jl | 14 +++--- .../ProjectiveVariety/Objects/Methods.jl | 2 +- .../EnumerativeCombinatorics/tableaux.jl | 1 - .../weak_compositions.jl | 2 +- src/Combinatorics/Graphs/functions.jl | 2 +- src/Groups/GAPGroups.jl | 14 +++--- src/Groups/cosets.jl | 12 ++--- src/Groups/group_characters.jl | 7 +-- src/Groups/gsets.jl | 8 ++-- src/Groups/homomorphisms.jl | 4 +- src/Groups/matrices/MatGrp.jl | 6 +-- src/InvariantTheory/invariant_rings.jl | 4 +- src/InvariantTheory/iterators.jl | 8 ++-- src/Rings/MPolyMap/MPolyAnyMap.jl | 10 ++--- src/Rings/MPolyQuo.jl | 2 +- src/Rings/localization_interface.jl | 2 +- src/Rings/mpoly-graded.jl | 4 +- src/Rings/mpoly-localizations.jl | 21 +++++---- src/Rings/mpolyquo-localizations.jl | 12 ++--- src/imports.jl | 2 + test/Groups/group_characters.jl | 10 ++--- 63 files changed, 178 insertions(+), 184 deletions(-) diff --git a/docs/src/DeveloperDocumentation/printing_details.md b/docs/src/DeveloperDocumentation/printing_details.md index 155dc4662e5..771d6dbb9f8 100644 --- a/docs/src/DeveloperDocumentation/printing_details.md +++ b/docs/src/DeveloperDocumentation/printing_details.md @@ -7,13 +7,13 @@ found in the [Developer Style Guide](@ref). ## Implementing `show` functions -Here is the translation between `:detail`, `one line` and `:supercompact`, +Here is the translation between `:detail`, `one line` and `terse`, where `io` is an `IO` object (such as `stdout` or an `IOBuffer`): ``` show(io, MIME"text/plain"(), x) # detailed printing print(io, x) # one line printing -print(IOContext(io, :supercompact => true), x) # supercompact printing +print(terse(io), x) # terse printing ``` For reference, string interpolation `"$(x)"` uses one line printing via `print(io, x)`, @@ -49,16 +49,16 @@ function Base.show(io::IO, ::MIME"text/plain", R::NewRing) end ``` -The following is a template for `one line` and `:supercompact` printing. +The following is a template for `one line` and `terse` printing. ```julia function Base.show(io::IO, R::NewRing) - if get(io, :supercompact, false) + if is_terse(io) # no nested printing - print(io, "supercompact printing of newring ") + print(io, "terse printing of newring ") else - # nested printing allowed, preferably supercompact + # nested printing allowed, preferably terse print(io, "one line printing of newring with ") - print(IOContext(io, :supercompact => true), "supercompact ", base_ring(R)) + print(terse(io), "terse ", base_ring(R)) end end ``` @@ -71,8 +71,8 @@ QQ julia> [R,R] 2-element Vector{NewRing}: - one line printing of newring with supercompact QQ - one line printing of newring with supercompact QQ + one line printing of newring with terse QQ + one line printing of newring with terse QQ ``` @@ -81,7 +81,7 @@ julia> [R,R] This version needs to be used in case the detailed printing does not contain newlines. Then detailed and one line printing agree. -The `if` clause takes care of supercompact printing as well. +The `if` clause takes care of terse printing as well. ```julia struct NewRing2 @@ -91,13 +91,13 @@ end base_ring(R::NewRing2) = R.base_ring function Base.show(io::IO, R::NewRing2) - if get(io, :supercompact, false) + if is_terse(io) # no nested printing - print(io, "supercompact printing of newring") + print(io, "terse printing of newring") else - # nested printing allowed, preferably supercompact + # nested printing allowed, preferably terse print(io, "I am a new ring and always print in one line " ) - print(IOContext(io, :supercompact => true), base_ring(R)) + print(terse(io), base_ring(R)) end end ``` @@ -111,11 +111,11 @@ julia> [R,R] I am a new ring and always print in one line Rational Field I am a new ring and always print in one line Rational Field -julia> print(IOContext(Base.stdout, :supercompact => true) ,R) -supercompact printing of newring +julia> print(terse(Base.stdout) ,R) +terse printing of newring ``` -The `supercompact` printing uses an `IOContext` (see [IOContext](https://docs.julialang.org/en/v1/base/io-network/#Base.IOContext) from +The `terse` printing uses an `IOContext` (see [IOContext](https://docs.julialang.org/en/v1/base/io-network/#Base.IOContext) from the Julia documentation) to pass information to other `show` methods invoked recursively (for example in nested printings). The same mechanism can be used to pass other context data. For instance, this is used by the `Scheme` code in @@ -140,11 +140,11 @@ It will be used for `print(io, R::NewRing)` though. ```julia function Base.show(io::IO, R::NewRing) - if get(io, :supercompact, false) - print(io, "supercompact printing of newring") + if is_terse(io) + print(io, "terse printing of newring") else # this is what we call one line print(io, "one line printing of newring with ") - print(IOContext(io, :supercompact => true), "supercompact ", R.base_ring) + print(terse(io), "terse ", R.base_ring) end end ``` @@ -161,7 +161,7 @@ julia> [R,R] # one line printing is ignored I am a new ring with a detailed printing of one line julia> print(Base.stdout, R) -one line printing of newring with supercompact QQ +one line printing of newring with terse QQ ``` ## Advanced printing functionality @@ -306,7 +306,7 @@ Here is an example with and without output using Unicode: - All `show` methods for parent objects such as rings or modules should use the `@show_name` macro. This macro ensures that if the object has a name (including one derived from the name of a Julia REPL variable to which the object is currently assigned) then in - a `compact` or `supercompact` io context it is printed using that name. + a `compact` or `terse` io context it is printed using that name. Here is an example illustrating this: ``` julia> vector_space(GF(2), 2) diff --git a/docs/src/DeveloperDocumentation/styleguide.md b/docs/src/DeveloperDocumentation/styleguide.md index 9b10d066614..44490ecffaf 100644 --- a/docs/src/DeveloperDocumentation/styleguide.md +++ b/docs/src/DeveloperDocumentation/styleguide.md @@ -275,7 +275,7 @@ matrix `A`, write `Oscar.parent(A)`. ### The 2 + 1 print modes of Oscar Oscar has two user print modes `detailed` and `one line` and one internal -print mode `:supercompact`. The latter is for use during recursion, +print mode `terse`. The latter is for use during recursion, e.g. to print the `base_ring(X)` when in `one line` mode. It exists to make sure that `one line` stays compact and human readable. @@ -302,7 +302,7 @@ General linear group of degree 24 # one line General linear group of degree 24 over GF(29^7) -# supercompact +# terse General linear group ``` @@ -317,17 +317,17 @@ The print modes are specified as follows - should make sense as a standalone without context - variable names/generators/relations should not be printed only their number. - Only the first word is capitalized e.g. `Polynomial ring` -- one should use `:supercompact` for nested printing in compact +- one should use `terse` for nested printing in compact - nested calls to `one line` (if you think them really necessary) should be at the end, - so that one can read sequentially. Calls to `:supercompact` can be anywhere. + so that one can read sequentially. Calls to `terse` can be anywhere. - commas must be enclosed in brackets so that printing tuples stays unambiguous -#### Super compact printing +#### Terse printing - a user readable version of the main (mathematical) type. - a single term or a symbol/letter mimicking mathematical notation - should usually only depend on the type and not of the type parameters or of the concrete instance - exceptions of this rule are possible e.g. for `GF(2)` - no nested printing. In particular variable names and `base_ring` must not be displayed. - This ensures that `one line` and `:supercompact` stay compact even for complicated things. + This ensures that `one line` and `terse` stay compact even for complicated things. If you want nested printing use `one line` or `detailed`. For further information and examples we refer you to our section [Details on diff --git a/experimental/BasisLieHighestWeight/src/MonomialBasis.jl b/experimental/BasisLieHighestWeight/src/MonomialBasis.jl index f5027ddb9ac..84d4e535f7a 100644 --- a/experimental/BasisLieHighestWeight/src/MonomialBasis.jl +++ b/experimental/BasisLieHighestWeight/src/MonomialBasis.jl @@ -92,7 +92,7 @@ function Base.show(io::IO, ::MIME"text/plain", basis::MonomialBasis) end function Base.show(io::IO, basis::MonomialBasis) - if get(io, :supercompact, false) + if is_terse(io) print(io, "Monomial basis of a highest weight module") else io = pretty(io) @@ -100,6 +100,6 @@ function Base.show(io::IO, basis::MonomialBasis) io, "Monomial basis of a highest weight module with highest weight $(highest_weight(basis)) over ", ) - print(IOContext(io, :supercompact => true), Lowercase(), base_lie_algebra(basis)) + print(terse(io), Lowercase(), base_lie_algebra(basis)) end end diff --git a/experimental/GModule/GaloisCohomology.jl b/experimental/GModule/GaloisCohomology.jl index 900cd21d1f2..9e7c029feab 100644 --- a/experimental/GModule/GaloisCohomology.jl +++ b/experimental/GModule/GaloisCohomology.jl @@ -6,7 +6,7 @@ import Oscar.GrpCoh: CoChain, MultGrpElem, MultGrp, GModule, is_consistent, Group import Base: parent import Oscar: direct_sum -import Oscar: pretty, Lowercase, Indent, Dedent +import Oscar: pretty, Lowercase, Indent, Dedent, terse export is_coboundary, idel_class_gmodule, relative_brauer_group export local_invariants, global_fundamental_class, shrink @@ -1390,7 +1390,8 @@ end function Base.show(io::IO, m::MIME"text/plain", a::RelativeBrauerGroupElem) io = pretty(io) print(io, "Element of relative Brauer group of ", Lowercase(), parent(a).k) - io = IOContext(io, :supercompact => true, :compact => true) + io = terse(io) + io = IOContext(io, :compact => true) # FIXME: for now also enable compact printing print(io, Indent()) data = sort(collect(a.data); by =(x -> first(x) isa AbsSimpleNumFieldEmbedding ? Inf : minimum(first(x)))) for (p,v) in data diff --git a/experimental/InvariantTheory/src/InvariantTheory.jl b/experimental/InvariantTheory/src/InvariantTheory.jl index 1cfde8782f8..aabe1001716 100644 --- a/experimental/InvariantTheory/src/InvariantTheory.jl +++ b/experimental/InvariantTheory/src/InvariantTheory.jl @@ -59,7 +59,7 @@ function Base.show(io::IO, G::LinearlyReductiveGroup) io = pretty(io) if G.group[1] == :SL println(io, "Reductive group ", G.group[1], G.group[2]) - print(IOContext(io, :supercompact => true), Indent(), "over ", Lowercase(), field(G)) + print(terse(io), Indent(), "over ", Lowercase(), field(G)) print(io, Dedent()) end end diff --git a/experimental/InvariantTheory/src/TorusInvariantsFast.jl b/experimental/InvariantTheory/src/TorusInvariantsFast.jl index 7cbc628df96..72c74089109 100644 --- a/experimental/InvariantTheory/src/TorusInvariantsFast.jl +++ b/experimental/InvariantTheory/src/TorusInvariantsFast.jl @@ -61,7 +61,7 @@ field(G::TorusGroup) = G.field function Base.show(io::IO, G::TorusGroup) io = pretty(io) println(io, "Torus of rank ", rank(G)) - print(IOContext(io, :supercompact => true), Indent(), "over ", Lowercase(), field(G)) + print(terse(io), Indent(), "over ", Lowercase(), field(G)) print(io, Dedent()) end @@ -152,7 +152,7 @@ group(R::RepresentationTorusGroup) = R.group function Base.show(io::IO, R::RepresentationTorusGroup) io = pretty(io) println(io, "Representation of torus of rank ", rank(group(R))) - println(IOContext(io, :supercompact => true), Indent(), "over ", Lowercase(), field(group(R)), " and weights ") + println(terse(io), Indent(), "over ", Lowercase(), field(group(R)), " and weights ") print(io, R.weights) print(io, Dedent()) end diff --git a/experimental/LieAlgebras/src/AbstractLieAlgebra.jl b/experimental/LieAlgebras/src/AbstractLieAlgebra.jl index 52ea93c7e50..a12d9531f60 100644 --- a/experimental/LieAlgebras/src/AbstractLieAlgebra.jl +++ b/experimental/LieAlgebras/src/AbstractLieAlgebra.jl @@ -120,12 +120,12 @@ function Base.show(io::IO, ::MIME"text/plain", L::AbstractLieAlgebra) end function Base.show(io::IO, L::AbstractLieAlgebra) - if get(io, :supercompact, false) + if is_terse(io) print(io, "Abstract Lie algebra") else io = pretty(io) print(io, "Abstract Lie algebra over ", Lowercase()) - print(IOContext(io, :supercompact => true), coefficient_ring(L)) + print(terse(io), coefficient_ring(L)) end end diff --git a/experimental/LieAlgebras/src/LieAlgebraHom.jl b/experimental/LieAlgebras/src/LieAlgebraHom.jl index 1eed643e5b8..91ec4cc2aea 100644 --- a/experimental/LieAlgebras/src/LieAlgebraHom.jl +++ b/experimental/LieAlgebras/src/LieAlgebraHom.jl @@ -71,7 +71,7 @@ end function Base.show(io::IO, ::MIME"text/plain", h::LieAlgebraHom) io = pretty(io) - println(IOContext(io, :supercompact => true), h) + println(terse(io), h) print(io, Indent()) println(io, "from ", Lowercase(), domain(h)) print(io, "to ", Lowercase(), codomain(h)) @@ -80,7 +80,7 @@ end function Base.show(io::IO, h::LieAlgebraHom) io = pretty(io) - if get(io, :supercompact, false) + if is_terse(io) print(io, LowercaseOff(), "Lie algebra morphism") else print(io, LowercaseOff(), "Lie algebra morphism: ") diff --git a/experimental/LieAlgebras/src/LieAlgebraIdeal.jl b/experimental/LieAlgebras/src/LieAlgebraIdeal.jl index 14dd8759d4f..c90a3960b3e 100644 --- a/experimental/LieAlgebras/src/LieAlgebraIdeal.jl +++ b/experimental/LieAlgebras/src/LieAlgebraIdeal.jl @@ -114,11 +114,11 @@ end function Base.show(io::IO, I::LieAlgebraIdeal) io = pretty(io) - if get(io, :supercompact, false) + if is_terse(io) print(io, LowercaseOff(), "Lie algebra ideal") else print(io, LowercaseOff(), "Lie algebra ideal of dimension $(dim(I)) over ", Lowercase()) - print(IOContext(io, :supercompact => true), base_lie_algebra(I)) + print(terse(io), base_lie_algebra(I)) end end diff --git a/experimental/LieAlgebras/src/LieAlgebraModule.jl b/experimental/LieAlgebras/src/LieAlgebraModule.jl index 253d5f61bba..853c2cdd3c0 100644 --- a/experimental/LieAlgebras/src/LieAlgebraModule.jl +++ b/experimental/LieAlgebras/src/LieAlgebraModule.jl @@ -211,12 +211,12 @@ function _show_inner(io::IO, V::LieAlgebraModule) end function Base.show(io::IO, V::LieAlgebraModule) - if get(io, :supercompact, false) + if is_terse(io) print(io, _module_type_to_string(V)) else io = pretty(io) print(io, _module_type_to_string(V), " of dimension $(dim(V)) over ", Lowercase()) - print(IOContext(io, :supercompact => true), base_lie_algebra(V)) + print(terse(io), base_lie_algebra(V)) end end diff --git a/experimental/LieAlgebras/src/LieAlgebraModuleHom.jl b/experimental/LieAlgebras/src/LieAlgebraModuleHom.jl index c92d9c2dc33..c2885ebe4b6 100644 --- a/experimental/LieAlgebras/src/LieAlgebraModuleHom.jl +++ b/experimental/LieAlgebras/src/LieAlgebraModuleHom.jl @@ -78,7 +78,7 @@ end function Base.show(io::IO, ::MIME"text/plain", h::LieAlgebraModuleHom) io = pretty(io) - println(IOContext(io, :supercompact => true), h) + println(terse(io), h) print(io, Indent()) println(io, "from ", Lowercase(), domain(h)) print(io, "to ", Lowercase(), codomain(h)) @@ -87,7 +87,7 @@ end function Base.show(io::IO, h::LieAlgebraModuleHom) io = pretty(io) - if get(io, :supercompact, false) + if is_terse(io) print(io, LowercaseOff(), "Lie algebra module morphism") else print(io, LowercaseOff(), "Lie algebra module morphism: ") diff --git a/experimental/LieAlgebras/src/LieSubalgebra.jl b/experimental/LieAlgebras/src/LieSubalgebra.jl index 528e74bcabf..4350e26731d 100644 --- a/experimental/LieAlgebras/src/LieSubalgebra.jl +++ b/experimental/LieAlgebras/src/LieSubalgebra.jl @@ -112,11 +112,11 @@ end function Base.show(io::IO, S::LieSubalgebra) io = pretty(io) - if get(io, :supercompact, false) + if is_terse(io) print(io, LowercaseOff(), "Lie subalgebra") else print(io, LowercaseOff(), "Lie subalgebra of dimension $(dim(S)) of ", Lowercase()) - print(IOContext(io, :supercompact => true), base_lie_algebra(S)) + print(terse(io), base_lie_algebra(S)) end end diff --git a/experimental/LieAlgebras/src/LinearLieAlgebra.jl b/experimental/LieAlgebras/src/LinearLieAlgebra.jl index 960f023c027..55df81638c8 100644 --- a/experimental/LieAlgebras/src/LinearLieAlgebra.jl +++ b/experimental/LieAlgebras/src/LinearLieAlgebra.jl @@ -91,7 +91,7 @@ function Base.show(io::IO, ::MIME"text/plain", L::LinearLieAlgebra) end function Base.show(io::IO, L::LinearLieAlgebra) - if get(io, :supercompact, false) + if is_terse(io) print(io, _lie_algebra_type_to_compact_string(get_attribute(L, :type, :unknown), L.n)) else io = pretty(io) @@ -101,7 +101,7 @@ function Base.show(io::IO, L::LinearLieAlgebra) " over ", Lowercase(), ) - print(IOContext(io, :supercompact => true), coefficient_ring(L)) + print(terse(io), coefficient_ring(L)) end end diff --git a/experimental/LieAlgebras/src/RootSystem.jl b/experimental/LieAlgebras/src/RootSystem.jl index 906572f1683..8c7598fc83c 100644 --- a/experimental/LieAlgebras/src/RootSystem.jl +++ b/experimental/LieAlgebras/src/RootSystem.jl @@ -81,7 +81,7 @@ function Base.show(io::IO, ::MIME"text/plain", R::RootSystem) end function Base.show(io::IO, R::RootSystem) - if get(io, :supercompact, false) + if is_terse(io) print(io, "Root system") else print(io, "Root system defined by Cartan matrix $(cartan_matrix(R))") diff --git a/experimental/QuadFormAndIsom/src/printings.jl b/experimental/QuadFormAndIsom/src/printings.jl index 5e1b334b240..2f2f7d6da67 100644 --- a/experimental/QuadFormAndIsom/src/printings.jl +++ b/experimental/QuadFormAndIsom/src/printings.jl @@ -20,7 +20,7 @@ function Base.show(io::IO, ::MIME"text/plain", Lf::ZZLatWithIsom) end function Base.show(io::IO, Lf::ZZLatWithIsom) - if get(io, :supercompact, false) + if is_terse(io) print(io, "Integer lattice with isometry") else n = order_of_isometry(Lf) @@ -54,7 +54,7 @@ function Base.show(io::IO, ::MIME"text/plain", Vf::QuadSpaceWithIsom) end function Base.show(io::IO, Vf::QuadSpaceWithIsom) - if get(io, :supercompact, false) + if is_terse(io) print(io, "Quadratic space with isometry") else n = order_of_isometry(Vf) diff --git a/experimental/Schemes/AlgebraicCycles.jl b/experimental/Schemes/AlgebraicCycles.jl index 2e699b2392f..2b097ebf3b1 100644 --- a/experimental/Schemes/AlgebraicCycles.jl +++ b/experimental/Schemes/AlgebraicCycles.jl @@ -358,7 +358,7 @@ function Base.show(io::IO, D::AlgebraicCycle) end if has_name(D) print(io, name(D)) - elseif get(io, :supercompact, false) + elseif is_terse(io) print(io, "Algebraic cycle") elseif length(components(D)) == 0 print(io, "Zero algebraic cycle on ", Lowercase(), scheme(D)) diff --git a/experimental/Schemes/BlowupMorphism.jl b/experimental/Schemes/BlowupMorphism.jl index e47b66380f8..c2e10c7dca0 100644 --- a/experimental/Schemes/BlowupMorphism.jl +++ b/experimental/Schemes/BlowupMorphism.jl @@ -686,7 +686,7 @@ end ############################################################################## function Base.show(io::IO, Bl::AbsSimpleBlowdownMorphism) io = pretty(io) - if get(io, :supercompact, false) + if is_terse(io) print(io, "Blowup morphism") else print(io, "Blow-down: ", Lowercase(), domain(Bl)) diff --git a/experimental/Schemes/CartierDivisor.jl b/experimental/Schemes/CartierDivisor.jl index df33628f3f4..cae4f92cb8a 100644 --- a/experimental/Schemes/CartierDivisor.jl +++ b/experimental/Schemes/CartierDivisor.jl @@ -413,7 +413,7 @@ function Base.show(io::IO, C::EffectiveCartierDivisor) cov = Oscar._covering_for_printing(io, scheme(C)) n = get(io, :label, "") _show_semi_compact(io, C, cov, n) - elseif get(io, :supercompact, false) + elseif is_terse(io) print(io, "Effective cartier divisor") elseif has_attribute(C, :name) print(io, get_attribute(C, :name)) @@ -472,7 +472,7 @@ function Base.show(io::IO, C::CartierDivisor) cov = Oscar._covering_for_printing(io, scheme(C)) n = get(io, :label, "") _show_semi_compact(io, C, cov, n) - elseif get(io, :supercompact, false) + elseif is_terse(io) print(io, "Cartier divisor") elseif has_attribute(C, :name) print(io, get_attribute(C, :name)) diff --git a/experimental/Schemes/CoherentSheaves.jl b/experimental/Schemes/CoherentSheaves.jl index 2e79344fe7f..4b2a9349fc4 100644 --- a/experimental/Schemes/CoherentSheaves.jl +++ b/experimental/Schemes/CoherentSheaves.jl @@ -69,7 +69,7 @@ end function Base.show(io::IO, M::AbsCoherentSheaf) io = pretty(io) - if get(io, :supercompact, false) + if is_terse(io) print(io, "Coherent sheaf of modules") elseif has_attribute(M, :name) print(io, get_attribute(M, :name)) @@ -1009,7 +1009,7 @@ function direct_sum(summands::Vector{<:AbsCoherentSheaf}) end function Base.show(io::IO, M::DirectSumSheaf) - if get(io, :supercompact, false) + if is_terse(io) print(io, "Direct sum of sheaves") else s = summands(M) diff --git a/experimental/Schemes/CoveredProjectiveSchemes.jl b/experimental/Schemes/CoveredProjectiveSchemes.jl index 6b56b606d78..55db8c4ae60 100644 --- a/experimental/Schemes/CoveredProjectiveSchemes.jl +++ b/experimental/Schemes/CoveredProjectiveSchemes.jl @@ -264,7 +264,7 @@ function Base.show(io::IO, CPS::CoveredProjectiveScheme) io = pretty(io) n = length(projective_patches(CPS)) K = base_ring(base_scheme(CPS)) - if get(io, :supercompact, false) + if is_terse(io) print(io, "Relative projective scheme") else if length(projective_patches(CPS)) == 0 diff --git a/experimental/Schemes/CoveredScheme.jl b/experimental/Schemes/CoveredScheme.jl index 898c441fab2..8e863bc5ca5 100644 --- a/experimental/Schemes/CoveredScheme.jl +++ b/experimental/Schemes/CoveredScheme.jl @@ -713,7 +713,7 @@ end ######################################################################## function Base.show(io::IO, f::CompositeCoveredSchemeMorphism) io = pretty(io) - if get(io, :supercompact, false) + if is_terse(io) print(io, "Composite morphism") else print(io, "Composition of ", "$(domain(f)) -> ") diff --git a/experimental/Schemes/FunctionFields.jl b/experimental/Schemes/FunctionFields.jl index ef1b8796969..9cfcff5fdfd 100644 --- a/experimental/Schemes/FunctionFields.jl +++ b/experimental/Schemes/FunctionFields.jl @@ -384,7 +384,7 @@ canonical_unit(f::VarietyFunctionFieldElem) = f # part of the ring interface tha function Base.show(io::IO, KK::VarietyFunctionField) io = pretty(io) - if get(io, :supercompact, false) + if is_terse(io) print(io, "Field of rational functions") else print(io, "Field of rational functions on ", Lowercase(), variety(KK)) @@ -415,7 +415,7 @@ function Base.show(io::IO, f::VarietyFunctionFieldElem) cov = Oscar._covering_for_printing(io, X) k = get(io, :offset, 0) _show_semi_compact(io, f, cov, k) - elseif get(io, :supercompact, false) + elseif is_terse(io) print(io, "Rational function") else print(io, "Rational function on ", Lowercase(), variety(parent(f))) diff --git a/experimental/Schemes/IdealSheaves.jl b/experimental/Schemes/IdealSheaves.jl index 9030f7dd6c4..174e2f4130b 100644 --- a/experimental/Schemes/IdealSheaves.jl +++ b/experimental/Schemes/IdealSheaves.jl @@ -1136,7 +1136,7 @@ function Base.show(io::IO, I::AbsIdealSheaf) prim = get_attribute(I, :is_prime, false) if has_attribute(I, :name) print(io, get_attribute(I, :name)) - elseif get(io, :supercompact, false) + elseif is_terse(io) print(io, "Sheaf of ideals") else if get_attribute(I, :is_one, false) diff --git a/experimental/Schemes/MorphismFromRationalFunctions.jl b/experimental/Schemes/MorphismFromRationalFunctions.jl index a22f2139c2f..7faa7548f45 100644 --- a/experimental/Schemes/MorphismFromRationalFunctions.jl +++ b/experimental/Schemes/MorphismFromRationalFunctions.jl @@ -92,7 +92,7 @@ morphism_from_rational_functions( ) = MorphismFromRationalFunctions(X, Y, U, V, a; check, domain_covering, codomain_covering) function Base.show(io::IOContext, Phi::MorphismFromRationalFunctions) - if get(io, :supercompact, false) + if is_terse(io) print("Morphism from rational functions") else io = pretty(io) diff --git a/experimental/Schemes/Sheaves.jl b/experimental/Schemes/Sheaves.jl index 9638cb9c16f..5edc24fca55 100644 --- a/experimental/Schemes/Sheaves.jl +++ b/experimental/Schemes/Sheaves.jl @@ -521,12 +521,12 @@ end function Base.show(io::IO, R::StructureSheafOfRings) io = pretty(io) - if get(io, :supercompact, false) + if is_terse(io) print(io, "Structure sheaf of rings") else if is_unicode_allowed() print(io, "𝒪_{") - print(IOContext(io, :supercompact => true), space(R), "}") + print(terse(io), space(R), "}") else print(io, "Structure sheaf of ", Lowercase(), space(R)) end diff --git a/experimental/Schemes/WeilDivisor.jl b/experimental/Schemes/WeilDivisor.jl index b2d7e6a15b7..862b7706380 100644 --- a/experimental/Schemes/WeilDivisor.jl +++ b/experimental/Schemes/WeilDivisor.jl @@ -186,7 +186,7 @@ function Base.show(io::IO, D::AbsWeilDivisor) prim = eff && get_attribute(D, :is_prime, false) if has_name(D) print(io, name(D)) - elseif get(io, :supercompact, false) + elseif is_terse(io) print(io, "Weil divisor") # if the divisor is prime and the ideal sheaf has a name print that elseif length(components(D)) == 1 && has_attribute(first(components(D)), :name) @@ -608,7 +608,7 @@ generated by rational functions ``f₁,…,fᵣ ∈ K(X)``. end function Base.show(io::IO, L::LinearSystem) - if get(io, :supercompact, true) + if is_terse(io) print(io, "Linear system") else io = pretty(io) diff --git a/experimental/Schemes/elliptic_surface.jl b/experimental/Schemes/elliptic_surface.jl index c8a29d1cddc..35847bd9d02 100644 --- a/experimental/Schemes/elliptic_surface.jl +++ b/experimental/Schemes/elliptic_surface.jl @@ -366,7 +366,7 @@ end function Base.show(io::IO, S::EllipticSurface) io = pretty(io) - if get(io, :supercompact, false) + if is_terse(io) print(io, "Elliptic surface") else E = generic_fiber(S) diff --git a/experimental/SymmetricIntersections/src/printings.jl b/experimental/SymmetricIntersections/src/printings.jl index 2fadaafbc24..4b316669dfa 100644 --- a/experimental/SymmetricIntersections/src/printings.jl +++ b/experimental/SymmetricIntersections/src/printings.jl @@ -6,7 +6,7 @@ function Base.show(io::IO, EC::ElevCtx{T, U}) where {T, U} d = degree_of_elevations(EC) - if get(io, :supercompact, false) + if is_terse(io) print(io, "Elevator") else print(io, "Degree $d elevator of a list with entries of type $T") @@ -30,7 +30,7 @@ function Base.show(io::IO, ::MIME"text/plain", LR::LinRep) end function Base.show(io::IO, LR::LinRep) - if get(io, :supercompact, false) + if is_terse(io) print(io, "Linear representation") else print(io, "Linear representation of finite group of dimension $(dimension_representation(LR))") @@ -48,7 +48,7 @@ function Base.show(io::IO, ::MIME"text/plain", PR::ProjRep) end function Base.show(io::IO, PR::ProjRep) - if get(io, :supercompact, false) + if is_terse(io) print(io, "Projective representation") else print(io, "Projective representation of finite group of dimension ", dimension_representation(PR)) @@ -66,7 +66,7 @@ function Base.show(io::IO, ::MIME"text/plain", RR::RepRing) end function Base.show(io::IO, RR::RepRing) - if get(io, :supercompact, false) + if is_terse(io) print(io, "Representation ring") else print(io, "Representation ring of finite group over a field of characteristic 0") @@ -91,7 +91,7 @@ function Base.show(io::IO, ::MIME"text/plain", M::IsotGrass) end function Base.show(io::IO, M::IsotGrass) - if get(io, :supercompact, false) + if is_terse(io) print(io, "Isotypical Grassmannian") else print(io, "Isotypical Grassmannian of dimension $(projective_dimension(M))") @@ -111,7 +111,7 @@ function Base.show(io::IO, ::MIME"text/plain", M::CharGrass) end function Base.show(io::IO, M::CharGrass) - if get(io, :supercompact, false) + if is_terse(io) print(io, "Character Grassmannian") else print(io, "Character Grassmannian of dimension $(projective_dimension(M))") @@ -130,7 +130,7 @@ function Base.show(io::IO, ::MIME"text/plain", M::DetGrass) end function Base.show(io::IO, M::DetGrass) - if get(io, :supercompact, false) + if is_terse(io) print(io, "Determinant Grassmannian") else print(io, "Determinant Grassmannian of dimension $(projective_dimension(M))") @@ -147,7 +147,7 @@ function Base.show(io::IO, ::MIME"text/plain", M::InvGrass) end function Base.show(io::IO, M::InvGrass) - if get(io, :supercompact, false) + if is_terse(io) print(io, "Invariant Grassmannian") else print(io, "Invariant Grassmannian of dimension $(projective_dimension(M))") @@ -185,13 +185,13 @@ function Base.show(io::IO, ::MIME"text/plain", symci::SymInter) println(io, Indent(), "of type $(ty)") println(io, "in projective $(n-1)-space") print(io, Indent(), "over ", Lowercase()) - Base.show(IOContext(io, :supercompact => true), F) + Base.show(terse(io), F) println(io) print(io, Dedent(), Dedent(), "preserved under the action of ", Lowercase(), G) end function Base.show(io::IO, symci::SymInter) - if get(io, :supercompact, false) + if is_terse(io) print(io, "Symmetric intersections") else print(io, "Parameter space for symmetric intersections") diff --git a/src/AlgebraicGeometry/Schemes/AffineAlgebraicSet/Objects/Methods.jl b/src/AlgebraicGeometry/Schemes/AffineAlgebraicSet/Objects/Methods.jl index b8166613e7a..37ce507e308 100644 --- a/src/AlgebraicGeometry/Schemes/AffineAlgebraicSet/Objects/Methods.jl +++ b/src/AlgebraicGeometry/Schemes/AffineAlgebraicSet/Objects/Methods.jl @@ -24,13 +24,13 @@ end # For compact printing, we value the notation V(bla) since it tells everything # we need to know, in a given contextual printing function Base.show(io::IO, X::AffineAlgebraicSet{<:Field,<:MPolyQuoRing}) - if get(io, :supercompact, false) + if is_terse(io) print(io, "Affine algebraic set") elseif get_attribute(X, :is_empty, false) io = pretty(io) print(io, "Empty affine algebraic set over ") K = base_ring(X) - print(IOContext(io, :supercompact => true), Lowercase(), K) + print(terse(io), Lowercase(), K) else io = pretty(io) if isdefined(X, :Xred) @@ -53,13 +53,13 @@ function Base.show(io::IO, ::MIME"text/plain", X::AffineAlgebraicSet) end function Base.show(io::IO, X::AffineAlgebraicSet) - if get(io, :supercompact, false) + if is_terse(io) print(io, "Affine algebraic set") elseif get_attribute(X, :is_empty, false) io = pretty(io) print(io, "Empty affine algebraic set over ") K = base_ring(X) - print(IOContext(io, :supercompact => true), Lowercase(), K) + print(terse(io), Lowercase(), K) else io = pretty(io) print(io, "Reduced subscheme of ", Lowercase(), fat_scheme(X)) diff --git a/src/AlgebraicGeometry/Schemes/AffineSchemeOpenSubscheme/Morphisms/Methods.jl b/src/AlgebraicGeometry/Schemes/AffineSchemeOpenSubscheme/Morphisms/Methods.jl index eafc5f2b6a1..64d15b54bf5 100644 --- a/src/AlgebraicGeometry/Schemes/AffineSchemeOpenSubscheme/Morphisms/Methods.jl +++ b/src/AlgebraicGeometry/Schemes/AffineSchemeOpenSubscheme/Morphisms/Methods.jl @@ -46,7 +46,7 @@ function Base.show(io::IO, ::MIME"text/plain", f::AffineSchemeOpenSubschemeMor) end function Base.show(io::IO, f::AffineSchemeOpenSubschemeMor) - if get(io, :supercompact, false) + if is_terse(io) print(io, "Affine scheme open subscheme morphism") else io = pretty(io) diff --git a/src/AlgebraicGeometry/Schemes/AffineSchemeOpenSubscheme/Objects/Methods.jl b/src/AlgebraicGeometry/Schemes/AffineSchemeOpenSubscheme/Objects/Methods.jl index 7c6b977c680..9cd15c88ea5 100644 --- a/src/AlgebraicGeometry/Schemes/AffineSchemeOpenSubscheme/Objects/Methods.jl +++ b/src/AlgebraicGeometry/Schemes/AffineSchemeOpenSubscheme/Objects/Methods.jl @@ -187,7 +187,7 @@ function Base.show(io::IO, U::AffineSchemeOpenSubscheme) _show_semi_compact(io, U) elseif isdefined(U, :name) print(io, name(U)) - elseif get(io, :supercompact, false) + elseif is_terse(io) print(io, "Open subset of affine scheme") elseif get_attribute(U, :is_empty, false) io = pretty(io) diff --git a/src/AlgebraicGeometry/Schemes/AffineSchemeOpenSubscheme/Rings/Methods.jl b/src/AlgebraicGeometry/Schemes/AffineSchemeOpenSubscheme/Rings/Methods.jl index 327467b68d3..b5b11f84c99 100644 --- a/src/AlgebraicGeometry/Schemes/AffineSchemeOpenSubscheme/Rings/Methods.jl +++ b/src/AlgebraicGeometry/Schemes/AffineSchemeOpenSubscheme/Rings/Methods.jl @@ -450,7 +450,7 @@ end ############################################################################### function Base.show(io::IO, R::AffineSchemeOpenSubschemeRing) - if get(io, :supercompact, false) + if is_terse(io) print(io, "Ring of regular functions") else io = pretty(io) @@ -468,7 +468,7 @@ function Base.show(io::IO, ::MIME"text/plain", R::AffineSchemeOpenSubschemeRing) end function Base.show(io::IO, a::AffineSchemeOpenSubschemeRingElem) - if get(io, :supercompact, false) + if is_terse(io) print(io, "Reguler function") else io = pretty(io) diff --git a/src/AlgebraicGeometry/Schemes/AffineSchemes/Morphisms/Methods.jl b/src/AlgebraicGeometry/Schemes/AffineSchemes/Morphisms/Methods.jl index 7f8f6f2081d..33b2ab89560 100644 --- a/src/AlgebraicGeometry/Schemes/AffineSchemes/Morphisms/Methods.jl +++ b/src/AlgebraicGeometry/Schemes/AffineSchemes/Morphisms/Methods.jl @@ -426,7 +426,7 @@ function Base.show(io::IO, ::MIME"text/plain", f::AbsAffineSchemeMor) end function Base.show(io::IO, f::AbsAffineSchemeMor) - if get(io, :supercompact, false) + if is_terse(io) print(io, "Affine scheme morphism") else io = pretty(io) diff --git a/src/AlgebraicGeometry/Schemes/AffineSchemes/Objects/Methods.jl b/src/AlgebraicGeometry/Schemes/AffineSchemes/Objects/Methods.jl index 71eecb87e37..432b9e54015 100644 --- a/src/AlgebraicGeometry/Schemes/AffineSchemes/Objects/Methods.jl +++ b/src/AlgebraicGeometry/Schemes/AffineSchemes/Objects/Methods.jl @@ -43,7 +43,7 @@ end function Base.show(io::IO, X::AbsAffineScheme) if has_attribute(X, :name) print(io, name(X)) - elseif get(io, :supercompact, false) + elseif is_terse(io) print(io, "Affine scheme") elseif get_attribute(X, :is_empty, false) print(io, "Empty affine scheme") diff --git a/src/AlgebraicGeometry/Schemes/AffineVariety/Objects/Methods.jl b/src/AlgebraicGeometry/Schemes/AffineVariety/Objects/Methods.jl index 55df42ded67..5a6da53c026 100644 --- a/src/AlgebraicGeometry/Schemes/AffineVariety/Objects/Methods.jl +++ b/src/AlgebraicGeometry/Schemes/AffineVariety/Objects/Methods.jl @@ -19,13 +19,13 @@ function Base.show(io::IO, ::MIME"text/plain", X::AffineVariety{<:Field,<:MPolyQ end function Base.show(io::IO, X::AffineVariety{<:Field,<:MPolyQuoRing}) - if get(io, :supercompact, false) + if is_terse(io) print(io, "Affine variety") elseif get_attribute(X, :is_empty, false) io = pretty(io) print(io, "Empty affine variety over ") K = base_ring(X) - print(IOContext(io, :supercompact => true), Lowercase(), K) + print(terse(io), Lowercase(), K) else print(io, underlying_scheme(X)) end @@ -42,13 +42,13 @@ function Base.show(io::IO, ::MIME"text/plain", X::AffineVariety) end function Base.show(io::IO, X::AffineVariety) - if get(io, :supercompact, false) + if is_terse(io) print(io, "Affine variety") elseif get_attribute(X, :is_empty, false) io = pretty(io) print(io, "Empty affine variety over ") K = base_ring(X) - print(IOContext(io, :supercompact => true), Lowercase(), K) + print(terse(io), Lowercase(), K) else io = pretty(io) print(io, "Affine open subset of ", Lowercase(), closure(X, ambient_space(X))) @@ -76,7 +76,7 @@ end function Base.show(io::IO, X::AffineVariety{<:Field, <:MPolyRing}) io = pretty(io) show_coord = get(io, :show_coordinates, true) - if get(io, :supercompact, false) + if is_terse(io) if is_unicode_allowed() ltx = Base.REPL_MODULE_REF.x.REPLCompletions.latex_symbols print(io, LowercaseOff(), "𝔸$(ltx["\\^$(dim(X))"])") @@ -86,7 +86,7 @@ function Base.show(io::IO, X::AffineVariety{<:Field, <:MPolyRing}) elseif get_attribute(X, :is_empty, false) print(io, "Empty affine space over ") K = base_ring(X) - print(IOContext(io, :supercompact => true), Lowercase(), K) + print(terse(io), Lowercase(), K) else if is_unicode_allowed() ltx = Base.REPL_MODULE_REF.x.REPLCompletions.latex_symbols @@ -96,7 +96,7 @@ function Base.show(io::IO, X::AffineVariety{<:Field, <:MPolyRing}) print(io, ltx["\\^$d"]) end print(io, " over ") - print(IOContext(io, :supercompact => true), Lowercase(), base_ring(X)) + print(terse(io), Lowercase(), base_ring(X)) if show_coord c = coordinates(X) print(io, " with coordinate") @@ -106,7 +106,7 @@ function Base.show(io::IO, X::AffineVariety{<:Field, <:MPolyRing}) end else print(io, "Affine $(dim(X))-space over ") - print(IOContext(io, :supercompact => true), Lowercase(), base_ring(X)) + print(terse(io), Lowercase(), base_ring(X)) if show_coord c = coordinates(X) print(io, " with coordinate") diff --git a/src/AlgebraicGeometry/Schemes/CoveredSchemes/Morphisms/Methods.jl b/src/AlgebraicGeometry/Schemes/CoveredSchemes/Morphisms/Methods.jl index 8f9c457197e..ba8457f4cdf 100644 --- a/src/AlgebraicGeometry/Schemes/CoveredSchemes/Morphisms/Methods.jl +++ b/src/AlgebraicGeometry/Schemes/CoveredSchemes/Morphisms/Methods.jl @@ -186,11 +186,11 @@ end # We use a pattern for printings morphisms, gluings, etc... # -# In supercompact printing, we just write what it is, super shortly. +# In terse printing, we just write what it is, super shortly. # For normal compact printing, we mention what it is, then use colons to # describe "domain -> codomain". function Base.show(io::IO, f::AbsCoveredSchemeMorphism) - if get(io, :supercompact, false) + if is_terse(io) print(io, "Covered scheme morphism") else io = pretty(io) diff --git a/src/AlgebraicGeometry/Schemes/CoveredSchemes/Objects/Methods.jl b/src/AlgebraicGeometry/Schemes/CoveredSchemes/Objects/Methods.jl index ff8fc7c3253..b215a33aa68 100644 --- a/src/AlgebraicGeometry/Schemes/CoveredSchemes/Objects/Methods.jl +++ b/src/AlgebraicGeometry/Schemes/CoveredSchemes/Objects/Methods.jl @@ -132,7 +132,7 @@ function Base.show(io::IO, X::AbsCoveredScheme) n = n_patches(cov) if has_name(X) print(io, name(X)) - elseif get(io, :supercompact, false) + elseif is_terse(io) print(io, "Covered scheme") else if get_attribute(X, :is_empty, false) || n == 0 @@ -140,7 +140,7 @@ function Base.show(io::IO, X::AbsCoveredScheme) else print(io, "Scheme over ") end - print(IOContext(io, :supercompact => true), Lowercase(), base_ring(X)) + print(terse(io), Lowercase(), base_ring(X)) end n > 0 && print(io, " covered with ", ItemQuantity(n, "patch")) end diff --git a/src/AlgebraicGeometry/Schemes/Covering/Morphisms/Methods.jl b/src/AlgebraicGeometry/Schemes/Covering/Morphisms/Methods.jl index eb405b150ed..8437b3758b1 100644 --- a/src/AlgebraicGeometry/Schemes/Covering/Morphisms/Methods.jl +++ b/src/AlgebraicGeometry/Schemes/Covering/Morphisms/Methods.jl @@ -93,7 +93,7 @@ function Base.show(io::IO, f::CoveringMorphism) io = pretty(io) if get(io, :show_semi_compact, false) _show_semi_compact(io, f) - elseif get(io, :supercompact, false) + elseif is_terse(io) print(io, "Covering morphism") else print(io, "Hom: ", Lowercase(), domain(f), " -> ", Lowercase(), codomain(f)) diff --git a/src/AlgebraicGeometry/Schemes/Covering/Objects/Methods.jl b/src/AlgebraicGeometry/Schemes/Covering/Objects/Methods.jl index 357588b9114..749247b39a4 100644 --- a/src/AlgebraicGeometry/Schemes/Covering/Objects/Methods.jl +++ b/src/AlgebraicGeometry/Schemes/Covering/Objects/Methods.jl @@ -289,10 +289,10 @@ function Base.show(io::IO, ::MIME"text/plain", C::Covering) end function Base.show(io::IO, C::Covering) - if get(io, :supercompact, false) + if is_terse(io) print(io, "Covering") else - print(io, "Covering with ", ItemQuantity(n_patches(C), "patch")) + print(io, "Covering with ", ItemQuantity(n_patches(C), "patch")) end end diff --git a/src/AlgebraicGeometry/Schemes/Gluing/Methods.jl b/src/AlgebraicGeometry/Schemes/Gluing/Methods.jl index 38582df92db..b5912120a66 100644 --- a/src/AlgebraicGeometry/Schemes/Gluing/Methods.jl +++ b/src/AlgebraicGeometry/Schemes/Gluing/Methods.jl @@ -66,7 +66,7 @@ end function Base.show(io::IO, G::AbsGluing) io = pretty(io) - if get(io, :supercompact, false) + if is_terse(io) print(io, "Gluing") else print(io, "Gluing: ", Lowercase(), patches(G)[1], " -> ", Lowercase(), patches(G)[2]) diff --git a/src/AlgebraicGeometry/Schemes/ProjectiveAlgebraicSet/Objects/Methods.jl b/src/AlgebraicGeometry/Schemes/ProjectiveAlgebraicSet/Objects/Methods.jl index b085fde691f..f70ef835446 100644 --- a/src/AlgebraicGeometry/Schemes/ProjectiveAlgebraicSet/Objects/Methods.jl +++ b/src/AlgebraicGeometry/Schemes/ProjectiveAlgebraicSet/Objects/Methods.jl @@ -18,7 +18,7 @@ end # If we know a radical ideal describing our algebraic set, we preferably print # that one (it is easier to read...) function Base.show(io::IO, X::AbsProjectiveAlgebraicSet{<:Field, <:MPolyQuoRing}) - if get(io, :supercompact, false) + if is_terse(io) print(io, "Projective algebraic set") elseif get_attribute(X, :is_empty, false) print(io, "Empty projective algebraic set") diff --git a/src/AlgebraicGeometry/Schemes/ProjectiveSchemes/Morphisms/Methods.jl b/src/AlgebraicGeometry/Schemes/ProjectiveSchemes/Morphisms/Methods.jl index 03f89ff31ec..f3d60b82e5a 100644 --- a/src/AlgebraicGeometry/Schemes/ProjectiveSchemes/Morphisms/Methods.jl +++ b/src/AlgebraicGeometry/Schemes/ProjectiveSchemes/Morphisms/Methods.jl @@ -250,7 +250,7 @@ end function Base.show(io::IO, f::AbsProjectiveSchemeMorphism) if get(io, :show_semi_compact, false) _show_semi_compact(io, f) - elseif get(io, :supercompact, false) + elseif is_terse(io) print(io, "Projective scheme morphism") else io = pretty(io) diff --git a/src/AlgebraicGeometry/Schemes/ProjectiveSchemes/Objects/Methods.jl b/src/AlgebraicGeometry/Schemes/ProjectiveSchemes/Objects/Methods.jl index 8eb7aa3d22f..08ecfc9c40a 100644 --- a/src/AlgebraicGeometry/Schemes/ProjectiveSchemes/Objects/Methods.jl +++ b/src/AlgebraicGeometry/Schemes/ProjectiveSchemes/Objects/Methods.jl @@ -10,17 +10,17 @@ function Base.show(io::IO, ::MIME"text/plain", P::AbsProjectiveScheme{<:Any, <:M end function Base.show(io::IO, P::AbsProjectiveScheme{<:Any, <:MPolyQuoRing}) - if get(io, :supercompact, false) + if is_terse(io) print(io, "Projective scheme") elseif get_attribute(P, :is_empty, false) io = pretty(io) print(io, "Empty projective scheme over ") K = base_ring(P) - print(IOContext(io, :supercompact => true), Lowercase(), K) + print(terse(io), Lowercase(), K) else io = pretty(io) print(io, "Projective scheme in ") - print(IOContext(io, :supercompact => true), Lowercase(), ambient_space(P), " over ", Lowercase(), base_ring(P)) + print(terse(io), Lowercase(), ambient_space(P), " over ", Lowercase(), base_ring(P)) end end @@ -38,7 +38,7 @@ end function Base.show(io::IO, P::AbsProjectiveScheme{<:Any, <:MPolyDecRing}) io = pretty(io) - if get(io, :supercompact, false) + if is_terse(io) if is_unicode_allowed() ltx = Base.REPL_MODULE_REF.x.REPLCompletions.latex_symbols print(io, LowercaseOff(), "ℙ$(ltx["\\^$(relative_ambient_dimension(P))"])") @@ -48,7 +48,7 @@ function Base.show(io::IO, P::AbsProjectiveScheme{<:Any, <:MPolyDecRing}) elseif get_attribute(P, :is_empty, false) print(io, "Empty projective space over ") K = base_ring(P) - print(IOContext(io, :supercompact => true), Lowercase(), K) + print(terse(io), Lowercase(), K) else if is_unicode_allowed() ltx = Base.REPL_MODULE_REF.x.REPLCompletions.latex_symbols @@ -58,10 +58,10 @@ function Base.show(io::IO, P::AbsProjectiveScheme{<:Any, <:MPolyDecRing}) print(io, ltx["\\^$d"]) end print(io, " over ") - print(IOContext(io, :supercompact => true), Lowercase(), base_ring(P)) + print(terse(io), Lowercase(), base_ring(P)) else print(io, "Projective $(relative_ambient_dimension(P))-space over ") - print(IOContext(io, :supercompact => true), Lowercase(), base_ring(P)) + print(terse(io), Lowercase(), base_ring(P)) c = homogeneous_coordinates(P) print(io, " with coordinate") length(c) != 1 && print(io, "s") diff --git a/src/AlgebraicGeometry/Schemes/ProjectiveVariety/Objects/Methods.jl b/src/AlgebraicGeometry/Schemes/ProjectiveVariety/Objects/Methods.jl index 250ac46d5c8..8e382c2bddd 100644 --- a/src/AlgebraicGeometry/Schemes/ProjectiveVariety/Objects/Methods.jl +++ b/src/AlgebraicGeometry/Schemes/ProjectiveVariety/Objects/Methods.jl @@ -12,7 +12,7 @@ end # one line printing function Base.show(io::IO, X::AbsProjectiveVariety{<:Field,<:MPolyQuoRing}) - if get(io, :supercompact, false) + if is_terse(io) print(io, "Projective variety") elseif get_attribute(X, :is_empty, false) print(io, "Empty projective variety") diff --git a/src/Combinatorics/EnumerativeCombinatorics/tableaux.jl b/src/Combinatorics/EnumerativeCombinatorics/tableaux.jl index 65af5b0e59e..17c1e9e8e35 100644 --- a/src/Combinatorics/EnumerativeCombinatorics/tableaux.jl +++ b/src/Combinatorics/EnumerativeCombinatorics/tableaux.jl @@ -57,7 +57,6 @@ young_tableau(v::Vector{Vector{T}}; check::Bool = true) where T <: IntegerUnion data(tab::YoungTableau) = tab.t -# supercompact and one-line printing function Base.show(io::IO, tab::YoungTableau) print(io, "Young tableau") # TODO: is there meaningful information to add in one-line mode? diff --git a/src/Combinatorics/EnumerativeCombinatorics/weak_compositions.jl b/src/Combinatorics/EnumerativeCombinatorics/weak_compositions.jl index be5f878fef1..ecfb149a70e 100644 --- a/src/Combinatorics/EnumerativeCombinatorics/weak_compositions.jl +++ b/src/Combinatorics/EnumerativeCombinatorics/weak_compositions.jl @@ -177,7 +177,7 @@ function Base.iterate(W::WeakCompositions{T}, s::Vector{T}) where T end function Base.show(io::IO, W::WeakCompositions) - if get(io, :supercompact, false) + if is_terse(io) print(io, "Iterator") else io = pretty(io) diff --git a/src/Combinatorics/Graphs/functions.jl b/src/Combinatorics/Graphs/functions.jl index bc668c2c199..44501f9d365 100644 --- a/src/Combinatorics/Graphs/functions.jl +++ b/src/Combinatorics/Graphs/functions.jl @@ -1075,7 +1075,7 @@ function Base.show(io::IO, ::MIME"text/plain", G::Graph{T}) where {T <: Union{Po end function Base.show(io::IO, G::Graph{T}) where {T <: Union{Polymake.Directed, Polymake.Undirected}} - if get(io, :supercompact, false) + if is_terse(io) print(io, "$(_to_string(T)) graph") else print(io, "$(_to_string(T)) graph with $(n_vertices(G)) nodes and $(n_edges(G)) edges") diff --git a/src/Groups/GAPGroups.jl b/src/Groups/GAPGroups.jl index e3f0cf7d15b..ec096929ce0 100644 --- a/src/Groups/GAPGroups.jl +++ b/src/Groups/GAPGroups.jl @@ -265,7 +265,7 @@ function Base.show(io::IO, G::GAPGroup) @show_name(io, G) @show_special(io, G) print(io, "Group") - if !get(io, :supercompact, false) + if !is_terse(io) if has_order(G) if is_finite(G) print(io, " of order ", order(G)) @@ -281,12 +281,12 @@ function Base.show(io::IO, G::FPGroup) @show_special(io, G) if GAPWrap.IsFreeGroup(GapObj(G)) print(io, "Free group") - if !get(io, :supercompact, false) && GAP.Globals.HasRankOfFreeGroup(GapObj(G))::Bool + if !is_terse(io) && GAP.Globals.HasRankOfFreeGroup(GapObj(G))::Bool print(io, " of rank ", GAP.Globals.RankOfFreeGroup(GapObj(G))::Int) end else print(io, "Finitely presented group") # FIXME: actually some of these groups are *not* finitely presented - if !get(io, :supercompact, false) + if !is_terse(io) if has_order(G) if is_finite(G) print(io, " of order ", order(G)) @@ -312,7 +312,7 @@ function Base.show(io::IO, G::PermGroup) print(io, LowercaseOff(), "Alt(", degree(G), ")") else print(io, "Permutation group") - if !get(io, :supercompact, false) + if !is_terse(io) print(io, " of degree ", degree(G)) if has_order(G) if is_finite(G) @@ -334,7 +334,7 @@ function Base.show(io::IO, G::PcGroup) @show_name(io, G) @show_special(io, G) print(io, "Pc group") - if !get(io, :supercompact, false) + if !is_terse(io) if isfinite(G) print(io, " of order ", order(G)) else @@ -566,7 +566,7 @@ function Base.show(io::IO, ::MIME"text/plain", x::GAPGroupConjClass) end function Base.show(io::IO, x::GAPGroupConjClass{T, S}) where T where S - if get(io, :supercompact, false) + if is_terse(io) if S <: GAPGroupElem print(io, "Conjugacy class of group elements") else @@ -575,7 +575,7 @@ function Base.show(io::IO, x::GAPGroupConjClass{T, S}) where T where S else print(io, "Conjugacy class of ") io = pretty(io) - print(IOContext(io, :supercompact => true), Lowercase(), x.repr, " in ", Lowercase(), acting_group(x)) + print(terse(io), Lowercase(), x.repr, " in ", Lowercase(), acting_group(x)) end end diff --git a/src/Groups/cosets.jl b/src/Groups/cosets.jl index 827eaeb7963..02e135e62eb 100644 --- a/src/Groups/cosets.jl +++ b/src/Groups/cosets.jl @@ -39,12 +39,12 @@ end function Base.show(io::IO, x::GroupCoset) side = x.side === :left ? "Left" : "Right" - if get(io, :supercompact, false) + if is_terse(io) print(io, "$side coset of a group") else print(io, "$side coset of ") io = pretty(io) - print(IOContext(io, :supercompact => true), Lowercase(), x.H, " with representative ", x.repr) + print(terse(io), Lowercase(), x.H, " with representative ", x.repr) end end @@ -329,12 +329,12 @@ end function Base.show(io::IO, x::SubgroupTransversal) side = x.side === :left ? "Left" : "Right" - if get(io, :supercompact, false) + if is_terse(io) print(io, "$side transversal of groups") else print(io, "$side transversal of ") io = pretty(io) - print(IOContext(io, :supercompact => true), Lowercase(), x.H, " in ", Lowercase(), x.G) + print(terse(io), Lowercase(), x.H, " in ", Lowercase(), x.G) end end @@ -480,12 +480,12 @@ function Base.show(io::IO, ::MIME"text/plain", x::GroupDoubleCoset) end function Base.show(io::IO, x::GroupDoubleCoset) - if get(io, :supercompact, false) + if is_terse(io) print(io, "Double coset of a group") else print(io, "Double coset of ") io = pretty(io) - print(IOContext(io, :supercompact => true), Lowercase(), x.H, + print(terse(io), Lowercase(), x.H, " and ", Lowercase(), x.K, " with representative ", x.repr) end end diff --git a/src/Groups/group_characters.jl b/src/Groups/group_characters.jl index 8a42a8da4f5..427a3ed3ff2 100644 --- a/src/Groups/group_characters.jl +++ b/src/Groups/group_characters.jl @@ -625,17 +625,14 @@ function matrix_of_strings(tbl::GAPGroupCharacterTable; alphabet::String = "", r return (m, legend) end -# supercompact and one-line printing function Base.show(io::IO, tbl::GAPGroupCharacterTable) - if get(io, :supercompact, false) - # no nested printing + if is_terse(io) if characteristic(tbl) == 0 print(io, "character table of a group") else print(io, "$(characteristic(tbl))-modular Brauer table of a group") end else - # nested printing allowed, preferably supercompact if isdefined(tbl, :group) if characteristic(tbl) == 0 print(io, "character table of ") @@ -643,7 +640,7 @@ function Base.show(io::IO, tbl::GAPGroupCharacterTable) print(io, "$(characteristic(tbl))-modular Brauer table of ") end io = pretty(io) - print(IOContext(io, :supercompact => true), Lowercase(), group(tbl)) + print(terse(io), Lowercase(), group(tbl)) elseif characteristic(tbl) == 0 print(io, "character table of ", identifier(tbl)) else diff --git a/src/Groups/gsets.jl b/src/Groups/gsets.jl index e973645744f..a81bfa3074b 100644 --- a/src/Groups/gsets.jl +++ b/src/Groups/gsets.jl @@ -60,12 +60,12 @@ function Base.show(io::IO, ::MIME"text/plain", x::GSetByElements) end function Base.show(io::IO, x::GSetByElements) - if get(io, :supercompact, false) + if is_terse(io) print(io, "G-set") else print(io, "G-set of ") io = pretty(io) - print(IOContext(io, :supercompact => true), Lowercase(), x.group, " with seeds ", x.seeds) + print(terse(io), Lowercase(), x.group, " with seeds ", x.seeds) end end @@ -541,12 +541,12 @@ end function Base.show(io::IO, x::GSetBySubgroupTransversal) side = (x.side == :right ? "Right" : "Left") - if get(io, :supercompact, false) + if is_terse(io) print(io, "$side cosets of groups") else print(io, "$side cosets of ") io = pretty(io) - print(IOContext(io, :supercompact => true), Lowercase(), x.subgroup, " in ", Lowercase(), x.group) + print(terse(io), Lowercase(), x.subgroup, " in ", Lowercase(), x.group) end end diff --git a/src/Groups/homomorphisms.jl b/src/Groups/homomorphisms.jl index 95b21f18979..0c02cfef444 100644 --- a/src/Groups/homomorphisms.jl +++ b/src/Groups/homomorphisms.jl @@ -1,10 +1,10 @@ function Base.show(io::IO, x::GAPGroupHomomorphism) - if get(io, :supercompact, false) + if is_terse(io) print(io, "Group homomorphism") else io = pretty(io) print(io, "Hom: ") - print(IOContext(io, :supercompact => true), Lowercase(), domain(x), " -> ", Lowercase(), codomain(x)) + print(terse(io), Lowercase(), domain(x), " -> ", Lowercase(), codomain(x)) end end diff --git a/src/Groups/matrices/MatGrp.jl b/src/Groups/matrices/MatGrp.jl index 439147c289a..63dd8301e45 100644 --- a/src/Groups/matrices/MatGrp.jl +++ b/src/Groups/matrices/MatGrp.jl @@ -118,7 +118,7 @@ function _print_matrix_group_desc(io::IO, x::MatrixGroup) elseif x.ring isa Field && is_finite(x.ring) print(io, order(x.ring),")") else - print(IOContext(io, :supercompact => true), x.ring) + print(terse(io), x.ring) print(io ,")") end end @@ -137,10 +137,10 @@ function Base.show(io::IO, x::MatrixGroup) @show_special(io, x) isdefined(x, :descr) && return _print_matrix_group_desc(io, x) print(io, "Matrix group") - if !get(io, :supercompact, false) + if !is_terse(io) print(io, " of degree ", degree(x)) io = pretty(io) - print(IOContext(io, :supercompact => true), " over ", Lowercase(), base_ring(x)) + print(terse(io), " over ", Lowercase(), base_ring(x)) end end diff --git a/src/InvariantTheory/invariant_rings.jl b/src/InvariantTheory/invariant_rings.jl index fe7fee51758..478438222f4 100644 --- a/src/InvariantTheory/invariant_rings.jl +++ b/src/InvariantTheory/invariant_rings.jl @@ -138,12 +138,12 @@ function Base.show(io::IO, ::MIME"text/plain", RG::FinGroupInvarRing) end function Base.show(io::IO, RG::FinGroupInvarRing) - if get(io, :supercompact, false) + if is_terse(io) print(io, "Invariant ring") else io = pretty(io) print(io, "Invariant ring of ") - print(IOContext(io, :supercompact => true), Lowercase(), group(RG)) + print(terse(io), Lowercase(), group(RG)) end end diff --git a/src/InvariantTheory/iterators.jl b/src/InvariantTheory/iterators.jl index d4da8c6d3a9..eef9e028a73 100644 --- a/src/InvariantTheory/iterators.jl +++ b/src/InvariantTheory/iterators.jl @@ -91,12 +91,12 @@ function Base.show(io::IO, ::MIME"text/plain", AM::AllMonomials) end function Base.show(io::IO, AM::AllMonomials) - if get(io, :supercompact, false) + if is_terse(io) print(io, "Iterator") else io = pretty(io) print(io, "Iterator over the monomials of degree $(AM.d) of") - print(IOContext(io, :supercompact => true), Lowercase(), AM.R) + print(terse(io), Lowercase(), AM.R) end end @@ -405,12 +405,12 @@ function Base.show(io::IO, ::MIME"text/plain", BI::FinGroupInvarRingBasisIterato end function Base.show(io::IO, BI::FinGroupInvarRingBasisIterator) - if get(io, :supercompact, false) + if is_terse(io) print(io, "Iterator") else io = pretty(io) print(io, "Iterator over a graded component of ") - print(IOContext(io, :supercompact => true), Lowercase(), BI.R) + print(terse(io), Lowercase(), BI.R) end end diff --git a/src/Rings/MPolyMap/MPolyAnyMap.jl b/src/Rings/MPolyMap/MPolyAnyMap.jl index e8a67a18228..784727bccc0 100644 --- a/src/Rings/MPolyMap/MPolyAnyMap.jl +++ b/src/Rings/MPolyMap/MPolyAnyMap.jl @@ -82,7 +82,7 @@ _images(f::MPolyAnyMap) = f.img_gens ################################################################################ function Base.show(io::IO, ::MIME"text/plain", f::MPolyAnyMap) io = pretty(io) - println(IOContext(io, :supercompact => true), f) + println(terse(io), f) print(io, Indent()) println(io, "from ", Lowercase(), domain(f)) println(io, "to ", Lowercase(), codomain(f)) @@ -104,14 +104,12 @@ end function Base.show(io::IO, f::MPolyAnyMap) io = pretty(io) - if get(io, :supercompact, false) - # no nested printing + if is_terse(io) print(io, "Ring homomorphism") else - # nested printing allowed, preferably supercompact print(io, "Hom: ") - print(IOContext(io, :supercompact => true), Lowercase(), domain(f), " -> ") - print(IOContext(io, :supercompact => true), Lowercase(), codomain(f)) + print(terse(io), Lowercase(), domain(f), " -> ") + print(terse(io), Lowercase(), codomain(f)) end end diff --git a/src/Rings/MPolyQuo.jl b/src/Rings/MPolyQuo.jl index 24ad06baf7c..c3b019cd1d0 100644 --- a/src/Rings/MPolyQuo.jl +++ b/src/Rings/MPolyQuo.jl @@ -51,7 +51,7 @@ end function Base.show(io::IO, Q::MPolyQuoRing) @show_name(io, Q) @show_special(io, Q) - if get(io, :supercompact, false) + if is_terse(io) # no nested printing print(io, "Quotient of multivariate polynomial ring") else diff --git a/src/Rings/localization_interface.jl b/src/Rings/localization_interface.jl index 463b85b56ec..ee1b5a1b2e5 100644 --- a/src/Rings/localization_interface.jl +++ b/src/Rings/localization_interface.jl @@ -414,7 +414,7 @@ end function Base.show(io::IO, W::AbsLocalizedRing) io = pretty(io) - if get(io, :supercompact, false) + if is_terse(io) print(io, "Localized ring") else print(io, "Localization of ", Lowercase(), base_ring(W)) diff --git a/src/Rings/mpoly-graded.jl b/src/Rings/mpoly-graded.jl index 42e0267e23f..2a81d22a79b 100644 --- a/src/Rings/mpoly-graded.jl +++ b/src/Rings/mpoly-graded.jl @@ -85,15 +85,13 @@ function Base.show(io::IO, W::MPolyDecRing) Hecke.@show_name(io, W) Hecke.@show_special(io, W) io = pretty(io) - if get(io, :supercompact, false) - # no nested printing + if is_terse(io) if is_filtered(W) print(io, "Filtered multivariate polynomial ring") else print(io, "Graded multivariate polynomial ring") end else - # nested printing allowed, preferably supercompact R = forget_decoration(W) if is_filtered(W) print(io, "Filtered ", Lowercase(), R) diff --git a/src/Rings/mpoly-localizations.jl b/src/Rings/mpoly-localizations.jl index c64ce0297e6..d04ff7259f4 100644 --- a/src/Rings/mpoly-localizations.jl +++ b/src/Rings/mpoly-localizations.jl @@ -60,8 +60,7 @@ function Base.show(io::IO, ::MIME"text/plain", S::MPolyPowersOfElement) end function Base.show(io::IO, S::MPolyPowersOfElement) - # no need for supercompact printing - if get(io, :supercompact, false) + if is_terse(io) print(io, "Products of ") print(io, ItemQuantity(length(denominators(S)), "element")) else @@ -207,7 +206,7 @@ function Base.show(io::IO, ::MIME"text/plain", S::MPolyComplementOfPrimeIdeal) end function Base.show(io::IO, S::MPolyComplementOfPrimeIdeal) - if get(io, :supercompact, false) + if is_terse(io) print(io, "Complement of prime ideal") else io = pretty(io) @@ -360,7 +359,7 @@ function Base.show(io::IO, ::MIME"text/plain", S::MPolyComplementOfKPointIdeal) end function Base.show(io::IO, S::MPolyComplementOfKPointIdeal) - if get(io, :supercompact, false) + if is_terse(io) print(io, "Complement of maximal ideal") else print(io, "Complement of maximal ideal of point ") @@ -436,12 +435,12 @@ end function Base.show(io::IO, S::MPolyProductOfMultSets) io = pretty(io) - if get(io, :supercompact, false) + if is_terse(io) print(io, "Product of multiplicatively closed subsets") else print(io, "Product of the multiplicative subsets [") for s in sets(S) - print(IOContext(io, :supercompact=>true), Lowercase(), s) + print(terse(io), Lowercase(), s) s !== last(sets(S)) && print(io, ", ") end print(io, "]") @@ -496,11 +495,11 @@ end function Base.show(io::IO, S::MPolyLeadingMonOne) io = pretty(io) - if get(io, :supercompact, false) + if is_terse(io) print(io, "Elements with leading monomial 1") else print(io, "Elements with leading monomial 1 w.r.t. ") - print(IOContext(io, :supercompact=>true), ordering(S)) + print(terse(io), ordering(S)) end end @@ -2297,7 +2296,7 @@ julia> (PSI, ) """ function Base.show(io::IO, ::MIME"text/plain", phi::MPolyLocalizedRingHom) io = pretty(io) - println(IOContext(io, :supercompact => true), phi) + println(terse(io), phi) print(io, Indent()) println(io, "from ", Lowercase(), domain(phi)) println(io, "to ", Lowercase(), codomain(phi)) @@ -2314,13 +2313,13 @@ function Base.show(io::IO, ::MIME"text/plain", phi::MPolyLocalizedRingHom) end function Base.show(io::IO, phi::MPolyLocalizedRingHom) - if get(io, :supercompact, false) + if is_terse(io) print(io, "Ring homomorphism") else R = base_ring(domain(phi)) psi = restricted_map(phi) io = pretty(io) - io = IOContext(io, :supercompact=>true) + io = terse(io) print(io, "hom: ", domain(phi)) if is_unicode_allowed() print(io, " → ") diff --git a/src/Rings/mpolyquo-localizations.jl b/src/Rings/mpolyquo-localizations.jl index 3a1318d3336..53737bb8f85 100644 --- a/src/Rings/mpolyquo-localizations.jl +++ b/src/Rings/mpolyquo-localizations.jl @@ -220,10 +220,10 @@ function Base.show(io::IO, ::MIME"text/plain", L::MPolyQuoLocRing) end function Base.show(io::IO, L::MPolyQuoLocRing) - if get(io, :supercompact, false) + if is_terse(io) print(io, "Localized quotient of multivariate polynomial ring") else - io = IOContext(pretty(io), :supercompact=>true) + io = terse(pretty(io)) print(io, "Localization of ") print(io, Lowercase(), underlying_quotient(L)) print(io, " at ", Lowercase(), inverted_set(L)) @@ -1173,7 +1173,7 @@ end ### printing function Base.show(io::IO, ::MIME"text/plain", phi::MPolyQuoLocalizedRingHom) io = pretty(io) - println(IOContext(io, :supercompact => true), phi) + println(terse(io), phi) print(io, Indent()) println(io, "from ", Lowercase(), domain(phi)) println(io, "to ", Lowercase(), codomain(phi)) @@ -1190,13 +1190,13 @@ function Base.show(io::IO, ::MIME"text/plain", phi::MPolyQuoLocalizedRingHom) end function Base.show(io::IO, phi::MPolyQuoLocalizedRingHom) - if get(io, :supercompact, false) + if is_terse(io) print(io, "Ring homomorphism") else R = base_ring(domain(phi)) psi = restricted_map(phi) io = pretty(io) - io = IOContext(io, :supercompact=>true) + io = terse(io) print(io, "hom: ", domain(phi)) if is_unicode_allowed() print(io, " → ") @@ -1915,7 +1915,7 @@ function _get_generators_string_one_line(I::MPolyAnyIdeal, character_limit::Int end function Base.show(io::IO, I::MPolyAnyIdeal) - if get(io, :supercompact, false) + if is_terse(io) print(io, "Ideal") else print(io, "Ideal ", _get_generators_string_one_line(I)) diff --git a/src/imports.jl b/src/imports.jl index 19211835d0d..70773c6e274 100644 --- a/src/imports.jl +++ b/src/imports.jl @@ -86,6 +86,7 @@ import AbstractAlgebra: Ideal, Indent, is_finite_order, + is_terse, is_trivial, is_unicode_allowed, Lowercase, @@ -113,6 +114,7 @@ import AbstractAlgebra: set_attribute!, SetMap, symbols, + terse, total_degree, with_unicode diff --git a/test/Groups/group_characters.jl b/test/Groups/group_characters.jl index 71a0a1592a6..e9ae2263853 100644 --- a/test/Groups/group_characters.jl +++ b/test/Groups/group_characters.jl @@ -50,18 +50,18 @@ julia> show([t_a5_2]) Oscar.GAPGroupCharacterTable[2-modular Brauer table of A5] ``` -supercompact printing +terse printing ```jldoctest group_characters.test -julia> print(IOContext(stdout, :supercompact => true), t_a4) +julia> print(AbstractAlgebra.terse(stdout), t_a4) character table of a group -julia> print(IOContext(stdout, :supercompact => true), t_a5) +julia> print(AbstractAlgebra.terse(stdout), t_a5) character table of a group -julia> print(IOContext(stdout, :supercompact => true), t_a4_2) +julia> print(AbstractAlgebra.terse(stdout), t_a4_2) 2-modular Brauer table of a group -julia> print(IOContext(stdout, :supercompact => true), t_a5_2) +julia> print(AbstractAlgebra.terse(stdout), t_a5_2) 2-modular Brauer table of a group ``` From 17b6d4337274f7f779ede3f69ae45d79b8e46beb Mon Sep 17 00:00:00 2001 From: Johannes Schmitt Date: Tue, 7 May 2024 11:35:24 +0200 Subject: [PATCH 6/7] Compositions from JuLie (#3682) * Get compositions from JuLie in * Move `ascending_partitions` to `ascending_compositions` * Provide an 'inplace' version of the weak compositions iterator * Fix doc and format * Export `Composition` and `WeakComposition`. Add docstrings. --- docs/doc.main | 1 + docs/oscar_references.bib | 11 - .../EnumerativeCombinatorics/compositions.md | 37 ++ .../EnumerativeCombinatorics/README.md | 4 - .../src/EnumerativeCombinatorics.jl | 149 ------- .../EnumerativeCombinatorics/test/runtests.jl | 16 - src/Combinatorics/Compositions.jl | 15 - .../EnumerativeCombinatorics.jl | 1 + .../EnumerativeCombinatorics/compositions.jl | 376 ++++++++++++++++++ .../EnumerativeCombinatorics/types.jl | 131 +++++- .../weak_compositions.jl | 59 ++- src/InvariantTheory/types.jl | 8 +- src/Oscar.jl | 1 - src/aliases.jl | 2 + src/exports.jl | 6 + test/Combinatorics/Compositions.jl | 11 - .../EnumerativeCombinatorics/compositions.jl | 59 +++ 17 files changed, 632 insertions(+), 255 deletions(-) create mode 100644 docs/src/Combinatorics/EnumerativeCombinatorics/compositions.md delete mode 100644 experimental/EnumerativeCombinatorics/README.md delete mode 100644 experimental/EnumerativeCombinatorics/src/EnumerativeCombinatorics.jl delete mode 100644 experimental/EnumerativeCombinatorics/test/runtests.jl delete mode 100644 src/Combinatorics/Compositions.jl create mode 100644 src/Combinatorics/EnumerativeCombinatorics/compositions.jl delete mode 100644 test/Combinatorics/Compositions.jl create mode 100644 test/Combinatorics/EnumerativeCombinatorics/compositions.jl diff --git a/docs/doc.main b/docs/doc.main index 0f280083a9e..e5aee7cb591 100644 --- a/docs/doc.main +++ b/docs/doc.main @@ -249,6 +249,7 @@ "Combinatorics/EnumerativeCombinatorics/partitions.md", "Combinatorics/EnumerativeCombinatorics/tableaux.md", "Combinatorics/EnumerativeCombinatorics/schur_polynomials.md", + "Combinatorics/EnumerativeCombinatorics/compositions.md", ], ], diff --git a/docs/oscar_references.bib b/docs/oscar_references.bib index 7e6c3a503d6..c7529ae38e0 100644 --- a/docs/oscar_references.bib +++ b/docs/oscar_references.bib @@ -1582,17 +1582,6 @@ @Book{Mar18 doi = {10.1007/978-3-319-90233-3} } -@Article{Mer12, - author = {Merca, M}, - title = {Fast algorithm for generating ascending compositions}, - journal = {J. Math. Model. Algorithms}, - volume = {11}, - number = {1}, - pages = {89--104}, - year = {2012}, - doi = {10.1007/s10852-011-9168-y} -} - @Article{Nik79, author = {Nikulin, V. V.}, title = {Integer symmetric bilinear forms and some of their geometric applications}, diff --git a/docs/src/Combinatorics/EnumerativeCombinatorics/compositions.md b/docs/src/Combinatorics/EnumerativeCombinatorics/compositions.md new file mode 100644 index 00000000000..bd69e02559d --- /dev/null +++ b/docs/src/Combinatorics/EnumerativeCombinatorics/compositions.md @@ -0,0 +1,37 @@ +# Compositions + +A **weak composition** of a non-negative integer $n$ is a sequence $\lambda_1,\dots,\lambda_k$ of non-negative integers $\lambda_i$ such that $n = \lambda_1 + \dots + \lambda_k$. +A **composition** of $n$ is a weak composition consisting of *positive* integers. +The $\lambda_i$ are called the **parts** of the (weak) composition. + +```@docs +weak_composition +composition +``` + +## Generating and counting + +### Unrestricted compositions +```@docs +compositions(::Oscar.IntegerUnion) +number_of_compositions(::Oscar.IntegerUnion) +``` +Note that an integer $n$ has infinitely many weak compositions as one may always append zeros to the end of a given weak composition. +Without restrictions on the number of parts, we can hence only generate compositions, but not weak compositions. + +### Restricted compositions +```@docs +compositions(::Oscar.IntegerUnion, ::Oscar.IntegerUnion) +number_of_compositions(::Oscar.IntegerUnion, ::Oscar.IntegerUnion) +``` +### Restricted weak compositions +```@docs +weak_compositions +number_of_weak_compositions(::Oscar.IntegerUnion, ::Oscar.IntegerUnion) +``` + +### Ascending compositions +```@docs +ascending_compositions +``` +The number of ascending compositions of $n$ coincides with the number of partitions of $n$. diff --git a/experimental/EnumerativeCombinatorics/README.md b/experimental/EnumerativeCombinatorics/README.md deleted file mode 100644 index 8310bf1885b..00000000000 --- a/experimental/EnumerativeCombinatorics/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# Enumerative combinatorics - -This experimental package contains "left-overs" from the former JuLie package which were not deemed ready for `src` yet. -See the discussion in https://github.com/oscar-system/Oscar.jl/pull/3159 . diff --git a/experimental/EnumerativeCombinatorics/src/EnumerativeCombinatorics.jl b/experimental/EnumerativeCombinatorics/src/EnumerativeCombinatorics.jl deleted file mode 100644 index e030e8c5fe8..00000000000 --- a/experimental/EnumerativeCombinatorics/src/EnumerativeCombinatorics.jl +++ /dev/null @@ -1,149 +0,0 @@ -# TODO: ascending_partitions should be renamed to ascending_compositions -# according to U. Thiel, see the discussion -# https://github.com/oscar-system/Oscar.jl/pull/3159#discussion_r1446198249 -@doc raw""" - ascending_partitions(n::IntegerUnion; algorithm::Symbol=:ks) - -Instead of encoding a partition of an integer ``n ≥ 0`` as a *descending* -sequence (which is our convention), one can also encode it as an *ascending* -sequence. In the papers Kelleher & O'Sullivan (2014) and Merca (2012) it is -said that generating the list of all ascending partitions is more efficient -than generating descending ones. To test this, we have implemented the -algorithms given in the papers: -1. `:ks` (*default*) is the algorithm "AccelAsc" (Algorithm 4.1) in [KO14](@cite). -2. `:m` is Algorithm 6 in [Mer12](@cite). This is actually similar to `:ks`. - -The ascending partitions are stored here as arrays and are not of type -`Partition` since the latter are descending by our convention. We are using `:ks` -as default since it looks slicker. - -# Comparison - -We don't see a significant speed difference to the descending encoding: -```julia-repl -julia> @btime partitions(Int8(90)); -3.376 s (56634200 allocations: 6.24 GiB) - -julia> @btime ascending_partitions(Int8(90), algorithm=:ks); -3.395 s (56634200 allocations: 6.24 GiB) - -julia> @btime ascending_partitions(Int8(90), algorithm=:m); -3.451 s (56634200 allocations: 6.24 GiB) -``` -""" -function ascending_partitions(n::IntegerUnion; algorithm::Symbol=:ks) - if algorithm === :ks - return ascending_partitions_kelleher_osullivan(n) - elseif algorithm === :m - return ascending_partitions_merca(n) - else - error("algorithm must be either :ks or :m") - end -end - -function ascending_partitions_kelleher_osullivan(n::T) where {T <: IntegerUnion} - #Argument checking - @req n >= 0 "n >= 0 required" - - # Some trivial cases - if n==0 - return Vector{T}[ [] ] - elseif n==1 - return Vector{T}[ [1] ] - end - - # Now, the algorithm starts - P = Vector{T}[] #this will be the array of all partitions - a = zeros(T, n) - k = 2 - y = n-1 - while k != 1 - k -= 1 - x = a[k] + 1 - while 2*x <= y - a[k] = x - y -= x - k += 1 - end - l = k + 1 - while x <= y - a[k] = x - a[l] = y - push!(P, a[1:l]) - x += 1 - y -= 1 - end - y += x - 1 - a[k] = y + 1 - push!(P, a[1:k]) - end - return P -end - -function ascending_partitions_merca(n::T) where {T <: IntegerUnion} - #Argument checking - @req n >= 0 "n >= 0 required" - - # Some trivial cases - if n==0 - return Vector{T}[ [] ] - elseif n==1 - return Vector{T}[ [1] ] - end - - P = Vector{T}[] #this will be the array of all partitions - a = zeros(T, n) - k = 1 - x = 1 - y = n-1 - while true - while 3*x <= y - a[k] = x - y = y-x - k += 1 - end - t = k + 1 - u = k + 2 - while 2*x <= y - a[k] = x - a[t] = x - a[u] = y - x - push!(P, a[1:u]) - p = x + 1 - q = y - p - while p <= q - a[t] = p - a[u] = q - push!(P, a[1:u]) - p += 1 - q -= 1 - end - a[t] = y - push!(P, a[1:t]) - x += 1 - y -= 1 - end - while x<=y - a[k] = x - a[t] = y - push!(P, a[1:t]) - x += 1 - y -= 1 - end - y += x-1 - a[k] = y+1 - push!(P, a[1:k]) - k -= 1 - - # I think there's a mistake in the publication - # because here k could be zero and then we access - # a[k]. - # That's why I do a while true and check k > 0 here. - if k == 0 - break - else - x = a[k] + 1 - end - end - return P -end diff --git a/experimental/EnumerativeCombinatorics/test/runtests.jl b/experimental/EnumerativeCombinatorics/test/runtests.jl deleted file mode 100644 index ba2f3fb11df..00000000000 --- a/experimental/EnumerativeCombinatorics/test/runtests.jl +++ /dev/null @@ -1,16 +0,0 @@ -@testset "Ascending partitions" begin - for n in 0:20 - # go through all algorithms - for a in [ :ks, :m ] - P = Oscar.ascending_partitions(n,algorithm=a) - # check that number of partitions is correct - @test length(P) == number_of_partitions(n) - # check that all partitions are distinct - @test P == unique(P) - # check that partitions are really partitions of n - for lambda in P - @test sum(lambda) == n - end - end - end -end diff --git a/src/Combinatorics/Compositions.jl b/src/Combinatorics/Compositions.jl deleted file mode 100644 index 422e1ed0246..00000000000 --- a/src/Combinatorics/Compositions.jl +++ /dev/null @@ -1,15 +0,0 @@ -function compositions(n, k) - if k == 0 - return n == 0 ? [Int[]] : Vector{Int}[] - end - if n < k - return [] - end - compos = Vector{Int}[] - for i in 1:n - for p in compositions(n - i, k - 1) - push!(compos, [i; p]) - end - end - return compos -end diff --git a/src/Combinatorics/EnumerativeCombinatorics/EnumerativeCombinatorics.jl b/src/Combinatorics/EnumerativeCombinatorics/EnumerativeCombinatorics.jl index 5e0f2fcf92b..ff581ddbd67 100644 --- a/src/Combinatorics/EnumerativeCombinatorics/EnumerativeCombinatorics.jl +++ b/src/Combinatorics/EnumerativeCombinatorics/EnumerativeCombinatorics.jl @@ -3,3 +3,4 @@ include("partitions.jl") include("schur_polynomials.jl") include("tableaux.jl") include("weak_compositions.jl") +include("compositions.jl") diff --git a/src/Combinatorics/EnumerativeCombinatorics/compositions.jl b/src/Combinatorics/EnumerativeCombinatorics/compositions.jl new file mode 100644 index 00000000000..a72ad256ea3 --- /dev/null +++ b/src/Combinatorics/EnumerativeCombinatorics/compositions.jl @@ -0,0 +1,376 @@ +################################################################################ +# Compositions of an integer. +# +# Copyright (C) 2021 Ulrich Thiel, ulthiel.com/math +# +# Originally taken from the JuLie [repository](https://github.com/ulthiel/JuLie) +################################################################################ + +################################################################################ +# +# Constructors and basic functionality +# +################################################################################ + +data(C::Composition) = C.c + +@doc raw""" + composition(parts::Vector{T}; check::Bool = true) where T <: IntegerUnion + +Return the composition given by the integer sequence `parts` as an object of +type `Composition{T}`. + +If `check` is `true` (default), it is checked whether the given sequence defines +a composition, that is, whether all elements of `parts` are positive. + +# Examples +```jldoctest +julia> C = composition([6, 1, 2, 3]) # the composition 6, 1, 2, 3 of 12 +[6, 1, 2, 3] + +julia> C = composition(Int8[6, 1, 2, 3]) # save the elements in 8-bit integers +Int8[6, 1, 2, 3] +``` +""" +function composition(parts::Vector{T}; check::Bool = true) where {T <: IntegerUnion} + if check + @req all(x -> x > 0, parts) "The integers must be positive" + end + return Composition{T}(parts) +end + +function Base.show(io::IO, ::MIME"text/plain", C::Composition) + print(io, data(C)) +end + +################################################################################ +# +# Array-like functionality +# +################################################################################ + +function Base.size(C::Composition) + return size(data(C)) +end + +function Base.length(C::Composition) + return length(data(C)) +end + +function Base.getindex(C::Composition, i::IntegerUnion) + return getindex(data(C), Int(i)) +end + +function Base.setindex!(C::Composition, x::IntegerUnion, i::IntegerUnion) + return setindex!(data(C), x, Int(i)) +end + +function Base.copy(C::Composition{T}) where T<:IntegerUnion + return Composition{T}(copy(data(C))) +end + +################################################################################ +# +# Number of compositions +# +################################################################################ + +@doc raw""" + number_of_compositions(n::IntegerUnion, k::IntegerUnion) + +Return the number of compositions of the non-negative integer `n` into `k >= 0` +parts. +If `n < 0` or `k < 0`, return `0`. +""" +function number_of_compositions(n::IntegerUnion, k::IntegerUnion) + if n < 0 || k < 0 + return ZZ(0) + end + + if n == 0 + if k == 0 + return ZZ(1) + else + return ZZ(0) + end + else + return binomial(ZZ(n - 1), ZZ(k - 1)) + end +end + +@doc raw""" + number_of_compositions(n::IntegerUnion) + +Return the number of compositions of the non-negative integer `n`. +For `n < 0`, return `0`. +""" +function number_of_compositions(n::IntegerUnion) + if n < 0 + return ZZ(0) + elseif n == 0 + return ZZ(1) + else + return ZZ(2)^(n - 1) + end +end + +################################################################################ +# +# Generating compositions with fixed number of parts +# +################################################################################ + +@doc raw""" + compositions(n::IntegerUnion, k::IntegerUnion) + +Return an iterator over all compositions of a non-negative integer `n` into +`k` parts, produced in lexicographically *descending* order. + +By a composition of `n` into `k` parts we mean a sequence of `k` positive integers +whose sum is `n`. + +# Examples +```jldoctest +julia> C = compositions(4, 2) +Iterator over the compositions of 4 into 2 parts + +julia> collect(C) +3-element Vector{Composition{Int64}}: + [3, 1] + [2, 2] + [1, 3] +``` +""" +function compositions(n::IntegerUnion, k::IntegerUnion) + kk = Int(k) + return CompositionsFixedNumParts(n, kk) +end + +base(C::CompositionsFixedNumParts) = C.n +parts(C::CompositionsFixedNumParts) = C.k + +Base.eltype(C::CompositionsFixedNumParts{T}) where T = Composition{T} + +function Base.show(io::IO, C::CompositionsFixedNumParts) + if get(io, :supercompact, false) + print(io, "Iterator") + else + io = pretty(io) + print(io, "Iterator over the compositions of $(base(C)) into ", ItemQuantity(parts(C), "part")) + end +end + +Base.length(C::CompositionsFixedNumParts) = BigInt(number_of_compositions(base(C), parts(C))) + +function Base.iterate(C::CompositionsFixedNumParts{T}, state::Union{Nothing,Vector{T}}=nothing) where T + w = iterate(C.weak_comp_iter, state) + if w === nothing + return nothing + end + + # w[1] is a weak composition of n - k into k parts, we get a composition of n + # into k parts by adding 1 to every entry. + c = data(w[1]) + s = w[2] + for i in 1:length(c) + c[i] += 1 + end + + return composition(c, check=false), s +end + +################################################################################ +# +# Generating all compositions +# +################################################################################ + +@doc raw""" + compositions(n::IntegerUnion) + +Return an iterator over all compositions of a non-negative integer `n`. + +By a composition of `n` we mean a sequence of positive integers whose sum is `n`. + +# Examples +```jldoctest +julia> C = compositions(4) +Iterator over the compositions of 4 + +julia> collect(C) +8-element Vector{Composition{Int64}}: + [4] + [3, 1] + [2, 2] + [1, 3] + [2, 1, 1] + [1, 2, 1] + [1, 1, 2] + [1, 1, 1, 1] +``` +""" +function compositions(n::IntegerUnion) + return Compositions(n) +end + +base(C::Compositions) = C.n + +Base.eltype(C::Compositions{T}) where T = Composition{T} + +function Base.show(io::IO, C::Compositions) + if get(io, :supercompact, false) + print(io, "Iterator") + else + io = pretty(io) + print(io, "Iterator over the compositions of $(base(C))") + end +end + +Base.length(C::Compositions) = BigInt(number_of_compositions(base(C))) + +function iterate(C::Compositions, state::Nothing = nothing) + n = base(C) + + if n == 0 + # The only composition is the empty one + Ck = compositions(n, 0) + else + # There are no compositions of n > 0 into k == 0 parts, + # so we can start at 1 + Ck = compositions(n, 1) + end + next = iterate(Ck) + return next[1], (Ck, next[2]) +end + +function iterate(C::Compositions{T}, state::Tuple{CompositionsFixedNumParts{T}, Vector{T}}) where T <: IntegerUnion + n = base(C) + Ck = state[1] + Ck_state = state[2] + + next = iterate(Ck, Ck_state) + + if next !== nothing + return next[1], (Ck, next[2]) + else + k = parts(Ck) + if k == n + return nothing + else + k += 1 + Ck = compositions(n, k) + next = iterate(Ck) + return next[1], (Ck, next[2]) + end + end +end + +################################################################################ +# +# Ascending compositions +# +################################################################################ + +@doc raw""" + ascending_compositions(n::IntegerUnion) + +Return an iterator over all ascending compositions of a non-negative integer `n`. + +By a ascending composition of `n` we mean a non-decreasing sequence of positive +integers whose sum is `n`. + +The implemented algorithm is "AccelAsc" (Algorithm 4.1) in [KO14](@cite). + +# Examples +```jldoctest +julia> C = ascending_compositions(4) +Iterator over the ascending compositions of 4 + +julia> collect(C) +5-element Vector{Composition{Int64}}: + [1, 1, 1, 1] + [1, 1, 2] + [1, 3] + [2, 2] + [4] +``` +""" +function ascending_compositions(n::IntegerUnion) + return AscendingCompositions(n) +end + +base(C::AscendingCompositions) = C.n + +Base.eltype(C::AscendingCompositions{T}) where T = Composition{T} + +function Base.show(io::IO, C::AscendingCompositions) + if get(io, :supercompact, false) + print(io, "Iterator") + else + io = pretty(io) + print(io, "Iterator over the ascending compositions of $(base(C))") + end +end + +# Ascending compositions are basically partitions turned around +Base.length(C::AscendingCompositions) = BigInt(number_of_partitions(base(C))) + +# Algorithm 4.1 in KO14 +function iterate(C::AscendingCompositions{T}, state::Union{Nothing,AscendingCompositionsState{T}}=nothing) where T + n = base(C) + + if isnothing(state) + state = AscendingCompositionsState{T}() + state.a = zeros(T, Int(n)) + state.k = 2 + state.y = n - 1 + state.x = T(0) + if n == 0 + state.k = 1 + return composition(T[]; check=false), state + elseif n == 1 + state.k = 1 + return composition([T(1)]; check=false), state + end + end + + a = state.a + k = state.k + y = state.y + x = state.x + + if x == 0 + if k == 1 + return nothing + end + + k -= 1 + x = a[k] + 1 + + while 2*x <= y + a[k] = x + y -= x + k += 1 + end + end + + l = k + 1 + if x <= y + a[k] = x + a[l] = y + x += 1 + y -= 1 + state.a = a + state.x = x + state.y = y + state.k = k + return composition(a[1:l]; check=false), state + end + y += x - 1 + a[k] = y + 1 + state.a = a + state.x = T(0) + state.y = y + state.k = k + return composition(a[1:k]; check=false), state +end diff --git a/src/Combinatorics/EnumerativeCombinatorics/types.jl b/src/Combinatorics/EnumerativeCombinatorics/types.jl index 8ef0d1ecb5e..fab763281fa 100644 --- a/src/Combinatorics/EnumerativeCombinatorics/types.jl +++ b/src/Combinatorics/EnumerativeCombinatorics/types.jl @@ -1,42 +1,153 @@ ################################################################################ # -# Partition +# WeakComposition # ################################################################################ -struct Partition{T<:IntegerUnion} <: AbstractVector{T} - p::Vector{T} +@doc raw""" + WeakComposition{T<:IntegerUnion} <: AbstractVector{T} + +A weak composition consisting of integers of type `T`. +This is a wrapper around `Vector{T}`. + +See [`weak_composition`](@ref) for the user-facing constructor and an example. +""" +struct WeakComposition{T<:IntegerUnion} <: AbstractVector{T} + c::Vector{T} +end + +# Iterator type: all weak compositions of n into k parts +struct WeakCompositions{T<:IntegerUnion} + n::T + k::Int # This is the length of the vectors, so cannot be larger than an Int + # and there is no performance benefit from making it an Int8 (for example) + inplace::Bool # Whether all generated compositions share the same array in + # memory + + function WeakCompositions(n::T, k::Int, inplace::Bool = false) where T<:IntegerUnion + @req n >= 0 "n >= 0 required" + @req k >= 0 "k >= 0 required" + return new{T}(n, k, inplace) + end end ################################################################################ # -# WeakComposition +# Composition # ################################################################################ -struct WeakComposition{T<:IntegerUnion} <: AbstractVector{T} +@doc raw""" + Composition{T<:IntegerUnion} <: AbstractVector{T} + +A composition consisting of integers of type `T`. +This is a wrapper around `Vector{T}`. + +See [`composition`](@ref) for the user-facing constructor and an example. +""" +struct Composition{T<:IntegerUnion} <: AbstractVector{T} c::Vector{T} end -# Iterator type: all weak compositions of n into k parts -struct WeakCompositions{T<:IntegerUnion} +# Iterator type: all compositions of n +struct Compositions{T<:IntegerUnion} + n::T + + function Compositions(n::T) where T<:IntegerUnion + @req n >= 0 "n >= 0 required" + return new{T}(n) + end +end + +# Iterator type: all compositions of n into k parts +struct CompositionsFixedNumParts{T<:IntegerUnion} n::T k::Int # This is the length of the vectors, so cannot be larger than an Int # and there is no performance benefit from making it an Int8 (for example) + weak_comp_iter::WeakCompositions{T} - function WeakCompositions(n::T, k::Int) where T<:IntegerUnion + function CompositionsFixedNumParts(n::T, k::Int) where T<:IntegerUnion @req n >= 0 "n >= 0 required" @req k >= 0 "k >= 0 required" - return new{T}(n, k) + + # We get a composition of n into k parts from a weak composition of n - k + # into k parts by adding 1 to every entry, so we may reuse the iterator + # for weak compositions here. If k > n, so n - k < 0, there are no + # compositions, but we have to cheat a bit to get an empty iterator + # for the weak compositions. + if k > n + # 1 does not have any weak compositions into 0 parts, so this will + # produce an empty iterator + nk = 1 + kk = 0 + else + nk = n - k + kk = k + end + return new{T}(n, k, weak_compositions(nk, kk)) + end +end + +################################################################################ +# +# Ascending composition +# +################################################################################ + +# Iterator type: all ascending compositions of n +struct AscendingCompositions{T<:IntegerUnion} + n::T + + function AscendingCompositions(n::T) where T<:IntegerUnion + @req n >= 0 "n >= 0 required" + return new{T}(n) + end +end + +# Internal type: state of the iterator +mutable struct AscendingCompositionsState{T<:IntegerUnion} + a::Vector{T} + x::T + y::T + k::Int + + function AscendingCompositionsState{T}() where {T<:IntegerUnion} + return new{T}() end end +################################################################################ +# +# Partition +# +################################################################################ + +@doc raw""" + Partition{T<:IntegerUnion} <: AbstractVector{T} + +A partition consisting of integers of type `T`. +This is a wrapper around `Vector{T}`. + +See [`partition`](@ref) for the user-facing constructor and an example. +""" +struct Partition{T<:IntegerUnion} <: AbstractVector{T} + p::Vector{T} +end + ################################################################################ # # Young Tableaux # ################################################################################ -struct YoungTableau{T} <: AbstractVector{AbstractVector{T}} +@doc raw""" + YoungTableau{T<:IntegerUnion} <: AbstractVector{AbstractVector{T}} + +A Young tableau filled with integers of type `T`. +This is a wrapper around `Vector{Vector{T}}`. + +See [`young_tableau`](@ref) for the user-facing constructor and an example. +""" +struct YoungTableau{T<:IntegerUnion} <: AbstractVector{AbstractVector{T}} t::Vector{Vector{T}} end diff --git a/src/Combinatorics/EnumerativeCombinatorics/weak_compositions.jl b/src/Combinatorics/EnumerativeCombinatorics/weak_compositions.jl index ecfb149a70e..c8782443a5e 100644 --- a/src/Combinatorics/EnumerativeCombinatorics/weak_compositions.jl +++ b/src/Combinatorics/EnumerativeCombinatorics/weak_compositions.jl @@ -86,16 +86,16 @@ julia> length(W) 4 julia> collect(W) -4-element Vector{Oscar.WeakComposition{Int64}}: +4-element Vector{WeakComposition{Int64}}: [3, 0] [2, 1] [1, 2] [0, 3] ``` """ -function weak_compositions(n::IntegerUnion, k::IntegerUnion) +function weak_compositions(n::IntegerUnion, k::IntegerUnion; inplace::Bool=false) kk = Int(k) - return WeakCompositions(n, kk) + return WeakCompositions(n, kk, inplace) end # I have no idea what to call these getter functions @@ -125,55 +125,42 @@ function Base.iterate(W::WeakCompositions{T}, state::Nothing = nothing) where T k = parts(W) if n == 0 s = zeros(T, k) - if k > 0 - s[k] = n + 1 - end - return (weak_composition(zeros(T, k), check = false), s) + c = W.inplace ? s : copy(s) + return weak_composition(c, check = false), s end if k == 0 return nothing end - c = zeros(T, k) - c[1] = n s = zeros(T, k) - if isone(k) - s[1] = n + 1 - return (weak_composition(c, check = false), s) - end - - s[1] = n - 1 - s[2] = 1 - return (weak_composition(c, check = false), s) + s[1] = n + c = W.inplace ? s : copy(s) + return weak_composition(c, check = false), s end function Base.iterate(W::WeakCompositions{T}, s::Vector{T}) where T n = base(W) k = parts(W) - if k == 0 || s[k] == n + 1 + if k == 0 || s[k] == n return nothing end - c = copy(s) - if s[k] == n - s[k] += 1 - return (weak_composition(c, check = false), s) + if s[k - 1] == 1 && s[k] == n - 1 + s[k - 1] = 0 + s[k] = n + c = W.inplace ? s : copy(s) + return weak_composition(c, check = false), s end - for i = k - 1:-1:1 - if !iszero(s[i]) - s[i] -= 1 - if i + 1 == k - s[k] += 1 - else - s[i + 1] = 1 - if !iszero(s[k]) - s[i + 1] += s[k] - s[k] = 0 - end - end - return (weak_composition(c, check = false), s) - end + i = findlast(!iszero, view(s, 1:(k - 1))) + @assert !isnothing(i) + + s[i] -= 1 + s[i + 1] = s[k] + 1 + if i + 1 != k + s[k] = 0 end + c = W.inplace ? s : copy(s) + return weak_composition(c, check = false), s end function Base.show(io::IO, W::WeakCompositions) diff --git a/src/InvariantTheory/types.jl b/src/InvariantTheory/types.jl index ad6818af7d6..8c7ff922157 100644 --- a/src/InvariantTheory/types.jl +++ b/src/InvariantTheory/types.jl @@ -133,7 +133,9 @@ struct AllMonomials{PolyRingT} function AllMonomials{PolyRingT}(R::PolyRingT, d::Int) where {PolyRingT} @assert d >= 0 - return new{PolyRingT}(R, d, weak_compositions(d, ngens(R)), true, ngens(R)) + return new{PolyRingT}( + R, d, weak_compositions(d, ngens(R); inplace=true), true, ngens(R) + ) end function AllMonomials{PolyRingT}( @@ -149,7 +151,9 @@ struct AllMonomials{PolyRingT} end tmp = zeros(Int, ngens(R)) - return new{PolyRingT}(R, d, weak_compositions(d, n_vars), false, n_vars, vars, tmp) + return new{PolyRingT}( + R, d, weak_compositions(d, n_vars; inplace=true), false, n_vars, vars, tmp + ) end end diff --git a/src/Oscar.jl b/src/Oscar.jl index 886e47d90e4..c4d402264c2 100644 --- a/src/Oscar.jl +++ b/src/Oscar.jl @@ -257,7 +257,6 @@ include("Combinatorics/Graphs/functions.jl") include("Combinatorics/SimplicialComplexes.jl") include("Combinatorics/OrderedMultiIndex.jl") include("Combinatorics/Matroids/JMatroids.jl") -include("Combinatorics/Compositions.jl") include("Combinatorics/EnumerativeCombinatorics/EnumerativeCombinatorics.jl") include("PolyhedralGeometry/visualization.jl") # needs SimplicialComplex diff --git a/src/aliases.jl b/src/aliases.jl index 6df64e51906..ad8da21d495 100644 --- a/src/aliases.jl +++ b/src/aliases.jl @@ -15,6 +15,7 @@ function n_polyhedra end function n_rays end function n_vertices end +function number_of_compositions end function number_of_partitions end function number_of_patches end function number_of_weak_compositions end @@ -36,6 +37,7 @@ function number_of_weak_compositions end @alias number_of_rays n_rays @alias number_of_vertices n_vertices +@alias n_compositions number_of_compositions @alias n_partitions number_of_partitions @alias n_patches number_of_patches @alias n_weak_compositions number_of_weak_compositions diff --git a/src/exports.jl b/src/exports.jl index fc11bce84d7..8cb857a8683 100644 --- a/src/exports.jl +++ b/src/exports.jl @@ -48,6 +48,7 @@ export BorcherdsCtx export ClosedEmbedding export ClosedSubvarietyOfToricVariety export CohomologyClass +export Composition export Cone export CoveredScheme export CoveredSchemeMorphism @@ -170,6 +171,7 @@ export TropicalSemiring, TropicalSemiringElem, tropical_semiring export TropicalSemiringMap, tropical_semiring_map export TropicalVariety export Undirected +export WeakComposition export WreathProductGroup export YoungTableau export ZZ @@ -248,6 +250,7 @@ export archimedean_solid export arithmetic_genus export as_dictionary export as_gset +export ascending_compositions export associahedron export atlas_description export atlas_group @@ -346,6 +349,8 @@ export collector export coloops export column export combinatorial_symmetries +export composition +export compositions export comm export comm! export common_components @@ -1084,6 +1089,7 @@ export normalizer export nullity export number_of_atlas_groups export number_of_complement_equations +export number_of_compositions export number_of_conjugacy_classes, has_number_of_conjugacy_classes, set_number_of_conjugacy_classes export number_of_factors export number_of_generators diff --git a/test/Combinatorics/Compositions.jl b/test/Combinatorics/Compositions.jl deleted file mode 100644 index 802935e9280..00000000000 --- a/test/Combinatorics/Compositions.jl +++ /dev/null @@ -1,11 +0,0 @@ -@testset "compositions" begin - compositions = Oscar.compositions - @test isempty(compositions(1, 0)) - @test length(compositions(0, 0)) == 1 - @test isempty(compositions(2, 3)) - @test [1, 2] in compositions(3, 2) - @test [2, 1] in compositions(3, 2) - @test [1, 3] in compositions(4, 2) - @test [2, 2] in compositions(4, 2) - @test [3, 1] in compositions(4, 2) -end diff --git a/test/Combinatorics/EnumerativeCombinatorics/compositions.jl b/test/Combinatorics/EnumerativeCombinatorics/compositions.jl new file mode 100644 index 00000000000..7a847f012d2 --- /dev/null +++ b/test/Combinatorics/EnumerativeCombinatorics/compositions.jl @@ -0,0 +1,59 @@ +@testset "compositions" begin + # Check some stupid cases + @test number_of_compositions(0, 0) == 1 + @test number_of_compositions(0, 1) == 0 + @test number_of_compositions(1, 0) == 0 + @test number_of_compositions(0) == 1 + + # First few number of compositions from https://oeis.org/A011782 + nums = [1, 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536, 131072, 262144, 524288, 1048576, 2097152, 4194304, 8388608, 16777216, 33554432, 67108864, 134217728, 268435456, 536870912, 1073741824, 2147483648, 4294967296, 8589934592] + + # Check if number_of_compositions is correct in these examples + @test [number_of_compositions(n) for n in 0:length(nums) - 1] == nums + + # Complete check of compositions for small cases + for n in 0:5 + # We'll piece together all compositions of n by the compositions + # of n into k parts for 0 <= k <= n + allcomps = [] + for k in 0:n + C = collect(compositions(n, k)) + @test length(C) == number_of_compositions(n, k) + + # Check if each composition consists of k parts and sums up to n + for c in C + @test length(c) == k + @test sum(c) == n + @test all(is_positive, c) + end + + # Check if all compositions are distinct + @test C == unique(C) + + append!(allcomps, C) + end + + # All compositions need to be distinct + @test allcomps == unique(allcomps) + + # Number of compositions needs to be correct + @test length(allcomps) == number_of_compositions(n) + + # Finally, check compositions(n) function + allcomps2 = collect(compositions(n)) + @test allcomps2 == unique(allcomps2) + @test Set(allcomps) == Set(allcomps2) + end +end + +@testset "Ascending compositions" begin + for n in 0:20 + C = collect(ascending_compositions(n)) + @test length(C) == number_of_partitions(n) + @test C == unique(C) + for lambda in C + @test sum(lambda) == n + @test all(i -> lambda[i] <= lambda[i + 1], 1:length(lambda) - 1) + end + end +end From 85594b1964d65ca1e9528e70add7f0687da5d3c4 Mon Sep 17 00:00:00 2001 From: Johannes Schmitt Date: Tue, 7 May 2024 14:08:25 +0200 Subject: [PATCH 7/7] Disable a test in elliptic surfaces (#3698) --- test/AlgebraicGeometry/Schemes/elliptic_surface.jl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/AlgebraicGeometry/Schemes/elliptic_surface.jl b/test/AlgebraicGeometry/Schemes/elliptic_surface.jl index 5c166aea792..af3d6535523 100644 --- a/test/AlgebraicGeometry/Schemes/elliptic_surface.jl +++ b/test/AlgebraicGeometry/Schemes/elliptic_surface.jl @@ -57,6 +57,8 @@ trivial_lattice(X3) =# + #= + This testset is disabled (for now), see https://github.com/oscar-system/Oscar.jl/issues/3676 @testset "elliptic parameter" begin k = GF(29) kt, _ = polynomial_ring(k, :t) @@ -84,6 +86,7 @@ @test det(algebraic_lattice(X)[3])==24 end + =# end @testset "normalize_quartic and transform_to_weierstrass" begin