Module dual_abelian_group_element
source code
Elements (characters) of the dual group of a finite Abelian group.
AUTHORS:
- David Joyner (2006-07); based on abelian_group_element.py.
- David Joyner (2006-10); modifications suggested by William Stein.
EXAMPLES:
sage: F = AbelianGroup(5,[2, 3, 5, 7, 8], names="abcde")
sage: a,b,c,d,e = F.gens()
sage: Fd = DualAbelianGroup(F, names = "ABCDE")
sage: A,B,C,D,E = Fd.gens()
sage: A*B^2*D^7
A*B^2
sage: A(a) ## random last few digits
-1.0000000000000000 + 0.00000000000000013834419720915037*I
sage: B(b)
-0.500000000000000 + 0.866025403784439*I
sage: A(a*b) ## random last few digits
-1.0000000000000000 + 0.00000000000000013834419720915037*I
sage: (A*B*C^2*D^20*E^65).list()
[1, 1, 2, 6, 1]
sage: B^(-1)
B^2
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 = A*B*C^2*D^2*E^-6
sage: X.list()
[1, 1, 2, 2, 2]
sage: X.list()[1] = -1
sage: X
A*B^-1*C^2*D^2*E^2
This was in sage.misc.misc but commented out. Needed to add
lists of strings in the word_problem method below.
Return the sum of the elements of x. If x is empty,
return z.
INPUT:
x -- iterable
z -- the "0" that will be returned if x is empty.
OUTPUT:
object
|