Abelian Groups
Here we describe the interface to abelian groups in Hecke.
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 GrpAbFinGen with elements of type GrpAbFinGenElem. 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 — Methodabelian_group(::Type{T} = GrpAbFinGen, M::ZZMatrix) -> GrpAbFinGenCreates 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 — Methodabelian_group(::Type{T} = GrpAbFinGen, 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 — Methodabelian_group(::Type{T} = GrpAbFinGen, 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 — Methodabelian_group(::Type{T} = GrpAbFinGen, M::AbstractVector{<:IntegerUnion}) -> GrpAbFinGen
abelian_group(::Type{T} = GrpAbFinGen, M::IntegerUnion...) -> GrpAbFinGenCreates 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)GrpAb: (Z/2)^2 x Z/6
or even
free_abelian_group — Methodfree_abelian_group(::Type{T} = GrpAbFinGen, n::Int) -> GrpAbFinGenCreates the free abelian group of rank n.
abelian_groups — Methodabelian_groups(n::Int) -> Vector{GrpAbFinGen}Given a positive integer $n$, return a list of all abelian groups of order $n$.
julia> abelian_groups(8)3-element Vector{GrpAbFinGen}: GrpAb: (Z/2)^3 GrpAb: Z/2 x Z/4 GrpAb: Z/8
Invariants
is_snf — Methodis_snf(G::GrpAbFinGen) -> BoolReturn whether the current relation matrix of the group $G$ is in Smith normal form.
ngens — Methodngens(G::GrpAbFinGen) -> IntReturn the number of generators of $G$ in the current representation.
nrels — Methodnrels(G::GrpAbFinGen) -> IntReturn the number of relations of $G$ in the current representation.
rels — Methodrels(A::GrpAbFinGen) -> ZZMatrixReturn the currently used relations of $G$ as a single matrix.
isfinite — Methodisfinite(A::GrpAbFinGen) -> BoolReturn whether $A$ is finite.
is_infinite — Methodis_infinite(x::Any) -> BoolTests whether $x$ is infinite, by returning !isfinite(x).
rank — Methodrank(A::GrpAbFinGen) -> IntReturn the rank of $A$, that is, the dimension of the $\mathbf{Q}$-vectorspace $A \otimes_{\mathbf Z} \mathbf Q$.
order — Methodorder(A::GrpAbFinGen) -> ZZRingElemReturn the order of $A$. It is assumed that $A$ is finite.
exponent — Methodexponent(A::GrpAbFinGen) -> ZZRingElemReturn the exponent of $A$. It is assumed that $A$ is finite.
istrivial — Methodistrivial(A::GrpAbFinGen) -> BoolReturn whether $A$ is the trivial group.
is_torsion — Methodis_torsion(G::GrpAbFinGen) -> BoolReturn whether G is a torsion group.
is_cyclic — Methodis_cyclic(G::GrpAbFinGen) -> BoolReturn whether $G$ is cyclic.
elementary_divisors — Methodelementary_divisors(G::GrpAbFinGen) -> Vector{ZZRingElem}Given $G$, return the elementary divisors of $G$, that is, the unique positive integers $e_1,\dotsc,e_k$ with $e_i \mid e_{i + 1}$ and $G \cong \mathbf{Z}/e_1\mathbf{Z} \times \dotsb \times \mathbf{Z}/e_k\mathbf{Z}$.