From 4a5b96deaba6332348c3fc5554d8d717774f14b1 Mon Sep 17 00:00:00 2001 From: Wolfram Decker Date: Sat, 28 Sep 2024 22:11:28 +0200 Subject: [PATCH] =?UTF-8?q?adjust=20docu=20to=20writing=20:x=20instead=20o?= =?UTF-8?q?f=20"x"=20etc.=20when=20constructing=20polyn=E2=80=A6=20(#4161)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * adjust docu to writing :x instead of "x" etc. when constructing polynomial rings * independently, add one example to intersection theory --- docs/src/CommutativeAlgebra/rings.md | 4 ++-- experimental/IntersectionTheory/src/Main.jl | 23 +++++++++++++++++++++ 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/docs/src/CommutativeAlgebra/rings.md b/docs/src/CommutativeAlgebra/rings.md index 67a8e7070adb..b7cd400d232b 100644 --- a/docs/src/CommutativeAlgebra/rings.md +++ b/docs/src/CommutativeAlgebra/rings.md @@ -27,7 +27,7 @@ The basic constructor below allows one to build multivariate polynomial rings: polynomial_ring(C::Ring, xs::AbstractVector{<:VarName}; cached::Bool = true) ``` -Given a ring `C` and a vector `xs` of Strings, Symbols, or Characters, return +Given a ring `C` and a vector `xs` of Symbols, Strings, or Characters, return a tuple `R, vars`, say, which consists of a polynomial ring `R` with coefficient ring `C` and a vector `vars` of generators (variables) which print according to the entries of `xs`. @@ -60,7 +60,7 @@ true ```jldoctest julia> R1, _ = polynomial_ring(ZZ, [:x, :y, :z]); -julia> R2, _ = polynomial_ring(ZZ, [:x, :y, :z]); +julia> R2, _ = polynomial_ring(ZZ, ["x", "y", "z"]); julia> R3, _ = polynomial_ring(ZZ, ['x', 'y', 'z']); diff --git a/experimental/IntersectionTheory/src/Main.jl b/experimental/IntersectionTheory/src/Main.jl index d1162a5a8076..300ced07acc0 100644 --- a/experimental/IntersectionTheory/src/Main.jl +++ b/experimental/IntersectionTheory/src/Main.jl @@ -1378,6 +1378,29 @@ basis(X::AbstractVariety, k::Int) = basis(X)[k+1] Return the Betti numbers of the Chow ring of `X`. Note that these are not necessarily equal to the usual Betti numbers, i.e., the dimensions of (co)homologies. + +# Examples +```jldoctest +julia> P2xP2 = abstract_projective_space(2, symbol = "k")*abstract_projective_space(2, symbol = "l") +AbstractVariety of dim 4 + +julia> betti(P2xP2) +5-element Vector{Int64}: + 1 + 2 + 3 + 2 + 1 + +julia> basis(P2xP2) +5-element Vector{Vector{MPolyQuoRingElem}}: + [1] + [l, k] + [l^2, k*l, k^2] + [k*l^2, k^2*l] + [k^2*l^2] + +``` """ betti(X::AbstractVariety) = length.(basis(X))