Introduction
Within Hecke, abelian groups are of generic abstract type GrpAb which does not have to be finitely generated, $\mathbb Q/\mathbb Z$ is an example of a more general abelian group. Having said that, most of the functionality is restricted to abelian groups that are finitely presented as $\mathbb Z$-modules.
Basic Creation
Finitely presented (as $\mathbb Z$-modules) abelian groups are of type FinGenAbGroup with elements of type FinGenAbGroupElem. The creation is mostly via a relation matrix $M = (m_{i,j})$ for $1\le i\le n$ and $1\le j\le m$. This creates a group with $m$ generators $e_j$ and relations
\[ \sum_{i=1}^n m_{i,j} e_j = 0.\]
abelian_group — Method
abelian_group(::Type{T} = FinGenAbGroup, M::ZZMatrix) -> FinGenAbGroupCreates the abelian group with relation matrix M. That is, the group will have ncols(M) generators and each row of M describes one relation.
abelian_group — Method
abelian_group(::Type{T} = FinGenAbGroup, M::AbstractMatrix{<:IntegerUnion})Creates the abelian group with relation matrix M. That is, the group will have ncols(M) generators and each row of M describes one relation.
abelian_group — Method
abelian_group(::Type{T} = FinGenAbGroup, M::AbstractMatrix{<:IntegerUnion})Creates the abelian group with relation matrix M. That is, the group will have ncols(M) generators and each row of M describes one relation.
Alternatively, there are shortcuts to create products of cyclic groups:
abelian_group — Method
abelian_group(::Type{T} = FinGenAbGroup, M::AbstractVector{<:IntegerUnion}) -> FinGenAbGroup
abelian_group(::Type{T} = FinGenAbGroup, M::IntegerUnion...) -> FinGenAbGroupCreates the direct product of the cyclic groups $\mathbf{Z}/m_i$, where $m_i$ is the $i$th entry of M.
julia> G = abelian_group(2, 2, 6)
(Z/2)^2 x Z/6or even
free_abelian_group — Method
free_abelian_group(::Type{T} = FinGenAbGroup, n::Int) -> FinGenAbGroupCreates the free abelian group of rank n.
abelian_groups — Method
abelian_groups(n::Int) -> Vector{FinGenAbGroup}Given a positive integer $n$, return a list of all abelian groups of order $n$.
sourcejulia> abelian_groups(8)
3-element Vector{FinGenAbGroup}:
(Z/2)^3
Z/2 x Z/4
Z/8Invariants
number_of_generators — Method
number_of_generators(G::FinGenAbGroup) -> IntReturn the number of generators of $G$ in the current representation.
sourcetorsion_free_rank — Method
is_trivial — Method
is_torsion — Method
elementary_divisors — Method
elementary_divisors(G::FinGenAbGroup) -> Vector{ZZRingElem}Given $G$, return the elementary divisors of $G$, that is, the unique non-negative integers $e_1,\dotsc,e_k$ with $e_i \mid e_{i + 1}$ and $e_i\neq 1$ such that $G \cong \mathbf{Z}/e_1\mathbf{Z} \times \dotsb \times \mathbf{Z}/e_k\mathbf{Z}$.
source