Module: sage.groups.abelian_gps.abelian_group
Multiplicative Abelian Groups
Author Log:
TODO: * additive abelian groups should also be supported
Background on elementary divisors, invariant factors and the Smith
normal form (according to section 4.1 of [C1]): An abelian group is a
group A for which there exists an exact sequence
, for some positive integers
with
. For example, a finite abelian group has a
decomposition
where
regarded as a map
The elementary divisors use the highest (non-trivial) prime powers occuring in the factorizations of the numbers
SAGE supports multiplicative abelian groups on any prescribed finite
number
of generators. Use the
AbelianGroup
function
to create an abelian group, and the gen
and gens
functions to obtain the corresponding generators. You can print the
generators as arbitrary strings using the optional names
argument to the AbelianGroup
function.
EXAMPLE 1: We create an abelian group in zero or more variables; the syntax T(1) creates the identity element even in the rank zero case.
sage: T = AbelianGroup(0,[]) sage: T Trivial Abelian Group sage: T.gens() () sage: T(1) 1
EXAMPLE 2: An abelian group uses a multiplicative representation of elements, but the underlying representation is lists of integer exponents.
sage: F = AbelianGroup(5,[3,4,5,5,7],names = list("abcde")) sage: F Multiplicative Abelian Group isomorphic to C3 x C4 x C5 x C5 x C7 sage: (a,b,c,d,e) = F.gens() sage: a*b^2*e*d a*b^2*d*e sage: x = b^2*e*d*a^7 sage: x a*b^2*d*e sage: x.list() [1, 2, 0, 1, 1]
REFERENCES: [C1] H. Cohen Advanced topics in computational number theory, Springer, 2000. [C2] ---, A course in computational algebraic number theory, Springer, 1996. [R] J. Rotman, An introduction to the theory of groups, 4th ed, Springer, 1995.
WARNINGS: Many basic properties for infinite abelian groups are not implemented.
Module-level Functions
n, [invfac=None], [names=f]) |
Create the multiplicative abelian group in
generators with
given invariants (which need not be prime powers).
Input:
Alternatively, you can also give input in the following form:
AbelianGroup(invfac, names="f")
,
where names must be explicitly named.
sage: F = AbelianGroup(5, [5,5,7,8,9], names='abcde') sage: F(1) 1 sage: (a, b, c, d, e) = F.gens() sage: mul([ a, b, a, c, b, d, c, d ], F(1)) a^2*b^2*c^2*d^2 sage: d * b**2 * c**3 b^2*c^3*d sage: F = AbelianGroup(3,[2]*3); F Multiplicative Abelian Group isomorphic to C2 x C2 x C2 sage: H = AbelianGroup([2,3], names="xy"); H Multiplicative Abelian Group isomorphic to C2 x C3 sage: AbelianGroup(5) Multiplicative Abelian Group isomorphic to Z x Z x Z x Z x Z sage: AbelianGroup(5).order() +Infinity
Notice how 0 's are padded on.
sage: AbelianGroup(5, [2,3,4]) Multiplicative Abelian Group isomorphic to Z x Z x C2 x C3 x C4
The invariant list can't be longer than the number of generators.
sage: AbelianGroup(2, [2,3,4]) Traceback (most recent call last): ... ValueError: invfac (=[2, 3, 4]) must have length n (=2)
x) |
Return True if
is an abelian group.
sage: F = AbelianGroup(5,[5,5,7,8,9],names = list("abcde")); F Multiplicative Abelian Group isomorphic to C5 x C5 x C7 x C8 x C9 sage: is_AbelianGroup(F) True sage: is_AbelianGroup(AbelianGroup(7, [3]*7)) True
words, g, [verbose=False]) |
G and H are abelian, g in G, H is a subgroup of G generated by a list (words) of elements of G. If g is in H, return the expression for g as a word in the elements of (words).
The 'word problem' for a finite abelian group G boils down to the following matrix-vector analog of the Chinese remainder theorem.
Problem: Fix integers
(indeed,
these
will all be prime powers), fix a generating set
(with
),
for
, for the group
, and let
be an element of the direct product
. Find, if they exist,
integers
such that
. In other words, solve the
equation
for
, where
is the matrix whose
rows are the
's. Of course, it suffices to restrict the
's
to the range
, where
denotes the least common
multiple of the integers
.
This function does not solve this directly, as perhaps it should. Rather (for both speed and as a model for a similar function valid for more general groups), it pushes it over to GAP, which has optimized algorithms for the word problem. Essentially, this function is a wrapper for the GAP function 'Factorization'.
sage: G.<a,b,c> = AbelianGroup(3,[2,3,4]); G Multiplicative Abelian Group isomorphic to C2 x C3 x C4 sage: word_problem([a*b,a*c], b*c) [[a*b, 1], [a*c, 1]] sage: word_problem([a*c,c],a) [[a*c, 1], [c, -1]] sage: word_problem([a*c,c],a,verbose=True) a = (a*c)^1*(c)^-1 [[a*c, 1], [c, -1]]
sage: A.<a,b,c,d,e> = AbelianGroup(5,[4, 5, 5, 7, 8]) sage: b1 = a^3*b*c*d^2*e^5 sage: b2 = a^2*b*c^2*d^3*e^3 sage: b3 = a^7*b^3*c^5*d^4*e^4 sage: b4 = a^3*b^2*c^2*d^3*e^5 sage: b5 = a^2*b^4*c^2*d^4*e^5 sage: word_problem([b1,b2,b3,b4,b5],e) [[a^3*b*c*d^2*e^5, 1], [a^2*b*c^2*d^3*e^3, 1], [a^3*b^3*d^4*e^4, 3], [a^2*b^4*c^2*d^4*e^5, 1]] sage: word_problem([a,b,c,d,e],e) [[e, 1]] sage: word_problem([a,b,c,d,e],b) [[b, 1]]
WARNINGS: (1) Might have unpleasant effect when the word problem cannot be solved.
(2) Uses permutation groups, so may be slow when group is large. The instance method word_problem of the class AbelianGroupElement is implemented differently (wrapping GAP's"EpimorphismFromFreeGroup" and "PreImagesRepresentative") and may be faster.
Class: AbelianGroup_class
sage: F = AbelianGroup(5,[5,5,7,8,9],names = list("abcde")); F Multiplicative Abelian Group isomorphic to C5 x C5 x C7 x C8 x C9 sage: F = AbelianGroup(5,[2, 4, 12, 24, 120],names = list("abcde")); F Multiplicative Abelian Group isomorphic to C2 x C4 x C12 x C24 x C120 sage: F.elementary_divisors() [2, 3, 3, 3, 4, 4, 5, 8, 8]
Thus we see that the "invariants" are not the invariant factors but the "elementary divisors" (in the terminology of Rotman [R]). The entry 1 in the list of invariants is ignored:
sage: F = AbelianGroup(3,[1,2,3],names='a') sage: F.invariants() [2, 3] sage: F.gens() (a0, a1) sage: F.ngens() 2 sage: (F.0).order() 2 sage: (F.1).order() 3 sage: AbelianGroup(1, [1], names='e') Multiplicative Abelian Group isomorphic to C1 sage: AbelianGroup(1, [1], names='e').gens() (e,) sage: AbelianGroup(1, [1], names='e').list() [1] sage: AbelianGroup(3, [2, 1, 2], names=list('abc')).list() [1, b, a, a*b]
self, n, invfac, [names=f]) |
Functions: dual_group,
elementary_divisors,
exponent,
gen,
invariants,
is_commutative,
list,
ngens,
order,
permutation_group,
random_element,
subgroup
self) |
Returns the dual group.
self) |
sage: G = AbelianGroup(2,[2,6]) sage: G Multiplicative Abelian Group isomorphic to C2 x C6 sage: G.invariants() [2, 6] sage: G.elementary_divisors() [2, 2, 3] sage: J = AbelianGroup([1,3,5,12]) sage: J.elementary_divisors() [3, 3, 4, 5]
self) |
Return the exponent of this abelian group.
sage: G = AbelianGroup([2,3,7]); G Multiplicative Abelian Group isomorphic to C2 x C3 x C7 sage: G.exponent() 42
self, [i=0]) |
The
-th generator of the abelian group.
sage: F = AbelianGroup(5,[],names='a') sage: F.0 a0 sage: F.2 a2 sage: F.invariants() [0, 0, 0, 0, 0]
self) |
Return a copy of the list of invariants of this group.
It is safe to modify the returned list.
sage: J = AbelianGroup([2,3]) sage: J.invariants() [2, 3] sage: v = J.invariants(); v [2, 3] sage: v[0] = 5 sage: J.invariants() [2, 3] sage: J.invariants() is J.invariants() False
self) |
Return True since this group is commutative.
sage: G = AbelianGroup([2,3,9, 0]) sage: G.is_commutative() True sage: G.is_abelian() True
self) |
Return list of all elements of this group.
sage: G = AbelianGroup([2,3], names = "ab") sage: G.list() [1, b, b^2, a, a*b, a*b^2]
self) |
The number of free generators of the abelian group.
sage: F = AbelianGroup(10000) sage: F.ngens() 10000
self) |
Return the order of this group.
sage: G = AbelianGroup(2,[2,3]) sage: G.order() 6 sage: G = AbelianGroup(3,[2,3,0]) sage: G.order() +Infinity
self) |
Return the permutation group isomorphic to this abelian group.
If the invariants are
then the generators
of the permutation will be of order
,
respectively.
sage: G = AbelianGroup(2,[2,3]); G Multiplicative Abelian Group isomorphic to C2 x C3 sage: G.permutation_group() Permutation Group with generators [(1,4)(2,5)(3,6), (1,2,3)(4,5,6)]
self) |
Return a random element of this group. (Renamed random to random_element.)
sage: G = AbelianGroup([2,3,9]) sage: G.random_element() f0*f1^2*f2
self, gensH, [names=f]) |
Create a subgroup of this group. The "big" group must be defined using "named" generators.
Input:
sage: G.<a,b,c> = AbelianGroup(3, [2,3,4]); G Multiplicative Abelian Group isomorphic to C2 x C3 x C4 sage: H = G.subgroup([a*b,a]); H Multiplicative Abelian Group isomorphic to C2 x C3, which is the subgroup of Multiplicative Abelian Group isomorphic to C2 x C3 x C4 generated by [a*b, a] sage: H < G True sage: F = G.subgroup([a,b^2]) sage: F Multiplicative Abelian Group isomorphic to C2 x C3, which is the subgroup of Multiplicative Abelian Group isomorphic to C2 x C3 x C4 generated by [a, b^2] sage: F.gens() [a, b^2] sage: F = AbelianGroup(5,[30,64,729],names = list("abcde")) sage: a,b,c,d,e = F.gens() sage: F.subgroup([a,b]) Multiplicative Abelian Group isomorphic to Z x Z, which is the subgroup of Multiplicative Abelian Group isomorphic to Z x Z x C30 x C64 x C729 generated by [a, b] sage: F.subgroup([c,e]) Multiplicative Abelian Group isomorphic to C2 x C3 x C5 x C729, which is the subgroup of Multiplicative Abelian Group isomorphic to Z x Z x C30 x C64 x C729 generated by [c, e]
Special Functions: __call__,
__contains__,
__eq__,
__ge__,
__gt__,
__init__,
__iter__,
__le__,
__lt__,
__ne__,
_gap_init_,
_group_notation,
_latex_,
_repr_
self, x) |
Create an element of this abelian group from
.
sage: F = AbelianGroup(10, [2]*10) sage: F(F.2) f2 sage: F(1) 1
self, x) |
Return True if
is an element of this abelian group.
sage: F = AbelianGroup(10,[2]*10) sage: F.2 * F.3 in F True
self, right) |
Compare self and right.
The ordering is the ordering induced by that on the invariant factors lists.
sage: G1 = AbelianGroup([2,3,4,5]) sage: G2 = AbelianGroup([2,3,4,5,1]) sage: G1 < G2 False sage: G1 > G2 False sage: G1 == G2 True
self) |
Return an iterator over the elements of this group.
sage: G = AbelianGroup([2,3], names = "ab") sage: [a for a in G] [1, b, b^2, a, a*b, a*b^2]
self, right) |
sage: G.<a, b> = AbelianGroup(2) sage: H.<c> = AbelianGroup(1) sage: H < G False
self) |
Return string that defines corresponding abelian group in GAP.
sage: G = AbelianGroup([2,3,9]) sage: G._gap_init_() 'AbelianGroup([2, 3, 9])' sage: gap(G) Group( [ f1, f2, f3 ] )
Only works for finite groups.
sage: G = AbelianGroup(3,[0,3,4],names="abc"); G Multiplicative Abelian Group isomorphic to Z x C3 x C4 sage: G._gap_init_() Traceback (most recent call last): ... TypeError: abelian groups in GAP are finite, but self is infinite
self) |
Return latex representation of this group.
sage: F = AbelianGroup(10, [2]*10) sage: F._latex_() '${\rm AbelianGroup}( 10, [2, 2, 2, 2, 2, 2, 2, 2, 2, 2] )$'
Class: AbelianGroup_subgroup
TODO: * There should be a way to coerce an element of a subgroup into the ambient group.
self, ambient, gens, [names=f]) |
sage: F = AbelianGroup(5,[30,64,729],names = list("abcde")) sage: a,b,c,d,e = F.gens() sage: F.subgroup([a^3,b]) Multiplicative Abelian Group isomorphic to Z x Z, which is the subgroup of Multiplicative Abelian Group isomorphic to Z x Z x C30 x C64 x C729 generated by [a^3, b]
sage: F.subgroup([c]) Multiplicative Abelian Group isomorphic to C2 x C3 x C5, which is the subgroup of Multiplicative Abelian Group isomorphic to Z x Z x C30 x C64 x C729 generated by [c]
sage: F.subgroup([a,c]) Multiplicative Abelian Group isomorphic to C2 x C3 x C5 x Z, which is the subgroup of Multiplicative Abelian Group isomorphic to Z x Z x C30 x C64 x C729 generated by [a, c]
sage: F.subgroup([a,b*c]) Multiplicative Abelian Group isomorphic to Z x Z, which is the subgroup of Multiplicative Abelian Group isomorphic to Z x Z x C30 x C64 x C729 generated by [a, b*c]
sage: F.subgroup([b*c,d]) Multiplicative Abelian Group isomorphic to C64 x Z, which is the subgroup of Multiplicative Abelian Group isomorphic to Z x Z x C30 x C64 x C729 generated by [b*c, d]
sage: F.subgroup([a*b,c^6,d],names = list("xyz")) Multiplicative Abelian Group isomorphic to C5 x C64 x Z, which is the subgroup of Multiplicative Abelian Group isomorphic to Z x Z x C30 x C64 x C729 generated by [a*b, c^6, d]
sage: H.<x,y,z> = F.subgroup([a*b, c^6, d]); H Multiplicative Abelian Group isomorphic to C5 x C64 x Z, which is the subgroup of Multiplicative Abelian Group isomorphic to Z x Z x C30 x C64 x C729 generated by [a*b, c^6, d]
sage: G = F.subgroup([a*b,c^6,d],names = list("xyz")); G Multiplicative Abelian Group isomorphic to C5 x C64 x Z, which is the subgroup of Multiplicative Abelian Group isomorphic to Z x Z x C30 x C64 x C729 generated by [a*b, c^6, d] sage: x,y,z = G.gens() sage: x.order() +Infinity sage: y.order() 5 sage: z.order() 64 sage: A = AbelianGroup(5,[3, 5, 5, 7, 8], names = "abcde") sage: a,b,c,d,e = A.gens() sage: A.subgroup([a,b]) Multiplicative Abelian Group isomorphic to C3 x C5, which is the subgroup of Multiplicative Abelian Group isomorphic to C3 x C5 x C5 x C7 x C8 generated by [a, b] sage: A.subgroup([a,b,c,d^2,e]) Multiplicative Abelian Group isomorphic to C3 x C5 x C5 x C7 x C8, which is the subgroup of Multiplicative Abelian Group isomorphic to C3 x C5 x C5 x C7 x C8 generated by [a, b, c, d^2, e] sage: A.subgroup([a,b,c,d^2,e^2]) Multiplicative Abelian Group isomorphic to C3 x C4 x C5 x C5 x C7, which is the subgroup of Multiplicative Abelian Group isomorphic to C3 x C5 x C5 x C7 x C8 generated by [a, b, c, d^2, e^2] sage: B = A.subgroup([a^3,b,c,d,e^2]); B Multiplicative Abelian Group isomorphic to C4 x C5 x C5 x C7, which is the subgroup of Multiplicative Abelian Group isomorphic to C3 x C5 x C5 x C7 x C8 generated by [b, c, d, e^2] sage: B.invariants() [4, 5, 5, 7] sage: A = AbelianGroup(4,[1009, 2003, 3001, 4001], names = "abcd") sage: a,b,c,d = A.gens() sage: B = A.subgroup([a^3,b,c,d]) sage: B.invariants() [1009, 2003, 3001, 4001] sage: A.order() 24266473210027 sage: B.order() 24266473210027 sage: A = AbelianGroup(4,[1008, 2003, 3001, 4001], names = "abcd") sage: a,b,c,d = A.gens() sage: B = A.subgroup([a^3,b,c,d]); B Multiplicative Abelian Group isomorphic to C3 x C7 x C16 x C2003 x C3001 x C4001, which is the subgroup of Multiplicative Abelian Group isomorphic to C1008 x C2003 x C3001 x C4001 generated by [a^3, b, c, d]
Infinite groups can also be handled:
sage: G = AbelianGroup([3,4,0], names = "abc") sage: a,b,c = G.gens() sage: F = G.subgroup([a,b^2,c]); F Multiplicative Abelian Group isomorphic to C2 x C3 x Z, which is the subgroup of Multiplicative Abelian Group isomorphic to C3 x C4 x Z generated by [a, b^2, c]
sage: F.invariants() [2, 3, 0] sage: F.gens() [a, b^2, c] sage: F.order() +Infinity
Functions: ambient_group,
gen,
gens,
invs
self) |
Return the ambient group related to self.
self, n) |
Return the nth generator of this subgroup.
sage: G.<a,b> = AbelianGroup(2) sage: A = G.subgroup([a]) sage: A.gen(0) a
self) |
Return the generators for this subgroup.
self) |
Return the invariants for this subgroup.
Special Functions: __contains__,
__eq__,
__init__,
_repr_
self, x) |
Return True if
is an element of this subgroup.
sage: G.<a,b> = AbelianGroup(2) sage: A = G.subgroup([a]) sage: a in G True sage: a in A True
self, right) |
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: F=G.subgroup([a,b^2]); F Multiplicative Abelian Group isomorphic to C2 x C3, which is the subgroup of Multiplicative Abelian Group isomorphic to C2 x C3 x C4 generated by [a, b^2] sage: F<G True
sage: A = AbelianGroup(1, [6]) sage: A.subgroup(list(A.gens())) == A True
sage: G.<a,b> = AbelianGroup(2) sage: A = G.subgroup([a]) sage: B = G.subgroup([b]) sage: A == B False
See About this document... for information on suggesting changes.