22.3 Abelian group elements

Module: sage.groups.abelian_gps.abelian_group_element

Abelian group elements

Author: - David Joyner (2006-02); based on free_abelian_monoid_element.py, written by David Kohel. - David Joyner (2006-05); bug fix in order - (2006-08); bug fix+new method in pow for negatives+fixed corresponding examples.

Recall an example from abelian groups.

sage: F = AbelianGroup(5,[4,5,5,7,8],names = list("abcde"))
sage: (a,b,c,d,e) = F.gens()
sage: x = a*b^2*e*d^20*e^12
sage: x
a*b^2*d^6*e^5
sage: x = a^10*b^12*c^13*d^20*e^12
sage: x
a^2*b^2*c^3*d^6*e^4
sage: y = a^13*b^19*c^23*d^27*e^72
sage: y
a*b^4*c^3*d^6
sage: x*y
a^3*b*c*d^5*e^4
sage: x.list()
[2, 2, 3, 6, 4]

It is important to note that lists are mutable and the returned list is not a copy. As a result, reassignment of an element of the list changes the object.

sage: x.list()[0] = 3
sage: x.list()
[3, 2, 3, 6, 4]
sage: x
a^3*b^2*c^3*d^6*e^4

Module-level Functions

is_AbelianGroupElement( x)

Return true if x is an abelian group element, i.e., an element of type AbelianGroupElement.

Though the integer 3 is in the integers, and the integers have an abelian group structure, 3 is not an AbelianGroupElement:

sage: is_AbelianGroupElement(3)
False
sage: F = AbelianGroup(5, [3,4,5,8,7], 'abcde')
sage: is_AbelianGroupElement(F.0)
True

Class: AbelianGroupElement

class AbelianGroupElement
AbelianGroupElement( self, F, x)

Create the element x of the AbelianGroup F.

sage: F = AbelianGroup(5, [3,4,5,8,7], 'abcde')
sage: a, b, c, d, e = F.gens()
sage: a^2 * b^3 * a^2 * b^-4
a*b^3
sage: b^-11
b
sage: a^-11
a
sage: a*b in F
True

Functions: as_permutation,$ \,$ inverse,$ \,$ list,$ \,$ order,$ \,$ random_element,$ \,$ word_problem

as_permutation( self)

Return the element of the permutation group G (isomorphic to the abelian group A) associated to a in A.

sage: G = AbelianGroup(3,[2,3,4],names="abc"); G
Multiplicative Abelian Group isomorphic to C2 x C3 x C4
sage: a,b,c=G.gens()
sage: Gp = G.permutation_group(); Gp
Permutation Group with generators
[(1,13)(2,14)(3,15)(4,16)(5,17)(6,18)(7,19)(8,20)(9,21)(10,22)(11,23)(12,24
), (1,5,9)(2,6,10)(3,7,11)(4,8,12)(13,17,21)(14,18,22)(15,19,23)(16,20,24),
(1,3,2,4)(5,7,6,8)(9,11,10,12)(13,15,14,16)(17,19,18,20)(21,23,22,24)]
sage: a.as_permutation()
(1,13)(2,14)(3,15)(4,16)(5,17)(6,18)(7,19)(8,20)(9,21)(10,22)(11,23)(12,24)
sage: ap = a.as_permutation(); ap
(1,13)(2,14)(3,15)(4,16)(5,17)(6,18)(7,19)(8,20)(9,21)(10,22)(11,23)(12,24)
sage: ap in Gp
True

inverse( self)

Returns the inverse element.

sage: G.<a,b> = AbelianGroup(2)
sage: a^-1
a^-1
sage: a.list()
[1, 0]
sage: a.inverse().list()
[-1, 0]
sage: a.inverse()
a^-1

list( self)

Return (a reference to) the underlying list used to represent this element. If this is a word in an abelian group on $ n$ generators, then this is a list of nonnegative integers of length $ n$ .

sage: F = AbelianGroup(5, [3,4,5,8,7], 'abcde')
sage: (a, b, c, d, e) = F.gens()
sage: a.list()
[1, 0, 0, 0, 0]

order( self)

Returns the (finite) order of this element or Infinity if this element does not have finite order.

sage: F = AbelianGroup(3,[7,8,9]); F
Multiplicative Abelian Group isomorphic to C7 x C8 x C9
sage: F.gens()[2].order()
9
sage: a,b,c = F.gens()
sage: (b*c).order()
72

random_element( self)

Return a random element of this dual group.

word_problem( self, words)

TODO - this needs a rewrite - see stuff in the matrix_grp directory.

G and H are abelian groups, g in G, H is a subgroup of G generated by a list (words) of elements of G. If self is in H, return the expression for self as a word in the elements of (words).

This function does not solve the word problem in SAGE. Rather it pushes it over to GAP, which has optimized algorithms for the word problem.

WANRING: Don't use E (or other GAP-reserved letters) as a generator name.

sage: G = AbelianGroup(2,[2,3], names="xy")
sage: x,y = G.gens()
sage: x.word_problem([x,y])
[[x, 1]]
sage: y.word_problem([x,y])
[[y, 1]]
sage: (y*x).word_problem([x,y])
[[x, 1], [y, 1]]

Special Functions: __cmp__,$ \,$ __init__,$ \,$ __pow__,$ \,$ _div_,$ \,$ _mul_,$ \,$ _repr_

__pow__( self, _n)

requires that len(invs) = n

_div_( self, y)

TESTS:

sage: G.<a,b> = AbelianGroup(2)
sage: a/b
a*b^-1

_repr_( self)

sage: AbelianGroupElement(AbelianGroup(1, [1], names='e'),[0])
1
sage: AbelianGroupElement(AbelianGroup(3, [2,3,4], names='e'),[1,2,3])
e0*e1^2*e2^3

See About this document... for information on suggesting changes.