Skip to content

Commit 55ebb79

Browse files
author
Release Manager
committed
gh-35306: `sage.groups.matrix_gps`: Modularization fixes for imports <!-- ^^^^^ Please provide a concise, informative and self-explanatory title. Don't put issue numbers in there, do this in the PR body below. For example, instead of "Fixes #1234" use "Introduce new method to calculate 1+1" --> ### 📚 Description We move the `...MatrixGroup_gap` classes to separate modules named `..._gap`. This is part of: - #29705 <!-- Describe your changes here in detail --> <!-- Why is this change required? What problem does it solve? --> <!-- If it resolves an open issue, please link to the issue here. For example "Closes #1337" --> ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> <!-- If your change requires a documentation PR, please link it appropriately --> <!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> - [x] I have made sure that the title is self-explanatory and the description concisely explains the PR. - [x] I have linked an issue or discussion. - [ ] I have created tests covering the changes. - [ ] I have updated the documentation accordingly. ### ⌛ Dependencies <!-- List all open pull requests that this PR logically depends on --> <!-- - #xyz: short description why this is a dependency - #abc: ... --> - Depends on #35099 - Depends on #35119 URL: #35306 Reported by: Matthias Köppe Reviewer(s): Kwankyu Lee, Matthias Köppe
2 parents 8bcce63 + 1024a23 commit 55ebb79

32 files changed

+2726
-2461
lines changed

src/doc/en/reference/groups/index.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,17 +72,24 @@ Matrix and Affine Groups
7272

7373
sage/groups/matrix_gps/catalog
7474
sage/groups/matrix_gps/matrix_group
75+
sage/groups/matrix_gps/matrix_group_gap
7576
sage/groups/matrix_gps/group_element
77+
sage/groups/matrix_gps/group_element_gap
7678
sage/groups/matrix_gps/finitely_generated
79+
sage/groups/matrix_gps/finitely_generated_gap
7780
sage/groups/matrix_gps/morphism
7881
sage/groups/matrix_gps/homset
7982
sage/groups/matrix_gps/binary_dihedral
8083
sage/groups/matrix_gps/coxeter_group
8184
sage/groups/matrix_gps/linear
85+
sage/groups/matrix_gps/linear_gap
8286
sage/groups/matrix_gps/orthogonal
87+
sage/groups/matrix_gps/orthogonal_gap
8388
sage/groups/matrix_gps/isometries
8489
sage/groups/matrix_gps/symplectic
90+
sage/groups/matrix_gps/symplectic_gap
8591
sage/groups/matrix_gps/unitary
92+
sage/groups/matrix_gps/unitary_gap
8693
sage/groups/matrix_gps/heisenberg
8794
sage/groups/affine_gps/affine_group
8895
sage/groups/affine_gps/euclidean_group
@@ -115,5 +122,6 @@ Internals
115122
:maxdepth: 1
116123

117124
sage/groups/matrix_gps/named_group
125+
sage/groups/matrix_gps/named_group_gap
118126

119127
.. include:: ../footer.txt

src/sage/categories/primer.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -524,12 +524,12 @@ class implements:
524524
525525
sage: G = GL(2,ZZ)
526526
sage: type(G)
527-
<class 'sage.groups.matrix_gps.linear.LinearMatrixGroup_gap_with_category'>
527+
<class 'sage.groups.matrix_gps.linear_gap.LinearMatrixGroup_gap_with_category'>
528528
529529
Here is a piece of the hierarchy of classes above it::
530530
531531
sage: for cls in G.__class__.mro(): print(cls)
532-
<class 'sage.groups.matrix_gps.linear.LinearMatrixGroup_gap_with_category'>
532+
<class 'sage.groups.matrix_gps.linear_gap.LinearMatrixGroup_gap_with_category'>
533533
...
534534
<class 'sage.categories.groups.Groups.parent_class'>
535535
<class 'sage.categories.monoids.Monoids.parent_class'>

src/sage/combinat/root_system/weyl_group.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@
3939
#
4040
# https://www.gnu.org/licenses/
4141
# ****************************************************************************
42-
from sage.groups.matrix_gps.finitely_generated import FinitelyGeneratedMatrixGroup_gap
43-
from sage.groups.matrix_gps.group_element import MatrixGroupElement_gap
42+
from sage.groups.matrix_gps.finitely_generated_gap import FinitelyGeneratedMatrixGroup_gap
43+
from sage.groups.matrix_gps.group_element_gap import MatrixGroupElement_gap
4444
from sage.groups.perm_gps.permgroup import PermutationGroup_generic
4545
from sage.rings.integer_ring import ZZ
4646
from sage.rings.rational_field import QQ

src/sage/groups/affine_gps/affine_group.py

Lines changed: 41 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -129,11 +129,11 @@ class AffineGroup(UniqueRepresentation, Group):
129129
130130
Some additional ways to create affine groups::
131131
132-
sage: A = AffineSpace(2, GF(4,'a')); A
132+
sage: A = AffineSpace(2, GF(4,'a')); A # optional - sage.rings.finite_rings
133133
Affine Space of dimension 2 over Finite Field in a of size 2^2
134-
sage: G = AffineGroup(A); G
134+
sage: G = AffineGroup(A); G # optional - sage.rings.finite_rings
135135
Affine Group of degree 2 over Finite Field in a of size 2^2
136-
sage: G is AffineGroup(2,4) # shorthand
136+
sage: G is AffineGroup(2,4) # shorthand # optional - sage.rings.finite_rings
137137
True
138138
139139
sage: V = ZZ^3; V
@@ -152,10 +152,10 @@ def __classcall__(cls, *args, **kwds):
152152
153153
EXAMPLES::
154154
155-
sage: A = AffineSpace(2, GF(4,'a'))
156-
sage: AffineGroup(A) is AffineGroup(2,4)
155+
sage: A = AffineSpace(2, GF(4,'a')) # optional - sage.rings.finite_rings
156+
sage: AffineGroup(A) is AffineGroup(2,4) # optional - sage.rings.finite_rings
157157
True
158-
sage: AffineGroup(A) is AffineGroup(2, GF(4,'a'))
158+
sage: AffineGroup(A) is AffineGroup(2, GF(4,'a')) # optional - sage.rings.finite_rings
159159
True
160160
sage: A = AffineGroup(2, QQ)
161161
sage: V = QQ^2
@@ -202,10 +202,10 @@ def __init__(self, degree, ring):
202202
203203
TESTS::
204204
205-
sage: G = AffineGroup(2, GF(5)); G
205+
sage: G = AffineGroup(2, GF(5)); G # optional - sage.rings.finite_rings
206206
Affine Group of degree 2 over Finite Field of size 5
207-
sage: TestSuite(G).run()
208-
sage: G.category()
207+
sage: TestSuite(G).run() # optional - sage.rings.finite_rings
208+
sage: G.category() # optional - sage.rings.finite_rings
209209
Category of finite groups
210210
211211
sage: Aff6 = AffineGroup(6, QQ)
@@ -264,8 +264,8 @@ def _latex_(self):
264264
265265
EXAMPLES::
266266
267-
sage: G = AffineGroup(6, GF(5))
268-
sage: latex(G)
267+
sage: G = AffineGroup(6, GF(5)) # optional - sage.rings.finite_rings
268+
sage: latex(G) # optional - sage.rings.finite_rings
269269
\mathrm{Aff}_{6}(\Bold{F}_{5})
270270
"""
271271
return "\\mathrm{Aff}_{%s}(%s)" % (self.degree(),
@@ -277,7 +277,7 @@ def _repr_(self):
277277
278278
EXAMPLES::
279279
280-
sage: AffineGroup(6, GF(5))
280+
sage: AffineGroup(6, GF(5)) # optional - sage.rings.finite_rings
281281
Affine Group of degree 6 over Finite Field of size 5
282282
"""
283283
return "Affine Group of degree %s over %s" % (self.degree(),
@@ -289,7 +289,7 @@ def cardinality(self):
289289
290290
EXAMPLES::
291291
292-
sage: AffineGroup(6, GF(5)).cardinality()
292+
sage: AffineGroup(6, GF(5)).cardinality() # optional - sage.rings.finite_rings
293293
172882428468750000000000000000
294294
sage: AffineGroup(6, ZZ).cardinality()
295295
+Infinity
@@ -301,17 +301,15 @@ def degree(self):
301301
"""
302302
Return the dimension of the affine space.
303303
304-
OUTPUT:
305-
306-
An integer.
304+
OUTPUT: An integer.
307305
308306
EXAMPLES::
309307
310-
sage: G = AffineGroup(6, GF(5))
311-
sage: g = G.an_element()
312-
sage: G.degree()
308+
sage: G = AffineGroup(6, GF(5)) # optional - sage.rings.finite_rings
309+
sage: g = G.an_element() # optional - sage.rings.finite_rings
310+
sage: G.degree() # optional - sage.rings.finite_rings
313311
6
314-
sage: G.degree() == g.A().nrows() == g.A().ncols() == g.b().degree()
312+
sage: G.degree() == g.A().nrows() == g.A().ncols() == g.b().degree() # optional - sage.rings.finite_rings
315313
True
316314
"""
317315
return self._degree
@@ -329,8 +327,8 @@ def matrix_space(self):
329327
330328
EXAMPLES::
331329
332-
sage: G = AffineGroup(3, GF(5))
333-
sage: G.matrix_space()
330+
sage: G = AffineGroup(3, GF(5)) # optional - sage.rings.finite_rings
331+
sage: G.matrix_space() # optional - sage.rings.finite_rings
334332
Full MatrixSpace of 3 by 3 dense matrices over Finite Field of size 5
335333
"""
336334
d = self.degree()
@@ -343,8 +341,8 @@ def vector_space(self):
343341
344342
EXAMPLES::
345343
346-
sage: G = AffineGroup(3, GF(5))
347-
sage: G.vector_space()
344+
sage: G = AffineGroup(3, GF(5)) # optional - sage.rings.finite_rings
345+
sage: G.vector_space() # optional - sage.rings.finite_rings
348346
Vector space of dimension 3 over Finite Field of size 5
349347
"""
350348
return FreeModule(self.base_ring(), self.degree())
@@ -373,8 +371,8 @@ def linear_space(self):
373371
374372
EXAMPLES::
375373
376-
sage: G = AffineGroup(3, GF(5))
377-
sage: G.linear_space()
374+
sage: G = AffineGroup(3, GF(5)) # optional - sage.rings.finite_rings
375+
sage: G.linear_space() # optional - sage.rings.finite_rings
378376
Full MatrixSpace of 4 by 4 dense matrices over Finite Field of size 5
379377
"""
380378
dp = self.degree() + 1
@@ -388,14 +386,12 @@ def linear(self, A):
388386
389387
- ``A`` -- anything that determines a matrix
390388
391-
OUTPUT:
392-
393-
The affine group element `x \mapsto A x`.
389+
OUTPUT: The affine group element `x \mapsto A x`.
394390
395391
EXAMPLES::
396392
397-
sage: G = AffineGroup(3, GF(5))
398-
sage: G.linear([1,2,3,4,5,6,7,8,0])
393+
sage: G = AffineGroup(3, GF(5)) # optional - sage.rings.finite_rings
394+
sage: G.linear([1,2,3,4,5,6,7,8,0]) # optional - sage.rings.finite_rings
399395
[1 2 3] [0]
400396
x |-> [4 0 1] x + [0]
401397
[2 3 0] [0]
@@ -411,14 +407,12 @@ def translation(self, b):
411407
412408
- ``b`` -- anything that determines a vector
413409
414-
OUTPUT:
415-
416-
The affine group element `x \mapsto x + b`.
410+
OUTPUT: The affine group element `x \mapsto x + b`.
417411
418412
EXAMPLES::
419413
420-
sage: G = AffineGroup(3, GF(5))
421-
sage: G.translation([1,4,8])
414+
sage: G = AffineGroup(3, GF(5)) # optional - sage.rings.finite_rings
415+
sage: G.translation([1,4,8]) # optional - sage.rings.finite_rings
422416
[1 0 0] [1]
423417
x |-> [0 1 0] x + [4]
424418
[0 0 1] [3]
@@ -446,12 +440,12 @@ def reflection(self, v):
446440
447441
EXAMPLES::
448442
449-
sage: G = AffineGroup(3, QQ)
450-
sage: G.reflection([1,0,0])
443+
sage: G = AffineGroup(3, QQ) # optional - sage.rings.finite_rings
444+
sage: G.reflection([1,0,0]) # optional - sage.rings.finite_rings
451445
[-1 0 0] [0]
452446
x |-> [ 0 1 0] x + [0]
453447
[ 0 0 1] [0]
454-
sage: G.reflection([3,4,-5])
448+
sage: G.reflection([3,4,-5]) # optional - sage.rings.finite_rings
455449
[ 16/25 -12/25 3/5] [0]
456450
x |-> [-12/25 9/25 4/5] x + [0]
457451
[ 3/5 4/5 0] [0]
@@ -470,13 +464,13 @@ def random_element(self):
470464
471465
EXAMPLES::
472466
473-
sage: G = AffineGroup(4, GF(3))
474-
sage: G.random_element() # random
467+
sage: G = AffineGroup(4, GF(3)) # optional - sage.rings.finite_rings
468+
sage: G.random_element() # random # optional - sage.rings.finite_rings
475469
[2 0 1 2] [1]
476470
[2 1 1 2] [2]
477471
x |-> [1 0 2 2] x + [2]
478472
[1 1 1 1] [2]
479-
sage: G.random_element() in G
473+
sage: G.random_element() in G # optional - sage.rings.finite_rings
480474
True
481475
"""
482476
A = self._GL.random_element()
@@ -490,8 +484,8 @@ def _an_element_(self):
490484
491485
TESTS::
492486
493-
sage: G = AffineGroup(4,5)
494-
sage: G.an_element() in G
487+
sage: G = AffineGroup(4,5) # optional - sage.rings.finite_rings
488+
sage: G.an_element() in G # optional - sage.rings.finite_rings
495489
True
496490
"""
497491
A = self._GL.an_element()
@@ -504,8 +498,8 @@ def some_elements(self):
504498
505499
EXAMPLES::
506500
507-
sage: G = AffineGroup(4,5)
508-
sage: G.some_elements()
501+
sage: G = AffineGroup(4,5) # optional - sage.rings.finite_rings
502+
sage: G.some_elements() # optional - sage.rings.finite_rings
509503
[ [2 0 0 0] [1]
510504
[0 1 0 0] [0]
511505
x |-> [0 0 1 0] x + [0]
@@ -518,7 +512,7 @@ def some_elements(self):
518512
[0 1 0 0] [...]
519513
x |-> [0 0 1 0] x + [...]
520514
[0 0 0 1] [...]]
521-
sage: all(v.parent() is G for v in G.some_elements())
515+
sage: all(v.parent() is G for v in G.some_elements()) # optional - sage.rings.finite_rings
522516
True
523517
524518
sage: G = AffineGroup(2,QQ)

src/sage/groups/affine_gps/euclidean_group.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
class EuclideanGroup(AffineGroup):
2323
r"""
24-
an Euclidean group.
24+
A Euclidean group.
2525
2626
The Euclidean group `E(A)` (or general affine group) of an affine
2727
space `A` is the group of all invertible affine transformations from
@@ -121,11 +121,11 @@ class EuclideanGroup(AffineGroup):
121121
122122
Some additional ways to create Euclidean groups::
123123
124-
sage: A = AffineSpace(2, GF(4,'a')); A
124+
sage: A = AffineSpace(2, GF(4,'a')); A # optional - sage.rings.finite_rings
125125
Affine Space of dimension 2 over Finite Field in a of size 2^2
126-
sage: G = EuclideanGroup(A); G
126+
sage: G = EuclideanGroup(A); G # optional - sage.rings.finite_rings
127127
Euclidean Group of degree 2 over Finite Field in a of size 2^2
128-
sage: G is EuclideanGroup(2,4) # shorthand
128+
sage: G is EuclideanGroup(2,4) # shorthand # optional - sage.rings.finite_rings
129129
True
130130
131131
sage: V = ZZ^3; V
@@ -144,9 +144,9 @@ class EuclideanGroup(AffineGroup):
144144
sage: V = QQ^6
145145
sage: E6 is EuclideanGroup(V)
146146
True
147-
sage: G = EuclideanGroup(2, GF(5)); G
147+
sage: G = EuclideanGroup(2, GF(5)); G # optional - sage.rings.finite_rings
148148
Euclidean Group of degree 2 over Finite Field of size 5
149-
sage: TestSuite(G).run()
149+
sage: TestSuite(G).run() # optional - sage.rings.finite_rings
150150
151151
REFERENCES:
152152
@@ -195,8 +195,8 @@ def _latex_(self):
195195
r"""
196196
EXAMPLES::
197197
198-
sage: G = EuclideanGroup(6, GF(5))
199-
sage: latex(G)
198+
sage: G = EuclideanGroup(6, GF(5)) # optional - sage.rings.finite_rings
199+
sage: latex(G) # optional - sage.rings.finite_rings
200200
\mathrm{E}_{6}(\Bold{F}_{5})
201201
"""
202202
return "\\mathrm{E}_{%s}(%s)"%(self.degree(), self.base_ring()._latex_())
@@ -207,7 +207,7 @@ def _repr_(self):
207207
208208
EXAMPLES::
209209
210-
sage: EuclideanGroup(6, GF(5))
210+
sage: EuclideanGroup(6, GF(5)) # optional - sage.rings.finite_rings
211211
Euclidean Group of degree 6 over Finite Field of size 5
212212
"""
213213
return "Euclidean Group of degree %s over %s"%(self.degree(), self.base_ring())
@@ -218,18 +218,18 @@ def random_element(self):
218218
219219
EXAMPLES::
220220
221-
sage: G = EuclideanGroup(4, GF(3))
222-
sage: G.random_element() # random
221+
sage: G = EuclideanGroup(4, GF(3)) # optional - sage.rings.finite_rings
222+
sage: G.random_element() # random # optional - sage.rings.finite_rings
223223
[2 1 2 1] [1]
224224
[1 2 2 1] [0]
225225
x |-> [2 2 2 2] x + [1]
226226
[1 1 2 2] [2]
227-
sage: G.random_element() in G
227+
sage: G.random_element() in G # optional - sage.rings.finite_rings
228228
True
229229
230230
TESTS::
231231
232-
sage: G.random_element().A().is_unitary()
232+
sage: G.random_element().A().is_unitary() # optional - sage.rings.finite_rings
233233
True
234234
"""
235235
while True:

0 commit comments

Comments
 (0)