Additive abelian groups are just modules over $$\ZZ$$. Hence the classes in this module derive from those in the module sage.modules.fg_pid. The only major differences are in the way elements are printed.

sage.groups.additive_abelian.additive_abelian_group.AdditiveAbelianGroup(invs, remember_generators=True)

Construct a finitely-generated additive abelian group.

INPUT:

• invs (list of integers): the invariants. These should all be greater than or equal to zero.
• remember_generators (boolean): whether or not to fix a set of generators (corresponding to the given invariants, which need not be in Smith form).

OUTPUT:

The abelian group $$\bigoplus_i \ZZ / n_i \ZZ$$, where $$n_i$$ are the invariants.

EXAMPLES:

sage: AdditiveAbelianGroup([0, 2, 4])
Additive abelian group isomorphic to Z + Z/2 + Z/4


An example of the remember_generators switch:

sage: G = AdditiveAbelianGroup([0, 2, 3]); G
Additive abelian group isomorphic to Z + Z/2 + Z/3
sage: G.gens()
((1, 0, 0), (0, 1, 0), (0, 0, 1))

sage: H = AdditiveAbelianGroup([0, 2, 3], remember_generators = False); H
Additive abelian group isomorphic to Z/6 + Z
sage: H.gens()
((0, 1, 2), (1, 0, 0))


There are several ways to create elements of an additive abelian group. Realize that there are two sets of generators: the “obvious” ones composed of zeros and ones, one for each invariant given to construct the group, the other being a set of minimal generators. Which set is the default varies with the use of the remember_generators switch.

First with “obvious” generators. Note that a raw list will use the minimal generators and a vector (a module element) will use the generators that pair up naturally with the invariants. We create the same element repeatedly.

sage: H=AdditiveAbelianGroup([3,2,0], remember_generators=True)
sage: H.gens()
((1, 0, 0), (0, 1, 0), (0, 0, 1))
sage: [H.0, H.1, H.2]
[(1, 0, 0), (0, 1, 0), (0, 0, 1)]
sage: p=H.0+H.1+6*H.2; p
(1, 1, 6)

sage: H.smith_form_gens()
((2, 1, 0), (0, 0, 1))
sage: q=H.linear_combination_of_smith_form_gens([5,6]); q
(1, 1, 6)
sage: p==q
True

sage: r=H(vector([1,1,6])); r
(1, 1, 6)
sage: p==r
True

sage: s=H(p)
sage: p==s
True


Again, but now where the generators are the minimal set. Coercing a list or a vector works as before, but the default generators are different.

sage: G=AdditiveAbelianGroup([3,2,0], remember_generators=False)
sage: G.gens()
((2, 1, 0), (0, 0, 1))
sage: [G.0, G.1]
[(2, 1, 0), (0, 0, 1)]
sage: p=5*G.0+6*G.1; p
(1, 1, 6)

sage: H.smith_form_gens()
((2, 1, 0), (0, 0, 1))
sage: q=G.linear_combination_of_smith_form_gens([5,6]); q
(1, 1, 6)
sage: p==q
True

sage: r=G(vector([1,1,6])); r
(1, 1, 6)
sage: p==r
True

sage: s=H(p)
sage: p==s
True

class sage.groups.additive_abelian.additive_abelian_group.AdditiveAbelianGroupElement(parent, x, check=True)

An element of an AdditiveAbelianGroup_class.

class sage.groups.additive_abelian.additive_abelian_group.AdditiveAbelianGroup_class(cover, relations)

Bases: sage.modules.fg_pid.fgp_module.FGP_Module_class, sage.groups.old.AbelianGroup

An additive abelian group, implemented using the $$\ZZ$$-module machinery.

INPUT:

• cover – the covering group as $$\ZZ$$-module.
• relations – the relations as submodule of cover.
Element
exponent()

Return the exponent of this group (the smallest positive integer $$N$$ such that $$Nx = 0$$ for all $$x$$ in the group). If there is no such integer, return 0.

EXAMPLES:

sage: AdditiveAbelianGroup([2,4]).exponent()
4
0
1

is_cyclic()

Returns True if the group is cyclic.

EXAMPLES:

With no common factors between the orders of the generators, the group will be cyclic.

sage: G=AdditiveAbelianGroup([6, 7, 55])
sage: G.is_cyclic()
True


Repeating primes in the orders will create a non-cyclic group.

sage: G=AdditiveAbelianGroup([6, 15, 21, 33])
sage: G.is_cyclic()
False


A trivial group is trivially cyclic.

sage: T=AdditiveAbelianGroup()
sage: T.is_cyclic()
True

is_multiplicative()

Return False since this is an additive group.

EXAMPLES:

sage: AdditiveAbelianGroup().is_multiplicative()
False

order()

Return the order of this group (an integer or infinity)

EXAMPLES:

sage: AdditiveAbelianGroup([2,4]).order()
8
+Infinity
1

short_name()

Return a name for the isomorphism class of this group.

EXAMPLES:

sage: AdditiveAbelianGroup([0, 2,4]).short_name()
'Z + Z/2 + Z/4'
'Z + Z/2 + Z/3'

class sage.groups.additive_abelian.additive_abelian_group.AdditiveAbelianGroup_fixed_gens(cover, rels, gens)

A variant which fixes a set of generators, which need not be in Smith form (or indeed independent).

gens()

Return the specified generators for self (as a tuple). Compare self.smithform_gens().

EXAMPLES:

sage: G = AdditiveAbelianGroup([2,3])
sage: G.gens()
((1, 0), (0, 1))
sage: G.smith_form_gens()
((1, 2),)

identity()

Return the identity (zero) element of this group.

EXAMPLES:

sage: G = AdditiveAbelianGroup([2, 3])
sage: G.identity()
(0, 0)

permutation_group()

Return the permutation group attached to this group.

EXAMPLES:

sage: G = AdditiveAbelianGroup([2, 3])
sage: G.permutation_group()
Permutation Group with generators [(3,4,5), (1,2)]

sage.groups.additive_abelian.additive_abelian_group.cover_and_relations_from_invariants(invs)

A utility function to construct modules required to initialize the super class.

Given a list of integers, this routine constructs the obvious pair of free modules such that the quotient of the two free modules over $$\ZZ$$ is naturally isomorphic to the corresponding product of cyclic modules (and hence isomorphic to a direct sum of cyclic groups).

EXAMPLES:

sage: from sage.groups.additive_abelian.additive_abelian_group import cover_and_relations_from_invariants as cr
sage: cr([0,2,3])
(Ambient free module of rank 3 over the principal ideal domain Integer Ring, Free module of degree 3 and rank 2 over Integer Ring
Echelon basis matrix:
[0 2 0]
[0 0 3])