Module abelian_group_element
source code
Abelian group elements
AUTHORS:
- 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.
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
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: is_AbelianGroupElement(3)
False
sage: F = AbelianGroup(5, [3,4,5,8,7], 'abcde')
sage: is_AbelianGroupElement(F.0)
True
|