Skip to content

Commit

Permalink
Rename rank(A::GrpAbFinGen) to torsion_free_rank
Browse files Browse the repository at this point in the history
Unfortunately the notion of 'rank' for groups clashes with that for abelian groups.
The latter is also known as 'torsion free rank'. Hence I propose to rename `rank`
for abelian groups here accordingly.
  • Loading branch information
fingolfin committed Sep 26, 2023
1 parent 75dbabf commit e5cb900
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion docs/src/abelian/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ nrels(G::GrpAbFinGen)
rels(A::GrpAbFinGen)
isfinite(A::GrpAbFinGen)
is_infinite(A::GrpAbFinGen)
rank(A::GrpAbFinGen)
torsion_free_rank(A::GrpAbFinGen)
order(A::GrpAbFinGen)
exponent(A::GrpAbFinGen)
istrivial(A::GrpAbFinGen)
Expand Down
8 changes: 4 additions & 4 deletions src/GrpAb/GrpAbFinGen.jl
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
import AbstractAlgebra.GroupsCore: istrivial

export abelian_group, free_abelian_group, is_snf, ngens, nrels, rels, snf, isfinite,
is_infinite, rank, order, exponent, istrivial, is_isomorphic,
is_infinite, torsion_free_rank, rank, order, exponent, istrivial, is_isomorphic,
direct_product, is_torsion, torsion_subgroup, sub, quo, is_cyclic,
psylow_subgroup, is_subgroup, abelian_groups, flat, tensor_product,
dual, chain_complex, is_exact, free_resolution, obj, map,
Expand Down Expand Up @@ -476,12 +476,12 @@ is_finite_gen(A::GrpAbFinGen) = isfinite(snf(A)[1])
################################################################################

@doc raw"""
rank(A::GrpAbFinGen) -> Int
torsion_free_rank(A::GrpAbFinGen) -> Int
Return the rank of $A$, that is, the dimension of the
Return the torsion free rank of $A$, that is, the dimension of the
$\mathbf{Q}$-vectorspace $A \otimes_{\mathbf Z} \mathbf Q$.
"""
rank(A::GrpAbFinGen) = is_snf(A) ? rank_snf(A) : rank_gen(A)
torsion_free_rank(A::GrpAbFinGen) = is_snf(A) ? rank_snf(A) : rank_gen(A)

rank_snf(A::GrpAbFinGen) = length(findall(x -> iszero(x), A.snf))

Expand Down

0 comments on commit e5cb900

Please sign in to comment.