AUTHORS:
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
Bases: sage.structure.element.MultiplicativeGroupElement
Return the element of the permutation group G (isomorphic to the abelian group A) associated to a in A.
EXAMPLES:
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
Returns the inverse element.
EXAMPLE:
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
Return (a reference to) the underlying list used to represent this element. If this is a word in an abelian group on generators, then this is a list of nonnegative integers of length .
EXAMPLES:
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]
Returns the (finite) order of this element or Infinity if this element does not have finite order.
EXAMPLES:
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
sage: G = AbelianGroup(3,[7,8,9])
sage: type((G.0 * G.1).order())==Integer
True
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 (non-deterministic) algorithms for the word problem.
Warning
Don’t use E (or other GAP-reserved letters) as a generator name.
EXAMPLE:
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: v = (y*x).word_problem([x,y]); v #random
[[x, 1], [y, 1]]
sage: prod([x^i for x,i in v]) == y*x
True
Return true if x is an abelian group element, i.e., an element of type AbelianGroupElement.
EXAMPLES: Though the integer 3 is in the integers, and the integers have an abelian group structure, 3 is not an AbelianGroupElement:
sage: from sage.groups.abelian_gps.abelian_group_element import is_AbelianGroupElement
sage: is_AbelianGroupElement(3)
False
sage: F = AbelianGroup(5, [3,4,5,8,7], 'abcde')
sage: is_AbelianGroupElement(F.0)
True