Matrix group over a ring that GAP understands#

class sage.groups.matrix_gps.matrix_group_gap.MatrixGroup_gap(degree, base_ring, libgap_group, ambient=None, category=None)#

Bases: GroupMixinLibGAP, MatrixGroup_generic, ParentLibGAP

Base class for matrix groups that implements GAP interface.


  • degree – integer. The degree (matrix size) of the matrix group.

  • base_ring – ring. The base ring of the matrices.

  • libgap_group – the defining libgap group.

  • ambient – A derived class of ParentLibGAP or None (default). The ambient class if libgap_group has been defined as a subgroup.


alias of MatrixGroupElement_gap

structure_description(G, latex=False)#

Return a string that tries to describe the structure of G.

This methods wraps GAP’s StructureDescription method.

For full details, including the form of the returned string and the algorithm to build it, see GAP’s documentation.


  • latex – a boolean (default: False). If True, return a LaTeX formatted string.




From GAP’s documentation: The string returned by StructureDescription is not an isomorphism invariant: non-isomorphic groups can have the same string value, and two isomorphic groups in different representations can produce different strings.


sage: # needs sage.groups
sage: G = CyclicPermutationGroup(6)
sage: G.structure_description()
sage: G.structure_description(latex=True)
sage: G2 = G.direct_product(G, maps=False)
sage: LatexExpr(G2.structure_description(latex=True))
C_{6} \times C_{6}

This method is mainly intended for small groups or groups with few normal subgroups. Even then there are some surprises:

sage: D3 = DihedralGroup(3)                                                     # needs sage.groups
sage: D3.structure_description()                                                # needs sage.groups

We use the Sage notation for the degree of dihedral groups:

sage: D4 = DihedralGroup(4)                                                     # needs sage.groups
sage: D4.structure_description()                                                # needs sage.groups

Works for finitely presented groups (github issue #17573):

sage: F.<x, y> = FreeGroup()                                                    # needs sage.groups
sage: G = F / [x^2*y^-1, x^3*y^2, x*y*x^-1*y^-1]                                # needs sage.groups
sage: G.structure_description()                                                 # needs sage.groups

And matrix groups (github issue #17573):

sage: groups.matrix.GL(4,2).structure_description()                             # needs sage.modules
subgroup(generators, check=True)#

Return the subgroup generated by the given generators.


  • generators – a list/tuple/iterable of group elements of self

  • check – boolean (optional, default: True). Whether to check that each matrix is invertible.

OUTPUT: The subgroup generated by generators as an instance of FinitelyGeneratedMatrixGroup_gap


sage: # needs sage.rings.number_field
sage: UCF = UniversalCyclotomicField()
sage: G  = GL(3, UCF)
sage: e3 = UCF.gen(3); e5 = UCF.gen(5)
sage: m = matrix(UCF, 3,3, [[e3, 1, 0], [0, e5, 7],[4, 3, 2]])
sage: S = G.subgroup([m]); S
Subgroup with 1 generators (
[E(3)    1    0]
[   0 E(5)    7]
[   4    3    2]
) of General Linear Group of degree 3 over Universal Cyclotomic Field

sage: # needs sage.rings.number_field
sage: CF3 = CyclotomicField(3)
sage: G  = GL(3, CF3)
sage: e3 = CF3.gen()
sage: m = matrix(CF3, 3,3, [[e3, 1, 0], [0, ~e3, 7],[4, 3, 2]])
sage: S = G.subgroup([m]); S
Subgroup with 1 generators (
[     zeta3          1          0]
[         0 -zeta3 - 1          7]
[         4          3          2]
) of General Linear Group of degree 3 over Cyclotomic Field of order 3 and degree 2