diff --git a/docs/src/abelian/introduction.md b/docs/src/abelian/introduction.md index ad6e1ba1ae..8884e1eddb 100644 --- a/docs/src/abelian/introduction.md +++ b/docs/src/abelian/introduction.md @@ -58,7 +58,7 @@ nrels(G::GrpAbFinGen) rels(A::GrpAbFinGen) is_finite(A::GrpAbFinGen) is_infinite(A::GrpAbFinGen) -rank(A::GrpAbFinGen) +torsion_free_rank(A::GrpAbFinGen) order(A::GrpAbFinGen) exponent(A::GrpAbFinGen) is_trivial(A::GrpAbFinGen) diff --git a/src/GrpAb/GrpAbFinGen.jl b/src/GrpAb/GrpAbFinGen.jl index 9d468a5a65..350f442f35 100644 --- a/src/GrpAb/GrpAbFinGen.jl +++ b/src/GrpAb/GrpAbFinGen.jl @@ -33,7 +33,7 @@ ################################################################################ export abelian_group, free_abelian_group, is_snf, ngens, nrels, rels, snf, isfinite, - is_infinite, rank, order, exponent, is_trivial, is_isomorphic, + is_infinite, torsion_free_rank, rank, order, exponent, is_trivial, 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, @@ -474,12 +474,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)) diff --git a/test/GrpAb/GrpAbFinGen.jl b/test/GrpAb/GrpAbFinGen.jl index 54cf7022d3..45a087fb34 100644 --- a/test/GrpAb/GrpAbFinGen.jl +++ b/test/GrpAb/GrpAbFinGen.jl @@ -130,16 +130,16 @@ @testset "Rank" begin G = abelian_group([3, 15]) - @test @inferred rank(G) == 0 + @test @inferred torsion_free_rank(G) == 0 G = abelian_group([3, 5]) - @test @inferred rank(G) == 0 + @test @inferred torsion_free_rank(G) == 0 G = abelian_group([3, 15, 0]) - @test @inferred rank(G) == 1 + @test @inferred torsion_free_rank(G) == 1 G = abelian_group([3, 5, 0]) - @test @inferred rank(G) == 1 + @test @inferred torsion_free_rank(G) == 1 end @testset "Order" begin