Additive Abelian Groups - Groups

Skip to content
Back to top
View this page
Edit this page

# Additive Abelian Groups

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 (default: `True`); 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

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

  Python

      >>> from sage.all import *
      >>> AdditiveAbelianGroup([Integer(0), Integer(2), Integer(4)])
      Additive abelian group isomorphic to Z + Z/2 + Z/4

  An example of the `remember_generators` switch:

  Sage

      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, 1), (1, 0, 0))

  [Python]

      >>> from sage.all import *
      >>> G = AdditiveAbelianGroup([Integer(0), Integer(2), Integer(3)]); G
      Additive abelian group isomorphic to Z + Z/2 + Z/3
      >>> G.gens()
      ((1, 0, 0), (0, 1, 0), (0, 0, 1))

      >>> H = AdditiveAbelianGroup([Integer(0), Integer(2), Integer(3)], remember_generators = False); H
      Additive abelian group isomorphic to Z/6 + Z
      >>> H.gens()
      ((0, 1, 1), (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

      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

  Python

      >>> from sage.all import *
      >>> H = AdditiveAbelianGroup([Integer(3),Integer(2),Integer(0)], remember_generators=True)
      >>> H.gens()
      ((1, 0, 0), (0, 1, 0), (0, 0, 1))
      >>> [H.gen(0), H.gen(1), H.gen(2)]
      [(1, 0, 0), (0, 1, 0), (0, 0, 1)]
      >>> p = H.gen(0)+H.gen(1)+Integer(6)*H.gen(2); p
      (1, 1, 6)

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

      >>> r = H(vector([Integer(1),Integer(1),Integer(6)])); r
      (1, 1, 6)
      >>> p == r
      True

      >>> s = H(p)
      >>> 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

      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

  [Python]

      >>> from sage.all import *
      >>> G = AdditiveAbelianGroup([Integer(3),Integer(2),Integer(0)], remember_generators=False)
      >>> G.gens()
      ((2, 1, 0), (0, 0, 1))
      >>> [G.gen(0), G.gen(1)]
      [(2, 1, 0), (0, 0, 1)]
      >>> p = Integer(5)*G.gen(0)+Integer(6)*G.gen(1); p
      (1, 1, 6)

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

      >>> r = G(vector([Integer(1),Integer(1),Integer(6)])); r
      (1, 1, 6)
      >>> p == r
      True

      >>> s = H(p)
      >>> p == s
      True

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

  Bases: `FGP_Element`

  An element of an `AdditiveAbelianGroup_class`.

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

  Bases: `FGP_Module_class`

  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

    alias of `AdditiveAbelianGroupElement`

  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

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

    Python

        >>> from sage.all import *
        >>> AdditiveAbelianGroup([Integer(2),Integer(4)]).exponent()
        4
        >>> AdditiveAbelianGroup([Integer(0), Integer(2),Integer(4)]).exponent()
        0
        >>> AdditiveAbelianGroup([]).exponent()
        1

  is_cyclic()

    Return `True` if the group is cyclic.

    EXAMPLES:

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

    Sage

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

    Python

        >>> from sage.all import *
        >>> G = AdditiveAbelianGroup([Integer(6), Integer(7), Integer(55)])
        >>> G.is_cyclic()
        True

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

    Sage

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

    [Python]

        >>> from sage.all import *
        >>> G = AdditiveAbelianGroup([Integer(6), Integer(15), Integer(21), Integer(33)])
        >>> G.is_cyclic()
        False

    A trivial group is trivially cyclic.

    Sage

        sage: T = AdditiveAbelianGroup([1])
        sage: T.is_cyclic()
        True

    Python

        >>> from sage.all import *
        >>> T = AdditiveAbelianGroup([Integer(1)])
        >>> T.is_cyclic()
        True

  is_multiplicative()

    Return `False` since this is an additive group.

    EXAMPLES:

    Sage

        sage: AdditiveAbelianGroup([0]).is_multiplicative()
        False

    Python

        >>> from sage.all import *
        >>> AdditiveAbelianGroup([Integer(0)]).is_multiplicative()
        False

  order()

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

    EXAMPLES:

    Sage

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

    Python

        >>> from sage.all import *
        >>> AdditiveAbelianGroup([Integer(2),Integer(4)]).order()
        8
        >>> AdditiveAbelianGroup([Integer(0), Integer(2),Integer(4)]).order()
        +Infinity
        >>> AdditiveAbelianGroup([]).order()
        1

  short_name()

    Return a name for the isomorphism class of this group.

    EXAMPLES:

    Sage

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

    Python

        >>> from sage.all import *
        >>> AdditiveAbelianGroup([Integer(0), Integer(2),Integer(4)]).short_name()
        'Z + Z/2 + Z/4'
        >>> AdditiveAbelianGroup([Integer(0), Integer(2), Integer(3)]).short_name()
        'Z + Z/2 + Z/3'

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

  Bases: `AdditiveAbelianGroup_class`

  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

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

    Python

        >>> from sage.all import *
        >>> G = AdditiveAbelianGroup([Integer(2),Integer(3)])
        >>> G.gens()
        ((1, 0), (0, 1))
        >>> G.smith_form_gens()
        ((1, 2),)

  identity()

    Return the identity (zero) element of this group.

    EXAMPLES:

    Sage

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

    Python

        >>> from sage.all import *
        >>> G = AdditiveAbelianGroup([Integer(2), Integer(3)])
        >>> G.identity()
        (0, 0)

  permutation_group()

    Return the permutation group attached to this group.

    EXAMPLES:

    Sage

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

    Python

        >>> from sage.all import *
        >>> G = AdditiveAbelianGroup([Integer(2), Integer(3)])
        >>> G.permutation_group()                                                 # needs sage.groups
        Permutation Group with generators [(1,2), (3,4,5)]

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

      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])

  Python

      >>> from sage.all import *
      >>> from sage.groups.additive_abelian.additive_abelian_group import cover_and_relations_from_invariants as cr
      >>> cr([Integer(0),Integer(2),Integer(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])