Skip to content

Commit

Permalink
Prepare for renaming of rank(A::FinGenAbGroup)
Browse files Browse the repository at this point in the history
... to torsion_free_rank(A::FinGenAbGroup), see also
<thofma/Hecke.jl#1224>.
  • Loading branch information
fingolfin committed Feb 28, 2024
1 parent e45ff24 commit 2eef2e0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/Rings/mpoly-graded.jl
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,8 @@ is_standard_graded(::MPolyRing) = false
Return `true` if `R` is $\mathbb Z$-graded, `false` otherwise.
!!! note
Writing `G = grading_group(R)`, we say that `R` is $\mathbb Z$-graded if `is_free(G) && ngens(G) == rank(G) == 1` evaluates to `true`.
Writing `G = grading_group(R)`, we say that `R` is $\mathbb Z$-graded if
`G` is free abelian of rank `1`, and `ngens(G) == 1`.
# Examples
```jldoctest
Expand All @@ -245,7 +246,7 @@ true
function is_z_graded(R::MPolyDecRing)
is_graded(R) || return false
A = grading_group(R)
return ngens(A) == 1 && rank(A) == 1 && is_free(A)
return ngens(A) == 1 && torsion_free_rank(A) == 1 && is_free(A)
end

is_z_graded(::MPolyRing) = false
Expand All @@ -256,7 +257,8 @@ is_z_graded(::MPolyRing) = false
Return `true` if `R` is $\mathbb Z^m$-graded for some $m$, `false` otherwise.
!!! note
Writing `G = grading_group(R)`, we say that `R` is $\mathbb Z^m$-graded if `is_free(G) && ngens(G) == rank(G) == m` evaluates to `true`.
Writing `G = grading_group(R)`, we say that `R` is $\mathbb Z^m$-graded
`G` is free abelian of rank `m`, and `ngens(G) == m`.
# Examples
```jldoctest
Expand Down Expand Up @@ -295,7 +297,7 @@ false
function is_zm_graded(R::MPolyDecRing)
is_graded(R) || return false
A = grading_group(R)
return is_free(A) && ngens(A) == rank(A)
return is_free(A) && ngens(A) == torsion_free_rank(A)
end

is_zm_graded(::MPolyRing) = false
Expand Down Expand Up @@ -340,7 +342,7 @@ false
is_graded(R) || return false
G = grading_group(R)
is_free(G) || return false
if ngens(G) == rank(G)
if ngens(G) == torsion_free_rank(G)
W = reduce(vcat, [x.coeff for x = R.d])
if is_positive_grading_matrix(transpose(W))
return true
Expand Down
6 changes: 6 additions & 0 deletions src/imports.jl
Original file line number Diff line number Diff line change
Expand Up @@ -195,4 +195,10 @@ import Hecke:
primitive_element,
QQBar

# temporary workaround, see https://github.com/thofma/Hecke.jl/pull/1224
if !isdefined(Hecke, :torsion_free_rank)
torsion_free_rank(A::FinGenAbGroup) = rank(A)
export torsion_free_rank
end

import cohomCalg_jll

0 comments on commit 2eef2e0

Please sign in to comment.