Elements
Elements in a finitely generated abelian group are of type FinGenAbGroupElem
and are always given as a linear combination of the generators. Internally this representation is normliased to have a unique representative.
Creation
In addition to the standard function id
, zero
and one
that can be used to create the neutral element, we also support more targeted creation:
FinGenAbGroup Method
(A::FinGenAbGroup)(x::Vector{ZZRingElem}) -> FinGenAbGroupElem
Given an array x
of elements of type ZZRingElem
of the same length as ngens(x
.
FinGenAbGroup Method
(A::FinGenAbGroup)(x::ZZMatrix) -> FinGenAbGroupElem
Given a matrix over the integers with either ngens(A)
columns or ngens(A)
rows and x
.
getindex Method
getindex(A::FinGenAbGroup, i::Int) -> FinGenAbGroupElem
Returns the element of
rand Method
rand(G::FinGenAbGroup) -> FinGenAbGroupElem
Returns an element of
rand Method
rand(G::FinGenAbGroup, B::ZZRingElem) -> FinGenAbGroupElem
For a (potentially infinite) abelian group
Access
getindex Method
getindex(x::FinGenAbGroupElem, v::AbstractVector{Int}) -> Vector{ZZRingElem}
Returns the
Note
This function is inefficient since the elements are internally stored using ZZMatrix but this function outputs a vector.
getindex Method
getindex(x::FinGenAbGroupElem, i::Int) -> ZZRingElem
Returns the
Predicates
We have the standard predicates iszero
, isone
and is_identity
to test an element for being trivial.
Invariants
order Method
order(A::FinGenAbGroupElem) -> ZZRingElem
Returns the order of
Iterator
One can iterate over the elements of a finite abelian group.
julia> G = abelian_group(ZZRingElem[1 2; 3 4])
Finitely generated abelian group
with 2 generators and 2 relations and relation matrix
[1 2]
[3 4]
julia> for g = G
println(g)
end
Abelian group element [0, 0]
Abelian group element [0, 1]