passagemath-groups 10.6.45__cp314-cp314-macosx_13_0_arm64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- passagemath_groups/.dylibs/libgap.10.dylib +0 -0
- passagemath_groups/.dylibs/libgmp.10.dylib +0 -0
- passagemath_groups/.dylibs/libreadline.8.2.dylib +0 -0
- passagemath_groups/.dylibs/libz.1.3.1.dylib +0 -0
- passagemath_groups/__init__.py +3 -0
- passagemath_groups-10.6.45.dist-info/METADATA +113 -0
- passagemath_groups-10.6.45.dist-info/RECORD +40 -0
- passagemath_groups-10.6.45.dist-info/WHEEL +6 -0
- passagemath_groups-10.6.45.dist-info/top_level.txt +3 -0
- sage/all__sagemath_groups.py +21 -0
- sage/geometry/all__sagemath_groups.py +1 -0
- sage/geometry/palp_normal_form.cpython-314-darwin.so +0 -0
- sage/geometry/palp_normal_form.pyx +401 -0
- sage/groups/abelian_gps/all.py +25 -0
- sage/groups/all.py +5 -0
- sage/groups/all__sagemath_groups.py +32 -0
- sage/groups/artin.py +1074 -0
- sage/groups/braid.py +3806 -0
- sage/groups/cactus_group.py +1001 -0
- sage/groups/cubic_braid.py +2052 -0
- sage/groups/finitely_presented.py +1896 -0
- sage/groups/finitely_presented_catalog.py +27 -0
- sage/groups/finitely_presented_named.py +592 -0
- sage/groups/fqf_orthogonal.py +579 -0
- sage/groups/free_group.py +944 -0
- sage/groups/group_exp.py +360 -0
- sage/groups/group_semidirect_product.py +504 -0
- sage/groups/kernel_subgroup.py +231 -0
- sage/groups/lie_gps/all.py +1 -0
- sage/groups/lie_gps/catalog.py +8 -0
- sage/groups/lie_gps/nilpotent_lie_group.py +945 -0
- sage/groups/misc_gps/all.py +1 -0
- sage/groups/misc_gps/misc_groups.py +11 -0
- sage/groups/misc_gps/misc_groups_catalog.py +33 -0
- sage/groups/raag.py +866 -0
- sage/groups/semimonomial_transformations/all.py +1 -0
- sage/groups/semimonomial_transformations/semimonomial_transformation.cpython-314-darwin.so +0 -0
- sage/groups/semimonomial_transformations/semimonomial_transformation.pxd +9 -0
- sage/groups/semimonomial_transformations/semimonomial_transformation.pyx +346 -0
- sage/groups/semimonomial_transformations/semimonomial_transformation_group.py +512 -0
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# sage_setup: distribution = sagemath-groups
|
|
2
|
+
"""
|
|
3
|
+
Type ``groups.presentation.<tab>`` to access examples
|
|
4
|
+
of groups implemented as finite presentations (quotients of
|
|
5
|
+
free groups).
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
# groups imported here will be available
|
|
9
|
+
# via groups.presentation.<tab>
|
|
10
|
+
#
|
|
11
|
+
# Do not use this file for code
|
|
12
|
+
#
|
|
13
|
+
# If you import a new group, then add an
|
|
14
|
+
# entry to the list in the module-level
|
|
15
|
+
# docstring of groups/groups_catalog.py
|
|
16
|
+
|
|
17
|
+
from .finitely_presented_named import DihedralPresentation as Dihedral
|
|
18
|
+
from .finitely_presented_named import CyclicPresentation as Cyclic
|
|
19
|
+
from .finitely_presented_named import DiCyclicPresentation as DiCyclic
|
|
20
|
+
from .finitely_presented_named import FinitelyGeneratedAbelianPresentation as FGAbelian
|
|
21
|
+
from .finitely_presented_named import FinitelyGeneratedHeisenbergPresentation as Heisenberg
|
|
22
|
+
from .finitely_presented_named import KleinFourPresentation as KleinFour
|
|
23
|
+
from .finitely_presented_named import SymmetricPresentation as Symmetric
|
|
24
|
+
from .finitely_presented_named import QuaternionPresentation as Quaternion
|
|
25
|
+
from .finitely_presented_named import AlternatingPresentation as Alternating
|
|
26
|
+
from .finitely_presented_named import BinaryDihedralPresentation as BinaryDihedral
|
|
27
|
+
from .finitely_presented_named import CactusPresentation as Cactus
|
|
@@ -0,0 +1,592 @@
|
|
|
1
|
+
# sage_setup: distribution = sagemath-groups
|
|
2
|
+
r"""
|
|
3
|
+
Named Finitely Presented Groups
|
|
4
|
+
|
|
5
|
+
Construct groups of small order and "named" groups as quotients of free groups. These
|
|
6
|
+
groups are available through tab completion by typing ``groups.presentation.<tab>``
|
|
7
|
+
or by importing the required methods. Tab completion is made available through
|
|
8
|
+
Sage's :ref:`group catalog <sage.groups.groups_catalog>`. Some examples are engineered
|
|
9
|
+
from entries in [TW1980]_.
|
|
10
|
+
|
|
11
|
+
Groups available as finite presentations:
|
|
12
|
+
|
|
13
|
+
- Alternating group, `A_n` of order `n!/2` --
|
|
14
|
+
:func:`groups.presentation.Alternating <sage.groups.finitely_presented_named.AlternatingPresentation>`
|
|
15
|
+
|
|
16
|
+
- the `n`-fruit Cactus group, a standard notation for which is `J_n` --
|
|
17
|
+
:func:`groups.presentation.Cactus <sage.groups.finitely_presented_named.CactusPresentation>`
|
|
18
|
+
|
|
19
|
+
- Cyclic group, `C_n` of order `n` --
|
|
20
|
+
:func:`groups.presentation.Cyclic <sage.groups.finitely_presented_named.CyclicPresentation>`
|
|
21
|
+
|
|
22
|
+
- Dicyclic group, nonabelian groups of order `4n` with a unique element of
|
|
23
|
+
order 2 --
|
|
24
|
+
:func:`groups.presentation.DiCyclic <sage.groups.finitely_presented_named.DiCyclicPresentation>`
|
|
25
|
+
|
|
26
|
+
- Dihedral group, `D_n` of order `2n` --
|
|
27
|
+
:func:`groups.presentation.Dihedral <sage.groups.finitely_presented_named.DihedralPresentation>`
|
|
28
|
+
|
|
29
|
+
- Finitely generated abelian group, `\ZZ_{n_1} \times \ZZ_{n_2} \times \cdots \times \ZZ_{n_k}` --
|
|
30
|
+
:func:`groups.presentation.FGAbelian <sage.groups.finitely_presented_named.FinitelyGeneratedAbelianPresentation>`
|
|
31
|
+
|
|
32
|
+
- Finitely generated Heisenberg group --
|
|
33
|
+
:func:`groups.presentation.Heisenberg <sage.groups.finitely_presented_named.FinitelyGeneratedHeisenbergPresentation>`
|
|
34
|
+
|
|
35
|
+
- Klein four group, `C_2 \times C_2` --
|
|
36
|
+
:func:`groups.presentation.KleinFour <sage.groups.finitely_presented_named.KleinFourPresentation>`
|
|
37
|
+
|
|
38
|
+
- Quaternion group of order 8 --
|
|
39
|
+
:func:`groups.presentation.Quaternion <sage.groups.finitely_presented_named.QuaternionPresentation>`
|
|
40
|
+
|
|
41
|
+
- Symmetric group, `S_n` of order `n!` --
|
|
42
|
+
:func:`groups.presentation.Symmetric <sage.groups.finitely_presented_named.SymmetricPresentation>`
|
|
43
|
+
|
|
44
|
+
AUTHORS:
|
|
45
|
+
|
|
46
|
+
- Davis Shurbert (2013-06-21): initial version
|
|
47
|
+
|
|
48
|
+
EXAMPLES::
|
|
49
|
+
|
|
50
|
+
sage: groups.presentation.Cyclic(4)
|
|
51
|
+
Finitely presented group < a | a^4 >
|
|
52
|
+
|
|
53
|
+
You can also import the desired functions::
|
|
54
|
+
|
|
55
|
+
sage: from sage.groups.finitely_presented_named import CyclicPresentation
|
|
56
|
+
sage: CyclicPresentation(4)
|
|
57
|
+
Finitely presented group < a | a^4 >
|
|
58
|
+
"""
|
|
59
|
+
# ****************************************************************************
|
|
60
|
+
# Copyright (C) 2013 Davis Shurbert <davis.sprout@gmail.com>
|
|
61
|
+
#
|
|
62
|
+
# Distributed under the terms of the GNU General Public License (GPL)
|
|
63
|
+
# https://www.gnu.org/licenses/
|
|
64
|
+
# ****************************************************************************
|
|
65
|
+
|
|
66
|
+
from sage.rings.integer import Integer
|
|
67
|
+
from sage.groups.free_group import FreeGroup
|
|
68
|
+
from sage.groups.finitely_presented import FinitelyPresentedGroup
|
|
69
|
+
from sage.libs.gap.libgap import libgap
|
|
70
|
+
from sage.matrix.constructor import diagonal_matrix
|
|
71
|
+
from sage.modules.fg_pid.fgp_module import FGP_Module
|
|
72
|
+
from sage.rings.integer_ring import ZZ
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
def CyclicPresentation(n):
|
|
76
|
+
r"""
|
|
77
|
+
Build cyclic group of order `n` as a finitely presented group.
|
|
78
|
+
|
|
79
|
+
INPUT:
|
|
80
|
+
|
|
81
|
+
- ``n`` -- the order of the cyclic presentation to be returned
|
|
82
|
+
|
|
83
|
+
OUTPUT: the cyclic group of order `n` as finite presentation
|
|
84
|
+
|
|
85
|
+
EXAMPLES::
|
|
86
|
+
|
|
87
|
+
sage: groups.presentation.Cyclic(10)
|
|
88
|
+
Finitely presented group < a | a^10 >
|
|
89
|
+
sage: n = 8; C = groups.presentation.Cyclic(n)
|
|
90
|
+
sage: C.as_permutation_group().is_isomorphic(CyclicPermutationGroup(n))
|
|
91
|
+
True
|
|
92
|
+
|
|
93
|
+
TESTS::
|
|
94
|
+
|
|
95
|
+
sage: groups.presentation.Cyclic(0)
|
|
96
|
+
Traceback (most recent call last):
|
|
97
|
+
...
|
|
98
|
+
ValueError: finitely presented group order must be positive
|
|
99
|
+
"""
|
|
100
|
+
n = Integer(n)
|
|
101
|
+
if n < 1:
|
|
102
|
+
raise ValueError('finitely presented group order must be positive')
|
|
103
|
+
F = FreeGroup('a')
|
|
104
|
+
rls = F([1])**n,
|
|
105
|
+
return FinitelyPresentedGroup(F, rls)
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
def FinitelyGeneratedAbelianPresentation(int_list):
|
|
109
|
+
r"""
|
|
110
|
+
Return canonical presentation of finitely generated abelian group.
|
|
111
|
+
|
|
112
|
+
INPUT:
|
|
113
|
+
|
|
114
|
+
- ``int_list`` -- list of integers defining the group to be returned, the defining list
|
|
115
|
+
is reduced to the invariants of the input list before generating the corresponding
|
|
116
|
+
group
|
|
117
|
+
|
|
118
|
+
OUTPUT:
|
|
119
|
+
|
|
120
|
+
Finitely generated abelian group, `\ZZ_{n_1} \times \ZZ_{n_2} \times \cdots \times \ZZ_{n_k}`
|
|
121
|
+
as a finite presentation, where `n_i` forms the invariants of the input list.
|
|
122
|
+
|
|
123
|
+
EXAMPLES::
|
|
124
|
+
|
|
125
|
+
sage: groups.presentation.FGAbelian([2,2])
|
|
126
|
+
Finitely presented group < a, b | a^2, b^2, a^-1*b^-1*a*b >
|
|
127
|
+
sage: groups.presentation.FGAbelian([2,3])
|
|
128
|
+
Finitely presented group < a | a^6 >
|
|
129
|
+
sage: groups.presentation.FGAbelian([2,4])
|
|
130
|
+
Finitely presented group < a, b | a^2, b^4, a^-1*b^-1*a*b >
|
|
131
|
+
|
|
132
|
+
You can create free abelian groups::
|
|
133
|
+
|
|
134
|
+
sage: groups.presentation.FGAbelian([0])
|
|
135
|
+
Finitely presented group < a | >
|
|
136
|
+
sage: groups.presentation.FGAbelian([0,0])
|
|
137
|
+
Finitely presented group < a, b | a^-1*b^-1*a*b >
|
|
138
|
+
sage: groups.presentation.FGAbelian([0,0,0])
|
|
139
|
+
Finitely presented group < a, b, c | a^-1*b^-1*a*b, a^-1*c^-1*a*c, b^-1*c^-1*b*c >
|
|
140
|
+
|
|
141
|
+
And various infinite abelian groups::
|
|
142
|
+
|
|
143
|
+
sage: groups.presentation.FGAbelian([0,2])
|
|
144
|
+
Finitely presented group < a, b | a^2, a^-1*b^-1*a*b >
|
|
145
|
+
sage: groups.presentation.FGAbelian([0,2,2])
|
|
146
|
+
Finitely presented group < a, b, c | a^2, b^2, a^-1*b^-1*a*b, a^-1*c^-1*a*c, b^-1*c^-1*b*c >
|
|
147
|
+
|
|
148
|
+
Outputs are reduced to minimal generators and relations::
|
|
149
|
+
|
|
150
|
+
sage: groups.presentation.FGAbelian([3,5,2,7,3])
|
|
151
|
+
Finitely presented group < a, b | a^3, b^210, a^-1*b^-1*a*b >
|
|
152
|
+
sage: groups.presentation.FGAbelian([3,210])
|
|
153
|
+
Finitely presented group < a, b | a^3, b^210, a^-1*b^-1*a*b >
|
|
154
|
+
|
|
155
|
+
The trivial group is an acceptable output::
|
|
156
|
+
|
|
157
|
+
sage: groups.presentation.FGAbelian([])
|
|
158
|
+
Finitely presented group < | >
|
|
159
|
+
sage: groups.presentation.FGAbelian([1])
|
|
160
|
+
Finitely presented group < | >
|
|
161
|
+
sage: groups.presentation.FGAbelian([1,1,1,1,1,1,1,1,1,1])
|
|
162
|
+
Finitely presented group < | >
|
|
163
|
+
|
|
164
|
+
Input list must consist of positive integers::
|
|
165
|
+
|
|
166
|
+
sage: groups.presentation.FGAbelian([2,6,3,9,-4])
|
|
167
|
+
Traceback (most recent call last):
|
|
168
|
+
...
|
|
169
|
+
ValueError: input list must contain nonnegative entries
|
|
170
|
+
sage: groups.presentation.FGAbelian([2,'a',4])
|
|
171
|
+
Traceback (most recent call last):
|
|
172
|
+
...
|
|
173
|
+
TypeError: unable to convert 'a' to an integer
|
|
174
|
+
|
|
175
|
+
TESTS::
|
|
176
|
+
|
|
177
|
+
sage: ag = groups.presentation.FGAbelian([2,2])
|
|
178
|
+
sage: ag.as_permutation_group().is_isomorphic(groups.permutation.KleinFour())
|
|
179
|
+
True
|
|
180
|
+
sage: G = groups.presentation.FGAbelian([2,4,8])
|
|
181
|
+
sage: C2 = CyclicPermutationGroup(2)
|
|
182
|
+
sage: C4 = CyclicPermutationGroup(4)
|
|
183
|
+
sage: C8 = CyclicPermutationGroup(8)
|
|
184
|
+
sage: gg = (C2.direct_product(C4)[0]).direct_product(C8)[0]
|
|
185
|
+
sage: gg.is_isomorphic(G.as_permutation_group())
|
|
186
|
+
True
|
|
187
|
+
sage: all(groups.presentation.FGAbelian([i]).as_permutation_group().is_isomorphic(groups.presentation.Cyclic(i).as_permutation_group()) for i in [2..35])
|
|
188
|
+
True
|
|
189
|
+
"""
|
|
190
|
+
from sage.groups.free_group import _lexi_gen
|
|
191
|
+
check_ls = [Integer(x) for x in int_list if Integer(x) >= 0]
|
|
192
|
+
if len(check_ls) != len(int_list):
|
|
193
|
+
raise ValueError('input list must contain nonnegative entries')
|
|
194
|
+
|
|
195
|
+
col_sp = diagonal_matrix(int_list).column_space()
|
|
196
|
+
invariants = FGP_Module(ZZ**(len(int_list)), col_sp).invariants()
|
|
197
|
+
name_gen = _lexi_gen()
|
|
198
|
+
F = FreeGroup([next(name_gen) for i in invariants])
|
|
199
|
+
ret_rls = [F([i+1])**invariants[i] for i in range(len(invariants)) if invariants[i] != 0]
|
|
200
|
+
|
|
201
|
+
# Build commutator relations
|
|
202
|
+
gen_pairs = [[F.gen(i),F.gen(j)] for i in range(F.ngens()-1) for j in range(i+1,F.ngens())]
|
|
203
|
+
ret_rls = ret_rls + [x[0]**(-1)*x[1]**(-1)*x[0]*x[1] for x in gen_pairs]
|
|
204
|
+
return FinitelyPresentedGroup(F, tuple(ret_rls))
|
|
205
|
+
|
|
206
|
+
|
|
207
|
+
def FinitelyGeneratedHeisenbergPresentation(n=1, p=0):
|
|
208
|
+
r"""
|
|
209
|
+
Return a finite presentation of the Heisenberg group.
|
|
210
|
+
|
|
211
|
+
The Heisenberg group is the group of `(n+2) \times (n+2)` matrices
|
|
212
|
+
over a ring `R` with diagonal elements equal to 1, first row and
|
|
213
|
+
last column possibly nonzero, and all the other entries equal to zero.
|
|
214
|
+
|
|
215
|
+
INPUT:
|
|
216
|
+
|
|
217
|
+
- ``n`` -- the degree of the Heisenberg group
|
|
218
|
+
|
|
219
|
+
- ``p`` -- (optional) a prime number, where we construct the
|
|
220
|
+
Heisenberg group over the finite field `\ZZ/p\ZZ`
|
|
221
|
+
|
|
222
|
+
OUTPUT: finitely generated Heisenberg group over the finite field
|
|
223
|
+
of order ``p`` or over the integers
|
|
224
|
+
|
|
225
|
+
.. SEEALSO::
|
|
226
|
+
|
|
227
|
+
:class:`~sage.groups.matrix_gps.heisenberg.HeisenbergGroup`
|
|
228
|
+
|
|
229
|
+
EXAMPLES::
|
|
230
|
+
|
|
231
|
+
sage: H = groups.presentation.Heisenberg(); H
|
|
232
|
+
Finitely presented group < x1, y1, z |
|
|
233
|
+
x1*y1*x1^-1*y1^-1*z^-1, z*x1*z^-1*x1^-1, z*y1*z^-1*y1^-1 >
|
|
234
|
+
sage: H.order()
|
|
235
|
+
+Infinity
|
|
236
|
+
sage: r1, r2, r3 = H.relations()
|
|
237
|
+
sage: A = matrix([[1, 1, 0], [0, 1, 0], [0, 0, 1]])
|
|
238
|
+
sage: B = matrix([[1, 0, 0], [0, 1, 1], [0, 0, 1]])
|
|
239
|
+
sage: C = matrix([[1, 0, 1], [0, 1, 0], [0, 0, 1]])
|
|
240
|
+
sage: r1(A, B, C)
|
|
241
|
+
[1 0 0]
|
|
242
|
+
[0 1 0]
|
|
243
|
+
[0 0 1]
|
|
244
|
+
sage: r2(A, B, C)
|
|
245
|
+
[1 0 0]
|
|
246
|
+
[0 1 0]
|
|
247
|
+
[0 0 1]
|
|
248
|
+
sage: r3(A, B, C)
|
|
249
|
+
[1 0 0]
|
|
250
|
+
[0 1 0]
|
|
251
|
+
[0 0 1]
|
|
252
|
+
sage: p = 3
|
|
253
|
+
sage: Hp = groups.presentation.Heisenberg(p=3)
|
|
254
|
+
sage: Hp.order() == p**3
|
|
255
|
+
True
|
|
256
|
+
sage: Hnp = groups.presentation.Heisenberg(n=2, p=3)
|
|
257
|
+
sage: len(Hnp.relations())
|
|
258
|
+
13
|
|
259
|
+
|
|
260
|
+
REFERENCES:
|
|
261
|
+
|
|
262
|
+
- :wikipedia:`Heisenberg_group`
|
|
263
|
+
"""
|
|
264
|
+
n = Integer(n)
|
|
265
|
+
if n < 1:
|
|
266
|
+
raise ValueError('n must be a positive integer')
|
|
267
|
+
|
|
268
|
+
# generators' names are x1, .., xn, y1, .., yn, z
|
|
269
|
+
vx = ['x' + str(i) for i in range(1,n+1)]
|
|
270
|
+
vy = ['y' + str(i) for i in range(1,n+1)]
|
|
271
|
+
str_generators = ', '.join(vx + vy + ['z'])
|
|
272
|
+
|
|
273
|
+
F = FreeGroup(str_generators)
|
|
274
|
+
x = F.gens()[0:n] # list of generators x1, x2, ..., xn
|
|
275
|
+
y = F.gens()[n:2*n] # list of generators x1, x2, ..., xn
|
|
276
|
+
z = F.gen(n*2)
|
|
277
|
+
|
|
278
|
+
def commutator(a, b):
|
|
279
|
+
return a * b * a**-1 * b**-1
|
|
280
|
+
# First set of relations: [xi, yi] = z
|
|
281
|
+
r1 = [commutator(x[i], y[i]) * z**-1 for i in range(n)]
|
|
282
|
+
# Second set of relations: [z, xi] = 1
|
|
283
|
+
r2 = [commutator(z, x[i]) for i in range(n)]
|
|
284
|
+
# Third set of relations: [z, yi] = 1
|
|
285
|
+
r3 = [commutator(z, y[i]) for i in range(n)]
|
|
286
|
+
# Fourth set of relations: [xi, yi] = 1 for i != j
|
|
287
|
+
r4 = [commutator(x[i], y[j]) for i in range(n) for j in range(n) if i != j]
|
|
288
|
+
rls = r1 + r2 + r3 + r4
|
|
289
|
+
|
|
290
|
+
from sage.sets.primes import Primes
|
|
291
|
+
if p not in Primes() and p != 0:
|
|
292
|
+
raise ValueError("p must be 0 or a prime number")
|
|
293
|
+
if p > 0:
|
|
294
|
+
rls += [w**p for w in F.gens()]
|
|
295
|
+
return FinitelyPresentedGroup(F, tuple(rls))
|
|
296
|
+
|
|
297
|
+
|
|
298
|
+
def DihedralPresentation(n):
|
|
299
|
+
r"""
|
|
300
|
+
Build the Dihedral group of order `2n` as a finitely presented group.
|
|
301
|
+
|
|
302
|
+
INPUT:
|
|
303
|
+
|
|
304
|
+
- ``n`` -- the size of the set that `D_n` is acting on
|
|
305
|
+
|
|
306
|
+
OUTPUT: Dihedral group of order `2n`
|
|
307
|
+
|
|
308
|
+
EXAMPLES::
|
|
309
|
+
|
|
310
|
+
sage: D = groups.presentation.Dihedral(7); D
|
|
311
|
+
Finitely presented group < a, b | a^7, b^2, (a*b)^2 >
|
|
312
|
+
sage: D.as_permutation_group().is_isomorphic(DihedralGroup(7))
|
|
313
|
+
True
|
|
314
|
+
|
|
315
|
+
TESTS::
|
|
316
|
+
|
|
317
|
+
sage: n = 9
|
|
318
|
+
sage: D = groups.presentation.Dihedral(n)
|
|
319
|
+
sage: D.ngens() == 2
|
|
320
|
+
True
|
|
321
|
+
sage: groups.presentation.Dihedral(0)
|
|
322
|
+
Traceback (most recent call last):
|
|
323
|
+
...
|
|
324
|
+
ValueError: finitely presented group order must be positive
|
|
325
|
+
"""
|
|
326
|
+
n = Integer( n )
|
|
327
|
+
if n < 1:
|
|
328
|
+
raise ValueError('finitely presented group order must be positive')
|
|
329
|
+
F = FreeGroup([ 'a', 'b' ])
|
|
330
|
+
rls = F([1])**n, F([2])**2, (F([1])*F([2]))**2
|
|
331
|
+
return FinitelyPresentedGroup( F, rls )
|
|
332
|
+
|
|
333
|
+
|
|
334
|
+
def DiCyclicPresentation(n):
|
|
335
|
+
r"""
|
|
336
|
+
Build the dicyclic group of order `4n`, for `n \geq 2`, as a finitely
|
|
337
|
+
presented group.
|
|
338
|
+
|
|
339
|
+
INPUT:
|
|
340
|
+
|
|
341
|
+
- ``n`` -- positive integer, 2 or greater, determining the order of
|
|
342
|
+
the group (`4n`)
|
|
343
|
+
|
|
344
|
+
OUTPUT: the dicyclic group of order `4n` is defined by the presentation
|
|
345
|
+
|
|
346
|
+
.. MATH::
|
|
347
|
+
|
|
348
|
+
\langle a, x \mid a^{2n}=1, x^{2}=a^{n}, x^{-1}ax=a^{-1} \rangle
|
|
349
|
+
|
|
350
|
+
.. NOTE::
|
|
351
|
+
|
|
352
|
+
This group is also available as a permutation group via
|
|
353
|
+
:class:`groups.permutation.DiCyclic <sage.groups.perm_gps.permgroup_named.DiCyclicGroup>`.
|
|
354
|
+
|
|
355
|
+
EXAMPLES::
|
|
356
|
+
|
|
357
|
+
sage: D = groups.presentation.DiCyclic(9); D
|
|
358
|
+
Finitely presented group < a, b | a^18, b^2*a^-9, b^-1*a*b*a >
|
|
359
|
+
sage: D.as_permutation_group().is_isomorphic(groups.permutation.DiCyclic(9))
|
|
360
|
+
True
|
|
361
|
+
|
|
362
|
+
TESTS::
|
|
363
|
+
|
|
364
|
+
sage: Q = groups.presentation.DiCyclic(2)
|
|
365
|
+
sage: Q.as_permutation_group().is_isomorphic(QuaternionGroup())
|
|
366
|
+
True
|
|
367
|
+
sage: for i in [5, 8, 12, 32]:
|
|
368
|
+
....: A = groups.presentation.DiCyclic(i).as_permutation_group()
|
|
369
|
+
....: B = groups.permutation.DiCyclic(i)
|
|
370
|
+
....: assert A.is_isomorphic(B)
|
|
371
|
+
sage: groups.presentation.DiCyclic(1)
|
|
372
|
+
Traceback (most recent call last):
|
|
373
|
+
...
|
|
374
|
+
ValueError: input integer must be greater than 1
|
|
375
|
+
"""
|
|
376
|
+
n = Integer(n)
|
|
377
|
+
if n < 2:
|
|
378
|
+
raise ValueError('input integer must be greater than 1')
|
|
379
|
+
|
|
380
|
+
F = FreeGroup(['a','b'])
|
|
381
|
+
rls = F([1])**(2*n), F([2,2])*F([-1])**n, F([-2,1,2,1])
|
|
382
|
+
return FinitelyPresentedGroup(F, rls)
|
|
383
|
+
|
|
384
|
+
|
|
385
|
+
def SymmetricPresentation(n):
|
|
386
|
+
r"""
|
|
387
|
+
Build the Symmetric group of order `n!` as a finitely presented group.
|
|
388
|
+
|
|
389
|
+
INPUT:
|
|
390
|
+
|
|
391
|
+
- ``n`` -- the size of the underlying set of arbitrary symbols being acted
|
|
392
|
+
on by the Symmetric group of order `n!`
|
|
393
|
+
|
|
394
|
+
OUTPUT:
|
|
395
|
+
|
|
396
|
+
Symmetric group as a finite presentation, implementation uses GAP to find an
|
|
397
|
+
isomorphism from a permutation representation to a finitely presented group
|
|
398
|
+
representation. Due to this fact, the exact output presentation may not be
|
|
399
|
+
the same for every method call on a constant ``n``.
|
|
400
|
+
|
|
401
|
+
EXAMPLES::
|
|
402
|
+
|
|
403
|
+
sage: S4 = groups.presentation.Symmetric(4)
|
|
404
|
+
sage: S4.as_permutation_group().is_isomorphic(SymmetricGroup(4))
|
|
405
|
+
True
|
|
406
|
+
|
|
407
|
+
TESTS::
|
|
408
|
+
|
|
409
|
+
sage: S = [groups.presentation.Symmetric(i) for i in range(1,4)]; S[0].order()
|
|
410
|
+
1
|
|
411
|
+
sage: S[1].order(), S[2].as_permutation_group().is_isomorphic(DihedralGroup(3))
|
|
412
|
+
(2, True)
|
|
413
|
+
sage: S5 = groups.presentation.Symmetric(5)
|
|
414
|
+
sage: perm_S5 = S5.as_permutation_group(); perm_S5.is_isomorphic(SymmetricGroup(5))
|
|
415
|
+
True
|
|
416
|
+
sage: groups.presentation.Symmetric(8).order()
|
|
417
|
+
40320
|
|
418
|
+
"""
|
|
419
|
+
from sage.groups.perm_gps.permgroup_named import SymmetricGroup
|
|
420
|
+
from sage.groups.free_group import _lexi_gen
|
|
421
|
+
|
|
422
|
+
n = Integer(n)
|
|
423
|
+
if n <= 1:
|
|
424
|
+
return FinitelyPresentedGroup(FreeGroup(()), ())
|
|
425
|
+
|
|
426
|
+
perm_rep = SymmetricGroup(n)
|
|
427
|
+
GAP_fp_rep = libgap.Image(libgap.IsomorphismFpGroupByGenerators(perm_rep, perm_rep.gens()))
|
|
428
|
+
image_gens = GAP_fp_rep.FreeGeneratorsOfFpGroup()
|
|
429
|
+
name_itr = _lexi_gen() # Python generator object for variable names
|
|
430
|
+
F = FreeGroup([next(name_itr) for x in perm_rep.gens()])
|
|
431
|
+
ret_rls = tuple([F(rel_word.TietzeWordAbstractWord(image_gens).sage())
|
|
432
|
+
for rel_word in GAP_fp_rep.RelatorsOfFpGroup()])
|
|
433
|
+
return FinitelyPresentedGroup(F, ret_rls)
|
|
434
|
+
|
|
435
|
+
|
|
436
|
+
def QuaternionPresentation():
|
|
437
|
+
r"""
|
|
438
|
+
Build the Quaternion group of order 8 as a finitely presented group.
|
|
439
|
+
|
|
440
|
+
OUTPUT: Quaternion group as a finite presentation
|
|
441
|
+
|
|
442
|
+
EXAMPLES::
|
|
443
|
+
|
|
444
|
+
sage: Q = groups.presentation.Quaternion(); Q
|
|
445
|
+
Finitely presented group < a, b | a^4, b^2*a^-2, a*b*a*b^-1 >
|
|
446
|
+
sage: Q.as_permutation_group().is_isomorphic(QuaternionGroup())
|
|
447
|
+
True
|
|
448
|
+
|
|
449
|
+
TESTS::
|
|
450
|
+
|
|
451
|
+
sage: Q = groups.presentation.Quaternion()
|
|
452
|
+
sage: Q.order(), Q.is_abelian()
|
|
453
|
+
(8, False)
|
|
454
|
+
sage: Q.is_isomorphic(groups.presentation.DiCyclic(2))
|
|
455
|
+
True
|
|
456
|
+
"""
|
|
457
|
+
F = FreeGroup(['a','b'])
|
|
458
|
+
rls = F([1])**4, F([2,2,-1,-1]), F([1,2,1,-2])
|
|
459
|
+
return FinitelyPresentedGroup(F, rls)
|
|
460
|
+
|
|
461
|
+
|
|
462
|
+
def AlternatingPresentation(n):
|
|
463
|
+
r"""
|
|
464
|
+
Build the Alternating group of order `n!/2` as a finitely presented group.
|
|
465
|
+
|
|
466
|
+
INPUT:
|
|
467
|
+
|
|
468
|
+
- ``n`` -- the size of the underlying set of arbitrary symbols being acted
|
|
469
|
+
on by the Alternating group of order `n!/2`
|
|
470
|
+
|
|
471
|
+
OUTPUT:
|
|
472
|
+
|
|
473
|
+
Alternating group as a finite presentation, implementation uses GAP to find an
|
|
474
|
+
isomorphism from a permutation representation to a finitely presented group
|
|
475
|
+
representation. Due to this fact, the exact output presentation may not be
|
|
476
|
+
the same for every method call on a constant ``n``.
|
|
477
|
+
|
|
478
|
+
EXAMPLES::
|
|
479
|
+
|
|
480
|
+
sage: A6 = groups.presentation.Alternating(6)
|
|
481
|
+
sage: A6.as_permutation_group().is_isomorphic(AlternatingGroup(6)), A6.order()
|
|
482
|
+
(True, 360)
|
|
483
|
+
|
|
484
|
+
TESTS:
|
|
485
|
+
|
|
486
|
+
Even permutation tests::
|
|
487
|
+
|
|
488
|
+
sage: A1 = groups.presentation.Alternating(1); A2 = groups.presentation.Alternating(2)
|
|
489
|
+
sage: A1.is_isomorphic(A2), A1.order()
|
|
490
|
+
(True, 1)
|
|
491
|
+
sage: A3 = groups.presentation.Alternating(3); A3.order(), A3.as_permutation_group().is_cyclic()
|
|
492
|
+
(3, True)
|
|
493
|
+
sage: A8 = groups.presentation.Alternating(8); A8.order()
|
|
494
|
+
20160
|
|
495
|
+
"""
|
|
496
|
+
from sage.groups.perm_gps.permgroup_named import AlternatingGroup
|
|
497
|
+
from sage.groups.free_group import _lexi_gen
|
|
498
|
+
|
|
499
|
+
n = Integer(n)
|
|
500
|
+
if n <= 2:
|
|
501
|
+
return FinitelyPresentedGroup(FreeGroup(()), ())
|
|
502
|
+
|
|
503
|
+
perm_rep = AlternatingGroup(n)
|
|
504
|
+
GAP_fp_rep = libgap.Image(libgap.IsomorphismFpGroupByGenerators(perm_rep, perm_rep.gens()))
|
|
505
|
+
image_gens = GAP_fp_rep.FreeGeneratorsOfFpGroup()
|
|
506
|
+
name_itr = _lexi_gen() # Python generator object for variable names
|
|
507
|
+
F = FreeGroup([next(name_itr) for x in perm_rep.gens()])
|
|
508
|
+
ret_rls = tuple([F(rel_word.TietzeWordAbstractWord(image_gens).sage())
|
|
509
|
+
for rel_word in GAP_fp_rep.RelatorsOfFpGroup()])
|
|
510
|
+
return FinitelyPresentedGroup(F, ret_rls)
|
|
511
|
+
|
|
512
|
+
|
|
513
|
+
def KleinFourPresentation():
|
|
514
|
+
r"""
|
|
515
|
+
Build the Klein group of order `4` as a finitely presented group.
|
|
516
|
+
|
|
517
|
+
OUTPUT: Klein four group (`C_2 \times C_2`) as a finitely presented group
|
|
518
|
+
|
|
519
|
+
EXAMPLES::
|
|
520
|
+
|
|
521
|
+
sage: K = groups.presentation.KleinFour(); K
|
|
522
|
+
Finitely presented group < a, b | a^2, b^2, a^-1*b^-1*a*b >
|
|
523
|
+
"""
|
|
524
|
+
F = FreeGroup(['a','b'])
|
|
525
|
+
rls = F([1])**2, F([2])**2, F([-1])*F([-2])*F([1])*F([2])
|
|
526
|
+
return FinitelyPresentedGroup(F, rls)
|
|
527
|
+
|
|
528
|
+
|
|
529
|
+
def BinaryDihedralPresentation(n):
|
|
530
|
+
r"""
|
|
531
|
+
Build a binary dihedral group of order `4n` as a finitely presented group.
|
|
532
|
+
|
|
533
|
+
The binary dihedral group `BD_n` has the following presentation
|
|
534
|
+
(note that there is a typo in [Sun2010]_):
|
|
535
|
+
|
|
536
|
+
.. MATH::
|
|
537
|
+
|
|
538
|
+
BD_n = \langle x, y, z | x^2 = y^2 = z^n = x y z \rangle.
|
|
539
|
+
|
|
540
|
+
INPUT:
|
|
541
|
+
|
|
542
|
+
- ``n`` -- the value `n`
|
|
543
|
+
|
|
544
|
+
OUTPUT: the binary dihedral group of order `4n` as finite presentation
|
|
545
|
+
|
|
546
|
+
EXAMPLES::
|
|
547
|
+
|
|
548
|
+
sage: groups.presentation.BinaryDihedral(9)
|
|
549
|
+
Finitely presented group < x, y, z | x^-2*y^2, x^-2*z^9, x^-1*y*z >
|
|
550
|
+
|
|
551
|
+
TESTS::
|
|
552
|
+
|
|
553
|
+
sage: for n in range(3, 9): # needs sage.modules sage.rings.number_field
|
|
554
|
+
....: P = groups.presentation.BinaryDihedral(n)
|
|
555
|
+
....: M = groups.matrix.BinaryDihedral(n)
|
|
556
|
+
....: assert P.is_isomorphic(M)
|
|
557
|
+
"""
|
|
558
|
+
F = FreeGroup('x,y,z')
|
|
559
|
+
x,y,z = F.gens()
|
|
560
|
+
rls = (x**-2 * y**2, x**-2 * z**n, x**-2 * x*y*z)
|
|
561
|
+
return FinitelyPresentedGroup(F, rls)
|
|
562
|
+
|
|
563
|
+
|
|
564
|
+
def CactusPresentation(n):
|
|
565
|
+
r"""
|
|
566
|
+
Build the `n`-fruit cactus group as a finitely presented group.
|
|
567
|
+
|
|
568
|
+
OUTPUT: Cactus group `J_n` as a finitely presented group
|
|
569
|
+
|
|
570
|
+
EXAMPLES::
|
|
571
|
+
|
|
572
|
+
sage: J3 = groups.presentation.Cactus(3); J3 # needs sage.graphs
|
|
573
|
+
Finitely presented group < s12, s13, s23 |
|
|
574
|
+
s12^2, s13^2, s23^2, s13*s12*s13^-1*s23^-1, s13*s23*s13^-1*s12^-1 >
|
|
575
|
+
"""
|
|
576
|
+
from sage.groups.cactus_group import CactusGroup
|
|
577
|
+
G = CactusGroup(n)
|
|
578
|
+
F = FreeGroup(G.variable_names())
|
|
579
|
+
gens = F.gens()
|
|
580
|
+
rls = [g**2 for g in gens]
|
|
581
|
+
Gg = G.group_generators()
|
|
582
|
+
K = Gg.keys()
|
|
583
|
+
for i,key in enumerate(K):
|
|
584
|
+
for j,key2 in enumerate(K):
|
|
585
|
+
if i == j:
|
|
586
|
+
continue
|
|
587
|
+
x,y = (Gg[key] * Gg[key2])._data
|
|
588
|
+
if key == x and key2 == y:
|
|
589
|
+
continue
|
|
590
|
+
elt = gens[i] * gens[j] * ~gens[K.index(y)] * ~gens[K.index(x)]
|
|
591
|
+
rls.append(elt)
|
|
592
|
+
return FinitelyPresentedGroup(F, tuple(rls))
|