Finitely generated abelian groups with GAP.¶
This module provides a python wrapper for abelian groups in GAP.
EXAMPLES:
sage: from sage.groups.abelian_gps.abelian_group_gap import AbelianGroupGap
sage: AbelianGroupGap([3,5])
Abelian group with gap, generator orders (3, 5)
For infinite abelian groups we use the GAP package Polycyclic
:
sage: AbelianGroupGap([3,0]) # optional - gap_packages
Abelian group with gap, generator orders (3, 0)
AUTHORS:
- Simon Brandhorst (2018-01-17): initial version
-
class
sage.groups.abelian_gps.abelian_group_gap.
AbelianGroupElement_gap
(parent, x, check=True)¶ Bases:
sage.groups.libgap_wrapper.ElementLibGAP
An element of an abelian group via libgap.
EXAMPLES:
sage: from sage.groups.abelian_gps.abelian_group_gap import AbelianGroupGap sage: G = AbelianGroupGap([3,6]) sage: G.gens() (f1, f2)
-
exponents
()¶ Return the tuple of exponents of this element.
OUTPUT:
- a tuple of integers
EXAMPLES:
sage: from sage.groups.abelian_gps.abelian_group_gap import AbelianGroupGap sage: G = AbelianGroupGap([4,7,9]) sage: gens = G.gens() sage: g = gens[0]^2 * gens[1]^4 * gens[2]^8 sage: g.exponents() (2, 4, 8) sage: S = G.subgroup(G.gens()[:1]) sage: s = S.gens()[0] sage: s f1 sage: s.exponents() (1,)
It can handle quite large groups too:
sage: G = AbelianGroupGap([2^10, 5^10]) sage: f1, f2 = G.gens() sage: g = f1^123*f2^789 sage: g.exponents() (123, 789)
Warning
Crashes for very large groups.
Todo
Make exponents work for very large groups. This could be done by using Pcgs in gap.
-
order
()¶ Return the order of this element.
OUTPUT:
- an integer or infinity
EXAMPLES:
sage: from sage.groups.abelian_gps.abelian_group_gap import AbelianGroupGap sage: G = AbelianGroupGap([4]) sage: g = G.gens()[0] sage: g.order() 4 sage: G = AbelianGroupGap([0]) # optional - gap_packages sage: g = G.gens()[0] # optional - gap_packages sage: g.order() # optional - gap_packages +Infinity
-
-
class
sage.groups.abelian_gps.abelian_group_gap.
AbelianGroupElement_polycyclic
(parent, x, check=True)¶ Bases:
sage.groups.abelian_gps.abelian_group_gap.AbelianGroupElement_gap
An element of an abelian group using the GAP package
Polycyclic
.-
exponents
()¶ Return the tuple of exponents of
self
.OUTPUT:
- a tuple of integers
EXAMPLES:
sage: from sage.groups.abelian_gps.abelian_group_gap import AbelianGroupGap sage: G = AbelianGroupGap([4,7,0]) # optional - gap_packages sage: gens = G.gens() # optional - gap_packages sage: g = gens[0]^2 * gens[1]^4 * gens[2]^8 # optional - gap_packages sage: g.exponents() # optional - gap_packages (2, 4, 8)
Efficiently handles very large groups:
sage: G = AbelianGroupGap([2^30,5^30,0]) # optional - gap_packages sage: f1, f2, f3 = G.gens() # optional - gap_packages sage: (f1^12345*f2^123456789).exponents() # optional - gap_packages (12345, 123456789, 0)
-
-
sage.groups.abelian_gps.abelian_group_gap.
AbelianGroupGap
¶ Abelian groups implemented using GAP.
INPUT:
generator_orders
– a list of nonnegative integers where \(0\) gives a factor isomorphic to \(\ZZ\)
OUTPUT:
- an abelian group
EXAMPLES:
sage: from sage.groups.abelian_gps.abelian_group_gap import AbelianGroupGap sage: AbelianGroupGap([3,6]) Abelian group with gap, generator orders (3, 6) sage: AbelianGroupGap([3,6,5]) Abelian group with gap, generator orders (3, 6, 5) sage: AbelianGroupGap([3,6,0]) # optional - gap_packages Abelian group with gap, generator orders (3, 6, 0)
Warning
Needs the GAP package
Polycyclic
in case the group is infinite.
-
sage.groups.abelian_gps.abelian_group_gap.
AbelianGroupSubgroup_gap
¶ Subgroups of abelian groups with GAP.
INPUT:
ambient
– the ambient groupgens
– generators of the subgroup
Note
Do not construct this class directly. Instead use
subgroup()
.EXAMPLES:
sage: from sage.groups.abelian_gps.abelian_group_gap import AbelianGroupGap sage: G = AbelianGroupGap([2,3,4,5]) sage: gen = G.gens()[:2] sage: S = G.subgroup(gen)
-
sage.groups.abelian_gps.abelian_group_gap.
AbelianGroup_gap
¶ Finitely generated abelian groups implemented in GAP.
Needs the gap package
Polycyclic
in case the group is infinite.INPUT:
G
– a GAP groupcategory
– a categoryambient
– (optional) anAbelianGroupGap
EXAMPLES:
sage: from sage.groups.abelian_gps.abelian_group_gap import AbelianGroupGap sage: G = AbelianGroupGap([3, 2, 5]) sage: G Abelian group with gap, generator orders (3, 2, 5)