Skip to content

Commit

Permalink
adjust docu to writing :x instead of "x" etc. when constructing polyn… (
Browse files Browse the repository at this point in the history
#4161)

* adjust docu to writing :x instead of "x" etc. when constructing polynomial rings

* independently, add one example to intersection theory
  • Loading branch information
wdecker authored Sep 28, 2024
1 parent f9580e9 commit 4a5b96d
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/src/CommutativeAlgebra/rings.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.

Expand Down Expand Up @@ -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']);
Expand Down
23 changes: 23 additions & 0 deletions experimental/IntersectionTheory/src/Main.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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))

Expand Down

0 comments on commit 4a5b96d

Please sign in to comment.