Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sage.groups.matrix_gps: Modularization fixes for imports #35306

Merged
merged 24 commits into from
Apr 23, 2023
Merged
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
1e9d096
sage.groups.matrix_gps: Move ..._gap classes to separate ..._gap modules
mkoeppe Mar 18, 2023
3440ffe
Merge branch 't/34948/sage__coding_groups___replace_imports_from_sage…
mkoeppe Mar 18, 2023
c95f132
sage.groups.matrix_gps: Update imports of ..._gap classes
mkoeppe Mar 18, 2023
d6d5747
sage.groups.matrix_gps: Move MatrixGroupElement_gap class to a separa…
mkoeppe Mar 19, 2023
b17ab88
sage.groups.matrix_gps: Make a namespace package, replace imports fro…
mkoeppe Mar 19, 2023
a074b13
sage.groups.matrix_gps: Fix up imports
mkoeppe Mar 19, 2023
3f1d650
src/doc/en/reference/groups/index.rst: Add the ..._gap modules
mkoeppe Mar 19, 2023
961fa72
Merge branch 't/32664/add_sage_rings_abc_finitefield__deprecate_is_fi…
mkoeppe Mar 19, 2023
009fb6c
sage.groups.matrix_gps: Mark doctests # optional
mkoeppe Mar 19, 2023
7f41289
sage.groups.{affine_gps,matrix_gps}: Mark doctests # optional
mkoeppe Mar 19, 2023
12ad68a
src/sage/matrix/matrix_space.py: Use try...except for import/isinstan…
mkoeppe Mar 19, 2023
fb55f02
sage.groups.matrix_gps: When ..._gap classes cannot be imported, fall…
mkoeppe Mar 19, 2023
66f7d76
Merge remote-tracking branch 'upstream/develop' into matrix_groups_mo…
mkoeppe Mar 19, 2023
97b5480
src/doc/en/reference/groups/index.rst: Fix up
mkoeppe Mar 19, 2023
c362fb7
src/sage/groups/matrix_gps/finitely_generated_gap.py: Mark a doctest …
mkoeppe Mar 19, 2023
ce07608
Merge tag '10.0.beta7' into matrix_groups_modularization
mkoeppe Apr 1, 2023
5dccde4
sage.groups.{affine_gps,matrix_gps}: Use '# optional - sage.rings.fin…
mkoeppe Apr 1, 2023
45a332d
src/sage/groups/matrix_gps/all__sagemath_polyhedra.py: Remove (commit…
mkoeppe Apr 1, 2023
f5a2807
Merge tag '10.0.beta8' into matrix_groups_modularization
mkoeppe Apr 7, 2023
0592931
Merge branch 'develop' into matrix_groups_modularization
mkoeppe Apr 14, 2023
9de361d
src/sage/groups/matrix_gps: Update/add copyright notices using 'git b…
mkoeppe Apr 14, 2023
bea635b
sage.groups.matrix_gps: Docstring cosmetics
mkoeppe Apr 14, 2023
e15c6e8
src/sage/groups/matrix_gps/matrix_group*.py: Fix up markup of 'genera…
mkoeppe Apr 16, 2023
1024a23
src/sage/groups/matrix_gps/orthogonal_gap.py: Add copyright notice ba…
mkoeppe Apr 17, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/doc/en/reference/groups/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -72,17 +72,24 @@ Matrix and Affine Groups

sage/groups/matrix_gps/catalog
sage/groups/matrix_gps/matrix_group
sage/groups/matrix_gps/matrix_group_gap
sage/groups/matrix_gps/group_element
sage/groups/matrix_gps/group_element_gap
sage/groups/matrix_gps/finitely_generated
sage/groups/matrix_gps/finitely_generated_gap
sage/groups/matrix_gps/morphism
sage/groups/matrix_gps/homset
sage/groups/matrix_gps/binary_dihedral
sage/groups/matrix_gps/coxeter_group
sage/groups/matrix_gps/linear
sage/groups/matrix_gps/linear_gap
sage/groups/matrix_gps/orthogonal
sage/groups/matrix_gps/orthogonal_gap
sage/groups/matrix_gps/isometries
sage/groups/matrix_gps/symplectic
sage/groups/matrix_gps/symplectic_gap
sage/groups/matrix_gps/unitary
sage/groups/matrix_gps/unitary_gap
sage/groups/matrix_gps/heisenberg
sage/groups/affine_gps/affine_group
sage/groups/affine_gps/euclidean_group
Expand Down Expand Up @@ -115,5 +122,6 @@ Internals
:maxdepth: 1

sage/groups/matrix_gps/named_group
sage/groups/matrix_gps/named_group_gap

.. include:: ../footer.txt
4 changes: 2 additions & 2 deletions src/sage/categories/primer.py
Original file line number Diff line number Diff line change
Expand Up @@ -524,12 +524,12 @@ class implements:

sage: G = GL(2,ZZ)
sage: type(G)
<class 'sage.groups.matrix_gps.linear.LinearMatrixGroup_gap_with_category'>
<class 'sage.groups.matrix_gps.linear_gap.LinearMatrixGroup_gap_with_category'>

Here is a piece of the hierarchy of classes above it::

sage: for cls in G.__class__.mro(): print(cls)
<class 'sage.groups.matrix_gps.linear.LinearMatrixGroup_gap_with_category'>
<class 'sage.groups.matrix_gps.linear_gap.LinearMatrixGroup_gap_with_category'>
...
<class 'sage.categories.groups.Groups.parent_class'>
<class 'sage.categories.monoids.Monoids.parent_class'>
Expand Down
4 changes: 2 additions & 2 deletions src/sage/combinat/root_system/weyl_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@
#
# https://www.gnu.org/licenses/
# ****************************************************************************
from sage.groups.matrix_gps.finitely_generated import FinitelyGeneratedMatrixGroup_gap
from sage.groups.matrix_gps.group_element import MatrixGroupElement_gap
from sage.groups.matrix_gps.finitely_generated_gap import FinitelyGeneratedMatrixGroup_gap
from sage.groups.matrix_gps.group_element_gap import MatrixGroupElement_gap
from sage.groups.perm_gps.permgroup import PermutationGroup_generic
from sage.rings.integer_ring import ZZ
from sage.rings.rational_field import QQ
Expand Down
88 changes: 41 additions & 47 deletions src/sage/groups/affine_gps/affine_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,11 @@ class AffineGroup(UniqueRepresentation, Group):

Some additional ways to create affine groups::

sage: A = AffineSpace(2, GF(4,'a')); A
sage: A = AffineSpace(2, GF(4,'a')); A # optional - sage.rings.finite_rings
Affine Space of dimension 2 over Finite Field in a of size 2^2
sage: G = AffineGroup(A); G
sage: G = AffineGroup(A); G # optional - sage.rings.finite_rings
Affine Group of degree 2 over Finite Field in a of size 2^2
sage: G is AffineGroup(2,4) # shorthand
sage: G is AffineGroup(2,4) # shorthand # optional - sage.rings.finite_rings
True

sage: V = ZZ^3; V
Expand All @@ -152,10 +152,10 @@ def __classcall__(cls, *args, **kwds):

EXAMPLES::

sage: A = AffineSpace(2, GF(4,'a'))
sage: AffineGroup(A) is AffineGroup(2,4)
sage: A = AffineSpace(2, GF(4,'a')) # optional - sage.rings.finite_rings
sage: AffineGroup(A) is AffineGroup(2,4) # optional - sage.rings.finite_rings
True
sage: AffineGroup(A) is AffineGroup(2, GF(4,'a'))
sage: AffineGroup(A) is AffineGroup(2, GF(4,'a')) # optional - sage.rings.finite_rings
True
sage: A = AffineGroup(2, QQ)
sage: V = QQ^2
Expand Down Expand Up @@ -202,10 +202,10 @@ def __init__(self, degree, ring):

TESTS::

sage: G = AffineGroup(2, GF(5)); G
sage: G = AffineGroup(2, GF(5)); G # optional - sage.rings.finite_rings
Affine Group of degree 2 over Finite Field of size 5
sage: TestSuite(G).run()
sage: G.category()
sage: TestSuite(G).run() # optional - sage.rings.finite_rings
sage: G.category() # optional - sage.rings.finite_rings
Category of finite groups

sage: Aff6 = AffineGroup(6, QQ)
Expand Down Expand Up @@ -264,8 +264,8 @@ def _latex_(self):

EXAMPLES::

sage: G = AffineGroup(6, GF(5))
sage: latex(G)
sage: G = AffineGroup(6, GF(5)) # optional - sage.rings.finite_rings
sage: latex(G) # optional - sage.rings.finite_rings
\mathrm{Aff}_{6}(\Bold{F}_{5})
"""
return "\\mathrm{Aff}_{%s}(%s)" % (self.degree(),
Expand All @@ -277,7 +277,7 @@ def _repr_(self):

EXAMPLES::

sage: AffineGroup(6, GF(5))
sage: AffineGroup(6, GF(5)) # optional - sage.rings.finite_rings
Affine Group of degree 6 over Finite Field of size 5
"""
return "Affine Group of degree %s over %s" % (self.degree(),
Expand All @@ -289,7 +289,7 @@ def cardinality(self):

EXAMPLES::

sage: AffineGroup(6, GF(5)).cardinality()
sage: AffineGroup(6, GF(5)).cardinality() # optional - sage.rings.finite_rings
172882428468750000000000000000
sage: AffineGroup(6, ZZ).cardinality()
+Infinity
Expand All @@ -301,17 +301,15 @@ def degree(self):
"""
Return the dimension of the affine space.

OUTPUT:

An integer.
OUTPUT: An integer.

EXAMPLES::

sage: G = AffineGroup(6, GF(5))
sage: g = G.an_element()
sage: G.degree()
sage: G = AffineGroup(6, GF(5)) # optional - sage.rings.finite_rings
sage: g = G.an_element() # optional - sage.rings.finite_rings
sage: G.degree() # optional - sage.rings.finite_rings
6
sage: G.degree() == g.A().nrows() == g.A().ncols() == g.b().degree()
sage: G.degree() == g.A().nrows() == g.A().ncols() == g.b().degree() # optional - sage.rings.finite_rings
True
"""
return self._degree
Expand All @@ -329,8 +327,8 @@ def matrix_space(self):

EXAMPLES::

sage: G = AffineGroup(3, GF(5))
sage: G.matrix_space()
sage: G = AffineGroup(3, GF(5)) # optional - sage.rings.finite_rings
sage: G.matrix_space() # optional - sage.rings.finite_rings
Full MatrixSpace of 3 by 3 dense matrices over Finite Field of size 5
"""
d = self.degree()
Expand All @@ -343,8 +341,8 @@ def vector_space(self):

EXAMPLES::

sage: G = AffineGroup(3, GF(5))
sage: G.vector_space()
sage: G = AffineGroup(3, GF(5)) # optional - sage.rings.finite_rings
sage: G.vector_space() # optional - sage.rings.finite_rings
Vector space of dimension 3 over Finite Field of size 5
"""
return FreeModule(self.base_ring(), self.degree())
Expand Down Expand Up @@ -373,8 +371,8 @@ def linear_space(self):

EXAMPLES::

sage: G = AffineGroup(3, GF(5))
sage: G.linear_space()
sage: G = AffineGroup(3, GF(5)) # optional - sage.rings.finite_rings
sage: G.linear_space() # optional - sage.rings.finite_rings
Full MatrixSpace of 4 by 4 dense matrices over Finite Field of size 5
"""
dp = self.degree() + 1
Expand All @@ -388,14 +386,12 @@ def linear(self, A):

- ``A`` -- anything that determines a matrix

OUTPUT:

The affine group element `x \mapsto A x`.
OUTPUT: The affine group element `x \mapsto A x`.

EXAMPLES::

sage: G = AffineGroup(3, GF(5))
sage: G.linear([1,2,3,4,5,6,7,8,0])
sage: G = AffineGroup(3, GF(5)) # optional - sage.rings.finite_rings
sage: G.linear([1,2,3,4,5,6,7,8,0]) # optional - sage.rings.finite_rings
[1 2 3] [0]
x |-> [4 0 1] x + [0]
[2 3 0] [0]
Expand All @@ -411,14 +407,12 @@ def translation(self, b):

- ``b`` -- anything that determines a vector

OUTPUT:

The affine group element `x \mapsto x + b`.
OUTPUT: The affine group element `x \mapsto x + b`.

EXAMPLES::

sage: G = AffineGroup(3, GF(5))
sage: G.translation([1,4,8])
sage: G = AffineGroup(3, GF(5)) # optional - sage.rings.finite_rings
sage: G.translation([1,4,8]) # optional - sage.rings.finite_rings
[1 0 0] [1]
x |-> [0 1 0] x + [4]
[0 0 1] [3]
Expand Down Expand Up @@ -446,12 +440,12 @@ def reflection(self, v):

EXAMPLES::

sage: G = AffineGroup(3, QQ)
sage: G.reflection([1,0,0])
sage: G = AffineGroup(3, QQ) # optional - sage.rings.finite_rings
sage: G.reflection([1,0,0]) # optional - sage.rings.finite_rings
[-1 0 0] [0]
x |-> [ 0 1 0] x + [0]
[ 0 0 1] [0]
sage: G.reflection([3,4,-5])
sage: G.reflection([3,4,-5]) # optional - sage.rings.finite_rings
[ 16/25 -12/25 3/5] [0]
x |-> [-12/25 9/25 4/5] x + [0]
[ 3/5 4/5 0] [0]
Expand All @@ -470,13 +464,13 @@ def random_element(self):

EXAMPLES::

sage: G = AffineGroup(4, GF(3))
sage: G.random_element() # random
sage: G = AffineGroup(4, GF(3)) # optional - sage.rings.finite_rings
sage: G.random_element() # random # optional - sage.rings.finite_rings
[2 0 1 2] [1]
[2 1 1 2] [2]
x |-> [1 0 2 2] x + [2]
[1 1 1 1] [2]
sage: G.random_element() in G
sage: G.random_element() in G # optional - sage.rings.finite_rings
True
"""
A = self._GL.random_element()
Expand All @@ -490,8 +484,8 @@ def _an_element_(self):

TESTS::

sage: G = AffineGroup(4,5)
sage: G.an_element() in G
sage: G = AffineGroup(4,5) # optional - sage.rings.finite_rings
sage: G.an_element() in G # optional - sage.rings.finite_rings
True
"""
A = self._GL.an_element()
Expand All @@ -504,8 +498,8 @@ def some_elements(self):

EXAMPLES::

sage: G = AffineGroup(4,5)
sage: G.some_elements()
sage: G = AffineGroup(4,5) # optional - sage.rings.finite_rings
sage: G.some_elements() # optional - sage.rings.finite_rings
[ [2 0 0 0] [1]
[0 1 0 0] [0]
x |-> [0 0 1 0] x + [0]
Expand All @@ -518,7 +512,7 @@ def some_elements(self):
[0 1 0 0] [...]
x |-> [0 0 1 0] x + [...]
[0 0 0 1] [...]]
sage: all(v.parent() is G for v in G.some_elements())
sage: all(v.parent() is G for v in G.some_elements()) # optional - sage.rings.finite_rings
True

sage: G = AffineGroup(2,QQ)
Expand Down
26 changes: 13 additions & 13 deletions src/sage/groups/affine_gps/euclidean_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

class EuclideanGroup(AffineGroup):
r"""
an Euclidean group.
A Euclidean group.

The Euclidean group `E(A)` (or general affine group) of an affine
space `A` is the group of all invertible affine transformations from
Expand Down Expand Up @@ -121,11 +121,11 @@ class EuclideanGroup(AffineGroup):

Some additional ways to create Euclidean groups::

sage: A = AffineSpace(2, GF(4,'a')); A
sage: A = AffineSpace(2, GF(4,'a')); A # optional - sage.rings.finite_rings
Affine Space of dimension 2 over Finite Field in a of size 2^2
sage: G = EuclideanGroup(A); G
sage: G = EuclideanGroup(A); G # optional - sage.rings.finite_rings
Euclidean Group of degree 2 over Finite Field in a of size 2^2
sage: G is EuclideanGroup(2,4) # shorthand
sage: G is EuclideanGroup(2,4) # shorthand # optional - sage.rings.finite_rings
True

sage: V = ZZ^3; V
Expand All @@ -144,9 +144,9 @@ class EuclideanGroup(AffineGroup):
sage: V = QQ^6
sage: E6 is EuclideanGroup(V)
True
sage: G = EuclideanGroup(2, GF(5)); G
sage: G = EuclideanGroup(2, GF(5)); G # optional - sage.rings.finite_rings
Euclidean Group of degree 2 over Finite Field of size 5
sage: TestSuite(G).run()
sage: TestSuite(G).run() # optional - sage.rings.finite_rings

REFERENCES:

Expand Down Expand Up @@ -195,8 +195,8 @@ def _latex_(self):
r"""
EXAMPLES::

sage: G = EuclideanGroup(6, GF(5))
sage: latex(G)
sage: G = EuclideanGroup(6, GF(5)) # optional - sage.rings.finite_rings
sage: latex(G) # optional - sage.rings.finite_rings
\mathrm{E}_{6}(\Bold{F}_{5})
"""
return "\\mathrm{E}_{%s}(%s)"%(self.degree(), self.base_ring()._latex_())
Expand All @@ -207,7 +207,7 @@ def _repr_(self):

EXAMPLES::

sage: EuclideanGroup(6, GF(5))
sage: EuclideanGroup(6, GF(5)) # optional - sage.rings.finite_rings
Euclidean Group of degree 6 over Finite Field of size 5
"""
return "Euclidean Group of degree %s over %s"%(self.degree(), self.base_ring())
Expand All @@ -218,18 +218,18 @@ def random_element(self):

EXAMPLES::

sage: G = EuclideanGroup(4, GF(3))
sage: G.random_element() # random
sage: G = EuclideanGroup(4, GF(3)) # optional - sage.rings.finite_rings
sage: G.random_element() # random # optional - sage.rings.finite_rings
[2 1 2 1] [1]
[1 2 2 1] [0]
x |-> [2 2 2 2] x + [1]
[1 1 2 2] [2]
sage: G.random_element() in G
sage: G.random_element() in G # optional - sage.rings.finite_rings
True

TESTS::

sage: G.random_element().A().is_unitary()
sage: G.random_element().A().is_unitary() # optional - sage.rings.finite_rings
True
"""
while True:
Expand Down
Loading