Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
sagemath
GitHub Repository: sagemath/sagesmc
Path: blob/master/src/sage/groups/libgap_group.py
8814 views
1
"""
2
Generic LibGAP-based Group
3
4
This is useful if you need to use a GAP group implementation in Sage
5
that does not have a dedicated Sage interface.
6
7
If you want to implement your own group class, you should not derive
8
from this but directly from
9
:class:`~sage.groups.libgap_wrapper.ParentLibGAP`.
10
11
EXAMPLES::
12
13
sage: F.<a,b> = FreeGroup()
14
sage: G_gap = libgap.Group([ (a*b^2).gap() ])
15
sage: from sage.groups.libgap_group import GroupLibGAP
16
sage: G = GroupLibGAP(G_gap); G
17
Group([ a*b^2 ])
18
sage: type(G)
19
<class 'sage.groups.libgap_group.GroupLibGAP_with_category'>
20
sage: G.gens()
21
(a*b^2,)
22
"""
23
24
##############################################################################
25
# Copyright (C) 2013 Volker Braun <[email protected]>
26
#
27
# Distributed under the terms of the GNU General Public License (GPL)
28
#
29
# The full text of the GPL is available at:
30
#
31
# http://www.gnu.org/licenses/
32
##############################################################################
33
34
35
from sage.groups.group import Group
36
from sage.groups.libgap_wrapper import ParentLibGAP, ElementLibGAP
37
38
class GroupLibGAP(Group, ParentLibGAP):
39
40
Element = ElementLibGAP
41
42
def __init__(self, *args, **kwds):
43
"""
44
Group interface for LibGAP-based groups.
45
46
INPUT:
47
48
Same as :class:`~sage.groups.libgap_wrapper.ParentLibGAP`.
49
50
TESTS::
51
52
sage: F.<a,b> = FreeGroup()
53
sage: G_gap = libgap.Group([ (a*b^2).gap() ])
54
sage: from sage.groups.libgap_group import GroupLibGAP
55
sage: G = GroupLibGAP(G_gap); G
56
Group([ a*b^2 ])
57
sage: g = G.gen(0); g
58
a*b^2
59
sage: TestSuite(G).run(skip=['_test_pickling', '_test_elements'])
60
sage: TestSuite(g).run(skip=['_test_pickling'])
61
"""
62
ParentLibGAP.__init__(self, *args, **kwds)
63
Group.__init__(self)
64
65
66
67
68
69