---
title: "Handbook of Magma Functions, Part IX: Finite Groups"
version: "2.30-1"
canonical: "https://docs.magma-maths.org/FiniteGroups/index-finite-groups.html"
---

# Finite Groups

- [Groups](https://docs.magma-maths.org/FiniteGroups/Groups/index-groups.md): General group creation and standard group extension constructors.
- [Permutation Groups](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/index-permutation-groups.md): Permutation group constructors, operations, and homomorphisms.
- [Matrix Groups over General Rings](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/index-matrix-groups-over-general-rings.md): General linear group creation, homomorphisms, and element operations.
- [Matrix Groups over Finite Fields](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/index-matrix-groups-over-finite-fields.md): Element order, Monte Carlo methods, and Aschbacher reduction.
- [Matrix Groups over Infinite Fields](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverInfiniteFields/index-matrix-groups-over-infinite-fields.md): Congruence, finiteness, and virtual membership tests.
- [Matrix Groups over Q and Z](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverQAndZ/index-matrix-groups-over-qand-z.md): Invariant forms, endomorphisms, and related constructions.
- [Finite Soluble Groups](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/index-finite-soluble-groups.md): PC-group definition, properties, and homomorphisms.
- [Black-box Groups](https://docs.magma-maths.org/FiniteGroups/BlackBoxGroups/index-black-box-groups.md): Black-box group creation, operations, and element operations.
- [Almost Simple Groups](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/index-almost-simple-groups.md): Double covers, standard constructions, and group recognition.
- [Databases of Groups](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/index-databases-of-groups.md): Small groups, simple groups, and p-group databases.
- [Automorphism Groups](https://docs.magma-maths.org/FiniteGroups/AutomorphismGroups/index-automorphism-groups.md): Automorphism group creation, access, and order.
- [Cohomology and Extensions](https://docs.magma-maths.org/FiniteGroups/CohomologyAndExtensions/index-cohomology-and-extensions.md): Cohomology groups, structural invariants, and group extensions.
- [Reductive Groups](https://docs.magma-maths.org/FiniteGroups/ReductiveGroups/index-reductive-groups.md): Reductive group creation, properties, and operations.

<a id="group-overview"></a>
<a id="chapgrp"></a>
## Groups

- [Introduction](https://docs.magma-maths.org/FiniteGroups/Groups/introduction.md)
  - [The Categories of Finite Groups](https://docs.magma-maths.org/FiniteGroups/Groups/introduction.md#the-categories-of-finite-groups)
- [Construction of Elements](https://docs.magma-maths.org/FiniteGroups/Groups/creation-symmetric.md)
  - [Construction of an Element](https://docs.magma-maths.org/FiniteGroups/Groups/creation-symmetric.md#construction-of-an-element)
    - [`elt< G | L >: Grp, List(Elt) → GrpElt`](https://docs.magma-maths.org/FiniteGroups/Groups/creation-symmetric.md#constructor-constructor-elt-grp-list-elt-grpelt)
    - [`G ! Q: Grp, [ Elt ] → GrpElt`](https://docs.magma-maths.org/FiniteGroups/Groups/creation-symmetric.md#operation-op-grp-elt)
    - [`Identity(G): Grp → GrpElt`](https://docs.magma-maths.org/FiniteGroups/Groups/creation-symmetric.md#function-identity-grp)
    - [`Id(G): Grp → GrpElt`](https://docs.magma-maths.org/FiniteGroups/Groups/creation-symmetric.md#function-id-grp)
  - [Coercion](https://docs.magma-maths.org/FiniteGroups/Groups/creation-symmetric.md#coercion)
    - [`G ! g: Grp, GrpElt → GrpElt`](https://docs.magma-maths.org/FiniteGroups/Groups/creation-symmetric.md#operation-op-grp-grpelt)
  - [Homomorphisms](https://docs.magma-maths.org/FiniteGroups/Groups/creation-symmetric.md#homomorphisms)
    - [`hom< G -> H | L >: Grp, Grp → Map`](https://docs.magma-maths.org/FiniteGroups/Groups/creation-symmetric.md#constructor-constructor-hom-grp-grp-map)
    - [`hom< G -> H | x :-> e(x) >: Grp, Grp → Map`](https://docs.magma-maths.org/FiniteGroups/Groups/creation-symmetric.md#constructor-constructor-hom-grp-grp-map-2)
    - [`IdentityHomomorphism(G): Grp → Map`](https://docs.magma-maths.org/FiniteGroups/Groups/creation-symmetric.md#function-identityhomomorphism-grp)
    - [Example: Homomorphism from Generator Images](https://docs.magma-maths.org/FiniteGroups/Groups/creation-symmetric.md#example-ex-c624be)
    - [Example: Homomorphism Defined by an Expression](https://docs.magma-maths.org/FiniteGroups/Groups/creation-symmetric.md#example-ex-7e66d9)
  - [Arithmetic with Elements](https://docs.magma-maths.org/FiniteGroups/Groups/creation-symmetric.md#arithmetic-with-elements)
    - [`g * h: GrpElt, GrpElt → GrpElt`](https://docs.magma-maths.org/FiniteGroups/Groups/creation-symmetric.md#operation-op-times-grpelt-grpelt)
    - [`g ^ n: GrpElt, RngIntElt → GrpElt`](https://docs.magma-maths.org/FiniteGroups/Groups/creation-symmetric.md#operation-op-pow-grpelt-rngintelt)
    - [`g / h: GrpElt, GrpElt → GrpElt`](https://docs.magma-maths.org/FiniteGroups/Groups/creation-symmetric.md#operation-op-div-grpelt-grpelt)
    - [`g ^ h: GrpElt, GrpElt → GrpElt`](https://docs.magma-maths.org/FiniteGroups/Groups/creation-symmetric.md#operation-op-pow-grpelt-grpelt)
    - [`(g, h): GrpElt, GrpElt → GrpElt`](https://docs.magma-maths.org/FiniteGroups/Groups/creation-symmetric.md#literal-literal-g-h-grpelt-grpelt-grpelt)
    - [`(g₁, ..., gᵣ): GrpElt, ..., GrpElt → GrpElt`](https://docs.magma-maths.org/FiniteGroups/Groups/creation-symmetric.md#literal-literal-g1-gr-grpelt-grpelt-grpelt)
    - [`g eq h: GrpElt, GrpElt → BoolElt`](https://docs.magma-maths.org/FiniteGroups/Groups/creation-symmetric.md#operation-op-eq-grpelt-grpelt)
    - [`g ne h: GrpElt, GrpElt → BoolElt`](https://docs.magma-maths.org/FiniteGroups/Groups/creation-symmetric.md#operation-op-ne-grpelt-grpelt)
    - [`IsId(g): GrpElt → BoolElt`](https://docs.magma-maths.org/FiniteGroups/Groups/creation-symmetric.md#function-isid-grpelt)
    - [`IsIdentity(g): GrpElt → BoolElt`](https://docs.magma-maths.org/FiniteGroups/Groups/creation-symmetric.md#function-isidentity-grpelt)
    - [`Order(g): GrpElt → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/Groups/creation-symmetric.md#function-order-grpelt)
    - [Example: Arithmetic with Permutations](https://docs.magma-maths.org/FiniteGroups/Groups/creation-symmetric.md#example-ex-7b16a3)
- [Construction of a General Group](https://docs.magma-maths.org/FiniteGroups/Groups/creation-general.md)
  - [The General Group Constructors](https://docs.magma-maths.org/FiniteGroups/Groups/creation-general.md#the-general-group-constructors)
    - [`PermutationGroup< X | L >: Set, List → GrpPerm, Hom`](https://docs.magma-maths.org/FiniteGroups/Groups/creation-general.md#constructor-constructor-permutationgroup-set-list-grpperm-hom)
    - [`PermutationGroup< n | L >: RngIntElt, List → GrpPerm, Hom`](https://docs.magma-maths.org/FiniteGroups/Groups/creation-general.md#constructor-constructor-permutationgroup-rngintelt-list-grpperm-hom)
    - [`MatrixGroup< n, R | L >: RngIntElt, Rng, List → GrpMat, Hom`](https://docs.magma-maths.org/FiniteGroups/Groups/creation-general.md#constructor-constructor-matrixgroup-rngintelt-rng-list-grpmat-hom)
    - [`Group< X | R >: List(Identifiers), List(GrpFPRel) → GrpFP, Hom(Grp)`](https://docs.magma-maths.org/FiniteGroups/Groups/creation-general.md#constructor-constructor-group-list-identifiers-list-grpfprel-grpfp-hom-grp)
    - [`PolycyclicGroup< X | R >: List(Identifiers), List(GrpFPRel) → GrpPC, Hom`](https://docs.magma-maths.org/FiniteGroups/Groups/creation-general.md#constructor-constructor-polycyclicgroup-list-identifiers-list-grpfprel-grppc-hom)
    - [`AbelianGroup< X | R >: List(Identifiers), List(GrpAbRel) → GrpAb, Hom(GrpAb)`](https://docs.magma-maths.org/FiniteGroups/Groups/creation-general.md#constructor-constructor-abeliangroup-list-identifiers-list-grpabrel-grpab-hom-grpab)
    - [Example: Group Constructors](https://docs.magma-maths.org/FiniteGroups/Groups/creation-general.md#example-ex-b4177f)
    - [Example: Dihedral Group as a Polycyclic Group](https://docs.magma-maths.org/FiniteGroups/Groups/creation-general.md#example-ex-327598)
  - [Construction of Subgroups](https://docs.magma-maths.org/FiniteGroups/Groups/creation-general.md#construction-of-subgroups)
    - [`sub<G | L>: Grp, List → Grp`](https://docs.magma-maths.org/FiniteGroups/Groups/creation-general.md#constructor-constructor-sub-grp-list-grp)
    - [`ncl<G | L>: Grp, List → Grp`](https://docs.magma-maths.org/FiniteGroups/Groups/creation-general.md#constructor-constructor-ncl-grp-list-grp)
    - [Example: Subgroup of a Finitely Presented Group](https://docs.magma-maths.org/FiniteGroups/Groups/creation-general.md#example-ex-2c1c5d)
  - [Construction of Quotient Groups](https://docs.magma-maths.org/FiniteGroups/Groups/creation-general.md#construction-of-quotient-groups)
    - [`quo<G | L>: Grp, List → Grp, Map`](https://docs.magma-maths.org/FiniteGroups/Groups/creation-general.md#constructor-constructor-quo-grp-list-grp-map)
    - [`G / N: Grp, Grp → Grp`](https://docs.magma-maths.org/FiniteGroups/Groups/creation-general.md#operation-op-div-grp-grp)
    - [Example: Quotient of an Abelian Group](https://docs.magma-maths.org/FiniteGroups/Groups/creation-general.md#example-ex-8f51d1)
- [Standard Groups and Extensions](https://docs.magma-maths.org/FiniteGroups/Groups/extension-standard-group.md)
  - [Construction of a Standard Group](https://docs.magma-maths.org/FiniteGroups/Groups/extension-standard-group.md#construction-of-a-standard-group)
    - [`AbelianGroup(C, Q): Cat, [ RngIntElt ] → GrpFin`](https://docs.magma-maths.org/FiniteGroups/Groups/extension-standard-group.md#function-abeliangroup-cat-rngintelt)
    - [`AbelianGroup(Q): [ RngIntElt ] → GrpAb`](https://docs.magma-maths.org/FiniteGroups/Groups/extension-standard-group.md#function-abeliangroup-rngintelt)
    - [`AlternatingGroup(C, n): Cat, RngIntElt → GrpFin`](https://docs.magma-maths.org/FiniteGroups/Groups/extension-standard-group.md#function-alternatinggroup-cat-rngintelt)
    - [`AlternatingGroup(n): RngIntElt → GrpPerm`](https://docs.magma-maths.org/FiniteGroups/Groups/extension-standard-group.md#function-alternatinggroup-rngintelt)
    - [`Alt(C, n): Cat, RngIntElt → GrpFin`](https://docs.magma-maths.org/FiniteGroups/Groups/extension-standard-group.md#function-alt-cat-rngintelt)
    - [`Alt(n): RngIntElt → GrpPerm`](https://docs.magma-maths.org/FiniteGroups/Groups/extension-standard-group.md#function-alt-rngintelt)
    - [`CyclicGroup(C, n): Cat, RngIntElt → GrpFin`](https://docs.magma-maths.org/FiniteGroups/Groups/extension-standard-group.md#function-cyclicgroup-cat-rngintelt)
    - [`CyclicGroup(n): RngIntElt → GrpPerm`](https://docs.magma-maths.org/FiniteGroups/Groups/extension-standard-group.md#function-cyclicgroup-rngintelt)
    - [`DihedralGroup(C, n): Cat, RngIntElt → GrpFin`](https://docs.magma-maths.org/FiniteGroups/Groups/extension-standard-group.md#function-dihedralgroup-cat-rngintelt)
    - [`DihedralGroup(n): RngIntElt → GrpPerm`](https://docs.magma-maths.org/FiniteGroups/Groups/extension-standard-group.md#function-dihedralgroup-rngintelt)
    - [`DicyclicGroup(n): RngIntElt → GrpFP`](https://docs.magma-maths.org/FiniteGroups/Groups/extension-standard-group.md#function-dicyclicgroup-rngintelt)
    - [`DicyclicGroup(A, a): GrpAb, GrpAbElt → GrpFP`](https://docs.magma-maths.org/FiniteGroups/Groups/extension-standard-group.md#function-dicyclicgroup-grpab-grpabelt)
    - [`SymmetricGroup(C, n): Cat, RngIntElt → GrpFin`](https://docs.magma-maths.org/FiniteGroups/Groups/extension-standard-group.md#function-symmetricgroup-cat-rngintelt)
    - [`SymmetricGroup(n): RngIntElt → GrpPerm`](https://docs.magma-maths.org/FiniteGroups/Groups/extension-standard-group.md#function-symmetricgroup-rngintelt)
    - [`Sym(GrpFin, n): Cat, RngIntElt → GrpFin`](https://docs.magma-maths.org/FiniteGroups/Groups/extension-standard-group.md#function-sym-cat-rngintelt)
    - [`Sym(n): RngIntElt → GrpPerm`](https://docs.magma-maths.org/FiniteGroups/Groups/extension-standard-group.md#function-sym-rngintelt)
    - [`ExtraSpecialGroup(C, p, n : parameters): Cat, RngIntElt, RngIntElt → GrpFin`](https://docs.magma-maths.org/FiniteGroups/Groups/extension-standard-group.md#function-extraspecialgroup-cat-rngintelt-rngintelt)
    - [`ExtraSpecialGroup(p, n : parameters): RngIntElt, RngIntElt → GrpPerm`](https://docs.magma-maths.org/FiniteGroups/Groups/extension-standard-group.md#function-extraspecialgroup-rngintelt-rngintelt)
    - [Example: Standard Groups](https://docs.magma-maths.org/FiniteGroups/Groups/extension-standard-group.md#example-ex-a51dba)
  - [Construction of Extensions](https://docs.magma-maths.org/FiniteGroups/Groups/extension-standard-group.md#construction-of-extensions)
    - [`DirectProduct(G, H): Grp, Grp → Grp`](https://docs.magma-maths.org/FiniteGroups/Groups/extension-standard-group.md#function-directproduct-grp-grp)
    - [`DirectProduct(Q): [ Grp ] → Grp`](https://docs.magma-maths.org/FiniteGroups/Groups/extension-standard-group.md#function-directproduct-grp)
    - [`SemidirectProduct(K, H, f: parameters): Grp, Grp, Map → Grp, Map, Map, Map`](https://docs.magma-maths.org/FiniteGroups/Groups/extension-standard-group.md#function-semidirectproduct-grp-grp-map)
    - [Example: Semidirect Product](https://docs.magma-maths.org/FiniteGroups/Groups/extension-standard-group.md#example-ex-ba6db1)
    - [`AffineSplitExtension(M: parameters): ModGrp → Grp, Map, Map, Map`](https://docs.magma-maths.org/FiniteGroups/Groups/extension-standard-group.md#function-affinesplitextension-modgrp)
    - [Example: Affine Split Extension](https://docs.magma-maths.org/FiniteGroups/Groups/extension-standard-group.md#example-ex-e704a5)
    - [Example: Direct Product of Two Groups](https://docs.magma-maths.org/FiniteGroups/Groups/extension-standard-group.md#example-ex-a6b832)
- [Transfer Functions Between Group Categories](https://docs.magma-maths.org/FiniteGroups/Groups/category-transfer.md)
  - [`pQuotient(F, p, c: parameters): GrpFP, RngIntElt, RngIntElt → GrpPC, Map`](https://docs.magma-maths.org/FiniteGroups/Groups/category-transfer.md#function-pquotient-grpfp-rngintelt-rngintelt)
  - [`CosetAction(G, H): Grp, Grp → Hom(Grp), GrpPerm, Grp`](https://docs.magma-maths.org/FiniteGroups/Groups/category-transfer.md#function-cosetaction-grp-grp)
  - [`RegularRepresentation(G, H): Grp, Grp → Hom(Grp), GrpPerm, Grp`](https://docs.magma-maths.org/FiniteGroups/Groups/category-transfer.md#function-regularrepresentation-grp-grp)
  - [`CosetImage(G, H): Grp, Grp → GrpPerm`](https://docs.magma-maths.org/FiniteGroups/Groups/category-transfer.md#function-cosetimage-grp-grp)
  - [`CosetKernel(G, H): Grp, Grp → Grp`](https://docs.magma-maths.org/FiniteGroups/Groups/category-transfer.md#function-cosetkernel-grp-grp)
  - [`MinimalDegreePermutationRepresentation(G: parameters): Grp → Hom(Grp), GrpPerm`](https://docs.magma-maths.org/FiniteGroups/Groups/category-transfer.md#function-minimaldegreepermutationrepresentation-grp)
  - [Example: Minimal Degree Permutation Representation](https://docs.magma-maths.org/FiniteGroups/Groups/category-transfer.md#example-ex-4a0ec6)
  - [`PermutationRepresentationQuotient(G, N : parameters): Grp, Grp → Hom(Grp), GrpPerm`](https://docs.magma-maths.org/FiniteGroups/Groups/category-transfer.md#function-permutationrepresentationquotient-grp-grp)
  - [`GPCGroup(G): Grp → GrpGPC, Hom(Grp)`](https://docs.magma-maths.org/FiniteGroups/Groups/category-transfer.md#function-gpcgroup-grp)
  - [`PCGroup(G): Grp → GrpPC, Hom(Grp)`](https://docs.magma-maths.org/FiniteGroups/Groups/category-transfer.md#function-pcgroup-grp)
  - [`FPGroup(G: parameters): GrpPerm → GrpFP, Hom(Grp)`](https://docs.magma-maths.org/FiniteGroups/Groups/category-transfer.md#function-fpgroup-grpperm)
  - [Example: Action on Cosets of a Subgroup](https://docs.magma-maths.org/FiniteGroups/Groups/category-transfer.md#example-ex-faa68a)
  - [Example: Permutation Representation of Sp(2, 4)](https://docs.magma-maths.org/FiniteGroups/Groups/category-transfer.md#example-ex-4138bd)
  - [Example: Finite Presentation of PSU(3, 3)](https://docs.magma-maths.org/FiniteGroups/Groups/category-transfer.md#example-ex-35b71d)
- [Basic Operations](https://docs.magma-maths.org/FiniteGroups/Groups/operation.md)
  - [Accessing Group Information](https://docs.magma-maths.org/FiniteGroups/Groups/operation.md#accessing-group-information)
    - [`G . i: Grp, RngIntElt → GrpElt`](https://docs.magma-maths.org/FiniteGroups/Groups/operation.md#operation-operation-grp-rngintelt-grpelt)
    - [`Generators(G): Grp → { GrpFinElt }`](https://docs.magma-maths.org/FiniteGroups/Groups/operation.md#function-generators-grp)
    - [`NumberOfGenerators(G): Grp → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/Groups/operation.md#function-numberofgenerators-grp)
    - [`Ngens(G): Grp → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/Groups/operation.md#function-ngens-grp)
    - [`SmallestGeneratingSet(G: parameters): Grp → SetIndx`](https://docs.magma-maths.org/FiniteGroups/Groups/operation.md#function-smallestgeneratingset-grp)
    - [`Generic(G): Grp → Grp`](https://docs.magma-maths.org/FiniteGroups/Groups/operation.md#function-generic-grp)
    - [`Parent(g): GrpElt → Grp`](https://docs.magma-maths.org/FiniteGroups/Groups/operation.md#function-parent-grpelt)
    - [Example: Generators of the Suzuki Group Sz(8)](https://docs.magma-maths.org/FiniteGroups/Groups/operation.md#example-ex-a47283)
    - [`Orbit(G, M, x): Grp, Any, Any → {Any}`](https://docs.magma-maths.org/FiniteGroups/Groups/operation.md#function-orbit-grp-any-any)
    - [`OrbitClosure(G, M, S): Grp, Any, {Any} → Any`](https://docs.magma-maths.org/FiniteGroups/Groups/operation.md#function-orbitclosure-grp-any-any)
  - [Names of Finite Groups](https://docs.magma-maths.org/FiniteGroups/Groups/operation.md#names-of-finite-groups)
    - [`GroupName(G): Grp → MonStgElt`](https://docs.magma-maths.org/FiniteGroups/Groups/operation.md#function-groupname-grp)
    - [Example: Names of Small Groups](https://docs.magma-maths.org/FiniteGroups/Groups/operation.md#example-ex-7a2387)
    - [`Group(s): MonStgElt → Grp`](https://docs.magma-maths.org/FiniteGroups/Groups/operation.md#function-group-monstgelt)
    - [Example: Groups from Names](https://docs.magma-maths.org/FiniteGroups/Groups/operation.md#example-ex-06353f)
- [Operations on the Set of Elements](https://docs.magma-maths.org/FiniteGroups/Groups/element.md)
  - [Order and Index Functions](https://docs.magma-maths.org/FiniteGroups/Groups/element.md#order-and-index-functions)
    - [`Order(G): GrpFin → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/Groups/element.md#function-order-grpfin)
    - [`# G: GrpFin → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/Groups/element.md#operation-operation-grpfin-rngintelt)
    - [`FactoredOrder(G): GrpFin → [ <RngIntElt, RngIntElt> ]`](https://docs.magma-maths.org/FiniteGroups/Groups/element.md#function-factoredorder-grpfin)
    - [`Index(G, H): GrpFin, GrpFin → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/Groups/element.md#function-index-grpfin-grpfin)
    - [`FactoredIndex(G, H): GrpFin, GrpFin → [ <RngIntElt, RngIntElt> ]`](https://docs.magma-maths.org/FiniteGroups/Groups/element.md#function-factoredindex-grpfin-grpfin)
    - [Example: Order and Index in an FP Group](https://docs.magma-maths.org/FiniteGroups/Groups/element.md#example-ex-fd70fc)
  - [Membership and Equality](https://docs.magma-maths.org/FiniteGroups/Groups/element.md#membership-and-equality)
    - [`g in G: GrpFinElt, GrpFin → BoolElt`](https://docs.magma-maths.org/FiniteGroups/Groups/element.md#operation-op-in-grpfinelt-grpfin)
    - [`g notin G: GrpFinElt, GrpFin → BoolElt`](https://docs.magma-maths.org/FiniteGroups/Groups/element.md#operation-op-notin-grpfinelt-grpfin)
    - [`S subset G: { GrpFinElt }, GrpFin → BoolElt`](https://docs.magma-maths.org/FiniteGroups/Groups/element.md#operation-op-subset-grpfinelt-grpfin)
    - [`S notsubset G: { GrpFinElt }, GrpFin → BoolElt`](https://docs.magma-maths.org/FiniteGroups/Groups/element.md#operation-operation-notsubset-grpfinelt-grpfin-boolelt)
    - [`H subset G: GrpFin, GrpFin → BoolElt`](https://docs.magma-maths.org/FiniteGroups/Groups/element.md#operation-op-subset-grpfin-grpfin)
    - [`IsSubgroup(H,G): GrpFin, GrpFin → BoolElt`](https://docs.magma-maths.org/FiniteGroups/Groups/element.md#function-issubgroup-grpfin-grpfin)
    - [`H notsubset G: GrpFin, GrpFin → BoolElt`](https://docs.magma-maths.org/FiniteGroups/Groups/element.md#operation-operation-notsubset-grpfin-grpfin-boolelt)
    - [`H eq G: GrpFin, GrpFin → BoolElt`](https://docs.magma-maths.org/FiniteGroups/Groups/element.md#operation-op-eq-grpfin-grpfin)
    - [`H ne G: GrpFin, GrpFin → BoolElt`](https://docs.magma-maths.org/FiniteGroups/Groups/element.md#operation-op-ne-grpfin-grpfin)
  - [Set Operations](https://docs.magma-maths.org/FiniteGroups/Groups/element.md#set-operations)
    - [`NumberingMap(G): GrpFin → Map`](https://docs.magma-maths.org/FiniteGroups/Groups/element.md#function-numberingmap-grpfin)
    - [`Representative(G): GrpFin → GrpFinElt`](https://docs.magma-maths.org/FiniteGroups/Groups/element.md#function-representative-grpfin)
    - [`Rep(G): GrpFin → GrpFinElt`](https://docs.magma-maths.org/FiniteGroups/Groups/element.md#function-rep-grpfin)
    - [Example: Multiplication Table via NumberingMap](https://docs.magma-maths.org/FiniteGroups/Groups/element.md#example-ex-f73fa4)
  - [Random Elements](https://docs.magma-maths.org/FiniteGroups/Groups/element.md#random-elements)
    - [`Random(G: parameters): GrpFin → GrpFinElt`](https://docs.magma-maths.org/FiniteGroups/Groups/element.md#function-random-grpfin)
    - [Example: Random Elements of a Wreath Product](https://docs.magma-maths.org/FiniteGroups/Groups/element.md#example-ex-79c950)
    - [`RandomProcess(G): GrpFin → Process`](https://docs.magma-maths.org/FiniteGroups/Groups/element.md#function-randomprocess-grpfin)
    - [`RandomProcessWithWords(G): GrpFin → Process`](https://docs.magma-maths.org/FiniteGroups/Groups/element.md#function-randomprocesswithwords-grpfin)
    - [`RandomProcessWithValues(G, Q): GrpFin, SeqEnum → Process`](https://docs.magma-maths.org/FiniteGroups/Groups/element.md#function-randomprocesswithvalues-grpfin-seqenum)
    - [`RandomProcessWithWordsAndValues(G, Q): GrpFin, SeqEnum → Process`](https://docs.magma-maths.org/FiniteGroups/Groups/element.md#function-randomprocesswithwordsandvalues-grpfin-seqenum)
    - [`Random(P): Process → GrpFinElt`](https://docs.magma-maths.org/FiniteGroups/Groups/element.md#function-random-process)
    - [`Random(P): Process → GrpFinElt`](https://docs.magma-maths.org/FiniteGroups/Groups/element.md#function-random-process-2)
    - [`InitialiseProspector(G:parameters): GrpMat`](https://docs.magma-maths.org/FiniteGroups/Groups/element.md#procedure-initialiseprospector-grpmat)
    - [`InitialiseProspector(G:parameters): GrpPerm`](https://docs.magma-maths.org/FiniteGroups/Groups/element.md#procedure-initialiseprospector-grpperm)
    - [`Prospector(G, f:parameters): Grp, UserProgram → BoolElt, GrpElt, GrpSLPElt`](https://docs.magma-maths.org/FiniteGroups/Groups/element.md#function-prospector-grp-userprogram)
    - [Example: Finding a 300-Cycle at Random](https://docs.magma-maths.org/FiniteGroups/Groups/element.md#example-ex-f1996a)
  - [Action on a Coset Space](https://docs.magma-maths.org/FiniteGroups/Groups/element.md#action-on-a-coset-space)
    - [`CosetTable(G, H): GrpFin, GrpFin → Map`](https://docs.magma-maths.org/FiniteGroups/Groups/element.md#function-cosettable-grpfin-grpfin)
    - [`CosetTable(G, f): GrpFin, Hom(GrpFin) → Hom(GrpFin)`](https://docs.magma-maths.org/FiniteGroups/Groups/element.md#function-cosettable-grpfin-hom-grpfin)
    - [`Transversal(G, H): Grp, Grp → {@ GrpElt  @}, Map`](https://docs.magma-maths.org/FiniteGroups/Groups/element.md#function-transversal-grp-grp)
    - [`RightTransversal(G, H): Grp, Grp → {@ GrpElt  @}, Map`](https://docs.magma-maths.org/FiniteGroups/Groups/element.md#function-righttransversal-grp-grp)
    - [`CosetAction(G, H): Grp, Grp → Hom(Grp), GrpPerm, Grp`](https://docs.magma-maths.org/FiniteGroups/Groups/element.md#function-cosetaction-grp-grp-2)
    - [`CosetImage(G, H): Grp, Grp → GrpPerm`](https://docs.magma-maths.org/FiniteGroups/Groups/element.md#function-cosetimage-grp-grp-2)
    - [`CosetKernel(G, H): Grp, Grp → Grp`](https://docs.magma-maths.org/FiniteGroups/Groups/element.md#function-cosetkernel-grp-grp-2)
- [Standard Subgroup Constructions](https://docs.magma-maths.org/FiniteGroups/Groups/operation-subgroup.md)
  - [`H ^ g: GrpFin, GrpFinElt → GrpFin`](https://docs.magma-maths.org/FiniteGroups/Groups/operation-subgroup.md#operation-op-pow-grpfin-grpfinelt)
  - [`Conjugate(H, g): GrpFin, GrpFinElt → GrpFin`](https://docs.magma-maths.org/FiniteGroups/Groups/operation-subgroup.md#function-conjugate-grpfin-grpfinelt)
  - [`H meet K: GrpFin, GrpFin → GrpFin`](https://docs.magma-maths.org/FiniteGroups/Groups/operation-subgroup.md#operation-op-meet-grpfin-grpfin)
  - [`CommutatorSubgroup(G, H, K): GrpFin, GrpFin, GrpFin → GrpFin`](https://docs.magma-maths.org/FiniteGroups/Groups/operation-subgroup.md#function-commutatorsubgroup-grpfin-grpfin-grpfin)
  - [`CommutatorSubgroup(H, K): GrpFin, GrpFin → GrpFin`](https://docs.magma-maths.org/FiniteGroups/Groups/operation-subgroup.md#function-commutatorsubgroup-grpfin-grpfin)
  - [`Centralizer(G, g): GrpFin, GrpFinElt → GrpFin`](https://docs.magma-maths.org/FiniteGroups/Groups/operation-subgroup.md#function-centralizer-grpfin-grpfinelt)
  - [`Centraliser(G, g): GrpFin, GrpFinElt → GrpFin`](https://docs.magma-maths.org/FiniteGroups/Groups/operation-subgroup.md#function-centraliser-grpfin-grpfinelt)
  - [`Centralizer(G, H): GrpFin, GrpFin → GrpFin`](https://docs.magma-maths.org/FiniteGroups/Groups/operation-subgroup.md#function-centralizer-grpfin-grpfin)
  - [`Centraliser(G, H): GrpFin, GrpFin → GrpFin`](https://docs.magma-maths.org/FiniteGroups/Groups/operation-subgroup.md#function-centraliser-grpfin-grpfin)
  - [`Core(G, H): GrpFin, GrpFin → GrpFin`](https://docs.magma-maths.org/FiniteGroups/Groups/operation-subgroup.md#function-core-grpfin-grpfin)
  - [`H ^ G: GrpFin, GrpFin → GrpFin`](https://docs.magma-maths.org/FiniteGroups/Groups/operation-subgroup.md#operation-op-pow-grpfin-grpfin)
  - [`NormalClosure(G, H): GrpFin, GrpFin → GrpFin`](https://docs.magma-maths.org/FiniteGroups/Groups/operation-subgroup.md#function-normalclosure-grpfin-grpfin)
  - [`Normalizer(G, H): GrpFin, GrpFin → GrpFin`](https://docs.magma-maths.org/FiniteGroups/Groups/operation-subgroup.md#function-normalizer-grpfin-grpfin)
  - [`Normaliser(G, H): GrpFin, GrpFin → GrpFin`](https://docs.magma-maths.org/FiniteGroups/Groups/operation-subgroup.md#function-normaliser-grpfin-grpfin)
  - [`pCore(G, p): GrpFin, RngIntElt → GrpFin`](https://docs.magma-maths.org/FiniteGroups/Groups/operation-subgroup.md#function-pcore-grpfin-rngintelt)
  - [`SylowSubgroup(G, p): GrpFin, RngIntElt → GrpFin`](https://docs.magma-maths.org/FiniteGroups/Groups/operation-subgroup.md#function-sylowsubgroup-grpfin-rngintelt)
  - [`Sylow(G, p): GrpFin, RngIntElt → GrpFin`](https://docs.magma-maths.org/FiniteGroups/Groups/operation-subgroup.md#function-sylow-grpfin-rngintelt)
  - [Abstract Group Predicates](https://docs.magma-maths.org/FiniteGroups/Groups/operation-subgroup.md#abstract-group-predicates)
    - [`IsAbelian(G): GrpFin → BoolElt`](https://docs.magma-maths.org/FiniteGroups/Groups/operation-subgroup.md#function-isabelian-grpfin)
    - [`IsCyclic(G): GrpFin → BoolElt`](https://docs.magma-maths.org/FiniteGroups/Groups/operation-subgroup.md#function-iscyclic-grpfin)
    - [`IsElementaryAbelian(G): GrpFin → BoolElt`](https://docs.magma-maths.org/FiniteGroups/Groups/operation-subgroup.md#function-iselementaryabelian-grpfin)
    - [`IsCentral(G, H): GrpFin, GrpFin → BoolElt`](https://docs.magma-maths.org/FiniteGroups/Groups/operation-subgroup.md#function-iscentral-grpfin-grpfin)
    - [`IsConjugate(G, g, h): GrpFin, GrpFinElt, GrpFinElt → BoolElt, GrpFinElt`](https://docs.magma-maths.org/FiniteGroups/Groups/operation-subgroup.md#function-isconjugate-grpfin-grpfinelt-grpfinelt)
    - [`IsConjugate(G, H, K): GrpFin, GrpFin, GrpFin → BoolElt, GrpFinElt`](https://docs.magma-maths.org/FiniteGroups/Groups/operation-subgroup.md#function-isconjugate-grpfin-grpfin-grpfin)
    - [`IsExtraSpecial(G): GrpFin → BoolElt`](https://docs.magma-maths.org/FiniteGroups/Groups/operation-subgroup.md#function-isextraspecial-grpfin)
    - [`IsHyperelementary(G): Grp → BoolElt, Grp, Grp`](https://docs.magma-maths.org/FiniteGroups/Groups/operation-subgroup.md#function-ishyperelementary-grp)
    - [Example: Hyperelementary Groups](https://docs.magma-maths.org/FiniteGroups/Groups/operation-subgroup.md#example-ex-d7354f)
    - [`IsMaximal(G, H): GrpFin, GrpFin → BoolElt`](https://docs.magma-maths.org/FiniteGroups/Groups/operation-subgroup.md#function-ismaximal-grpfin-grpfin)
    - [`IsNilpotent(G): GrpFin → BoolElt`](https://docs.magma-maths.org/FiniteGroups/Groups/operation-subgroup.md#function-isnilpotent-grpfin)
    - [`IsNormal(G, H): GrpFin, GrpFin → BoolElt`](https://docs.magma-maths.org/FiniteGroups/Groups/operation-subgroup.md#function-isnormal-grpfin-grpfin)
    - [`IsPerfect(G): GrpFin → BoolElt`](https://docs.magma-maths.org/FiniteGroups/Groups/operation-subgroup.md#function-isperfect-grpfin)
    - [`IsQGroup(G): Grp → BoolElt`](https://docs.magma-maths.org/FiniteGroups/Groups/operation-subgroup.md#function-isqgroup-grp)
    - [Example: Testing for Q-Groups](https://docs.magma-maths.org/FiniteGroups/Groups/operation-subgroup.md#example-ex-694ffe)
    - [`IsSelfNormalizing(G, H): GrpFin, GrpFin → BoolElt`](https://docs.magma-maths.org/FiniteGroups/Groups/operation-subgroup.md#function-isselfnormalizing-grpfin-grpfin)
    - [`IsSelfNormalising(G, H): GrpFin, GrpFin → BoolElt`](https://docs.magma-maths.org/FiniteGroups/Groups/operation-subgroup.md#function-isselfnormalising-grpfin-grpfin)
    - [`IsSimple(G): GrpFin → BoolElt`](https://docs.magma-maths.org/FiniteGroups/Groups/operation-subgroup.md#function-issimple-grpfin)
    - [`IsSoluble(G): GrpFin → BoolElt`](https://docs.magma-maths.org/FiniteGroups/Groups/operation-subgroup.md#function-issoluble-grpfin)
    - [`IsSolvable(G): GrpFin → BoolElt`](https://docs.magma-maths.org/FiniteGroups/Groups/operation-subgroup.md#function-issolvable-grpfin)
    - [`IsSpecial(G): GrpFin → BoolElt`](https://docs.magma-maths.org/FiniteGroups/Groups/operation-subgroup.md#function-isspecial-grpfin)
    - [`IsAbstractFrobeniusGroup(G): GrpFin → BoolElt, Grp, Grp`](https://docs.magma-maths.org/FiniteGroups/Groups/operation-subgroup.md#function-isabstractfrobeniusgroup-grpfin)
    - [`IsSubnormal(G, H): GrpFin, GrpFin → BoolElt`](https://docs.magma-maths.org/FiniteGroups/Groups/operation-subgroup.md#function-issubnormal-grpfin-grpfin)
    - [`IsTrivial(G): Grp → BoolElt`](https://docs.magma-maths.org/FiniteGroups/Groups/operation-subgroup.md#function-istrivial-grp)
- [Characteristic Subgroups and Normal Structure](https://docs.magma-maths.org/FiniteGroups/Groups/characteristic-subgroup-normal-structure.md)
  - [Characteristic Subgroups and Subgroup Series](https://docs.magma-maths.org/FiniteGroups/Groups/characteristic-subgroup-normal-structure.md#characteristic-subgroups-and-subgroup-series)
    - [`Centre(G): GrpFin → GrpFin`](https://docs.magma-maths.org/FiniteGroups/Groups/characteristic-subgroup-normal-structure.md#function-centre-grpfin)
    - [`Center(G): GrpFin → GrpFin`](https://docs.magma-maths.org/FiniteGroups/Groups/characteristic-subgroup-normal-structure.md#function-center-grpfin)
    - [`Hypercentre(G): GrpFin → GrpFin`](https://docs.magma-maths.org/FiniteGroups/Groups/characteristic-subgroup-normal-structure.md#function-hypercentre-grpfin)
    - [`Hypercenter(G): GrpFin → GrpFin`](https://docs.magma-maths.org/FiniteGroups/Groups/characteristic-subgroup-normal-structure.md#function-hypercenter-grpfin)
    - [`DerivedLength(G): GrpFin → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/Groups/characteristic-subgroup-normal-structure.md#function-derivedlength-grpfin)
    - [`DerivedSeries(G): GrpFin → [ GrpFin ]`](https://docs.magma-maths.org/FiniteGroups/Groups/characteristic-subgroup-normal-structure.md#function-derivedseries-grpfin)
    - [`DerivedSubgroup(G): GrpFin → GrpFin`](https://docs.magma-maths.org/FiniteGroups/Groups/characteristic-subgroup-normal-structure.md#function-derivedsubgroup-grpfin)
    - [`DerivedGroup(G): GrpFin → GrpFin`](https://docs.magma-maths.org/FiniteGroups/Groups/characteristic-subgroup-normal-structure.md#function-derivedgroup-grpfin)
    - [`FittingSubgroup(G): GrpFin → GrpFin`](https://docs.magma-maths.org/FiniteGroups/Groups/characteristic-subgroup-normal-structure.md#function-fittingsubgroup-grpfin)
    - [`FrattiniSubgroup(G): GrpFin → GrpFin`](https://docs.magma-maths.org/FiniteGroups/Groups/characteristic-subgroup-normal-structure.md#function-frattinisubgroup-grpfin)
    - [`JenningsSeries(G): GrpFin → [ GrpFin ]`](https://docs.magma-maths.org/FiniteGroups/Groups/characteristic-subgroup-normal-structure.md#function-jenningsseries-grpfin)
    - [`LowerCentralSeries(G): GrpFin → [ GrpFin ]`](https://docs.magma-maths.org/FiniteGroups/Groups/characteristic-subgroup-normal-structure.md#function-lowercentralseries-grpfin)
    - [`NilpotencyClass(G): GrpFin → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/Groups/characteristic-subgroup-normal-structure.md#function-nilpotencyclass-grpfin)
    - [`H ^ G: GrpFin → GrpFin`](https://docs.magma-maths.org/FiniteGroups/Groups/characteristic-subgroup-normal-structure.md#operation-op-pow-grpfin)
    - [`NormalClosure(G, H): GrpFin, GrpFin → GrpFin`](https://docs.magma-maths.org/FiniteGroups/Groups/characteristic-subgroup-normal-structure.md#function-normalclosure-grpfin-grpfin-2)
    - [`NormalLattice(G): GrpFin → NormalLattice`](https://docs.magma-maths.org/FiniteGroups/Groups/characteristic-subgroup-normal-structure.md#function-normallattice-grpfin)
    - [`NormalSubgroups(G): GrpFin → [ Rec ]`](https://docs.magma-maths.org/FiniteGroups/Groups/characteristic-subgroup-normal-structure.md#function-normalsubgroups-grpfin)
    - [`pCentralSeries(G, p): GrpFin, RngIntElt → [ GrpFin ]`](https://docs.magma-maths.org/FiniteGroups/Groups/characteristic-subgroup-normal-structure.md#function-pcentralseries-grpfin-rngintelt)
    - [`Radical(G): GrpFin → GrpFin`](https://docs.magma-maths.org/FiniteGroups/Groups/characteristic-subgroup-normal-structure.md#function-radical-grpfin)
    - [`SolubleResidual(G): GrpFin → GrpFin`](https://docs.magma-maths.org/FiniteGroups/Groups/characteristic-subgroup-normal-structure.md#function-solubleresidual-grpfin)
    - [`SolvableResidual(G): GrpFin → GrpFin`](https://docs.magma-maths.org/FiniteGroups/Groups/characteristic-subgroup-normal-structure.md#function-solvableresidual-grpfin)
    - [`SubnormalSeries(G, H): GrpFin, GrpFin → [ GrpFin ]`](https://docs.magma-maths.org/FiniteGroups/Groups/characteristic-subgroup-normal-structure.md#function-subnormalseries-grpfin-grpfin)
    - [`UpperCentralSeries(G): GrpFin → [ GrpFin ]`](https://docs.magma-maths.org/FiniteGroups/Groups/characteristic-subgroup-normal-structure.md#function-uppercentralseries-grpfin)
  - [The Abstract Structure of a Group](https://docs.magma-maths.org/FiniteGroups/Groups/characteristic-subgroup-normal-structure.md#the-abstract-structure-of-a-group)
    - [`CompositionFactors(G): GrpFin → [ <RngIntElt, RngIntElt, RngIntElt> ]`](https://docs.magma-maths.org/FiniteGroups/Groups/characteristic-subgroup-normal-structure.md#function-compositionfactors-grpfin)
    - [`PrimaryAbelianInvariants(G): GrpFin → [ RngIntElt ]`](https://docs.magma-maths.org/FiniteGroups/Groups/characteristic-subgroup-normal-structure.md#function-primaryabelianinvariants-grpfin)
    - [`AbelianInvariants(G): GrpFin → [ RngIntElt ]`](https://docs.magma-maths.org/FiniteGroups/Groups/characteristic-subgroup-normal-structure.md#function-abelianinvariants-grpfin)
    - [`PrimaryAbelianBasis(G): GrpFin → [ GrpFinElt ], [ RngIntElt ]`](https://docs.magma-maths.org/FiniteGroups/Groups/characteristic-subgroup-normal-structure.md#function-primaryabelianbasis-grpfin)
    - [`AbelianBasis(G): GrpFin → [ GrpFinElt ], [ RngIntElt ]`](https://docs.magma-maths.org/FiniteGroups/Groups/characteristic-subgroup-normal-structure.md#function-abelianbasis-grpfin)
- [Conjugacy Classes of Elements](https://docs.magma-maths.org/FiniteGroups/Groups/conjugate.md)
  - [`Class(H, x): GrpFin, GrpFinElt → { GrpFinElt }`](https://docs.magma-maths.org/FiniteGroups/Groups/conjugate.md#function-class-grpfin-grpfinelt)
  - [`Conjugates(H, x): GrpFin, GrpFinElt → { GrpFinElt }`](https://docs.magma-maths.org/FiniteGroups/Groups/conjugate.md#function-conjugates-grpfin-grpfinelt)
  - [`ClassMap(G: parameters): GrpFin → Map`](https://docs.magma-maths.org/FiniteGroups/Groups/conjugate.md#function-classmap-grpfin)
  - [`ConjugacyClasses(G: parameters): GrpFin → [ <RngIntElt, RngIntElt, GrpFinElt> ]`](https://docs.magma-maths.org/FiniteGroups/Groups/conjugate.md#function-conjugacyclasses-grpfin)
  - [`Classes(G: parameters): GrpFin → [ <RngIntElt, RngIntElt, GrpFinElt> ]`](https://docs.magma-maths.org/FiniteGroups/Groups/conjugate.md#function-classes)
  - [`ClassesData(G: parameters): GrpFin → [ <RngIntElt, RngIntElt> ]`](https://docs.magma-maths.org/FiniteGroups/Groups/conjugate.md#function-classesdata-grpfin)
  - [`ClassRepresentative(G, x): GrpFin, GrpFinElt → GrpFinElt`](https://docs.magma-maths.org/FiniteGroups/Groups/conjugate.md#function-classrepresentative-grpfin-grpfinelt)
  - [`IsConjugate(G, g, h): GrpFin, GrpFinElt, GrpFinElt → BoolElt, GrpFinElt`](https://docs.magma-maths.org/FiniteGroups/Groups/conjugate.md#function-isconjugate-grpfin-grpfinelt-grpfinelt-2)
  - [`IsConjugate(G, H, K): GrpFin, GrpFin, GrpFin → BoolElt, GrpFinElt`](https://docs.magma-maths.org/FiniteGroups/Groups/conjugate.md#function-isconjugate-grpfin-grpfin-grpfin-2)
  - [`Exponent(G): GrpFin → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/Groups/conjugate.md#function-exponent-grpfin)
  - [`NumberOfClasses(G): GrpFin → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/Groups/conjugate.md#function-numberofclasses-grpfin)
  - [`Nclasses(G): GrpFin → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/Groups/conjugate.md#function-nclasses-grpfin)
  - [`PowerMap(G): GrpFin → Map`](https://docs.magma-maths.org/FiniteGroups/Groups/conjugate.md#function-powermap-grpfin)
  - [Example: Conjugacy Classes of M11](https://docs.magma-maths.org/FiniteGroups/Groups/conjugate.md#example-ex-63376d)
- [Conjugacy Classes of Subgroups](https://docs.magma-maths.org/FiniteGroups/Groups/subgroup.md)
  - [Conjugacy Classes of Subgroups](https://docs.magma-maths.org/FiniteGroups/Groups/subgroup.md#id1)
    - [`SubgroupClasses(G: parameters): GrpFin → [ rec< Grp, RngIntElt, RngIntElt, GrpFP> ]`](https://docs.magma-maths.org/FiniteGroups/Groups/subgroup.md#function-subgroupclasses-grpfin)
    - [`Subgroups(G: parameters): GrpFin → [ rec< Grp, RngIntElt, RngIntElt, GrpFP> ]`](https://docs.magma-maths.org/FiniteGroups/Groups/subgroup.md#function-subgroups-grpfin)
    - [`Subgroups(G, N: parameters): GrpFin, GrpFin → [ rec< Grp, RngIntElt, RngIntElt, GrpFP> ]`](https://docs.magma-maths.org/FiniteGroups/Groups/subgroup.md#function-subgroups-grpfin-grpfin)
    - [`ElementaryAbelianSubgroups(G: parameters): GrpFin → [ rec< Grp, RngIntElt, RngIntElt, GrpFP> ]`](https://docs.magma-maths.org/FiniteGroups/Groups/subgroup.md#function-elementaryabeliansubgroups-grpfin)
    - [`AbelianSubgroups(G: parameters): GrpFin → [ rec< Grp, RngIntElt, RngIntElt, GrpFP> ]`](https://docs.magma-maths.org/FiniteGroups/Groups/subgroup.md#function-abeliansubgroups-grpfin)
    - [`CyclicSubgroups(G: parameters): GrpFin → [ rec< Grp, RngIntElt, RngIntElt, GrpFP> ]`](https://docs.magma-maths.org/FiniteGroups/Groups/subgroup.md#function-cyclicsubgroups-grpfin)
    - [`NilpotentSubgroups(G: parameters): GrpFin → [ rec< Grp, RngIntElt, RngIntElt, GrpFP> ]`](https://docs.magma-maths.org/FiniteGroups/Groups/subgroup.md#function-nilpotentsubgroups-grpfin)
    - [`SolubleSubgroups(G: parameters): GrpFin → [ rec< Grp, RngIntElt, RngIntElt, GrpFP> ]`](https://docs.magma-maths.org/FiniteGroups/Groups/subgroup.md#function-solublesubgroups-grpfin)
    - [`SolvableSubgroups(G: parameters): GrpFin → [ rec< Grp, RngIntElt, RngIntElt, GrpFP> ]`](https://docs.magma-maths.org/FiniteGroups/Groups/subgroup.md#function-solvablesubgroups-grpfin)
    - [`NonsolvableSubgroups(G: parameters): GrpFin → [ rec< Grp, RngIntElt, RngIntElt, GrpFP> ]`](https://docs.magma-maths.org/FiniteGroups/Groups/subgroup.md#function-nonsolvablesubgroups-grpfin)
    - [`PerfectSubgroups(G: parameters): GrpFin → [ rec< Grp, RngIntElt, RngIntElt, GrpFP> ]`](https://docs.magma-maths.org/FiniteGroups/Groups/subgroup.md#function-perfectsubgroups-grpfin)
    - [`SimpleSubgroups(G: parameters): GrpFin → [ rec< Grp, RngIntElt, RngIntElt, GrpFP> ]`](https://docs.magma-maths.org/FiniteGroups/Groups/subgroup.md#function-simplesubgroups-grpfin)
    - [`RegularSubgroups(G: parameters): GrpFin → [ rec< Grp, RngIntElt, RngIntElt, GrpFP> ]`](https://docs.magma-maths.org/FiniteGroups/Groups/subgroup.md#function-regularsubgroups-grpfin)
    - [`SetVerbose("SubgroupLattice", i): MonStgElt, RngIntElt`](https://docs.magma-maths.org/FiniteGroups/Groups/subgroup.md#procedure-setverbose-monstgelt-rngintelt-subgrouplattice)
    - [`Class(G, H): GrpFin, GrpFin → { GrpFin }`](https://docs.magma-maths.org/FiniteGroups/Groups/subgroup.md#function-class-grpfin-grpfin)
    - [`Conjugates(G, H): GrpFin, GrpElt → { GrpElt }`](https://docs.magma-maths.org/FiniteGroups/Groups/subgroup.md#function-conjugates-grpfin-grpelt)
    - [Example: Subgroup Classes of a Dihedral Group](https://docs.magma-maths.org/FiniteGroups/Groups/subgroup.md#example-ex-ca0e1e)
  - [The Poset of Subgroup Classes](https://docs.magma-maths.org/FiniteGroups/Groups/subgroup.md#the-poset-of-subgroup-classes)
    - [Creating the Poset of Subgroup Classes](https://docs.magma-maths.org/FiniteGroups/Groups/subgroup.md#creating-the-poset-of-subgroup-classes)
      - [`SubgroupLattice(G): GrpFin → SubGrpLat`](https://docs.magma-maths.org/FiniteGroups/Groups/subgroup.md#function-subgrouplattice-grpfin)
      - [Example: Subgroup Lattice of ASL(2, 3)](https://docs.magma-maths.org/FiniteGroups/Groups/subgroup.md#example-ex-c15cda)
    - [Operations on Subgroup Class Posets](https://docs.magma-maths.org/FiniteGroups/Groups/subgroup.md#operations-on-subgroup-class-posets)
      - [`# L: SubGrpLat → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/Groups/subgroup.md#operation-operation-subgrplat-rngintelt)
      - [`L ! i: SubGrpLat, RngIntElt → SubGrpLatElt`](https://docs.magma-maths.org/FiniteGroups/Groups/subgroup.md#operation-op-subgrplat-rngintelt)
      - [`L ! H: SubGrpLat, GrpFin → SubGrpLatElt`](https://docs.magma-maths.org/FiniteGroups/Groups/subgroup.md#operation-op-subgrplat-grpfin)
      - [`Bottom(L): SubGrpLat → SubGrpLatElt`](https://docs.magma-maths.org/FiniteGroups/Groups/subgroup.md#function-bottom-subgrplat)
      - [`Top(L): SubGrpLat → SubGrpLatElt`](https://docs.magma-maths.org/FiniteGroups/Groups/subgroup.md#function-top-subgrplat)
      - [`Random(L): SubGrpLat → SubGrpLatElt`](https://docs.magma-maths.org/FiniteGroups/Groups/subgroup.md#function-random-subgrplat)
      - [Example: Fitting Subgroup in a Subgroup Lattice](https://docs.magma-maths.org/FiniteGroups/Groups/subgroup.md#example-ex-b91cf9)
    - [Operations on Poset Elements](https://docs.magma-maths.org/FiniteGroups/Groups/subgroup.md#operations-on-poset-elements)
      - [`IntegerRing() ! e: SubGrpLatElt → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/Groups/subgroup.md#literal-integerring-subgrplatelt)
      - [`e eq f: SubGrpLatElt, SubGrpLatElt → SubGrpLatElt`](https://docs.magma-maths.org/FiniteGroups/Groups/subgroup.md#operation-op-eq-subgrplatelt-subgrplatelt)
      - [`e ge f: SubGrpLatElt, SubGrpLatElt → BoolElt`](https://docs.magma-maths.org/FiniteGroups/Groups/subgroup.md#operation-op-ge-subgrplatelt-subgrplatelt)
      - [`e ge f: SubGrpLatElt, SubGrpLatElt → BoolElt`](https://docs.magma-maths.org/FiniteGroups/Groups/subgroup.md#operation-op-ge-subgrplatelt-subgrplatelt-2)
      - [`e le f: SubGrpLatElt, SubGrpLatElt → BoolElt`](https://docs.magma-maths.org/FiniteGroups/Groups/subgroup.md#operation-op-le-subgrplatelt-subgrplatelt)
      - [`e subset f: SubGrpLatElt, SubGrpLatElt → SubGrpLatElt`](https://docs.magma-maths.org/FiniteGroups/Groups/subgroup.md#operation-op-subset-subgrplatelt-subgrplatelt)
      - [`e lt f: SubGrpLatElt, SubGrpLatElt → BoolElt`](https://docs.magma-maths.org/FiniteGroups/Groups/subgroup.md#operation-op-lt-subgrplatelt-subgrplatelt)
    - [Class Information from a Conjugacy Class Poset](https://docs.magma-maths.org/FiniteGroups/Groups/subgroup.md#class-information-from-a-conjugacy-class-poset)
      - [`Group(e): SubGrpLatElt → GrpFin`](https://docs.magma-maths.org/FiniteGroups/Groups/subgroup.md#function-group-subgrplatelt)
      - [`Centraliser(e, f): SubGrpLatElt, SubGrpLatElt → SubGrpLatElt`](https://docs.magma-maths.org/FiniteGroups/Groups/subgroup.md#function-centraliser-subgrplatelt-subgrplatelt)
      - [`Centralizer(e, f): SubGrpLatElt, SubGrpLatElt → SubGrpLatElt`](https://docs.magma-maths.org/FiniteGroups/Groups/subgroup.md#function-centralizer-subgrplatelt-subgrplatelt)
      - [`Normaliser(e, f): SubGrpLatElt, SubGrpLatElt → SubGrpLatElt`](https://docs.magma-maths.org/FiniteGroups/Groups/subgroup.md#function-normaliser-subgrplatelt-subgrplatelt)
      - [`Normalizer(e, f): SubGrpLatElt, SubGrpLatElt → SubGrpLatElt`](https://docs.magma-maths.org/FiniteGroups/Groups/subgroup.md#function-normalizer-subgrplatelt-subgrplatelt)
      - [`Length(e): SubGrpLatElt → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/Groups/subgroup.md#function-length-subgrplatelt)
      - [`Order(e): SubGrpLatElt → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/Groups/subgroup.md#function-order-subgrplatelt)
      - [`MaximalSubgroups(e): SubGrpLatElt → { SubGrpLatElt }`](https://docs.magma-maths.org/FiniteGroups/Groups/subgroup.md#function-maximalsubgroups-subgrplatelt)
      - [`MinimalOvergroups(e): SubGrpLatElt → { SubGrpLatElt }`](https://docs.magma-maths.org/FiniteGroups/Groups/subgroup.md#function-minimalovergroups-subgrplatelt)
      - [`NumberOfInclusions(e, f): SubGrpLatElt, SubGrpLatElt → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/Groups/subgroup.md#function-numberofinclusions-subgrplatelt-subgrplatelt)
- [All Subgroups and Intermediate Subgroups](https://docs.magma-maths.org/FiniteGroups/Groups/all-subgroups.md)
  - [`AllSubgroups(G): GrpFin → [ SeqEnum ]`](https://docs.magma-maths.org/FiniteGroups/Groups/all-subgroups.md#function-allsubgroups-grpfin)
  - [`MinimalOvergroups(G,H): GrpFin, GrpFin → [ SeqEnum ]`](https://docs.magma-maths.org/FiniteGroups/Groups/all-subgroups.md#function-minimalovergroups-grpfin-grpfin)
  - [`IntermediateSubgroups(G,H: parameters): GrpFin, GrpFin → [ SeqEnum ]`](https://docs.magma-maths.org/FiniteGroups/Groups/all-subgroups.md#function-intermediatesubgroups-grpfin-grpfin)
- [Cohomology](https://docs.magma-maths.org/FiniteGroups/Groups/cohomology.md)
  - [`pMultiplicator(G, p): GrpFin, RngIntElt → [ RngIntElt ]`](https://docs.magma-maths.org/FiniteGroups/Groups/cohomology.md#function-pmultiplicator-grpfin-rngintelt)
  - [`pCover(G, F, p): GrpPerm, GrpFP, RngIntElt → GrpFinFP`](https://docs.magma-maths.org/FiniteGroups/Groups/cohomology.md#function-pcover-grpperm-grpfp-rngintelt)
  - [`CohomologicalDimension(G, M, i): GrpFin, ModRng, RngIntElt → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/Groups/cohomology.md#function-cohomologicaldimension-grpfin-modrng-rngintelt)
  - [`ExtensionProcess(G, M, F): GrpPerm, ModRng, GrpFP → GrpFPExtProc`](https://docs.magma-maths.org/FiniteGroups/Groups/cohomology.md#function-extensionprocess-grpperm-modrng-grpfp)
  - [`Extension(P, Q): Process → GrpFinFP`](https://docs.magma-maths.org/FiniteGroups/Groups/cohomology.md#function-extension-process)
  - [`NextExtension(P): Process → GrpFinFP`](https://docs.magma-maths.org/FiniteGroups/Groups/cohomology.md#function-nextextension-process)
  - [`SplitExtension(G, M, F): GrpPerm, ModRng, GrpFP → GrpFP`](https://docs.magma-maths.org/FiniteGroups/Groups/cohomology.md#function-splitextension-grpperm-modrng-grpfp)
- [Characters and Representations](https://docs.magma-maths.org/FiniteGroups/Groups/character-representation.md)
  - [Character Theory](https://docs.magma-maths.org/FiniteGroups/Groups/character-representation.md#character-theory)
    - [`CharacterDegrees(G): GrpPC → [ Tup ]`](https://docs.magma-maths.org/FiniteGroups/Groups/character-representation.md#function-characterdegrees-grppc)
    - [`CharacterTable(G): GrpFin → TabChtr`](https://docs.magma-maths.org/FiniteGroups/Groups/character-representation.md#function-charactertable-grpfin)
    - [`PermutationCharacter(G): GrpPerm → AlgChtrElt`](https://docs.magma-maths.org/FiniteGroups/Groups/character-representation.md#function-permutationcharacter-grpperm)
    - [`PermutationCharacter(G, H): GrpFin, GrpFin → AlgChtrElt`](https://docs.magma-maths.org/FiniteGroups/Groups/character-representation.md#function-permutationcharacter-grpfin-grpfin)
    - [`BurnsideCokernel(G): Grp → GrpAb, UserProgram, SeqEnum[AlgChtrElt]`](https://docs.magma-maths.org/FiniteGroups/Groups/character-representation.md#function-burnsidecokernel-grp)
    - [Example: Groups with Nontrivial Burnside Cokernel](https://docs.magma-maths.org/FiniteGroups/Groups/character-representation.md#example-ex-79dcca)
  - [Representation Theory](https://docs.magma-maths.org/FiniteGroups/Groups/character-representation.md#representation-theory)
    - [`GModule(G, S): GrpFin, AlgMat → ModGrpFin`](https://docs.magma-maths.org/FiniteGroups/Groups/character-representation.md#function-gmodule-grpfin-algmat)
    - [`GModule(G, A, B): GrpFin, GrpFin, GrpFin → ModGrpFin, Map`](https://docs.magma-maths.org/FiniteGroups/Groups/character-representation.md#function-gmodule-grpfin-grpfin-grpfin)
    - [`PermutationModule(G, H, R): GrpFin, GrpFin, Rng → ModGrpFin`](https://docs.magma-maths.org/FiniteGroups/Groups/character-representation.md#function-permutationmodule-grpfin-grpfin-rng)
    - [`PermutationModule(G, R): GrpPerm, Rng → ModGrpFin`](https://docs.magma-maths.org/FiniteGroups/Groups/character-representation.md#function-permutationmodule-grpperm-rng)
    - [Example: Permutation Module for M10](https://docs.magma-maths.org/FiniteGroups/Groups/character-representation.md#example-ex-652230)
    - [Example: Module for a Split Extension](https://docs.magma-maths.org/FiniteGroups/Groups/character-representation.md#example-ex-36abf4)
- [Databases of Groups](https://docs.magma-maths.org/FiniteGroups/Groups/databases.md)
- [Bibliography](https://docs.magma-maths.org/FiniteGroups/Groups/bibliography.md)

### Introduction

Groups arise in several different categories in Magma. In the case of the category of permutation groups and the category of soluble groups defined by a power-conjugate presentation, all groups in the category are finite. However, the finitely-presented group category, the polycyclic group category, the abelian group category, and the matrix group category contain both finite and infinite groups. In the case of the abelian group category and the matrix group category, a large number of functions are available for finite groups only. In the near future, these functions will be extended to finite finitely-presented groups of moderate order.

In this chapter, we discuss the functions that are provided for groups collectively, noting especially those functions that are available only for finite groups. Descriptions of functions that depend upon the particular category may be found in the chapter devoted to that category.

#### The Categories of Finite Groups

At present Magma contains five main categories of finite groups:

**(i)**
Permutation groups: category [`GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/index-permutation-groups.md#chapgrpperm);

**(ii)**
Finite matrix groups: category [`GrpMat`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/index-matrix-groups-over-general-rings.md#chapgrpmat);

**(iii)**
Finite solvable groups given by a power-conjugate presentation: category [`GrpPC`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/index-finite-soluble-groups.md#chapgrppc);

**(iv)**
Finite abelian groups: category [`GrpAb`](https://docs.magma-maths.org/FinitelyPresentedGroups/AbelianGroups/index-abelian-groups.md#chapgrpab);

**(v)**
Finite polycyclic groups: category [`GrpGPC`](https://docs.magma-maths.org/FinitelyPresentedGroups/PolycyclicGroups/index-polycyclic-groups.md#chapgrpgpc).

Note that the categories [`GrpMat`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/index-matrix-groups-over-general-rings.md#chapgrpmat), [`GrpAb`](https://docs.magma-maths.org/FinitelyPresentedGroups/AbelianGroups/index-abelian-groups.md#chapgrpab) and [`GrpGPC`](https://docs.magma-maths.org/FinitelyPresentedGroups/PolycyclicGroups/index-polycyclic-groups.md#chapgrpgpc) contain both finite and infinite groups; most of the operations described in this chapter apply only to finite groups belonging to these categories. In this chapter we will use the category name `GrpFin` to collectively refer to categories [`GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/index-permutation-groups.md#chapgrpperm) and [`GrpPC`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/index-finite-soluble-groups.md#chapgrppc) and the subcategories of [`GrpMat`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/index-matrix-groups-over-general-rings.md#chapgrpmat), [`GrpAb`](https://docs.magma-maths.org/FinitelyPresentedGroups/AbelianGroups/index-abelian-groups.md#chapgrpab) and [`GrpGPC`](https://docs.magma-maths.org/FinitelyPresentedGroups/PolycyclicGroups/index-polycyclic-groups.md#chapgrpgpc) consisting of finite groups. The category name `Grp` will be used when the operation does not depend upon the finiteness of the group.

### Construction of Elements

#### Construction of an Element

Throughout this subsection we shall assume that the carrier set for the group $G$ is a subset of the set $S$. Thus, if $G$ is a permutation group on the set $X$, its carrier set will be a subset of ${\operatorname{Sym}}(X)$.

<a id="constructor-constructor-elt-grp-list-elt-grpelt"></a>
##### `elt< G | L >: Grp, List(Elt) -> GrpElt`

Given a group $G$ whose elements are a subset of the set $S$, and a list $L$ of objects $a_1, a_2, \ldots, a_n$ defining an element of $S$, construct this element $g$ of $S$. Then, the element $g$ will be tested for membership of $G$, and if $g$ is not an element of $G$, the function will fail. If $g$ does lie in $G$, $g$ will be returned with $G$ as its parent.

<a id="operation-op-grp-elt"></a>
##### `G ! Q: Grp, [ Elt ] -> GrpElt`

Given a group $G$ whose elements are a subset of the set $S$, and a sequence $Q=[ a_1, a_2, \ldots, a_n ]$ defining an element of $S$, construct this element $g$ of $S$. Then, the element $g$ will be tested for membership of $G$, and if $g$ is not an element of $G$, the function will fail. If $g$ does lie in $G$, $g$ will be returned with $G$ as its parent.

<a id="function-identity-grp"></a>
##### `Identity(G): Grp -> GrpElt`

<a id="function-id-grp"></a>
##### `Id(G): Grp -> GrpElt`

Construct the identity element in the group $G$.

#### Coercion

<a id="operation-op-grp-grpelt"></a>
##### `G ! g: Grp, GrpElt -> GrpElt`

Given a group $G$ and an element $g$ of $H$, where $G$ and $H$ are subgroups of some common over-group and $g$ is contained in $G$, embed $g$ in $G$. Thus this operator changes the parent of $g$ into $G$. The coercion may fail for groups in the category [`GrpFP`](https://docs.magma-maths.org/FinitelyPresentedGroups/FPGroups/index-fpgroups.md#chapgrpfp).

#### Homomorphisms

<a id="constructor-constructor-hom-grp-grp-map"></a>
##### `hom< G -> H | L >: Grp, Grp -> Map`

Return the group homomorphism $\phi\ : G \rightarrow H$ defined by extending the map of the generators of $G$, as given by the list $L$ on the right side of the constructor. Suppose that the generators of $G$ are $g_1, \dots, g_n$, and that $\phi(g_i)=h_i$ for each $i$. Then $L$ must be one of the following:

**(a)**
a list of the $n$ 2-tuples $< g_i, h_i >$ (order not important);

**(b)**
a list of the $n$ arrow-pairs $g_i$ `->` $h_i$ (order not important);

**(c)**
$h_1, \dots, h_n$ (order is important).

For its computations, Magma often assumes that the mapping so defined is a homomorphism without attempting to verify this.

For certain categories of groups, e.g. [`GrpGPC`](https://docs.magma-maths.org/FinitelyPresentedGroups/PolycyclicGroups/index-polycyclic-groups.md#chapgrpgpc), the homomorphism constructor provides some additional functionality. See the chapter on the appropriate category for further information.

<a id="constructor-constructor-hom-grp-grp-map-2"></a>
##### `hom< G -> H | x :-> e(x) >: Grp, Grp -> Map`

Return the group homomorphism $\phi : G \rightarrow H$ defined by the rule $\phi(x)=e(x)$, where $x$ is a general element of $G$ and $e(x)$ is an expression in $x$. The symbol $x$ may be any identifier name, and has local scope. For its computations, Magma assumes the expression defines a homomorphism, but does not verify this.

<a id="function-identityhomomorphism-grp"></a>
##### `IdentityHomomorphism(G): Grp -> Map`

Return the identity homomorphism $\phi: G\rightarrow G: x\mapsto x$.

<a id="example-ex-c624be"></a>
##### `Example: Homomorphism from Generator Images (ex-c624be)`

Construction of an isomorphism from the cyclic group of order 15 to the abelian group isomorphic to ${\mathbb{Z}}/15{\mathbb{Z}}$, by giving the image of the generator:

```magma
> C15 := CyclicGroup(15);
> C15;
Permutation group C15 acting on a set of cardinality 15
Order = 15 = 3 * 5
    (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15)
> A15 := AbelianGroup([15]);
> A15;
Abelian Group isomorphic to Z/15
Defined on 1 generator
Relations:
    15*A15.1 = 0
> iso11 := hom< C15 -> A15 | C15.1 -> 11*A15.1 >;
> A15 eq iso11(C15);
true
> forall{ <c, d> : c, d in C15 | iso11(c * d) eq iso11(c) * iso11(d) };
true
```

<a id="example-ex-7e66d9"></a>
##### `Example: Homomorphism Defined by an Expression (ex-7e66d9)`

An endomorphism of the same cyclic group, defined using an expression. The image is cyclic of order 5.

```magma
> C15 := CyclicGroup(15);
> h := hom< C15 -> C15 | g :-> g^3 >;
> forall{ <c, d> : c, d in C15 | h(c * d) eq h(c) * h(d) };
true
> im := h(C15);
> im;
Permutation group im acting on a set of cardinality 15
Order = 5
    (1, 4, 7, 10, 13)(2, 5, 8, 11, 14)(3, 6, 9, 12, 15)
> IsCyclic(im);
true
```

#### Arithmetic with Elements

<a id="operation-op-times-grpelt-grpelt"></a>
##### `g * h: GrpElt, GrpElt -> GrpElt`

Product of element $g$ and element $h$, where $g$ and $h$ belong to the same generic group $U$. If $g$ and $h$ both belong to the same proper subgroup $G$ of $U$, then the result will be returned as an element of $G$; if $g$ and $h$ belong to subgroups $H$ and $K$ of a subgroup $G$ of $U$, then the product is returned as an element of $G$. Otherwise, the product is returned as an element of $U$. The product in abelian groups is called the sum and is written `g + h` instead.

<a id="operation-op-pow-grpelt-rngintelt"></a>
##### `g ^ n: GrpElt, RngIntElt -> GrpElt`

The $n$-th power of the group element $g$, where $n$ is a positive, negative, or zero integer. In abelian groups, this is written as a scalar product `n * g` instead.

<a id="operation-op-div-grpelt-grpelt"></a>
##### `g / h: GrpElt, GrpElt -> GrpElt`

Product of the group element $g$ by the inverse of the group element $h$, i.e., the element $gh^{-1}$. Here $g$ and $h$ must belong to the same generic group $U$. The rules for determining the parent group of $g / h$ are the same as for $gh$. In abelian groups, this is written additively as `g - h`.

<a id="operation-op-pow-grpelt-grpelt"></a>
##### `g ^ h: GrpElt, GrpElt -> GrpElt`

Conjugate of the group element $g$ by the group element $h$, i.e., the element $h^{-1}gh$. Here $g$ and $h$ must belong to the same generic group $U$. The rules for determining the parent group of $g^h$ are the same as for $gh$. In abelian groups, this operation does not exist.

<a id="literal-literal-g-h-grpelt-grpelt-grpelt"></a>
##### `(g, h): GrpElt, GrpElt -> GrpElt`

Commutator of the group elements $g$ and $h$, i.e., the element $g^{-1}h^{-1}gh$. Here $g$ and $h$ must belong to the same generic group $U$. The rules for determining the parent group of $(g, h)$ are the same as those for $gh$.

<a id="literal-literal-g1-gr-grpelt-grpelt-grpelt"></a>
##### `(g₁, ..., gᵣ): GrpElt, ..., GrpElt -> GrpElt`

Given $r$ elements $g_1, \ldots, g_r$ belonging to a common group, return their commutator. Commutators are *left-normed*, so they are evaluated from left to right.

<a id="operation-op-eq-grpelt-grpelt"></a>
##### `g eq h: GrpElt, GrpElt -> BoolElt`

Given elements $g$ and $h$ belonging to the same generic group, return `true` if $g$ and $h$ are the same element, `false` otherwise.

<a id="operation-op-ne-grpelt-grpelt"></a>
##### `g ne h: GrpElt, GrpElt -> BoolElt`

Given elements $g$ and $h$ belonging to the same generic group, return `true` if $g$ and $h$ are distinct elements, `false` otherwise.

<a id="function-isid-grpelt"></a>
##### `IsId(g): GrpElt -> BoolElt`

<a id="function-isidentity-grpelt"></a>
##### `IsIdentity(g): GrpElt -> BoolElt`

Returns `true` if the group element $g$ is the identity element.

<a id="function-order-grpelt"></a>
##### `Order(g): GrpElt -> RngIntElt`

The order of the group element $g$.

<a id="example-ex-7b16a3"></a>
##### `Example: Arithmetic with Permutations (ex-7b16a3)`

We illustrate the arithmetic operations by applying them to some elements of ${\operatorname{Sym}}(9)$.

```magma
> G := Sym(9);
> x := G ! (1,2,4)(5,6,8)(3,9,7);
> y := G ! (4,5,6)(7,9,8);
> x*y;
(1, 2, 5, 4)(3, 8, 6, 7)
> x^-1;
(1, 4, 2)(3, 7, 9)(5, 8, 6)
> x^2;
(1, 4, 2)(3, 7, 9)(5, 8, 6)
> x / y;
(1, 2, 6, 9, 8, 4)(3, 7)
> x^y;
(1, 2, 5)(3, 8, 9)(4, 7, 6)
> (x, y);
(1, 7, 3, 6)(4, 5, 9, 8)
> x^y eq y^x;
false
> CycleStructure(x^2*y);
[ <6, 1>, <2, 1>, <1, 1> ]
> Degree(y);
6
> Order(x^2*y);
6
```

### Construction of a General Group

#### The General Group Constructors

The chapters on the individual group categories describe several methods for constructing groups; this section indicates one approach only.

<a id="constructor-constructor-permutationgroup-set-list-grpperm-hom"></a>
##### `PermutationGroup< X | L >: Set, List -> GrpPerm, Hom`

<a id="constructor-constructor-permutationgroup-rngintelt-list-grpperm-hom"></a>
##### `PermutationGroup< n | L >: RngIntElt, List -> GrpPerm, Hom`

<a id="constructor-constructor-matrixgroup-rngintelt-rng-list-grpmat-hom"></a>
##### `MatrixGroup< n, R | L >: RngIntElt, Rng, List -> GrpMat, Hom`

These expressions construct, respectively: a permutation group $G$ acting on the set $X$; a permutation group $G$ acting on the set $X=\{ 1, \dots, n\rbrace$; or a matrix group $G$ of degree $n$ over the ring $R$. The generic group $U$ of which $G$ is a subgroup will be ${\operatorname{Sym}}(X)$ in the permutation case or ${\operatorname{GL}}(n, R)$ in the matrix case. There are two return values: $G$, and the inclusion homomorphism from $G$ to $U$. The generators of $G$ are defined by the list $L$. Each term of $L$ must be an object of one of the following types:

**(a)**
Either (permutation case) a sequence of $n$ elements of $X$, or (matrix case) a sequence of $n^2$ elements of $R$, defining an element of $U$;

**(b)**
A set or sequence of sequences of type (a);

**(c)**
An element of $U$;

**(d)**
A set or sequence of elements of $U$;

**(e)**
A subgroup of $U$;

**(f)**
A set or sequence of subgroups of $U$.

Each element or group specified by the list must belong to the *same* generic group. The group $G$ will be constructed as a subgroup of some group which contains each of the elements and groups specified in the list. The generators of $G$ consist of the elements specified by the terms of the list $L$ together with the stored generators for groups specified by terms of the list. Repetitions of an element and occurrences of the identity element are removed (unless $G$ is trivial). The `PermutationGroup` constructor is shorthand for the two statements:

```
   U := SymmetricGroup(X);

   G := sub< U | L >;
```

and the `MatrixGroup` constructor is shorthand for the two statements:

```
   U := GeneralLinearGroup(n, R);

   G := sub< U | L >;
```

where `sub< ... >` is the subgroup constructor described in the next subsection.

<a id="constructor-constructor-group-list-identifiers-list-grpfprel-grpfp-hom-grp"></a>
##### `Group< X | R >: List(Identifiers), List(GrpFPRel) -> GrpFP, Hom(Grp)`

<a id="constructor-constructor-polycyclicgroup-list-identifiers-list-grpfprel-grppc-hom"></a>
##### `PolycyclicGroup< X | R >: List(Identifiers), List(GrpFPRel) -> GrpPC, Hom`

<a id="constructor-constructor-abeliangroup-list-identifiers-list-grpabrel-grpab-hom-grpab"></a>
##### `AbelianGroup< X | R >: List(Identifiers), List(GrpAbRel) -> GrpAb, Hom(GrpAb)`

These expressions construct, respectively, a finitely presented group, a finite soluble group given by a power-conjugate presentation or a polycyclic group, and an abelian group, in the categories [`GrpFP`](https://docs.magma-maths.org/FinitelyPresentedGroups/FPGroups/index-fpgroups.md#chapgrpfp), [`GrpPC`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/index-finite-soluble-groups.md#chapgrppc) or [`GrpGPC`](https://docs.magma-maths.org/FinitelyPresentedGroups/PolycyclicGroups/index-polycyclic-groups.md#chapgrpgpc), and [`GrpAb`](https://docs.magma-maths.org/FinitelyPresentedGroups/AbelianGroups/index-abelian-groups.md#chapgrpab). Given a list $X$ of identifier names $x_1, \ldots, x_r$, and a list of relations $R$ over them, first construct the free group $F$ (in [`GrpFP`](https://docs.magma-maths.org/FinitelyPresentedGroups/FPGroups/index-fpgroups.md#chapgrpfp) or [`GrpAb`](https://docs.magma-maths.org/FinitelyPresentedGroups/AbelianGroups/index-abelian-groups.md#chapgrpab)) on the generators $x_1, \cdots, x_r$, and then construct the quotient $G$ of $F$ corresponding to the normal subgroup of $F$ defined by the relations $R$. There are two return values: $G$, and the natural homomorphism from $F$ to $G$. The relations of $G$ are defined by the list $R$. Each term of $R$ must be an object of one of the following types:

**(a)**
A word $w$ of $F$, interpreted as the relator $w={\rm identity}$ of $F$;

**(b)**
A relation $w_1=w_2$, where $w_1$ and $w_2$ are words of $F$;

**(c)**
A relation list $w_1 = w_2 = \cdots = w_r$, where the $w_i$ are words of $F$, interpreted as the set of relations $w_1 = w_r, \ldots, w_{r-1} = w_r$.

Within $R$, the identity element of $F$ may be represented by the digit `1` for `Group` or `PolycyclicGroup`, and `0` for `AbelianGroup`. The construct $x_1, \ldots, x_n$ defines names for the generators of $G$ that are local to the constructor, i.e., they are used when writing down the relations to the right of the bar. However, no assignment of *values* to these identifiers is made. If the user wants to refer to the generators by these (or other) names, then the *generators assignment* construct must be used on the left hand side of an assignment statement. The constructor `PolycyclicGroup` returns either a finite soluble group given by a power-conjugate presentation (category [`GrpPC`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/index-finite-soluble-groups.md#chapgrppc)) or a general polycyclic group (category [`GrpGPC`](https://docs.magma-maths.org/FinitelyPresentedGroups/PolycyclicGroups/index-polycyclic-groups.md#chapgrpgpc)), depending on the arguments. $R$ must be either a valid power-conjugate presentation for a finite soluble group or a consistent polycyclic presentation. If $R$ is a valid power-conjugate presentation for a finite soluble group, a group in the category [`GrpPC`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/index-finite-soluble-groups.md#chapgrppc) is returned, unless the parameter `Class` is set to `"GrpGPC"`. If the parameter `Class` is set to `"GrpGPC"` or if $R$ is not a valid power-conjugate presentation for a finite soluble group and the parameter `Class` is not set to `"GrpPC"`, a general polycyclic group in the category [`GrpGPC`](https://docs.magma-maths.org/FinitelyPresentedGroups/PolycyclicGroups/index-polycyclic-groups.md#chapgrpgpc) is returned. In any case, the free group $F$ is in the category [`GrpFP`](https://docs.magma-maths.org/FinitelyPresentedGroups/FPGroups/index-fpgroups.md#chapgrpfp). If $R$ is neither a valid power-conjugate presentation for a finite soluble group nor a consistent polycyclic presentation, or if $R$ does not match the value of the parameter `Class`, a runtime error is caused.

For a detailed description of this constructor and in particular for a description of power-conjugate presentations and consistent polycyclic presentations, we refer to Chapter [Finite Soluble Groups](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/index-finite-soluble-groups.md#chapgrppc) and Chapter [Polycyclic Groups](https://docs.magma-maths.org/FinitelyPresentedGroups/PolycyclicGroups/index-polycyclic-groups.md#chapgrpgpc), respectively.

<a id="example-ex-b4177f"></a>
##### `Example: Group Constructors (ex-b4177f)`

The permutation group of degree 8 generated by the permutations $(1,7,2,8)(3,6,4,5)$ and $(1,4,2,3)(5,7,6,8)$:

```magma
> G := PermutationGroup< 8 |
>     (1, 7, 2, 8)(3, 6, 4, 5), (1, 4, 2, 3)(5, 7, 6, 8) >;
> G;
Permutation group G acting on a set of cardinality 8
    (1, 7, 2, 8)(3, 6, 4, 5)
    (1, 4, 2, 3)(5, 7, 6, 8)
```

A matrix group of degree 2 over ${\bf F}_{9}$:

```magma
> K<w> := GF(9);
> M := MatrixGroup< 2, K | [w,w,1,2*w], [0,2*w,1,1], [1,0,1,2] >;
> M;
MatrixGroup(2, GF(3^2))
Generators:
    [  w   w]
    [  1 w^5]

    [  0 w^5]
    [  1   1]

    [  1   0]
    [  1   2]
> Order(M);
5760
```

The finitely presented group $Q$ defined by the presentation

$$
< s, t, u  \  |  \  t^2, u^{17}, s^2 = t^s = t, u^s = u^{16}, u^t = u >,
$$

together with the natural homomorphism from the free group to $Q$:

```magma
> Q<s,t,u>, h := Group< s, t, u |
>     t^2, u^17, s^2 = t^s = t, u^s = u^16, u^t = u >;
> Q;
Finitely presented group Q on 3 generators
Relations
    t^2 = Id(Q)
    u^17 = Id(Q)
    s^2 = t
    t^s = t
    u^s = u^16
    u^t = u
> Domain(h);
Finitely presented group on 3 generators (free)
```

The soluble group of order 70 defined by the presentation $< a, b, c  \  |  \  a^2 = b, b^5 = c, c^7 >$:

```magma
> G<a,b,c> := PolycyclicGroup< a, b, c | a^2 = b, b^5 = c, c^7 >;
> G;
GrpPC : G of order 70 = 2 * 5 * 7
PC-Relations:
a^2 = b,
b^5 = c,
c^7 = Id(G)
```

A finite abelian group on 4 generators:

```magma
> G := AbelianGroup< h, i, j, k | 5*h, 4*i, 7*j, 2*k - h >;
> G;
Abelian Group isomorphic to Z/2 + Z/140
Defined on 4 generators
Relations:
    G.1 + 8*G.4 = 0
    4*G.2 = 0
    7*G.3 = 0
    10*G.4 = 0
> Order(G);
280
```

<a id="example-ex-327598"></a>
##### `Example: Dihedral Group as a Polycyclic Group (ex-327598)`

Using the constructor `PolycyclicGroup` with different values of the parameter `Class`, we construct the dihedral group of order 10 first as a finite soluble group given by a power-conjugate presentation ([`GrpPC`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/index-finite-soluble-groups.md#chapgrppc)) and next as a general polycyclic group ([`GrpGPC`](https://docs.magma-maths.org/FinitelyPresentedGroups/PolycyclicGroups/index-polycyclic-groups.md#chapgrpgpc)). Note that the presentation $\langle a,b \,|\, a^2, b^5, b^a=b^4 \rangle$ is both a valid power-conjugate presentation and a consistent polycyclic presentation, so we have to set the parameter `Class` to `"GrpGPC"` if we want to construct a group in the category [`GrpGPC`](https://docs.magma-maths.org/FinitelyPresentedGroups/PolycyclicGroups/index-polycyclic-groups.md#chapgrpgpc).

```magma
> G1<a,b> := PolycyclicGroup< a,b | a^2, b^5, b^a=b^4 >;
> G1;
GrpPC : G1 of order 10 = 2 * 5
PC-Relations:
    a^2 = Id(G1),
    b^5 = Id(G1),
    b^a = b^4
> G2<a,b> := PolycyclicGroup< a,b | a^2, b^5, b^a=b^4 : Class := "GrpGPC">;
> G2;
GrpGPC : G2 of order 10 = 2 * 5 on 2 PC-generators
PC-Relations:
    a^2 = Id(G2),
    b^5 = Id(G2),
    b^a = b^4
```

We construct the infinite dihedral group as a group in the category [`GrpGPC`](https://docs.magma-maths.org/FinitelyPresentedGroups/PolycyclicGroups/index-polycyclic-groups.md#chapgrpgpc) from a consistent polycyclic presentation. We do not have to use the parameter `Class` in this case.

```magma
> G3<a,b> := PolycyclicGroup< a,b | a^2, b^a=b^-1>;
> G3;
GrpGPC : G3 of infinite order on 2 PC-generators
PC-Relations:
    a^2 = Id(G3),
    b^a = b^-1
```

The presentation $\langle a,b \,|\, a^2, b^4, b^a=b^3 \rangle$ is not a valid power-conjugate presentation for the dihedral group of order 8, since the exponent of $b$ is not prime. However, it is a consistent polycyclic presentation. Consequently, the constructor `PolycyclicGroup` without specifying a value for the parameter `Class` returns a group in the category [`GrpGPC`](https://docs.magma-maths.org/FinitelyPresentedGroups/PolycyclicGroups/index-polycyclic-groups.md#chapgrpgpc).

```magma
> G4<a,b> := PolycyclicGroup< a,b | a^2, b^4, b^a=b^3 >;
> G4;
GrpGPC : G4 of order 2^3 on 2 PC-generators
PC-Relations:
    a^2 = Id(G3),
    b^4 = Id(G3),
    b^a = b^3
```

#### Construction of Subgroups

<a id="constructor-constructor-sub-grp-list-grp"></a>
##### `sub<G | L>: Grp, List -> Grp`

Given the group $G$, construct the subgroup $H$ of $G$, generated by the elements specified by the list $L$, where $L$ is a list of one or more items of the following types:

**(a)**
A Magma object which may be coerced into $G$;

**(b)**
A set or sequence of sequences of type (a);

**(c)**
An element of $G$;

**(d)**
A set or sequence of elements of $G$;

**(e)**
A subgroup of $G$;

**(f)**
A set or sequence of subgroups of $G$.

Each element or group specified by the list must belong to the *same* generic group. The subgroup $H$ will be constructed as a subgroup of some group which contains each of the elements and groups specified in the list. The generators of $H$ consist of the elements specified by the terms of the list $L$ together with the stored generators for groups specified by terms of the list. Repetitions of an element and occurrences of the identity element are removed (unless $H$ is trivial).

<a id="constructor-constructor-ncl-grp-list-grp"></a>
##### `ncl<G | L>: Grp, List -> Grp`

Given the group $G$, construct the subgroup $H$ of $G$ that is the *normal closure* of the subgroup $H$ generated by the elements specified by the list $L$, where the possibilities for $L$ are the same as for the `sub`-constructor.

<a id="example-ex-2c1c5d"></a>
##### `Example: Subgroup of a Finitely Presented Group (ex-2c1c5d)`

Let $Q$ be the finitely presented group in generators $s,t,u$ constructed in an earlier example. We construct the subgroup $S$ of $Q$ generated by $ts^2$ and $u^4$:

```magma
> Q<s,t,u>, h := Group< s, t, u |
>     t^2, u^17, s^2 = t^s = t, u^s = u^16, u^t = u >;
> S := sub< Q | t*s^2, u^4 >;
> S;
Finitely presented group S on 2 generators
Generators as words
    S.1 = $.2 * $.1^2
    S.2 = $.3^4
```

#### Construction of Quotient Groups

<a id="constructor-constructor-quo-grp-list-grp-map"></a>
##### `quo<G | L>: Grp, List -> Grp, Map`

Given the group $G$, construct the quotient group $Q = G/N$, where $N$ is the normal closure of the subgroup of $G$ generated by the elements specified by $L$. The clause $L$ is a list of one or more items of the following types:

**(a)**
A Magma object which can be coerced into $G$;

**(b)**
A set or sequence of sequences of type (a);

**(c)**
An element of $G$;

**(d)**
A set or sequence of elements of $G$;

**(e)**
A subgroup of $G$;

**(f)**
A set or sequence of subgroups of $G$.

Each element or group specified by the list must belong to the *same* generic group. The function returns

**(a)**
the quotient group $Q$, and

**(b)**
the natural homomorphism $f: G\rightarrow Q$.

Arbitrary quotients may be readily constructed in the case of the categories [`GrpFP`](https://docs.magma-maths.org/FinitelyPresentedGroups/FPGroups/index-fpgroups.md#chapgrpfp), [`GrpGPC`](https://docs.magma-maths.org/FinitelyPresentedGroups/PolycyclicGroups/index-polycyclic-groups.md#chapgrpgpc), [`GrpPC`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/index-finite-soluble-groups.md#chapgrppc) and [`GrpAb`](https://docs.magma-maths.org/FinitelyPresentedGroups/AbelianGroups/index-abelian-groups.md#chapgrpab). However, in the case of permutation and matrix groups, currently the quotient group is constructed via its regular representation, so that the application of this operator is restricted to the case where the index of $N$ in $G$ is less than $2^{30}$.

The second return value is the epimorphism from $G$ to the resulting quotient group.

<a id="operation-op-div-grp-grp"></a>
##### `G / N: Grp, Grp -> Grp`

Given a (normal) subgroup $N$ of the group $G$, construct the quotient of $G$ by $N$.

If $G$ is in category [`GrpFP`](https://docs.magma-maths.org/FinitelyPresentedGroups/FPGroups/index-fpgroups.md#chapgrpfp), $N$ is not checked to be normal in $G$. In fact, the returned group is the quotient of $G$ by the normal closure of $N$ in $G$. For all other categories of groups, passing a subgroup which fails to be normal causes a runtime error.

If $G$ is a permutation or matrix group, the quotient group is constructed via its regular representation, so that the application of this operator is restricted to the case where the index of $N$ in $G$ is at most a million. The result returned need not be regular, as an attempt is made to reduce the degree of the result.

<a id="example-ex-8f51d1"></a>
##### `Example: Quotient of an Abelian Group (ex-8f51d1)`

Construction of the quotient of an abelian group, with a demonstration of the use of the natural homomorphism:

```magma
> G<[x]>, f := AbelianGroup< h, i, j, k | 8*h, 4*i, 6*j, 2*k - h >;
> T, n := quo< G | x[1] + 2*x[2] + 24*x[3], 16*x[3] >;
> T;
Abelian Group isomorphic to Z/2 + Z/16
Defined on 2 generators
Relations:
    4*T.1 = 0
    16*T.2 = 0
> n(x);
[
    2*T.1,
    T.1 + 12*T.2,
    T.2
]
> n(sub< G | x[1] + x[2] + x[3] >);
Abelian Group isomorphic to Z/16
Defined on 1 generator in supergroup T:
    $.1 = 3*T.1 + T.2
Relations:
    16*$.1 = 0
```

### Standard Groups and Extensions

#### Construction of a Standard Group

A number of functions are provided which construct various standard groups. The effect of these functions is to construct the group on some standard set of generators. The group category of the result may be specified as an argument to the function.

<a id="function-abeliangroup-cat-rngintelt"></a>
##### `AbelianGroup(C, Q): Cat, [ RngIntElt ] -> GrpFin`

<a id="function-abeliangroup-rngintelt"></a>
##### `AbelianGroup(Q): [ RngIntElt ] -> GrpAb`

Construct the abelian group defined by the sequence $Q = [n_1,\ldots,n_r]$ of positive integers. The function constructs the direct product of cyclic groups $\Z_{n_1} \times \Z_{n_2} \times \cdots \times \Z_{n_r}$. In some categories, $n_i$ may also be 0, denoting the infinite cyclic group $\Z$. If the single-argument version of the function is used, the group will be constructed in the category [`GrpAb`](https://docs.magma-maths.org/FinitelyPresentedGroups/AbelianGroups/index-abelian-groups.md#chapgrpab); otherwise, its category will be $C$, where $C$ may be [`GrpAb`](https://docs.magma-maths.org/FinitelyPresentedGroups/AbelianGroups/index-abelian-groups.md#chapgrpab), [`GrpFP`](https://docs.magma-maths.org/FinitelyPresentedGroups/FPGroups/index-fpgroups.md#chapgrpfp), [`GrpGPC`](https://docs.magma-maths.org/FinitelyPresentedGroups/PolycyclicGroups/index-polycyclic-groups.md#chapgrpgpc), [`GrpPC`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/index-finite-soluble-groups.md#chapgrppc) or [`GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/index-permutation-groups.md#chapgrpperm).

<a id="function-alternatinggroup-cat-rngintelt"></a>
##### `AlternatingGroup(C, n): Cat, RngIntElt -> GrpFin`

<a id="function-alternatinggroup-rngintelt"></a>
##### `AlternatingGroup(n): RngIntElt -> GrpPerm`

<a id="function-alt-cat-rngintelt"></a>
##### `Alt(C, n): Cat, RngIntElt -> GrpFin`

<a id="function-alt-rngintelt"></a>
##### `Alt(n): RngIntElt -> GrpPerm`

Construct the alternating group on $n$ letters. If the single-argument version of the function is used, the group will be constructed in the category [`GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/index-permutation-groups.md#chapgrpperm); otherwise, its category will be $C$, where $C$ may be [`GrpFP`](https://docs.magma-maths.org/FinitelyPresentedGroups/FPGroups/index-fpgroups.md#chapgrpfp) or [`GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/index-permutation-groups.md#chapgrpperm).

<a id="function-cyclicgroup-cat-rngintelt"></a>
##### `CyclicGroup(C, n): Cat, RngIntElt -> GrpFin`

<a id="function-cyclicgroup-rngintelt"></a>
##### `CyclicGroup(n): RngIntElt -> GrpPerm`

Construct the cyclic group of order $n$. If the single-argument version of the function is used, the group will be constructed in the category [`GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/index-permutation-groups.md#chapgrpperm); otherwise, its category will be $C$, where $C$ may be [`GrpAb`](https://docs.magma-maths.org/FinitelyPresentedGroups/AbelianGroups/index-abelian-groups.md#chapgrpab), [`GrpFP`](https://docs.magma-maths.org/FinitelyPresentedGroups/FPGroups/index-fpgroups.md#chapgrpfp), [`GrpGPC`](https://docs.magma-maths.org/FinitelyPresentedGroups/PolycyclicGroups/index-polycyclic-groups.md#chapgrpgpc), [`GrpPC`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/index-finite-soluble-groups.md#chapgrppc) or [`GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/index-permutation-groups.md#chapgrpperm).

<a id="function-dihedralgroup-cat-rngintelt"></a>
##### `DihedralGroup(C, n): Cat, RngIntElt -> GrpFin`

<a id="function-dihedralgroup-rngintelt"></a>
##### `DihedralGroup(n): RngIntElt -> GrpPerm`

Construct the dihedral group of order $2*n$. If the single-argument version of the function is used, the group will be constructed in the category [`GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/index-permutation-groups.md#chapgrpperm); otherwise, its category will be $C$, where $C$ may be [`GrpFP`](https://docs.magma-maths.org/FinitelyPresentedGroups/FPGroups/index-fpgroups.md#chapgrpfp), [`GrpGPC`](https://docs.magma-maths.org/FinitelyPresentedGroups/PolycyclicGroups/index-polycyclic-groups.md#chapgrpgpc), [`GrpPC`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/index-finite-soluble-groups.md#chapgrppc) or [`GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/index-permutation-groups.md#chapgrpperm).

<a id="function-dicyclicgroup-rngintelt"></a>
##### `DicyclicGroup(n): RngIntElt -> GrpFP`

<a id="function-dicyclicgroup-grpab-grpabelt"></a>
##### `DicyclicGroup(A, a): GrpAb, GrpAbElt -> GrpFP`

The first intrinsic constructs the dicyclic group of order $4n$. The second, when given an abelian group $A$ and an element $a$ of order 2, constructs the associated dicyclic group generated by $A$ and an $x$ with $x^2=a$ and $a^x=a^{-1}$ for all $x\in A$.

<a id="function-symmetricgroup-cat-rngintelt"></a>
##### `SymmetricGroup(C, n): Cat, RngIntElt -> GrpFin`

<a id="function-symmetricgroup-rngintelt"></a>
##### `SymmetricGroup(n): RngIntElt -> GrpPerm`

<a id="function-sym-cat-rngintelt"></a>
##### `Sym(GrpFin, n): Cat, RngIntElt -> GrpFin`

<a id="function-sym-rngintelt"></a>
##### `Sym(n): RngIntElt -> GrpPerm`

Construct the symmetric group on $n$ letters. If the single-argument version of the function is used, the group will be constructed in the category [`GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/index-permutation-groups.md#chapgrpperm); otherwise, its category will be $C$, where $C$ may be [`GrpFP`](https://docs.magma-maths.org/FinitelyPresentedGroups/FPGroups/index-fpgroups.md#chapgrpfp) or [`GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/index-permutation-groups.md#chapgrpperm).

<a id="function-extraspecialgroup-cat-rngintelt-rngintelt"></a>
##### `ExtraSpecialGroup(C, p, n : parameters): Cat, RngIntElt, RngIntElt -> GrpFin`

<a id="function-extraspecialgroup-rngintelt-rngintelt"></a>
##### `ExtraSpecialGroup(p, n : parameters): RngIntElt, RngIntElt -> GrpPerm`

```magma
Type: MonStgElt                    Default: "+"
```

Given a prime $p$ and a small positive integer $n$, construct an extra-special group $G$ of order $p^{2n+1}$. The isomorphism type of $G$ can be selected using the parameter `Type` described below.

If the two-argument version of the function is used, the group will be constructed in the category [`GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/index-permutation-groups.md#chapgrpperm); otherwise, its category will be $C$, where $C$ may be [`GrpFP`](https://docs.magma-maths.org/FinitelyPresentedGroups/FPGroups/index-fpgroups.md#chapgrpfp), [`GrpGPC`](https://docs.magma-maths.org/FinitelyPresentedGroups/PolycyclicGroups/index-polycyclic-groups.md#chapgrpgpc), [`GrpPC`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/index-finite-soluble-groups.md#chapgrppc) or [`GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/index-permutation-groups.md#chapgrpperm). If $C$ is [`GrpFP`](https://docs.magma-maths.org/FinitelyPresentedGroups/FPGroups/index-fpgroups.md#chapgrpfp), [`GrpPC`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/index-finite-soluble-groups.md#chapgrppc) or [`GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/index-permutation-groups.md#chapgrpperm), the prime $p$ must be small.

Possible values for this parameter are “$+$” (default) and “$-$“.

If `Type` is set to “$+$”, the function returns for $p = 2$ the central product of $n$ copies of the dihedral group of order 8, and for $p > 2$ it returns the unique extra-special group of order $p^{2n+1}$ and exponent $p$.

If `Type` is set to “$-$”, the function returns for $p = 2$ the central product of a quaternion group of order 8 and $n-1$ copies of the dihedral group of order 8, and for $p > 2$ it returns the unique extra-special group of order $p^{2n+1}$ and exponent $p^2$.

<a id="example-ex-a51dba"></a>
##### `Example: Standard Groups (ex-a51dba)`

The abelian group $\Z_6 \times \Z_2 \times \Z_7$ in the category [`GrpAb`](https://docs.magma-maths.org/FinitelyPresentedGroups/AbelianGroups/index-abelian-groups.md#chapgrpab):

```magma
> A := AbelianGroup([6, 2, 7]);
> A;
Abelian Group isomorphic to Z/2 + Z/42
Defined on 3 generators
Relations:
    6*A.1 = 0
    2*A.2 = 0
    7*A.3 = 0
```

The alternating group on $6$ letters as a permutation group:

```magma
> A6 := Alt(6);
> A6;
Permutation group A6 acting on a set of cardinality 6
Order = 360 = 2^3 * 3^2 * 5
    (1, 2)(3, 4, 5, 6)
    (1, 2, 3)
```

The dihedral group of order $8$ as a [`GrpPC`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/index-finite-soluble-groups.md#chapgrppc):

```magma
> D8 := DihedralGroup(GrpPC, 4);
> D8;
GrpPC : D8 of order 8 = 2^3
PC-Relations:
  D8.2^2 = D8.3,
  D8.2^D8.1 = D8.2 * D8.3
```

The symmetric group on $7$ letters as a finitely presented group on generators $a$ and $b$:

```magma
> S7<a, b> := SymmetricGroup(GrpFP, 7);
> S7;
Finitely presented group S7 on 2 generators
Relations
    a^7 = Id(S7)
    b^2 = Id(S7)
    (a * b)^6 = Id(S7)
    (a^-1 * b * a * b)^3 = Id(S7)
    (b * a^-2 * b * a^2)^2 = Id(S7)
    (b * a^-3 * b * a^3)^2 = Id(S7)
```

#### Construction of Extensions

<a id="function-directproduct-grp-grp"></a>
##### `DirectProduct(G, H): Grp, Grp -> Grp`

Given two groups $G$ and $H$ belonging to the category $C$, construct the direct product of $G$ and $H$ as a group in $C$.

<a id="function-directproduct-grp"></a>
##### `DirectProduct(Q): [ Grp ] -> Grp`

Given a sequence $Q$ of $n$ groups belonging to the category $C$, construct the direct product $Q[1] \times Q[2] \times \ldots \times Q[n]$ as a group in the category $C$.

<a id="function-semidirectproduct-grp-grp-map"></a>
##### `SemidirectProduct(K, H, f: parameters): Grp, Grp, Map -> Grp, Map, Map, Map`

```magma
MaxDeg    : RngIntElt                    Default: 1000000
Print     : BoolElt                      Default: false
UseRegular: BoolElt                      Default: false
```

Given two groups $K$ and $H$ and a homomorphism $f:H\to {\operatorname{Aut}}(K)$, construct the semidirect product of $K$ and $H$ where the elements of $H$ act on $K$ via the map $f$. The semidirect product $S$ is returned together with maps embedding $K$ and $H$ into $S$, and the projection $S \to H$.

The maximum degree permutation representation the algorithm will attempt.

Setting `UseRegular` to true forces the algorithm to go via the regular representations of $K$ and $H$.

<a id="example-ex-ba6db1"></a>
##### `Example: Semidirect Product (ex-ba6db1)`

```magma
> K := CyclicGroup(3);
> H := CyclicGroup(4);
> A := AutomorphismGroup(K);
> f := hom< H->A | [ hom<K->K | [K.1^2]> ] >;
> S := SemidirectProduct(K,H,f);
> S;
Permutation group S acting on a set of cardinality 7
    (1, 2, 3)
    (2, 3)(4, 5, 6, 7)
```

<a id="function-affinesplitextension-modgrp"></a>
##### `AffineSplitExtension(M: parameters): ModGrp -> Grp, Map, Map, Map`

```magma
MaxDeg: RngIntElt                    Default: 1000000
Print : BoolElt                      Default: false
```

Given a module $M$ over a finite group ring $KG$, construct the semidirect product of $M$ and $G$, where the elements of $G$ act on $M$ as in the module. The semidirect product $S$ is returned together with maps embedding $M$ and $G$ into $S$, and the projection $S \to G$.

The module $M$ will act as a regular normal subgroup on the first orbit of $S$. If the action of $G$ on $M$ is faithful, then $S$ will be transitive, and otherwise there will be a second orbit on which $H$ acts faithfully.

The maximum degree permutation representation the algorithm will attempt.

<a id="example-ex-e704a5"></a>
##### `Example: Affine Split Extension (ex-e704a5)`

```magma
> G := SL(2,3);
> I := IrreducibleModules(G,GF(2));
> I[2];
GModule of dimension 2 over GF(2)
> E := AffineSplitExtension(I[2]);
> E;
Permutation group E acting on a set of cardinality 12
Order = 96 = 2^5 * 3
    (1, 2)(3, 4)
    (1, 3)(2, 4)
    (2, 3, 4)(6, 9, 11)(8, 10, 12)
    (5, 6, 7, 8)(9, 12, 10, 11)
```

<a id="example-ex-a6b832"></a>
##### `Example: Direct Product of Two Groups (ex-a6b832)`

We define $G$ to be the symmetric group of degree $4$ and $H$ to be the dihedral group of order $8$. We then form the direct product of $G$ and $H$.

```magma
> G := SymmetricGroup(4);
> H := DihedralGroup(3);
> D := DirectProduct(G, H);
> D;
Permutation group D acting on a set of cardinality 7
    (1, 2, 3, 4)
    (1, 2)
    (5, 6, 7)
    (5, 6)
> Order(D);
144
```

### Transfer Functions Between Group Categories

Since certain group computations are possible or feasible only for particular group representations, it is often useful to transfer a group from one category to another. The functions in this section take a group and return a group isomorphic to it (or isomorphic to some related group) in another category.

<a id="function-pquotient-grpfp-rngintelt-rngintelt"></a>
#### `pQuotient(F, p, c: parameters): GrpFP, RngIntElt, RngIntElt -> GrpPC, Map`

```magma
Exponent  : RngIntElt                    Default: 0
Metabelian: BoolElt                      Default: false
Print     : RngIntElt                    Default: 0
Workspace : RngIntElt                    Default: 5000000
```

Given a group $F$ in category [`GrpFP`](https://docs.magma-maths.org/FinitelyPresentedGroups/FPGroups/index-fpgroups.md#chapgrpfp), a prime $p$, and a positive integer $c$, construct the largest $p$-quotient $G$ of $F$ having lower exponent-$p$ class at most $c$ (or 127, if $c$ is given as $0$) as group in the category [`GrpPC`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/index-finite-soluble-groups.md#chapgrppc). The prime $p$ must be less than $65536$. The function also returns the homomorphism from $F$ to $G$.

The parameters are:

If `Exponent := m`, enforce the exponent law, $x^m = 1$, on the group.

If `Metabelian := true`, then a consistent pcp is constructed for the largest metabelian $p$-quotient of $F$ having lower exponent-$p$ class at most $c$.

This parameter controls the volume of printing. By default its value is that returned by `GetVerbose("pQuotient")`, which is $0$ unless it has been changed through use of `SetVerbose`. The effect is the following:

`Print := 0` : No output.

`Print := 1` : Report order of $p$-quotient at each class.

`Print := 2` : Report statistics and redundancy information about tails, consistency, collection of relations, and exponent enforcement components of calculation.

`Print := 3` : Report in detail on the construction of each class.

Note that the presentation displayed is a *power-commutator* presentation (since this is the version stored by the $p$-quotient).

The amount of space requested for the $p$-quotient computation.

<a id="function-cosetaction-grp-grp"></a>
#### `CosetAction(G, H): Grp, Grp -> Hom(Grp), GrpPerm, Grp`

<a id="function-regularrepresentation-grp-grp"></a>
#### `RegularRepresentation(G, H): Grp, Grp -> Hom(Grp), GrpPerm, Grp`

Given a subgroup $H$ of the group $G$, construct the permutation representation of $G$ given by the action of $G$ on the set of (right) cosets of $H$ in $G$. The function returns:

**(a)**
The natural homomorphism $f: G \rightarrow  L$;

**(b)**
The induced permutation group $L$ (the image of $f$);

**(c)**
(if possible) The kernel $K$ of the action (a subgroup of $G$).

If $G$ is a finitely presented group, then $K$ may be returned undefined. The permutation representation is obtained by using the Todd-Coxeter procedure to construct the coset table for $H$ in $G$. Note that $G$ may be an infinite group: it is only necessary that the index of $H$ in $G$ be finite.

<a id="function-cosetimage-grp-grp"></a>
#### `CosetImage(G, H): Grp, Grp -> GrpPerm`

Given a subgroup $H$ of the group $G$, construct the image of $G$ given by its action on the (right) coset space of $H$ in $G$, returning it as a permutation group. (This is also the second return value of `CosetAction(G, H)`.)

<a id="function-cosetkernel-grp-grp"></a>
#### `CosetKernel(G, H): Grp, Grp -> Grp`

Given a subgroup $H$ of the group $G$, construct the kernel of $G$ in its action on the (right) coset space of $H$ in $G$. (This is also the third return value of `CosetAction(G, H)`.) This function may fail if $G$ is a finitely presented group; it is only available when the index of $H$ in $G$ is very small.

<a id="function-minimaldegreepermutationrepresentation-grp"></a>
#### `MinimalDegreePermutationRepresentation(G: parameters): Grp -> Hom(Grp), GrpPerm`

```magma
Print    : RngIntElt                    Default: 0
Accept   : RngIntElt                    Default: 0
UseAutGrp: BoolElt                      Default: true
```

Given a finite group $G$ in category `GrpPerm`, `GrpMat`, or `GrpPC`, construct a faithful permutation representation $\phi$ of $G$ of smallest possible degree. The homomorphism $\phi$ and its image $P$ are returned.

*Warning*: This function can take a very long time on difficult examples.

The parameters are:

This controls the level of diagnostic printing, the default being none.

If `Accept` is set to an integer $n > 0$, then the function will stop if it finds a faithful permutation representation of degree at most $n$, and return that. Of course this means that the representation returned is not guaranteed to have minimal degree.

When `UsAutGrp` is `true`, the function might compute the automorphism group of $G$ to help reduce its search space.

<a id="example-ex-4a0ec6"></a>
#### `Example: Minimal Degree Permutation Representation (ex-4a0ec6)`

```magma
> G := OmegaPlus(8,3);
> phi, P := MinimalDegreePermutationRepresentation(G);
> P;
Permutation group P acting on a set of cardinality 2160
Order = 2^13 * 3^12 * 5^2 * 7 * 13
```

The function works quickly on almost all of the groups in the small groups library of groups of order less than 2000, but it can be slow on a few such examples, particularly large $p$-groups. These might be suitable candidates for effective use of the `Accept` parameter.

It generally performs well with groups of type `GrpMat`, provided that a reasonably small degree faithful permutation representation exists. For example, for the group `SpinPlus`(8,3), it finds the optimal representation of degree 4320 reasonably quickly (about 20 seconds), whereas for `SpinMinus`(8,3), it takes longer (about 180 seconds) to find the representation of degree 183680 and prove that it has minimal degree.

As another example, with input the representation of the non-split extension $2^5 \cdot L_5(2)$ of $L_5(2)$ by its natural module as a subgroup of ${\rm GL}(69,2)$ (from the ATLAS database in Magma), the minimal degree function takes about 10 seconds to find the optimal faithful permutation representation of degree 3968, which is less than the degree of the permutation representations in the ATLAS database.

The new function cannot be used directly on finite groups of type `GrpFP`, but the user can try using coset enumeration with `CosetAction` or `CosetImage` to find an isomorphic group of type `GrpPerm`, and then use
`MinimalDegreePermutationRepresentation` on that. For example, with the group $G = \langle x,y \mid x^2,y^3,(xy)^7,[x,y]^8\rangle$, which has order 10752, we could first use `CosetAction` to compute a permutation representation of degree $1344$ on the cosets of the subgroup $\langle [x,y] \rangle$, and then use the resulting image as input to `MinimalDegreePermutationRepresentation` to find the minimal degree representation, which is of degree 28.

<a id="function-permutationrepresentationquotient-grp-grp"></a>
#### `PermutationRepresentationQuotient(G, N : parameters): Grp, Grp -> Hom(Grp), GrpPerm`

```magma
Print : RngIntElt                    Default: 0
Accept: RngIntElt                    Default: 0
MaxDeg: RngIntElt                    Default: 10^7
```

Given a finite group $G$ in category `GrpPerm`, `GrpMat`, or `GrpPC` and a normal subgroup $N$ of $G$, construct a faithful permutation representation $G/N$. This is returned as a permutation representation $\phi$ of $G$ with kernel $N$, together with the image of $\phi$. The representation will usually, but not always, be of smallest possible degree.

*Warning*: This function can take a very long time on difficult examples.

The parameters are:

This controls the level of diagnostic printing, the default being none.

If `Accept` is set to an integer $n > 0$, then the function will stop if it finds a faithful permutation representation of $G/N$ of degree at most $n$, and return that. Of course this means that the representation returned will typically not be of minimal degree.

The process aborts if it discovers that the smallest degree faithful representation of $G/N$ has degree more than `MaxDeg`.

<a id="function-gpcgroup-grp"></a>
#### `GPCGroup(G): Grp -> GrpGPC, Hom(Grp)`

Given a soluble group $G$, in the category [`GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/index-permutation-groups.md#chapgrpperm), [`GrpMat`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/index-matrix-groups-over-general-rings.md#chapgrpmat), [`GrpAb`](https://docs.magma-maths.org/FinitelyPresentedGroups/AbelianGroups/index-abelian-groups.md#chapgrpab) or [`GrpPC`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/index-finite-soluble-groups.md#chapgrppc), construct a polycyclic group $P$ isomorphic to $G$. Currently $G$ must be finite, if it is in the category [`GrpMat`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/index-matrix-groups-over-general-rings.md#chapgrpmat). In addition to returning $P$, the function returns an isomorphism $\phi: G \ar P$.

<a id="function-pcgroup-grp"></a>
#### `PCGroup(G): Grp -> GrpPC, Hom(Grp)`

Given a finite soluble group $G$, in the category [`GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/index-permutation-groups.md#chapgrpperm), [`GrpMat`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/index-matrix-groups-over-general-rings.md#chapgrpmat), [`GrpAb`](https://docs.magma-maths.org/FinitelyPresentedGroups/AbelianGroups/index-abelian-groups.md#chapgrpab) or [`GrpGPC`](https://docs.magma-maths.org/FinitelyPresentedGroups/PolycyclicGroups/index-polycyclic-groups.md#chapgrpgpc), construct a group $S$ given by a power-conjugate presentation, which is isomorphic to $G$. In addition to returning $S$, the function returns an isomorphism $\phi: G \ar S$.

<a id="function-fpgroup-grpperm"></a>
#### `FPGroup(G: parameters): GrpPerm -> GrpFP, Hom(Grp)`

```magma
StrongGenerators: BoolElt                      Default: false
Random          : BoolElt                      Default: true
Max             : RngIntElt                    Default: 100
Run             : RngIntElt                    Default: 20
```

Given a group $G$, in the category [`GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/index-permutation-groups.md#chapgrpperm), [`GrpMat`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/index-matrix-groups-over-general-rings.md#chapgrpmat), [`GrpGPC`](https://docs.magma-maths.org/FinitelyPresentedGroups/PolycyclicGroups/index-polycyclic-groups.md#chapgrpgpc) or [`GrpPC`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/index-finite-soluble-groups.md#chapgrppc), construct a finitely presented group $F$ isomorphic to $G$, by presenting the group on its given generators. For groups in the category [`GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/index-permutation-groups.md#chapgrpperm) and [`GrpMat`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/index-matrix-groups-over-general-rings.md#chapgrpmat), the Todd-Coxeter Schreier algorithm is used to construct the presentation and a choice of a presentation on the given generators or on the strong generators is available. In addition to returning $F$, the function returns an isomorphism $\phi: F \ar G$, such that $\phi(F.i)=G.i$ for all $i$. If the parameter `StrongGenerators` is set to `true` ([`GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/index-permutation-groups.md#chapgrpperm) and [`GrpMat`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/index-matrix-groups-over-general-rings.md#chapgrpmat) only), the presentation will be constructed on the strong generators of $G$ instead of the given generators. If strong generators are not already known for $G$, they will be constructed; in this case, the other parameters are also meaningful. The parameter `Random` with its associated parameters `Max` and `Run` may be used to apply the Random Schreier algorithm to construct a probable BSGS before commencing the construction of the presentation.

<a id="example-ex-faa68a"></a>
#### `Example: Action on Cosets of a Subgroup (ex-faa68a)`

We construct a finitely presented group $G$ and a subgroup $H$, then find the permutation representation of $G$ given by its action on the cosets of $H$. Since the induced permutation group $L$ has the same order as $G$, the representation is faithful, and the homomorphism $f: G \rightarrow L$ is an isomorphism.

```magma
> G<a, b> := Group< a, b | a^3, b^3, (b * a)^4,
>     ((b^-1)^a * b^-1)^2 * b^a * b >;
> Order(G);
168
> H := sub< G | a^2 * b^2, (a * b)^2 >;
> Index(G, H);
7
> f, L := CosetAction(G, H);
> f;
Mapping from: GrpFP: G to GrpPerm: L
> L;
Permutation group L acting on a set of cardinality 7
    (1, 2, 3)(4, 7, 5)
    (1, 3, 4)(2, 5, 6)
> Order(L);
168
```

<a id="example-ex-4138bd"></a>
#### `Example: Permutation Representation of Sp(2, 4) (ex-4138bd)`

A permutation representation of ${\operatorname{Sp}}(2, 4)$.

```magma
> M := SymplecticGroup(2, 4);
> #M;
60
> Ms := sub< M | M.1 * M.2 >;
> Index(M, Ms);
12
> PG := CosetImage(M, Ms);
> PG;
Permutation group PG acting on a set of cardinality 12
    (1, 2, 4)(3, 5, 7)(6, 8, 10)(9, 11, 12)
    (1, 3, 2)(4, 6, 8)(5, 7, 9)(10, 12, 11)
> #PG;
60
```

<a id="example-ex-35b71d"></a>
#### `Example: Finite Presentation of PSU(3, 3) (ex-35b71d)`

A finitely presented group isomorphic to ${\operatorname{PSU}}(3, 3)$:

```magma
> G := PSU(3, 3);
> F<a, b>, phi := FPGroup(G);
> F;
Finitely presented group F on 2 generators
Relations
    a^8 = Id(F)
    b^8 = Id(F)
    (b * a^-1 * b)^3 = Id(F)
    b * a^-1 * b^-1 * a^-1 * b^-1 * a^-1 * b * a^-1 * b * a^-1 = Id(F)
    b^-1 * a^-2 * b^-1 * a^-2 * b^-1 * a^-1 * b^-2 * a^-1 = Id(F)
> phi(a) eq G.1 and phi(b) eq G.2;
true
```

### Basic Operations

#### Accessing Group Information

The functions in this group provide access to basic information stored for a group $G$.

<a id="operation-operation-grp-rngintelt-grpelt"></a>
##### `G . i: Grp, RngIntElt -> GrpElt`

The $i$-th defining generator for $G$, if $i>0$. If $i<0$, then the inverse of the $-i$-th defining generator is returned. The generator `G.0` is equivalent to `Identity(G)`.

<a id="function-generators-grp"></a>
##### `Generators(G): Grp -> { GrpFinElt }`

A set containing the defining generators for $G$.

<a id="function-numberofgenerators-grp"></a>
##### `NumberOfGenerators(G): Grp -> RngIntElt`

<a id="function-ngens-grp"></a>
##### `Ngens(G): Grp -> RngIntElt`

The number of defining generators for $G$.

<a id="function-smallestgeneratingset-grp"></a>
##### `SmallestGeneratingSet(G: parameters): Grp -> SetIndx`

```magma
Print     : RngIntElt                    Default: 0
QuickTries: RngIntElt                    Default: 250
```

A generating set of minimal cardinality for the finite group $G$. The algorithm is from [[LT24](https://docs.magma-maths.org/references.md#cite-luctha)].

<a id="function-generic-grp"></a>
##### `Generic(G): Grp -> Grp`

Given a group $G$ in the category [`GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/index-permutation-groups.md#chapgrpperm) or [`GrpMat`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/index-matrix-groups-over-general-rings.md#chapgrpmat), return the generic group containing $G$, i.e., the largest group in which $G$ is naturally embedded. The precise definition of generic group depends upon the category to which $G$ belongs.

<a id="function-parent-grpelt"></a>
##### `Parent(g): GrpElt -> Grp`

The parent group $G$ for the group element $g$.

<a id="example-ex-a47283"></a>
##### `Example: Generators of the Suzuki Group Sz(8) (ex-a47283)`

The Suzuki simple group $G={\operatorname{Sz}}(8)$ is constructed. Its generic group is ${\operatorname{GL}}(4, K)$, where $K$ is the finite field with 8 elements. The field $K$ is constructed first, so that its generator may be given the printname $z$. Then the three generators of $G$ are printed, in the standard order of indexing.

```magma
> K<z> := GF(2, 3);
> G := SuzukiGroup(8);
> Generic(G);
GL(4, GF(2, 3))
> Ngens(G);
3
> for i in [1..3] do
>    print "generator", i, G.i;
>    print "order", Order(G.i), "\\r";
> end for;
generator 1
[  0   0   0   1]
[  0   0   1   0]
[  0   1   0   0]
[  1   0   0   0]
order 2

generator 2
[z^2   0   0   0]
[  0 z^6   0   0]
[  0   0   z   0]
[  0   0   0 z^5]
order 7

generator 3
[  1   0   0   0]
[z^2   1   0   0]
[  0   z   1   0]
[z^5 z^3 z^2   1]
order 4
```

<a id="function-orbit-grp-any-any"></a>
##### `Orbit(G, M, x): Grp, Any, Any -> {Any}`

Given a finitely generated group $G$ that acts on the parent structure of $x$ through the map (or user defined function) $M$, compute the orbit of $x$ under $G$. Thus, for every generator $g$ of $G$, $M(g)$ must return a function that can be applied to $x$ or any other element in the parent of $x$.

If the orbit is infinite, this process will eventually run out of memory.

<a id="function-orbitclosure-grp-any-any"></a>
##### `OrbitClosure(G, M, S): Grp, Any, {Any} -> Any`

Given a finitely generated group $G$ acting on the universe of $S$ through the map or user defined function $M$, compute the smallest subset $T$ containing $S$ that is $G$-invariant. Thus, for every generator $g$ of $G$, $M(g)$ must return a function that can be applied to an arbitrary element in the universe of $S$.

If the orbit closure is infinite, this process will eventually run out of memory.

<a id="groupname"></a>
#### Names of Finite Groups

<a id="function-groupname-grp"></a>
##### `GroupName(G): Grp -> MonStgElt`

```magma
TeX: BoolElt                    Default: false
```

Short name of a finite group $G$, as an abstract group.

<a id="example-ex-7a2387"></a>
##### `Example: Names of Small Groups (ex-7a2387)`

```magma
> [GroupName(G): G in SmallGroups(24)];
[ C3:C8, C24, SL(2,3), C3:Q8, C4*S3, D12, C2*C3:C4, C3:D4, C2*C12, C3*D4,
   C3*Q8, S4, C2*A4, C2^2*S3, C2^2*C6 ]
> GroupName(AlternatingGroup(10): TeX:=true);
A_{10}
```

Small groups (of order $<512$, not divisible by $128$) have a unique name each, and `Group(GroupName(G))` always returns a group isomorphic to $G$. For larger groups, Magma attempts to recognize direct products, wreath products, and split extensions, and uses chief series if that fails. With `TeX:=true`, the returned string is in LaTeX format. Note that for such larger groups the name returned is not canonical: isomorphic groups may be given different names.

Here is a list of notation used by `GroupName`. See also example below.

```
        Basic groups

Cn      Cyclic group of order n
Dn      Dihedral group of order 2n
Sn      Symmetric group on n letters
An      Alternating group on n letters

        Operators, high to low precedence

^       power, e.g C2^2 is the non-cyclic group of order 4
wr      wreath product, e.g. C2wrC2=C2^2:C2=D4
:       semidirect product, i.e. a split extension
.       (generally) non-split extension
*       direct product

        Other standard groups

Fq      Frobenius group of order q(q-1)
Hep     Heisenberg group of order p^3
Qn      Generalized quaternion group, n=2^k
SDn     Semi-dihedral group C2^(k-1):C2 (n=2^k) with C2
        acting as 2^(k-2)-1
ODn     Other-dihedral group C2^(k-1):C2 (n=2^k) with C2
        acting as 2^(k-2)+1

        Simple, almost-simple, and linear groups

Mn      Matthieu group (n in {11,12,21,22,23,24})
GL(n,q) General linear group; also SL,AGL,ASL,AGammaL,ASigmaL,PGL,
        PSL (=L),PGammaL,PSigmaL,SU,PSU,PGammaU,PSigmaU,O (=GO),SO,
        PSO,PGO,PGO+,PGO-,POmega,POmega+,POmega-,Sp,PSp,PSigmaSp
B(n,q)  Simple group of Lie type, also C,D,E,F,G,2A,2B,2D,2E,2F,2G,3D
J1      Sporadic simple group; also Mn (see above),J2,J3,J4,HS,McL,Suz,
        Co1,Co2,Co3,HE,Fi22,Fi23,Fi24,Ly,Ru,ON,TH,HN,BM,M
```

<a id="function-group-monstgelt"></a>
##### `Group(s): MonStgElt -> Grp`

A finite group from its name. See `GroupName` and the example below.

<a id="example-ex-06353f"></a>
##### `Example: Groups from Names (ex-06353f)`

```magma
> G0:=Group("C10^2*C3");    // cyclic and abelian
> G1:=Group("D5");          // dihedral Dn of order 2n
> G2:=Group("A5");          // alternating
> G3:=Group("S5");          // symmetric
>
> G4:=Group("SL(2,3)");     // linear: GL, SL, AGL, ASL, AGammaL, ASigmaL, PGL,
> G5:=Group("SL(2,F3)");    //   PSL (=L), PGammaL, PSigmaL, SU, PSU, PGammaU,
> G6:=Group("SL_2(3)");     //   PSigmaU, O (=GO), SO, PSO, PGO, PGO+, PGO-,
> G7:=Group("SL2(3)");      //   POmega, POmega+, POmega-, Sp, PSp, PSigmaSp
>
> G8:=Group("S3*GL(4,2)");  // Products
> G9:=Group("C41:C40");     // Split extensions that are not direct products,
>                           // [usually with largest action of the quotient group]
> G10:=Group("A5wrC2");     // Wreath products
>
> G11:=Group("C2^3.C4");             // unique names returned by GroupName
>                                    // when |G|<512, not multiple of 128
> G12:=Group("A5*A_5*A_{5}*Alt(5)"); // name variations
> G13:=Group("D10:C8.C2*C3");        // operator order ^ > wr > : > . > *
>                                    // (so read left to right in this example)
>
> G14:=Group("<12,1>");        // Small group database (C3:C4)
> G14:=Group("g12n1");         //   same group
> G15:=Group("T<12,48>");      // Transitive group database (C2^2*S4)
> G15:=Group("t12n48");        //   same group
>                              // Simple groups: Lie Type A,B,C,D,E,F,G, returned
> G16:=Group("C(4,2)");        //   as matrix groups via standard representation
Warning: Projective representation
> G17:=Group("Sz(32)");        // Simple groups: Suzuki
> G18:=Group("J1*Co3*M11");    // Simple groups: sporadic
> G19:=Group("PGL(4,3)`2");    // Names from the almost simple group database
>
> G20:=Group("He11");          // Heisenberg
> G21:=Group("F13");           // Frobenius group Fn of order n(n-1)
> G22:=Group("Q8");            // Quasi-cyclic groups of normal 2-rank one:
> G23:=Group("SD16");          //   Dihedral, (generalized) quaternion,
> G24:=Group("OD16");          //   semi-dihedral, the `other-dihedral' one.
>
> [GroupName(eval "G"*Sprint(n)): n in [1..24]];     // back to names
[ D5, A5, S5, SL(2,3), SL(2,3), SL(2,3), SL(2,3), S3*A8, F41, A5wrC2, C2^3.C4,
   A5^4, C3*D10:C8.C2, C3:C4, C2^2*S4, C(4,2), 2B(2,32), J1*Co3*M11,
   PSL(4,3).C2^2, He11, F13, Q8, SD16, OD16 ]
```

### Operations on the Set of Elements

#### Order and Index Functions

<a id="function-order-grpfin"></a>
##### `Order(G): GrpFin -> RngIntElt`

<a id="operation-operation-grpfin-rngintelt"></a>
##### `# G: GrpFin -> RngIntElt`

The order of the group $G$ as an integer. If the order is not currently known, it will be computed. Computing the order may fail for groups in the category [`GrpFP`](https://docs.magma-maths.org/FinitelyPresentedGroups/FPGroups/index-fpgroups.md#chapgrpfp); cf. Chapter [Introduction to Fp-Groups](https://docs.magma-maths.org/FinitelyPresentedGroups/IntroductionToFPGroups/index-introduction-to-fpgroups.md#chapgrpfpint).

<a id="function-factoredorder-grpfin"></a>
##### `FactoredOrder(G): GrpFin -> [ <RngIntElt, RngIntElt> ]`

The order of the finite group $G$ returned as a factored integer. The factorization is returned in the form of a sequence $Q$ which is defined as follows: If $\#G = p_1^{e_1}\ldots p_n^{e_n}, \quad e_i>0$, then $Q$ will be the integer sequence $[ \langle p_1, e_1\rangle, \ldots, \langle p_n, e_n\rangle ]$. If the orders of $G$ is not known, it will be computed. Computing the order may fail for groups in the category [`GrpFP`](https://docs.magma-maths.org/FinitelyPresentedGroups/FPGroups/index-fpgroups.md#chapgrpfp); cf. Chapter [Introduction to Fp-Groups](https://docs.magma-maths.org/FinitelyPresentedGroups/IntroductionToFPGroups/index-introduction-to-fpgroups.md#chapgrpfpint).

<a id="function-index-grpfin-grpfin"></a>
##### `Index(G, H): GrpFin, GrpFin -> RngIntElt`

The index of the subgroup $H$ in the group $G$. The index is returned as an integer. Computing the index may fail for groups in the category [`GrpFP`](https://docs.magma-maths.org/FinitelyPresentedGroups/FPGroups/index-fpgroups.md#chapgrpfp); cf. Chapter [Introduction to Fp-Groups](https://docs.magma-maths.org/FinitelyPresentedGroups/IntroductionToFPGroups/index-introduction-to-fpgroups.md#chapgrpfpint).

<a id="function-factoredindex-grpfin-grpfin"></a>
##### `FactoredIndex(G, H): GrpFin, GrpFin -> [ <RngIntElt, RngIntElt> ]`

The index of the subgroup $H$ in the group $G$. The subgroup $H$ must have finite index in $G$. The index is returned as a factored integer. The format is the same as for `FactoredOrder`. Computing the index may fail for groups in the category [`GrpFP`](https://docs.magma-maths.org/FinitelyPresentedGroups/FPGroups/index-fpgroups.md#chapgrpfp); cf. Chapter [Introduction to Fp-Groups](https://docs.magma-maths.org/FinitelyPresentedGroups/IntroductionToFPGroups/index-introduction-to-fpgroups.md#chapgrpfpint).

<a id="example-ex-fd70fc"></a>
##### `Example: Order and Index in an FP Group (ex-fd70fc)`

Exploration of the order and index functions for a finitely presented group and its subgroup:

```magma
> Q<s,t,u>, h := Group< s, t, u |
>     t^2, u^17, s^2 = t^s = t, u^s = u^16, u^t = u >;
> Order(Q);
68
> FactoredOrder(Q);
[ <2, 2>, <17, 1> ]
> S := sub< Q | t*s^2, u^4 >;
> Index(Q, S);
4
> #S;
17
```

#### Membership and Equality

<a id="operation-op-in-grpfinelt-grpfin"></a>
##### `g in G: GrpFinElt, GrpFin -> BoolElt`

Given a group element $g$ and a group $G$, return `true` if $g$ is an element of $G$, `false` otherwise.

<a id="operation-op-notin-grpfinelt-grpfin"></a>
##### `g notin G: GrpFinElt, GrpFin -> BoolElt`

Given a group element $g$ and a group $G$, return `true` if $g$ is not an element of $G$, `false` otherwise.

<a id="operation-op-subset-grpfinelt-grpfin"></a>
##### `S subset G: { GrpFinElt }, GrpFin -> BoolElt`

Given a group $G$ and a set $S$ of group elements belonging to a group $H$, where $G$ and $H$ belong the same generic group, return `true` if $S$ is a subset of $G$, `false` otherwise.

<a id="operation-operation-notsubset-grpfinelt-grpfin-boolelt"></a>
##### `S notsubset G: { GrpFinElt }, GrpFin -> BoolElt`

Given a group $G$ and a set $S$ of group elements belonging to a group $H$, where $G$ and $H$ belong the same generic group, return `true` if $S$ is not a subset of $G$, `false` otherwise.

<a id="operation-op-subset-grpfin-grpfin"></a>
##### `H subset G: GrpFin, GrpFin -> BoolElt`

<a id="function-issubgroup-grpfin-grpfin"></a>
##### `IsSubgroup(H, G): GrpFin, GrpFin -> BoolElt`

Given groups $G$ and $H$ belonging to the same generic group, return `true` if $H$ is a subgroup of $G$, `false` otherwise.

<a id="operation-operation-notsubset-grpfin-grpfin-boolelt"></a>
##### `H notsubset G: GrpFin, GrpFin -> BoolElt`

Given groups $G$ and $H$ belonging to the same generic group, return `true` if $H$ is not a subgroup of $G$, `false` otherwise.

<a id="operation-op-eq-grpfin-grpfin"></a>
##### `H eq G: GrpFin, GrpFin -> BoolElt`

Given groups $G$ and $H$ belonging to the same generic group, return `true` if $G$ and $H$ are the same group, `false` otherwise.

<a id="operation-op-ne-grpfin-grpfin"></a>
##### `H ne G: GrpFin, GrpFin -> BoolElt`

Given groups $G$ and $H$ belonging to the same generic group, return `true` if $G$ and $H$ are distinct groups, `false` otherwise.

#### Set Operations

<a id="function-numberingmap-grpfin"></a>
##### `NumberingMap(G): GrpFin -> Map`

Given a finite group $G$ in the category [`GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/index-permutation-groups.md#chapgrpperm), [`GrpMat`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/index-matrix-groups-over-general-rings.md#chapgrpmat), [`GrpPC`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/index-finite-soluble-groups.md#chapgrppc) or [`GrpAb`](https://docs.magma-maths.org/FinitelyPresentedGroups/AbelianGroups/index-abelian-groups.md#chapgrpab), return a bijective mapping from the group $G$ onto the set of integers $\{ 1 \ldots |G| \rbrace$. The actual mapping depends upon the particular representation of $G$.

<a id="function-representative-grpfin"></a>
##### `Representative(G): GrpFin -> GrpFinElt`

<a id="function-rep-grpfin"></a>
##### `Rep(G): GrpFin -> GrpFinElt`

An element chosen from the group $G$.

<a id="example-ex-f73fa4"></a>
##### `Example: Multiplication Table via NumberingMap (ex-f73fa4)`

We use the function `NumberingMap` to construct the multiplication table for the dihedral group of order $12$.

```magma
> G := DihedralGroup(6);
> f := NumberingMap(G);
> [ [ f(x*y) : y in G ] : x in G ];
[
    [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 ],
    [ 2, 3, 4, 5, 6, 1, 12, 7, 8, 9, 10, 11 ],
    [ 3, 4, 5, 6, 1, 2, 11, 12, 7, 8, 9, 10 ],
    [ 4, 5, 6, 1, 2, 3, 10, 11, 12, 7, 8, 9 ],
    [ 5, 6, 1, 2, 3, 4, 9, 10, 11, 12, 7, 8 ],
    [ 6, 1, 2, 3, 4, 5, 8, 9, 10, 11, 12, 7 ],
    [ 7, 8, 9, 10, 11, 12, 1, 2, 3, 4, 5, 6 ],
    [ 8, 9, 10, 11, 12, 7, 6, 1, 2, 3, 4, 5 ],
    [ 9, 10, 11, 12, 7, 8, 5, 6, 1, 2, 3, 4 ],
    [ 10, 11, 12, 7, 8, 9, 4, 5, 6, 1, 2, 3 ],
    [ 11, 12, 7, 8, 9, 10, 3, 4, 5, 6, 1, 2 ],
    [ 12, 7, 8, 9, 10, 11, 2, 3, 4, 5, 6, 1 ]
]
```

#### Random Elements

<a id="function-random-grpfin"></a>
##### `Random(G: parameters): GrpFin -> GrpFinElt`

```magma
Short: BoolElt                    Default: false
```

A randomly chosen element for the group $G$. If a representation of the carrier set of $G$ has already been created, then the element chosen will be genuinely random. If such a representation has not yet been created, then the *random* element is chosen by multiplying out a *random* word in the generators. Since it is not usually practical to choose words long enough to properly sample the elements of $G$, the element returned will usually be biased. The boolean-valued parameter `Short` is used in this situation to indicate that a short word will suffice. Thus, if `Random` is invoked with `Short` assigned the value `true` then the element is constructed using a short word.

<a id="example-ex-79c950"></a>
##### `Example: Random Elements of a Wreath Product (ex-79c950)`

We illustrate the use of the function `Random` using the wreath product of the symmetric group of degree $4$ and the cyclic group of order $6$.

```magma
> G := WreathProduct(Sym(4), CyclicGroup(6));
> G;
Permutation group G acting on a set of cardinality 24
    (1, 5, 9, 13, 17, 21)(2, 6, 10, 14, 18, 22) (3, 7, 11, 15, 19, 23)
        (4, 8, 12, 16, 20, 24)
    (1, 2, 3, 4)
    (1, 2)
> Order(G);
1146617856
> Random(G);
(1, 17, 12, 4, 18, 10, 3, 20, 9, 2, 19, 11)(5, 22, 13, 6, 21, 15)
    (7, 24, 16)(8, 23, 14)
// We display the cycle structures of 10 random elements of G
> R := [ CycleStructure(Random(G)) : i in [1..10] ];
> R;
[
    [ <6, 1>, <3, 6> ],
    [ <9, 1>, <6, 2>, <3, 1> ],
    [ <9, 2>, <3, 2> ],
    [ <12, 1>, <9, 1>, <3, 1> ],
    [ <18, 1>, <6, 1> ],
    [ <18, 1>, <6, 1> ],
    [ <12, 1>, <6, 2> ],
    [ <6, 3>, <2, 3> ],
    [ <6, 1>, <4, 3>, <2, 3> ],
    [ <6, 3>, <3, 2> ]
]
```

<a id="function-randomprocess-grpfin"></a>
##### `RandomProcess(G): GrpFin -> Process`

<a id="function-randomprocesswithwords-grpfin"></a>
##### `RandomProcessWithWords(G): GrpFin -> Process`

<a id="function-randomprocesswithvalues-grpfin-seqenum"></a>
##### `RandomProcessWithValues(G, Q): GrpFin, SeqEnum -> Process`

<a id="function-randomprocesswithwordsandvalues-grpfin-seqenum"></a>
##### `RandomProcessWithWordsAndValues(G, Q): GrpFin, SeqEnum -> Process`

```magma
Slots    : RngIntElt                    Default: 10
Scramble : RngIntElt                    Default: 50
WordGroup: GrpSLP                       Default: 
```

Create a process to generate randomly chosen elements from the group $G$. The process uses a variant of the product-replacement method similar to the *Rattle* method of [[LGM02b](https://docs.magma-maths.org/references.md#cite-randomelementsvariants)]. The generating set stored in the process has $N$ elements, where $N$ is the maximum of the specified value for `Slots` and `Ngens`$(G) + 1$. Initially they are the generators of $G$ repeated as necessary and the accumulator is the identity. Random elements are now produced by successive calls to `Random(P)`, where $P$ is the process created by this function. Each such call returns the current value of the accumulator, modifying the generating set as for product-replacement, and modifying the accumulator by multiplying by the new member of the generating set. Setting `Scramble := m` causes $m$ such operations to be performed before the process is returned. The functions with words and values create a process that returns extra group elements for each call. A process created with words returns, as second return value for each call to `Random(P)`, the `GrpSLPElt` describing the random element returned as a straight-line program in the group generators. The parameter `WordGroup` may be used to specify a particular group for the words to be elements of. A process created with values takes as input a sequence of group elements $Q$ giving the values assigned to each generator of $G$. The second value returned is the result of computing in parallel with these values as with the generators of $G$. In particular, if the elements of $Q$ are homomorphic images of the generators of $G$, then the second return value from `Random(P)` will be the image of the first under this homomorphism. A process created with words and values does all of the above, with the three return values of `Random(P)` being a random element of $G$, the straight-line program, and the value. The use of this function on a finitely-presented group $G$ is not recommended. Since there is no reduction of words, the random elements generated may be extremely long.

<a id="function-random-process"></a>
##### `Random(P): Process -> GrpFinElt`

Given a random element process $P$ created by the function `RandomProcess(G)` for the finite group $G$, construct a random element of $G$ by forming a random product over the expanded generating set constructed when the process was created. For large permutation or matrix groups for which a BSGS is not known, this function should be used in preference to `Random(G)`. If the process was created with words or values then there will be second and third return values as described under `RandomProcess` above.

<a id="function-random-process-2"></a>
##### `Random(P): Process -> GrpFinElt`

Given a random element process $P$ created by the function `RandomProcess(G)` for the finite group $G$, return $G$.

<a id="procedure-initialiseprospector-grpmat"></a>
##### `InitialiseProspector(G:parameters): GrpMat`

<a id="procedure-initialiseprospector-grpperm"></a>
##### `InitialiseProspector(G:parameters): GrpPerm`

Initialise a product-replacement prospector for the given group. This is an extension of the product-replacement algorithm that searches for an element $x\in G$ such that some predicate is true for this element. The prospector aims to find elements $x$ so that the corresponding straight-line program for $x$ is short. Statistical tests and various heuristics are used to achieve this.

Generally, output from product-replacement with short straight-line programs is not very random. Prospector aims to run product-replacement until the output looks random, then start a search for the element wanted. At all times, if the output starts to look non-random, or word lengths grow too far without finding an element, the prospector may return to a previous state of product replacement and try again, searching in a different direction. The statistical tests are used to make concrete the notion of “looks random”. For permutation groups the test used is based on number of cycles of the element. For matrix groups the test statistic is the number of factors of the characteristic polynomial.

<a id="function-prospector-grp-userprogram"></a>
##### `Prospector(G, f:parameters): Grp, UserProgram -> BoolElt, GrpElt, GrpSLPElt`

Run an initialised prospector for group $G$ to find $x\in G$ such that $f(x)$ is true. The first return value gives the success or failure of the search. If this value is true, then the second and third return values are $x$ and a straight-line program giving $x$ in terms of the group generators. The parameter `MaxTries` may be set to limit the number of random selections made by the prospector when attempting to find $x$.

<a id="example-ex-f1996a"></a>
##### `Example: Finding a 300-Cycle at Random (ex-f1996a)`

We find a random pair of generators for the symmetric group of degree 300 and use a random process to find an element which is a 300-cycle as a straight-line program in the generators. The proportion of such elements is 1 in 300, so we expect the program to have length 600.

```magma
> SetSeed(1);
> S := Sym(300);
> repeat G := sub<S|Random(S),Random(S)>;
> until IsSymmetric(G);
> P := RandomProcessWithWords(G);
> repeat x,w := Random(P);
> until CycleStructure(x) eq [<300,1>];
> #w;
936
```

Note that the group $S$, known to be a symmetric group, has an efficient uniform random element generator available as above. The word length was somewhat longer than the expected value. Now we set up a prospector and use it to search for an element of the same cycle structure. The defining word for the new element should be shorter than the expected 600.

```magma
> InitialiseProspector(G);
true
> test := func<x|CycleStructure(x) eq [<300,1>]>;
> repeat a,x,w := Prospector(G, test); until a;
> #w;
206
> Evaluate(w, [G.1,G.2]) eq x;
true
```

#### Action on a Coset Space

<a id="function-cosettable-grpfin-grpfin"></a>
##### `CosetTable(G, H): GrpFin, GrpFin -> Map`

The (right) coset table for $G$ over subgroup $H$ relative to its defining generators.

<a id="function-cosettable-grpfin-hom-grpfin"></a>
##### `CosetTable(G, f): GrpFin, Hom(GrpFin) -> Hom(GrpFin)`

The coset table for $G$ corresponding to the permutation representation $f$ of $G$, where $f$ is a homomorphism of $G$ onto a transitive permutation group.

<a id="function-transversal-grp-grp"></a>
##### `Transversal(G, H): Grp, Grp -> {@ GrpElt @}, Map`

<a id="function-righttransversal-grp-grp"></a>
##### `RightTransversal(G, H): Grp, Grp -> {@ GrpElt @}, Map`

Given a group $G$ and a subgroup $H$ of $G$, this function returns

**(a)**
An indexed set of elements $T$ of $G$ forming a right transversal for $G$ over $H$;

**(b)**
The corresponding transversal mapping $\phi: G \rightarrow T$. If $T = [t_1, \ldots, t_r]$ and $g \in G$, $\phi$ is defined by $\phi(g) = t_i$, where $g\in Ht_i$.

<a id="function-cosetaction-grp-grp-2"></a>
##### `CosetAction(G, H): Grp, Grp -> Hom(Grp), GrpPerm, Grp`

Given a subgroup $H$ of the group $G$, construct the permutation representation of $G$ given by the action of $G$ on the set of (right) cosets of $H$ in $G$. The function returns:

**(a)**
The natural homomorphism $f: G \rightarrow  L$;

**(b)**
The induced group $L$;

**(c)**
The kernel $K$ of the action (a subgroup of $G$).

Note that $G$ may be any type of group. If $G$ is a finitely presented group, then $K$ may be returned undefined.

<a id="function-cosetimage-grp-grp-2"></a>
##### `CosetImage(G, H): Grp, Grp -> GrpPerm`

Given a subgroup $H$ of the group $G$, construct the image $L$ of $G$ given by the action of $G$ on the set of (right) cosets of $H$ in $G$.

<a id="function-cosetkernel-grp-grp-2"></a>
##### `CosetKernel(G, H): Grp, Grp -> Grp`

Given a subgroup $H$ of the group $G$, construct the kernel of the action of $G$ on the set of (right) cosets of $H$ in $G$.

### Standard Subgroup Constructions

Some functions described in this section may not exist or may have restrictions for some categories of groups. Details can be found in the chapters on the individual categories.

<a id="operation-op-pow-grpfin-grpfinelt"></a>
#### `H ^ g: GrpFin, GrpFinElt -> GrpFin`

<a id="function-conjugate-grpfin-grpfinelt"></a>
#### `Conjugate(H, g): GrpFin, GrpFinElt -> GrpFin`

Construct the conjugate $g^{-1}Hg$ of the group $H$ by the element $g$. The group $H$ and the element $g$ must belong to the same generic group.

<a id="operation-op-meet-grpfin-grpfin"></a>
#### `H meet K: GrpFin, GrpFin -> GrpFin`

Given groups $H$ and $K$ which belong to the same symmetric group, construct the intersection of $H$ and $K$.

<a id="function-commutatorsubgroup-grpfin-grpfin-grpfin"></a>
#### `CommutatorSubgroup(G, H, K): GrpFin, GrpFin, GrpFin -> GrpFin`

<a id="function-commutatorsubgroup-grpfin-grpfin"></a>
#### `CommutatorSubgroup(H, K): GrpFin, GrpFin -> GrpFin`

Given groups $H$ and $K$, both subgroups of the group $G$, construct the commutator subgroup of $H$ and $K$ in the group $G$. If $K$ is a subgroup of $H$, then the group $G$ may be omitted.

<a id="function-centralizer-grpfin-grpfinelt"></a>
#### `Centralizer(G, g): GrpFin, GrpFinElt -> GrpFin`

<a id="function-centraliser-grpfin-grpfinelt"></a>
#### `Centraliser(G, g): GrpFin, GrpFinElt -> GrpFin`

Construct the centralizer of the element $g$ in the group $G$.

<a id="function-centralizer-grpfin-grpfin"></a>
#### `Centralizer(G, H): GrpFin, GrpFin -> GrpFin`

<a id="function-centraliser-grpfin-grpfin"></a>
#### `Centraliser(G, H): GrpFin, GrpFin -> GrpFin`

Construct the centralizer of the group $H$ in the group $G$.

<a id="function-core-grpfin-grpfin"></a>
#### `Core(G, H): GrpFin, GrpFin -> GrpFin`

Given a subgroup $H$ of the group $G$, construct the maximal normal subgroup of $G$ that is contained in the subgroup $H$.

<a id="operation-op-pow-grpfin-grpfin"></a>
#### `H ^ G: GrpFin, GrpFin -> GrpFin`

<a id="function-normalclosure-grpfin-grpfin"></a>
#### `NormalClosure(G, H): GrpFin, GrpFin -> GrpFin`

Given a subgroup $H$ of the group $G$, construct the normal closure of $H$ in $G$.

<a id="function-normalizer-grpfin-grpfin"></a>
#### `Normalizer(G, H): GrpFin, GrpFin -> GrpFin`

<a id="function-normaliser-grpfin-grpfin"></a>
#### `Normaliser(G, H): GrpFin, GrpFin -> GrpFin`

Given a subgroup $H$ of the group $G$, construct the normalizer of $H$ in $G$.

<a id="function-pcore-grpfin-rngintelt"></a>
#### `pCore(G, p): GrpFin, RngIntElt -> GrpFin`

Given a group $G$ and a prime $p$ dividing the order of $G$, construct the maximal normal $p$-subgroup of $G$.

<a id="function-sylowsubgroup-grpfin-rngintelt"></a>
#### `SylowSubgroup(G, p): GrpFin, RngIntElt -> GrpFin`

<a id="function-sylow-grpfin-rngintelt"></a>
#### `Sylow(G, p): GrpFin, RngIntElt -> GrpFin`

Given a group $G$ and a prime $p$, construct a Sylow $p$-subgroup of $G$.

#### Abstract Group Predicates

Some functions described in this section may not exist or may have restrictions for some categories of groups. Details can be found in the chapters on the individual categories.

<a id="function-isabelian-grpfin"></a>
##### `IsAbelian(G): GrpFin -> BoolElt`

Returns `true` if the group $G$ is abelian, `false` otherwise.

<a id="function-iscyclic-grpfin"></a>
##### `IsCyclic(G): GrpFin -> BoolElt`

Returns `true` if the group $G$ is cyclic, `false` otherwise.

<a id="function-iselementaryabelian-grpfin"></a>
##### `IsElementaryAbelian(G): GrpFin -> BoolElt`

Returns `true` if the group $G$ is elementary abelian, `false` otherwise.

<a id="function-iscentral-grpfin-grpfin"></a>
##### `IsCentral(G, H): GrpFin, GrpFin -> BoolElt`

Return `true` if the subgroup $H$ of the group $G$ lies in the centre of $G$, `false` otherwise.

<a id="function-isconjugate-grpfin-grpfinelt-grpfinelt"></a>
##### `IsConjugate(G, g, h): GrpFin, GrpFinElt, GrpFinElt -> BoolElt, GrpFinElt`

Given a group $G$ and elements $g$ and $h$ belonging to $G$, return the value `true` if $g$ and $h$ are conjugate in $G$. The function returns a second value if the elements are conjugate: an element $k$ which conjugates $g$ into $h$. For permutation groups it is sufficient that $G$, $g$, and $h$ have a common covering group.

<a id="function-isconjugate-grpfin-grpfin-grpfin"></a>
##### `IsConjugate(G, H, K): GrpFin, GrpFin, GrpFin -> BoolElt, GrpFinElt`

Given a group $G$ and subgroups $H$ and $K$ belonging to $G$, return the value `true` if $H$ and $K$ are conjugate in $G$. The function returns a second value if the subgroups are conjugate: an element $z$ which conjugates $H$ into $K$. For permutation groups it is sufficient that $G$, $H$, and $K$ have a common covering group.

<a id="function-isextraspecial-grpfin"></a>
##### `IsExtraSpecial(G): GrpFin -> BoolElt`

Given a group $G$ is a $p$-group $G$, return `true` if $G$ is extra-special, `false` otherwise.

<a id="function-ishyperelementary-grp"></a>
##### `IsHyperelementary(G): Grp -> BoolElt, Grp, Grp`

```magma
p: RngIntElt                    Default: 0
```

Test if $G$ is a finite hyperelementary (=quasi-elementary) group, that is a semi-direct product $G=C:P$ with $C$ cyclic and $P$ a $p$-group of order coprime to $C$. If yes, returns `true`, $C$, $P$. Otherwise returns `false`. The prime number $p$ can be forced with an optional parameter $p$ ($0$ by default).

<a id="example-ex-d7354f"></a>
##### `Example: Hyperelementary Groups (ex-d7354f)`

```magma
> ok,C,P:=IsHyperelementary(Sym(3));   // S3=C3:C2 is hyperelementary
> ok,GroupName(C),GroupName(P);
true C3 C2
> ok,C,P:=IsHyperelementary(Sylow(Sym(6),2));    // So is any p-group
> ok,GroupName(C),GroupName(P);
true C1 C2*D4
> IsHyperelementary(Sym(4));             // S4 is not hyperelementary
false
```

<a id="function-ismaximal-grpfin-grpfin"></a>
##### `IsMaximal(G, H): GrpFin, GrpFin -> BoolElt`

Returns `true` if the subgroup $H$ of the group $G$ is a maximal subgroup of $G$. This function is evaluated by constructing the permutation representation of $G$ on the cosets of $H$ and testing this representation for primitivity. For this reason, the use of `IsMaximal` should be avoided if the index of $H$ in $G$ exceeds a one hundred thousand.

<a id="function-isnilpotent-grpfin"></a>
##### `IsNilpotent(G): GrpFin -> BoolElt`

Return `true` if the group $G$ is nilpotent, `false` otherwise.

<a id="function-isnormal-grpfin-grpfin"></a>
##### `IsNormal(G, H): GrpFin, GrpFin -> BoolElt`

Return `true` if the subgroup $H$ of the group $G$ is a normal subgroup of $G$, `false` otherwise.

<a id="function-isperfect-grpfin"></a>
##### `IsPerfect(G): GrpFin -> BoolElt`

Return `true` if the group $G$ is perfect, `false` otherwise.

<a id="function-isqgroup-grp"></a>
##### `IsQGroup(G): Grp -> BoolElt`

Returns `true` if the group $G$ is a ${\mathbb{Q}}$-group (all characters are rational-valued).

<a id="example-ex-694ffe"></a>
##### `Example: Testing for Q-Groups (ex-694ffe)`

```magma
> IsQGroup(Sym(4));         // Symmetric groups S_n are Q-groups
true
> IsQGroup(Alt(4));         // and alternating groups A_n are not (for n>2)
false
```

<a id="function-isselfnormalizing-grpfin-grpfin"></a>
##### `IsSelfNormalizing(G, H): GrpFin, GrpFin -> BoolElt`

<a id="function-isselfnormalising-grpfin-grpfin"></a>
##### `IsSelfNormalising(G, H): GrpFin, GrpFin -> BoolElt`

Return `true` if the subgroup $H$ of the group $G$ is self-normalizing in $G$, `false` otherwise.

<a id="function-issimple-grpfin"></a>
##### `IsSimple(G): GrpFin -> BoolElt`

Return `true` if the group $G$ is simple, `false` otherwise.

<a id="function-issoluble-grpfin"></a>
##### `IsSoluble(G): GrpFin -> BoolElt`

<a id="function-issolvable-grpfin"></a>
##### `IsSolvable(G): GrpFin -> BoolElt`

Return `true` if the group $G$ is soluble, `false` otherwise.

<a id="function-isspecial-grpfin"></a>
##### `IsSpecial(G): GrpFin -> BoolElt`

Given a $p$-group $G$, return `true` if $G$ is special, `false` otherwise.

<a id="function-isabstractfrobeniusgroup-grpfin"></a>
##### `IsAbstractFrobeniusGroup(G): GrpFin -> BoolElt, Grp, Grp`

Is the finite group $G$ a Frobenius group as an abstract group? Equivalently, does there exist a faithful permutation representation of $G$ for which the image is a Frobenius group as a permutation group? If so, then return `true`, a Frobenius kernel, and a corresponding Frobenius complement; otherwise return `false`.

<a id="function-issubnormal-grpfin-grpfin"></a>
##### `IsSubnormal(G, H): GrpFin, GrpFin -> BoolElt`

Return `true` if the subgroup $H$ of the group $G$ is subnormal in $G$, `false` otherwise.

<a id="function-istrivial-grp"></a>
##### `IsTrivial(G): Grp -> BoolElt`

Return `true` if $G$ is trivial, `false` otherwise.

### Characteristic Subgroups and Normal Structure

#### Characteristic Subgroups and Subgroup Series

Some functions described in this section may not exist or may have restrictions for some categories of groups. Details can be found in the chapters on the individual categories.

<a id="function-centre-grpfin"></a>
##### `Centre(G): GrpFin -> GrpFin`

<a id="function-center-grpfin"></a>
##### `Center(G): GrpFin -> GrpFin`

Construct the centre of the group $G$.

<a id="function-hypercentre-grpfin"></a>
##### `Hypercentre(G): GrpFin -> GrpFin`

<a id="function-hypercenter-grpfin"></a>
##### `Hypercenter(G): GrpFin -> GrpFin`

Construct the hypercentre of the group $G$ (the stationary term of the upper central series).

<a id="function-derivedlength-grpfin"></a>
##### `DerivedLength(G): GrpFin -> RngIntElt`

The derived length of $G$. If $G$ is non-soluble, the function returns the number of terms in the series terminating with the soluble residual.

<a id="function-derivedseries-grpfin"></a>
##### `DerivedSeries(G): GrpFin -> [ GrpFin ]`

The derived series of the group $G$. The series is returned as a sequence of subgroups.

<a id="function-derivedsubgroup-grpfin"></a>
##### `DerivedSubgroup(G): GrpFin -> GrpFin`

<a id="function-derivedgroup-grpfin"></a>
##### `DerivedGroup(G): GrpFin -> GrpFin`

The derived subgroup of the group $G$.

<a id="function-fittingsubgroup-grpfin"></a>
##### `FittingSubgroup(G): GrpFin -> GrpFin`

The Fitting subgroup of the group $G$.

<a id="function-frattinisubgroup-grpfin"></a>
##### `FrattiniSubgroup(G): GrpFin -> GrpFin`

Given a group $G$ that is a $p$-group, return the Frattini subgroup.

<a id="function-jenningsseries-grpfin"></a>
##### `JenningsSeries(G): GrpFin -> [ GrpFin ]`

Given a $p$-group $G$, return the Jennings series for $G$. The series is returned as a sequence of subgroups.

<a id="function-lowercentralseries-grpfin"></a>
##### `LowerCentralSeries(G): GrpFin -> [ GrpFin ]`

The lower central series of $G$. The series is returned as a sequence of subgroups.

<a id="function-nilpotencyclass-grpfin"></a>
##### `NilpotencyClass(G): GrpFin -> RngIntElt`

The nilpotency class of the group $G$. If the group is not nilpotent, the value $-1$ is returned.

<a id="operation-op-pow-grpfin"></a>
##### `H ^ G: GrpFin -> GrpFin`

<a id="function-normalclosure-grpfin-grpfin-2"></a>
##### `NormalClosure(G, H): GrpFin, GrpFin -> GrpFin`

The normal closure of the subgroup $H$ of group $G$.

<a id="function-normallattice-grpfin"></a>
##### `NormalLattice(G): GrpFin -> NormalLattice`

The normal subgroups of $G$ arranged as a lattice.

<a id="function-normalsubgroups-grpfin"></a>
##### `NormalSubgroups(G): GrpFin -> [ Rec ]`

The normal subgroups of $G$.

<a id="function-pcentralseries-grpfin-rngintelt"></a>
##### `pCentralSeries(G, p): GrpFin, RngIntElt -> [ GrpFin ]`

Given a soluble group $G$, and a prime $p$ dividing $|G|$, return the lower $p$-central series for $G$. The series is returned as a sequence of subgroups.

<a id="function-radical-grpfin"></a>
##### `Radical(G): GrpFin -> GrpFin`

The maximal normal solvable subgroup of the group $G$.

<a id="function-solubleresidual-grpfin"></a>
##### `SolubleResidual(G): GrpFin -> GrpFin`

<a id="function-solvableresidual-grpfin"></a>
##### `SolvableResidual(G): GrpFin -> GrpFin`

The solvable residual of the group $G$.

<a id="function-subnormalseries-grpfin-grpfin"></a>
##### `SubnormalSeries(G, H): GrpFin, GrpFin -> [ GrpFin ]`

Given a group $G$ and a subnormal subgroup $H$ of $G$, return a sequence of subgroups commencing with $G$ and terminating with $H$, such that each subgroup is normal in the previous one. If $H$ is not subnormal in $G$, the empty sequence is returned.

<a id="function-uppercentralseries-grpfin"></a>
##### `UpperCentralSeries(G): GrpFin -> [ GrpFin ]`

The upper central series of $G$. The series is returned as a sequence of subgroups commencing with the trivial subgroup. Since the algorithm used requires the conjugacy classes of $G$, this function is much more restricted in its range of application than `DerivedSeries` and `LowerCentralSeries`.

#### The Abstract Structure of a Group

*Table 1: Family numbers and names Table 2: Sporadic groups*

<a id="function-compositionfactors-grpfin"></a>
##### `CompositionFactors(G): GrpFin -> [ <RngIntElt, RngIntElt, RngIntElt> ]`

Given a finite group $G$ in the category [`GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/index-permutation-groups.md#chapgrpperm), [`GrpMat`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/index-matrix-groups-over-general-rings.md#chapgrpmat), [`GrpPC`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/index-finite-soluble-groups.md#chapgrppc) of [`GrpAb`](https://docs.magma-maths.org/FinitelyPresentedGroups/AbelianGroups/index-abelian-groups.md#chapgrpab), return a sequence $S$ of tuples that represent the composition factors of $G$, ordered according to some composition series of $G$. Each tuple is a triple of integers $f$, $d$, $q$ that defines the isomorphism type of the corresponding composition factor. A triple $< f,d,q >$ describes a simple group as follows. The integer $f$ defines the family to which the group belongs, and $d$ and $q$ are the parameters of the family. The length of the sequence $S$ is the number of composition factors of $G$.

```
   The families are:
       f      family name
   -------------------------
       1       A(d, q)
       2       B(d, q)
       3       C(d, q)
       4       D(d, q)
       5       G(2, q)
       6       F(4, q)
       7       E(6, q)
       8       E(7, q)
       9       E(8, q)
      10       2A(d, q)
      11       2B(2, q)
      12       2D(d, q)
      13       3D(4, q)
      14       2G(2, q)
      15       2F(4, q)
      16       2E(6, q)
      17       Alternating(d)
      18       Sporadic group --- see next list
      19       Cyclic(q)

   For f=18, the sporadic groups are:
       d      group name
   -------------------------
       1      M_11
       2      M_12
       3      M_22
       4      M_23
       5      M_24
       6      J_1
       7      HS
       8      J_2
       9      McL
      10      Suz
      11      J_3
      12      Co_1
      13      Co_2
      14      Co_3
      15      He
      16      Fi_22 = M(22)
      17      Fi_23 = M(23)
      18      Fi_24 = M(24)
      19      Ly
      20      Ru
      21      ON
      22      Th
      23      HN
      24      BM
      25      M
      26      J_4
```

<a id="function-primaryabelianinvariants-grpfin"></a>
##### `PrimaryAbelianInvariants(G): GrpFin -> [ RngIntElt ]`

<a id="function-abelianinvariants-grpfin"></a>
##### `AbelianInvariants(G): GrpFin -> [ RngIntElt ]`

Given an abelian group $G$ in the category [`GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/index-permutation-groups.md#chapgrpperm), [`GrpMat`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/index-matrix-groups-over-general-rings.md#chapgrpmat), [`GrpPC`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/index-finite-soluble-groups.md#chapgrppc) or [`GrpAb`](https://docs.magma-maths.org/FinitelyPresentedGroups/AbelianGroups/index-abelian-groups.md#chapgrpab), return a sequence $Q$ containing the types of each $p$-primary component of $G$. The non-primary form gives the Smith form invariants, i.e. each element of the sequence divides the next..

<a id="function-primaryabelianbasis-grpfin"></a>
##### `PrimaryAbelianBasis(G): GrpFin -> [ GrpFinElt ], [ RngIntElt ]`

<a id="function-abelianbasis-grpfin"></a>
##### `AbelianBasis(G): GrpFin -> [ GrpFinElt ], [ RngIntElt ]`

Given an abelian group $G$ in the category [`GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/index-permutation-groups.md#chapgrpperm), [`GrpPC`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/index-finite-soluble-groups.md#chapgrppc) of [`GrpAb`](https://docs.magma-maths.org/FinitelyPresentedGroups/AbelianGroups/index-abelian-groups.md#chapgrpab), return sequences $B$ and $I$ where $I$ contains the types of each $p$-primary component of $G$ and $B$ contains corresponding elements of $G$ which have the order given and generate $G$. The non-primary form uses the Smith form invariants, i.e. each element of the sequence divides the next.

### Conjugacy Classes of Elements

There are three aspects of the conjugacy problem for elements: determining whether two elements are conjugate in a group $G$, determining a set of representatives for the conjugacy classes of elements of $G$, and listing all the elements in a particular class of $G$. The algorithms used depend on the category of $G$. If $G$ is in category [`GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/index-permutation-groups.md#chapgrpperm) or [`GrpMat`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/index-matrix-groups-over-general-rings.md#chapgrpmat), conjugacy is determined by means of a backtrack search over base-images. If $G$ is in category [`GrpPC`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/index-finite-soluble-groups.md#chapgrppc), testing conjugacy is performed by transforming each element into a standard representative of its conjugacy class by an orbit-stabilizer process that works down a sequence of increasing quotients of $G$. Conjugacy testing for a group $G$ in category [`GrpGPC`](https://docs.magma-maths.org/FinitelyPresentedGroups/PolycyclicGroups/index-polycyclic-groups.md#chapgrpgpc) is only possible if $G$ is nilpotent. In this case, an algorithm by E. Lo [[Lo98](https://docs.magma-maths.org/references.md#cite-lo-nilpotent)] is used.

Some functions described in this section may not exist or may have restrictions for some categories of groups. Details can be found in the chapters on the individual categories.

<a id="function-class-grpfin-grpfinelt"></a>
#### `Class(H, x): GrpFin, GrpFinElt -> { GrpFinElt }`

<a id="function-conjugates-grpfin-grpfinelt"></a>
#### `Conjugates(H, x): GrpFin, GrpFinElt -> { GrpFinElt }`

Given a group $H$ and an element $x$ belonging to a group $K$ such that $H$ and $K$ are subgroups of the same symmetric group, this function returns the set of conjugates of $x$ under the action of $H$. If $H = K$, the function returns the conjugacy class of $x$ in $H$.

<a id="function-classmap-grpfin"></a>
#### `ClassMap(G: parameters): GrpFin -> Map`

Given a group $G$, construct the conjugacy classes and the class map $f$ for $G$. For any element $x$ of $G$, $f(x)$ will be the index of the conjugacy class of $x$ in the sequence returned by the `Classes` function.

If $G$ is a permutation group, the construction may be controlled using the parameters `Orbits`, `WeakLimit`, and `StrongLimit`. If the parameter `Orbits` is set `true`, the classes are computed as orbits of elements under conjugation and the class map is stored as a list of images of the elements of $G$ (a list of length $|G|$). This option gives fast evaluation of the class map but is practical only in the case of very small groups. With `Orbits := false`, `WeakLimit` and `StrongLimit` are used to control the random classes algorithm (see function `Classes`).

<a id="function-conjugacyclasses-grpfin"></a>
#### `ConjugacyClasses(G: parameters): GrpFin -> [ <RngIntElt, RngIntElt, GrpFinElt> ]`

<a id="function-classes"></a>
#### `Classes(G: parameters): GrpFin -> [ <RngIntElt, RngIntElt, GrpFinElt> ]`

```magma
WeakLimit  : RngIntElt                        Default: 200
StrongLimit: RngIntElt                        Default: 500
Reps       : [ GrpFinElt ]                    Default: 
Al         : MonStg                           Default: 
```

Construct a set of representatives for the conjugacy classes of $G$. The classes are returned as a sequence of triples containing the element order, the class length, and a representative element for the class. The parameters `Reps` and `Al` enable the user to select the algorithm that is to be used when $G$ is a permutation or matrix group.

`Reps := Q`: Create the classes of $G$ by assuming that Q is a sequence of class representatives for $G$. The orders and lengths of the classes will be computed and checked for consistency.

`Al := "Action"`: Create the classes of $G$ by computing the orbits of the set of elements of $G$ under the action of conjugation. This option is only feasible for small groups.

`Al := "Random"`: Construct the conjugacy classes of elements for a permutation or matrix group $G$ using an algorithm that searches for representatives of all conjugacy classes of $G$ by examining a random selection of group elements and their powers. The behaviour of this algorithm is controlled by two associated optional parameters `WeakLimit` and `StrongLimit`, whose values are positive integers $n_1$ and $n_2$, say. Before describing the effect of these parameters, some definitions are needed: A mapping $f: G\rightarrow I$ is called a *class invariant* if $f(g) = f(g^h)$ for all $g, h\in G$. For permutation groups, the cycle structure of $g$ is a readily computable class invariant. In matrix groups, the primary invariant factors are used where possible, or the characteristic or minimal polynomials otherwise. Two elements $g$ and $h$ are said to be *weakly conjugate* with respect to the class invariant $f$ if $f(g) = f(h)$. By definition, conjugacy implies weak conjugacy, but the converse is false. The random algorithm first examines $n_1$ random elements and their powers, using a test for weak conjugacy. It then proceeds to examine a further $n_2$ random elements and their powers, using a test for ordinary conjugacy. The idea behind this strategy is that the algorithm should attempt to find as many classes as possible using the very cheap test for weak conjugacy, before employing the more expensive ordinary conjugacy test to recognize the remaining classes.

`Al := "Extend"`: Construct the conjugacy classes of $G$ by first computing classes in a quotient $G/N$ and then extending these classes to successively larger quotients $G/H$ until the classes for $G/1$ are known. More precisely, a maximal series of subgroups $1 = G_0 < G_1 < \cdots < G_r = R < G$ is computed such that $R$ is the (solvable) radical of $G$ and $G_{i+1}/G_i$ is elementary abelian. A representation of $G/R$ is computed using an algorithm of Derek Holt and its classes computed and represented as elements of $G$. To extend to the next larger quotient, a group is computed from each class which acts on the transversal. Each distinct orbit in that action gives rise to a new class. To compute the classes of $G/R$, the default algorithm (excluding the extension method) is used. The same set of parameters is passed on, so you can control limits in the random classes method if it is chosen. The limitations of the algorithm are that $R$ may be trivial, in which case nothing is done except to call a different algorithm, or one or more of the sections may be so large as to prohibit computing the action on the transversal. This algorithm is currently only available for permutation groups.

<a id="function-classesdata-grpfin"></a>
#### `ClassesData(G: parameters): GrpFin -> [ <RngIntElt, RngIntElt> ]`

Return the sequence of pairs giving element orders and class lengths of the group $G$. This uses the same algorithms as the [`Classes`](https://docs.magma-maths.org/FiniteGroups/Groups/conjugate.md#function-classes) function, with the same parameters, to compute the classes and their representatives, but only returns the basic data of orders and lengths. The class representatives are stored within the group structure, just as with the [`Classes`](https://docs.magma-maths.org/FiniteGroups/Groups/conjugate.md#function-classes) function.

<a id="function-classrepresentative-grpfin-grpfinelt"></a>
#### `ClassRepresentative(G, x): GrpFin, GrpFinElt -> GrpFinElt`

Given a group $G$ for which the conjugacy classes are known and an element $x$ of $G$, return the designated representative for the conjugacy class of $G$ containing $x$.

<a id="function-isconjugate-grpfin-grpfinelt-grpfinelt-2"></a>
#### `IsConjugate(G, g, h): GrpFin, GrpFinElt, GrpFinElt -> BoolElt, GrpFinElt`

Given a group $G$ and elements $g$ and $h$ belonging to $G$, return the value `true` if $g$ and $h$ are conjugate in $G$. The function returns a second value if the elements are conjugate: an element $k$ which conjugates $g$ into $h$. For permutation groups it is sufficient that $G$, $g$, and $h$ have a common covering group.

<a id="function-isconjugate-grpfin-grpfin-grpfin-2"></a>
#### `IsConjugate(G, H, K): GrpFin, GrpFin, GrpFin -> BoolElt, GrpFinElt`

Given a group $G$ and subgroups $H$ and $K$ belonging to $G$, return the value `true` if $G$ and $H$ are conjugate in $G$. The function returns a second value if the subgroups are conjugate: an element $z$ which conjugates $H$ into $K$. For permutation groups it is sufficient that $G$, $H$, and $K$ have a common covering group.

<a id="function-exponent-grpfin"></a>
#### `Exponent(G): GrpFin -> RngIntElt`

The exponent of the group $G$.

<a id="function-numberofclasses-grpfin"></a>
#### `NumberOfClasses(G): GrpFin -> RngIntElt`

<a id="function-nclasses-grpfin"></a>
#### `Nclasses(G): GrpFin -> RngIntElt`

The number of conjugacy classes of elements for the group $G$.

<a id="function-powermap-grpfin"></a>
#### `PowerMap(G): GrpFin -> Map`

Given a group $G$, construct the power map for $G$. Suppose that the order of $G$ is $m$ and that $G$ has $r$ conjugacy classes. When the classes are determined by Magma, they are numbered from $1$ to $r$. Let $C$ be the set of class indices $\{ 1, \ldots, r \rbrace$. The *power map* $f$ for $G$ is the mapping

$$
f : C \times{\mathbb{Z}}\rightarrow C
$$

where the value of $f(i, j)$ for $i \in C$ and $j \in{\mathbb{Z}}$ is the number of the class which contains $x_i^j$, where $x_i$ is a representative of the $i$-th conjugacy class.

<a id="example-ex-63376d"></a>
#### `Example: Conjugacy Classes of M11 (ex-63376d)`

The conjugacy classes of the Mathieu group $M_{11}$ can be constructed as follows:

```magma
> M11 := sub<Sym(11) | (1,10)(2,8)(3,11)(5,7), (1,4,7,6)(2,11,10,9)>;
> Classes(M11);
Conjugacy Classes of group M11
------------------------------
[1]     Order 1       Length 1
        Rep Id(M11)

[2]     Order 2       Length 165
        Rep (3, 10)(4, 9)(5, 6)(8, 11)

[3]     Order 3       Length 440
        Rep (1, 2, 4)(3, 5, 10)(6, 8, 11)

[4]     Order 4       Length 990
        Rep (3, 6, 10, 5)(4, 8, 9, 11)

[5]     Order 5       Length 1584
        Rep (1, 3, 6, 2, 8)(4, 7, 10, 9, 11)

[6]     Order 6       Length 1320
        Rep (1, 11, 2, 6, 4, 8)(3, 10, 5)(7, 9)

[7]     Order 8       Length 990
        Rep (1, 4, 5, 6, 2, 7, 11, 10)(8, 9)

[8]     Order 8       Length 990
        Rep (1, 7, 5, 10, 2, 4, 11, 6)(8, 9)

[9]     Order 11      Length 720
        Rep (1, 11, 9, 10, 4, 3, 7, 2, 6, 5, 8)

[10]    Order 11      Length 720
        Rep (1, 9, 4, 7, 6, 8, 11, 10, 3, 2, 5)
```

### Conjugacy Classes of Subgroups

Magma contains a new algorithm for computing representatives of the conjugacy classes of subgroups. Let $R$ denote the maximal normal soluble subgroup of the finite group $G$. The algorithm first constructs representatives for the conjugacy classes of subgroups of $Q = G/R$, and then successively extends these to larger and larger quotients of $G$ until $G$ itself is reached. If $G$ is soluble, then $Q$ is trivial and so its subgroups are known. If $G$ is non-soluble, we attempt to locate the quotient in a database of groups with trivial Fitting subgroup. This database contains all such groups of order up to $216\,000$, and all such which are perfect of order up to $1\,000\,000$. If $Q$ is found then either all its subgroups, or its maximal subgroups are read from the database. (In some cases only the maximal subgroups are stored.) If $Q$ is not found then we attempt to find the maximal subgroups of $Q$ using a method of Derek Holt. For this to succeed all simple factors of the socle of $Q$ must be found in a second database which currently contains all simple groups of order less than $1.6 \times 10^7$, as well as $M_{24}$, $HS$, $J_3$, $McL$, $Sz(32)$, and $L_6(2)$. There are also special routines to handle numerous other groups. These include: $A_n$ for $n \le 999$, $L_2(q)$, $L_3(q)$, $L_4(q)$ and $L_5(q)$ for all $q$, $S_4(q)$, $U_3(q)$ and $U_4(q)$ for all $q$, $L_d(2)$ for $d \le 14$, and the following groups: $L_6(3)$, $L_7(3)$, $U_6(2)$, $S_8(2)$, $S_{10}(2)$, $O^\pm_8(2)$, $O^\pm_{10}(2)$, $S_6(3)$, $O_7(3)$, $O^-_8(3)$, $G_2(4)$, $G_2(5)$, ${}^3D_4(2)$, ${}^2F_4(2)'$, $Co_2$, $Co_3$, $He$, $Fi_{22}$.

If we have only maximal subgroups of $Q$, and more are required, we apply the algorithm recursively to the maximal subgroups to determine all subgroups of $Q$. This may take some time.

<a id="id1"></a>
#### Conjugacy Classes of Subgroups

In this section we describe the functions that allow a user to create representatives of the conjugacy classes of subgroups, possibly subject to conditions. The main function, `Subgroups`, finds representatives for conjugacy classes of subgroups subject to certain user-supplied conditions on the order. The alternative functions `ElementaryAbelianSubgroups` and `AbelianSubgroups`, `CyclicSubgroups`, `NilpotentSubgroups`, `SolubleSubgroups`, `PerfectSubgroups`, `NonsolvableSubgroups`, `SimpleSubgroups`, and `RegularSubgroups` allow the user to construct particular classes of subgroups.

Most of the features described in this section are currently only available for groups in the category [`GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/index-permutation-groups.md#chapgrpperm), [`GrpMat`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/index-matrix-groups-over-general-rings.md#chapgrpmat) or [`GrpPC`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/index-finite-soluble-groups.md#chapgrppc).

<a id="function-subgroupclasses-grpfin"></a>
##### `SubgroupClasses(G: parameters): GrpFin -> [ rec< Grp, RngIntElt, RngIntElt, GrpFP> ]`

<a id="function-subgroups-grpfin"></a>
##### `Subgroups(G: parameters): GrpFin -> [ rec< Grp, RngIntElt, RngIntElt, GrpFP> ]`

<a id="function-subgroups-grpfin-grpfin"></a>
##### `Subgroups(G, N: parameters): GrpFin, GrpFin -> [ rec< Grp, RngIntElt, RngIntElt, GrpFP> ]`

```magma
Presentation : BoolElt                      Default: false
OrderEqual   : RngIntElt                    Default: 
OrderDividing: RngIntElt                    Default: 
IsNormal     : BoolElt                      Default: false
IsRegular    : BoolElt                      Default: false
LayerSizes   : SeqEnum                      Default: see below
```

Representatives for the conjugacy classes of subgroups for the group $G$. If $N$ is given, it must be a soluble normal subgroup of $G$. The subgroups returned are subgroups of $G$ containing $N$. The subgroups are returned as a sequence of records where the $i$-th record contains:

**(a)**
A representative subgroup $H$ for the $i$-th conjugacy class (field name `subgroup`).

**(b)**
The order of the subgroup (field name `order`).

**(c)**
The number of subgroups in the class (field name `length`).

**(d)**
[Optionally] A presentation for $H$ (field name `presentation`).

`Presentation := true`: In the case in which $G$ is a permutation group, construct a presentation for each subgroup.

`OrderEqual := n`: Only construct subgroups having order equal to $n$.

`OrderDividing := n`: Only construct subgroups having order dividing $n$.

`IsNormal := true`: Only construct normal subgroups.

`IsRegular := true`: In the case in which $G$ is a permutation group, only construct regular subgroups.

`LayerSizes := [ 2, 5, 3, 4, 7, 3, 11, 2, 17, 1]` is equivalent to the default. When constructing an Elementary Abelian series for the group, attempt to split 2-layers of size gt $2^5$, 3-layers of size gt $3^4$, etc. The implied exponent for 13 is 2 and for all primes greater than 17 the exponent is 1.

<a id="function-elementaryabeliansubgroups-grpfin"></a>
##### `ElementaryAbelianSubgroups(G: parameters): GrpFin -> [ rec< Grp, RngIntElt, RngIntElt, GrpFP> ]`

Representatives for the conjugacy classes of elementary abelian subgroups for the group $G$. The subgroups are returned as a sequence of records having the same format as `Subgroups`. The optional parameters are also the same as for `Subgroups`.

<a id="function-abeliansubgroups-grpfin"></a>
##### `AbelianSubgroups(G: parameters): GrpFin -> [ rec< Grp, RngIntElt, RngIntElt, GrpFP> ]`

Representatives for the conjugacy classes of abelian subgroups for the group $G$. The subgroups are returned as a sequence of records having the same format as `Subgroups`. The optional parameters are also the same as for `Subgroups`.

<a id="function-cyclicsubgroups-grpfin"></a>
##### `CyclicSubgroups(G: parameters): GrpFin -> [ rec< Grp, RngIntElt, RngIntElt, GrpFP> ]`

Representatives for the conjugacy classes of cyclic subgroups for the group $G$. The subgroups are returned as a sequence of records having the same format as `Subgroups`. The optional parameters are also the same as for `Subgroups`.

<a id="function-nilpotentsubgroups-grpfin"></a>
##### `NilpotentSubgroups(G: parameters): GrpFin -> [ rec< Grp, RngIntElt, RngIntElt, GrpFP> ]`

Representatives for the conjugacy classes of nilpotent subgroups for the group $G$. The subgroups are returned as a sequence of records having the same format as `Subgroups`. The optional parameters are also the same as for `Subgroups`.

<a id="function-solublesubgroups-grpfin"></a>
##### `SolubleSubgroups(G: parameters): GrpFin -> [ rec< Grp, RngIntElt, RngIntElt, GrpFP> ]`

<a id="function-solvablesubgroups-grpfin"></a>
##### `SolvableSubgroups(G: parameters): GrpFin -> [ rec< Grp, RngIntElt, RngIntElt, GrpFP> ]`

Representatives for the conjugacy classes of solvable subgroups for the group $G$. The subgroups are returned as a sequence of records having the same format as `Subgroups`. The optional parameters are also the same as for `Subgroups`.

<a id="function-nonsolvablesubgroups-grpfin"></a>
##### `NonsolvableSubgroups(G: parameters): GrpFin -> [ rec< Grp, RngIntElt, RngIntElt, GrpFP> ]`

Representatives for the conjugacy classes of nonsolvable subgroups for the group $G$. The subgroups are returned as a sequence of records having the same format as `Subgroups`. The optional parameters are also the same as for `Subgroups`.

<a id="function-perfectsubgroups-grpfin"></a>
##### `PerfectSubgroups(G: parameters): GrpFin -> [ rec< Grp, RngIntElt, RngIntElt, GrpFP> ]`

Representatives for the conjugacy classes of perfect subgroups for the group $G$. The subgroups are returned as a sequence of records having the same format as `Subgroups`. The optional parameters are also the same as for `Subgroups`.

<a id="function-simplesubgroups-grpfin"></a>
##### `SimpleSubgroups(G: parameters): GrpFin -> [ rec< Grp, RngIntElt, RngIntElt, GrpFP> ]`

Representatives for the conjugacy classes of non-abelian simple subgroups for the group $G$. The subgroups are returned as a sequence of records having the same format as `Subgroups`. The optional parameters are also the same as for `Subgroups`.

<a id="function-regularsubgroups-grpfin"></a>
##### `RegularSubgroups(G: parameters): GrpFin -> [ rec< Grp, RngIntElt, RngIntElt, GrpFP> ]`

Representatives for the conjugacy classes of regular subgroups for the permutation group $G$. The subgroups are returned as a sequence of records having the same format as `Subgroups`. The optional parameters are also the same as for `Subgroups`.

<a id="procedure-setverbose-monstgelt-rngintelt-subgrouplattice"></a>
##### `SetVerbose("SubgroupLattice", i): MonStgElt, RngIntElt`

Turn on verbose printing for the subgroup algorithm. The level $i$ can be 2 for maximal printing or 1 for moderate printing. The algorithm works down an elementary abelian series of the group and at each level, the possible extensions of each subgroup are listed.

<a id="function-class-grpfin-grpfin"></a>
##### `Class(G, H): GrpFin, GrpFin -> { GrpFin }`

<a id="function-conjugates-grpfin-grpelt"></a>
##### `Conjugates(G, H): GrpFin, GrpElt -> { GrpElt }`

The $G$-conjugacy class of subgroups containing the group $H$.

<a id="example-ex-ca0e1e"></a>
##### `Example: Subgroup Classes of a Dihedral Group (ex-ca0e1e)`

We construct the conjugacy classes of subgroups for the dihedral group of order $12$.

```magma
> G := DihedralGroup(6);
> S := Subgroups(G);
> S;
Conjugacy classes of subgroups
------------------------------

[ 1]    Order 1            Length 1
        Permutation group acting on a set of cardinality 6
        Order = 1
          Id($)
[ 2]    Order 2            Length 3
        Permutation group acting on a set of cardinality 6
          (2, 6)(3, 5)
[ 3]    Order 2            Length 3
        Permutation group acting on a set of cardinality 6
          (1, 4)(2, 3)(5, 6)
[ 4]    Order 2            Length 1
        Permutation group acting on a set of cardinality 6
          (1, 4)(2, 5)(3, 6)
[ 5]    Order 3            Length 1
        Permutation group acting on a set of cardinality 6
          (1, 5, 3)(2, 6, 4)
[ 6]    Order 4            Length 3
        Permutation group acting on a set of cardinality 6
          (2, 6)(3, 5)
          (1, 4)(2, 5)(3, 6)
[ 7]    Order 6            Length 1
        Permutation group acting on a set of cardinality 6
          (1, 5, 3)(2, 6, 4)
          (1, 4)(2, 5)(3, 6)
[ 8]    Order 6            Length 1
        Permutation group acting on a set of cardinality 6
          (2, 6)(3, 5)
          (1, 5, 3)(2, 6, 4)
[ 9]    Order 6            Length 1
        Permutation group acting on a set of cardinality 6
          (1, 4)(2, 3)(5, 6)
          (1, 5, 3)(2, 6, 4)
[10]    Order 12           Length 1
        Permutation group acting on a set of cardinality 6
          (2, 6)(3, 5)
          (1, 5, 3)(2, 6, 4)
          (1, 4)(2, 5)(3, 6)

> // We extract the representative subgroup for class 7
> h := S[7]`subgroup;
> h;
Permutation group h acting on a set of cardinality 6
    (1, 3, 5)(2, 4, 6)
    (1, 4)(2, 5)(3, 6)
```

#### The Poset of Subgroup Classes

In addition to finding representatives for conjugacy classes of subgroups, Magma allows the user to create the poset $L$ of subgroup classes. The elements of the poset correspond to the conjugacy classes of subgroups. Two lattice elements $a$ and $b$ are joined by an edge if either some subgroup of the conjugacy class $a$ is a maximal subgroup of some subgroup of conjugacy class $b$ or vice-versa. The elements of $L$ are called *subgroup-poset elements* and are numbered from 1 to $n$, where $n$ is the cardinality of $L$. Various functions allow the user to identify maximal subgroups, normalizers, centralizers, and other relatives in the lattice. Given an element $e$ of $L$, one can easily create the subgroup $H$ of $G$ corresponding to $e$ and one can also create the element of $L$ corresponding to a subgroup of $G$.

The features described in this section are currently only available for groups in the category [`GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/index-permutation-groups.md#chapgrpperm) or [`GrpPC`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/index-finite-soluble-groups.md#chapgrppc).

##### Creating the Poset of Subgroup Classes

<a id="function-subgrouplattice-grpfin"></a>
###### `SubgroupLattice(G): GrpFin -> SubGrpLat`

```magma
Properties  : BoolElt                    Default: false
Centralizers: BoolElt                    Default: false
Normalizers : BoolElt                    Default: false
```

Create the poset $L$ of subgroup classes of $G$.

`Properties := true`: As the subgroup classes are put into the poset, record their abstract type, i.e., elementary abelian, abelian, nilpotent, soluble, simple, or perfect.

`Centralizers := true`: As each subgroup class $e$ is put into the poset, record the class in which the centralizers of the subgroups of $e$ lie.

`Normalizers := true`: As each subgroup class $e$ is put into the poset, record the class in which the normalizers of the subgroups of $e$ lie.

<a id="example-ex-c15cda"></a>
###### `Example: Subgroup Lattice of ASL(2, 3) (ex-c15cda)`

We create the subgroup poset for the group ${\operatorname{ASL}}(2, 3)$.

```magma
> G := ASL(2, 3);
> L := SubgroupLattice(G : Properties := true, Normalizers:= true,
>                           Centralizers:= true);
> L;
Partially ordered set of subgroup classes
-----------------------------------------

[ 1]  Order 1 Length 1 C = [20] N = [20]
      Maximal Subgroups:
---
[ 2]  Order 2 Length 9 Cyclic. C = [16] N = [16]
      Maximal Subgroups: 1
[ 3]  Order 3 Length 12 Cyclic. C = [14] N = [14]
      Maximal Subgroups: 1
[ 4]  Order 3 Length 24 Cyclic. C = [10] N = [10]
      Maximal Subgroups: 1
[ 5]  Order 3 Length 4 Cyclic. C = [15] N = [18]
      Maximal Subgroups: 1
---
[ 6]  Order 4 Length 27 Cyclic. C = [6] N = [12]
      Maximal Subgroups: 2
[ 7]  Order 6 Length 12 Soluble. C = [3] N = [14]
      Maximal Subgroups: 2 5
[ 8]  Order 6 Length 36 Cyclic. C = [8] N = [8]
      Maximal Subgroups: 2 3
[ 9]  Order 9 Length 4 Elementary Abelian. C = [9] N = [18]
      Maximal Subgroups: 3 5
[10]  Order 9 Length 8 Elementary Abelian. C = [10] N = [15]
      Maximal Subgroups: 4 5
[11]  Order 9 Length 1 Elementary Abelian. C = [11] N = [20]
      Maximal Subgroups: 5
---
[12]  Order 8 Length 9 Nilpotent. C = [2] N = [16]
      Maximal Subgroups: 6
[13]  Order 18 Length 1 Soluble. C = [1] N = [20]
      Maximal Subgroups: 7 11
[14]  Order 18 Length 12 Soluble. C = [3] N = [14]
      Maximal Subgroups: 7 8 9
[15]  Order 27 Length 4 Nilpotent. C = [5] N = [18]
      Maximal Subgroups: 9 10 11
---
[16]  Order 24 Length 9 Soluble. C = [2] N = [16]
      Maximal Subgroups: 8 12
[17]  Order 36 Length 3 Soluble. C = [1] N = [19]
      Maximal Subgroups: 6 13
[18]  Order 54 Length 4 Soluble. C = [1] N = [18]
      Maximal Subgroups: 13 14 15
---
[19]  Order 72 Length 1 Soluble. C = [1] N = [20]
      Maximal Subgroups: 12 17
---
[20]  Order 216 Length 1 Soluble. C = [1] N = [20]
      Maximal Subgroups: 16 18 19
```

##### Operations on Subgroup Class Posets

In the following, $L$ is the poset of subgroup classes for a group $G$.

<a id="operation-operation-subgrplat-rngintelt"></a>
###### `# L: SubGrpLat -> RngIntElt`

The cardinality of $L$, i.e., the number of conjugacy classes of subgroups of $G$.

<a id="operation-op-subgrplat-rngintelt"></a>
###### `L ! i: SubGrpLat, RngIntElt -> SubGrpLatElt`

Create the $i$-th element of the poset $L$. The elements of $L$ are sorted so that classes $i$ and $j$ of groups whose orders $o_i$ and $o_j$ are the products of $e_i$ and $e_j$ prime numbers respectively will be ordered so that $i$ comes before $j$ is $e_i<e_j$ or $e_i=e_j$ and $o_i<o_j$.

<a id="operation-op-subgrplat-grpfin"></a>
###### `L ! H: SubGrpLat, GrpFin -> SubGrpLatElt`

Create the element of the poset $L$ corresponding to the subgroup $H$ of the group $G$.

<a id="function-bottom-subgrplat"></a>
###### `Bottom(L): SubGrpLat -> SubGrpLatElt`

Create the bottom of the poset $L$, i.e., the element of $L$ corresponding to the trivial subgroup of $G$. If the poset was created with restrictions on the type of subgroups constructed, the bottom of the poset may not be the trivial subgroup.

<a id="function-top-subgrplat"></a>
###### `Top(L): SubGrpLat -> SubGrpLatElt`

Create the top of the poset $L$, i.e., the element of $L$ corresponding to $G$.

<a id="function-random-subgrplat"></a>
###### `Random(L): SubGrpLat -> SubGrpLatElt`

Create a random element of $L$.

<a id="example-ex-b91cf9"></a>
###### `Example: Fitting Subgroup in a Subgroup Lattice (ex-b91cf9)`

We create the subgroup lattice of ${\operatorname{A\Gamma L}}(1, 8)$ and locate the Fitting subgroup in the lattice.

```magma
> G := AGammaL(1, 8);
> L := SubgroupLattice(G);
> L;

Subgroup Lattice
----------------

[ 1]  Order 1 Length 1
      Maximal Subgroups:
---
[ 2]  Order 2 Length 7
      Maximal Subgroups: 1
[ 3]  Order 3 Length 28
      Maximal Subgroups: 1
[ 4]  Order 7 Length 8
      Maximal Subgroups: 1
---
[ 5]  Order 4 Length 7
      Maximal Subgroups: 2
[ 6]  Order 6 Length 28
      Maximal Subgroups: 2 3
[ 7]  Order 21 Length 8
      Maximal Subgroups: 3 4
---
[ 8]  Order 8 Length 1
      Maximal Subgroups: 5
[ 9]  Order 12 Length 7
      Maximal Subgroups: 3 5
---
[10]  Order 24 Length 7
      Maximal Subgroups: 6 8 9
[11]  Order 56 Length 1
      Maximal Subgroups: 4 8
---
[12]  Order 168 Length 1
      Maximal Subgroups: 7 10 11

> F := FittingSubgroup(G);
> F;
Permutation group F acting on a set of cardinality 8
Order = 8 = 2^3
    (1, 2)(3, 6)(4, 8)(5, 7)
    (1, 6)(2, 3)(4, 7)(5, 8)
    (1, 5)(2, 7)(3, 4)(6, 8)
> L!F;
8
```

We now construct a chain from the bottom to the top of the lattice.

```magma
> H := Bottom(L);
> Chain := [H];
> while H ne Top(L) do
>     H := Representative(MinimalOvergroups(H));
>     Chain := Append(Chain, H);
> end while;
> Chain;
[ 1, 2, 5, 8, 10, 12 ]
```

##### Operations on Poset Elements

In the following, $L$ is the poset of subgroups for a group $G$. Elements of $L$ are identified with the integers $[1..\#L]$.

<a id="literal-integerring-subgrplatelt"></a>
###### `IntegerRing() ! e: SubGrpLatElt -> RngIntElt`

The integer corresponding to poset element $e$.

<a id="operation-op-eq-subgrplatelt-subgrplatelt"></a>
###### `e eq f: SubGrpLatElt, SubGrpLatElt -> SubGrpLatElt`

Returns `true` if and only if poset elements $e$ and $f$ are equal.

<a id="operation-op-ge-subgrplatelt-subgrplatelt"></a>
###### `e ge f: SubGrpLatElt, SubGrpLatElt -> BoolElt`

Returns `true` if and only if poset element $e$ contains poset element $f$.

<a id="operation-op-ge-subgrplatelt-subgrplatelt-2"></a>
###### `e ge f: SubGrpLatElt, SubGrpLatElt -> BoolElt`

Returns `true` if and only if poset element $e$ strictly contains poset element $f$.

<a id="operation-op-le-subgrplatelt-subgrplatelt"></a>
###### `e le f: SubGrpLatElt, SubGrpLatElt -> BoolElt`

<a id="operation-op-subset-subgrplatelt-subgrplatelt"></a>
###### `e subset f: SubGrpLatElt, SubGrpLatElt -> SubGrpLatElt`

Returns `true` if and only if poset element $e$ is contained in poset element $f$.

<a id="operation-op-lt-subgrplatelt-subgrplatelt"></a>
###### `e lt f: SubGrpLatElt, SubGrpLatElt -> BoolElt`

Returns `true` if and only if poset element $e$ is strictly contained in poset element $f$.

##### Class Information from a Conjugacy Class Poset

In the following, $L$ is the poset of subgroups for a group $G$. Elements of $L$ are identified with the integers $[1..\#L]$.

<a id="function-group-subgrplatelt"></a>
###### `Group(e): SubGrpLatElt -> GrpFin`

The subgroup of $G$ that is the chosen class representative corresponding to the element $e$ of the poset $L$.

<a id="function-centraliser-subgrplatelt-subgrplatelt"></a>
###### `Centraliser(e, f): SubGrpLatElt, SubGrpLatElt -> SubGrpLatElt`

<a id="function-centralizer-subgrplatelt-subgrplatelt"></a>
###### `Centralizer(e, f): SubGrpLatElt, SubGrpLatElt -> SubGrpLatElt`

Given poset elements $e$ and $f$, return the poset element that corresponds to the class of subgroups that contains the centralizers of the subgroups of class $f$ (taken in a subgroup of class $e$). If no subgroup of class $f$ lies in class $e$, the construction fails.

<a id="function-normaliser-subgrplatelt-subgrplatelt"></a>
###### `Normaliser(e, f): SubGrpLatElt, SubGrpLatElt -> SubGrpLatElt`

<a id="function-normalizer-subgrplatelt-subgrplatelt"></a>
###### `Normalizer(e, f): SubGrpLatElt, SubGrpLatElt -> SubGrpLatElt`

Given poset elements $e$ and $f$, return the poset element that corresponds to the class of subgroups that contain the normalizers of the subgroups of class $f$ (taken in a subgroup of class $e$). If no subgroup of class $f$ lies in class $e$, the construction fails.

<a id="function-length-subgrplatelt"></a>
###### `Length(e): SubGrpLatElt -> RngIntElt`

The number of subgroups in the class corresponding to $e$.

<a id="function-order-subgrplatelt"></a>
###### `Order(e): SubGrpLatElt -> RngIntElt`

The order of the subgroup of $G$ corresponding to $e$.

<a id="function-maximalsubgroups-subgrplatelt"></a>
###### `MaximalSubgroups(e): SubGrpLatElt -> { SubGrpLatElt }`

The maximal subgroups of $e$, returned as a set of poset elements.

<a id="function-minimalovergroups-subgrplatelt"></a>
###### `MinimalOvergroups(e): SubGrpLatElt -> { SubGrpLatElt }`

The minimal overgroups of $e$, returned as a set of poset elements.

<a id="function-numberofinclusions-subgrplatelt-subgrplatelt"></a>
###### `NumberOfInclusions(e, f): SubGrpLatElt, SubGrpLatElt -> RngIntElt`

The number of elements of the conjugacy class of subgroups $e$ that lie in a fixed representative of the conjugacy class of subgroups $f$.

### All Subgroups and Intermediate Subgroups

If you want a complete list of all subgroups of the (moderately small) finite group $G$ rather than a list of representatives of the conjugacy classes, then you can use the following function. There are also functions that output lists of minimal and of all overgroups of a given subgroup.

<a id="function-allsubgroups-grpfin"></a>
#### `AllSubgroups(G): GrpFin -> [ SeqEnum ]`

A list of all subgroups of the finite group $G$.

<a id="function-minimalovergroups-grpfin-grpfin"></a>
#### `MinimalOvergroups(G, H): GrpFin, GrpFin -> [ SeqEnum ]`

A list of all minimal overgroups in $G$ of the subgroup $H$ of the finite group $G$.

<a id="function-intermediatesubgroups-grpfin-grpfin"></a>
#### `IntermediateSubgroups(G, H: parameters): GrpFin, GrpFin -> [ SeqEnum ]`

```magma
AllSubgroups: BoolElt                      Default: 
Print       : RngIntElt                    Default: 0
```

A list of all subgroups of $G$ that strictly contain the subgroup $H$ and are strictly contained in $G$.

There are two methods implemented for this. The first is to start by finding all subgroups of order divisible by $|H|$ and then to test which of these properly contain $H$. The second is to recursively call `MinimalOvergroups`.

`AllSubgroups`: If this is set to `true`, then the method involving finding all subgroups of order divisible by $|H|$ is used. If it is set to `false`, then the recursive method is used. If it is not set by the user, then Magma tries to choose which method will be faster, but this can be difficult to get right!

`Print:=0`: If this is nonzero then the method used is printed.

### Cohomology

In the following description, $G$ is a group in the category [`GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/index-permutation-groups.md#chapgrpperm), $p$ is a prime number, and $K$ is the finite field of order $p$. Further, $F$ is a finitely presented group having the same number of generators as $G$, and is such that its relations are satisfied by the corresponding generators of $G$. In other words, the mapping taking the $i$-th generator of $F$ to the $i$-th generator of $G$ must be an epimorphism. Usually this mapping will be an isomorphism, although this is not mandatory.

<a id="function-pmultiplicator-grpfin-rngintelt"></a>
#### `pMultiplicator(G, p): GrpFin, RngIntElt -> [ RngIntElt ]`

Given the group $G$ and a prime $p$, return the invariant factors of the $p$-part of the Schur multiplicator of $G$.

<a id="function-pcover-grpperm-grpfp-rngintelt"></a>
#### `pCover(G, F, p): GrpPerm, GrpFP, RngIntElt -> GrpFinFP`

Given the group $G$ and the finitely presented group $F$ such that $G$ is an epimorphic image of $G$ in the sense described above, return a presentation for the $p$-cover of $G$, constructed as an extension of the $p$-multiplier by $F$.

<a id="function-cohomologicaldimension-grpfin-modrng-rngintelt"></a>
#### `CohomologicalDimension(G, M, i): GrpFin, ModRng, RngIntElt -> RngIntElt`

Given the group $G$, the $K[G]$-module $M$, and an integer $i$ (equal to 1 or 2), return the dimension of the $i$-th cohomology group of $G$ acting on $M$.

<a id="function-extensionprocess-grpperm-modrng-grpfp"></a>
#### `ExtensionProcess(G, M, F): GrpPerm, ModRng, GrpFP -> GrpFPExtProc`

Create an extension process for the group $G$ by the module $M$.

<a id="function-extension-process"></a>
#### `Extension(P, Q): Process -> GrpFinFP`

<a id="function-nextextension-process"></a>
#### `NextExtension(P): Process -> GrpFinFP`

Return the next extension of $G$ as defined by the process $P$.

Assume that $F$ is isomorphic to the permutation group $G$, and that we wish to determine presentations for one or more extensions of the $K$-module $M$ by $F$, where $K$ is the field of $p$ elements. We first create an extension process using `ExtensionProcess(G, M, F)`. The possible extensions of $M$ by $G$ are in one-one correspondence with the elements of the second cohomology group $H^2(G,M)$ of $G$ acting on $M$. Let $b_1, \ldots, b_l$ be a basis of $H^2(G,M)$. A general element of $H^2(G,M)$ therefore has the form $a_1b_1 + \cdots + a_lb_l$ and so can be defined by a sequence $Q$ of $l$ integers $[a_1, \ldots, a_l]$. Now, to construct the corresponding extension of $M$ by $G$ we call the function `Extension(P, Q)`. The required extension is returned as a finitely presented group. If all the extensions are required then they may be obtained successively by making $p^l$ calls to the function `NextExtension`.

<a id="function-splitextension-grpperm-modrng-grpfp"></a>
#### `SplitExtension(G, M, F): GrpPerm, ModRng, GrpFP -> GrpFP`

The split extension of the module $M$ by the group $G$.

### Characters and Representations

A set of functions are provided for computing with the characters and representations of a group. A full account of the character functions may be found in Chapter [Characters of Finite Groups](https://docs.magma-maths.org/RepresentationTheory/CharactersOfFiniteGroups/index-characters-of-finite-groups.md#chapchtr). Full details of the functions for constructing and analyzing representations may be found in Chapter [Modules over an Algebra and Group Representations](https://docs.magma-maths.org/RepresentationTheory/ModulesOverAnAlgebraAndGroupRepresentations/index-modules-over-an-algebra-and-group-representations.md#chapmodalg). For the reader’s convenience we include here a description of the basic functions for creating characters and representations.

Some functions described in this section may be missing or may have slightly different calling sequences for some categories of groups. For a complete description of the features available for a special category of groups, we refer to the chapter devoted to that category.

#### Character Theory

<a id="function-characterdegrees-grppc"></a>
##### `CharacterDegrees(G): GrpPC -> [ Tup ]`

Given a finite pc-group $G$, return the sequence $[\langle d_1,c_1\rangle, \langle d_2,c_2\rangle, \ldots]$, where $c_i$ is the number of irreducible characters of $G$ having degree $d_i$. For details of the algorithm see Conlon [[Con90b](https://docs.magma-maths.org/references.md#cite-conlon-degrees)].

<a id="function-charactertable-grpfin"></a>
##### `CharacterTable(G): GrpFin -> TabChtr`

Construct the table of irreducible characters for the group $G$.

<a id="function-permutationcharacter-grpperm"></a>
##### `PermutationCharacter(G): GrpPerm -> AlgChtrElt`

Given a group $G$ represented as a permutation group, construct the character of $G$ afforded by the defining permutation representation of $G$.

<a id="function-permutationcharacter-grpfin-grpfin"></a>
##### `PermutationCharacter(G, H): GrpFin, GrpFin -> AlgChtrElt`

Given a group $G$ and some subgroup $H$ of $G$, construct the ordinary character of $G$ afforded by the permutation representation of $G$ given by the action of $G$ on the coset space of the subgroup $H$ in $G$.

<a id="function-burnsidecokernel-grp"></a>
##### `BurnsideCokernel(G): Grp -> GrpAb, UserProgram, SeqEnum[AlgChtrElt]`

For a finite group $G$ computes the Burnside cokernel $C(G)$, the quotient of the rational representation ring $R_{\mathbb{Q}}(G)$ by the image of the Burnside ring (virtual permutation representations). Returns $C(G)$ as a finite abelian group, map $R_{\mathbb{Q}}(G)\to C(G)$, and a list of irreducible rational characters with non-trivial class in $C(G)$. (The implementation follows [[AD14](https://docs.magma-maths.org/references.md#cite-bardok)], and does not compute the subgroup lattice.)

<a id="example-ex-79dcca"></a>
##### `Example: Groups with Nontrivial Burnside Cokernel (ex-79dcca)`

The first example of a finite group with $C(G)\ne 1$ is due to Serre, $G=C_3\times{\mathbb{Q}}_8$. In fact, there are two groups of order 24 with $C(G)\ne 1$ and no smaller examples:

```magma
> [GroupName(G): G in SmallGroups(n), n in [1..24] | #BurnsideCokernel(G) ne 1];
[ C3:C8, C3*Q8 ]
```

#### Representation Theory

We describe the main functions for creating $K[G]$-modules for finite groups. The machinery for working with these modules is described in Chapter [Modules over an Algebra and Group Representations](https://docs.magma-maths.org/RepresentationTheory/ModulesOverAnAlgebraAndGroupRepresentations/index-modules-over-an-algebra-and-group-representations.md#chapmodalg).

<a id="function-gmodule-grpfin-algmat"></a>
##### `GModule(G, S): GrpFin, AlgMat -> ModGrpFin`

Let $G$ be a group defined on $r$ generators and let $S$ be a subalgebra of the matrix algebra $M_n(R)$, also defined by $r$ non-singular matrices. It is assumed that the mapping from $G$ to $S$ defined by $\phi : G.i \mapsto S.i$, for $i = 1, \ldots, r$, extends to a group homomorphism. Let $M$ be the natural module for the matrix algebra $S$. The function `GModule` gives $M$ the structure of an $S[G]$-module, where the action of the $i$-th generator of $G$ on $M$ is given by the $i$-th generator of $S$.

<a id="function-gmodule-grpfin-grpfin-grpfin"></a>
##### `GModule(G, A, B): GrpFin, GrpFin, GrpFin -> ModGrpFin, Map`

Given a finite group $G$, a normal subgroup $A$ of G, and a normal subgroup $B$ of $A$ such that the section $A/B$ is elementary abelian of order $p^n,$ create the $K[G]$-module $M$ corresponding to the action of $G$ on $A/B$, where $K$ is the field ${\bf F}_{p}$. If $B$ is trivial, it may be omitted. The function returns:

**(a)**
the module $M$; and,

**(b)**
the homomorphism $\phi : A/B \rightarrow M$.

<a id="function-permutationmodule-grpfin-grpfin-rng"></a>
##### `PermutationModule(G, H, R): GrpFin, GrpFin, Rng -> ModGrpFin`

Given a finite group $G$ and a ring $R$, create the $R[G]$-module for $G$ corresponding to the permutation action of $G$ on the cosets of $H$.

<a id="function-permutationmodule-grpperm-rng"></a>
##### `PermutationModule(G, R): GrpPerm, Rng -> ModGrpFin`

Given a finite permutation group $G$ and a ring $R$, create the natural permutation module for $G$ over $R$.

<a id="example-ex-652230"></a>
##### `Example: Permutation Module for M10 (ex-652230)`

The permutation module for the group $M_{10}$ over $GF(2)$ may be created as follows:

```magma
> m10 := PermutationGroup< 10 |  (1, 3, 9, 10, 2, 8, 7, 6, 4, 5),
>                                (1, 7)(2, 4, 3, 6, 8, 10, 9, 5) >;
> p := PermutationModule(m10, GF(2));
> p : Maximal;

GModule p of dimension 10 over GF(2)
Generators of acting algebra:

[0 0 1 0 0 0 0 0 0 0]
[0 0 0 0 0 0 0 1 0 0]
[0 0 0 0 0 0 0 0 1 0]
[0 0 0 0 1 0 0 0 0 0]
[1 0 0 0 0 0 0 0 0 0]
[0 0 0 1 0 0 0 0 0 0]
[0 0 0 0 0 1 0 0 0 0]
[0 0 0 0 0 0 1 0 0 0]
[0 0 0 0 0 0 0 0 0 1]
[0 1 0 0 0 0 0 0 0 0]

[0 0 0 0 0 0 1 0 0 0]
[0 0 0 1 0 0 0 0 0 0]
[0 0 0 0 0 1 0 0 0 0]
[0 0 1 0 0 0 0 0 0 0]
[0 1 0 0 0 0 0 0 0 0]
[0 0 0 0 0 0 0 1 0 0]
[1 0 0 0 0 0 0 0 0 0]
[0 0 0 0 0 0 0 0 0 1]
[0 0 0 0 1 0 0 0 0 0]
[0 0 0 0 0 0 0 0 1 0]
```

<a id="example-ex-36abf4"></a>
##### `Example: Module for a Split Extension (ex-36abf4)`

The group $G$ defined below is the split extension of an elementary abelian group $E$ of order $16$ by $Alt(6)$. After setting up the group, we construct the module $M$ for $G$ corresponding to its action on $E$.

```magma
> G := PermutationGroup< 16 |
>         (1, 15, 7, 5, 12)(2, 9, 13, 14, 8)(3, 6, 10, 11, 4),
>         (1, 4, 5)(2, 8, 10)(3, 12, 15)(6, 13, 11)(7, 9, 14),
>         (1, 16)(2, 3)(4, 5)(6, 7)(8, 9)(10, 11)(12, 13)(14, 15) >;
> CS := ChiefSeries(G);
> [ Order(H) : H in CS ];
[ 5760, 16, 1 ]
> M := GModule(G, CS[2]);
> M:Maximal;

GModule M of dimension 4 over GF(2)
Generators of acting algebra:

[0 1 0 0]
[0 1 1 0]
[0 0 1 1]
[1 0 0 1]

[0 0 1 0]
[0 0 0 1]
[1 0 1 0]
[0 1 0 1]

[1 0 0 0]
[0 1 0 0]
[0 0 1 0]
[0 0 0 1]
```

### Databases of Groups

Magma contains the following databases of groups:

*Small Groups*: Contains all groups of order up to 1000, excluding orders 512 and 768.

*Perfect Groups*: This database contains all perfect groups up to order 50000, and many classes of perfect groups up to order one million. Each group is defined by means of a finite presentation. Further information is also provided which allows the construction of permutation representations.

*Rational Maximal Matrix Groups*: Contains rational maximal finite matrix groups and their invariant forms, for small dimensions (up to 31 at V2.9 and above). Each entry can be accessed either as a matrix group or as a lattice.

*Quaternionic Matrix Groups*: A database of the finite absolutely irreducible subgroups of ${\operatorname{GL}}_n({\cal D})$ where ${\cal D}$ is a definite quaternion algebra whose centre has degree $d$ over ${\mathbb{Q}}$ and $nd\leq10$. Each entry can be accessed either as a matrix group or as a lattice.

*Transitive Permutation Groups*: Magma has a database containing all transitive permutation groups having degree up to 47.

*Primitive Permutation Groups*: Magma has a database containing all primitive permutation groups having degree up to 4095.

For a description of these databases, we refer to Chapter [Databases of Groups](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/index-databases-of-groups.md#chapgrpdata).

<a id="permutation"></a>
<a id="chapgrpperm"></a>
## Permutation Groups

- [Introduction](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/introduction.md)
  - [Terminology](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/introduction.md#terminology)
  - [The Category of Permutation Groups](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/introduction.md#the-category-of-permutation-groups)
  - [The Construction of a Permutation Group](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/introduction.md#the-construction-of-a-permutation-group)
- [Creation of a Permutation Group](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/creation-symmetric.md)
  - [Construction of the Symmetric Group](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/creation-symmetric.md#construction-of-the-symmetric-group)
    - [`Sym(n): RngIntElt → GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/creation-symmetric.md#function-sym-rngintelt)
    - [`SymmetricGroup(n): RngIntElt → GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/creation-symmetric.md#function-symmetricgroup-rngintelt)
    - [`Sym(X): Set → GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/creation-symmetric.md#function-sym-set)
    - [`SymmetricGroup(X): Set → GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/creation-symmetric.md#function-symmetricgroup-set)
    - [`StandardGroup(G): GrpPerm → GrpPerm, Map`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/creation-symmetric.md#function-standardgroup-grpperm)
    - [Example: Symmetric Group on Strings](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/creation-symmetric.md#example-ex-667d16)
  - [Construction of a Permutation](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/creation-symmetric.md#construction-of-a-permutation)
    - [`elt< G | L >: GrpPerm, List(Elt) → GrpPermElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/creation-symmetric.md#constructor-constructor-elt-grpperm-list-elt-grppermelt)
    - [`G ! Q: GrpPerm, [ Elt ] → GrpPermElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/creation-symmetric.md#operation-op-grpperm-elt)
    - [`G ! (...)(...)...(...): GrpPerm, Cycles → GrpPermElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/creation-symmetric.md#operation-op-grpperm-cycles)
    - [`G ! \(...)(...)...(...): GrpPerm, LiteralCycles → GrpPermElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/creation-symmetric.md#operation-op-grpperm-literalcycles)
    - [`G ! Q: GrpPerm, SeqEnum[SetIndx] → GrpPermElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/creation-symmetric.md#operation-op-grpperm-seqenum-setindx)
    - [`ElementToSequence(g): GrpPermElt → [ Elt ]`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/creation-symmetric.md#function-elementtosequence-grppermelt)
    - [`Eltseq(g): GrpPermElt → [ Elt ]`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/creation-symmetric.md#function-eltseq-grppermelt)
    - [`Identity(G): Grp → GrpPermElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/creation-symmetric.md#function-identity-grp)
    - [`Id(G): Grp → GrpPermElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/creation-symmetric.md#function-id-grp)
    - [`G ! 1: Grp, RngIntElt → GrpPermElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/creation-symmetric.md#operation-op-grp-rngintelt)
    - [Example: Three Ways to Construct a Permutation](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/creation-symmetric.md#example-ex-ffdb2d)
  - [Construction of a General Permutation Group](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/creation-symmetric.md#construction-of-a-general-permutation-group)
    - [`PermutationGroup< X | L >: Set, List → GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/creation-symmetric.md#constructor-constructor-permutationgroup-set-list-grpperm)
    - [`PermutationGroup< n | L >: RngIntElt, List → GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/creation-symmetric.md#constructor-constructor-permutationgroup-rngintelt-list-grpperm)
    - [Example: Hessian Group](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/creation-symmetric.md#example-ex-1e0f19)
- [Elementary Properties of a Group](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/operation.md)
  - [Accessing Group Information](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/operation.md#accessing-group-information)
    - [`G . i: GrpPerm, RngIntElt → GrpPermElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/operation.md#operation-operation-grpperm-rngintelt-grppermelt)
    - [`Degree(G): GrpPermElt → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/operation.md#function-degree-grppermelt)
    - [`Generators(G): GrpPerm → { GrpPermElt }`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/operation.md#function-generators-grpperm)
    - [`GeneratorsSequence(G): GrpPerm → [ GrpPermElt ]`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/operation.md#function-grpperm-generatorssequence)
    - [`NumberOfGenerators(G): GrpPerm → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/operation.md#function-numberofgenerators-grpperm)
    - [`Ngens(G): GrpPerm → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/operation.md#function-ngens-grpperm)
    - [`FewGenerators(G): GrpPerm → [GrpPermElt]`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/operation.md#function-fewgenerators-grpperm)
    - [`Generic(G): GrpPerm → GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/operation.md#function-generic-grpperm)
    - [`Parent(g): GrpPermElt → GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/operation.md#function-parent-grppermelt)
    - [`GSet(G): GrpPerm → GSet`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/operation.md#function-gset-grpperm)
    - [Example: Basic Access Functions for a Group](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/operation.md#example-ex-e70b28)
  - [Group Order](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/operation.md#group-order)
    - [`Order(G): GrpPerm → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/operation.md#function-order-grpperm)
    - [`# G: GrpPerm → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/operation.md#operation-operation-grpperm-rngintelt)
    - [`FactoredOrder(G): GrpPerm → [ <RngIntElt, RngIntElt> ]`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/operation.md#function-factoredorder-grpperm)
  - [Abstract Properties of a Group](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/operation.md#abstract-properties-of-a-group)
    - [`IsAbelian(G): GrpPerm → BoolElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/operation.md#function-isabelian-grpperm)
    - [`IsCyclic(G): GrpPerm → BoolElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/operation.md#function-iscyclic-grpperm)
    - [`IsElementaryAbelian(G): GrpPerm → BoolElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/operation.md#function-iselementaryabelian-grpperm)
    - [`IsSpecial(G): GrpPerm → BoolElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/operation.md#function-isspecial-grpperm)
    - [`IsExtraSpecial(G): GrpPerm → BoolElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/operation.md#function-isextraspecial-grpperm)
    - [`IsNilpotent(G): GrpPerm → BoolElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/operation.md#function-isnilpotent-grpperm)
    - [`IsSoluble(G): GrpPerm → BoolElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/operation.md#function-issoluble-grpperm)
    - [`IsSolvable(G): GrpPerm → BoolElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/operation.md#function-issolvable-grpperm)
    - [`IsPerfect(G): GrpPerm → BoolElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/operation.md#function-isperfect-grpperm)
    - [`IsSimple(G): GrpPerm → BoolElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/operation.md#function-issimple-grpperm)
    - [`IsWreathProduct(G): GrpPerm → BoolElt, GrpPerm, GrpPerm, GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/operation.md#function-iswreathproduct-grpperm)
    - [Example: Perfect Non-Simple Subgroups of M24](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/operation.md#example-ex-c8fc8b)
- [Homomorphisms](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/homomorphism.md)
  - [`hom<G -> H | L>: GrpPerm, List → Map`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/homomorphism.md#constructor-constructor-hom-grpperm-list-map)
  - [`Domain(f): Map → Grp`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/homomorphism.md#function-domain-map)
  - [`Codomain(f): Map → Grp`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/homomorphism.md#function-codomain-map)
  - [`Image(f): Map → Grp`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/homomorphism.md#function-image-map)
  - [`Kernel(f): Map → Grp`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/homomorphism.md#function-kernel-map)
  - [`IsHomomorphism(G, H, Q): GrpPerm, GrpPerm, SeqEnum[GrpPermElt] → Bool, Map`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/homomorphism.md#function-ishomomorphism-grpperm-grpperm-seqenum-grppermelt)
  - [Example: Permutation Representation of Degree 8](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/homomorphism.md#example-ex-bee0e9)
- [Building Permutation Groups](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/building-groups.md)
  - [Some Standard Permutation Groups](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/building-groups.md#some-standard-permutation-groups)
    - [`AbelianGroup(GrpPerm, Q): Cat, [ RngIntElt ] → GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/building-groups.md#function-abeliangroup-cat-rngintelt)
    - [`AlternatingGroup(GrpPerm, n): Cat, RngIntElt → GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/building-groups.md#function-alternatinggroup-cat-rngintelt)
    - [`AlternatingGroup(n): RngIntElt → GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/building-groups.md#function-alternatinggroup-rngintelt)
    - [`Alt(n): RngIntElt → GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/building-groups.md#function-alt-rngintelt)
    - [`CyclicGroup(GrpPerm, n): Cat, RngIntElt → GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/building-groups.md#function-cyclicgroup-cat-rngintelt)
    - [`CyclicGroup(n): RngIntElt → GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/building-groups.md#function-cyclicgroup-rngintelt)
    - [`DihedralGroup(GrpPerm, n): Cat, RngIntElt → GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/building-groups.md#function-dihedralgroup-cat-rngintelt)
    - [`DihedralGroup(n): RngIntElt → GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/building-groups.md#function-dihedralgroup-rngintelt)
    - [`Sym(GrpPerm, n): Cat, RngIntElt → GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/building-groups.md#function-sym-cat-rngintelt)
    - [`SymmetricGroup(GrpPerm, n): Cat, RngIntElt → GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/building-groups.md#function-symmetricgroup-cat-rngintelt)
    - [`Sym(n): RngIntElt → GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/building-groups.md#function-sym-rngintelt-2)
    - [`SymmetricGroup(n): RngIntElt → GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/building-groups.md#function-symmetricgroup-rngintelt-2)
    - [`ExtraSpecialGroup(GrpPerm, p, n : parameters): Cat, RngIntElt, RngIntElt → GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/building-groups.md#function-extraspecialgroup-cat-rngintelt-rngintelt)
    - [`ExtraSpecialGroup(p, n : parameters): RngIntElt, RngIntElt → GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/building-groups.md#function-extraspecialgroup-rngintelt-rngintelt)
    - [`YoungSubgroup(L): [RngIntElt] → GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/building-groups.md#function-youngsubgroup-rngintelt)
    - [Example: Standard Permutation Groups](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/building-groups.md#example-ex-98baac)
  - [Direct Products and Wreath Products](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/building-groups.md#direct-products-and-wreath-products)
    - [`DirectProduct(G, H): GrpPerm, GrpPerm → GrpPerm, [ Hom(Grp) ], [ Hom(Grp) ]`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/building-groups.md#function-directproduct-grpperm-grpperm)
    - [`DirectProduct(Q): [ GrpPerm ] → GrpPerm, [ Hom(Grp) ], [ Hom(Grp) ]`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/building-groups.md#function-directproduct-grpperm)
    - [`PrimitiveWreathProduct(G, H): GrpPerm, GrpPerm → GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/building-groups.md#function-permg-primitivewreathproduct)
    - [`PrimitiveWreathProduct(Q): [ GrpPerm ] → GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/building-groups.md#function-primitivewreathproduct-grpperm)
    - [`WreathProduct(G, H): GrpPerm, GrpPerm → GrpPerm, SeqEnum[Map], Map, Map`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/building-groups.md#function-wreathproduct-grpperm-grpperm)
    - [`WreathProduct(Q): [ GrpPerm ] → GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/building-groups.md#function-wreathproduct-grpperm)
    - [`WreathProduct(B): GSet → GrpPerm, GrpPerm, GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/building-groups.md#function-wreathproduct-gset)
    - [`WreathProduct(G, B): GrpPerm, GSet → GrpPerm, GrpPerm, GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/building-groups.md#function-wreathproduct-grpperm-gset)
    - [Example: Direct and Wreath Products](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/building-groups.md#example-ex-4e2871)
- [Permutations](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/permutations.md)
  - [Coercion](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/permutations.md#coercion)
    - [`G ! g: GrpPerm, GrpPermElt → GrpPermElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/permutations.md#operation-op-grpperm-grppermelt)
    - [`G !! H: GrpPerm, GrpPerm → GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/permutations.md#operation-op-grpperm-grpperm)
  - [Arithmetic with Permutations](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/permutations.md#arithmetic-with-permutations)
    - [`g * h: GrpPermElt, GrpPermElt → GrpPermElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/permutations.md#operation-op-times-grppermelt-grppermelt)
    - [`g ^ n: GrpPermElt, RngIntElt → GrpPermElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/permutations.md#operation-op-pow-grppermelt-rngintelt)
    - [`g / h: GrpPermElt, GrpPermElt → GrpPermElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/permutations.md#operation-op-div-grppermelt-grppermelt)
    - [`g ^ h: GrpPermElt, GrpPermElt → GrpPermElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/permutations.md#operation-op-pow-grppermelt-grppermelt)
    - [`(g, h): GrpPermElt, GrpPermElt → GrpPermElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/permutations.md#literal-literal-g-h-grppermelt-grppermelt-grppermelt)
    - [`(g₁, ..., gᵣ): GrpPermElt, ..., GrpPermElt → GrpPermElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/permutations.md#literal-literal-g1-gr-grppermelt-grppermelt-grppermelt)
  - [Properties of Permutations](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/permutations.md#properties-of-permutations)
    - [`CycleStructure(g): GrpPermElt → [ <RngIntElt, RngIntElt> ]`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/permutations.md#function-cyclestructure-grppermelt)
    - [`Degree(g): GrpPermElt → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/permutations.md#function-degree-grppermelt-2)
    - [`IsEven(g): GrpPermElt → BoolElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/permutations.md#function-iseven-grppermelt)
    - [`Sign(g): GrpPermElt → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/permutations.md#function-sign-grppermelt)
    - [`Order(g): GrpPermElt → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/permutations.md#function-order-grppermelt)
  - [Predicates for Permutations](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/permutations.md#predicates-for-permutations)
    - [`g eq h: GrpPermElt, GrpPermElt → BoolElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/permutations.md#operation-op-eq-grppermelt-grppermelt)
    - [`g ne h: GrpPermElt, GrpPermElt → BoolElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/permutations.md#operation-op-ne-grppermelt-grppermelt)
    - [`IsId(g): GrpPermElt → BoolElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/permutations.md#function-isid-grppermelt)
    - [`IsIdentity(g): GrpPermElt → BoolElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/permutations.md#function-isidentity-grppermelt)
    - [Example: Arithmetic with Permutations](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/permutations.md#example-ex-531aba)
  - [Set Operations](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/permutations.md#set-operations)
    - [`G * H: GrpPerm, GrpPerm → { GrpPermElt }`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/permutations.md#operation-op-times-grpperm-grpperm)
    - [`ElementSet(G, H): GrpPerm, GrpPerm → { GrpPermElt }`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/permutations.md#function-elementset-grpperm-grpperm)
    - [`NumberingMap(G): GrpPerm → Map`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/permutations.md#function-numberingmap-grpperm)
    - [`RandomProcess(G): GrpPerm → Process`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/permutations.md#function-randomprocess-grpperm)
    - [`Random(G: parameters): GrpPerm → GrpPermElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/permutations.md#function-random-grpperm)
    - [`Random(P): Process → GrpPermElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/permutations.md#function-random-process)
    - [`Representative(G): GrpPerm → GrpPermElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/permutations.md#function-representative-grpperm)
    - [`Rep(G): GrpPerm → GrpPermElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/permutations.md#function-rep-grpperm)
    - [Example: Multiplication Table of a Dihedral Group](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/permutations.md#example-ex-80e2ef)
    - [Example: Random Elements of a Wreath Product](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/permutations.md#example-ex-6247bb)
- [Conjugacy](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/conjugate.md)
  - [`Class(H, x): GrpPerm, GrpPermElt → { GrpPermElt }`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/conjugate.md#function-class-grpperm-grppermelt)
  - [`Conjugates(H, x): GrpPerm, GrpPermElt → { GrpPermElt }`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/conjugate.md#function-conjugates-grpperm-grppermelt)
  - [`ConjugacyClasses(G: parameters): GrpPerm → [ <RngIntElt, RngIntElt, GrpPermElt> ]`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/conjugate.md#function-conjugacyclasses-grpperm)
  - [`Classes(G: parameters): GrpPerm → [ <RngIntElt, RngIntElt, GrpPermElt> ]`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/conjugate.md#function-classes-grpperm)
  - [`ClassRepresentative(G, x): GrpPerm, GrpPermElt → GrpPermElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/conjugate.md#function-classrepresentative-grpperm-grppermelt)
  - [`ClassRepresentative(G, i): GrpPerm, RngIntElt → GrpPermElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/conjugate.md#function-classrepresentative-grpperm-rngintelt)
  - [`ClassCentraliser(G, i): GrpPerm, RngIntElt → GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/conjugate.md#function-classcentraliser-grpperm-rngintelt)
  - [`ClassCentralizer(G, i): GrpPerm, RngIntElt → GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/conjugate.md#function-classcentralizer-grpperm-rngintelt)
  - [`ClassMap(G: parameters): GrpPerm → Map`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/conjugate.md#function-classmap-grpperm)
  - [`IsConjugate(G, g, h: parameters): GrpPerm, GrpPermElt, GrpPermElt → BoolElt, GrpPermElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/conjugate.md#function-isconjugate-grpperm-grppermelt-grppermelt)
  - [`IsConjugate(G, H, K: parameters): GrpPerm, GrpPerm, GrpPerm → BoolElt, GrpPermElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/conjugate.md#function-isconjugate-grpperm-grpperm-grpperm)
  - [`Exponent(G): GrpPerm → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/conjugate.md#function-exponent-grpperm)
  - [`NumberOfClasses(G): GrpPerm → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/conjugate.md#function-numberofclasses-grpperm)
  - [`Nclasses(G): GrpPerm → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/conjugate.md#function-nclasses-grpperm)
  - [`PowerMap(G): GrpPerm → Map`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/conjugate.md#function-powermap-grpperm)
  - [`AssertAttribute(G, "Classes", Q): GrpPerm, MonStgElt, SeqEnum`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/conjugate.md#procedure-assertattribute-grpperm-monstgelt-seqenum-classes)
  - [Example: Conjugacy Classes of M11](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/conjugate.md#example-ex-1e8f6a)
  - [Example: Random Class Parameters for Higman-Sims](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/conjugate.md#example-ex-d654b2)
- [Subgroups](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/subgroup.md)
  - [Construction of a Subgroup](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/subgroup.md#construction-of-a-subgroup)
    - [`sub<G | L>: GrpPerm, List → GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/subgroup.md#constructor-constructor-sub-grpperm-list-grpperm)
    - [`ncl<G | L>: GrpPerm, List → GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/subgroup.md#constructor-constructor-ncl-grpperm-list-grpperm)
    - [Example: Ways to Define PGL(2, 7)](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/subgroup.md#example-ex-dfcc0d)
    - [Example: Action on Unordered Pairs](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/subgroup.md#example-ex-f29910)
    - [Example: Derived Subgroup via Normal Closure](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/subgroup.md#example-ex-9bd7f8)
  - [Membership and Equality](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/subgroup.md#membership-and-equality)
    - [`g in G: GrpPermElt, GrpPerm → BoolElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/subgroup.md#operation-op-in-grppermelt-grpperm)
    - [`g notin G: GrpPermElt, GrpPerm → BoolElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/subgroup.md#operation-op-notin-grppermelt-grpperm)
    - [`S subset G: { GrpPermElt }, GrpPerm → BoolElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/subgroup.md#operation-op-subset-grppermelt-grpperm)
    - [`S notsubset G: { GrpPermElt }, GrpPerm → BoolElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/subgroup.md#operation-operation-notsubset-grppermelt-grpperm-boolelt)
    - [`H subset G: GrpPerm, GrpPerm → BoolElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/subgroup.md#operation-op-subset-grpperm-grpperm)
    - [`IsSubgroup(H,G): GrpPerm, GrpPerm → BoolElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/subgroup.md#function-issubgroup-grpperm-grpperm)
    - [`H notsubset G: GrpPerm, GrpPerm → BoolElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/subgroup.md#operation-operation-notsubset-grpperm-grpperm-boolelt)
    - [`H eq G: GrpPerm, GrpPerm → BoolElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/subgroup.md#operation-op-eq-grpperm-grpperm)
    - [`H ne G: GrpPerm, GrpPerm → BoolElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/subgroup.md#operation-op-ne-grpperm-grpperm)
  - [Elementary Properties of a Subgroup](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/subgroup.md#elementary-properties-of-a-subgroup)
    - [`Index(G, H): GrpPerm, GrpPerm → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/subgroup.md#function-index-grpperm-grpperm)
    - [`FactoredIndex(G, H): GrpPerm, GrpPerm → [ <RngIntElt, RngIntElt> ]`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/subgroup.md#function-factoredindex-grpperm-grpperm)
    - [`IsCentral(G, H): GrpPerm, GrpPerm → BoolElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/subgroup.md#function-iscentral-grpperm-grpperm)
    - [`IsNormal(G, H): GrpPerm, GrpPerm → BoolElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/subgroup.md#function-isnormal-grpperm-grpperm)
    - [`IsSelfNormalizing(G, H): GrpPerm, GrpPerm → BoolElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/subgroup.md#function-isselfnormalizing-grpperm-grpperm)
    - [`IsSelfNormalising(G, H): GrpPerm, GrpPerm → BoolElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/subgroup.md#function-isselfnormalising-grpperm-grpperm)
    - [`IsSubnormal(G, H): GrpPerm, GrpPerm → BoolElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/subgroup.md#function-issubnormal-grpperm-grpperm)
  - [Standard Subgroups](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/subgroup.md#standard-subgroups)
    - [`H ^ g: GrpPerm, GrpPermElt → GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/subgroup.md#operation-op-pow-grpperm-grppermelt)
    - [`Conjugate(H, g): GrpPerm, GrpPermElt → GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/subgroup.md#function-conjugate-grpperm-grppermelt)
    - [`H meet K: GrpPerm, GrpPerm → GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/subgroup.md#operation-op-meet-grpperm-grpperm)
    - [`IntersectionWithNormalSubgroup(G, N: parameters): GrpPerm, GrpPerm → GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/subgroup.md#function-intersectionwithnormalsubgroup-grpperm-grpperm)
    - [`CommutatorSubgroup(G, H, K): GrpPerm, GrpPerm, GrpPerm → GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/subgroup.md#function-commutatorsubgroup-grpperm-grpperm-grpperm)
    - [`CommutatorSubgroup(H, K): GrpPerm, GrpPerm → GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/subgroup.md#function-commutatorsubgroup-grpperm-grpperm)
    - [`Centralizer(G, g: parameters): GrpPerm, GrpPermElt → GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/subgroup.md#function-centralizer-grpperm-grppermelt)
    - [`Centraliser(G, g: parameters): GrpPerm, GrpPermElt → GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/subgroup.md#function-centraliser-grpperm-grppermelt)
    - [`Centralizer(G, H): GrpPerm, GrpPerm → GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/subgroup.md#function-centralizer-grpperm-grpperm)
    - [`Centraliser(G, H): GrpPerm, GrpPerm → GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/subgroup.md#function-centraliser-grpperm-grpperm)
    - [`CentralizerOfNormalSubgroup(G, H): GrpPerm, GrpPerm → GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/subgroup.md#function-centralizerofnormalsubgroup-grpperm-grpperm)
    - [`SectionCentraliser(G, H, K): GrpPerm, GrpPerm, GrpPerm → GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/subgroup.md#function-sectioncentraliser-grpperm-grpperm-grpperm)
    - [`SectionCentralizer(G, H, K): GrpPerm, GrpPerm, GrpPerm → GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/subgroup.md#function-sectioncentralizer-grpperm-grpperm-grpperm)
    - [`Core(G, H): GrpPerm, GrpPerm → GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/subgroup.md#function-core-grpperm-grpperm)
    - [`H ^ G: GrpPerm, GrpPerm → GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/subgroup.md#operation-op-pow-grpperm-grpperm)
    - [`NormalClosure(G, H): GrpPerm, GrpPerm → GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/subgroup.md#function-normalclosure-grpperm-grpperm)
    - [`Normalizer(G, H: parameters): GrpPerm, GrpPerm → GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/subgroup.md#function-normalizer-grpperm-grpperm)
    - [`Normaliser(G, H: parameters): GrpPerm, GrpPerm → GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/subgroup.md#function-normaliser-grpperm-grpperm)
    - [`SymmetricNormalizer(G): GrpPerm → GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/subgroup.md#function-symmetricnormalizer-grpperm)
    - [`SymmetricNormaliser(G): GrpPerm → GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/subgroup.md#function-symmetricnormaliser-grpperm)
    - [`SylowSubgroup(G, p): GrpPerm, RngIntElt → GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/subgroup.md#function-sylowsubgroup-grpperm-rngintelt)
    - [`Sylow(G, p): GrpPerm, RngIntElt → GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/subgroup.md#function-sylow-grpperm-rngintelt)
    - [Example: Standard Subgroups of a Degree 30 Group](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/subgroup.md#example-ex-ea0914)
  - [Maximal Subgroups](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/subgroup.md#maximal-subgroups)
    - [`IsMaximal(G, H: parameters): GrpPerm, GrpPerm → BoolElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/subgroup.md#function-ismaximal-grpperm-grpperm)
    - [`IsProbablyMaximal(G, H: parameters): GrpPerm, GrpPerm → BoolElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/subgroup.md#function-isprobablymaximal-grpperm-grpperm)
    - [`MaximalSubgroups(G: parameters): GrpPerm → [ rec< GrpPerm, RngIntElt, RngIntElt, GrpFP> ]`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/subgroup.md#function-maximalsubgroups-grpperm)
    - [Example: Maximal Subgroups of a Large Rubik's Cube Group](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/subgroup.md#example-ex-aa3565)
    - [`MaximalSubgroups(G,N: parameters): GrpPerm, GrpPerm → [ rec< GrpPerm, RngIntElt, RngIntElt, GrpFP> ]`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/subgroup.md#function-maximalsubgroups-grpperm-grpperm)
  - [Conjugacy Classes of Subgroups](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/subgroup.md#conjugacy-classes-of-subgroups)
    - [`SubgroupClasses(G: parameters): GrpPerm → [ rec< GrpPerm, RngIntElt, RngIntElt, GrpFP> ]`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/subgroup.md#function-subgroupclasses-grpperm)
    - [`Subgroups(G: parameters): GrpPerm → [ rec< GrpPerm, RngIntElt, RngIntElt, GrpFP> ]`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/subgroup.md#function-subgroups-grpperm)
    - [`SubgroupsLift(G, A, B, Q: parameters): GrpPerm, GrpPerm, GrpPerm, SeqEnum → SeqEnum`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/subgroup.md#function-subgroupslift-grpperm-grpperm-grpperm-seqenum)
    - [`LowIndexSubgroups(G, n: parameters): GrpPerm, RngIntElt → SeqEnum`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/subgroup.md#function-lowindexsubgroups-grpperm-rngintelt)
    - [`LowIndexSubgroups(G, t: parameters): GrpPerm, Tup → SeqEnum`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/subgroup.md#function-lowindexsubgroups-grpperm-tup)
    - [`LowIndexSubgroups(G, N, n: parameters): GrpPerm, RngIntElt → SeqEnum`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/subgroup.md#function-lowindexsubgroups-grpperm-rngintelt-2)
    - [`LowIndexSubgroups(G, N, t: parameters): GrpPerm, Tup → SeqEnum`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/subgroup.md#function-lowindexsubgroups-grpperm-tup-2)
    - [Example: Subgroups of the Double Cover of M12](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/subgroup.md#example-ex-24cf2d)
    - [Example: Low Index Subgroups of a Transitive Group](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/subgroup.md#example-ex-157d91)
    - [Example: Subgroup Lattice with Inclusions](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/subgroup.md#example-ex-672b95)
    - [`SubgroupLattice(G): GrpPerm → SubGrpLat`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/subgroup.md#function-subgrouplattice-grpperm)
    - [`BurnsideMatrix(G): GrpPerm → AlgMatElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/subgroup.md#function-burnsidematrix-grpperm)
    - [`DisplayBurnsideMatrix(G): GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/subgroup.md#procedure-displayburnsidematrix-grpperm)
    - [`TableOfMarks(G): GrpPerm → AlgMatElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/subgroup.md#function-tableofmarks-grpperm)
  - [Classes of Subgroups Satisfying a Condition](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/subgroup.md#classes-of-subgroups-satisfying-a-condition)
    - [`NormalSubgroups(G: parameters): GrpPerm → [ rec< GrpPerm, RngIntElt, RngIntElt, GrpFP> ]`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/subgroup.md#function-normalsubgroups-grpperm)
    - [`ElementaryAbelianSubgroups(G: parameters): GrpPerm → [ rec< GrpPerm, RngIntElt, RngIntElt, GrpFP> ]`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/subgroup.md#function-elementaryabeliansubgroups-grpperm)
    - [`CyclicSubgroups(G: parameters): GrpPerm → [ rec< GrpPerm, RngIntElt, RngIntElt, GrpFP> ]`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/subgroup.md#function-cyclicsubgroups-grpperm)
    - [`AbelianSubgroups(G: parameters): GrpPerm → [ rec< GrpPerm, RngIntElt, RngIntElt, GrpFP> ]`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/subgroup.md#function-abeliansubgroups-grpperm)
    - [`NilpotentSubgroups(G: parameters): GrpPerm → [ rec< GrpPerm, RngIntElt, RngIntElt, GrpFP> ]`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/subgroup.md#function-nilpotentsubgroups-grpperm)
    - [`SolvableSubgroups(G: parameters): GrpPerm → [ rec< GrpPerm, RngIntElt, RngIntElt, GrpFP> ]`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/subgroup.md#function-solvablesubgroups-grpperm)
    - [`PerfectSubgroups(G: parameters): GrpPerm → [ rec< GrpPerm, RngIntElt, RngIntElt, GrpFP> ]`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/subgroup.md#function-perfectsubgroups-grpperm)
    - [`NonsolvableSubgroups(G: parameters): GrpPerm → [ rec< GrpPerm, RngIntElt, RngIntElt, GrpFP> ]`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/subgroup.md#function-nonsolvablesubgroups-grpperm)
    - [`SimpleSubgroups(G: parameters): GrpPerm → [ rec< GrpPerm, RngIntElt, RngIntElt, GrpFP> ]`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/subgroup.md#function-simplesubgroups-grpperm)
- [Quotient Groups](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/quotient.md)
  - [Construction of Quotient Groups](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/quotient.md#construction-of-quotient-groups)
    - [`quo<G | L>: GrpPerm, List → GrpPerm, Map`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/quotient.md#constructor-constructor-quo-grpperm-list-grpperm-map)
    - [`G / N: GrpPerm, GrpPerm → GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/quotient.md#operation-op-div-grpperm-grpperm)
    - [Example: Quotient of Sym(4) by the Klein Group](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/quotient.md#example-ex-d39a4a)
  - [Abelian, Nilpotent, and Soluble Quotients](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/quotient.md#abelian-nilpotent-and-soluble-quotients)
    - [`AbelianQuotient(G): GrpPerm → GrpAb, Map`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/quotient.md#function-abelianquotient-grpperm)
    - [`ElementaryAbelianQuotient(G, p): GrpPerm, RngIntElt → GrpAb, Map`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/quotient.md#function-elementaryabelianquotient-grpperm-rngintelt)
    - [`pQuotient(G, p, c): GrpPerm, RngIntElt, RngIntElt → GrpPC, Map, SeqEnum, BoolElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/quotient.md#function-pquotient-grpperm-rngintelt-rngintelt)
    - [`NilpotentQuotient(G, c): GrpPerm, RngIntElt → GrpGPC, Map`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/quotient.md#function-nilpotentquotient-grpperm-rngintelt)
    - [`SolvableQuotient(G): GrpPerm → GrpPC, Map, SeqEnum, MonStgElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/quotient.md#function-solvablequotient-grpperm)
    - [`SolubleQuotient(G): GrpPerm → GrpPC, Map, SeqEnum, MonStgElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/quotient.md#function-solublequotient-grpperm)
    - [Example: Soluble Quotient of a Wreath Product](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/quotient.md#example-ex-d5d186)
- [Permutation Group Actions](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/actions.md)
  - [$G$-Sets](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/actions.md#g-sets)
  - [Creating a $G$-Set](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/actions.md#creating-a-g-set)
    - [`GSetFromIndexed(G, Y): GrpPerm, SetIndx → GSet`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/actions.md#function-gsetfromindexed-grpperm-setindx)
    - [`GSet(G, X, Y): GrpPerm, GSet, SetEnum → GSet`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/actions.md#function-gset-grpperm-gset-setenum)
    - [`GSet(G, Y): GrpPerm, Set → GSet`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/actions.md#function-gset-grpperm-set)
    - [`GSet(G): GrpPerm → GSet`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/actions.md#function-gset-grpperm-2)
    - [`GSet(G, Y, f): GrpPerm, Set, Map → GSet`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/actions.md#function-gset-grpperm-set-map)
    - [`Action(Y): GSet → Map`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/actions.md#function-action-gset)
    - [`Group(Y): GSet → GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/actions.md#function-group-gset)
    - [`Labelling(G): GrpPerm → SetIndx`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/actions.md#function-labelling-grpperm)
    - [`Degree(g, Y): GrpPermElt, GSet → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/actions.md#function-degree-grppermelt-gset)
    - [`Degree(g): GrpPermElt → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/actions.md#function-degree-grppermelt-3)
    - [`Degree(G, Y): GrpPerm, GSet → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/actions.md#function-degree-grpperm-gset)
    - [`Degree(G): GrpPerm → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/actions.md#function-degree-grpperm)
    - [`Support(g, Y): GrpPermElt, GSet → { Elt }`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/actions.md#function-support-grppermelt-gset)
    - [`Support(g): GrpPermElt → { Elt }`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/actions.md#function-support-grppermelt)
    - [`Support(G, Y): GrpPerm, GSet → { Elt }`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/actions.md#function-support-grpperm-gset)
    - [`Support(G): GrpPerm → { Elt }`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/actions.md#function-support-grpperm)
    - [Example: G-Set with a User-Defined Action](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/actions.md#example-ex-5fb40e)
  - [Images, Orbits, and Stabilizers](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/actions.md#images-orbits-and-stabilizers)
    - [`x ^ g: Elt, GrpPermElt → Elt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/actions.md#operation-op-pow-elt-grppermelt)
    - [`Image(g, Y, y): GrpPermElt, GSet, Elt → Elt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/actions.md#function-image-grppermelt-gset-elt)
    - [`Image(g, y): GrpPermElt, Elt → Elt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/actions.md#function-image-grppermelt-elt)
    - [`Fix(g, Y): GrpPermElt, GSet → { Elt }`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/actions.md#function-fix-grppermelt-gset)
    - [`Fix(g): GrpPermElt → { Elt }`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/actions.md#function-fix-grppermelt)
    - [`Fix(G, Y): GrpPerm, GSet → { Elt }`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/actions.md#function-fix-grpperm-gset)
    - [`Fix(G): GrpPerm → { Elt }`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/actions.md#function-fix-grpperm)
    - [`x ^ G: Elt, GrpPerm → GSet`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/actions.md#operation-op-pow-elt-grpperm)
    - [`Cycle(e, x): GrpPermElt, Elt → SetIndx`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/actions.md#function-cycle-grppermelt-elt)
    - [`CycleDecomposition(e): GrpPermElt → SeqEnum[SetIndx]`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/actions.md#function-cycledecomposition-grppermelt)
    - [`Orbit(G, Y, y): GrpPerm, GSet, Elt → GSet`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/actions.md#function-orbit-grpperm-gset-elt)
    - [`Orbit(G, y): GrpPerm, Elt → GSet`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/actions.md#function-orbit-grpperm-elt)
    - [`Orbits(G, Y): GrpPerm, GSet → [ GSet ]`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/actions.md#function-orbits-grpperm-gset)
    - [`Orbits(G): GrpPerm → [ GSet ]`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/actions.md#function-orbits-grpperm)
    - [`OrbitRepresentatives(G): GrpPerm → SeqEnum`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/actions.md#function-orbitrepresentatives-grpperm)
    - [`OrbitClosure(G, Y, S): GrpPerm, GSet, { Elt } → GSet`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/actions.md#function-orbitclosure-grpperm-gset-elt)
    - [`OrbitClosure(G, S): GrpPerm, { Elt } → GSet`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/actions.md#function-orbitclosure-grpperm-elt)
    - [`IsConjugate(G, Y, y, z): GrpPerm, GSet, Elt, Elt → BoolElt, GrpPermElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/actions.md#function-isconjugate-grpperm-gset-elt-elt)
    - [`IsConjugate(G, y, z): GrpPerm, Elt, Elt → BoolElt, GrpPermElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/actions.md#function-isconjugate-grpperm-elt-elt)
    - [`Stabilizer(G, Y, y): GrpPerm, GSet, Elt → GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/actions.md#function-stabilizer-grpperm-gset-elt)
    - [`Stabiliser(G, Y, y): GrpPerm, GSet, Elt → GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/actions.md#function-stabiliser-grpperm-gset-elt)
    - [`Stabilizer(G, y): GrpPerm, Elt → GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/actions.md#function-stabilizer-grpperm-elt)
    - [`Stabiliser(G, y): GrpPerm, Elt → GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/actions.md#function-stabiliser-grpperm-elt)
    - [`TwoClosure(G): GrpPerm → GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/actions.md#function-twoclosure-grpperm)
    - [`IsPrimitive(G, Y): GrpPerm, GSet → BoolElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/actions.md#function-isprimitive-grpperm-gset)
    - [`IsPrimitive(G): GrpPerm → BoolElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/actions.md#function-isprimitive-grpperm)
    - [`IsTransitive(G, Y): GrpPerm, GSet → BoolElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/actions.md#function-istransitive-grpperm-gset)
    - [`IsTransitive(G): GrpPerm → BoolElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/actions.md#function-istransitive-grpperm)
    - [`IsTransitive(G, Y, k): GrpPerm, GSet, RngIntElt → BoolElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/actions.md#function-istransitive-grpperm-gset-rngintelt)
    - [`IsTransitive(G, k): GrpPerm, RngIntElt → BoolElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/actions.md#function-istransitive-grpperm-rngintelt)
    - [`IsSharplyTransitive(G, Y, k): GrpPerm, GSet, RngIntElt → BoolElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/actions.md#function-issharplytransitive-grpperm-gset-rngintelt)
    - [`IsSharplyTransitive(G, k): GrpPerm, RngIntElt → BoolElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/actions.md#function-issharplytransitive-grpperm-rngintelt)
    - [`Transitivity(G, Y): GrpPerm, GSet → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/actions.md#function-transitivity-grpperm-gset)
    - [`Transitivity(G): GrpPerm → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/actions.md#function-transitivity-grpperm)
    - [`Homogeneity(G): GrpPerm → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/actions.md#function-homogeneity-grpperm)
    - [`IsRegular(G, Y): GrpPerm, GSet → BoolElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/actions.md#function-isregular-grpperm-gset)
    - [`IsRegular(G): GrpPerm → BoolElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/actions.md#function-isregular-grpperm)
    - [`IsSemiregular(G, Y): GrpPerm, GSet → BoolElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/actions.md#function-issemiregular-grpperm-gset)
    - [`IsSemiregular(G): GrpPerm → BoolElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/actions.md#function-issemiregular-grpperm)
    - [`IsSemiregular(G, Y, S): GrpPerm, GSet, SetEnum → BoolElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/actions.md#function-issemiregular-grpperm-gset-setenum)
    - [`IsSemiregular(G, S): GrpPerm, SetEnum → BoolElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/actions.md#function-issemiregular-grpperm-setenum)
    - [`IsFrobenius(G): GrpPerm → BoolElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/actions.md#function-isfrobenius-grpperm)
    - [Example: Orbits and Stabilizers in M24](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/actions.md#example-ex-ca8a24)
  - [Action on a $G$-Space](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/actions.md#action-on-a-g-space)
    - [`Action(G, Y): GrpPerm, GSet → Hom(Grp), GrpPerm, GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/actions.md#function-action-grpperm-gset)
    - [`ActionImage(G, Y): GrpPerm, GSet → GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/actions.md#function-actionimage-grpperm-gset)
    - [`ActionKernel(G, Y): GrpPerm, GSet → GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/actions.md#function-actionkernel-grpperm-gset)
    - [`IsFaithful(G, Y): GrpPerm, GSet → BoolElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/actions.md#function-isfaithful-grpperm-gset)
    - [Example: Action of PSL(3, 4) on Flags](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/actions.md#example-ex-6c5cfe)
  - [Action on Orbits](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/actions.md#action-on-orbits)
    - [`OrbitAction(G, T): GrpPerm, GSet → Hom(Grp), GrpPerm, GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/actions.md#function-orbitaction-grpperm-gset)
    - [`OrbitImage(G, T): GrpPerm, GSet → GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/actions.md#function-orbitimage-grpperm-gset)
    - [`OrbitKernel(G, T): GrpPerm, GSet → GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/actions.md#function-orbitkernel-grpperm-gset)
    - [`IsOrbit(G, S): GrpPerm, { Elt } → BoolElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/actions.md#function-isorbit-grpperm-elt)
    - [Example: Actions on Orbits of an Intransitive Group](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/actions.md#example-ex-301205)
  - [Action on a G-invariant Partition](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/actions.md#action-on-a-g-invariant-partition)
    - [`IsBlock(G, S): GrpPerm, { Elt } → BoolElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/actions.md#function-isblock-grpperm-elt)
    - [`IsPrimitive(G): GrpPerm → BoolElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/actions.md#function-isprimitive-grpperm-2)
    - [`MaximalPartition(G): GrpPerm → GSet`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/actions.md#function-maximalpartition-grpperm)
    - [`MinimalPartition(G: parameters): GrpPerm → GSet`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/actions.md#function-minimalpartition-grpperm)
    - [`MinimalPartitions(G: parameters): GrpPerm → [ GSet ]`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/actions.md#function-minimalpartitions-grpperm)
    - [`MinimalBlocks(G: parameters): GrpPerm → [ SetEnum ]`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/actions.md#function-minimalblocks-grpperm)
    - [`AllPartitions(G): GrpPerm → SetEnum`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/actions.md#function-allpartitions-grpperm)
    - [`BlocksAction(G, P): GrpPerm, Any → Hom(GrpPerm), GrpPerm, GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/actions.md#function-blocksaction-grpperm-any)
    - [`BlocksAction(G, P): GrpPerm, GSet → Hom(GrpPerm), GrpPerm, GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/actions.md#function-blocksaction-grpperm-gset)
    - [`BlocksAction(G, P): GrpPerm, SeqEnum → Hom(GrpPerm), GrpPerm, GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/actions.md#function-blocksaction-grpperm-seqenum)
    - [`BlocksAction(G, P): GrpPerm, SetIndx → Hom(GrpPerm), GrpPerm, GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/actions.md#function-blocksaction-grpperm-setindx)
    - [`BlocksAction(G, P): GrpPerm, SetEnum → Hom(GrpPerm), GrpPerm, GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/actions.md#function-blocksaction-grpperm-setenum)
    - [`BlocksImage(G, P): GrpPerm, Any → GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/actions.md#function-blocksimage-grpperm-any)
    - [`BlocksImage(G, P): GrpPerm, GSet → GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/actions.md#function-blocksimage-grpperm-gset)
    - [`BlocksImage(G, P): GrpPerm, SetIndx → GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/actions.md#function-blocksimage-grpperm-setindx)
    - [`BlocksImage(G, P): GrpPerm, SeqEnum → GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/actions.md#function-blocksimage-grpperm-seqenum)
    - [`BlocksImage(G, P): GrpPerm, SetEnum → GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/actions.md#function-blocksimage-grpperm-setenum)
    - [`BlocksKernel(G, P): GrpPerm, Any → GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/actions.md#function-blockskernel-grpperm-any)
    - [`BlocksKernel(G, P): GrpPerm, GSet → GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/actions.md#function-blockskernel-grpperm-gset)
    - [`BlocksKernel(G, P): GrpPerm, SetIndx → GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/actions.md#function-blockskernel-grpperm-setindx)
    - [`BlocksKernel(G, P): GrpPerm, SeqEnum → GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/actions.md#function-blockskernel-grpperm-seqenum)
    - [`BlocksKernel(G, P): GrpPerm, SetEnum → GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/actions.md#function-blockskernel-grpperm-setenum)
    - [Example: Block Systems of an Imprimitive Group](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/actions.md#example-ex-da83a9)
    - [Example: Reducing to Primitive Components](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/actions.md#example-ex-c3774e)
  - [Action on a Coset Space](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/actions.md#action-on-a-coset-space)
    - [`CosetAction(G, H: parameters): Grp, Grp → Hom(Grp), GrpPerm, GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/actions.md#function-cosetaction-grp-grp)
    - [`RegularRepresentation(G, H: parameters): Grp, Grp → Hom(Grp), GrpPerm, GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/actions.md#function-regularrepresentation-grp-grp)
    - [`CosetImage(G, H: parameters): Grp, Grp → GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/actions.md#function-cosetimage-grp-grp)
    - [`CosetKernel(G, H): Grp, Grp → Grp`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/actions.md#function-cosetkernel-grp-grp)
  - [Reduced Permutation Actions](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/actions.md#reduced-permutation-actions)
    - [`TransitiveQuotient(G): GrpPerm → GrpPerm, Hom, GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/actions.md#function-transitivequotient-grpperm)
    - [`PrimitiveQuotient(G): GrpPerm → GrpPerm, Hom, GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/actions.md#function-primitivequotient-grpperm)
    - [`DegreeReduction(G): GrpPerm → GrpPerm, Hom`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/actions.md#function-degreereduction-grpperm)
  - [The Jellyfish Algorithm](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/actions.md#the-jellyfish-algorithm)
    - [`JellyfishConstruction(G: parameters): GrpPerm → BoolElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/actions.md#function-jellyfishconstruction-grpperm)
    - [`JellyfishImage(G): GrpPerm → GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/actions.md#function-jellyfishimage-grpperm)
    - [`JellyfishImage(G, x: parameters): GrpPerm, GrpPermElt → GrpPermElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/actions.md#function-jellyfishimage-grpperm-grppermelt)
    - [`JellyfishImage(G, H: parameters): GrpPerm, GrpPerm → GrpPermElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/actions.md#function-jellyfishimage-grpperm-grpperm)
    - [`JellyfishPreimage(G, x: parameters): GrpPerm, GrpPermElt → GrpPermElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/actions.md#function-jellyfishpreimage-grpperm-grppermelt)
    - [`JellyfishPreimage(G, I: parameters): GrpPerm, GrpPerm → GrpPermElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/actions.md#function-jellyfishpreimage-grpperm-grpperm)
- [Normal and Subnormal Subgroups](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/characteristic-subgroup-normal-structure.md)
  - [Characteristic Subgroups and Normal Series](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/characteristic-subgroup-normal-structure.md#characteristic-subgroups-and-normal-series)
    - [`DerivedSeries(G): GrpPerm → [ GrpPerm ]`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/characteristic-subgroup-normal-structure.md#function-grpperm-derivedseries)
    - [`CompositionSeries(G): GrpPerm → [ GrpPerm ]`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/characteristic-subgroup-normal-structure.md#function-compositionseries-grpperm)
    - [`CommutatorSubgroup(G): GrpPerm → GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/characteristic-subgroup-normal-structure.md#function-commutatorsubgroup-grpperm)
    - [`DerivedSubgroup(G): GrpPerm → GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/characteristic-subgroup-normal-structure.md#function-derivedsubgroup-grpperm)
    - [`DerivedGroup(G): GrpPerm → GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/characteristic-subgroup-normal-structure.md#function-derivedgroup-grpperm)
    - [`SolubleResidual(G): GrpPerm → GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/characteristic-subgroup-normal-structure.md#function-solubleresidual-grpperm)
    - [`SolvableResidual(G): GrpPerm → GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/characteristic-subgroup-normal-structure.md#function-solvableresidual-grpperm)
    - [`DerivedLength(G): GrpPerm → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/characteristic-subgroup-normal-structure.md#function-derivedlength-grpperm)
    - [`LowerCentralSeries(G): GrpPerm → [ GrpPerm ]`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/characteristic-subgroup-normal-structure.md#function-lowercentralseries-grpperm)
    - [`NilpotencyClass(G): GrpPerm → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/characteristic-subgroup-normal-structure.md#function-nilpotencyclass-grpperm)
    - [`UpperCentralSeries(G): GrpPerm → [ GrpPerm ]`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/characteristic-subgroup-normal-structure.md#function-uppercentralseries-grpperm)
    - [`Centre(G): GrpPerm → GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/characteristic-subgroup-normal-structure.md#function-centre-grpperm)
    - [`Center(G): GrpPerm → GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/characteristic-subgroup-normal-structure.md#function-center-grpperm)
    - [`Hypercentre(G): GrpPerm → GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/characteristic-subgroup-normal-structure.md#function-hypercentre-grpperm)
    - [`Hypercenter(G): GrpPerm → GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/characteristic-subgroup-normal-structure.md#function-hypercenter-grpperm)
    - [`pCore(G, p): GrpPerm, RngIntElt → GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/characteristic-subgroup-normal-structure.md#function-pcore-grpperm-rngintelt)
    - [`pCoreQuotient(G, p): GrpPerm, RngIntElt → GrpPerm, Map, GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/characteristic-subgroup-normal-structure.md#function-pcorequotient-grpperm-rngintelt)
    - [`FittingGroup(G): GrpPerm → GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/characteristic-subgroup-normal-structure.md#function-fittinggroup-grpperm)
    - [`FittingSubgroup(G): GrpPerm → GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/characteristic-subgroup-normal-structure.md#function-fittingsubgroup-grpperm)
    - [`FrattiniSubgroup(G): GrpPerm → GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/characteristic-subgroup-normal-structure.md#function-frattinisubgroup-grpperm)
    - [`JenningsSeries(G): GrpPerm → [ GrpPerm ]`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/characteristic-subgroup-normal-structure.md#function-jenningsseries-grpperm)
    - [`pCentralSeries(G, p): GrpPerm, RngIntElt → [ GrpPerm ]`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/characteristic-subgroup-normal-structure.md#function-pcentralseries-grpperm-rngintelt)
    - [`SubnormalSeries(G, H): GrpPerm, GrpPerm → [ GrpPerm ]`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/characteristic-subgroup-normal-structure.md#function-subnormalseries-grpperm-grpperm)
    - [Example: Series of a Soluble Wreath Product](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/characteristic-subgroup-normal-structure.md#example-ex-bfec16)
  - [Maximal and Minimal Normal Subgroups](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/characteristic-subgroup-normal-structure.md#maximal-and-minimal-normal-subgroups)
    - [`MaximalNormalSubgroup(G): GrpPerm → GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/characteristic-subgroup-normal-structure.md#function-maximalnormalsubgroup-grpperm)
    - [`MinimalNormalSubgroups(G): GrpPerm → [ GrpPerm ]`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/characteristic-subgroup-normal-structure.md#function-minimalnormalsubgroups-grpperm)
  - [Lattice of Normal Subgroups](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/characteristic-subgroup-normal-structure.md#lattice-of-normal-subgroups)
    - [`NormalSubgroups(G): GrpPerm → [ Rec ]`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/characteristic-subgroup-normal-structure.md#function-normalsubgroups-grpperm-2)
    - [`NormalLattice(G): GrpPerm → SubGrpLat`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/characteristic-subgroup-normal-structure.md#function-normallattice-grpperm)
    - [Example: Normal Subgroups of a Wreath Product](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/characteristic-subgroup-normal-structure.md#example-ex-7f08ec)
  - [Composition and Chief Series](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/characteristic-subgroup-normal-structure.md#composition-and-chief-series)
    - [`ChiefFactors(G): GrpPerm → [ <RngIntElt, RngIntElt, RngIntElt, RngIntElt> ]`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/characteristic-subgroup-normal-structure.md#function-chieffactors-grpperm)
    - [`ChiefSeries(G): GrpPerm → [ GrpPerm ], [ <RngIntElt, RngIntElt, RngIntElt, RngIntElt> ]`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/characteristic-subgroup-normal-structure.md#function-chiefseries-grpperm)
    - [`CompositionFactors(G): GrpPerm → [ <RngIntElt, RngIntElt, RngIntElt> ]`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/characteristic-subgroup-normal-structure.md#function-compositionfactors-grpperm)
    - [Example: Composition Factors of Rubik's Cube Group](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/characteristic-subgroup-normal-structure.md#example-ex-ea023a)
    - [`PrimaryAbelianInvariants(G): GrpPerm → [ RngIntElt ]`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/characteristic-subgroup-normal-structure.md#function-primaryabelianinvariants-grpperm)
    - [`AbelianInvariants(G): GrpPerm → [ RngIntElt ]`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/characteristic-subgroup-normal-structure.md#function-abelianinvariants-grpperm)
    - [`PrimaryAbelianBasis(G): GrpPerm → [ GrpPermElt ], [ RngIntElt ]`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/characteristic-subgroup-normal-structure.md#function-primaryabelianbasis-grpperm)
    - [`AbelianBasis(G): GrpPerm → [ GrpPermElt ], [ RngIntElt ]`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/characteristic-subgroup-normal-structure.md#function-abelianbasis-grpperm)
  - [The Socle](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/characteristic-subgroup-normal-structure.md#the-socle)
    - [`Socle(G): GrpPerm → GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/characteristic-subgroup-normal-structure.md#function-socle-grpperm)
    - [`SocleFactor(G): GrpPerm → GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/characteristic-subgroup-normal-structure.md#function-soclefactor-grpperm)
    - [`SocleFactors(G): GrpPerm → [ GrpPerm ]`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/characteristic-subgroup-normal-structure.md#function-soclefactors-grpperm)
    - [`SocleSeries(G): GrpPerm → [ GrpPerm ]`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/characteristic-subgroup-normal-structure.md#function-socleseries-grpperm)
    - [`EARNS(G): GrpPerm → GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/characteristic-subgroup-normal-structure.md#function-earns-grpperm)
    - [`AffineGeneralLinearGroup(E): GrpPerm → GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/characteristic-subgroup-normal-structure.md#function-affinegenerallineargroup-grpperm)
    - [`AGL(E): GrpPerm → GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/characteristic-subgroup-normal-structure.md#function-agl-grpperm)
    - [`IsAffine(G): GrpPerm → BoolElt, GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/characteristic-subgroup-normal-structure.md#function-isaffine-grpperm)
    - [`AffineAction(G): GrpPerm → Hom, GrpPerm, GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/characteristic-subgroup-normal-structure.md#function-affineaction-grpperm)
    - [`AffineImage(G): GrpPerm → GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/characteristic-subgroup-normal-structure.md#function-affineimage-grpperm)
    - [`AffineKernel(G): GrpPerm → GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/characteristic-subgroup-normal-structure.md#function-affinekernel-grpperm)
    - [`SocleAction(G): GrpPerm → Hom, GrpPerm, GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/characteristic-subgroup-normal-structure.md#function-socleaction-grpperm)
    - [`SocleImage(G): GrpPerm → GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/characteristic-subgroup-normal-structure.md#function-socleimage-grpperm)
    - [`SocleKernel(G): GrpPerm → GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/characteristic-subgroup-normal-structure.md#function-soclekernel-grpperm)
    - [`SocleQuotient(G): GrpPerm → GrpPerm, Hom, GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/characteristic-subgroup-normal-structure.md#function-soclequotient-grpperm)
    - [`RefineSection(G, M, N): GrpPerm, GrpPerm, GrpPerm → [ GrpPerm ]`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/characteristic-subgroup-normal-structure.md#function-refinesection-grpperm-grpperm-grpperm)
    - [Example: Normal Structure of a Primitive Group](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/characteristic-subgroup-normal-structure.md#example-ex-5535a8)
  - [The Soluble Radical and its Quotient](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/characteristic-subgroup-normal-structure.md#the-soluble-radical-and-its-quotient)
    - [`Radical(G): GrpPerm → GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/characteristic-subgroup-normal-structure.md#function-radical-grpperm)
    - [`SolubleRadical(G): GrpPerm → GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/characteristic-subgroup-normal-structure.md#function-solubleradical-grpperm)
    - [`SolvableRadical(G): GrpPerm → GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/characteristic-subgroup-normal-structure.md#function-solvableradical-grpperm)
    - [`RadicalQuotient(G): GrpPerm → GrpPerm, Hom(GrpPerm), GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/characteristic-subgroup-normal-structure.md#function-radicalquotient-grpperm)
    - [`ElementaryAbelianSeries(G: parameters): GrpPerm → [ GrpPerm ]`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/characteristic-subgroup-normal-structure.md#function-elementaryabelianseries-grpperm)
    - [`ElementaryAbelianSeries(G, N: parameters): GrpPerm, GrpPerm → [ GrpPerm ]`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/characteristic-subgroup-normal-structure.md#function-elementaryabelianseries-grpperm-grpperm)
    - [`ElementaryAbelianSeriesCanonical(G): GrpPerm → [ GrpPerm ]`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/characteristic-subgroup-normal-structure.md#function-elementaryabelianseriescanonical-grpperm)
    - [Example: Soluble Radical and Its Quotient](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/characteristic-subgroup-normal-structure.md#example-ex-034f3d)
  - [Complements and Supplements](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/characteristic-subgroup-normal-structure.md#complements-and-supplements)
    - [`Complements(G, M): GrpPerm, GrpPerm → [ GrpPerm ]`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/characteristic-subgroup-normal-structure.md#function-complements-grpperm-grpperm)
    - [`Complements(G, M, N): GrpPerm, GrpPerm, GrpPerm → [ GrpPerm ]`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/characteristic-subgroup-normal-structure.md#function-complements-grpperm-grpperm-grpperm)
    - [`HasComplement(G, M): GrpPerm, GrpPerm → BoolElt, GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/characteristic-subgroup-normal-structure.md#function-hascomplement-grpperm-grpperm)
    - [`Supplements(G, M): GrpPerm, GrpPerm → [ GrpPerm ]`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/characteristic-subgroup-normal-structure.md#function-supplements-grpperm-grpperm)
    - [`Supplements(G, M, N): GrpPerm, GrpPerm, GrpPerm → [ GrpPerm ]`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/characteristic-subgroup-normal-structure.md#function-supplements-grpperm-grpperm-grpperm)
    - [`HasSupplement(G, M): GrpPerm, GrpPerm → BoolElt, GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/characteristic-subgroup-normal-structure.md#function-hassupplement-grpperm-grpperm)
    - [Example: Complements of a Normal Subgroup](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/characteristic-subgroup-normal-structure.md#example-ex-f9be31)
  - [Abelian Normal Subgroups](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/characteristic-subgroup-normal-structure.md#abelian-normal-subgroups)
    - [`AbelianNormalSubgroup(G): GrpPerm → GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/characteristic-subgroup-normal-structure.md#function-abeliannormalsubgroup-grpperm)
    - [`AbelianNormalQuotient(G, H): GrpPerm, GrpPerm → GrpPerm, Hom(GrpPerm), GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/characteristic-subgroup-normal-structure.md#function-abeliannormalquotient-grpperm-grpperm)
    - [`SolubleNormalQuotient(G, H): GrpPerm → GrpPerm, Hom(GrpPerm), GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/characteristic-subgroup-normal-structure.md#function-solublenormalquotient-grpperm)
    - [`ElementaryAbelianNormalSubgroup(G): GrpPerm → GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/characteristic-subgroup-normal-structure.md#function-elementaryabeliannormalsubgroup-grpperm)
    - [`pElementaryAbelianNormalSubgroup(G, p): GrpPerm, RngIntElt → GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/characteristic-subgroup-normal-structure.md#function-pelementaryabeliannormalsubgroup-grpperm-rngintelt)
    - [`MEANS(G): GrpPerm → GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/characteristic-subgroup-normal-structure.md#function-means-grpperm)
    - [`MEANS(G, N): GrpPerm, GrpPerm → GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/characteristic-subgroup-normal-structure.md#function-means-grpperm-grpperm)
- [Cosets and Transversals](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/cosets-transversals.md)
  - [Cosets](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/cosets-transversals.md#cosets)
    - [`H * g: GrpPerm, GrpPermElt → Elt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/cosets-transversals.md#operation-op-times-grpperm-grppermelt)
    - [`DoubleCoset(G, H, g, K): GrpPerm, GrpPerm, GrpPermElt, GrpPerm → GrpPermDcosElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/cosets-transversals.md#function-doublecoset-grpperm-grpperm-grppermelt-grpperm)
    - [`DoubleCosetRepresentatives(G, H, K): GrpPerm, GrpPerm, GrpPerm → SeqEnum, SeqEnum`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/cosets-transversals.md#function-doublecosetrepresentatives-grpperm-grpperm-grpperm)
    - [`DoubleCosetCanonical(G, H, g, K: parameters): GrpPerm, GrpPerm, GrpPermElt, GrpPerm → SeqEnum, SeqEnum`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/cosets-transversals.md#function-doublecosetcanonical-grpperm-grpperm-grppermelt-grpperm)
    - [`ProcessLadder(L, G, U): [GrpPerm], GrpPerm, GrpPerm → Rec`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/cosets-transversals.md#function-processladder-grpperm-grpperm-grpperm)
    - [`GetRep(p, R): GrpPermElt, Rec → GrpPermElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/cosets-transversals.md#function-getrep-grppermelt-rec)
    - [`DeleteData(R): Rec`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/cosets-transversals.md#procedure-deletedata-rec)
    - [`YoungSubgroupLadder(L): [RngIntElt] → [GrpPerm]`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/cosets-transversals.md#function-youngsubgroupladder-rngintelt)
    - [`StabilizerLadder(G, d): GrpPerm, RngMPolElt → [GrpPerm]`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/cosets-transversals.md#function-stabilizerladder-grpperm-rngmpolelt)
    - [`x in C: GrpPermElt, Elt → BoolElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/cosets-transversals.md#operation-op-in-grppermelt-elt)
    - [`x notin C: GrpPermElt, Elt → BoolElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/cosets-transversals.md#operation-op-notin-grppermelt-elt)
    - [`C₁ eq C₂: Elt, Elt → BoolElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/cosets-transversals.md#operation-op-eq-elt-elt)
    - [`C₁ ne C₂: Elt, Elt → BoolElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/cosets-transversals.md#operation-op-ne-elt-elt)
    - [`# C: Elt → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/cosets-transversals.md#operation-operation-elt-rngintelt)
    - [`CosetTable(G, H): Grp, Grp → Map`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/cosets-transversals.md#function-cosettable-grp-grp)
    - [`CosetTable(G, f): Grp, Map → Map`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/cosets-transversals.md#function-cosettable-grp-map)
  - [Transversals](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/cosets-transversals.md#transversals)
    - [`Transversal(G, H): GrpPerm, GrpPerm → {@ GrpPermElt  @}, Map`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/cosets-transversals.md#function-transversal-grpperm-grpperm)
    - [`RightTransversal(G, H): GrpPerm, GrpPerm → {@ GrpPermElt  @}, Map`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/cosets-transversals.md#function-righttransversal-grpperm-grpperm)
    - [`TransversalProcess(G, H): GrpPerm, GrpPerm → GrpPermTransProc`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/cosets-transversals.md#function-transversalprocess-grpperm-grpperm)
    - [`TransversalProcessRemaining(P): GrpPermTransProc → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/cosets-transversals.md#function-transversalprocessremaining-grppermtransproc)
    - [`TransversalProcessNext(P): GrpPermTransProc → GrpPermElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/cosets-transversals.md#function-transversalprocessnext-grppermtransproc)
    - [`ShortCosets(p, H, G): GrpPermElt, GrpPerm, GrpPerm → [GrpPermElt]`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/cosets-transversals.md#function-shortcosets-grppermelt-grpperm-grpperm)
- [Presentations](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/presentations.md)
  - [Generators and Relations](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/presentations.md#generators-and-relations)
    - [`FPGroup(G): GrpPerm → GrpFP, Hom(Grp)`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/presentations.md#function-fpgroup-grpperm)
    - [`FPGroup(G, N): GrpPerm, GrpPerm → GrpFP, Hom(Grp)`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/presentations.md#function-fpgroup-grpperm-grpperm)
    - [`FPQuotient(G, N): GrpPerm, GrpPerm → GrpFP, Hom(Grp)`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/presentations.md#function-fpquotient-grpperm-grpperm)
    - [`FPGroupStrong(G: parameters): GrpPerm → GrpFP, Hom(Grp)`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/presentations.md#function-fpgroupstrong-grpperm)
  - [Permutations as Words](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/presentations.md#permutations-as-words)
    - [`WordGroup(G): GrpPerm → GrpBB, Map`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/presentations.md#function-wordgroup-grpperm)
    - [`InverseWordMap(G): GrpPerm → Map`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/presentations.md#function-inversewordmap-grpperm)
    - [`ActingWord(G, x, y): GrpPerm, Elt, Elt → GrpFPElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/presentations.md#function-actingword-grpperm-elt-elt)
    - [`WordInGenerators(G, g : parameters): GrpPerm, GrpPermElt → GrpFPElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/presentations.md#function-wordingenerators-grpperm-grppermelt)
- [Automorphism Groups](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/automorphisms.md)
  - [`AutomorphismGroup(G: parameters): GrpPerm → GrpAuto`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/automorphisms.md#function-automorphismgroup-grpperm)
  - [`IsIsomorphic(G, H: parameters): GrpPerm, GrpPerm → BoolElt, Hom(Grp)`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/automorphisms.md#function-isisomorphic-grpperm-grpperm)
  - [Example: Isomorphism Testing for Groups of Order 120](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/automorphisms.md#example-ex-c36bda)
- [Cohomology](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/cohomology.md)
  - [`pMultiplicator(G, p): GrpPerm, RngIntElt → [ RngIntElt ]`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/cohomology.md#function-pmultiplicator-grpperm-rngintelt)
  - [`pCover(G, F, p): GrpPerm, GrpFP, RngIntElt → GrpFP`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/cohomology.md#function-pcover-grpperm-grpfp-rngintelt)
  - [`CohomologicalDimension(G, M, i): GrpPerm, ModRng, RngIntElt → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/cohomology.md#function-cohomologicaldimension-grpperm-modrng-rngintelt)
  - [`ExtensionProcess(G, M, F): GrpPerm, ModRng, GrpFP → Process`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/cohomology.md#function-extensionprocess-grpperm-modrng-grpfp)
  - [`Extension(P, Q): Process → GrpFP`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/cohomology.md#function-extension-process)
  - [`NextExtension(P): Process → GrpFP`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/cohomology.md#function-nextextension-process)
  - [`SplitExtension(G, M, F): GrpPerm, ModRng, GrpFP → GrpFP`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/cohomology.md#function-splitextension-grpperm-modrng-grpfp)
  - [Example: Schur Cover Presentation of A6](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/cohomology.md#example-ex-5181ae)
  - [Example: Extension of A5 by a Permutation Module](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/cohomology.md#example-ex-d836b8)
- [Representation Theory](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/character-representation.md)
  - [`CharacterTable(G: parameters): GrpPerm → TabChtr`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/character-representation.md#function-charactertable-grpperm)
  - [`PermutationCharacter(G): GrpPerm → AlgChtrElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/character-representation.md#function-permutationcharacter-grpperm)
  - [`PermutationCharacter(G, H): GrpPerm, GrpPerm → AlgChtrElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/character-representation.md#function-permutationcharacter-grpperm-grpperm)
  - [`GModule(G, S): Grp, AlgMat → ModGrp`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/character-representation.md#function-gmodule-grp-algmat)
  - [`GModule(G, A, B): Grp, Grp, Grp → ModGrp, Map`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/character-representation.md#function-gmodule-grp-grp-grp)
  - [`PermutationModule(G, H, R): Grp, Grp, Rng → ModGrp`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/character-representation.md#function-permutationmodule-grp-grp-rng)
  - [`PermutationModule(G, R): GrpPerm, Rng → ModGrp`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/character-representation.md#function-permutationmodule-grpperm-rng)
  - [Example: Refining an Elementary Abelian Subgroup](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/character-representation.md#example-ex-7c0920)
- [Identification](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/identification.md)
  - [Identification as an Abstract Group](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/identification.md#identification-as-an-abstract-group)
    - [`NameSimple(G): GrpPerm → <RngIntElt, RngIntElt, RngIntElt>`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/identification.md#function-namesimple-grpperm)
  - [Identification as a Permutation Group](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/identification.md#identification-as-a-permutation-group)
    - [`IsAlternating(G): GrpPerm → BoolElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/identification.md#function-isalternating-grpperm)
    - [`IsSymmetric(G): GrpPerm → BoolElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/identification.md#function-issymmetric-grpperm)
    - [`IsAltsym(G : parameters): GrpPerm → BoolElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/identification.md#function-isaltsym-grpperm)
    - [`TwoTransitiveGroupIdentification(G): GrpPerm → Tup`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/identification.md#function-twotransitivegroupidentification-grpperm)
    - [`IsEven(G): GrpPerm → BoolElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/identification.md#function-iseven-grpperm)
    - [`RecogniseAlternatingOrSymmetric(G : parameters): Grp, RngIntElt → BoolElt, Map, Map, Map, Map, BoolElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/identification.md#function-recognisealternatingorsymmetric-grp-rngintelt)
    - [`AlternatingOrSymmetricElementToWord(G, g): Grp, GrpElt → BoolElt, GrpSLPElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/identification.md#function-alternatingorsymmetricelementtoword-grp-grpelt)
    - [Example: Recognising A13 in a Coset Action](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/identification.md#example-ex-29961f)
    - [`RecogniseSymmetric(G, n: parameters): Grp, RngIntElt → BoolElt, Map, Map, Map, Map, BoolElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/identification.md#function-recognisesymmetric-grp-rngintelt)
    - [`SymmetricElementToWord(G, g): Grp, GrpElt → BoolElt, GrpSLPElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/identification.md#function-symmetricelementtoword-grp-grpelt)
    - [`RecogniseAlternating(G, n: parameters): Grp, RngIntElt → BoolElt, Map, Map, Map, Map, BoolElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/identification.md#function-recognisealternating-grp-rngintelt)
    - [`AlternatingElementToWord(G, g): Grp, GrpElt → BoolElt, GrpSLPElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/identification.md#function-alternatingelementtoword-grp-grpelt)
    - [`GuessAltsymDegree(G: parameters): Grp → BoolElt, MonStgElt, RngIntElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/identification.md#function-guessaltsymdegree-grp)
    - [Example: Guessing an Alternating or Symmetric Degree](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/identification.md#example-ex-51196d)
- [Base and Strong Generating Set](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/BSGS-base-strong-generator.md)
  - [Construction of a Base and Strong Generating Set](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/BSGS-base-strong-generator.md#construction-of-a-base-and-strong-generating-set)
    - [`BSGS(G): GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/BSGS-base-strong-generator.md#procedure-bsgs-grpperm)
    - [`SimsSchreier(G: parameters): GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/BSGS-base-strong-generator.md#procedure-simsschreier-grpperm)
    - [`RandomSchreier(G: parameters): GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/BSGS-base-strong-generator.md#procedure-randomschreier-grpperm)
    - [`ToddCoxeterSchreier(G: parameters): GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/BSGS-base-strong-generator.md#procedure-toddcoxeterschreier-grpperm)
    - [`SolubleSchreier(G: parameters): GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/BSGS-base-strong-generator.md#procedure-solubleschreier-grpperm)
    - [`SolvableSchreier(G: parameters): GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/BSGS-base-strong-generator.md#procedure-solvableschreier-grpperm)
    - [`Verify(G: parameters ): GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/BSGS-base-strong-generator.md#procedure-verify-grpperm)
    - [Example: BSGS for the Higman-Sims Group](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/BSGS-base-strong-generator.md#example-ex-12dc1e)
    - [Example: BSGS for the Rudvalis Group](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/BSGS-base-strong-generator.md#example-ex-6e86d0)
  - [Defining Values for Attributes](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/BSGS-base-strong-generator.md#defining-values-for-attributes)
    - [`AssertAttribute(G, "Order", n): GrpPerm, MonStgElt, RngIntElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/BSGS-base-strong-generator.md#procedure-assertattribute-grpperm-monstgelt-rngintelt-order)
    - [`AssertAttribute(G, "Order", Q): GrpPerm, MonStgElt, [<RngIntElt, RngIntElt>]`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/BSGS-base-strong-generator.md#procedure-assertattribute-grpperm-monstgelt-rngintelt-rngintelt-order)
    - [`AssertAttribute(G, "BSGS", S): GrpPerm, MonStgElt, GrpPermBSGS`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/BSGS-base-strong-generator.md#procedure-assertattribute-grpperm-monstgelt-grppermbsgs-bsgs)
    - [Example: Random Schreier-Sims with Known Order](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/BSGS-base-strong-generator.md#example-ex-f89434)
  - [Accessing the Base and Strong Generating Set](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/BSGS-base-strong-generator.md#accessing-the-base-and-strong-generating-set)
    - [`Base(G): GrpPerm → [Elt]`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/BSGS-base-strong-generator.md#function-base-grpperm)
    - [`BasePoint(G, i): GrpPerm, RngIntElt → Elt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/BSGS-base-strong-generator.md#function-basepoint-grpperm-rngintelt)
    - [`BasicOrbit(G, i): GrpPerm, RngIntElt → SetIndx`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/BSGS-base-strong-generator.md#function-basicorbit-grpperm-rngintelt)
    - [`BasicOrbits(G): GrpPerm → [SetIndx]`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/BSGS-base-strong-generator.md#function-basicorbits-grpperm)
    - [`BasicOrbitLength(G, i): GrpPerm, RngIntElt → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/BSGS-base-strong-generator.md#function-basicorbitlength-grpperm-rngintelt)
    - [`BasicOrbitLengths(G): GrpPerm → [RngIntElt]`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/BSGS-base-strong-generator.md#function-basicorbitlengths-grpperm)
    - [`BasicStabilizer(G, i): GrpPerm, RngIntElt → GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/BSGS-base-strong-generator.md#function-basicstabilizer-grpperm-rngintelt)
    - [`BasicStabiliser(G, i): GrpPerm, RngIntElt → GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/BSGS-base-strong-generator.md#function-basicstabiliser-grpperm-rngintelt)
    - [`BasicStabilizerChain(G): GrpPerm → [GrpPerm]`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/BSGS-base-strong-generator.md#function-basicstabilizerchain-grpperm)
    - [`BasicStabiliserChain(G): GrpPerm → [GrpPerm]`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/BSGS-base-strong-generator.md#function-basicstabiliserchain-grpperm)
    - [`IsMemberBasicOrbit(G, i, a): GrpPerm, RngIntElt, Elt → BoolElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/BSGS-base-strong-generator.md#function-ismemberbasicorbit-grpperm-rngintelt-elt)
    - [`NumberOfStrongGenerators(G): GrpPerm → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/BSGS-base-strong-generator.md#function-numberofstronggenerators-grpperm)
    - [`Nsgens(G): GrpPerm → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/BSGS-base-strong-generator.md#function-nsgens-grpperm)
    - [`NumberOfStrongGenerators(G, i): GrpPerm, RngIntElt → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/BSGS-base-strong-generator.md#function-numberofstronggenerators-grpperm-rngintelt)
    - [`Nsgens(G, i): GrpPerm, RngIntElt → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/BSGS-base-strong-generator.md#function-nsgens-grpperm-rngintelt)
    - [`SchreierVectors(G): GrpPerm → [ [RngIntElt] ]`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/BSGS-base-strong-generator.md#function-schreiervectors-grpperm)
    - [`SchreierVector(G, i): GrpPerm, RngIntElt → [RngIntElt]`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/BSGS-base-strong-generator.md#function-schreiervector-grpperm-rngintelt)
    - [`StrongGenerators(G): GrpPerm → SetIndx(GrpPermElt)`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/BSGS-base-strong-generator.md#function-stronggenerators-grpperm)
    - [`StrongGenerators(G, i): GrpPerm, RngIntElt → SetIndx(GrpPermElt)`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/BSGS-base-strong-generator.md#function-stronggenerators-grpperm-rngintelt)
  - [Working with a Base and Strong Generating Set](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/BSGS-base-strong-generator.md#working-with-a-base-and-strong-generating-set)
    - [`BaseImage(x): GrpPermElt → [Elt]`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/BSGS-base-strong-generator.md#function-baseimage-grppermelt)
    - [`Permutation(G, Q): GrpPerm, [Elt] → GrpPermElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/BSGS-base-strong-generator.md#function-permutation-grpperm-elt)
    - [`SVPermutation(G, i, a): GrpPerm, RngIntElt, Elt → GrpPermElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/BSGS-base-strong-generator.md#function-svpermutation-grpperm-rngintelt-elt)
    - [`SVWord(G, i, a): GrpPerm, RngIntElt, Elt → GrpFPElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/BSGS-base-strong-generator.md#function-svword-grpperm-rngintelt-elt)
    - [`Strip(H, x): GrpPerm, GrpPermElt → BoolElt, GrpPermElt, RngIntElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/BSGS-base-strong-generator.md#function-strip-grpperm-grppermelt)
    - [`WordStrip(H, x): GrpPerm, GrpPermElt → BoolElt, GrpFPElt, RngIntElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/BSGS-base-strong-generator.md#function-wordstrip-grpperm-grppermelt)
    - [`BaseImageWordStrip(H, x): GrpPerm, GrpPermElt → BoolElt, GrpFPElt, RngIntElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/BSGS-base-strong-generator.md#function-baseimagewordstrip-grpperm-grppermelt)
    - [`WordInStrongGenerators(H, x): GrpPerm, GrpPermElt → GrpFPElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/BSGS-base-strong-generator.md#function-wordinstronggenerators-grpperm-grppermelt)
  - [Modifying a Base and Strong Generating Set](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/BSGS-base-strong-generator.md#modifying-a-base-and-strong-generating-set)
    - [`ChangeBase(~G, Q): GrpPerm, [Elt]`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/BSGS-base-strong-generator.md#procedure-changebase-grpperm-elt-ref)
    - [`AddNormalizingGenerator(~H, x): GrpPerm, GrpPermElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/BSGS-base-strong-generator.md#procedure-addnormalizinggenerator-grpperm-grppermelt-ref)
    - [`ReduceGenerators(~G): GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/BSGS-base-strong-generator.md#procedure-reducegenerators-grpperm-ref)
- [Permutation Representations of Linear Groups](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md)
  - [`AffineGeneralLinearGroup(arguments)`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#literal-literal-affinegenerallineargroup-affinegenerallineargroup-arguments)
  - [`AGL(arguments)`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#literal-literal-agl-agl-arguments)
  - [`AffineGeneralLinearGroup(n, q): RngIntElt, RngIntElt → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-affinegenerallineargroup-rngintelt-rngintelt)
  - [`AffineGeneralLinearGroup(n, K): RngIntElt, FldFin → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-affinegenerallineargroup-rngintelt-fldfin)
  - [`AffineGeneralLinearGroup(V): ModTupRng → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-affinegenerallineargroup-modtuprng)
  - [`AGL(n, q): RngIntElt, RngIntElt → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-agl-rngintelt-rngintelt)
  - [`AGL(n, K): RngIntElt, FldFin → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-agl-rngintelt-fldfin)
  - [`AGL(V): ModTupRng → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-agl-modtuprng)
  - [`AffineSpecialLinearGroup(arguments)`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#literal-literal-affinespeciallineargroup-affinespeciallineargroup-arguments)
  - [`ASL(arguments)`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#literal-literal-asl-asl-arguments)
  - [`AffineSpecialLinearGroup(n, q): RngIntElt, RngIntElt → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-affinespeciallineargroup-rngintelt-rngintelt)
  - [`AffineSpecialLinearGroup(n, K): RngIntElt, FldFin → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-affinespeciallineargroup-rngintelt-fldfin)
  - [`AffineSpecialLinearGroup(V): ModTupRng → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-affinespeciallineargroup-modtuprng)
  - [`ASL(n, q): RngIntElt, RngIntElt → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-asl-rngintelt-rngintelt)
  - [`ASL(n, K): RngIntElt, FldFin → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-asl-rngintelt-fldfin)
  - [`ASL(V): ModTupRng → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-asl-modtuprng)
  - [`AffineGammaLinearGroup(arguments)`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#literal-literal-affinegammalineargroup-affinegammalineargroup-arguments)
  - [`AGammaL(arguments)`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#literal-literal-agammal-agammal-arguments)
  - [`AffineGammaLinearGroup(n, q): RngIntElt, RngIntElt → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-affinegammalineargroup-rngintelt-rngintelt)
  - [`AffineGammaLinearGroup(n, K): RngIntElt, FldFin → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-affinegammalineargroup-rngintelt-fldfin)
  - [`AffineGammaLinearGroup(V): ModTupRng → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-affinegammalineargroup-modtuprng)
  - [`AGammaL(n, q): RngIntElt, RngIntElt → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-agammal-rngintelt-rngintelt)
  - [`AGammaL(n, K): RngIntElt, FldFin → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-agammal-rngintelt-fldfin)
  - [`AGammaL(V): ModTupRng → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-agammal-modtuprng)
  - [`AffineSigmaLinearGroup(arguments)`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#literal-literal-affinesigmalineargroup-affinesigmalineargroup-arguments)
  - [`ASigmaL(arguments)`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#literal-literal-asigmal-asigmal-arguments)
  - [`AffineSigmaLinearGroup(n, q): RngIntElt, RngIntElt → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-affinesigmalineargroup-rngintelt-rngintelt)
  - [`AffineSigmaLinearGroup(n, K): RngIntElt, FldFin → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-affinesigmalineargroup-rngintelt-fldfin)
  - [`AffineSigmaLinearGroup(V): ModTupRng → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-affinesigmalineargroup-modtuprng)
  - [`ASigmaL(n, q): RngIntElt, RngIntElt → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-asigmal-rngintelt-rngintelt)
  - [`ASigmaL(n, K): RngIntElt, FldFin → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-asigmal-rngintelt-fldfin)
  - [`ASigmaL(V): ModTupRng → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-asigmal-modtuprng)
  - [`AffineSymplecticGroup(arguments)`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#literal-literal-affinesymplecticgroup-affinesymplecticgroup-arguments)
  - [`ASp(arguments)`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#literal-literal-asp-asp-arguments)
  - [`AffineSymplecticGroup(n, q): RngIntElt, RngIntElt → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-affinesymplecticgroup-rngintelt-rngintelt)
  - [`AffineSymplecticGroup(n, K): RngIntElt, FldFin → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-affinesymplecticgroup-rngintelt-fldfin)
  - [`AffineSymplecticGroup(V): ModTupRng → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-affinesymplecticgroup-modtuprng)
  - [`ASp(n, q): RngIntElt, RngIntElt → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-asp-rngintelt-rngintelt)
  - [`ASp(n, K): RngIntElt, FldFin → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-asp-rngintelt-fldfin)
  - [`ASp(V): ModTupRng → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-asp-modtuprng)
  - [`AffineSigmaSymplecticGroup(arguments)`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#literal-literal-affinesigmasymplecticgroup-affinesigmasymplecticgroup-arguments)
  - [`ASigmaSp(arguments)`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#literal-literal-asigmasp-asigmasp-arguments)
  - [`AffineSigmaSymplecticGroup(n, q): RngIntElt, RngIntElt → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-affinesigmasymplecticgroup-rngintelt-rngintelt)
  - [`AffineSigmaSymplecticGroup(n, K): RngIntElt, FldFin → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-affinesigmasymplecticgroup-rngintelt-fldfin)
  - [`AffineSigmaSymplecticGroup(V): ModTupRng → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-affinesigmasymplecticgroup-modtuprng)
  - [`ASigmaSp(n, q): RngIntElt, RngIntElt → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-asigmasp-rngintelt-rngintelt)
  - [`ASigmaSp(n, K): RngIntElt, FldFin → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-asigmasp-rngintelt-fldfin)
  - [`ASigmaSp(V): ModTupRng → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-asigmasp-modtuprng)
  - [`ProjectiveGeneralLinearGroup(arguments)`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#literal-literal-projectivegenerallineargroup-projectivegenerallineargroup-arguments)
  - [`PGL(arguments)`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#literal-literal-pgl-pgl-arguments)
  - [`ProjectiveGeneralLinearGroup(n, q): RngIntElt, RngIntElt → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-projectivegenerallineargroup-rngintelt-rngintelt)
  - [`ProjectiveGeneralLinearGroup(n, K): RngIntElt, FldFin → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-projectivegenerallineargroup-rngintelt-fldfin)
  - [`ProjectiveGeneralLinearGroup(V): ModTupRng → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-projectivegenerallineargroup-modtuprng)
  - [`PGL(n, q): RngIntElt, RngIntElt → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-pgl-rngintelt-rngintelt)
  - [`PGL(n, K): RngIntElt, FldFin → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-pgl-rngintelt-fldfin)
  - [`PGL(V): ModTupRng → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-pgl-modtuprng)
  - [`ProjectiveSpecialLinearGroup(arguments)`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#literal-literal-projectivespeciallineargroup-projectivespeciallineargroup-arguments)
  - [`PSL(arguments)`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#literal-literal-psl-psl-arguments)
  - [`ProjectiveSpecialLinearGroup(n, q): RngIntElt, RngIntElt → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-projectivespeciallineargroup-rngintelt-rngintelt)
  - [`ProjectiveSpecialLinearGroup(n, K): RngIntElt, FldFin → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-projectivespeciallineargroup-rngintelt-fldfin)
  - [`ProjectiveSpecialLinearGroup(V): ModTupRng → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-projectivespeciallineargroup-modtuprng)
  - [`PSL(n, q): RngIntElt, RngIntElt → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-psl-rngintelt-rngintelt)
  - [`PSL(n, K): RngIntElt, FldFin → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-psl-rngintelt-fldfin)
  - [`PSL(V): ModTupRng → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-psl-modtuprng)
  - [`ProjectiveGammaLinearGroup(arguments)`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#literal-literal-projectivegammalineargroup-projectivegammalineargroup-arguments)
  - [`PGammaL(arguments)`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#literal-literal-pgammal-pgammal-arguments)
  - [`ProjectiveGammaLinearGroup(n, q): RngIntElt, RngIntElt → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-projectivegammalineargroup-rngintelt-rngintelt)
  - [`ProjectiveGammaLinearGroup(n, K): RngIntElt, FldFin → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-projectivegammalineargroup-rngintelt-fldfin)
  - [`ProjectiveGammaLinearGroup(V): ModTupRng → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-projectivegammalineargroup-modtuprng)
  - [`PGammaL(n, q): RngIntElt, RngIntElt → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-pgammal-rngintelt-rngintelt)
  - [`PGammaL(n, K): RngIntElt, FldFin → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-pgammal-rngintelt-fldfin)
  - [`PGammaL(V): ModTupRng → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-pgammal-modtuprng)
  - [`ProjectiveSigmaLinearGroup(arguments)`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#literal-literal-projectivesigmalineargroup-projectivesigmalineargroup-arguments)
  - [`PSigmaL(arguments)`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#literal-literal-psigmal-psigmal-arguments)
  - [`ProjectiveSigmaLinearGroup(n, q): RngIntElt, RngIntElt → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-projectivesigmalineargroup-rngintelt-rngintelt)
  - [`ProjectiveSigmaLinearGroup(n, K): RngIntElt, FldFin → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-projectivesigmalineargroup-rngintelt-fldfin)
  - [`ProjectiveSigmaLinearGroup(V): ModTupRng → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-projectivesigmalineargroup-modtuprng)
  - [`PSigmaL(n, q): RngIntElt, RngIntElt → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-psigmal-rngintelt-rngintelt)
  - [`PSigmaL(n, K): RngIntElt, FldFin → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-psigmal-rngintelt-fldfin)
  - [`PSigmaL(V): ModTupRng → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-psigmal-modtuprng)
  - [`ProjectiveGeneralUnitaryGroup(arguments)`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#literal-literal-projectivegeneralunitarygroup-projectivegeneralunitarygroup-arguments)
  - [`PGU(arguments)`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#literal-literal-pgu-pgu-arguments)
  - [`ProjectiveGeneralUnitaryGroup(n, q): RngIntElt, RngIntElt → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-projectivegeneralunitarygroup-rngintelt-rngintelt)
  - [`ProjectiveGeneralUnitaryGroup(n, K): RngIntElt, FldFin → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-projectivegeneralunitarygroup-rngintelt-fldfin)
  - [`ProjectiveGeneralUnitaryGroup(V): ModTupRng → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-projectivegeneralunitarygroup-modtuprng)
  - [`PGU(n, q): RngIntElt, RngIntElt → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-pgu-rngintelt-rngintelt)
  - [`PGU(n, K): RngIntElt, FldFin → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-pgu-rngintelt-fldfin)
  - [`PGU(V): ModTupRng → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-pgu-modtuprng)
  - [`ProjectiveSpecialUnitaryGroup(arguments)`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#literal-literal-projectivespecialunitarygroup-projectivespecialunitarygroup-arguments)
  - [`PSU(arguments)`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#literal-literal-psu-psu-arguments)
  - [`ProjectiveSpecialUnitaryGroup(n, q): RngIntElt, RngIntElt → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-projectivespecialunitarygroup-rngintelt-rngintelt)
  - [`ProjectiveSpecialUnitaryGroup(n, K): RngIntElt, FldFin → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-projectivespecialunitarygroup-rngintelt-fldfin)
  - [`ProjectiveSpecialUnitaryGroup(V): ModTupRng → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-projectivespecialunitarygroup-modtuprng)
  - [`PSU(n, q): RngIntElt, RngIntElt → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-psu-rngintelt-rngintelt)
  - [`PSU(n, K): RngIntElt, FldFin → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-psu-rngintelt-fldfin)
  - [`PSU(V): ModTupRng → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-psu-modtuprng)
  - [`ProjectiveGammaUnitaryGroup(arguments)`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#literal-literal-projectivegammaunitarygroup-projectivegammaunitarygroup-arguments)
  - [`PGammaU(arguments)`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#literal-literal-pgammau-pgammau-arguments)
  - [`ProjectiveGammaUnitaryGroup(n, q): RngIntElt, RngIntElt → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-projectivegammaunitarygroup-rngintelt-rngintelt)
  - [`ProjectiveGammaUnitaryGroup(n, K): RngIntElt, FldFin → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-projectivegammaunitarygroup-rngintelt-fldfin)
  - [`ProjectiveGammaUnitaryGroup(V): ModTupRng → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-projectivegammaunitarygroup-modtuprng)
  - [`PGammaU(n, q): RngIntElt, RngIntElt → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-pgammau-rngintelt-rngintelt)
  - [`PGammaU(n, K): RngIntElt, FldFin → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-pgammau-rngintelt-fldfin)
  - [`PGammaU(V): ModTupRng → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-pgammau-modtuprng)
  - [`ProjectiveSigmaUnitaryGroup(arguments)`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#literal-literal-projectivesigmaunitarygroup-projectivesigmaunitarygroup-arguments)
  - [`PSigmaU(arguments)`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#literal-literal-psigmau-psigmau-arguments)
  - [`ProjectiveSigmaUnitaryGroup(n, q): RngIntElt, RngIntElt → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-projectivesigmaunitarygroup-rngintelt-rngintelt)
  - [`ProjectiveSigmaUnitaryGroup(n, K): RngIntElt, FldFin → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-projectivesigmaunitarygroup-rngintelt-fldfin)
  - [`ProjectiveSigmaUnitaryGroup(V): ModTupRng → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-projectivesigmaunitarygroup-modtuprng)
  - [`PSigmaU(n, q): RngIntElt, RngIntElt → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-psigmau-rngintelt-rngintelt)
  - [`PSigmaU(n, K): RngIntElt, FldFin → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-psigmau-rngintelt-fldfin)
  - [`PSigmaU(V): ModTupRng → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-psigmau-modtuprng)
  - [`ProjectiveSymplecticGroup(arguments)`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#literal-literal-projectivesymplecticgroup-projectivesymplecticgroup-arguments)
  - [`PSp(arguments)`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#literal-literal-psp-psp-arguments)
  - [`ProjectiveSymplecticGroup(n, q): RngIntElt, RngIntElt → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-projectivesymplecticgroup-rngintelt-rngintelt)
  - [`ProjectiveSymplecticGroup(n, K): RngIntElt, FldFin → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-projectivesymplecticgroup-rngintelt-fldfin)
  - [`ProjectiveSymplecticGroup(V): ModTupRng → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-projectivesymplecticgroup-modtuprng)
  - [`PSp(n, q): RngIntElt, RngIntElt → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-psp-rngintelt-rngintelt)
  - [`PSp(n, K): RngIntElt, FldFin → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-psp-rngintelt-fldfin)
  - [`PSp(V): ModTupRng → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-psp-modtuprng)
  - [`ProjectiveSigmaSymplecticGroup(arguments)`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#literal-literal-projectivesigmasymplecticgroup-projectivesigmasymplecticgroup-arguments)
  - [`PSigmaSp(arguments)`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#literal-literal-psigmasp-psigmasp-arguments)
  - [`ProjectiveSigmaSymplecticGroup(n, q): RngIntElt, RngIntElt → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-projectivesigmasymplecticgroup-rngintelt-rngintelt)
  - [`ProjectiveSigmaSymplecticGroup(n, K): RngIntElt, FldFin → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-projectivesigmasymplecticgroup-rngintelt-fldfin)
  - [`ProjectiveSigmaSymplecticGroup(V): ModTupRng → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-projectivesigmasymplecticgroup-modtuprng)
  - [`PSigmaSp(n, q): RngIntElt, RngIntElt → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-psigmasp-rngintelt-rngintelt)
  - [`PSigmaSp(n, K): RngIntElt, FldFin → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-psigmasp-rngintelt-fldfin)
  - [`PSigmaSp(V): ModTupRng → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-psigmasp-modtuprng)
  - [`ProjectiveGeneralOrthogonalGroup(arguments)`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#literal-literal-projectivegeneralorthogonalgroup-projectivegeneralorthogonalgroup-arguments)
  - [`PGO(arguments)`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#literal-literal-pgo-pgo-arguments)
  - [`ProjectiveGeneralOrthogonalGroup(n, q): RngIntElt, RngIntElt → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-projectivegeneralorthogonalgroup-rngintelt-rngintelt)
  - [`ProjectiveGeneralOrthogonalGroup(n, K): RngIntElt, FldFin → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-projectivegeneralorthogonalgroup-rngintelt-fldfin)
  - [`ProjectiveGeneralOrthogonalGroup(V): ModTupRng → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-projectivegeneralorthogonalgroup-modtuprng)
  - [`PGO(n, q): RngIntElt, RngIntElt → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-pgo-rngintelt-rngintelt)
  - [`PGO(n, K): RngIntElt, FldFin → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-pgo-rngintelt-fldfin)
  - [`PGO(V): ModTupRng → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-pgo-modtuprng)
  - [`ProjectiveGeneralOrthogonalGroupPlus(arguments)`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#literal-literal-projectivegeneralorthogonalgroupplus-projectivegeneralorthogonalgroupplus-arguments)
  - [`PGOPlus(arguments)`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#literal-literal-pgoplus-pgoplus-arguments)
  - [`ProjectiveGeneralOrthogonalGroupPlus(n, q): RngIntElt, RngIntElt → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-projectivegeneralorthogonalgroupplus-rngintelt-rngintelt)
  - [`ProjectiveGeneralOrthogonalGroupPlus(n, K): RngIntElt, FldFin → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-projectivegeneralorthogonalgroupplus-rngintelt-fldfin)
  - [`ProjectiveGeneralOrthogonalGroupPlus(V): ModTupRng → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-projectivegeneralorthogonalgroupplus-modtuprng)
  - [`PGOPlus(n, q): RngIntElt, RngIntElt → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-pgoplus-rngintelt-rngintelt)
  - [`PGOPlus(n, K): RngIntElt, FldFin → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-pgoplus-rngintelt-fldfin)
  - [`PGOPlus(V): ModTupRng → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-pgoplus-modtuprng)
  - [`ProjectiveGeneralOrthogonalGroupMinus(arguments)`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#literal-literal-projectivegeneralorthogonalgroupminus-projectivegeneralorthogonalgroupminus-arguments)
  - [`PGOMinus(arguments)`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#literal-literal-pgominus-pgominus-arguments)
  - [`ProjectiveGeneralOrthogonalGroupMinus(n, q): RngIntElt, RngIntElt → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-projectivegeneralorthogonalgroupminus-rngintelt-rngintelt)
  - [`ProjectiveGeneralOrthogonalGroupMinus(n, K): RngIntElt, FldFin → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-projectivegeneralorthogonalgroupminus-rngintelt-fldfin)
  - [`ProjectiveGeneralOrthogonalGroupMinus(V): ModTupRng → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-projectivegeneralorthogonalgroupminus-modtuprng)
  - [`PGOMinus(n, q): RngIntElt, RngIntElt → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-pgominus-rngintelt-rngintelt)
  - [`PGOMinus(n, K): RngIntElt, FldFin → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-pgominus-rngintelt-fldfin)
  - [`PGOMinus(V): ModTupRng → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-pgominus-modtuprng)
  - [`ProjectiveSpecialOrthogonalGroup(arguments)`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#literal-literal-projectivespecialorthogonalgroup-projectivespecialorthogonalgroup-arguments)
  - [`PSO(arguments)`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#literal-literal-pso-pso-arguments)
  - [`ProjectiveSpecialOrthogonalGroup(n, q): RngIntElt, RngIntElt → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-projectivespecialorthogonalgroup-rngintelt-rngintelt)
  - [`ProjectiveSpecialOrthogonalGroup(n, K): RngIntElt, FldFin → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-projectivespecialorthogonalgroup-rngintelt-fldfin)
  - [`ProjectiveSpecialOrthogonalGroup(V): ModTupRng → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-projectivespecialorthogonalgroup-modtuprng)
  - [`PSO(n, q): RngIntElt, RngIntElt → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-pso-rngintelt-rngintelt)
  - [`PSO(n, K): RngIntElt, FldFin → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-pso-rngintelt-fldfin)
  - [`PSO(V): ModTupRng → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-pso-modtuprng)
  - [`ProjectiveSpecialOrthogonalGroupPlus(arguments)`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#literal-literal-projectivespecialorthogonalgroupplus-projectivespecialorthogonalgroupplus-arguments)
  - [`PSOPlus(arguments)`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#literal-literal-psoplus-psoplus-arguments)
  - [`ProjectiveSpecialOrthogonalGroupPlus(n, q): RngIntElt, RngIntElt → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-projectivespecialorthogonalgroupplus-rngintelt-rngintelt)
  - [`ProjectiveSpecialOrthogonalGroupPlus(n, K): RngIntElt, FldFin → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-projectivespecialorthogonalgroupplus-rngintelt-fldfin)
  - [`ProjectiveSpecialOrthogonalGroupPlus(V): ModTupRng → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-projectivespecialorthogonalgroupplus-modtuprng)
  - [`PSOPlus(n, q): RngIntElt, RngIntElt → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-psoplus-rngintelt-rngintelt)
  - [`PSOPlus(n, K): RngIntElt, FldFin → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-psoplus-rngintelt-fldfin)
  - [`PSOPlus(V): ModTupRng → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-psoplus-modtuprng)
  - [`ProjectiveSpecialOrthogonalGroupMinus(arguments)`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#literal-literal-projectivespecialorthogonalgroupminus-projectivespecialorthogonalgroupminus-arguments)
  - [`PSOMinus(arguments)`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#literal-literal-psominus-psominus-arguments)
  - [`ProjectiveSpecialOrthogonalGroupMinus(n, q): RngIntElt, RngIntElt → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-projectivespecialorthogonalgroupminus-rngintelt-rngintelt)
  - [`ProjectiveSpecialOrthogonalGroupMinus(n, K): RngIntElt, FldFin → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-projectivespecialorthogonalgroupminus-rngintelt-fldfin)
  - [`ProjectiveSpecialOrthogonalGroupMinus(V): ModTupRng → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-projectivespecialorthogonalgroupminus-modtuprng)
  - [`PSOMinus(n, q): RngIntElt, RngIntElt → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-psominus-rngintelt-rngintelt)
  - [`PSOMinus(n, K): RngIntElt, FldFin → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-psominus-rngintelt-fldfin)
  - [`PSOMinus(V): ModTupRng → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-psominus-modtuprng)
  - [`ProjectiveOmega(arguments)`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#literal-literal-projectiveomega-projectiveomega-arguments)
  - [`POmega(arguments)`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#literal-literal-pomega-pomega-arguments)
  - [`ProjectiveOmega(n, q): RngIntElt, RngIntElt → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-projectiveomega-rngintelt-rngintelt)
  - [`ProjectiveOmega(n, K): RngIntElt, FldFin → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-projectiveomega-rngintelt-fldfin)
  - [`ProjectiveOmega(V): ModTupRng → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-projectiveomega-modtuprng)
  - [`POmega(n, q): RngIntElt, RngIntElt → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-pomega-rngintelt-rngintelt)
  - [`POmega(n, K): RngIntElt, FldFin → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-pomega-rngintelt-fldfin)
  - [`POmega(V): ModTupRng → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-pomega-modtuprng)
  - [`ProjectiveOmegaPlus(arguments)`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#literal-literal-projectiveomegaplus-projectiveomegaplus-arguments)
  - [`POmegaPlus(arguments)`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#literal-literal-pomegaplus-pomegaplus-arguments)
  - [`ProjectiveOmegaPlus(n, q): RngIntElt, RngIntElt → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-projectiveomegaplus-rngintelt-rngintelt)
  - [`ProjectiveOmegaPlus(n, K): RngIntElt, FldFin → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-projectiveomegaplus-rngintelt-fldfin)
  - [`ProjectiveOmegaPlus(V): ModTupRng → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-projectiveomegaplus-modtuprng)
  - [`POmegaPlus(n, q): RngIntElt, RngIntElt → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-pomegaplus-rngintelt-rngintelt)
  - [`POmegaPlus(n, K): RngIntElt, FldFin → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-pomegaplus-rngintelt-fldfin)
  - [`POmegaPlus(V): ModTupRng → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-pomegaplus-modtuprng)
  - [`ProjectiveOmegaMinus(arguments)`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#literal-literal-projectiveomegaminus-projectiveomegaminus-arguments)
  - [`POmegaMinus(arguments)`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#literal-literal-pomegaminus-pomegaminus-arguments)
  - [`ProjectiveOmegaMinus(n, q): RngIntElt, RngIntElt → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-projectiveomegaminus-rngintelt-rngintelt)
  - [`ProjectiveOmegaMinus(n, K): RngIntElt, FldFin → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-projectiveomegaminus-rngintelt-fldfin)
  - [`ProjectiveOmegaMinus(V): ModTupRng → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-projectiveomegaminus-modtuprng)
  - [`POmegaMinus(n, q): RngIntElt, RngIntElt → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-pomegaminus-rngintelt-rngintelt)
  - [`POmegaMinus(n, K): RngIntElt, FldFin → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-pomegaminus-rngintelt-fldfin)
  - [`POmegaMinus(V): ModTupRng → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-pomegaminus-modtuprng)
  - [`ProjectiveSuzukiGroup(arguments)`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#literal-literal-projectivesuzukigroup-projectivesuzukigroup-arguments)
  - [`PSz(arguments)`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#literal-literal-psz-psz-arguments)
  - [`ProjectiveSuzukiGroup(q): RngIntElt → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-projectivesuzukigroup-rngintelt)
  - [`ProjectiveSuzukiGroup(K): FldFin → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-projectivesuzukigroup-fldfin)
  - [`ProjectiveSuzukiGroup(V): ModTupRng → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-projectivesuzukigroup-modtuprng)
  - [`PSz(q): RngIntElt → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-psz-rngintelt)
  - [`PSz(K): FldFin → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-psz-fldfin)
  - [`PSz(V): ModTupRng → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-psz-modtuprng)
  - [`AffineGroup(M): GrpMat[FldFin] → GrpPerm, {@ ModTupFldElt  @}`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/linear-group.md#function-affinegroup-grpmat-fldfin)
- [Permutation Group Databases](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/databases.md)
- [Ordering of Permutation Groups](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/canonical-gens.md)
  - [`CanonicalGenerators(G): GrpPerm → SeqEnum[GrpPermElt], GrpPermElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/canonical-gens.md#function-canonicalgenerators-grpperm)
  - [`CanonicalInvariant(G): GrpPerm → SeqEnum[SeqEnum], Seqenum`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/canonical-gens.md#function-canonicalinvariant-grpperm)
  - [Example: Canonical Generators](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/canonical-gens.md#example-ex-3ece73)
- [Ordered Partition Stacks](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/ordered-partn-stack.md)
  - [Construction of Ordered Partition Stacks](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/ordered-partn-stack.md#construction-of-ordered-partition-stacks)
    - [`OrderedPartitionStack(n): RngIntElt → StkPtnOrd`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/ordered-partn-stack.md#function-orderedpartitionstack-rngintelt)
    - [`OrderedPartitionStackZero(n, h): RngIntElt, RngIntElt → StkPtnOrd`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/ordered-partn-stack.md#function-orderedpartitionstackzero-rngintelt-rngintelt)
  - [Properties of Ordered Partition Stacks](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/ordered-partn-stack.md#properties-of-ordered-partition-stacks)
    - [`Degree(P): StkPtnOrd → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/ordered-partn-stack.md#function-degree-stkptnord)
    - [`Height(P): StkPtnOrd → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/ordered-partn-stack.md#function-height-stkptnord)
    - [`NumberOfCells(P, h): StkPtnOrd, RngIntElt → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/ordered-partn-stack.md#function-numberofcells-stkptnord-rngintelt)
    - [`NumberOfCells(P): StkPtnOrd → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/ordered-partn-stack.md#function-numberofcells-stkptnord)
    - [`CellNumber(P, h, x): StkPtnOrd, RngIntElt, RngIntElt → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/ordered-partn-stack.md#function-cellnumber-stkptnord-rngintelt-rngintelt)
    - [`CellNumber(P, x): StkPtnOrd, RngIntElt → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/ordered-partn-stack.md#function-cellnumber-stkptnord-rngintelt)
    - [`CellSize(P, h, i): StkPtnOrd, RngIntElt, RngIntElt → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/ordered-partn-stack.md#function-cellsize-stkptnord-rngintelt-rngintelt)
    - [`CellSize(P, i): StkPtnOrd, RngIntElt → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/ordered-partn-stack.md#function-cellsize-stkptnord-rngintelt)
    - [`Cell(P, h, i): StkPtnOrd, RngIntElt, RngIntElt → SeqEnum`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/ordered-partn-stack.md#function-cell-stkptnord-rngintelt-rngintelt)
    - [`Cell(P, i): StkPtnOrd, RngIntElt → SeqEnum`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/ordered-partn-stack.md#function-cell-stkptnord-rngintelt)
    - [`Random(P, i): StkPtnOrd, RngIntElt → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/ordered-partn-stack.md#function-random-stkptnord-rngintelt)
    - [`Representative(P, i): StkPtnOrd, RngIntElt → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/ordered-partn-stack.md#function-representative-stkptnord-rngintelt)
    - [`Rep(P, i): StkPtnOrd, RngIntElt → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/ordered-partn-stack.md#function-rep-stkptnord-rngintelt)
    - [`ParentCell(P, i): StkPtnOrd, RngIntElt → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/ordered-partn-stack.md#function-parentcell-stkptnord-rngintelt)
  - [Operations on Ordered Partition Stacks](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/ordered-partn-stack.md#operations-on-ordered-partition-stacks)
    - [`SplitCell(P, i, x): StkPtnOrd, RngIntElt, RngIntElt → BoolElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/ordered-partn-stack.md#function-splitcell-stkptnord-rngintelt-rngintelt)
    - [`SplitCell(P, i, Q): StkPtnOrd, RngIntElt, SeqEnum[RngIntElt] → BoolElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/ordered-partn-stack.md#function-splitcell-stkptnord-rngintelt-seqenum-rngintelt)
    - [`SplitAllByValues(P, V): StkPtnOrd, SeqEnum[RngIntElt] → BoolElt, RngIntElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/ordered-partn-stack.md#function-splitallbyvalues-stkptnord-seqenum-rngintelt)
    - [`SplitCellsByValues(P, C, V): StkPtnOrd, SeqEnum[RngIntElt], SeqEnum[RngIntElt] → BoolElt, RngIntElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/ordered-partn-stack.md#function-splitcellsbyvalues-stkptnord-seqenum-rngintelt-seqenum-rngintelt)
    - [`SplitCellsByValues(P, i, V): StkPtnOrd, RngIntElt, SeqEnum[RngIntElt] → BoolElt, RngIntElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/ordered-partn-stack.md#function-splitcellsbyvalues-stkptnord-rngintelt-seqenum-rngintelt)
    - [`Pop(P): StkPtnOrd`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/ordered-partn-stack.md#procedure-pop-stkptnord)
    - [`Pop(P, h): StkPtnOrd, RngIntElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/ordered-partn-stack.md#procedure-pop-stkptnord-rngintelt)
    - [`Advance(X, L, P, h): StkPtnOrd, SeqEnum[RngIntElt], StkPtnOrd, RngIntElt`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/ordered-partn-stack.md#procedure-advance-stkptnord-seqenum-rngintelt-stkptnord-rngintelt)
    - [Example: Operations on an Ordered Partition Stack](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/ordered-partn-stack.md#example-ex-23b5b0)
- [Bibliography](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/bibliography.md)

### Introduction

#### Terminology

A permutation group $G$ is a group of bijections $X \to X$, for some set $X$. The group $G$ is said to *act* on $X$ and the elements of $G$ are called permutations (of the set $X$). A given permutation group $G$ may have actions on sets other than the one on which it is defined. Thus, any set upon which $G$ has a legitimate action will be called a $G$-set. The set $X$ is called the *natural* $G$*-set* for the group $G$, and the action of $G$ on $X$ is called the *natural action* of $G$. Note that the group $G$ also has a natural induced action on the $G$-closure of any *derived set* of $X$ (see [$G$-Sets](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/actions.md#permg-gsets)). Magma expects the $G$-set $X$ to be of finite cardinality $n$. Usually, $X$ will be $\{1,2,\dots,n\}$, but, as we shall see below, $X$ may be a set of strings, or any other legitimate Magma set.

The elements of a $G$-set are called *points*. Let $Y$ be a $G$-set for $G$. The (possibly empty) subset of $Y$ whose points are fixed by every permutation of $G$, is called the *fixed-point set* for $G$, while the subset of $Y$ consisting of points moved by some permutation of $G$ is called the *support* of $G$. Similarly, for an element $g$ of $G$ the *fixed-point set* and the *support* of $g$ are, respectively, the subsets of $Y$ consisting of the points fixed and moved by $g$. The *degree* of $G$ is defined to be the cardinality of the natural $G$-set of $G$; whereas the *degree* of an element $g$ of $G$ is defined to be the cardinality of the support of $g$, i.e. the number of points moved by $g$.

Permutation groups in Magma are limited to degree less than $2^{30}$.

#### The Category of Permutation Groups

The family of all permutation groups of finite degree forms a category. The objects are the permutation groups and the morphisms are group homomorphisms. The Magma designation for this category of permutation groups is `GrpPerm`.

#### The Construction of a Permutation Group

Every permutation group acting on a set $X$ is created as a subgroup of the symmetric group ${\operatorname{Sym}}(X)$. Thus, the construction of a general permutation group is a two-step process:

**(i)**
The appropriate symmetric group, ${\operatorname{Sym}}(X)$, is constructed;

**(ii)**
The required group $G$ is then defined as a subgroup of ${\operatorname{Sym}}(X)$.

For convenience, a constructor `PermutationGroup< ... >`, which combines these two steps, is provided.

### Creation of a Permutation Group

#### Construction of the Symmetric Group

<a id="function-sym-rngintelt"></a>
##### `Sym(n): RngIntElt -> GrpPerm`

<a id="function-symmetricgroup-rngintelt"></a>
##### `SymmetricGroup(n): RngIntElt -> GrpPerm`

Given an integer $n \geq 1$, create the generic permutation group acting on the natural $G$-set $\Omega = \{ 1, 2, \ldots, n \}$, i.e. the symmetric group ${\operatorname{Sym}}(\Omega)$. Initially, only a structure table is created for ${\operatorname{Sym}}(n)$, so that, in particular, generators are not defined. This function is normally used to provide a context for the creation of elements and subgroups of ${\operatorname{Sym}}(n)$. If structural computation is attempted with the group created by `Sym(n)`, then generators will be created dynamically.

<a id="function-sym-set"></a>
##### `Sym(X): Set -> GrpPerm`

<a id="function-symmetricgroup-set"></a>
##### `SymmetricGroup(X): Set -> GrpPerm`

Given a finite set $X$ of cardinality $n \geq 1$, create the generic group $G$ of permutations of $X$ – the symmetric group ${\operatorname{Sym}}(X)$. Initially, only a structure table is created for ${\operatorname{Sym}}(X)$, so that, in particular, generators are not defined. This function is normally used to provide a context for the creation of elements and subgroups of ${\operatorname{Sym}}(X)$. If structural computation is attempted with the group created by `Sym(X)`, then generators will be created dynamically. Although the group $G$ is defined on the set $X$, $G$ is represented internally as a group of permutations of the set $\Omega = \{ 1, 2, \ldots, n \}$. Translation between $X$ and $\Omega$ is done at input/output time. The precise representation can be found by using the `Labelling` function. If $X$ is an indexed set then the indexing of elements of $X$ determines the correspondence.

<a id="function-standardgroup-grpperm"></a>
##### `StandardGroup(G): GrpPerm -> GrpPerm, Map`

Return a group $H$ isomorphic to $G$, but acting on the standard set $\lbrace 1, \ldots, n \rbrace$. This function is useful when the natural $G$-set for $G$ is not the standard set. If the natural $G$-set for $G$ is the standard set, $G$ is returned. The isomorphism from $G$ to $H$ is also returned.

<a id="example-ex-667d16"></a>
##### `Example: Symmetric Group on Strings (ex-667d16)`

We define the symmetric group on the set of strings `{ "a" "b" "c" "d" }`:

```magma
> S4 := Sym({ "a", "b", "c", "d" });
> S4;
Symmetric group S4 acting on a set of cardinality 4
Order = 24 = 2^3 * 3
> GSet(S4);
GSet{@ c, b, a, d @}
```

We define the symmetric group of degree $10$ acting on the set $\{ 0, 1, \ldots,9\}$.

```magma
> G := Sym({ 0..9 });
> G;
Symmetric group G acting on a set of cardinality 10
Order = 3628800 = 2^8 * 3^4 * 5^2 * 7
> GSet(G);
GSet{@ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 @}
```

#### Construction of a Permutation

Throughout this subsection we shall assume that the permutation group $G$ has natural $G$-set $X$.

<a id="constructor-constructor-elt-grpperm-list-elt-grppermelt"></a>
##### `elt< G | L >: GrpPerm, List(Elt) -> GrpPermElt`

Given a permutation group $G$ defined as acting on the set $X = \{ x_1,\ldots, x_n\}$ of cardinality $n \geq 1$, and a list $L$ of distinct elements $a_1, a_2, \ldots, a_n$ of $X$, construct the element $g$ of $G$ defined by $x_i \rightarrow a_i$, for $i = 1,\ldots, n$. Unless $G$ is known to be the generic permutation group of degree $n$, the permutation will be tested for membership of $G$, and if $g$ is not an element of $G$, the function will fail. If $g$ does lie in $G$, $g$ will have $G$ as its parent. Since the membership test may involve constructing a base and strong generating set for $G$, this constructor may occasionally be very costly. Hence, a permutation $g$ should be defined as an element of a subgroup of the generic group only when membership of $G$ is required by subsequent operations involving $g$.

<a id="operation-op-grpperm-elt"></a>
##### `G ! Q: GrpPerm, [ Elt ] -> GrpPermElt`

Given a permutation group $G$ defined as acting on the set $X = \{ x_1,\ldots, x_n\}$ of cardinality $n \geq 1$, and a sequence $Q = [a_1, a_2, \ldots, a_n]$ of distinct elements of $X$, construct the permutation $g$ of $X$ defined by $x_i \rightarrow a_i$, for $i = 1,\ldots, n$. This permutation will have $G$ as its parent structure. As in the case of the `elt`-constructor, the operation will fail if $g$ is not an element of $G$ and the same observations concerning the cost of membership testing apply.

<a id="operation-op-grpperm-cycles"></a>
##### `G ! (...)(...)...(...): GrpPerm, Cycles -> GrpPermElt`

Given a permutation group $G$ defined as acting on the set $X=\{x_1$, $x_2, \dots, x_n\}$, construct the permutation $g$ corresponding to the given product of cycles. Adjacent letters must be separated by commas. Further, *cycles of length one must be omitted*. The coercion operator ! may be omitted only within the context of the standard constructors `sub<>`, `ncl<>`, and `quo<>`. Once the permutation $g$ has been constructed, it will be tested for membership in $G$. If it is not a member, the construction fails.

<a id="operation-op-grpperm-literalcycles"></a>
##### `G ! \(...)(...)...(...): GrpPerm, LiteralCycles -> GrpPermElt`

Given a permutation group $G$ defined as acting on the set $X=\{1 .. n\}$, construct the permutation $g$ corresponding to the given product of literal cycles of integers. Adjacent integers must be separated by commas. Once the permutation $g$ has been constructed, it will be tested for membership in $G$. If it is not a member, the construction fails. This construction is strongly recommended when creating large permutations to avoid overhead in constructing unnecessarily large parse trees by Magma.

<a id="operation-op-grpperm-seqenum-setindx"></a>
##### `G ! Q: GrpPerm, SeqEnum[SetIndx] -> GrpPermElt`

Given a permutation group $G$ defined as acting on the set $X=\{1 .. n\}$, construct the permutation $g$ corresponding to the given product of cycles. The indexed sets in $Q$ must be disjoint subsets of $X$, which are interpreted as the disjoint cycles of the permutation being constructed. Cycles of length 1 may be omitted, but do not have to be omitted. Once the permutation $g$ has been constructed, it will be tested for membership in $G$. If it is not a member, the construction fails. Note that the `Cycle` function produces results suitable for use as members of $Q$.

<a id="function-elementtosequence-grppermelt"></a>
##### `ElementToSequence(g): GrpPermElt -> [ Elt ]`

<a id="function-eltseq-grppermelt"></a>
##### `Eltseq(g): GrpPermElt -> [ Elt ]`

The sequence $Q$ of images of the $G$-set of g. In particular, it has the property that `Parent(g)!Eltseq(g) eq g`.

<a id="function-identity-grp"></a>
##### `Identity(G): Grp -> GrpPermElt`

<a id="function-id-grp"></a>
##### `Id(G): Grp -> GrpPermElt`

<a id="operation-op-grp-rngintelt"></a>
##### `G ! 1: Grp, RngIntElt -> GrpPermElt`

Construct the identity permutation in the permutation group $G$.

<a id="example-ex-ffdb2d"></a>
##### `Example: Three Ways to Construct a Permutation (ex-ffdb2d)`

The three different constructions are illustrated by the following code, which assigns to each of the variables $x$, $y$, and $z$ the permutation (1)(2,3)(4,5,6).

```magma
> S6 := Sym(6);
> x := elt<S6 | 1,3,2,5,6,4>;
> x;
(2, 3)(4, 5, 6)
> y := S6![1,3,2,5,6,4];
> y;
(2, 3)(4, 5, 6)
> z := S6!(2,3)(4,5,6);
> z;
(2, 3)(4, 5, 6)
> S6!1;
Id(S6)
```

#### Construction of a General Permutation Group

<a id="constructor-constructor-permutationgroup-set-list-grpperm"></a>
##### `PermutationGroup< X | L >: Set, List -> GrpPerm`

Suppose that the cardinality of the set $X$ is $n$. Construct the permutation group $G$ acting on the set $X$ generated by the permutations defined by the list $L$. A term of the list $L$ must be an object of one of the following types:

**(a)**
A sequence of $n$ elements of $X$ defining a permutation of $X$ (note that this is only well-defined when $X$ is an indexed set);

**(b)**
A set or sequence of sequences of type (a);

**(c)**
An element of ${\operatorname{Sym}}(X)$;

**(d)**
A set or sequence of elements of ${\operatorname{Sym}}(X)$;

**(e)**
A subgroup of ${\operatorname{Sym}}(X)$;

**(f)**
A set or sequence of subgroups of ${\operatorname{Sym}}(X)$.

Each element or group specified by the list must belong to the *same* generic permutation group. The group $G$ will be constructed as a subgroup of some group which contains each of the elements and groups specified in the list. The generators of $G$ consist of the elements specified by the terms of the list $L$ together with the stored generators for groups specified by terms of the list. The `PermutationGroup` constructor is shorthand for the two statements:

```
   SX := Sym(X);
   G := sub< SX | L >;
```

where `sub< ... >` is the subgroup constructor described in the next subsection.

<a id="constructor-constructor-permutationgroup-rngintelt-list-grpperm"></a>
##### `PermutationGroup< n | L >: RngIntElt, List -> GrpPerm`

Construct the permutation group $G$ acting on the set $X = \{ 1, 2, \ldots, n \rbrace$ generated by the permutations defined by the list $L$. The possibilities for the terms of the list $L$ are the same as for the constructor `PermutationGroup< X | L >`.

<a id="example-ex-1e0f19"></a>
##### `Example: Hessian Group (ex-1e0f19)`

The Hessian group generated by the permutations $(1,2,4)(5,6,8)(3,9,7)$ and $(4,5,6)(7,9,8)$ may be created by the statement:

```magma
> H := PermutationGroup< 9 | (1,2,4)(5,6,8)(3,9,7), (4,5,6)(7,9,8) >;
> H;
Permutation group H acting on a set of cardinality 9
       (1, 2, 4)(3, 9, 7)(5, 6, 8)
       (4, 5, 6)(7, 9, 8)
```

### Elementary Properties of a Group

#### Accessing Group Information

The functions in this group provide access to basic information stored for a permutation group $G$.

<a id="operation-operation-grpperm-rngintelt-grppermelt"></a>
##### `G . i: GrpPerm, RngIntElt -> GrpPermElt`

The $i$-th defining generator for $G$. A negative subscript indicates that the inverse of the generator is to be created. The identity element of $G$ will be created by `G.0`.

<a id="function-degree-grppermelt"></a>
##### `Degree(G): GrpPermElt -> RngIntElt`

The degree of the permutation group $G$.

<a id="function-generators-grpperm"></a>
##### `Generators(G): GrpPerm -> { GrpPermElt }`

A set of elements of $G$ that generate $G$.

<a id="function-grpperm-generatorssequence"></a>
##### `GeneratorsSequence(G): GrpPerm -> [ GrpPermElt ]`

The sequence of elements used to define the group $G$. Any occurrences of the identity element or any repetitions of a generator, as removed by `Generators(G)`, are retained in this sequence. This function has the same effect as the expression `[G.i : i in [1..Ngens(G)]] `.

<a id="function-numberofgenerators-grpperm"></a>
##### `NumberOfGenerators(G): GrpPerm -> RngIntElt`

<a id="function-ngens-grpperm"></a>
##### `Ngens(G): GrpPerm -> RngIntElt`

The number of defining generators for $G$.

<a id="function-fewgenerators-grpperm"></a>
##### `FewGenerators(G): GrpPerm -> [GrpPermElt]`

A typically short sequence of random elements generating the group. Especially when groups are generated as subgroups, the result of `FewGenerators` is a much shorter sequence than returned by [`GeneratorsSequence`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/operation.md#function-grpperm-generatorssequence).

<a id="function-generic-grpperm"></a>
##### `Generic(G): GrpPerm -> GrpPerm`

The generic group containing $G$, i.e. the symmetric group in which $G$ is naturally embedded.

<a id="function-parent-grppermelt"></a>
##### `Parent(g): GrpPermElt -> GrpPerm`

The parent group $G$ for the permutation $g$.

<a id="function-gset-grpperm"></a>
##### `GSet(G): GrpPerm -> GSet`

The natural $G$-set for the permutation group $G$.

<a id="example-ex-e70b28"></a>
##### `Example: Basic Access Functions for a Group (ex-e70b28)`

Consider the group $G$ of order $648$ generated by the permutations (1,6,7)(2,5,8,3,4,9)(11,12) and (1,3)(4,9,12)(5,8,10,6,7,11).

```magma
> G := PermutationGroup< 12 | (1,6,7)(2,5,8,3,4,9)(11,12),
>                             (1,3)(4,9,12)(5,8,10,6,7,11) >;
> G;
Permutation group G acting on a set of cardinality 12
    (1, 6, 7)(2, 5, 8, 3, 4, 9)(11, 12)
    (1, 3)(4, 9, 12)(5, 8, 10, 6, 7, 11)
> G.1;
(1, 6, 7)(2, 5, 8, 3, 4, 9)(11, 12)
> G.1*G.2;
(1, 7, 3, 9, 2, 8)(4, 12, 5, 10, 6, 11)
> Degree(G);
12
> GSet(G);
GSet{@ 1 .. 12 @}
> Generic(G);
Symmetric group acting on a set of cardinality 12
Order = 479001600 = 2^10 * 3^5 * 5^2 * 7 * 11
> Generators(G);
{
    (1, 6, 7)(2, 5, 8, 3, 4, 9)(11, 12),
    (1, 3)(4, 9, 12)(5, 8, 10, 6, 7, 11)
}
> Ngens(G);
2
> x := G ! (1,6,7)(2,5,8,3,4,9)(11,12);
> x;
(1, 6, 7)(2, 5, 8, 3, 4, 9)(11, 12)
> Parent(x);
Permutation group G acting on a set of cardinality 12
Order = 648 = 2^3 * 3^4
    (1, 6, 7)(2, 5, 8, 3, 4, 9)(11, 12)
    (1, 3)(4, 9, 12)(5, 8, 10, 6, 7, 11)
]
```

#### Group Order

Unless the order is already known, each of the functions in this family will create a base and strong generating set for the group if one does not already exist.

<a id="function-order-grpperm"></a>
##### `Order(G): GrpPerm -> RngIntElt`

<a id="operation-operation-grpperm-rngintelt"></a>
##### `# G: GrpPerm -> RngIntElt`

The order of the group $G$ as an integer. If the order is not currently known, a base and strong generating set will be constructed for $G$.

<a id="function-factoredorder-grpperm"></a>
##### `FactoredOrder(G): GrpPerm -> [ <RngIntElt, RngIntElt> ]`

The order of the group $G$ returned as a factored integer. The factorization is returned in the form of a sequence $Q$ which is defined as follows: If $\# G = p_1^{e_1}\ldots p_n^{e_n}, \quad e_i \neq 0$, then $Q$ will be the integer sequence $[ <p_1, e_1>, \ldots, <p_n, e_n> ]$. If the order of $G$ is not known, it will be computed.

#### Abstract Properties of a Group

<a id="function-isabelian-grpperm"></a>
##### `IsAbelian(G): GrpPerm -> BoolElt`

Returns `true` if the group $G$ is abelian, `false` otherwise.

<a id="function-iscyclic-grpperm"></a>
##### `IsCyclic(G): GrpPerm -> BoolElt`

Returns `true` if the group $G$ is cyclic, `false` otherwise.

<a id="function-iselementaryabelian-grpperm"></a>
##### `IsElementaryAbelian(G): GrpPerm -> BoolElt`

Returns `true` if the group $G$ is elementary abelian, `false` otherwise.

<a id="function-isspecial-grpperm"></a>
##### `IsSpecial(G): GrpPerm -> BoolElt`

Given a $p$-group $G$, return `true` if $G$ is special, `false` otherwise.

<a id="function-isextraspecial-grpperm"></a>
##### `IsExtraSpecial(G): GrpPerm -> BoolElt`

Given a group $G$ is a $p$-group $G$, return `true` if $G$ is extra-special, `false` otherwise.

<a id="function-isnilpotent-grpperm"></a>
##### `IsNilpotent(G): GrpPerm -> BoolElt`

Returns `true` if the group $G$ is nilpotent, `false` otherwise.

<a id="function-issoluble-grpperm"></a>
##### `IsSoluble(G): GrpPerm -> BoolElt`

<a id="function-issolvable-grpperm"></a>
##### `IsSolvable(G): GrpPerm -> BoolElt`

Returns `true` if the group $G$ is soluble, `false` otherwise. Uses the algorithm of Sims [[Sim90](https://docs.magma-maths.org/references.md#cite-sol-schreier)].

<a id="function-isperfect-grpperm"></a>
##### `IsPerfect(G): GrpPerm -> BoolElt`

Returns `true` if the group $G$ is perfect, `false` otherwise.

<a id="function-issimple-grpperm"></a>
##### `IsSimple(G): GrpPerm -> BoolElt`

Returns `true` if the group $G$ is simple, `false` otherwise.

<a id="function-iswreathproduct-grpperm"></a>
##### `IsWreathProduct(G): GrpPerm -> BoolElt, GrpPerm, GrpPerm, GrpPerm`

Returns `true` if the group $G$ is isomorphic to a wreath product $A \wr B$, where $B$ is transitive, and `false` otherwise. If true, then three subgroups of $G$, call them $A$, $B$, $C$, are also returned. In this case we have $G$ isomorphic to `WreathProduct(A, CosetImage(B, C))`.

<a id="example-ex-c8fc8b"></a>
##### `Example: Perfect Non-Simple Subgroups of M24 (ex-c8fc8b)`

We determine the orders of those subgroups of the Mathieu group $M_{24}$ which are perfect but not simple. We use the function `PerfectSubgroups` which returns a representative from each conjugacy class of perfect subgroups.

```magma
> load m24;
Loading "/home/magma/libs/pergps/m24"
M24 - Mathieu group on 24 letters - degree 24
Order 244 823 040 = 2^10 * 3^3 * 5 * 7 * 11 * 23;  Base 1,2,3,4,5,6,7
Group: G
> time S := PerfectSubgroups(G);
Time: 29.460
> [ Order(H) : R in S | not IsSimple(H) where H := R`subgroup ];
[ 120, 120, 120, 180, 180, 240, 240, 336, 336, 336, 336, 504, 720, 1008, 1080,
  960, 960, 960, 1344, 1344, 1344, 1920, 2688, 2688, 2688, 2688, 2688, 2880,
  3840, 3840, 5760, 10752, 11520, 11520, 40320, 21504, 21504, 32256, 64512,
  69120, 322560 ]
```

### Homomorphisms

Homomorphisms are a central concept in group theory, and Magma provides extensive facilities for group homomorphisms. Many useful homomorphisms are returned by constructors and intrinsic functions. Examples of these are the `quo` constructor, the `sub` constructor, and intrinsic functions such as `OrbitAction`, `BlocksAction`, `FPGroup`, and `RadicalQuotient`, which are described in more detail elsewhere in this chapter. In this section we describe how the user may create their own homomorphisms with domain a permutation group.

<a id="constructor-constructor-hom-grpperm-list-map"></a>
#### `hom<G -> H | L>: GrpPerm, List -> Map`

Given the permutation group $G$, construct the homomorphism $f : G \to H$ given by the generator images in $L$. $H$ must be a group. The clause $L$ may be any one of the following types:

**(a)**
A list of elements of $H$, giving images of the generators of $G$;

**(b)**
A list of pairs, where the first in the pair is an element of $G$ and the second its image in $H$;

**(c)**
A sequence of elements of $H$, as in (a);

**(d)**
A set or sequence of pairs, as in (b);

Each image element specified by the list must belong to the *same* group $H$. In the cases where pairs are given the given elements of $G$ must generate $G$.

<a id="function-domain-map"></a>
#### `Domain(f): Map -> Grp`

The domain of the homomorphism $f$.

<a id="function-codomain-map"></a>
#### `Codomain(f): Map -> Grp`

The codomain of the homomorphism $f$.

<a id="function-image-map"></a>
#### `Image(f): Map -> Grp`

The image or range of the homomorphism $f$. This will be a subgroup of the codomain of $f$. The algorithm computes the image and kernel simultaneously (see [[LGPS91](https://docs.magma-maths.org/references.md#cite-grp-homs)]).

<a id="function-kernel-map"></a>
#### `Kernel(f): Map -> Grp`

The kernel of the homomorphism $f$. This will be a normal subgroup of the domain of $f$. The algorithm computes the image and kernel simultaneously (see [[LGPS91](https://docs.magma-maths.org/references.md#cite-grp-homs)]).

<a id="function-ishomomorphism-grpperm-grpperm-seqenum-grppermelt"></a>
#### `IsHomomorphism(G, H, Q): GrpPerm, GrpPerm, SeqEnum[GrpPermElt] -> Bool, Map`

Return the value `true` if the sequence $Q$ defines a homomorphism from the group $G$ to the group $H$. The sequence $Q$ must have length `Ngens(G)` and must contain elements of $H$. The $i$-th element of $Q$ is interpreted as the image of the $i$-th generator of $G$ and the function decides if these images extend to a homomorphism. If so, the homomorphism is also returned. The algorithm employed is described in [[LGPS91](https://docs.magma-maths.org/references.md#cite-grp-homs)].

<a id="example-ex-bee0e9"></a>
#### `Example: Permutation Representation of Degree 8 (ex-bee0e9)`

Consider the group $G$ of order $648$ generated by the permutations (1,6,7)(2,5,8,3,4,9)(11,12) and (1,3)(4,9,12)(5,8,10,6,7,11). We construct a permutation representation of $G$ of degree 8 by considering the conjugation action of $G$ on one of its elements. We then construct the preimage of a normal subgroup of the image.

```magma
> G := PermutationGroup< 12 | (1,6,7)(2,5,8,3,4,9)(11,12),
>                             (1,3)(4,9,12)(5,8,10,6,7,11) >;
> #G;
648
> x := G ! (1, 2, 3)(7, 8, 9)(10, 11, 12);
> x_class := {@ x ^ y : y in G @};
> #x_class;
8
> S := SymmetricGroup(8);
> images := [S![Index(x_class, x_class[i]^(G.j)):i in [1..8]] :j in [1..2]];
> f := hom< G -> S | images>;
```

The map $f$ is the homomorphism of $G$ onto the group induced by the action of the element $x$. We computer the images of some elements and then find the image and kernel of $f$.

```magma
> (G.1*G.-2) @ f;
(2, 5, 7)(3, 8, 6)
> ((G.1) @ f) * ((G.2) @ f) ^ -1;
(2, 5, 7)(3, 8, 6)
> H := Image(f);
> H;
Permutation group acting on a set of cardinality 8
Order = 24 = 2^3 * 3
  (1, 2, 3, 4, 6, 5)(7, 8)
  (1, 2, 8, 4, 6, 7)(3, 5)
> Kernel(f);
Permutation group acting on a set of cardinality 12
Order = 27 = 3^3
  (1, 2, 3)(4, 6, 5)(7, 8, 9)(10, 12, 11)
  (4, 5, 6)(7, 9, 8)
  (7, 9, 8)(10, 11, 12)
```

We now find the preimage of $O_2(H)$ as a subgroup of $G$.

```magma
> pCore(H, 2) @@ f;
Permutation group acting on a set of cardinality 12
Order = 216 = 2^3 * 3^3
  (4, 5, 6)(7, 9, 8)
  (1, 2, 3)(4, 6, 5)(7, 8, 9)(10, 12, 11)
  (1, 4, 2, 5, 3, 6)(7, 12, 9, 11, 8, 10)
  (1, 10, 3, 11, 2, 12)(4, 9, 5, 8, 6, 7)
  (2, 3)(4, 5)(8, 9)(11, 12)
  (7, 9, 8)(10, 11, 12)
```

### Building Permutation Groups

Examples of permutation groups are routinely constructed by taking one or more standard groups and applying some extension procedure to construct a group having the given groups as subgroups or quotient groups. In the first subsection we describe functions which construct some well-known groups and in the following subsection we give functions for constructing direct and wreath products.

#### Some Standard Permutation Groups

A number of functions are provided which construct various standard groups. The effect of these functions is to construct the group on some standard set of generating permutations.

<a id="function-abeliangroup-cat-rngintelt"></a>
##### `AbelianGroup(GrpPerm, Q): Cat, [ RngIntElt ] -> GrpPerm`

Construct the abelian group defined by the sequence $Q = [n_1,\ldots,n_r]$ of positive integers. The function constructs the direct product of cyclic groups

$$
Z(n_1) \times Z(n_2) \times \cdots \times Z(n_r).
$$

<a id="function-alternatinggroup-cat-rngintelt"></a>
##### `AlternatingGroup(GrpPerm, n): Cat, RngIntElt -> GrpPerm`

<a id="function-alternatinggroup-rngintelt"></a>
##### `AlternatingGroup(n): RngIntElt -> GrpPerm`

<a id="function-alt-rngintelt"></a>
##### `Alt(n): RngIntElt -> GrpPerm`

Construct the alternating group of degree $n$ on generators $(3,4,\ldots,n)$ and $(1,2,3)$, if $n$ is odd, or $(1,2)(3,4$, $\ldots$, $n)$ and $(1,2,3)$, if $n$ is even.

<a id="function-cyclicgroup-cat-rngintelt"></a>
##### `CyclicGroup(GrpPerm, n): Cat, RngIntElt -> GrpPerm`

<a id="function-cyclicgroup-rngintelt"></a>
##### `CyclicGroup(n): RngIntElt -> GrpPerm`

Construct the cyclic group of order $n$ with generator $(1,2,\ldots,n)$.

<a id="function-dihedralgroup-cat-rngintelt"></a>
##### `DihedralGroup(GrpPerm, n): Cat, RngIntElt -> GrpPerm`

<a id="function-dihedralgroup-rngintelt"></a>
##### `DihedralGroup(n): RngIntElt -> GrpPerm`

Construct the dihedral group of degree $n$ and order $2*n$ on generators $(1,2,\ldots,n)$ and $(1,n)(2,n-1)\cdots$.

<a id="function-sym-cat-rngintelt"></a>
##### `Sym(GrpPerm, n): Cat, RngIntElt -> GrpPerm`

<a id="function-symmetricgroup-cat-rngintelt"></a>
##### `SymmetricGroup(GrpPerm, n): Cat, RngIntElt -> GrpPerm`

<a id="function-sym-rngintelt-2"></a>
##### `Sym(n): RngIntElt -> GrpPerm`

<a id="function-symmetricgroup-rngintelt-2"></a>
##### `SymmetricGroup(n): RngIntElt -> GrpPerm`

Construct the symmetric group of degree $n$ on generators $(1,2,\ldots,n)$ and $(1,2)$.

<a id="function-extraspecialgroup-cat-rngintelt-rngintelt"></a>
##### `ExtraSpecialGroup(GrpPerm, p, n : parameters): Cat, RngIntElt, RngIntElt -> GrpPerm`

<a id="function-extraspecialgroup-rngintelt-rngintelt"></a>
##### `ExtraSpecialGroup(p, n : parameters): RngIntElt, RngIntElt -> GrpPerm`

```magma
Type: MonStgElt                    Default: "+"
```

Given a small prime $p$ and a small positive integer $n$, construct an extra-special group $G$ of order $p^{2n+1}$ in the category `GrpPerm`. The isomorphism type of $G$ can be selected using the parameter `Type`.

Possible values for this parameter are “$+$” (default) and “$-$“.

If `Type` is set to “$+$”, the function returns for $p = 2$ the central product of $n$ copies of the dihedral group of order 8, and for $p > 2$ it returns the unique extra-special group of order $p^{2n+1}$ and exponent $p$.

If `Type` is set to “$-$”, the function returns for $p = 2$ the central product of a quaternion group of order 8 and $n-1$ copies of the dihedral group of order 8, and for $p > 2$ it returns the unique extra-special group of order $p^{2n+1}$ and exponent $p^2$.

<a id="function-youngsubgroup-rngintelt"></a>
##### `YoungSubgroup(L): [RngIntElt] -> GrpPerm`

```magma
Full: RngIntElt                    Default: false
```

Given a sequence $L$ of positive integers, compute the Young subgroup parameterized by $L$, i.e., the direct product of the symmetric groups on $L_i$ points. If the optional parameter `Full` is given, construct the group as a subgroup of the symmetric group on `Full` elements.

<a id="example-ex-98baac"></a>
##### `Example: Standard Permutation Groups (ex-98baac)`

The abelian group $Z_2 \times Z_2 \times Z_4$:

```magma
> A := AbelianGroup(GrpPerm, [2, 2, 4] );
> A;
Permutation group A acting on a set of cardinality 8
Order = 16 = 2^4
    (1, 2)
    (3, 4)
    (5, 6, 7, 8)
```

The alternating group of degree $12$:

```magma
> A12 := AlternatingGroup(GrpPerm, 12);
> A12;
Permutation group A12 acting on a set of cardinality 12
Order = 239500800 = 2^9 * 3^5 * 5^2 * 7 * 11
    (1, 2)(3, 4, 5, 6, 7, 8, 9, 10, 11, 12)
    (1, 2, 3)
```

The cyclic group $Z_{24}$:

```magma
> Z24 := CyclicGroup(GrpPerm, 24);
> Z24;
Permutation group Z24 on a set of cardinality 24
Order = 24 = 2^3 * 3
    (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
        16, 17, 18, 19, 20, 21, 22, 23, 24)
```

The dihedral group of order $24$:

```magma
> D12 := DihedralGroup(GrpPerm, 12);
> D12;
Permutation group D12 acting on a set of cardinality 12
Order = 24 = 2^3 * 3
    (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12)
    (1, 12)(2, 11)(3, 10)(4, 9)(5, 8)(6, 7)
```

The symmetric group of degree $8$:

```magma
> S8 := SymmetricGroup(GrpPerm, 8);
> S8;
Symmetric group S8 acting on a set of cardinality 8
Order = 40320 = 2^7 * 3^2 * 5 * 7
```

#### Direct Products and Wreath Products

<a id="function-directproduct-grpperm-grpperm"></a>
##### `DirectProduct(G, H): GrpPerm, GrpPerm -> GrpPerm, [ Hom(Grp) ], [ Hom(Grp) ]`

Given two permutation groups $G$ and $H$, construct the direct product $D$ of $G$ and $H$ as an intransitive group having degree equal to the sum of the degrees of $G$ and $H$. In addition, the sequences $I$ of inclusions and $P$ of projections are returned, satisfying $I[i]: K_i\rightarrow D(K_i)$ and $P[i]: D\rightarrow K_i$ (where $K_1 = G, K_2 = H$ and $D(K)$ is the group $K$ represented naturally as a subgroup of $D$).

<a id="function-directproduct-grpperm"></a>
##### `DirectProduct(Q): [ GrpPerm ] -> GrpPerm, [ Hom(Grp) ], [ Hom(Grp) ]`

Given a sequence $Q$ of $n$ permutation groups, construct the direct product $Q[1] \times Q[2] \times \ldots \times Q[n]$ as an intransitive group of degree equal to the sum of the degrees of the groups $Q[i]$, $(i = 1, \ldots, n)$. In addition, the sequences $I$ of inclusion and $P$ of projections are returned, satisfying $I[i]: Q[i]\rightarrow D(Q[i])$ and $P[i]: D\rightarrow Q[i]$ (where $D(K)$ is the group $K$ represented naturally as a subgroup of $D$).

<a id="function-permg-primitivewreathproduct"></a>
##### `PrimitiveWreathProduct(G, H): GrpPerm, GrpPerm -> GrpPerm`

Given permutation groups $G$ and $H$, construct the wreath product $G\wr H$ of $G$ and $H$, where $G\wr H$ has product action.

<a id="function-primitivewreathproduct-grpperm"></a>
##### `PrimitiveWreathProduct(Q): [ GrpPerm ] -> GrpPerm`

Given a sequence $Q$ of $n$ permutation groups, construct the iterated wreath product $T = ( \ldots (Q[1] \wr Q[2]) \wr \ldots \wr Q[n])$, where $T$ has product action.

<a id="function-wreathproduct-grpperm-grpperm"></a>
##### `WreathProduct(G, H): GrpPerm, GrpPerm -> GrpPerm, SeqEnum[Map], Map, Map`

Given permutation groups $G$ and $H$, construct the wreath product $W = G\wr H$ of $G$ and $H$, where $G\wr H$ has imprimitive action. The function also returns the sequence of `Degree(H)` inclusions of $G$ into $W$, the inclusion of $H$ into $W$, and the projection of $W$ onto $H$.

<a id="function-wreathproduct-grpperm"></a>
##### `WreathProduct(Q): [ GrpPerm ] -> GrpPerm`

Given a sequence $Q$ of $n$ permutation groups, construct the iterated wreath product $W = ( \ldots (Q[1] \wr Q[2]) \wr \ldots \wr Q[n])$, where $W$ has imprimitive action.

<a id="function-wreathproduct-gset"></a>
##### `WreathProduct(B): GSet -> GrpPerm, GrpPerm, GrpPerm`

Given a block system $B$ of some permutation group $G$, compute the wreath-product corresponding to $B$.

<a id="function-wreathproduct-grpperm-gset"></a>
##### `WreathProduct(G, B): GrpPerm, GSet -> GrpPerm, GrpPerm, GrpPerm`

Compute the smallest wreath product $W$ to the block system $B$ of $G$ such that $G \subseteq W$. Also return the complement as a subgroup of $W$. The third parameter is a subgroup which is isomorphic to the action within a block.

<a id="example-ex-4e2871"></a>
##### `Example: Direct and Wreath Products (ex-4e2871)`

We define $G$ to be the symmetric group of degree $4$ and $H$ to be the dihedral group of order $8$. We then proceed to form the direct, primitive-wreath, and wreath products of $G$ and $H$.

```magma
> G := SymmetricGroup(GrpPerm, 4);
> H := DihedralGroup(GrpPerm, 3);
> D := DirectProduct(G, H);
> D;
Permutation group D acting on a set of cardinality 7
Order = 144 = 2^4 * 3^2
    (1, 2, 3, 4)
    (1, 2)
    (5, 6, 7)
    (5, 6)
> T := PrimitiveWreathProduct(G, H);
> T;
Permutation group T acting on a set of cardinality 64
Order = 82944 = 2^10 * 3^4
    (2, 5, 17)(3, 9, 33)(4, 13, 49)(6, 21, 18)(7, 25, 34)(8, 29, 50)
       (10, 37, 19) (11, 41, 35)(12, 45, 51) (14, 53, 20)(15, 57, 36)
       (16, 61, 52)(23, 26, 38) (24, 30, 54)(27, 42, 39)(28, 46, 55)
       (31, 58, 40) (32, 62, 56)(44, 47, 59)(48, 63, 60)
    (2, 5)(3, 9)(4, 13)(7, 10)(8, 14)(12, 15)(18, 21)(19 , 25)(20, 29)
       (23, 26)(24, 30)(28, 31)(34, 37)(35 , 41)(36, 45)(39, 42)(40, 46)
       (44, 47)(50, 53)(51 , 57)(52, 61)(55, 58)(56, 62)(60, 63)
    (1, 2, 3, 4)(5, 6, 7, 8)(9, 10, 11, 12)(13, 14, 15, 16)(17, 18, 19, 20)
       (21, 22, 23, 24)(25, 26, 27, 28)(29, 30, 31, 32)(33, 34, 35, 36)
       (37, 38, 39, 40)(41, 42, 43, 44)(45, 46, 47, 48)(49, 50, 51, 52)
       (53, 54, 55, 56)(57, 58, 59, 60)(61, 62, 63, 64)
    (1, 2)(5, 6)(9, 10)(13, 14)(17, 18)(21, 22)(25, 26)( 29, 30)(33, 34)
       (37, 38)(41, 42)(45, 46)(49, 50)( 53, 54)(57, 58)(61, 62)
> W := WreathProduct(G, H);
> W;
Permutation group W acting on a set of cardinality 12
Order = 82944 = 2^10 * 3^4
    (1, 5, 9)(2, 6, 10)(3, 7, 11)(4, 8, 12)
    (1, 5)(2, 6)(3, 7)(4, 8)
    (1, 2, 3, 4)
    (1, 2)
```

### Permutations

#### Coercion

<a id="operation-op-grpperm-grppermelt"></a>
##### `G ! g: GrpPerm, GrpPermElt -> GrpPermElt`

Given a subgroup $G$ of ${\operatorname{Sym}}(X)$ and a permutation $g$ belonging to ${\operatorname{Sym}}(X)$ that is contained in $G$, embed $g$ in $G$. Thus, this operator changes the parent of $g$ to be $G$.

<a id="operation-op-grpperm-grpperm"></a>
##### `G !! H: GrpPerm, GrpPerm -> GrpPerm`

Given a group $H$ whose natural $G$-set $X$ is a subset of the natural $G$-set $Y$ for the group $G$, embed $H$ as a subgroup of $G$. The operator fails if the image of $H$ in ${\operatorname{Sym}}(Y)$ is not a subgroup of $G$.

#### Arithmetic with Permutations

<a id="operation-op-times-grppermelt-grppermelt"></a>
##### `g * h: GrpPermElt, GrpPermElt -> GrpPermElt`

Product of permutation $g$ and permutation $h$, where $g$ and $h$ belong to the same generic group $U$. If $g$ and $h$ both belong to the same proper subgroup $G$ of $U$, then the result will be returned as an element of $G$; if $g$ and $h$ belong to subgroups $H$ and $K$ of a subgroup $G$ of $U$, then the product is returned as an element of $G$. Otherwise, the product is returned as an element of $U$.

<a id="operation-op-pow-grppermelt-rngintelt"></a>
##### `g ^ n: GrpPermElt, RngIntElt -> GrpPermElt`

The $n$-th power of the permutation $g$, where $n$ is a positive, negative, or zero integer.

<a id="operation-op-div-grppermelt-grppermelt"></a>
##### `g / h: GrpPermElt, GrpPermElt -> GrpPermElt`

Product of the permutation $g$ by the inverse of the permutation $h$, i.e. the element $g*h^{-1}$. Here $g$ and $h$ must belong to the same generic group $U$. The rules for determining the parent group of $g / h$ are the same as for $g*h$.

<a id="operation-op-pow-grppermelt-grppermelt"></a>
##### `g ^ h: GrpPermElt, GrpPermElt -> GrpPermElt`

Conjugate of the permutation $g$ by the permutation $h$, i.e. the element $h^{-1}*g*h$. Here $g$ and $h$ must belong to the same generic group $U$. The rules for determining the parent group of $g^h$ are the same as for $g*h$.

<a id="literal-literal-g-h-grppermelt-grppermelt-grppermelt"></a>
##### `(g, h): GrpPermElt, GrpPermElt -> GrpPermElt`

Commutator of the permutations $g$ and $h$, i.e. the element $g^{-1}*h^{-1}*g*h$. Here $g$ and $h$ must belong to the same generic group $U$. The rules for determining the parent group of $(g, h)$ are the same as those for $g*h$.

<a id="literal-literal-g1-gr-grppermelt-grppermelt-grppermelt"></a>
##### `(g₁, ..., gᵣ): GrpPermElt, ..., GrpPermElt -> GrpPermElt`

Given $r$ permutations $g_1, \ldots, g_r$ belonging to a common group, return their commutator. Commutators are *left-normed*, so they are evaluated from left to right.

#### Properties of Permutations

<a id="function-cyclestructure-grppermelt"></a>
##### `CycleStructure(g): GrpPermElt -> [ <RngIntElt, RngIntElt> ]`

Given a permutation $g$ belonging to a group of degree $n$, return the partition of $n$ corresponding to the cycles of $g$. This partition is returned in the form of a sequence $Q$ of pairs, where the terms of $Q$ correspond to the distinct cycle lengths of $g$. The value of the term $Q[i]$ is a tuple $< l_i, n_i >$ belonging to ${\mathbb{Z}}\times {\mathbb{Z}}$. Here $l_i$ is the length of a cycle of $g$ and $n_i$ is the number of cycles of length $l_i$.

<a id="function-degree-grppermelt-2"></a>
##### `Degree(g): GrpPermElt -> RngIntElt`

Given a permutation $g$, return the degree of $g$, i.e. the number of points moved by $g$.

<a id="function-iseven-grppermelt"></a>
##### `IsEven(g): GrpPermElt -> BoolElt`

Returns `true` if the permutation $g$ is an even permutation, `false` otherwise.

<a id="function-sign-grppermelt"></a>
##### `Sign(g): GrpPermElt -> RngIntElt`

Return 1 if the permutation $g$ is even, return -1 if $g$ is odd.

<a id="function-order-grppermelt"></a>
##### `Order(g): GrpPermElt -> RngIntElt`

Order of the permutation $g$.

#### Predicates for Permutations

<a id="operation-op-eq-grppermelt-grppermelt"></a>
##### `g eq h: GrpPermElt, GrpPermElt -> BoolElt`

Given permutations $g$ and $h$ belonging to the same generic group, return `true` if $g$ and $h$ are the same element, `false` otherwise.

<a id="operation-op-ne-grppermelt-grppermelt"></a>
##### `g ne h: GrpPermElt, GrpPermElt -> BoolElt`

Given permutations $g$ and $h$ belonging to the same generic group, return `true` if $g$ and $h$ are distinct elements, `false` otherwise.

<a id="function-isid-grppermelt"></a>
##### `IsId(g): GrpPermElt -> BoolElt`

<a id="function-isidentity-grppermelt"></a>
##### `IsIdentity(g): GrpPermElt -> BoolElt`

Returns `true` if the permutation $g$ is the identity permutation.

<a id="example-ex-531aba"></a>
##### `Example: Arithmetic with Permutations (ex-531aba)`

We illustrate the permutation operations by applying them to some elements of ${\operatorname{Sym}}(9)$.

```magma
> G := Sym(9);
> x := G ! (1,2,4)(5,6,8)(3,9,7);
> y := G ! (4,5,6)(7,9,8);
> x*y;
(1, 2, 5, 4)(3, 8, 6, 7)
> x^-1;
(1, 4, 2)(3, 7, 9)(5, 8, 6)
> x^2;
(1, 4, 2)(3, 7, 9)(5, 8, 6)
> x / y;
(1, 2, 6, 9, 8, 4)(3, 7)
> x^y;
(1, 2, 5)(3, 8, 9)(4, 7, 6)
> (x, y);
(1, 7, 3, 6)(4, 5, 9, 8)
> x^y eq y^x;
false
> CycleStructure(x^2*y);
[ <6, 1>, <2, 1>, <1, 1> ]
> Degree(y);
6
> Order(x^2*y);
6
```

#### Set Operations

The creation of a base and strong generating set (BSGS) for a permutation group $G$ provides us with a very compact representation of the set of elements of $G$. A particular BSGS imposes an order on the elements of $G$ (lexicographic ordering of base images). It thus makes sense to talk about the ‘number’ of a group element relative to a particular BSGS.

<a id="operation-op-times-grpperm-grpperm"></a>
##### `G * H: GrpPerm, GrpPerm -> { GrpPermElt }`

Given permutation groups $G$ and $H$, where $G$ and $H$ both belong to the same generic group, form the set product $\{ g*h | g\in G, h\in H \}$ as a set of group elements.

<a id="function-elementset-grpperm-grpperm"></a>
##### `ElementSet(G, H): GrpPerm, GrpPerm -> { GrpPermElt }`

Given a group $G$ and a subgroup $H$ of $G$, return the elements of $H$ in the form of a set of elements of $G$. This function is only applicable to very small groups.

<a id="function-numberingmap-grpperm"></a>
##### `NumberingMap(G): GrpPerm -> Map`

A bijective mapping from the group $G$ onto the set of integers $\{ 1 \ldots |G| \rbrace$. The actual mapping depends upon the base and strong generating set chosen for $G$.

<a id="function-randomprocess-grpperm"></a>
##### `RandomProcess(G): GrpPerm -> Process`

```magma
Slots   : RngIntElt                    Default: 10
Scramble: RngIntElt                    Default: 20
```

Create a process to generate randomly chosen elements from the finite group $G$. The process is based on the product-replacement algorithm of [[CLGM+95](https://docs.magma-maths.org/references.md#cite-randomelements)], modified by the use of an accumulator. At all times, $N$ elements are stored where $N$ is the maximum of the specified value for `Slots` and `Ngens`$(G) + 1$. Initially, these are just the generators of $G$. As well, one extra group element is stored, the accumulator. Initially, this is the identity. Random elements are now produced by successive calls to `Random(P)`, where $P$ is the process created by this function. Each such call chooses one of the elements in the slots and multiplies it into the accumulator. The element in that slot is replaced by the product of it and another randomly chosen slot. The random value returned is the new accumulator value. Setting `Scramble := m` causes $m$ such operations to be performed before the process is returned.

<a id="function-random-grpperm"></a>
##### `Random(G: parameters): GrpPerm -> GrpPermElt`

```magma
Short: BoolElt                    Default: false
```

A randomly chosen element for the group $G$. If a BSGS is known for $G$, then the distribution will be uniform over $G$. If no BSGS is known, then the *random* element is chosen by multiplying out a *random* word in the generators. Since it is usually not practical to choose words long enough to properly sample the elements of $G$, the element returned will usually be biased. The boolean-valued parameter `Short` is used in this situation to indicate that a short word will suffice. Thus, if `Random` is invoked with `Short` assigned the value `true` then the element is constructed using a short word.

<a id="function-random-process"></a>
##### `Random(P): Process -> GrpPermElt`

Given a random element process $P$ created by the function `RandomProcess(G)` for the finite group $G$, construct a random element of $G$ by forming a random product over the expanded generating set constructed when the process was created. For large degree groups, or groups for which a BSGS is not known, this function should be used in preference to `Random(G)`.

<a id="function-representative-grpperm"></a>
##### `Representative(G): GrpPerm -> GrpPermElt`

<a id="function-rep-grpperm"></a>
##### `Rep(G): GrpPerm -> GrpPermElt`

An element chosen from the permutation group $G$.

<a id="example-ex-80e2ef"></a>
##### `Example: Multiplication Table of a Dihedral Group (ex-80e2ef)`

We use the function `NumberingMap` to construct the multiplication table for the dihedral group of order $12$.

```magma
> G := DihedralGroup(GrpPerm, 6);
> f := NumberingMap(G);
> [ [ f(x*y) : y in G ] : x in G ];
[
    [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 ],
    [ 2, 3, 4, 5, 6, 1, 12, 7, 8, 9, 10, 11 ],
    [ 3, 4, 5, 6, 1, 2, 11, 12, 7, 8, 9, 10 ],
    [ 4, 5, 6, 1, 2, 3, 10, 11, 12, 7, 8, 9 ],
    [ 5, 6, 1, 2, 3, 4, 9, 10, 11, 12, 7, 8 ],
    [ 6, 1, 2, 3, 4, 5, 8, 9, 10, 11, 12, 7 ],
    [ 7, 8, 9, 10, 11, 12, 1, 2, 3, 4, 5, 6 ],
    [ 8, 9, 10, 11, 12, 7, 6, 1, 2, 3, 4, 5 ],
    [ 9, 10, 11, 12, 7, 8, 5, 6, 1, 2, 3, 4 ],
    [ 10, 11, 12, 7, 8, 9, 4, 5, 6, 1, 2, 3 ],
    [ 11, 12, 7, 8, 9, 10, 3, 4, 5, 6, 1, 2 ],
    [ 12, 7, 8, 9, 10, 11, 2, 3, 4, 5, 6, 1 ]
]
```

<a id="example-ex-6247bb"></a>
##### `Example: Random Elements of a Wreath Product (ex-6247bb)`

We illustrate the use of the function `Random` using the wreath product of the symmetric group of degree $4$ and the cyclic group of order $6$.

```magma
> G := WreathProduct( Sym(4), CyclicGroup(GrpPerm, 6));
> G;
Permutation group G acting on a set of cardinality 24
    (1, 5, 9, 13, 17, 21)(2, 6, 10, 14, 18, 22) (3, 7, 11, 15, 19, 23)
        (4, 8, 12, 16, 20, 24)
    (1, 2, 3, 4)
    (1, 2)
> Order(G);
1146617856
> Random(G);
(1, 17, 12, 4, 18, 10, 3, 20, 9, 2, 19, 11)(5, 22, 13, 6, 21, 15)
    (7, 24, 16)(8, 23, 14)
```

We display the cycle structures of 10 random elements of $G$.

```magma
> R := [ CycleStructure(Random(G)) : i in [1..10] ];
> R;
[
    [ <6, 1>, <3, 6> ],
    [ <9, 1>, <6, 2>, <3, 1> ],
    [ <9, 2>, <3, 2> ],
    [ <12, 1>, <9, 1>, <3, 1> ],
    [ <18, 1>, <6, 1> ],
    [ <18, 1>, <6, 1> ],
    [ <12, 1>, <6, 2> ],
    [ <6, 3>, <2, 3> ],
    [ <6, 1>, <4, 3>, <2, 3> ],
    [ <6, 3>, <3, 2> ]
]
```

### Conjugacy

Here we look at conjugacy classes of the group $G$. When the classes of $G$ are stored they will be ordered so that the element orders are increasing and, second to this, by increasing class length. Apart from this the ordering is random. If the user chooses to assert conjugacy classes the ordering must agree with this ordering. Once the ordering of classes for a particular group is set, it may not be changed.

<a id="function-class-grpperm-grppermelt"></a>
#### `Class(H, x): GrpPerm, GrpPermElt -> { GrpPermElt }`

<a id="function-conjugates-grpperm-grppermelt"></a>
#### `Conjugates(H, x): GrpPerm, GrpPermElt -> { GrpPermElt }`

Given a group $H$ and an element $x$ belonging to a group $K$ such that $H$ and $K$ are subgroups of the same symmetric group, this function returns the set of conjugates of $x$ under the action of $H$. If $H = K$, the function returns the conjugacy class of $x$ in $H$.

<a id="function-conjugacyclasses-grpperm"></a>
#### `ConjugacyClasses(G: parameters): GrpPerm -> [ <RngIntElt, RngIntElt, GrpPermElt> ]`

<a id="function-classes-grpperm"></a>
#### `Classes(G: parameters): GrpPerm -> [ <RngIntElt, RngIntElt, GrpPermElt> ]`

```magma
Reps        : [ <GrpPermElt, RngIntElt> ]                    Default: 
Al          : MonStgElt                                      Default: "Default"
WeakLimit   : RngIntElt                                      Default: 500
StrongLimit : RngIntElt                                      Default: 5000
TFAl        : MonStgElt                                      Default: "Default"
ASAl        : MonStgElt                                      Default: "Default"
Centralisers: BoolElt                                        Default: false
PowerMap    : BoolElt                                        Default: false
```

Construct a set of representatives for the conjugacy classes of $G$. The classes are returned as a sequence of triples containing the element order, the class length, and a representative element for the class. The parameters `Reps` and `Al` enable the user to select the algorithm that is to be used.

`Reps := Q`: Create the classes of $G$ by using the random algorithm but using the group elements in $Q$ as the “random” elements tried. The element orders and lengths of the classes will be computed and checked for consistency. Note that this function may re-order the given elements.

`Reps := Q` Create the classes of $G$ assuming that the first elements of the tuples in $Q$ form a complete set of conjugacy class representatives and the corresponding integer is the size of the conjugacy class. The only check performed is that the class sizes sum to the group order.

`Al := "Action"`: Create the classes of $G$ by computing the orbits of the set of elements of $G$ under the action of conjugation. This option is only feasible for small groups.

`Al := "Random"`: Construct the conjugacy classes of elements for a permutation group $G$ using an algorithm that searches for representatives of all conjugacy classes of $G$ by examining a random selection of group elements and their powers. The behaviour of this algorithm is controlled by two associated optional parameters `WeakLimit` and `StrongLimit`, whose values are positive integers $n_1$ and $n_2$, say. Before describing the effect of these parameters, some definitions are needed: A mapping $f: G\rightarrow I$ is called a class invariant if $f(g) = f(g^h)$ for all $g, h\in G$. For permutation groups, the cycle structure of $g$ is a readily computable class invariant. Two elements $g$ and $h$ are said to be *weakly conjugate* with respect to the class invariant $f$ if $f(g) = f(h)$. By definition, conjugacy implies weak conjugacy, but the converse is false. The random algorithm first examines $n_1$ random elements and their powers, using a test for weak conjugacy. It then proceeds to examine a further $n_2$ random elements and their powers, using a test for ordinary conjugacy. The idea behind this strategy is that the algorithm should attempt to find as many classes as possible using the very cheap test for weak conjugacy, before employing the more expensive ordinary conjugacy test to recognize the remaining classes.

`Al := "Inductive"`: Use G. Butler’s inductive method to compute the classes. See Butler [[But94](https://docs.magma-maths.org/references.md#cite-inductive-classes)] for a description of the algorithm. The action and random algorithms are used by this algorithm to find the classes of any small groups it is called upon to deal with.

`Al := "Extend"`: Construct the conjugacy classes of $G$ by first computing classes in a quotient $G/N$ and then extending these classes to successively larger quotients $G/H$ until the classes for $G/1$ are known. More precisely, a series of subgroups $1 = G_0 < G_1 < \cdots < G_r = R < G$ is computed such that $R$ is the (solvable) radical of $G$ and $G_{i+1}/G_i$ is elementary abelian. The radical quotient $G/R$ is computed and its classes and centralizers of their representatives found and pulled back to $G$. The parameters `TFAl` and `ASAl` control the algorithm used to compute the classes of $G/R$.

To extend from $G/G_{i+1}$ to the next larger quotient $G/G_i$, an affine action of each centralizer on a quotient of the elementary abelian layer $G_{i+1}/G_i$ is computed. Each distinct orbit in that action gives rise to a new class of the larger quotient (see Mecky and Neubuser [[MN89](https://docs.magma-maths.org/references.md#cite-mecky-neubuser)]).

`Al := "Default"`: First some special cases are checked for: If `IsAltsym(G)` then the classes of $G$ are computed from the partitions of `Degree(G)`. If $G$ is solvable, an isomorphic representation of $G$ as a pc-group is computed and the classes computed in that representation. In general, the action algorithm will be used if $|G|\leq 5000$, otherwise the extension algorithm will be applied.

This parameter controls the algorithm used to compute the classes of a group with trivial Fitting subgroup, such as the group $G/R$ in the description of the `"Extend"` method. The possible settings are the same as for `Al`, except that `"Extend"` is not a valid choice. The `"Action"`, `"Random"`, and `"Inductive` settings behave as described above. The default algorithm is Derek Holt’s generalisation of the Cannon/Souvignier fusion method to all classes of the group. The original fusion algorithm used fusion only on classes within a direct product normal subgroup, see [[CS97](https://docs.magma-maths.org/references.md#cite-conj-classes-permg)]. Holt has extended the use of fusion to all conjugacy classes, avoiding the random part of the Cannon/Souvignier method. This algorithm must use another algorithm to find the classes of almost simple groups arising from the socle of the TF-group. The algorithm used for this is controlled by the parameter `ASAl`.

This parameter controls the algorithm used to compute the classes of an almost simple group from within the default TF-group algorithm. The possibilities for this parameter are as for `TFAl`. The default algorithm first determines if `Altsym(G)` is true. If so, classes are deduced from the partitions of `Degree(G)`. Next, if the order of $G$ is $\le 5000$ then the action algorithm is used. If the socle of $G$ has the correct order to be $PSL(2,q)$, for some $q$, then the random algorithm is used on $G$. Otherwise the inductive algorithm is used.

A flag to force the storing of the centralisers of the class representatives with the class table. This does not apply to the action algorithm. In the case of the extension algorithm, this will do extra work to lift the centralisers through the final elementary abelian layer.

A flag to force the storing of whatever power map information is produced by the classes algorithm used. In the case of the extension algorithm, this flag forces the computation of the full power map en-route, and may take considerably longer than not doing so. However, it is overall faster to set this flag true when the `PowerMap` is going to be computed anyway.

<a id="function-classrepresentative-grpperm-grppermelt"></a>
#### `ClassRepresentative(G, x): GrpPerm, GrpPermElt -> GrpPermElt`

<a id="function-classrepresentative-grpperm-rngintelt"></a>
#### `ClassRepresentative(G, i): GrpPerm, RngIntElt -> GrpPermElt`

Given a group $G$ for which the conjugacy classes are known, return the stored representative for the conjugacy class of $G$ containing $x$ or the stored representative of conjugacy class $i$.

<a id="function-classcentraliser-grpperm-rngintelt"></a>
#### `ClassCentraliser(G, i): GrpPerm, RngIntElt -> GrpPerm`

<a id="function-classcentralizer-grpperm-rngintelt"></a>
#### `ClassCentralizer(G, i): GrpPerm, RngIntElt -> GrpPerm`

The centraliser of the representative element stored for conjugacy class number $i$ in group $G$. The group computed is stored with the class table for reference by future calls to this function.

<a id="function-classmap-grpperm"></a>
#### `ClassMap(G: parameters): GrpPerm -> Map`

Given a group $G$, construct the conjugacy classes and the class map $f$ for $G$. For any element $x$ of $G$, $f(x)$ will be the index of the conjugacy class of $x$ in the sequence returned by the `Classes` function. If the parameter `Orbits` is set `true`, the classes are computed as orbits of elements under conjugation and the class map is stored as a list of images of the elements of $G$ (a list of length $|G|$). This option gives fast evaluation of the class map but is practical only in the case of very small groups. With `Orbits := false`, `WeakLimit` and `StrongLimit` are used to control the random classes algorithm (see function `Classes`).

<a id="function-isconjugate-grpperm-grppermelt-grppermelt"></a>
#### `IsConjugate(G, g, h: parameters): GrpPerm, GrpPermElt, GrpPermElt -> BoolElt, GrpPermElt`

```magma
Centralizer  : MonStgElt                    Default: "Default"
LeftSubgroup : GrpPerm                      Default: 
RightSubgroup: GrpPerm                      Default: 
```

Given a group $G$ and elements $g$ and $h$ with a common covering group, return the value `true` if $g$ and $h$ are conjugate with respect to $G$. The function returns a second value if the elements are conjugate: an element $k\in G$ that conjugates $g$ to $h$. The method used is the backtrack search of Leon [[Leo97](https://docs.magma-maths.org/references.md#cite-leon2)]. This search may be speeded considerably by knowledge of (subgroups of) the centralizers of $g$ and $h$ in $G$. The parameters relate to these subgroups.

The `LeftSubgroup` and `RightSubgroup` parameters enable the user to supply known subgroups of the centralizers of $g$ and $h$ respectively to the algorithm. Neither is supplied by default. The `Centralizer` parameter controls whether the algorithm starts by computing one or both centralizers in full before the conjugacy test. The `"Default"` behaviour is to compute the left centralizer, i.e. $C_G(g)$, unless either a left or right subgroup is specified, in which case no centralizer calculation is done. Other possible values are the four possibilities `"Left"` which forces computation of $C_G(g)$, `"Right"` which forces $C_G(h)$ to be computed, `"Both"` which computes both centralizers, and `"None"` which will compute no centralizers. With `"None"` and neither subgroup given, the search runs with no known subgroup on either side.

<a id="function-isconjugate-grpperm-grpperm-grpperm"></a>
#### `IsConjugate(G, H, K: parameters): GrpPerm, GrpPerm, GrpPerm -> BoolElt, GrpPermElt`

```magma
Compute      : MonStgElt                    Default: "Default"
LeftSubgroup : GrpPerm                      Default: H
RightSubgroup: GrpPerm                      Default: K
```

Given groups $G$, $H$, and $K$ with a common covering group, return `true` if $H$ and $K$ are conjugate with respect to $G$. The function returns a second value if the subgroups are conjugate: an element $z\in G$ that conjugates $H$ to $K$. The method used is the backtrack search of Leon [[Leo97](https://docs.magma-maths.org/references.md#cite-leon2)].

This parameter may be set to any of “Both”, “Default”, “Left”, “None”, or “Right”. This controls which normalisers are computed before starting the conjugacy test. The default strategy is currently “Left”, which computes the normalizer of $H$ in $G$ before starting the conjugacy test between $H$ and $K$. The greater the difference between $H$ and $K$ and their normalizers in $G$, the more helpful to the search it is to compute their normalizers.

Instead of having the `IsConjugate` function compute the normalizers of $H$ and $K$, the user may supply any known subgroup of $G$ normalizing $H$ (as `LeftSubgroup`) or normalizing $K$ (as `RightSubgroup`) to be used as the normalizing groups to aid the search.

<a id="function-exponent-grpperm"></a>
#### `Exponent(G): GrpPerm -> RngIntElt`

The exponent of the group $G$. This is computed as the product of the exponents of the Sylow subgroups fo $G$.

<a id="function-numberofclasses-grpperm"></a>
#### `NumberOfClasses(G): GrpPerm -> RngIntElt`

<a id="function-nclasses-grpperm"></a>
#### `Nclasses(G): GrpPerm -> RngIntElt`

The number of conjugacy classes of elements for the group $G$.

<a id="function-powermap-grpperm"></a>
#### `PowerMap(G): GrpPerm -> Map`

Given a group $G$, construct the power map for G. Suppose that the order of $G$ is $m$ and that $G$ has $r$ conjugacy classes. When the classes are determined by Magma, they are numbered from $1$ to $r$. Let $C$ be the set of class indices $\{ 1, \ldots, r \rbrace$ and let $Z$ be the set of integers. The *power map* $f$ for $G$ is the mapping  $f : C \times Z \rightarrow C$ where the value of $f(i, j)$ for $i \in C$ and $j \in Z$ is the number of the class which contains $x_i^j$, where $x_i$ is a representative of the $i$-th conjugacy class.

<a id="procedure-assertattribute-grpperm-monstgelt-seqenum-classes"></a>
#### `AssertAttribute(G, "Classes", Q): GrpPerm, MonStgElt, SeqEnum`

An alternative form for setting this attribute is ``G`Classes := Q;``. Assert the class representatives of $G$. If $Q$ is a sequence of group elements then the action taken is identical to using the `ConjugacyClasses` function described above, with the parameter `Reps` set to $Q$. If $Q$ is a sequence of triples $\langle a, \ell, x \rangle$ then it is assumed to be the full class table, each $x$ has order $a$, and the class length of $x$ in $G$ is $\ell$. This assertion sets the class table with classes in the order as given by $Q$, so this order must agree with the conventions of increasing element order and then increasing class length.

<a id="example-ex-1e8f6a"></a>
#### `Example: Conjugacy Classes of M11 (ex-1e8f6a)`

The conjugacy classes of the Mathieu group $M_{11}$ can be constructed as follows:

```magma
> SetSeed(2);
> M11 := sub<Sym(11) | (1,10)(2,8)(3,11)(5,7), (1,4,7,6)(2,11,10,9)>;
> Classes(M11);
Conjugacy Classes of group M11
------------------------------
[1]     Order 1       Length 1
        Rep Id(M11)

[2]     Order 2       Length 165
        Rep (3, 10)(4, 9)(5, 6)(8, 11)

[3]     Order 3       Length 440
        Rep (1, 2, 4)(3, 5, 10)(6, 8, 11)

[4]     Order 4       Length 990
        Rep (3, 6, 10, 5)(4, 8, 9, 11)

[5]     Order 5       Length 1584
        Rep (1, 3, 6, 2, 8)(4, 7, 10, 9, 11)

[6]     Order 6       Length 1320
        Rep (1, 11, 2, 6, 4, 8)(3, 10, 5)(7, 9)

[7]     Order 8       Length 990
        Rep (1, 4, 5, 6, 2, 7, 11, 10)(8, 9)

[8]     Order 8       Length 990
        Rep (1, 7, 5, 10, 2, 4, 11, 6)(8, 9)

[9]     Order 11      Length 720
        Rep (1, 11, 9, 10, 4, 3, 7, 2, 6, 5, 8)

[10]    Order 11      Length 720
        Rep (1, 9, 4, 7, 6, 8, 11, 10, 3, 2, 5)
```

<a id="example-ex-d654b2"></a>
#### `Example: Random Class Parameters for Higman-Sims (ex-d654b2)`

The default values for the random class algorithm are adequate for a large variety of groups. We look at what happens when we vary the parameters in the case of the Higman-Sims simple group represented on 100 letters. In this case the default strategy reduces to a random search. The first choice of parameters does not look at enough random elements. Increasing the limit on the number of random elements examined will ensure the algorithm succeeds.

```magma
> G := sub<Sym(100) |
>    (2,8,13,17,20,22,7)(3,9,14,18,21,6,12)(4,10,15,19,5,11,16)
>        (24,77,99,72,64,82,40)(25,92,49,88,28,65,90)(26,41,70,98,91,38,75)
>        (27,55,43,78,86,87,45)(29,69,59,79,76,35,67)(30,39,42,81,36,57,89)
>        (31,93,62,44,73,71,50)(32,53,85,60,51,96,83)(33,37,58,46,84,100,56)
>        (34,94,80,61,97,48,68)(47,95,66,74,52,54,63),
>    (1,35)(3,81)(4,92)(6,60)(7,59)(8,46)(9,70)(10,91)(11,18)(12,66)(13,55)
>        (14,85)(15,90)(17,53)(19,45)(20,68)(21,69)(23,84)(24,34)(25,31)(26,32)
>        (37,39)(38,42)(40,41)(43,44)(49,64)(50,63)(51,52)(54,95)(56,96)(57,100)
>        (58,97)(61,62)(65,82)(67,83)(71,98)(72,99)(74,77)(76,78)(87,89) >;
> K := Classes(G:WeakLimit := 20, StrongLimit := 50);
Runtime error in 'Classes': Random classes algorithm failed
> K := Classes(G: WeakLimit := 20, StrongLimit := 100);
> NumberOfClasses(G);
24
```

As the group has only 24 classes, the first random search could have succeeded by looking at 50 elements. On this occasion it did not, but looking at 100 elements did succeed.

We print the order, length, and cycle structure for each conjugacy class.

```magma
> [ < k[1], k[2], CycleStructure(k[3]) > : k in K ];
[
       <1, 1, [ <1, 100> ]>,
       <2, 5775, [ <2, 40>, <1, 20> ]>,
       <2, 15400, [ <2, 50> ]>,
       <3, 123200, [ <3, 30>, <1, 10> ]>,
       <4, 11550, [ <4, 20>, <2, 10> ]>,
       <4, 173250, [ <4, 20>, <2, 6>, <1, 8> ]>,
       <4, 693000, [ <4, 20>, <2, 8>, <1, 4> ]>,
       <5, 88704, [ <5, 20> ]>,
       <5, 147840, [ <5, 20> ]>,
       <5, 1774080, [ <5, 19>, <1, 5> ]>,
       <6, 1232000, [ <6, 15>, <2, 5> ]>,
       <6, 1848000, [ <6, 12>, <3, 6>, <2, 4>, <1, 2> ]>,
       <7, 6336000, [ <7, 14>, <1, 2> ]>,
       <8, 2772000, [ <8, 10>, <4, 4>, <2, 2> ]>,
       <8, 2772000, [ <8, 10>, <4, 3>, <2, 3>, <1, 2> ]>,
       <8, 2772000, [ <8, 10>, <4, 4>, <2, 2> ]>,
       <10, 2217600, [ <10, 8>, <5, 4> ]>,
       <10, 2217600, [ <10, 10> ]>,
       <11, 4032000, [ <11, 9>, <1, 1> ]>,
       <11, 4032000, [ <11, 9>, <1, 1> ]>,
       <12, 3696000, [ <12, 6>, <6, 3>, <4, 2>, <2, 1> ]>,
       <15, 2956800, [ <15, 6>, <5, 2> ]>,
       <20, 2217600, [ <20, 4>, <10, 2> ]>,
       <20, 2217600, [ <20, 4>, <10, 2> ]>
]
```

We construct the power map and tabulate the second, third, and fifth powers of each class.

```magma
> p := PowerMap(G);
> [ < i, p(i, 2), p(i, 3), p(i, 5) > : i in [1 .. #K] ];
[
    <1, 1, 1, 1>,
    <2, 1, 2, 2>,
    <3, 1, 3, 3>,
    <4, 4, 1, 4>,
    <5, 2, 5, 5>,
    <6, 2, 6, 6>,
    <7, 2, 7, 7>,
    <8, 8, 8, 1>,
    <9, 9, 9, 1>,
    <10, 10, 10, 1>,
    <11, 4, 3, 11>,
    <12, 4, 2, 12>,
    <13, 13, 13, 13>,
    <14, 7, 14, 14>,
    <15, 6, 15, 15>,
    <16, 7, 16, 16>,
    <17, 8, 17, 2>,
    <18, 9, 18, 3>,
    <19, 20, 19, 19>,
    <20, 19, 20, 20>,
    <21, 12, 5, 21>,
    <22, 22, 9, 4>,
    <23, 17, 23, 5>,
    <24, 17, 24, 5>
]
```

### Subgroups

#### Construction of a Subgroup

<a id="constructor-constructor-sub-grpperm-list-grpperm"></a>
##### `sub<G | L>: GrpPerm, List -> GrpPerm`

Given the permutation group $G$, construct the subgroup $H$ of $G$, generated by the elements specified by the list $L$, where $L$ is a list of one or more items of the following types:

**(a)**
A sequence of $n$ integers defining a permutation of $G$;

**(b)**
A set or sequence of sequences of type (a);

**(c)**
An element of $G$;

**(d)**
A set or sequence of elements of $G$;

**(e)**
A subgroup of $G$;

**(f)**
A set or sequence of subgroups of $G$.

Each element or group specified by the list must belong to the *same* generic permutation group. The subgroup $H$ will be constructed as a subgroup of some group which contains each of the elements and groups specified in the list. The generators of $H$ consist of the elements specified by the terms of the list $L$ together with the stored generators for groups specified by terms of the list.

<a id="constructor-constructor-ncl-grpperm-list-grpperm"></a>
##### `ncl<G | L>: GrpPerm, List -> GrpPerm`

Given the permutation group $G$, construct the subgroup $H$ of $G$ that is the *normal closure* of the subgroup $H$ generated by the elements specified by the list $L$ (see [[BC82](https://docs.magma-maths.org/references.md#cite-perm-matrix-i)]), where the possibilities for $L$ are the same as for the `sub`-constructor.

<a id="example-ex-dfcc0d"></a>
##### `Example: Ways to Define PGL(2, 7) (ex-dfcc0d)`

The group ${\operatorname{PGL}}(2, 7)$ in its natural action on projective points is generated by the set of permutations $\{ (1,2,3,4,5,6,7), (2,4,3,7,5,6), (1,8)(2,7)(3,4)(5,6) \}$.

Using the above syntax, the group may be defined in any of the following ways: By means of a list of generating permutations written as products of cycles:

```magma
> PGL27 := sub< Sym(8) | (1,2,3,4,5,6,7), (2,4,3,7,5,6), (1,8)(2,7)(3,4)(5,6)>;
> PGL27;
Permutation group PGL27 acting on a set of cardinality 8
    (1, 2, 3, 4, 5, 6, 7)
    (2, 4, 3, 7, 5, 6)
    (1, 8)(2, 7)(3, 4)(5, 6)
```

By means of a list of integer sequences representing generators:

```magma
> PGL27 := sub< Sym(8) |
>               [2,3,4,5,6,7,1,8], [1,4,7,3,6,2,5,8], [8,7,4,3,6,5,2,1] >;
```

In terms of preassigned elements of the symmetric group of degree 8:

```magma
> S8 := Sym(8);
> a := S8!(1,2,3,4,5,6,7);
> b := S8!(2,4,3,7,5,6);
> c := S8!(1,8)(2,7)(3,4)(5,6);
> PGL27 := sub<S8 | a, b, c>;
```

By means of a set of generators:

```magma
> S8 := Sym(8);
> gens := { S8 | (1,2,3,4,5,6,7), (2,4,3,7,5,6), (1,8)(2,7)(3,4)(5,6) };
> PGL27 := sub<S8 | gens>;
```

By means of a sequence of generators:

```magma
> S8 := Sym(8);
> gens := [ S8 | (1,2,3,4,5,6,7), (2,4,3,7,5,6), (1,8)(2,7)(3,4)(5,6) ];
> PGL27 := sub<S8 | gens>;
```

<a id="example-ex-f29910"></a>
##### `Example: Action on Unordered Pairs (ex-f29910)`

A representation $H$ of a $2$-generator transitive group $G$ in its action on unordered pairs is constructed as follows:

```magma
> G := AlternatingGroup(7);
> deg1 := Degree(G);
> pairs := [ { i, j } : j in [i+1..deg1], i in [1..deg1-1] ];
> deg2 := #pairs;
> h1 := [ Position(pairs, pairs[i] ^ G.1): i in [1..deg2] ];
> h2 := [ Position(pairs, pairs[i] ^ G.2): i in [1..deg2] ];
> H := sub<Sym(deg2) | h1, h2>;
> H;
Permutation group H acting on a set of cardinality 21
 (2,3,4,5,6)(7,8,9,10,11)(12,16,19,21,15)(13,17,20,14,18),
 (1,7,2)(3,8,12)(4,9,13)(5,10,14)(6,11,15)
```

<a id="example-ex-9bd7f8"></a>
##### `Example: Derived Subgroup via Normal Closure (ex-9bd7f8)`

We illustrate the `ncl`-constructor by using it to construct the derived subgroup of the Hessian group $H$. We exploit the fact that the derived subgroup may be obtained as the normal closure of the subgroup generated by the commutators of the generators of $H$.

```magma
> H := PermutationGroup< 9 | (1,2,4)(5,6,8)(3,9,7), (4,5,6)(7,9,8) >;
> Order(H);
216
> D := ncl< H | (H.1, H.2) >;
> D;
Permutation group D acting on a set of cardinality 9
Order = 72 = 2^3 * 3^2
    (1, 7, 3, 6)(4, 5, 9, 8)
    (2, 9, 3, 5)(4, 6, 7, 8)
    (2, 6, 3, 8)(4, 5, 7, 9)
```

#### Membership and Equality

<a id="operation-op-in-grppermelt-grpperm"></a>
##### `g in G: GrpPermElt, GrpPerm -> BoolElt`

Given a permutation $g$ and a permutation group $G$, return `true` if $g$ is an element of $G$, `false` otherwise.

<a id="operation-op-notin-grppermelt-grpperm"></a>
##### `g notin G: GrpPermElt, GrpPerm -> BoolElt`

Given a permutation $g$ and a permutation group $G$, return `true` if $g$ is not an element of $G$, `false` otherwise.

<a id="operation-op-subset-grppermelt-grpperm"></a>
##### `S subset G: { GrpPermElt }, GrpPerm -> BoolElt`

Given a permutation group $G$ and a set $S$ of permutations belonging to a group $H$, where $G$ and $H$ belong the same generic group, return `true` if $S$ is a subset of $G$, `false` otherwise.

<a id="operation-operation-notsubset-grppermelt-grpperm-boolelt"></a>
##### `S notsubset G: { GrpPermElt }, GrpPerm -> BoolElt`

Given a permutation group $G$ and a set $S$ of permutations belonging to a group $H$, where $G$ and $H$ belong the same generic group, return `true` if $S$ is not a subset of $G$, `false` otherwise.

<a id="operation-op-subset-grpperm-grpperm"></a>
##### `H subset G: GrpPerm, GrpPerm -> BoolElt`

<a id="function-issubgroup-grpperm-grpperm"></a>
##### `IsSubgroup(H, G): GrpPerm, GrpPerm -> BoolElt`

Given permutation groups $G$ and $H$ belonging to the same generic group, return `true` if $H$ is a subgroup of $G$, `false` otherwise.

<a id="operation-operation-notsubset-grpperm-grpperm-boolelt"></a>
##### `H notsubset G: GrpPerm, GrpPerm -> BoolElt`

Given permutation groups $G$ and $H$ belonging to the same generic group, return `true` if $H$ is not a subgroup of $G$, `false` otherwise.

<a id="operation-op-eq-grpperm-grpperm"></a>
##### `H eq G: GrpPerm, GrpPerm -> BoolElt`

Given permutation groups $G$ and $H$ belonging to the same generic group, return `true` if $G$ and $H$ are the same group, `false` otherwise.

<a id="operation-op-ne-grpperm-grpperm"></a>
##### `H ne G: GrpPerm, GrpPerm -> BoolElt`

Given permutation groups $G$ and $H$ belonging to the same generic group, return `true` if $G$ and $H$ are distinct groups, `false` otherwise.

#### Elementary Properties of a Subgroup

<a id="function-index-grpperm-grpperm"></a>
##### `Index(G, H): GrpPerm, GrpPerm -> RngIntElt`

The index of the subgroup $H$ in the group $G$. The index is returned as an integer. If the orders of $G$ and $H$ are not known, they will be computed.

<a id="function-factoredindex-grpperm-grpperm"></a>
##### `FactoredIndex(G, H): GrpPerm, GrpPerm -> [ <RngIntElt, RngIntElt> ]`

The index of the subgroup $H$ in the group $G$. The index is returned as a factored integer. The format is the same as for `FactoredOrder`. If the orders of $G$ and $H$ are not known, they will be computed.

<a id="function-iscentral-grpperm-grpperm"></a>
##### `IsCentral(G, H): GrpPerm, GrpPerm -> BoolElt`

Returns `true` if the subgroup $H$ of the group $G$ lies in the centre of $G$, `false` otherwise.

<a id="function-isnormal-grpperm-grpperm"></a>
##### `IsNormal(G, H): GrpPerm, GrpPerm -> BoolElt`

Returns `true` if the subgroup $H$ of the group $G$ is a normal subgroup of $G$, `false` otherwise.

<a id="function-isselfnormalizing-grpperm-grpperm"></a>
##### `IsSelfNormalizing(G, H): GrpPerm, GrpPerm -> BoolElt`

<a id="function-isselfnormalising-grpperm-grpperm"></a>
##### `IsSelfNormalising(G, H): GrpPerm, GrpPerm -> BoolElt`

Returns `true` if the subgroup $H$ of the group $G$ is self-normalizing in $G$, `false` otherwise.

<a id="function-issubnormal-grpperm-grpperm"></a>
##### `IsSubnormal(G, H): GrpPerm, GrpPerm -> BoolElt`

Returns `true` if the subgroup $H$ of the group $G$ is subnormal in $G$, `false` otherwise.

#### Standard Subgroups

Unless the order is already known, each of the functions in this family will create a base and strong generating set for the group if one does not already exist.

<a id="operation-op-pow-grpperm-grppermelt"></a>
##### `H ^ g: GrpPerm, GrpPermElt -> GrpPerm`

<a id="function-conjugate-grpperm-grppermelt"></a>
##### `Conjugate(H, g): GrpPerm, GrpPermElt -> GrpPerm`

Construct the conjugate $g^{-1}*H*g$ of the permutation group $H$ by the permutation $g$. The group $H$ and the element $g$ must belong to the same symmetric group.

<a id="operation-op-meet-grpperm-grpperm"></a>
##### `H meet K: GrpPerm, GrpPerm -> GrpPerm`

Given groups $H$ and $K$ which belong to the same symmetric group, construct the intersection of $H$ and $K$. The intersection is found using the backtrack search of J. Leon [[Leo97](https://docs.magma-maths.org/references.md#cite-leon2)].

<a id="function-intersectionwithnormalsubgroup-grpperm-grpperm"></a>
##### `IntersectionWithNormalSubgroup(G, N: parameters): GrpPerm, GrpPerm -> GrpPerm`

```magma
Check: BoolElt                    Default: true
```

Given groups $G$ and $N$ which belong to the same symmetric group and so that $G$ normalises $N$, construct the intersection of $G$ and $N$. The algorithm used is that of Cooperman, Finkelstein, and Luks [[CFL89](https://docs.magma-maths.org/references.md#cite-cfl-pointstabs)], which uses a permutation representation of double the degree of $G$ and $N$. Setting `Check` to `false` suppresses checking that $G$ normalises $N$.

<a id="function-commutatorsubgroup-grpperm-grpperm-grpperm"></a>
##### `CommutatorSubgroup(G, H, K): GrpPerm, GrpPerm, GrpPerm -> GrpPerm`

<a id="function-commutatorsubgroup-grpperm-grpperm"></a>
##### `CommutatorSubgroup(H, K): GrpPerm, GrpPerm -> GrpPerm`

Given groups $H$ and $K$, both subgroups of the group $G$, construct the commutator subgroup of $H$ and $K$ in the group $G$. If $K$ is a subgroup of $H$, then the group $G$ may be omitted. The algorithm used is described in [[BC82](https://docs.magma-maths.org/references.md#cite-perm-matrix-i)].

<a id="function-centralizer-grpperm-grppermelt"></a>
##### `Centralizer(G, g: parameters): GrpPerm, GrpPermElt -> GrpPerm`

<a id="function-centraliser-grpperm-grppermelt"></a>
##### `Centraliser(G, g: parameters): GrpPerm, GrpPermElt -> GrpPerm`

```magma
Subgroup: GrpPerm                    Default: 
```

Construct the centralizer of the permutation $g$ in the group $G$; $g$ and $G$ must belong to a common symmetric group. A backtrack search through $G$ as described in [[Leo97](https://docs.magma-maths.org/references.md#cite-leon2)] is employed.

The parameter `Subgroup` may be used to supply a known subgroup of the centralizer. This may speed the search.

<a id="function-centralizer-grpperm-grpperm"></a>
##### `Centralizer(G, H): GrpPerm, GrpPerm -> GrpPerm`

<a id="function-centraliser-grpperm-grpperm"></a>
##### `Centraliser(G, H): GrpPerm, GrpPerm -> GrpPerm`

Construct the centralizer of the group $H$ in the group $G$; $G$ and $H$ must belong to a common symmetric group. A backtrack search through $G$ as described in [[Leo97](https://docs.magma-maths.org/references.md#cite-leon2)] is employed.

<a id="function-centralizerofnormalsubgroup-grpperm-grpperm"></a>
##### `CentralizerOfNormalSubgroup(G, H): GrpPerm, GrpPerm -> GrpPerm`

Given $G$ and $H$, belonging to a common symmetric group, with the restriction that $H$ is a normal subgroup of $G$, construct the centralizer of $H$ in $G$. A polynomial-time reduction algorithm described in Beals [[Bea93](https://docs.magma-maths.org/references.md#cite-beals-phd)] is used.

<a id="function-sectioncentraliser-grpperm-grpperm-grpperm"></a>
##### `SectionCentraliser(G, H, K): GrpPerm, GrpPerm, GrpPerm -> GrpPerm`

<a id="function-sectioncentralizer-grpperm-grpperm-grpperm"></a>
##### `SectionCentralizer(G, H, K): GrpPerm, GrpPerm, GrpPerm -> GrpPerm`

Return the full preimage in $G$ of the centralizer in $G/K$ of $H/K$. The groups $H$ and $K$ must be normal subgroups of $G$ with $K$ contained in $H$. An algorithm of Luks [[Luk93](https://docs.magma-maths.org/references.md#cite-luks-polynomial)] is employed which involves computing the core of a subgroup in a group having twice the degree of $G$.

<a id="function-core-grpperm-grpperm"></a>
##### `Core(G, H): GrpPerm, GrpPerm -> GrpPerm`

Given a subgroup $H$ of the permutation group $G$, construct the maximal normal subgroup of $G$ that is contained in the subgroup $H$. The algorithm employs repeated conjugation and intersection using the backtrack search of Leon [[Leo97](https://docs.magma-maths.org/references.md#cite-leon2)].

<a id="operation-op-pow-grpperm-grpperm"></a>
##### `H ^ G: GrpPerm, GrpPerm -> GrpPerm`

<a id="function-normalclosure-grpperm-grpperm"></a>
##### `NormalClosure(G, H): GrpPerm, GrpPerm -> GrpPerm`

Given a subgroup $H$ of the permutation group $G$, construct the normal closure of $H$ in $G$.

<a id="function-normalizer-grpperm-grpperm"></a>
##### `Normalizer(G, H: parameters): GrpPerm, GrpPerm -> GrpPerm`

<a id="function-normaliser-grpperm-grpperm"></a>
##### `Normaliser(G, H: parameters): GrpPerm, GrpPerm -> GrpPerm`

```magma
Subgroup: GrpPerm                      Default: H
Bound   : RngIntElt                    Default: 
```

Given a subgroup $H$ of the group $G$, construct the normalizer of $H$ in $G$. A backtrack search as described in Leon [[Leo97](https://docs.magma-maths.org/references.md#cite-leon2)] is employed.

The parameter `Subgroup` may be used to pass the search a known subgroup of the normalizer. The default value of the starting subgroup is $H$. If `Bound` is set, the search will be terminated once the normalizing group found has order at least equal to `Bound`. If this does not happen, the search will complete as normal.

<a id="function-symmetricnormalizer-grpperm"></a>
##### `SymmetricNormalizer(G): GrpPerm -> GrpPerm`

<a id="function-symmetricnormaliser-grpperm"></a>
##### `SymmetricNormaliser(G): GrpPerm -> GrpPerm`

```magma
Subgroup: GrpPerm                      Default: H
Bound   : RngIntElt                    Default: 
```

Given a permutation group $G$ acting on the set $X$, return the normalizer of $G$ in the symmetric group on $X$. The parameters are as for `Normalizer` above.

<a id="function-sylowsubgroup-grpperm-rngintelt"></a>
##### `SylowSubgroup(G, p): GrpPerm, RngIntElt -> GrpPerm`

<a id="function-sylow-grpperm-rngintelt"></a>
##### `Sylow(G, p): GrpPerm, RngIntElt -> GrpPerm`

Given a group $G$ and a prime $p$, construct a Sylow $p$-subgroup of $G$. The algorithm used is that of Cannon, Cox, and Holt [[CCH97](https://docs.magma-maths.org/references.md#cite-sylow-permg)].

<a id="example-ex-ea0914"></a>
##### `Example: Standard Subgroups of a Degree 30 Group (ex-ea0914)`

We illustrate the use of these functions by applying them to a group of degree $30$.

```magma
> M := PermutationGroup< 30 |
>         (1,2,3)(4,14,8)(5,15,9)(6,13,7)(25,27,26),
>         (4,20,13)(5,21,14)(6,19,15)(16,17,18)(27,28,29),
>         (1, 15)(2, 13)(3, 14)(4, 22)(5, 23)(6, 24)(7, 18)(8, 16)
>           (9, 17)(10, 21)(11, 19)(12, 20)(25, 29)(26, 27)(28, 30) >;
> FactoredOrder(M);
[ <2, 8>, <3, 10>, <5, 1> ]
> S2 := SylowSubgroup(M, 2);
> S2;
Permutation group S2 acting on a set of cardinality 30
Order = 256 = 2^8
    (1, 10)(2, 11)(3, 12)(4, 8)(5, 9)(6, 7)(13, 19)(14, 20)(15, 21)
        (16, 22)(17, 23)(18, 24)
    (1, 24)(2, 22)(3, 23)(4, 14)(5, 15)(6, 13)(7, 19)(8, 20)(9, 21)
        (10, 18)(11, 16)(12, 17)
    (4, 8)(5, 9)(6, 7)(13, 19)(14, 20)(15, 21)
    (4, 14)(5, 15)(6, 13)(7, 19)(8, 20)(9, 21)(25, 26)(29, 30)
    (1, 4)(2, 5)(3, 6)(7, 12)(8, 10)(9, 11)(13, 23)(14, 24)(15, 22)
        (16, 21)(17, 19)(18, 20)(25, 26)
    (27, 28)(29, 30)
    (27, 29)(28, 30)
    (25, 26)(29, 30)
```

We try to find a second Sylow subgroup $S2a$ that has trivial intersection with $S2$.

```magma
> b := exists(t){ x : x in M | Order(S2 meet S2^x) eq 1 };
> b;
true
> S2a := S2^t;
> N := Normalizer(M, S2);
> N;
Permutation group N acting on a set of cardinality 30
Order = 768 = 2^8 * 3
    (4, 8)(5, 9)(6, 7)(13, 19)(14, 20)(15, 21)
    (4, 14)(5, 15)(6, 13)(7, 19)(8, 20)(9, 21)
    (1, 10)(2, 11)(3, 12)(4, 8)(5, 9)(6, 7)(13, 19)(14, 20)(15, 21)
        (16, 22)(17, 23)(18, 24)
    (1, 24)(2, 22)(3, 23)(4, 14)(5, 15)(6, 13)(7, 19)(8, 20)(9, 21)
        (10, 18)(11, 16)(12, 17)
    (1, 22, 12)(2, 23, 10)(3, 24, 11)(4, 21, 13)(5, 19, 14)(6, 20, 15)
        (7, 8, 9)(16, 17, 18)
    (27, 29)(28, 30)
    (1, 14, 24, 4)(2, 15, 22, 5)(3, 13, 23, 6)(7, 12, 19, 17)(8, 10, 20, 18)
        (9, 11, 21, 16)(29, 30)
    (4, 14)(5, 15)(6, 13)(7, 19)(8, 20)(9, 21)(25, 26)(29, 30)
    (27, 28)(29, 30)
```

Thus the Sylow 2-subgroup is normalized by an element of order 3.

#### Maximal Subgroups

<a id="function-ismaximal-grpperm-grpperm"></a>
##### `IsMaximal(G, H: parameters): GrpPerm, GrpPerm -> BoolElt`

```magma
Al: MonStgElt                    Default: "Subgroups"
```

Returns `true` if the subgroup $H$ of the group $G$ is a maximal subgroup of $G$. The algorithm used depends on the value of the parameter `Al`. The default value `Subgroups` computes the maximal subgroups of $G$ if the index of $H$ in $G$ is over 1000 and the maximal subgroups are computable.The subgroup $H$ is then tested for conjugacy with each class found. In the other cases, or when the `Al` parameter is set to `CosetImage`, the function is evaluated by first calling `IsProbablyMaximal` and if that returns `true` then constructing the permutation representation of $G$ on the cosets of $H$ and testing this representation for primitivity.

<a id="function-isprobablymaximal-grpperm-grpperm"></a>
##### `IsProbablyMaximal(G, H: parameters): GrpPerm, GrpPerm -> BoolElt`

```magma
Tries: RngIntElt                    Default: 20
```

Given a group $G$ and a subgroup $H$ of $G$, this function performs a probabilistic test for the maximality of $H$ in $G$. The test involves adjoining random elements of $G$ to $H$ and determining if the result $G$. If not, then `false` is returned, otherwise `true` s returned. The number of random elements used is controlled by the parameter `Tries`, which is set to $20$ by default.

<a id="function-maximalsubgroups-grpperm"></a>
##### `MaximalSubgroups(G: parameters): GrpPerm -> [ rec< GrpPerm, RngIntElt, RngIntElt, GrpFP> ]`

Construct the sequence of maximal subgroup classes of $G$. This is equivalent to the command `Subgroups(G: Al := "Maximal")`. The same parameters as for `Subgroups` are available to limit the search. The algorithm is described in [[CH04](https://docs.magma-maths.org/references.md#cite-maxsubgrp-permg)].

<a id="example-ex-aa3565"></a>
##### `Example: Maximal Subgroups of a Large Rubik's Cube Group (ex-aa3565)`

The `Subgroups` family of commands can deal with fairly large groups. We look at the maximal subgroups of the group of the $4\times4\times4$ Rubik’s cube. This group has order about $1.7\times10^{55}$.

```magma
> load rubik444;
Loading "/home/magma/libs/pergps/rubik444"
The automorphism group of the 4 x 4 x 4 Rubik cube.
The group is represented as a permutation group of degree 72.
Its order is
2^50 * 3^29 * 5^9 * 7^7 * 11^4 * 13^2 * 17^2 * 19^2 * 23^2.
Group: G
> time max := MaximalSubgroups(G);
Time: 100.559
> #max;
46
> [Index(G, x`subgroup) : x in max];
[ 51090942171709440000, 51090942171709440000, 9161680528000,
9161680528000, 4509264634875, 4509264634875, 316234143225,
316234143225, 96197645544, 96197645544, 1577585295,
1577585295, 2496144, 2496144, 1961256, 1961256, 1307504,
1307504, 346104, 346104, 42504, 42504, 2187, 1352078,
1352078, 735471, 735471, 134596, 134596, 10626, 10626, 2024,
2024, 120, 276, 276, 56, 24, 24, 105, 28, 8, 35, 2, 2, 2 ]
```

<a id="function-maximalsubgroups-grpperm-grpperm"></a>
##### `MaximalSubgroups(G, N: parameters): GrpPerm, GrpPerm -> [ rec< GrpPerm, RngIntElt, RngIntElt, GrpFP> ]`

Construct the sequence of maximal subgroup classes of $G$ that contain the normal subgroup $N$ of $G$. So this is equivalent to computing the maximal subgroups of $G$ that contain $N$. *Warning*: Some parameters may have no effect.

#### Conjugacy Classes of Subgroups

<a id="function-subgroupclasses-grpperm"></a>
##### `SubgroupClasses(G: parameters): GrpPerm -> [ rec< GrpPerm, RngIntElt, RngIntElt, GrpFP> ]`

<a id="function-subgroups-grpperm"></a>
##### `Subgroups(G: parameters): GrpPerm -> [ rec< GrpPerm, RngIntElt, RngIntElt, GrpFP> ]`

```magma
Al                 : MonStgElt                    Default: "All"
LayerSizes         : SeqEnum                      Default: See below
Series             : SeqEnum                      Default: See below
Presentation       : BoolElt                      Default: false
OrderEqual         : RngIntElt                    Default: 
OrderDividing      : RngIntElt                    Default: 
OrderMultipleOf    : RngIntElt                    Default: 
IndexLimit         : RngIntElt                    Default: 
IsElementaryAbelian: BoolElt                      Default: false
IsCyclic           : BoolElt                      Default: false
IsAbelian          : BoolElt                      Default: false
IsNilpotent        : BoolElt                      Default: false
IsSolvable         : BoolElt                      Default: false
IsNotSolvable      : BoolElt                      Default: false
IsPerfect          : BoolElt                      Default: false
IsRegular          : BoolElt                      Default: false
IsTransitive       : BoolElt                      Default: false
```

Representatives for the conjugacy classes of subgroups for the group $G$. The subgroups are returned as a sequence of records where the $i$-th record contains:

**(a)**
A representative subgroup $H$ for the $i$-th conjugacy class (field name `subgroup`).

**(b)**
The order of the subgroup (field name `order`).

**(c)**
The number of subgroups in the class (field name `length`).

**(d)**
[Optional] A presentation for $H$ (field name `presentation`).

`Al := "All"`: Construct all subgroups of $G$.

`Al := "Maximal"`: Only construct maximal subgroups of $G$. This option reduces the number of intersections with any elementary abelian layer that need be considered and eliminates the need to recursively apply the algorithm.

`Al := "Normal"`: Only construct normal subgroups of $G$. This option does not use database lookup to find the normal subgroups of the radical quotient of $G$ and also reduces the number of intersections with any layer that need be considered.

`LayerSizes := [ 2, 5, 3, 4, 7, 3, 11, 2, 17, 1]` is equivalent to the default. When constructing an Elementary Abelian series for the group, attempt to split 2-layers of size gt $2^5$, 3-layers of size gt $3^4$, etc. The implied exponent for 13 is 2 and for all primes greater than 17 the exponent is 1.

Use the given elementary abelian series rather than constructing the default series. The first subgroup in the series must be the solvable radical of $G$. The subgroups must form a descending chain of normal subgroups of $G$, such that each quotient is elementary abelian. The last subgroup in the series must be either elementary abelian or trivial.

`Presentation := true`: Construct a presentation for each subgroup.

`OrderEqual := n`: Only construct subgroups having order equal to $n$.

`OrderDividing := n`: Only construct subgroups having order dividing $n$.

`OrderMultipleOf := n`: Only construct subgroups having order a multiple of $n$.

`IndexLimit := n`: Only construct subgroups having index in $G$ less than or equal to $n$.

`IsElementaryAbelian := true`: Only construct elementary abelian subgroups of $G$.

`IsCyclic := true`: Only construct cyclic subgroups of $G$.

`IsAbelian := true`: Only construct abelian subgroups of $G$.

`IsNilpotent := true`: Only construct nilpotent subgroups of $G$.

`IsSolvable := true`: Only construct solvable subgroups of $G$.

`IsNotSolvable := true`: Only construct insolvable subgroups of $G$.

`IsPerfect := true`: Only construct perfect subgroups of $G$.

`IsRegular := true`: Only construct regular subgroups of $G$.

`IsTransitive := true`: Only construct transitive subgroups of $G$.

**The Algorithm:** (See Cannon, Cox, and Holt [[CCH01b](https://docs.magma-maths.org/references.md#cite-subgroups-permg)]) This command proceeds by first constructing an elementary abelian series for $G$ together with $G$’s radical quotient $Q$. We first attempt to locate the quotient in a database of groups with trivial Fitting subgroup. This database contains all such groups of order up to $216\,000$, and all such which are perfect of order up to $1\,000\,000$. If $Q$ is found then either all its subgroups, or its maximal subgroups are read from the database. (In some cases only the maximal subgroups are stored.) If $Q$ is not found then we attempt to find the maximal subgroups of $Q$ using a method of Derek Holt. For this to succeed all simple factors of the socle of $Q$ must be found in a second database which currently contains all simple groups of order less than $1.6 \times 10^7$, as well as $M_{24}$, $HS$, $J_3$, $McL$, $Sz(32)$, and $L_6(2)$. There are also special routines to handle numerous other groups. These include: $A_n$ for $n \le 2499$, $L_2(q)$, $L_3(q)$, $L_4(q)$, $L_5(q)$, $L_6(q)$, and $L_7(q)$ for all $q$, $U_3(q)$ for all $q$, $U_4(q)$ for all $q$, $S_4(q)$ for all $q$, $L_d(2)$ for $d \le 14$, and the following groups: $L_8(3)$, $L_9(3)$, $U_5(3)$, $U_5(4)$, $U_6(2)$, $U_6(3)$, $U_7(2)$, $U_8(2)$, $S_6(3)$, $S_6(4)$, $S_6(5)$, $S_8(2)$, $S_8(3)$, $S_{10}(2)$, $S_{12}(2)$, $S_{14}(2)$, $O^\pm_8(2)$, $O^\pm_8(4)$, $O^\pm_{10}(2)$, $O^\pm_{12}(2)$, $O^\pm_{14}(2)$, $O^\pm_8(3)$, $O^\pm_{10}(3)$, $O_7(3)$, $O_7(5)$, $O_9(3)$, $G_2(4)$, $G_2(5)$, ${}^3D_4(2)$, ${}^2F_4(2)'$, $F_2(4)$, $R(27$, $Co_2$, $Co_3$, $He$, $Fi_{22}$, $Fi_{23}$, $Ru$, $Suz$, $ON$, $HN$.

If we have only maximal subgroups of $Q$, and more are required, we apply the algorithm recursively to the maximal subgroups to determine all subgroups of $Q$. This may take some time.

The subgroups are then extended to the whole group by stepwise extension through each layer of the elementary abelian series. For each layer this involves determining all possible intersections of a subgroup with this layer and all extensions with this intersection.

The limitations are that the simple factors of the socle of $Q$ must be in the database, which is limited as above. Further, it may take some time to construct all subgroups from the maximal subgroups first found, and, if there is a large elementary abelian layer, there will be many possible intersections, which could also make the algorithm prohibitively slow.

There are numerous parameters for this function which allow the user to place restrictions on which subgroup classes are constructed. Using these restrictions may help overcome the problems noted above.

<a id="function-subgroupslift-grpperm-grpperm-grpperm-seqenum"></a>
##### `SubgroupsLift(G, A, B, Q: parameters): GrpPerm, GrpPerm, GrpPerm, SeqEnum -> SeqEnum`

This function isolates one step of the extension process used by the `Subgroups` family of functions. The argument $Q$ is a sequence of records such as returned by `Subgroups(G)`. The groups $A$ and $B$ are normal subgroups of $G$ with $A/B$ elementary abelian. The records in $Q$ are interpreted as subgroups of $G/A$, which are lifted to all possible corresponding subgroups of $G/B$, subject to the parameters given.

<a id="function-lowindexsubgroups-grpperm-rngintelt"></a>
##### `LowIndexSubgroups(G, n: parameters): GrpPerm, RngIntElt -> SeqEnum`

<a id="function-lowindexsubgroups-grpperm-tup"></a>
##### `LowIndexSubgroups(G, t: parameters): GrpPerm, Tup -> SeqEnum`

Returns a sequence of subgroups of $G$, each with index at most $n$. The sequence will contain one representative from each conjugacy class of $G$-subgroups satisfying the index constraint. The algorithm used is described in Cannon, Holt, Slattery & Steel [[CHSS03](https://docs.magma-maths.org/references.md#cite-chss-lix)]. The previous version of the algorithm is available by setting the parameter `Algorithm` to the string `"Subgroups"`. In this case the group $G$ is subject to the same restrictions as the group input to the `Subgroups` function above. In the second form $t$ should be a pair of integers $\langle a,b\rangle$, and subgroups with index in the interval $[a,b]$ will be returned. Other parameters are `Presentation` which may be set `true` to return a second sequence of presentations of the groups found, and `Print` which may be set to a positive integer to turn on diagnostic printing of the progress of the algorithms.

<a id="function-lowindexsubgroups-grpperm-rngintelt-2"></a>
##### `LowIndexSubgroups(G, N, n: parameters): GrpPerm, RngIntElt -> SeqEnum`

<a id="function-lowindexsubgroups-grpperm-tup-2"></a>
##### `LowIndexSubgroups(G, N, t: parameters): GrpPerm, Tup -> SeqEnum`

Same as above, but only those subgroups containing the normal subgroup $N$ of $G$ are returned. This is equivalent to computing the low index subgroups of $G/N$. Only the `Print` parameter is available for this command.

<a id="example-ex-24cf2d"></a>
##### `Example: Subgroups of the Double Cover of M12 (ex-24cf2d)`

With the `Subgroups` family of commands we can get the entire collection of (classes of) subgroups of a group $G$. We look at the double cover of $M_{12}$.

```magma
> load m12cover;
Loading "/home/magma/libs/pergps/m12cover"
The two-fold cover of the Mathieu group M12 on 24 letters.
Order is 190080 = 2^7 * 3^3 * 5 * 11.
Group: G
> time s := SubgroupClasses(G);
Time: 4.469
> #s;
293
```

This may be too many. The parameters allow us to restrict attention to a subset of the subgroups. We specify that the function is to return only the elementary abelian $2$-subgroups of $G$.

```magma
> se := SubgroupClasses(G : IsElementaryAbelian := true,
>               OrderMultipleOf := 2);
> #se;
14
> se : Minimal;
Conjugacy classes of subgroups
------------------------------

[ 1]    Order 2            Length 1
        GrpPerm: $, Degree 24, Order 2
[ 2]    Order 2            Length 495
        GrpPerm: $, Degree 24, Order 2
[ 3]    Order 2            Length 495
        GrpPerm: $, Degree 24, Order 2
[ 4]    Order 4            Length 495
        GrpPerm: $, Degree 24, Order 2^2
[ 5]    Order 4            Length 495
        GrpPerm: $, Degree 24, Order 2^2
[ 6]    Order 4            Length 1485
        GrpPerm: $, Degree 24, Order 2^2
[ 7]    Order 4            Length 1980
        GrpPerm: $, Degree 24, Order 2^2
[ 8]    Order 4            Length 5940
        GrpPerm: $, Degree 24, Order 2^2
[ 9]    Order 8            Length 495
        GrpPerm: $, Degree 24, Order 2^3
[10]    Order 8            Length 495
        GrpPerm: $, Degree 24, Order 2^3
[11]    Order 8            Length 1485
        GrpPerm: $, Degree 24, Order 2^3
[12]    Order 8            Length 1980
        GrpPerm: $, Degree 24, Order 2^3
[13]    Order 8            Length 1980
        GrpPerm: $, Degree 24, Order 2^3
[14]    Order 16           Length 495
        GrpPerm: $, Degree 24, Order 2^4
```

<a id="example-ex-157d91"></a>
##### `Example: Low Index Subgroups of a Transitive Group (ex-157d91)`

Other options when restricting computation of the subgroups of a group are to find low index subgroups or maximal subgroups.

```magma
> G := TransitiveGroup(33,31);
> lix :=  LowIndexSubgroups(G, <2,47>);
> [Index(G, H) : H in lix];
[ 3, 4, 6, 12, 33, 44 ];
> m := MaximalSubgroups(G);
> [Index(G, r`subgroup) : r in m];
[ 1331, 4, 3 ]
> #Subgroups(G);
60
```

<a id="example-ex-672b95"></a>
##### `Example: Subgroup Lattice with Inclusions (ex-672b95)`

Using the `SubgroupLattice` function we obtain a representative subgroup for each conjugacy class together with the inclusion relations between subgroups.

**WARNING:** *Computing the inclusions is very time consuming and should only be performed for small groups.*

```magma
> G := PSL(2,9);
> time L := SubgroupLattice(G);
Time: 0.20O
> L;
Partially ordered set of subgroup classes
-----------------------------------------

[ 1]  Order 1    Length 1   Maximal Subgroups:
---
[ 2]  Order 2    Length 45  Maximal Subgroups: 1
[ 3]  Order 3    Length 20  Maximal Subgroups: 1
[ 4]  Order 3    Length 20  Maximal Subgroups: 1
[ 5]  Order 5    Length 36  Maximal Subgroups: 1
---
[ 6]  Order 4    Length 15  Maximal Subgroups: 2
[ 7]  Order 4    Length 15  Maximal Subgroups: 2
[ 8]  Order 4    Length 45  Maximal Subgroups: 2
[ 9]  Order 6    Length 60  Maximal Subgroups: 2 3
[10]  Order 6    Length 60  Maximal Subgroups: 2 4
[11]  Order 9    Length 10  Maximal Subgroups: 3 4
[12]  Order 10   Length 36  Maximal Subgroups: 2 5
---
[13]  Order 8    Length 45  Maximal Subgroups: 6 7 8
[14]  Order 12   Length 15  Maximal Subgroups: 4 6
[15]  Order 12   Length 15  Maximal Subgroups: 3 7
[16]  Order 18   Length 10  Maximal Subgroups: 9 10 11
---
[17]  Order 24   Length 15  Maximal Subgroups: 10 13 14
[18]  Order 24   Length 15  Maximal Subgroups: 9 13 15
[19]  Order 36   Length 10  Maximal Subgroups: 8 16
[20]  Order 60   Length 6   Maximal Subgroups: 9 12 15
[21]  Order 60   Length 6   Maximal Subgroups: 10 12 14
---
[22]  Order 360  Length 1   Maximal Subgroups: 17 18 19 20 21

> NumberOfInclusions(L!5, L!20);
6
> L[5];
Permutation group acting on a set of cardinality 10
Order = 5
  (1, 8, 9, 3, 4)(2, 7, 5, 10, 6)
```

The order and class length of each class of subgroups is listed, along with the information about where to find the maximal subgroups of a member of this class. Further information about inclusions is available from the lattice. We see that 6 members of class 5 are contained in any fixed member of class 20.

<a id="function-subgrouplattice-grpperm"></a>
##### `SubgroupLattice(G): GrpPerm -> SubGrpLat`

The lattice of conjugacy classes of subgroups of $G$.

<a id="function-burnsidematrix-grpperm"></a>
##### `BurnsideMatrix(G): GrpPerm -> AlgMatElt`

The Burnside matrix corresponding to the lattice of subgroups of $G$. The $(i,j)$th entry of the matrix is the number of subgroups in class $i$ contained in a single subgroup of class $j$ when $i\le j$, and is the number of subgroups of class $i$ containing a given subgroup in class $j$ when $i\ge j$.

<a id="procedure-displayburnsidematrix-grpperm"></a>
##### `DisplayBurnsideMatrix(G): GrpPerm`

Pretty-print the Burnside matrix corresponding to the lattice of subgroups of $G$.

<a id="function-tableofmarks-grpperm"></a>
##### `TableOfMarks(G): GrpPerm -> AlgMatElt`

Burnside’s table of marks corresponding to the lattice of subgroups of $G$. Rows correspond to marks for transitive permutation representations of $G$, while the entries in column $j$ are the number of fixed points of subgroup class $j$ in each transitive representation.

#### Classes of Subgroups Satisfying a Condition

<a id="function-normalsubgroups-grpperm"></a>
##### `NormalSubgroups(G: parameters): GrpPerm -> [ rec< GrpPerm, RngIntElt, RngIntElt, GrpFP> ]`

Construct the sequence of normal subgroup classes of $G$. This is equivalent to `Subgroups(G: Al := "Normal")`. The same parameters as for `Subgroups` are available to limit the search.

<a id="function-elementaryabeliansubgroups-grpperm"></a>
##### `ElementaryAbelianSubgroups(G: parameters): GrpPerm -> [ rec< GrpPerm, RngIntElt, RngIntElt, GrpFP> ]`

Construct the sequence of elementary abelian subgroups of $G$. This is equivalent to `Subgroups(G: IsElementaryAbelian := true)`. The same parameters as for `Subgroups` are available to limit the search.

<a id="function-cyclicsubgroups-grpperm"></a>
##### `CyclicSubgroups(G: parameters): GrpPerm -> [ rec< GrpPerm, RngIntElt, RngIntElt, GrpFP> ]`

Construct the sequence of cyclic subgroups of $G$. This is equivalent to `Subgroups(G: IsCyclic := true)`. The same parameters as for `Subgroups` are available to limit the search.

<a id="function-abeliansubgroups-grpperm"></a>
##### `AbelianSubgroups(G: parameters): GrpPerm -> [ rec< GrpPerm, RngIntElt, RngIntElt, GrpFP> ]`

Construct the sequence of abelian subgroups of $G$. Equivalent to `Subgroups(G:` `IsAbelian := true)`. The same parameters as for `Subgroups` are available to limit the search.

<a id="function-nilpotentsubgroups-grpperm"></a>
##### `NilpotentSubgroups(G: parameters): GrpPerm -> [ rec< GrpPerm, RngIntElt, RngIntElt, GrpFP> ]`

Construct the sequence of nilpotent subgroups of $G$. This is equivalent to `Subgroups(G: IsNilpotent := true)`. The same parameters as for `Subgroups` are available to limit the search.

<a id="function-solvablesubgroups-grpperm"></a>
##### `SolvableSubgroups(G: parameters): GrpPerm -> [ rec< GrpPerm, RngIntElt, RngIntElt, GrpFP> ]`

Construct the sequence of solvable subgroups of $G$. This is equivalent to `Subgroups(G: IsSolvable := true)`. The same parameters as for `Subgroups` are available to limit the search.

<a id="function-perfectsubgroups-grpperm"></a>
##### `PerfectSubgroups(G: parameters): GrpPerm -> [ rec< GrpPerm, RngIntElt, RngIntElt, GrpFP> ]`

Construct the sequence of perfect subgroups of $G$. Equivalent to `Subgroups(G:` `IsNotSolvable := true)`. The same parameters as for `Subgroups` are available to limit the search.

<a id="function-nonsolvablesubgroups-grpperm"></a>
##### `NonsolvableSubgroups(G: parameters): GrpPerm -> [ rec< GrpPerm, RngIntElt, RngIntElt, GrpFP> ]`

Construct the sequence of insolvable subgroups of $G$. This is equivalent to `Subgroups(G: IsNotSolvable := true)`. The same parameters as for `Subgroups` are available to limit the search.

<a id="function-simplesubgroups-grpperm"></a>
##### `SimpleSubgroups(G: parameters): GrpPerm -> [ rec< GrpPerm, RngIntElt, RngIntElt, GrpFP> ]`

Construct the sequence of non-abelian simple subgroup classes of $G$. This is equivalent to `Subgroups(G: Al := "Simple")`. The same parameters as for `Subgroups` are available to limit the search.

### Quotient Groups

#### Construction of Quotient Groups

<a id="constructor-constructor-quo-grpperm-list-grpperm-map"></a>
##### `quo<G | L>: GrpPerm, List -> GrpPerm, Map`

Given the permutation group $G$, construct the quotient group $Q = G/N$, where $N$ is the normal closure of the subgroup of $G$ generated by the elements specified by $L$. The clause $L$ is a list of one or more items of the following types:

**(a)**
A sequence of $n$ integers defining a permutation of $G$;

**(b)**
A set or sequence of sequences of type (a);

**(c)**
An element of $G$;

**(d)**
A set or sequence of elements of $G$;

**(e)**
A subgroup of $G$;

**(f)**
A set or sequence of subgroups of $G$.

Each element or group specified by the list must belong to the *same* generic permutation group. The function returns

**(a)**
the quotient group $Q$, and

**(b)**
the natural homomorphism $f: G\rightarrow Q$.

Currently, the quotient group is constructed via the regular representation of the quotient, so the application of this operator is restricted to the case where the index of $N$ in $G$ is small. The representation of the quotient group that is returned is the result of a degree reduction applied to the regular representation, so need not be regular. The generators of the quotient are images of the generators of $G$.

The second return value is the epimorphism from G to the resulting quotient group.

<a id="operation-op-div-grpperm-grpperm"></a>
##### `G / N: GrpPerm, GrpPerm -> GrpPerm`

Given a normal subgroup $N$ of the permutation group $G$, construct the quotient of $G$ by $N$. Currently, the quotient group is constructed via the regular representation of the quotient, so the application of this operator is restricted to the case where the index of $N$ in $G$ is small. The representation of the quotient group that is returned is the result of a degree reduction applied to the regular representation, so need not be regular. The generators of the quotient are images of the generators of $G$.

<a id="example-ex-d39a4a"></a>
##### `Example: Quotient of Sym(4) by the Klein Group (ex-d39a4a)`

The quotient of ${\operatorname{Sym}}(4)$ by the Klein $4$-group is constructed by the following statement:

```magma
> Q, f := quo< Sym(4) | (1,2)(3,4), (1,3)(2,4) >;
> Q;
Permutation group Q acting on a set of cardinality 3
Order = 6 = 2 * 3
    (2, 3)
    (1, 2)
```

#### Abelian, Nilpotent, and Soluble Quotients

A number of standard quotients may be constructed. The method first constructs a presentation for the permutation group and then applies the appropriate fp-group algorithm.

<a id="function-abelianquotient-grpperm"></a>
##### `AbelianQuotient(G): GrpPerm -> GrpAb, Map`

The maximal abelian quotient $G/G^\prime$ of the group $G$ as `GrpAb` (cf. Chapter [Abelian Groups](https://docs.magma-maths.org/FinitelyPresentedGroups/AbelianGroups/index-abelian-groups.md#chapgrpab)). The natural epimorphism $\pi:G\rightarrow G/G^\prime$ is returned as second value.

<a id="function-elementaryabelianquotient-grpperm-rngintelt"></a>
##### `ElementaryAbelianQuotient(G, p): GrpPerm, RngIntElt -> GrpAb, Map`

The maximal $p$-elementary abelian quotient $Q$ of the group $G$ as `GrpAb` (cf. Chapter [Abelian Groups](https://docs.magma-maths.org/FinitelyPresentedGroups/AbelianGroups/index-abelian-groups.md#chapgrpab)). The natural epimorphism $\pi:G\rightarrow Q$ is returned as second value.

<a id="function-pquotient-grpperm-rngintelt-rngintelt"></a>
##### `pQuotient(G, p, c): GrpPerm, RngIntElt, RngIntElt -> GrpPC, Map, SeqEnum, BoolElt`

Given a permutation group $G$, a prime $p$, and a positive integer $c$, construct a pc-presentation for the largest $p$-quotient $P$ of $G$ having lower exponent-$p$ class at most $c$. If $c$ is given as $0$, then the limit 127 is placed on the class. The prime $p$ must be less than $65536$.

The function also returns the natural homomorphism $\pi$ from $G$ to $P$, a sequence $S$ describing the definitions of the pc-generators of $P$ and a flag indicating whether $P$ is the maximal $p$-quotient of $G$.

The $k$-th element of $S$ is a sequence of two integers, describing the definition of the $k$-th pc-generator $P.k$ of $P$ as follows.

- If $S[k] = [0,r]$, then $P.k$ is defined via the image of $G.r$ under $\pi$.
- If $S[k] = [r,0]$, then $P.k$ is defined via the power relation for $P.r$.
- If $S[k] = [r,s]$, then $P.k$ is defined via the conjugate relation involving $P.r^{P.s}$.

<a id="function-nilpotentquotient-grpperm-rngintelt"></a>
##### `NilpotentQuotient(G, c): GrpPerm, RngIntElt -> GrpGPC, Map`

This function returns the class $c$ nilpotent quotient of $G$, together with the epimorphism $\pi$ from $G$ onto this quotient.

<a id="function-solvablequotient-grpperm"></a>
##### `SolvableQuotient(G): GrpPerm -> GrpPC, Map, SeqEnum, MonStgElt`

<a id="function-solublequotient-grpperm"></a>
##### `SolubleQuotient(G): GrpPerm -> GrpPC, Map, SeqEnum, MonStgElt`

The function returns the largest soluble quotient $S$ of the permutation group $G$ together with the epimorphism $\pi:G\rightarrow S$.

<a id="example-ex-d5d186"></a>
##### `Example: Soluble Quotient of a Wreath Product (ex-d5d186)`

The soluble quotient of the wreath product of ${\operatorname{Sym}}(6)$ with the dihedral group of order 12 is easily constructed:

```magma
> G := WreathProduct( Sym(6), DihedralGroup(6));
> #G;
1671768834048000000
> SQ, phi := SolubleQuotient(G);
SQ;
GrpPC : SQ of order 768 = 2^8 * 3
PC-Relations:
    SQ.1^2 = SQ.5,
    SQ.2^2 = Id(SQ),
    SQ.3^2 = Id(SQ),
    SQ.4^2 = Id(SQ),
    SQ.5^3 = Id(SQ),
    SQ.6^2 = Id(SQ),
    SQ.7^2 = Id(SQ),
    SQ.8^2 = Id(SQ),
    SQ.9^2 = Id(SQ),
    SQ.2^SQ.1 = SQ.2 * SQ.5,
    SQ.3^SQ.1 = SQ.3 * SQ.4 * SQ.6 * SQ.8,
    SQ.4^SQ.1 = SQ.4 * SQ.9,
    SQ.4^SQ.2 = SQ.4 * SQ.6 * SQ.7 * SQ.8,
    SQ.5^SQ.2 = SQ.5^2,
    SQ.5^SQ.3 = SQ.5 * SQ.7,
    SQ.5^SQ.4 = SQ.5 * SQ.6 * SQ.8,
    SQ.6^SQ.1 = SQ.6 * SQ.8,
    SQ.6^SQ.2 = SQ.7 * SQ.8,
    SQ.6^SQ.5 = SQ.6 * SQ.7 * SQ.8 * SQ.9,
    SQ.7^SQ.1 = SQ.8,
    SQ.7^SQ.2 = SQ.9,
    SQ.7^SQ.5 = SQ.7 * SQ.9,
    SQ.8^SQ.1 = SQ.7 * SQ.9,
    SQ.8^SQ.2 = SQ.6 * SQ.9,
    SQ.8^SQ.5 = SQ.6 * SQ.9,
    SQ.9^SQ.1 = SQ.6 * SQ.8 * SQ.9,
    SQ.9^SQ.2 = SQ.7,
    SQ.9^SQ.5 = SQ.7
```

### Permutation Group Actions

<a id="permg-gsets"></a>
#### $G$-Sets

Let $G$ be a group. A $G$*-set* is a pair $(Y, f)$, where $Y$ is a set and $f : Y \times G \rightarrow Y$ is a mapping such that

$$
f(f(y, g), h) = f(y, gh),\quad \hbox{\rm for all\ } g, h \in G\tag{(a)}
$$

and

$$
f(y, 1) = y,\quad \hbox{for all\ } y \in Y.\tag{(b)}
$$

The mapping $f$ defines the *action* of $G$ on the set $Y$. If $G$ is defined as a permutation group acting on the set $X$ and $Y$ is another $G$-set then there is a homomorphism of $G^{X}$ into $G^{Y}$. We distinguish three types of $G$-set for a permutation group $G$. The set on which $G$ is defined will be referred to as the *natural* $G$*-set* and the action of $G$ on $X$ as the *natural action* of $G$. Let $A$ be a set. A *derived set* of $A$ is defined (recursively) as follows:

**(i)**
A subset of $A$ is a derived set;

**(ii)**
A set of $k$-subsets of $A$ is a derived set;

**(iii)**
A set of $k$-sequences of $A$ is a derived set;

**(iv)**
A set of ordered partitions of $A$ is a derived set;

**(v)**
A subset of a cartesian product of derived sets of $A$ is a derived set.

The natural action of $G$ on $X$ induces a natural action on the $G$-closure $Y$ of any derived set of $X$. Such a set $Y$ is also a $G$-set. For example, a subset of $X$ is a $G$-set for $G$ if and only if it is a union of orbits for $G$. Finally, a *general* $G$*-set* is an arbitrary set $Y$ with an action $f$ satisfying the conditions (a) and (b). The notion of a $G$-set enables the user to work with several different actions of $G$. Rather than having to always work with the image of $G$ with respect to an action on a set $Y$, the user may specify the required operation in terms of $G$.

#### Creating a $G$-Set

<a id="function-gsetfromindexed-grpperm-setindx"></a>
##### `GSetFromIndexed(G, Y): GrpPerm, SetIndx -> GSet`

Given a group $G$ and an indexed set $Y$ with the same cardinality as the natural $G$-set, return a $G$-set corresponding to the natural bijection between the labelling $L$ $(= {\rm Labelling(G)})$ of $G$ and $Y$. Explicitly, the bijection is $\phi: L\rightarrow Y: l\mapsto Y[{\rm Position}(L, l)].$ Then the returned $G$-set is the set $Y$ endowed with the action

$$
f: Y\times G\rightarrow Y: (y, p)\mapsto \phi(p(\phi^{-1}(y))).
$$

<a id="function-gset-grpperm-gset-setenum"></a>
##### `GSet(G, X, Y): GrpPerm, GSet, SetEnum -> GSet`

<a id="function-gset-grpperm-set"></a>
##### `GSet(G, Y): GrpPerm, Set -> GSet`

Return the smallest derived $G$-set containing $Y$ as a subset under the action of $G$ on $X$. If $X$ is omitted, then the natural action will be assumed. In practice, the set $Y$ is expanded until for each element $y$ of the expanded $Y$, the image of $y$ under each generator of $G$ under the action described by $X$ is also in $Y$. The action of $G$ on $Y$ is then the action induced by the action of $G$ on $X$.

<a id="function-gset-grpperm-2"></a>
##### `GSet(G): GrpPerm -> GSet`

Given a permutation group $G$, return the $G$-set corresponding to the natural action of $G$.

<a id="function-gset-grpperm-set-map"></a>
##### `GSet(G, Y, f): GrpPerm, Set, Map -> GSet`

Construct the smallest $G$-set containing $Y$ as a subset with the given action $f$. The map $f$ must satisfy the requirements of a $G$-set action. In particular, the domain of $f$ must be a superset of $Y\times G$, the codomain a superset of $Y$ and the two conditions listed at the beginning of this section must be met.

<a id="function-action-gset"></a>
##### `Action(Y): GSet -> Map`

The map giving the action of the group on the $G$-set $Y$.

<a id="function-group-gset"></a>
##### `Group(Y): GSet -> GrpPerm`

The group associated with the $G$-set $Y$.

<a id="function-labelling-grpperm"></a>
##### `Labelling(G): GrpPerm -> SetIndx`

Given a permutation group $G$ of degree $n$, return an indexed set giving the internal mapping of the natural $G$-set of $G$ onto the set $\lbrace 1, \ldots, n \rbrace$, where $n$ is the degree of $G$.

<a id="function-degree-grppermelt-gset"></a>
##### `Degree(g, Y): GrpPermElt, GSet -> RngIntElt`

<a id="function-degree-grppermelt-3"></a>
##### `Degree(g): GrpPermElt -> RngIntElt`

Given an element $g$ of a permutation group $G$ and a $G$-set $Y$, return the cardinality of the subset of $Y$ consisting of points that are moved by $g$. If $Y$ is omitted, the natural $G$-set $X$ is assumed.

<a id="function-degree-grpperm-gset"></a>
##### `Degree(G, Y): GrpPerm, GSet -> RngIntElt`

<a id="function-degree-grpperm"></a>
##### `Degree(G): GrpPerm -> RngIntElt`

Given a $G$-set $Y$, return the cardinality of $Y$. If $Y$ is omitted, the natural $G$-set $X$ is assumed.

<a id="function-support-grppermelt-gset"></a>
##### `Support(g, Y): GrpPermElt, GSet -> { Elt }`

<a id="function-support-grppermelt"></a>
##### `Support(g): GrpPermElt -> { Elt }`

Given an element $g$ of a permutation group $G$ and a $G$-set $Y$, return the subset of $Y$ consisting of points that are moved by $g$. If $Y$ is omitted, the natural $G$-set $X$ is assumed.

<a id="function-support-grpperm-gset"></a>
##### `Support(G, Y): GrpPerm, GSet -> { Elt }`

<a id="function-support-grpperm"></a>
##### `Support(G): GrpPerm -> { Elt }`

Given a permutation group $G$ and a $G$-set $Y$, return the subset of $Y$ consisting of points that are moved by at least one element of $G$. If $Y$ is omitted the natural $G$-set for $G$ is assumed.

<a id="example-ex-5fb40e"></a>
##### `Example: G-Set with a User-Defined Action (ex-5fb40e)`

We construct a $G$-set with a user defined action. Our example will take a group $G$ and a normal subgroup $N$ of index 4. The $G$-set will be the irreducible characters of $N$, with the usual $G$ action obtained from permuting the elements of $N$ by conjugation. As this is not a derived set we will define the action via a map.

```magma
> G := PGammaL(2, 9);
> N := PSL(2, 9);
> CT := CharacterTable(N);
> X := SequenceToSet(CT);
> XxG := CartesianProduct(X, G);
> f := map< XxG -> X | x :-> x[1]^x[2] >;
> Y := GSet(G, X, f);
```

This defines our $G$-set `Y`. The inertia group of a character is its stabilizer in this action. Let us compute an inertia group.

```magma
> chi := CT[2];
> I := Stabilizer(G, Y, chi);
> Index(G, I);
2
> [#o : o in Orbits(G, Y)];
[ 1, 1, 1, 2, 2 ]
```

We find that two of the characters have inertia groups of index 2 in $G$, while three are $G$-invariant.

#### Images, Orbits, and Stabilizers

<a id="operation-op-pow-elt-grppermelt"></a>
##### `x ^ g: Elt, GrpPermElt -> Elt`

Given a permutation group $G$ with natural $G$-set $X$ and an object $x$ which is an element of some derived $G$-set of $X$, find the image of $x$ under $G$.

<a id="function-image-grppermelt-gset-elt"></a>
##### `Image(g, Y, y): GrpPermElt, GSet, Elt -> Elt`

<a id="function-image-grppermelt-elt"></a>
##### `Image(g, y): GrpPermElt, Elt -> Elt`

Given a permutation $g$ belonging to a group $G$, a $G$-set $Y$, and an element $y$ of $Y$, find the image of $y$ under $g$. If $y$ is an element of some derived $G$-set of $G$, the set $Y$ may be omitted.

<a id="function-fix-grppermelt-gset"></a>
##### `Fix(g, Y): GrpPermElt, GSet -> { Elt }`

<a id="function-fix-grppermelt"></a>
##### `Fix(g): GrpPermElt -> { Elt }`

Given a permutation $g$ belonging to a group $G$ and a $G$-set $Y$, construct the fixed-point set of $g$ in its action on $Y$. In the case in which $Y$ is the natural $G$-set, $Y$ may be omitted. The fixed-point set is returned as a subset of points of $Y$.

<a id="function-fix-grpperm-gset"></a>
##### `Fix(G, Y): GrpPerm, GSet -> { Elt }`

<a id="function-fix-grpperm"></a>
##### `Fix(G): GrpPerm -> { Elt }`

The fixed-point set of the permutation group $G$ in its action on the $G$-set $Y$ (or the natural $G$-set for $G$ if $Y$ is omitted).

<a id="operation-op-pow-elt-grpperm"></a>
##### `x ^ G: Elt, GrpPerm -> GSet`

Given a permutation group $G$ with natural $G$-set $X$ and an element $x$ belonging to some derived $G$-set of $X$, construct the orbit of $x$ under $G$. The orbit is returned as a $G$-set.

<a id="function-cycle-grppermelt-elt"></a>
##### `Cycle(e, x): GrpPermElt, Elt -> SetIndx`

Let $e$ be an element of a permutation group defined as acting on a set containing $x$. Returns the set of images of $x$ under repeated application of $e$ as an indexed set with $x$ the first element. This gives the cycle containing $x$ in the disjoint cycle representation of $e$.

<a id="function-cycledecomposition-grppermelt"></a>
##### `CycleDecomposition(e): GrpPermElt -> SeqEnum[SetIndx]`

Let $e$ be an element of a permutation group defined as acting on a set $X$. Returns a sequence of indexed sets partitioning $X$, each of which is a cycle of $e$. This gives the full disjoint cycle representation of $e$.

<a id="function-orbit-grpperm-gset-elt"></a>
##### `Orbit(G, Y, y): GrpPerm, GSet, Elt -> GSet`

<a id="function-orbit-grpperm-elt"></a>
##### `Orbit(G, y): GrpPerm, Elt -> GSet`

Given a permutation group $G$, a $G$-set $Y$, and an element $y$ belonging to $Y$, construct the orbit of $y$ under $G$. The orbit is returned as a $G$-set. If $y$ is an element of some derived $G$-set of $G$, the set $Y$ may be omitted.

<a id="function-orbits-grpperm-gset"></a>
##### `Orbits(G, Y): GrpPerm, GSet -> [ GSet ]`

<a id="function-orbits-grpperm"></a>
##### `Orbits(G): GrpPerm -> [ GSet ]`

Given a permutation group $G$ and a $G$-set $Y$, construct the orbits of $G$ on $Y$. If the set $Y$ is omitted, the orbits of $G$ on its natural $G$-set are constructed. The orbits are returned as a sequence of $G$-sets.

<a id="function-orbitrepresentatives-grpperm"></a>
##### `OrbitRepresentatives(G): GrpPerm -> SeqEnum`

Given a permutation group $G$, construct the orbits of $G$ on its natural $G$-set. The orbit descriptions are returned as a sequence of tuples $\langle l, r\rangle$ giving the length $l$ and a representative $r$ of each orbit of $G$ on its support.

This function stores *only* the orbit representatives and so is more space-efficient than `Orbits`. However, it should be used only if the user wants to determine just the orbit representatives; queries about the orbits containing other elements of the support will cause further computation.

<a id="function-orbitclosure-grpperm-gset-elt"></a>
##### `OrbitClosure(G, Y, S): GrpPerm, GSet, { Elt } -> GSet`

<a id="function-orbitclosure-grpperm-elt"></a>
##### `OrbitClosure(G, S): GrpPerm, { Elt } -> GSet`

Given a subset $S$ of the $G$-set $Y$, construct the smallest $G$-invariant subset of $Y$ that contains $S$. If $Y$ is the natural $G$-set for $G$ it may be omitted.

<a id="function-isconjugate-grpperm-gset-elt-elt"></a>
##### `IsConjugate(G, Y, y, z): GrpPerm, GSet, Elt, Elt -> BoolElt, GrpPermElt`

<a id="function-isconjugate-grpperm-elt-elt"></a>
##### `IsConjugate(G, y, z): GrpPerm, Elt, Elt -> BoolElt, GrpPermElt`

Given elements $y$ and $z$ belonging either to a $G$-set $Y$ or to a (restricted) derived set of $Y$, return the value `true` if there exists an element $g \in G$ such that $y^g = z$. Otherwise, return `false`. If such an element exists, then it is returned as the second value of the function. If $y$ and $z$ belong to the natural $G$-set, then $Y$ may be omitted. Currently, $y$ and $z$ are restricted to being elements, sets of elements, multisets of elements, sequences of elements, ordered partitions, or unordered partitions of $Y$.

<a id="function-stabilizer-grpperm-gset-elt"></a>
##### `Stabilizer(G, Y, y): GrpPerm, GSet, Elt -> GrpPerm`

<a id="function-stabiliser-grpperm-gset-elt"></a>
##### `Stabiliser(G, Y, y): GrpPerm, GSet, Elt -> GrpPerm`

<a id="function-stabilizer-grpperm-elt"></a>
##### `Stabilizer(G, y): GrpPerm, Elt -> GrpPerm`

<a id="function-stabiliser-grpperm-elt"></a>
##### `Stabiliser(G, y): GrpPerm, Elt -> GrpPerm`

Given a permutation group $G$ and a $G$-set $Y$, and an object $y$ which is either an element, a sequence of elements, a set of elements, an ordered or unordered partition, or a tuple over the $G$-set $Y$, find the stabilizer of $y$ in $G$. The stabilizer is returned as a subgroup of $G$. If $Y$ is the natural $G$-set, it may be omitted.

<a id="function-twoclosure-grpperm"></a>
##### `TwoClosure(G): GrpPerm -> GrpPerm`

The two-closure of the transitive permutation group $G$. That is, the intersection of the automorphism groups of the orbital graphs of $G$ or, equivalently, the largest subgroup of the symmetric group on the domain $X$ of $G$ with the same orbits as $G$ on $X \times X$.

<a id="function-isprimitive-grpperm-gset"></a>
##### `IsPrimitive(G, Y): GrpPerm, GSet -> BoolElt`

<a id="function-isprimitive-grpperm"></a>
##### `IsPrimitive(G): GrpPerm -> BoolElt`

Returns `true` if $G$ acts primitively on the $G$-set $Y$. If $Y$ is the natural $G$-set, the set $Y$ may be omitted.

<a id="function-istransitive-grpperm-gset"></a>
##### `IsTransitive(G, Y): GrpPerm, GSet -> BoolElt`

<a id="function-istransitive-grpperm"></a>
##### `IsTransitive(G): GrpPerm -> BoolElt`

Returns `true` if $G$ acts transitively on the $G$-set $Y$. If $Y$ is the natural $G$-set, the set $Y$ may be omitted.

<a id="function-istransitive-grpperm-gset-rngintelt"></a>
##### `IsTransitive(G, Y, k): GrpPerm, GSet, RngIntElt -> BoolElt`

<a id="function-istransitive-grpperm-rngintelt"></a>
##### `IsTransitive(G, k): GrpPerm, RngIntElt -> BoolElt`

Returns `true` if $G$ acts $k$-transitively on the $G$-set $Y$. If $Y$ is the natural $G$-set, the set $Y$ may be omitted.

<a id="function-issharplytransitive-grpperm-gset-rngintelt"></a>
##### `IsSharplyTransitive(G, Y, k): GrpPerm, GSet, RngIntElt -> BoolElt`

<a id="function-issharplytransitive-grpperm-rngintelt"></a>
##### `IsSharplyTransitive(G, k): GrpPerm, RngIntElt -> BoolElt`

Returns `true` if $G$ acts sharply $k$-transitively on the $G$-set $Y$. If $Y$ is the natural $G$-set, the set $Y$ may be omitted.

<a id="function-transitivity-grpperm-gset"></a>
##### `Transitivity(G, Y): GrpPerm, GSet -> RngIntElt`

<a id="function-transitivity-grpperm"></a>
##### `Transitivity(G): GrpPerm -> RngIntElt`

The degree of transitivity of $G$ acting on the $G$-set $Y$. The set $Y$ may be omitted if it is the same as the natural $G$-set.

<a id="function-homogeneity-grpperm"></a>
##### `Homogeneity(G): GrpPerm -> RngIntElt`

The largest integer $k \le$ the degree of $G$ such that for all $s$ with $1 \le s \le k$, $G$ acts transitively on $s$-subsets of the domain.

<a id="function-isregular-grpperm-gset"></a>
##### `IsRegular(G, Y): GrpPerm, GSet -> BoolElt`

<a id="function-isregular-grpperm"></a>
##### `IsRegular(G): GrpPerm -> BoolElt`

Returns `true` if $G$ acts regularly on the $G$-set $Y$. If $Y$ is the natural $G$-set, the set $Y$ may be omitted. The algorithm used is that of Sims, see [[CB92](https://docs.magma-maths.org/references.md#cite-struct-gps)].

<a id="function-issemiregular-grpperm-gset"></a>
##### `IsSemiregular(G, Y): GrpPerm, GSet -> BoolElt`

<a id="function-issemiregular-grpperm"></a>
##### `IsSemiregular(G): GrpPerm -> BoolElt`

Returns `true` if $G$ acts semiregularly on the $G$-set $Y$. If $Y$ is the natural $G$-set, the set $Y$ may be omitted. The algorithm used is a variation of Sims’ regularity test, see [[CB92](https://docs.magma-maths.org/references.md#cite-struct-gps)].

<a id="function-issemiregular-grpperm-gset-setenum"></a>
##### `IsSemiregular(G, Y, S): GrpPerm, GSet, SetEnum -> BoolElt`

<a id="function-issemiregular-grpperm-setenum"></a>
##### `IsSemiregular(G, S): GrpPerm, SetEnum -> BoolElt`

Given a permutation group $G$, a $G$-set $Y$ for $G$, and a union of orbits $S$ for $G$ in its action on $Y$, return `true` if $G$ acts semiregularly on $S$. If $Y$ is the natural $G$-set, then $Y$ may be omitted.

<a id="function-isfrobenius-grpperm"></a>
##### `IsFrobenius(G): GrpPerm -> BoolElt`

Returns `true` if the permutation group $G$ is a Frobenius group with respect to its natural action, `false` otherwise. (A group $G$ defined as acting on $X$ is Frobenius if it acts transitively but non-regularly on $X$ and if the pointwise stabilizer of any two distinct points of $X$ is the trivial group.)

<a id="example-ex-ca8a24"></a>
##### `Example: Orbits and Stabilizers in M24 (ex-ca8a24)`

We apply some of these functions to the Mathieu group $M_{24}$, taking as generators the following three permutations:

$$
\begin{aligned}&(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,24),\\
   &(2,16,9,6,8)(3,12,13,18,4)(7,17,10,11,22)(14,19,21,20,15),\\
   &(1,22)(2,11)(3,15)(4,17)(5,9)(6,19)(7,13)(8,20)(10,16)(12,21)(14,18)(23,24).\end{aligned}
$$

```magma
> M24 := sub< Sym(24) |
>  (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,24),
>  (2,16,9,6,8)(3,12,13,18,4)(7,17,10,11,22)(14,19,21,20,15),
>  (1,22)(2,11)(3,15)(4,17)(5,9)(6,19)(7,13)(8,20)(10,16)(12,21)(14,18)(23,24)>;
> M24;
Permutation group M24 acting on a set of cardinality 24
    (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
       21, 22, 24)
    (2, 16, 9, 6, 8)(3, 12, 13, 18, 4)(7, 17, 10, 11, 22)(14, 19, 21, 20, 15)
    (1, 22)(2, 11)(3, 15)(4, 17)(5, 9)(6, 19)(7, 13)(8, 20)(10, 16)(12, 21)
       (14, 18)(23, 24)
```

Choosing a random element $x$ of $M_{24}$, we use it to compute some images.

```magma
> x := Random(M24);
> 1^x;
7
> [1,2,3,4]^x;
[ 7, 9, 8, 17 ]
> { 1,2,3,4}^x;
{ 17, 7, 8, 9 }
```

We find the stabilizer of the point $1$, which is the group $M_{23}$.

```magma
> S1 := Stabilizer(M24, 1);
> S1;
Permutation group S1 acting on a set of cardinality 24
Order = 10200960 = 2^7 * 3^2 * 5 * 7 * 11 * 23
    (2, 16, 9, 6, 8)(3, 12, 13, 18, 4)(7, 17, 10, 11, 22)(14, 19, 21, 20, 15)
    (7, 17, 22)(8, 11, 13)(9, 14, 12)(10, 20, 19)(15, 23, 18)(16, 21, 24)
    (3, 6, 18)(5, 16, 14)(7, 21, 22)(8, 19, 17)(9, 20, 24)(11, 12, 13)
    (6, 18, 15)(7, 19, 16)(8, 13, 11)(9, 10, 22)(12, 21, 20)(14, 17, 24)
    (4, 12, 6, 19)(5, 22, 24, 8)(7, 17, 20, 14)(9, 15, 13, 18)(10, 21)(11, 16)
    (6, 22, 7)(8, 13, 11)(9, 20, 16)(10, 18, 21)(12, 15, 19)(14, 24, 23)
    (5, 12, 21)(6, 15, 18)(7, 22, 8)(9, 16, 17)(10, 14, 13)(11, 24, 19)
```

We next compute the stabilizer of the sequence $[1,2,3,4,5]$.

```magma
> SQ := Stabilizer(M24, [1,2,3,4,5]);
> SQ;
Permutation group SQ acting on a set of cardinality 24
Order = 48 = 2^4 * 3
    (6, 18, 15)(7, 19, 16)(8, 13, 11)(9, 10, 22)(12, 21, 20)(14, 17, 24)
    (7, 17, 22)(8, 11, 13)(9, 14, 12)(10, 20, 19)(15, 23, 18)(16, 21, 24)
    (6, 22, 7)(8, 13, 11)(9, 20, 16)(10, 18, 21)(12, 15, 19)(14, 24, 23)
> Orbits(SQ);
[
    GSet{@ 1 @},
    GSet{@ 2 @},
    GSet{@ 3 @},
    GSet{@ 4 @},
    GSet{@ 5 @},
    GSet{@ 6, 18, 22, 15, 21, 9, 7, 23, 19, 20, 24, 10,
    14, 17, 16 12 @},
    GSet{@ 8, 13, 11 @}
]
```

The five fixed points together with the orbit of length $3$ form a block of a $5-(24,8,1)$ design. By computing the orbit of this block under $M_{24}$, we obtain all the blocks of the design.

```magma
> B := { 1,2,3,4,5,8,11,13 };
> D := B^M24;
> #D;
759
```

Finally, we check that the set stabilizer of the block $\{ 1,2,3,4,5,8,11,13\ \rbrace$ has index 759 in $M_{24}$.

```magma
> Index(M24, Stabilizer(M24, { 1,2,3,4,5,8,11,13 }));
759
```

#### Action on a $G$-Space

<a id="function-action-grpperm-gset"></a>
##### `Action(G, Y): GrpPerm, GSet -> Hom(Grp), GrpPerm, GrpPerm`

Given a permutation group $G$ defined to be acting on $X$ and a set $Y$, construct the homomorphism $\phi: G \rightarrow L$, where the permutation group $L$ gives the action of $G$ on the set $Y$. The function returns:

**(a)**
The natural homomorphism $\phi: G \rightarrow  L$;

**(b)**
The induced group $L$;

**(c)**
The kernel of the action (a subgroup of $G$).

<a id="function-actionimage-grpperm-gset"></a>
##### `ActionImage(G, Y): GrpPerm, GSet -> GrpPerm`

Given a permutation group $G$ defined to be acting on $X$ and a set $Y$, construct the permutation group $L$ giving the action of $G$ on the set $Y$.

<a id="function-actionkernel-grpperm-gset"></a>
##### `ActionKernel(G, Y): GrpPerm, GSet -> GrpPerm`

Construct the kernel of the homomorphism $\phi : G \rightarrow L$, where the permutation group $L$ gives the action of $G$ on the $G$-set $Y$.

<a id="function-isfaithful-grpperm-gset"></a>
##### `IsFaithful(G, Y): GrpPerm, GSet -> BoolElt`

Returns `true` if the action of $G$ on the $G$-set $Y$ is faithful.

<a id="example-ex-6c5cfe"></a>
##### `Example: Action of PSL(3, 4) on Flags (ex-6c5cfe)`

We take the group ${\operatorname{PSL}}(3, 4)$ acting on projective points and construct its representation on flags (point-line pairs). In order to construct the flags, we need to find a line. If $H$ is the stabilizer of a point $\alpha$ in ${\operatorname{PSL}}(3, 4)$ in its action on projective points, then a line consists of $\alpha$ together with the points in any non-trivial orbit of $O_2(G)$.

```magma
> G := ProjectiveSpecialLinearGroup(3, 4);
> O2 := pCore( Stabilizer(G, 1), 2 );
> O2;
Permutation group O2 acting on a set of cardinality 21
Order = 16 = 2^4
       (3, 4)(5, 7)(9, 16)(10, 17)(11, 15)(13, 18)(14, 19)(20, 21)
       (3, 20)(4, 21)(5, 15)(7, 11)(9, 10)(13, 19)(14, 18)(16, 17)
       (2, 8)(5, 15)(6, 12)(7, 11)(9, 17)(10, 16)(13, 18)(14, 19)
       (2, 12)(5, 11)(6, 8)(7, 15)(9, 16)(10, 17)(13, 19)(14, 18)
> flag := < 1, Orbit(O2, 2) >;
> flag;
<1, GSet{@ 2, 6, 8, 12 @}>
> flags := GSet(G, Orbit(G, flag));
> #flags;
105
> GOnFlags := ActionImage(G, flags);
> GOnFlags;
Permutation group GOnFlags acting on a set of
cardinality 105
Order = 20160 = 2^6 * 3^2 * 5 * 7
> Stabilizer(GOnFlags, Rep(flags));
Permutation group acting on a set of cardinality 105
Order = 192 = 2^6 * 3
```

#### Action on Orbits

The operations described here are concerned with the class of $G$-sets consisting of $G$-invariant subsets of the natural $G$-set. Because of the special nature of such $G$-sets, more efficient algorithms are available for computing with homomorphisms of $G$ induced by the action of $G$ on such a $G$-set. See Butler [[But85](https://docs.magma-maths.org/references.md#cite-butler-homs)] for more details.

<a id="function-orbitaction-grpperm-gset"></a>
##### `OrbitAction(G, T): GrpPerm, GSet -> Hom(Grp), GrpPerm, GrpPerm`

The homomorphism $f : G \rightarrow L$ induced by the action of $G$ on the $G$-invariant subset $T$ of $X$ (a union of orbits).

<a id="function-orbitimage-grpperm-gset"></a>
##### `OrbitImage(G, T): GrpPerm, GSet -> GrpPerm`

The group $L$ defined by the action of $G$ on the $G$-invariant subset $T$ of $X$ (a union of orbits).

<a id="function-orbitkernel-grpperm-gset"></a>
##### `OrbitKernel(G, T): GrpPerm, GSet -> GrpPerm`

The kernel of the homomorphism $f : G \rightarrow L$, where the group $L$ gives the action of $G$ on the $G$-invariant subset $T$ of $X$ (a union of orbits).

<a id="function-isorbit-grpperm-elt"></a>
##### `IsOrbit(G, S): GrpPerm, { Elt } -> BoolElt`

Returns `true` if the subset $S$ of [`Support`](https://docs.magma-maths.org/search.html?q=Support&show=intrinsics&match=exact)$(G)$ is invariant under $G$.

<a id="example-ex-301205"></a>
##### `Example: Actions on Orbits of an Intransitive Group (ex-301205)`

We study an intransitive group of degree 36 generated by the permutations

$$
\begin{aligned}&(3, 17, 26)(4, 16, 25)(5, 18, 27)(8, 15, 24),\\
   &(1, 32, 10)(2, 31, 11)(3, 35, 12)(6, 30, 15),\\
   &(12, 33, 24)(13, 29, 20)(14, 28, 19)(17, 30, 21),\\
   &(6, 26, 33)(7, 22, 34)(8, 21, 35)(9, 23, 36).\end{aligned}
$$

```magma
> G := PermutationGroup< 36 | (3, 17, 26)(4, 16, 25)(5, 18, 27)(8, 15, 24),
>                             (1, 32, 10)(2, 31, 11)(3, 35, 12)(6, 30, 15),
>                             (12, 33, 24)(13, 29, 20)(14, 28, 19)(17, 30, 21),
>                             (6, 26, 33)(7, 22, 34)(8, 21, 35)(9, 23, 36) >;
> IsTransitive(G);
false
> Orbit(G, 1);
GSet{@ 1, 32, 10 @}
> O := Orbits(G);
> O;
[
    GSet{@ 1, 32, 10 @},
    GSet{@ 2, 31, 11 @},
    GSet{@ 4, 16, 25 @},
    GSet{@ 5, 18, 27 @},
    GSet{@ 7, 22, 34 @},
    GSet{@ 9, 23, 36 @},
    GSet{@ 13, 29, 20 @},
    GSet{@ 14, 28, 19 @},
    GSet{@ 3, 17, 35, 26, 30, 12, 8, 33, 15, 21, 24, 6 @}
]
> Order(G);
933120
```

We see that the group is intransitive having eight orbits of size $3$ and one orbit of size $12$. We consider the action of $G$ on the orbit of size $12$.

```magma
> f := OrbitAction(G, O[9]);
> f;
Mapping from: GrpPerm: G to GrpPerm: $
> Im := Image(f);
> Im;
Permutation group acting on a set of cardinality 12
Order = 11520 = 2^8 * 3^2 * 5
    (1, 6, 9)(3, 5, 8)
    (4, 11, 8)(6, 10, 7)
    (6, 8)(7, 11)
    (2, 8, 10)(4, 12, 6)
    (3, 10, 8)(4, 6, 9)
> Ker := Kernel(f);
> Ker;
Permutation group acting on a set of cardinality 36
Order = 81 = 3^4
    (4, 16, 25)(5, 18, 27)
    (7, 22, 34)(9, 23, 36)
    (13, 29, 20)(14, 28, 19)
    (1, 32, 10)(2, 31, 11)(4, 25, 16)(5, 27, 18)
> IsElementaryAbelian(Ker);
true
```

Thus $G$ has an elementary abelian normal subgroup of order $81$ which is the kernel of the restriction of $G$ to the orbit of size $12$.

#### Action on a G-invariant Partition

This section describes the functions supplied by Magma for computing with block systems for a permutation group.

<a id="function-isblock-grpperm-elt"></a>
##### `IsBlock(G, S): GrpPerm, { Elt } -> BoolElt`

Given a transitive permutation group $G$ with natural $G$-set $X$, and a subset $S$ of $X$, return `true` if $S$ is a block for $G$ in its action on $X$.

<a id="function-isprimitive-grpperm-2"></a>
##### `IsPrimitive(G): GrpPerm -> BoolElt`

Returns `true` if the transitive permutation group $G$ is primitive.

<a id="function-maximalpartition-grpperm"></a>
##### `MaximalPartition(G): GrpPerm -> GSet`

Construct a $G$-invariant partition $P$ for the transitive permutation group $G$ with natural $G$-set $X$. The partition $P$ is maximal in the sense that there is no $G$-invariant partition $P'$ of $X$ such that some block of $P'$ properly contains a block of the partition $P$. The block system is returned as a partition of $X$. If $G$ is primitive, the partition with one block is returned.

<a id="function-minimalpartition-grpperm"></a>
##### `MinimalPartition(G: parameters): GrpPerm -> GSet`

```magma
Block: {Elt}                    Default: []
```

Construct a non-trivial $G$-invariant partition $P$ of the natural $G$-set $X$ of the transitive permutation group $G$. The partition $P$ is minimal in the sense that there is no $G$-invariant partition $P'$ of $X$ such that some block of $P'$ is properly contained in some block of the partition $P$. The block system is returned as a partition of $X$. If $G$ is primitive, or if no partition satisfying the side-condition (see below) is found, then the empty set is returned. The algorithm used is based on Schönert & Seress [[SS94](https://docs.magma-maths.org/references.md#cite-blocks-schonert-seress)].

If $S$ := `Block` is non-empty, then the partition $P$ must possess a block $B$ such that $S$ is a subset of $B$. In this case the algorithm used is that of Atkinson, [[Atk75](https://docs.magma-maths.org/references.md#cite-blocks-atkinson)].

<a id="function-minimalpartitions-grpperm"></a>
##### `MinimalPartitions(G: parameters): GrpPerm -> [ GSet ]`

```magma
Limit: RngIntElt                    Default: Infinity()
```

Construct all non-trivial minimal $G$-invariant partitions of the natural $G$-set $X$ of the transitive permutation group $G$. A partition $P$ is minimal in the sense that there is no $G$-invariant partition $P'$ of $X$ such that some block of $P'$ is properly contained in some block of the partition $P$.

The minimal block systems are returned as a sequence of sets of sets. If $G$ is primitive, the function returns the empty sequence.

The algorithm used is based on Schönert & Seress [[SS94](https://docs.magma-maths.org/references.md#cite-blocks-schonert-seress)].

The function will return after creating at most $n$ := `Limit` block systems. This option is useful in situations where, say, two distinct minimal blocks systems are required for a reduction algorithm.

<a id="function-minimalblocks-grpperm"></a>
##### `MinimalBlocks(G: parameters): GrpPerm -> [ SetEnum ]`

A variant of `MinimalPartitions` where a sequence of non-trivial blocks, one from each minimal partition, is returned.

<a id="function-allpartitions-grpperm"></a>
##### `AllPartitions(G): GrpPerm -> SetEnum`

Construct all non-trivial $G$-invariant partitions of the natural $G$-set $X$ of the transitive permutation group $G$. The structure returned is a set containing one block from each such partition. The block chosen is the block containing the first element of `Labelling(G)`.

<a id="function-blocksaction-grpperm-any"></a>
##### `BlocksAction(G, P): GrpPerm, Any -> Hom(GrpPerm), GrpPerm, GrpPerm`

<a id="function-blocksaction-grpperm-gset"></a>
##### `BlocksAction(G, P): GrpPerm, GSet -> Hom(GrpPerm), GrpPerm, GrpPerm`

<a id="function-blocksaction-grpperm-seqenum"></a>
##### `BlocksAction(G, P): GrpPerm, SeqEnum -> Hom(GrpPerm), GrpPerm, GrpPerm`

<a id="function-blocksaction-grpperm-setindx"></a>
##### `BlocksAction(G, P): GrpPerm, SetIndx -> Hom(GrpPerm), GrpPerm, GrpPerm`

<a id="function-blocksaction-grpperm-setenum"></a>
##### `BlocksAction(G, P): GrpPerm, SetEnum -> Hom(GrpPerm), GrpPerm, GrpPerm`

Given a transitive permutation group $G$ with natural $G$-set $X$ and a $G$-invariant partition $P$ of $X$, construct the group $L$ induced by the action of $G$ on the blocks of $P$. In the second form, $P$ is specified by giving a single block of the partition. The function returns

**(a)**
The natural homomorphism $f: G \rightarrow  L$;

**(b)**
The induced group;

**(c)**
The kernel of the action (a subgroup of $G$).

The relationship between the supports of $G$ and $L$ is given by the returned mapping, which may also be used as a map from `Labelling(G)` to `Labelling(L)`. In the forward direction this takes each element in the support of $G$ to its block number in the support of $L$, while in the reverse direction this takes a block number to a representative of the block.

<a id="function-blocksimage-grpperm-any"></a>
##### `BlocksImage(G, P): GrpPerm, Any -> GrpPerm`

<a id="function-blocksimage-grpperm-gset"></a>
##### `BlocksImage(G, P): GrpPerm, GSet -> GrpPerm`

<a id="function-blocksimage-grpperm-setindx"></a>
##### `BlocksImage(G, P): GrpPerm, SetIndx -> GrpPerm`

<a id="function-blocksimage-grpperm-seqenum"></a>
##### `BlocksImage(G, P): GrpPerm, SeqEnum -> GrpPerm`

<a id="function-blocksimage-grpperm-setenum"></a>
##### `BlocksImage(G, P): GrpPerm, SetEnum -> GrpPerm`

Given a transitive permutation group $G$ with natural $G$-set $X$ and a $G$-invariant partition $P$ of $X$, construct the group induced by the action of $G$ on the blocks of $P$. In the second form, $P$ is specified by giving a single block of the partition.

<a id="function-blockskernel-grpperm-any"></a>
##### `BlocksKernel(G, P): GrpPerm, Any -> GrpPerm`

<a id="function-blockskernel-grpperm-gset"></a>
##### `BlocksKernel(G, P): GrpPerm, GSet -> GrpPerm`

<a id="function-blockskernel-grpperm-setindx"></a>
##### `BlocksKernel(G, P): GrpPerm, SetIndx -> GrpPerm`

<a id="function-blockskernel-grpperm-seqenum"></a>
##### `BlocksKernel(G, P): GrpPerm, SeqEnum -> GrpPerm`

<a id="function-blockskernel-grpperm-setenum"></a>
##### `BlocksKernel(G, P): GrpPerm, SetEnum -> GrpPerm`

Given a transitive permutation group $G$ with natural $G$-set $X$ and a $G$-invariant partition $P$ of $X$, construct the kernel of the action of $G$ on the blocks of $P$. In the second form, $P$ is specified by giving a single block of the partition.

<a id="example-ex-da83a9"></a>
##### `Example: Block Systems of an Imprimitive Group (ex-da83a9)`

An imprimitive group of degree 100 constructed by Capel has several different block systems.

```magma
> G := sub< Sym(100) |
>   (1,21,41,61,81)(2,82,62,42,22)(3,23,43,63,83)(4,84,64,44,24)
>     (5,25,45,65,85)(6,86,66,46,26)(7,27,47,67,87)(8,88,68,48,28)
>     (9,29,49,69,89)(10,90,70,50,30)(11,31,51,71,91)(12,92,72,52,32)
>     (13,33,53,73,93)(14,94,74,54,34)(15,35,55,75,95)(16,96,76,56,36)
>     (17,37,57,77,97)(18,98,78,58,38)(19,39,59,79,99)(20,100,80,60,40),
>   (1,4,6,7,10)(2,3,5,8,9)(11,19,17,15,14)(12,20,18,16,13)(21,24,26,27,30)
>      (22,23,25,28,29)(31,39,37,35,34)(32,40,38,36,33)(41,44,46,47,50)
>      (42,43,45,48,49)(51,59,57,55,54)(52,60,58,56,53)(61,64,66,67,70)
>      (62,63,65,68,69)(71,79,77,75,74)(72,80,78,76,73)(81,84,86,87,90)
>      (82,83,85,88,89)(91,99,97,95,94)(92,100,98,96,93),
>   (1,11,2,12)(3,13,4,14)(5,16,6,15)(7,17,8,18)(9,20,10,19)(21,31,22,32)
>      (23,33,24,34)(25,36,26,35)(27,37,28,38)(29,40,30,39)(41,51,42,52)
>      (43,53,44,54)(45,56,46,55)(47,57,48,58)(49,60,50,59)(61,71,62,72)
>      (63,73,64,74)(65,76,66,75)(67,77,68,78)(69,80,70,79)(81,91,82,92)
>      (83,93,84,94)(85,96,86,95)(87,97,88,98)(89,100,90,99) >;
> MaxPart := MaximalPartition(G);
> #MaxPart;
2
> MaxPart;
GSet{@
    { 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 31, 32, 33, 34, 35,
    36, 37, 38, 39, 40, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 71,
    72, 73, 74, 75, 76, 77, 78, 79, 80, 91, 92, 93, 94, 95, 96, 97,
    98, 99, 100 },
    { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 21, 22, 23, 24, 25, 26, 27, 28,
    29, 30, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 61, 62, 63, 64,
    65, 66, 67, 68, 69, 70, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90 }
@}
> MinPart := MinimalPartition(G);
> #MinPart;
50
```

We see that the group has a (maximal) system of imprimitivity consisting of $2$ blocks of size $50$ and a (minimal) system of imprimitivity consisting of $50$ blocks of size $2$.

```magma
> Parts := MinimalPartitions(G);
> [ #p : p in Parts ];
[ 50, 50, 50, 50, 20, 50 ]
```

Thus the group has six distinct minimal $G$-invariant partitions. Of these five have 50 blocks of size two while the remaining one has 20 blocks of size 5. We examine the action of G on one of the partitions into 50 blocks of size 2.

```magma
> f, Im, Ker := BlocksAction(G, Parts[1]);
> f;
Mapping from: GrpPerm: G to GrpPerm: Im
> Im;
Permutation group Im acting on a set of cardinality 50
Order = 7812500 = 2^2 * 5^9
    (1, 11, 31, 32, 12)(2, 13, 33, 34, 14)(3, 15, 35, 36, 16)
         (4, 17, 37, 38, 18) (5, 19, 39, 40, 20)(6, 21, 41, 42, 22)
         (7, 23, 43, 44, 24)(8, 25, 45, 46, 26)(9, 27, 47, 48, 28)
         (10, 29, 49, 50, 30)
    (1, 2, 3, 4, 5)(6, 10, 9, 8, 7)(11, 14, 16, 17, 20)(12, 13, 15, 18, 19)
         (21, 29, 27, 25, 24)(22, 30, 28, 26, 23)(31, 34, 36, 37, 40)
         (32, 33, 35, 38, 39)(41, 49, 47, 45, 44)(42, 50, 48, 46, 43)
    (1, 6)(2, 7)(3, 8)(4, 9)(5, 10)(11, 21, 12, 22)(13, 23, 14, 24)
        (15, 26, 16, 25)(17, 27, 18, 28)(19, 30, 20, 29)(31, 41, 32, 42)
        (33, 43, 34, 44)(35, 46, 36, 45)(37, 47, 38, 48)(39, 50, 40, 49)
> Ker;
Permutation group Ker acting on a set of cardinality 100
Order = 1
```

Thus, $G$ acts faithfully on this block system.

<a id="example-ex-c3774e"></a>
##### `Example: Reducing to Primitive Components (ex-c3774e)`

When analyzing a permutation group, it is sometimes necessary to reduce it to its primitive components. This can be done by using the constituent homomorphism and blocks homomorphism functions. We illustrate their use by analyzing the group of Rubik’s cube, represented as a permutation group on 48 letters:

```magma
> G := sub<Sym(48) |
>     (1,3,8,6)(2,5,7,4)(9,48,15,12)(10,47,16,13)(11,46,17,14),
>     (6,15,35,26)(7,22,34,19)(8,30,33,11)(12,14,29,27)(13,21,28,20),
>     (1,12,33,41)(4,20,36,44)(6,27,38,46)(9,11,26,24)(10,19,25,18),
>     (1,24,40,17)(2,18,39,23)(3,9,38,32)(41,43,48,46)(42,45,47,44),
>     (3,43,35,14)(5,45,37,21)(8,48,40,29)(15,17,32,30)(16,23,31,22),
>     (24,27,30,43)(25,28,31,42)(26,29,32,41)(33,35,40,38)(34,37,39,36) >;
> O1 := Orbits(G);
> O1;
[
    GSet{@ 1, 3, 6, 8, 9, 11, 12, 14, 15, 17, 24, 26, 27, 29,
     30, 32, 33, 35, 38, 40, 41, 43, 46, 48 @},
    GSet{@ 2, 4, 5, 7, 10, 13, 16, 18, 19, 20, 21, 22, 23, 25, 28,
     31, 34, 36, 37, 39, 42, 44, 45, 47 @}
]
```

Thus, $G$ has two orbits, each of size 24. We consider the restriction of the action of $G$ to the first of these orbits.

```magma
> f1, Im1, Ker1 := OrbitAction(G, O1[1]);
> FactoredOrder(Im1);
[ <2, 7>, <3, 9>, <5, 1>, <7, 1> ]
> IsPrimitive(Im1);
false
> P1 := MinimalPartition(Im1);
> #P1;
8
> f2, Im2, Ker2 := BlocksAction(Im1, P1);
> FactoredOrder(Im2);
[ <2, 7>, <3, 2>, <5, 1>, <7, 1> ]
> IsPrimitive(Im2);
true
> IsSymmetric(Im2);
true
> FactoredOrder(Ker2);
[ <3, 7> ]
> IsElementaryAbelian(Ker2);
true
```

Hence the group obtained by restricting $G$ to its first orbit is isomorphic to $Sym(8)$ acting on an elementary abelian normal subgroup of order $3^7$. We next investigate the kernel $Ker1$ of the restriction of $G$ to the first orbit of length 24. We know that $Ker1$ must fix all the points in the first orbit of $G$ so we first take its restriction to the second orbit.

```magma
> f3, Im3, Ker3 := OrbitAction(Ker1, O1[2]);
> IsTransitive(Im3);
true
> FactoredOrder(Im3);
[ <2, 20>, <3, 5>, <5, 2>, <7, 1>, <11, 1> ]
> FactoredOrder(Ker3);
[]
> IsPrimitive(Im3);
false
```

The kernel acts transitively and faithfully on the second orbit. As it is imprimitive, we look at its action on a system of imprimitivity.

```magma
> P := MinimalPartition(Im3);
> f4, Im4, Ker4 := BlocksAction(Im3, P);
> Im4;
Permutation group Im4 acting on a set of cardinality 12
Order = 239500800 = 2^9 * 3^5 * 5^2 * 7 * 11
    (10, 12, 11)
    (9, 12, 11)
    (8, 12, 9)
    (7, 9)(8, 12)
    (6, 9, 10)
    (5, 6, 9)
    (4, 6, 9)
    (3, 6, 9)
    (2, 6, 9, 5)(4, 10)
    (1, 9, 6, 5)(4, 10)
> IsPrimitive(Im4);
true
> IsAlternating(Im4);
true
> FactoredOrder(Ker4);
[ <2, 11> ]
> IsElementaryAbelian(Ker4);
true
```

The kernel of the restriction of $G$ to the first orbit is isomorphic to $Alt(12)$ acting on an elementary abelian group of order $2^{11}$. So we now know the composition factors of $G$ together with an indication of how they fit together.

#### Action on a Coset Space

<a id="function-cosetaction-grp-grp"></a>
##### `CosetAction(G, H: parameters): Grp, Grp -> Hom(Grp), GrpPerm, GrpPerm`

<a id="function-regularrepresentation-grp-grp"></a>
##### `RegularRepresentation(G, H: parameters): Grp, Grp -> Hom(Grp), GrpPerm, GrpPerm`

```magma
Al: MonStgElt                    Default: "Default"
```

Given a subgroup $H$ of the group $G$, construct the permutation representation of $G$ given by the action of $G$ on the set of (right) cosets of $H$ in $G$. The function returns:

**(a)**
The natural homomorphism $f: G \rightarrow  L$;

**(b)**
The induced group $L$;

**(c)**
The kernel $K$ of the action (a subgroup of $G$).

Note that $G$ may be any type of group. If $G$ is a finitely presented group, then $K$ may be returned undefined.

`Al := "Wang"`: Construct the coset action using Wang da Fang’s algorithm which builds the action up the stabilizer chains of $G$ and $H$, using a sequence of induction and block image operations. This algorithm is particularly efficient when $H$ has fixed points that are not fixed points of $G$, and is the default choice when $H$ is trivial.

`Al := "Canonical"`: Compute the cosets using an orbit algorithm, which describes each coset found by computing a canonical element of that coset. The canonical element is one with the minimal base image in the group $G$. The algorithm is due to Richardson, [[Ric73](https://docs.magma-maths.org/references.md#cite-jimr-msc)].

`Al := "Default"`: Choose one of the above to use.

<a id="function-cosetimage-grp-grp"></a>
##### `CosetImage(G, H: parameters): Grp, Grp -> GrpPerm`

Given a subgroup $H$ of the group $G$, construct the image $L$ of $G$ given by the action of $G$ on the set of (right) cosets of $H$ in $G$. $L$ is returned as a permutation group. Possible parameters are as for the previous function.

<a id="function-cosetkernel-grp-grp"></a>
##### `CosetKernel(G, H): Grp, Grp -> Grp`

Given a subgroup $H$ of the group $G$, construct the kernel of the action of $G$ on the set of (right) cosets of $H$ in $G$.

#### Reduced Permutation Actions

If a permutation group is intransitive or imprimitive, then orbit actions and blocks actions provide natural permutation representations of lower degree.

<a id="function-transitivequotient-grpperm"></a>
##### `TransitiveQuotient(G): GrpPerm -> GrpPerm, Hom, GrpPerm`

Returns the transitive constituent of $G$ acting on its longest orbit, together with the action homomorphism and the kernel of the action. If G is transitive then the return values are $G$, the identity map on $G$, and the trivial subgroup of $G$.

<a id="function-primitivequotient-grpperm"></a>
##### `PrimitiveQuotient(G): GrpPerm -> GrpPerm, Hom, GrpPerm`

For a transitive group $G$, returns the blocks image of $G$ acting on a maximal block system, together with the action homomorphism and the kernel of the action. If G is primitive then the return values are $G$, the identity map on $G$, and the trivial subgroup of $G$.

<a id="function-degreereduction-grpperm"></a>
##### `DegreeReduction(G): GrpPerm -> GrpPerm, Hom`

Use a combination of orbit images and blocks images to attempt to find a faithful permutation representation of $G$ with lower degree than $G$. The second return value is the isomorphism from $G$ to the representation found. If no lower degree faithful representation is found then $G$ and the identity map on $G$ is returned.

#### The Jellyfish Algorithm

The Jellyfish reduction algorithm was introduced in [[LNPS06](https://docs.magma-maths.org/references.md#cite-lnps-jellyfish)]. See this article for an explanation of the name “Jellyfish”. It attempts to find faithful low degree permutation representations for a family of large-base primitive permutation groups. We now define the target family as given in [[LNPS06](https://docs.magma-maths.org/references.md#cite-lnps-jellyfish)]. Consider the group $W = S_n\wr S_r$, as a permutation group in its primitive action on the set of $r$-tuples of $k$-subsets of the chosen $n$-set (see [`PrimitiveWreathProduct`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/building-groups.md#function-permg-primitivewreathproduct)). Let $M$ be the socle of $W$, $M = A_n^r$. Let $G$ be any subgroup of $W$, with $M\le G$, such that the conjugation action of $G$ on the $r$ copies of $A_n$ in $M$ is transitive. A group $T$ is in the target family of the algorithm if $T$ is permutation isomorphic to some such $G$, having $n > 2rk^2$, and $rk > 1$. The degree of such a $T$ is ${n \choose k}^r$, and any such $T$ is primitive. The image sought by the algorithm has degree $nk$. The utility of the algorithm is that any primitive group not in the target family is either alternating, symmetric, or has a short base.

The algorithm is one-sided Monte-Carlo in that, if it reports success, then it has found a faithful representation of the group. There is a small probability that the algorithm will find no faithful representation, even when the group given is in the target family.

Note that the Jellyfish algorithm implemented in Magma may succeed even when the input group is not in the target family. In all cases, success of the algorithm guarantees a faithful representation of the group.

The Magma implementation offers functions for testing the group for applicability of the Jellyfish algorithm. If successful, this test constructs data structures as in the cited article for quick evaluation of the homomorphism to the low-degree representation found and stores these with the group. There are also functions to compute the image and preimage of elements under the representation map. The preimage function is an addition to the algorithms given in [[LNPS06](https://docs.magma-maths.org/references.md#cite-lnps-jellyfish)], using an extension of their data structure. The preimage algorithm is nearly linear in the degree of the large degree primitive group.

<a id="function-jellyfishconstruction-grpperm"></a>
##### `JellyfishConstruction(G: parameters): GrpPerm -> BoolElt`

```magma
Limit: RngIntElt                    Default: 
```

Attempt to construct a set of jellyfish for $G$. If unsuccessful, return false. Otherwise, construct data structures corresponding to T1 and T5 of [[LNPS06](https://docs.magma-maths.org/references.md#cite-lnps-jellyfish)], attach them to $G$, and return `true`. The parameter `Limit` controls how many attempts are made to find the orbits of the point stabilizer of G, which is the initial step in constructing a jellyfish. This construction phase terminates after a sequence of `Limit` random elements of $G$ fails to change the orbits found. If the orbits found so far are not the orbits of a point stabilizer in $G$, the algorithm may fail. The same limit is used in the next phase, constructing the first jellyfish. The current default is the maximum of 15 and $2\lfloor\log_2 d\rfloor$, where $d$ is the degree of $G$.

<a id="function-jellyfishimage-grpperm"></a>
##### `JellyfishImage(G): GrpPerm -> GrpPerm`

If the `JellyfishConstruction` function applied to $G$ has returned `true`, return the faithful image of $G$ found by the jellyfish algorithm. Otherwise an error results. If the `JellyfishConstruction` has not yet been applied to $G$, then it is applied first with default parameters. A failure here results in an error.

<a id="function-jellyfishimage-grpperm-grppermelt"></a>
##### `JellyfishImage(G, x: parameters): GrpPerm, GrpPermElt -> GrpPermElt`

<a id="function-jellyfishimage-grpperm-grpperm"></a>
##### `JellyfishImage(G, H: parameters): GrpPerm, GrpPerm -> GrpPermElt`

```magma
KnownInGroup: BoolElt                    Default: false
```

If the `JellyfishConstruction` function applied to $G$ has returned `true`, return the image of $x$ as a permutation of the jellyfish, or the image of $H$ as a permutation group acting on the jellyfish. The function will attempt this for any $x$ in the same symmetric group as $G$ and any subgroup of this symmetric group. The algorithm may fail when $x\notin G$ or $H$ is not a subgroup of $G$, in which cases an error results. It is possible for this map to succeed when $x$ is not in $G$ or $H$ is not a subset of $G$. In recognition of this, the parent of the result will be a symmetric group. This can be varied by setting the `KnownInGroup` parameter to be true, which should only be done when it is known that $x\in G$ or $H\le G$, which will dispense with checking the validity of the operation, and give an element (or group) that is flagged as contained in the jellyfish image of $G$. If the `JellyfishConstruction` has not yet been applied to $G$, then it is applied first with default parameters. A failure here results in an error.

<a id="function-jellyfishpreimage-grpperm-grppermelt"></a>
##### `JellyfishPreimage(G, x: parameters): GrpPerm, GrpPermElt -> GrpPermElt`

<a id="function-jellyfishpreimage-grpperm-grpperm"></a>
##### `JellyfishPreimage(G, I: parameters): GrpPerm, GrpPerm -> GrpPermElt`

```magma
KnownInGroup: BoolElt                    Default: false
```

If the `JellyfishConstruction` function applied to $G$ has returned `true`, return the preimage of $x$ as a permutation in the symmetric group of $G$. The element $x$ is assumed to be a permutation of the jellyfish for $G$. The function will attempt this for any $x$ in the same symmetric group as the `JellyfishImage` of $G$. The algorithm may fail when $x$ is not in the image group, in which case an error results. It is possible for this map to succeed when $x$ is not in the image group. In recognition of this, the parent of the result will be a symmetric group. The function may also gbe applied to a subgroup, $I$ of the jellyfish image group of $G$. If the `KnownInGroup` parameter is set to true then it will be assumed that taking the preimage of $x$ (or $I$) will be valid and that the result will lie in $G$. If the `JellyfishConstruction` has not yet been applied to $G$, then it is applied first with default parameters. A failure here results in an error.

### Normal and Subnormal Subgroups

#### Characteristic Subgroups and Normal Series

<a id="function-grpperm-derivedseries"></a>
##### `DerivedSeries(G): GrpPerm -> [ GrpPerm ]`

The derived series of the group $G$. The series is returned as a sequence of subgroups. The algorithm used is described in [[BC82](https://docs.magma-maths.org/references.md#cite-perm-matrix-i)].

<a id="function-compositionseries-grpperm"></a>
##### `CompositionSeries(G): GrpPerm -> [ GrpPerm ]`

A composition series of the group $G$, ie. a descending chain of normal subgroups, such that each quotient is a simple group. The series is returned as a sequence of subgroups.

<a id="function-commutatorsubgroup-grpperm"></a>
##### `CommutatorSubgroup(G): GrpPerm -> GrpPerm`

<a id="function-derivedsubgroup-grpperm"></a>
##### `DerivedSubgroup(G): GrpPerm -> GrpPerm`

<a id="function-derivedgroup-grpperm"></a>
##### `DerivedGroup(G): GrpPerm -> GrpPerm`

The derived subgroup of the group $G$.

<a id="function-solubleresidual-grpperm"></a>
##### `SolubleResidual(G): GrpPerm -> GrpPerm`

<a id="function-solvableresidual-grpperm"></a>
##### `SolvableResidual(G): GrpPerm -> GrpPerm`

The solvable residual (the last term of the derived series) of the group $G$.

<a id="function-derivedlength-grpperm"></a>
##### `DerivedLength(G): GrpPerm -> RngIntElt`

The derived length of $G$. If $G$ is non-soluble, the function returns the number of terms in the series terminating with the soluble residual.

<a id="function-lowercentralseries-grpperm"></a>
##### `LowerCentralSeries(G): GrpPerm -> [ GrpPerm ]`

The lower central series of $G$. The series is returned as a sequence of subgroups, the first of which is the group $G$. The algorithm used is described in [[BC82](https://docs.magma-maths.org/references.md#cite-perm-matrix-i)].

<a id="function-nilpotencyclass-grpperm"></a>
##### `NilpotencyClass(G): GrpPerm -> RngIntElt`

The nilpotency class of the group $G$. If the group is not nilpotent, the value $-1$ is returned.

<a id="function-uppercentralseries-grpperm"></a>
##### `UpperCentralSeries(G): GrpPerm -> [ GrpPerm ]`

The upper central series of $G$. The series is returned as a sequence of subgroups commencing with the trivial subgroup. The algorithm used is to compute the centre of $G$ and then section centralisers (see [[Luk93](https://docs.magma-maths.org/references.md#cite-luks-polynomial)]) up the chain. This requires computing cores of subgroups, so this function is more restricted in its range of application than `DerivedSeries` and `LowerCentralSeries`.

<a id="function-centre-grpperm"></a>
##### `Centre(G): GrpPerm -> GrpPerm`

<a id="function-center-grpperm"></a>
##### `Center(G): GrpPerm -> GrpPerm`

Construct the centre of the group $G$. The centre is found by applying the function `CentralizerOfNormalSubgroup` to $G$ in $G$.

<a id="function-hypercentre-grpperm"></a>
##### `Hypercentre(G): GrpPerm -> GrpPerm`

<a id="function-hypercenter-grpperm"></a>
##### `Hypercenter(G): GrpPerm -> GrpPerm`

Construct the hypercentre of the group $G$ (the stationary term of the upper central series).

<a id="function-pcore-grpperm-rngintelt"></a>
##### `pCore(G, p): GrpPerm, RngIntElt -> GrpPerm`

Given a group $G$ and a prime $p$, construct the maximal normal $p$-subgroup of $G$. The algorithm employed is described in Unger [[Ung06b](https://docs.magma-maths.org/references.md#cite-unger)].

<a id="function-pcorequotient-grpperm-rngintelt"></a>
##### `pCoreQuotient(G, p): GrpPerm, RngIntElt -> GrpPerm, Map, GrpPerm`

Given a group $G$ and a prime $p$, construct the quotient of $G$ by `K := pCore(G, p)`. The return values are the quotient, $Q$, represented as a permutation group of the same degree as $G$, the quotient map from $G$ onto $Q$, and $K$.

<a id="function-fittinggroup-grpperm"></a>
##### `FittingGroup(G): GrpPerm -> GrpPerm`

<a id="function-fittingsubgroup-grpperm"></a>
##### `FittingSubgroup(G): GrpPerm -> GrpPerm`

The Fitting subgroup of the group $G$. It is computed as the product of the $p$-cores of the radical of $G$.

<a id="function-frattinisubgroup-grpperm"></a>
##### `FrattiniSubgroup(G): GrpPerm -> GrpPerm`

Given a group $G$, return the Frattini subgroup. For $p$-groups this is computed as the derived group with $p$th powers of the generators added. Solvable groups are converted to their `GrpPC` representation and the problem solved there. Non-solvable groups are treated by finding their maximal subgroups and forming the intersection, so are subject to the same restrictions as the `MaximalSubgroups` command.

<a id="function-jenningsseries-grpperm"></a>
##### `JenningsSeries(G): GrpPerm -> [ GrpPerm ]`

Given a $p$-group $G$, return the Jennings series for $G$. The series is returned as a sequence of subgroups.

<a id="function-pcentralseries-grpperm-rngintelt"></a>
##### `pCentralSeries(G, p): GrpPerm, RngIntElt -> [ GrpPerm ]`

Given a soluble group $G$, and a prime $p$ dividing $|G|$, return the lower $p$-central series for $G$. The series is returned as a sequence of subgroups.

<a id="function-subnormalseries-grpperm-grpperm"></a>
##### `SubnormalSeries(G, H): GrpPerm, GrpPerm -> [ GrpPerm ]`

Given a group $G$ and a subnormal subgroup $H$ of $G$, return a sequence of subgroups commencing with $G$ and terminating with $H$, such that each subgroup is normal in the previous one. If $H$ is not subnormal in $G$, the empty sequence is returned.

<a id="example-ex-bfec16"></a>
##### `Example: Series of a Soluble Wreath Product (ex-bfec16)`

We compute the various series in the wreath product of the symmetric group of degree 4 with the dihedral group of order 8 (a soluble group).

```magma
> G := WreathProduct(Sym(4), DihedralGroup(4));
> G;
Permutation group G acting on a set of cardinality 16
    (1, 5, 9, 13)(2, 6, 10, 14)(3, 7, 11, 15)(4, 8, 12, 16)
    (1, 13)(2, 14)(3, 15)(4, 16)(5, 9)(6, 10)(7, 11)(8, 12)
    (1, 2, 3, 4)
    (1, 2)
> [ FactoredOrder(H) : H in DerivedSeries(G) ];
[
    [ <2, 15>, <3, 4> ],
    [ <2, 12>, <3, 4> ],
    [ <2, 9>, <3, 4> ],
    [ <2, 8>, <3, 4> ],
    [ <2, 8> ],
    []
]
> DerivedLength(G);
5
> [ FactoredOrder(H) : H in LowerCentralSeries(G) ];
[
    [ <2, 15>, <3, 4> ],
    [ <2, 12>, <3, 4> ],
    [ <2, 10>, <3, 4> ],
    [ <2, 9>, <3, 4> ],
    [ <2, 8>, <3, 4> ]
]
> NilpotencyClass(G);
-1
> Centre(G);
Permutation group acting on a set of cardinality 16
Order = 1
    Id($)
> pCentralSeries(G, 2);
[
    [ <2, 15>, <3, 4> ],
    [ <2, 12>, <3, 4> ],
    [ <2, 10>, <3, 4> ],
    [ <2, 9>, <3, 4> ],
    [ <2, 8>, <3, 4> ]
]
> [ FactoredOrder(H) : H in pCentralSeries(G, 3) ];
[
    [ <2, 15>, <3, 4> ]
]
```

#### Maximal and Minimal Normal Subgroups

<a id="function-maximalnormalsubgroup-grpperm"></a>
##### `MaximalNormalSubgroup(G): GrpPerm -> GrpPerm`

A maximal normal subgroup of $G$. The trivial subgroup is returned if $G$ is simple. The algorithm takes homomorphic reductions to a primitive group and then uses O’Nan-Scott type considerations to get its result.

<a id="function-minimalnormalsubgroups-grpperm"></a>
##### `MinimalNormalSubgroups(G): GrpPerm -> [ GrpPerm ]`

The minimal normal subgroups of $G$. These are obtained by first computing the socle of $G$ and then splitting off the normal factors.

#### Lattice of Normal Subgroups

<a id="function-normalsubgroups-grpperm-2"></a>
##### `NormalSubgroups(G): GrpPerm -> [ Rec ]`

The normal subgroups of $G$. These are determined by the method of Cannon and Souvignier [[CS](https://docs.magma-maths.org/references.md#cite-normal-subgps-permg)].

<a id="function-normallattice-grpperm"></a>
##### `NormalLattice(G): GrpPerm -> SubGrpLat`

The normal subgroup lattice of $G$. The subgroups are first found using the same algorithm as the function `NormalSubgroups` and then inclusions are determined.

<a id="example-ex-7f08ec"></a>
##### `Example: Normal Subgroups of a Wreath Product (ex-7f08ec)`

We determine all normal subgroups of the wreath product of $Sym(8)$ and the dihedral group of order $8$.

```magma
> G := WreathProduct(Sym(8), DihedralGroup(4));
> Order(G);
21143266346926080000
> time N := NormalSubgroups(G);
Time: 1.050
> #N;
29
> [ < Order(H`subgroup), FactoredOrder(H`subgroup) > : H in N ];
[
    <1, []>,
    <165181768335360000, [ <2, 24>, <3, 8>, <5, 4>, <7, 4> ]>,
    <330363536670720000, [ <2, 25>, <3, 8>, <5, 4>, <7, 4> ]>,
    <660727073341440000, [ <2, 26>, <3, 8>, <5, 4>, <7, 4> ]>,
    <1321454146682880000, [ <2, 27>, <3, 8>, <5, 4>, <7, 4> ]>,
    <1321454146682880000, [ <2, 27>, <3, 8>, <5, 4>, <7, 4> ]>,
    <1321454146682880000, [ <2, 27>, <3, 8>, <5, 4>, <7, 4> ]>,
    <2642908293365760000, [ <2, 28>, <3, 8>, <5, 4>, <7, 4> ]>,
    <2642908293365760000, [ <2, 28>, <3, 8>, <5, 4>, <7, 4> ]>,
    <2642908293365760000, [ <2, 28>, <3, 8>, <5, 4>, <7, 4> ]>,
    <2642908293365760000, [ <2, 28>, <3, 8>, <5, 4>, <7, 4> ]>,
    <2642908293365760000, [ <2, 28>, <3, 8>, <5, 4>, <7, 4> ]>,
    <2642908293365760000, [ <2, 28>, <3, 8>, <5, 4>, <7, 4> ]>,
    <2642908293365760000, [ <2, 28>, <3, 8>, <5, 4>, <7, 4> ]>,
    <5285816586731520000, [ <2, 29>, <3, 8>, <5, 4>, <7, 4> ]>,
    <5285816586731520000, [ <2, 29>, <3, 8>, <5, 4>, <7, 4> ]>,
    <5285816586731520000, [ <2, 29>, <3, 8>, <5, 4>, <7, 4> ]>,
    <5285816586731520000, [ <2, 29>, <3, 8>, <5, 4>, <7, 4> ]>,
    <5285816586731520000, [ <2, 29>, <3, 8>, <5, 4>, <7, 4> ]>,
    <5285816586731520000, [ <2, 29>, <3, 8>, <5, 4>, <7, 4> ]>,
    <5285816586731520000, [ <2, 29>, <3, 8>, <5, 4>, <7, 4> ]>,
    <10571633173463040000, [ <2, 30>, <3, 8>, <5, 4>, <7, 4> ]>,
    <10571633173463040000, [ <2, 30>, <3, 8>, <5, 4>, <7, 4> ]>,
    <10571633173463040000, [ <2, 30>, <3, 8>, <5, 4>, <7, 4> ]>,
    <10571633173463040000, [ <2, 30>, <3, 8>, <5, 4>, <7, 4> ]>,
    <10571633173463040000, [ <2, 30>, <3, 8>, <5, 4>, <7, 4> ]>,
    <10571633173463040000, [ <2, 30>, <3, 8>, <5, 4>, <7, 4> ]>,
    <10571633173463040000, [ <2, 30>, <3, 8>, <5, 4>, <7, 4> ]>,
    <21143266346926080000, [ <2, 31>, <3, 8>, <5, 4>, <7, 4> ]>
]
```

<a id="grpperm-tablecompositionfactors"></a>
#### Composition and Chief Series

<a id="function-chieffactors-grpperm"></a>
##### `ChiefFactors(G): GrpPerm -> [ <RngIntElt, RngIntElt, RngIntElt, RngIntElt> ]`

Given a group $G$, return a sequence of the isomorphism types $<f, d, q, m>$ of the chief factors. An isomorphism type in a chief factor should be understood as the direct product of $m$ copies of the simple group described by $<f, d, q>$ (see `CompositionFactors` below). For the algorithm, see Unger [[Ung](https://docs.magma-maths.org/references.md#cite-chief-series-unger)].

<a id="function-chiefseries-grpperm"></a>
##### `ChiefSeries(G): GrpPerm -> [ GrpPerm ], [ <RngIntElt, RngIntElt, RngIntElt, RngIntElt> ]`

Given a group $G$, return the chief series of $G$ and a sequence of the corresponding isomorphism types $<f, d, q, m>$ of the chief factors. An isomorphism type in a chief factor should be understood as the direct product of $m$ copies of the simple group described by $<f, d, q>$ (see `CompositionFactors` below). The series will be organised to include the soluble radical of $G$, and, if $G$ is insoluble, the socle of the quotient of $G$ by the soluble radical.

*Table 1: Family numbers and names Table 2: Sporadic groups*

<a id="function-compositionfactors-grpperm"></a>
##### `CompositionFactors(G): GrpPerm -> [ <RngIntElt, RngIntElt, RngIntElt> ]`

Given a permutation group $G$, return a sequence $S$ of tuples that represent the composition factors of $G$, ordered according to some composition series of $G$. Each tuple is a triple of integers $f$, $d$, $q$ that defines the isomorphism type of the corresponding composition factor. A triple $\langle f,d,q \rangle$ describes a simple group as follows. The integer $f$ defines the family to which the group belongs, and $d$ and $q$ are the parameters of the family. The length of the sequence $S$ is the number of composition factors of $G$. The algorithm used is the “tabular” algorithm of Kantor [[Kan91](https://docs.magma-maths.org/references.md#cite-kantor-comp-factors)], extended to be valid for groups of degree $\le 2^{30}$.

```
   The families are:
       f      family name
   -------------------------
       1       A(d, q)
       2       B(d, q)
       3       C(d, q)
       4       D(d, q)
       5       G(2, q)
       6       F(4, q)
       7       E(6, q)
       8       E(7, q)
       9       E(8, q)
      10       2A(d, q)
      11       2B(2, q)
      12       2D(d, q)
      13       3D(4, q)
      14       2G(2, q)
      15       2F(4, q)
      16       2E(6, q)
      17       Alternating(d)
      18       Sporadic group --- see next list
      19       Cyclic(q)

   For f=18, the sporadic groups are:
       d      group name
   -------------------------
       1      M_11
       2      M_12
       3      M_22
       4      M_23
       5      M_24
       6      J_1
       7      HS
       8      J_2
       9      McL
      10      Suz
      11      J_3
      12      Co_1
      13      Co_2
      14      Co_3
      15      He
      16      Fi_22
      17      Fi_23
      18      Fi_24
      19      Ly
      20      Ru
      21      ON
      22      Th
      23      HN
      24      BM
      25      M
      26      J_4
```

<a id="example-ex-ea023a"></a>
##### `Example: Composition Factors of Rubik's Cube Group (ex-ea023a)`

We illustrate the function `CompositionFactors` by applying it to the group associated with Rubik’s cube.

```magma
> G := sub<Sym(48) |
>     (1,3,8,6)(2,5,7,4)(9,48,15,12)(10,47,16,13)(11,46,17,14),
>     (6,15,35,26)(7,22,34,19)(8,30,33,11)(12,14,29,27)(13,21,28,20),
>     (1,12,33,41)(4,20,36,44)(6,27,38,46)(9,11,26,24)(10,19,25,18),
>     (1,24,40,17)(2,18,39,23)(3,9,38,32)(41,43,48,46)(42,45,47,44),
>     (3,43,35,14)(5,45,37,21)(8,48,40,29)(15,17,32,30)(16,23,31,22),
>     (24,27,30,43)(25,28,31,42)(26,29,32,41)(33,35,40,38)(34,37,39,36)
>         >;
> FactoredOrder(G);
[ <2, 27>, <3, 14>, <5, 3>, <7, 2>, <11, 1> ]
> CompositionFactors(G);
     G
     |  Cyclic(2)
     *
     |  Alternating(12)
     *
     |  Cyclic(2)
     *
     |  Cyclic(2)
     *
     |  Cyclic(2)
     *
     |  Cyclic(2)
     *
     |  Cyclic(2)
     *
     |  Cyclic(2)
     *
     |  Cyclic(2)
     *
     |  Cyclic(2)
     *
     |  Cyclic(2)
     *
     |  Cyclic(2)
     *
     |  Cyclic(2)
     *
     |  Alternating(8)
     *
     |  Cyclic(3)
     *
     |  Cyclic(3)
     *
     |  Cyclic(3)
     *
     |  Cyclic(3)
     *
     |  Cyclic(3)
     *
     |  Cyclic(3)
     *
     |  Cyclic(3)
     1
```

<a id="function-primaryabelianinvariants-grpperm"></a>
##### `PrimaryAbelianInvariants(G): GrpPerm -> [ RngIntElt ]`

<a id="function-abelianinvariants-grpperm"></a>
##### `AbelianInvariants(G): GrpPerm -> [ RngIntElt ]`

Given an abelian group $G$, return a sequence $Q$ containing the types of each $p$-primary component of $G$. The non-primary form gives the Smith form invariants, i.e. each element of the sequence divides the next.

<a id="function-primaryabelianbasis-grpperm"></a>
##### `PrimaryAbelianBasis(G): GrpPerm -> [ GrpPermElt ], [ RngIntElt ]`

<a id="function-abelianbasis-grpperm"></a>
##### `AbelianBasis(G): GrpPerm -> [ GrpPermElt ], [ RngIntElt ]`

Given an abelian group $G$, return sequences $B$ and $I$ where $I$ contains the types of each $p$-primary component of $G$ and $B$ contains corresponding elements of $G$ which have the order given and generate $G$. The non-primary form uses the Smith form invariants, i.e. each element of the sequence divides the next.

#### The Socle

<a id="function-socle-grpperm"></a>
##### `Socle(G): GrpPerm -> GrpPerm`

The socle of the group $G$. This is computed using the algorithms described in Cannon and Holt [[CH97](https://docs.magma-maths.org/references.md#cite-chief-series-permg)], extended to apply to all degrees up to $2^{30}$.

<a id="function-soclefactor-grpperm"></a>
##### `SocleFactor(G): GrpPerm -> GrpPerm`

A simple factor of the socle of the group $G$.

<a id="function-soclefactors-grpperm"></a>
##### `SocleFactors(G): GrpPerm -> [ GrpPerm ]`

The simple factors of the socle of the group $G$. The index of each factor in the sequence corresponds to the points of the image group of `SocleAction` and `SocleImage`.

<a id="function-socleseries-grpperm"></a>
##### `SocleSeries(G): GrpPerm -> [ GrpPerm ]`

A chain of subgroups $S_1, S_1 \times S_2, \ldots, S_1 \times \ldots \times S_r,$ where $S_1, ..., S_r$ are the simple factors of the socle of the primitive group $G$.

<a id="function-earns-grpperm"></a>
##### `EARNS(G): GrpPerm -> GrpPerm`

The elementary abelian regular normal subgroup (EARNS) of the primitive group $G$. If $G$ does not have an EARNS, then the trivial subgroup is returned. The algorithm used is that of Neumann [[Neu86](https://docs.magma-maths.org/references.md#cite-neumann-algs-permg)].

<a id="function-affinegenerallineargroup-grpperm"></a>
##### `AffineGeneralLinearGroup(E): GrpPerm -> GrpPerm`

<a id="function-agl-grpperm"></a>
##### `AGL(E): GrpPerm -> GrpPerm`

The affine general linear group of the elementary abelian group $E$, regarded as a vector space over the field ${\bf F}_{p}$, where $p$ is the exponent of $E$.

<a id="function-isaffine-grpperm"></a>
##### `IsAffine(G): GrpPerm -> BoolElt, GrpPerm`

Decide if the permutation group $G$ is of primitive affine type. If so, the elementary abelian regular normal subgroup of $G$ is returned as second return value. If the group $G$ is either intransitive or transitive and imprimitive or primitive and not of affine type, then the result will be false (only). This function combines `IsTransitive`, `IsPrimitive`, and `EARNS`.

<a id="function-affineaction-grpperm"></a>
##### `AffineAction(G): GrpPerm -> Hom, GrpPerm, GrpPerm`

Given a primitive group $G$ which has a non-trivial elementary abelian regular normal subgroup $A$, construct the representation of $G$ given by the action of $G$ on elements of the elementary abelian group $A$. The image is realised as a point-stabilizer in $G$ and the kernel of the action is $A$. As with the other action functions, `AffineAction` returns the homomorphism, the image, and the kernel of the action.

<a id="function-affineimage-grpperm"></a>
##### `AffineImage(G): GrpPerm -> GrpPerm`

Given a primitive group $G$ which has an elementary abelian regular normal subgroup $A$, construct the permutation group that results from the action of $G$ on elements of the elementary abelian group $A$. This image is realised as a point-stabilizer in $G$.

<a id="function-affinekernel-grpperm"></a>
##### `AffineKernel(G): GrpPerm -> GrpPerm`

Given a primitive group $G$ which has a non-trivial elementary abelian regular normal subgroup $A$, construct the kernel of the action of $G$ on elements of the elementary abelian group $A$. This kernel equals $A$.

<a id="function-socleaction-grpperm"></a>
##### `SocleAction(G): GrpPerm -> Hom, GrpPerm, GrpPerm`

Given a non-trivial permutation group $G$ which has trivial Fitting subgroup, construct the permutation representation of $G$ given by the action of $G$ on the simple factors of $N$. Note that a primitive group has a perfect socle if and only if it has no elementary abelian regular normal subgroup. As with the other action functions, `SocleAction` returns the homomorphism, the image, and the kernel of the action. The socle factor corresponding to point $i$ in the support of the image group is the $i$th element in the sequence `SocleFactors(G)`.

<a id="function-socleimage-grpperm"></a>
##### `SocleImage(G): GrpPerm -> GrpPerm`

Given a non-trivial permutation group $G$ which has trivial Fitting subgroup, construct the permutation group $L$ induced by the action of $G$ on the simple factors of $N$.

<a id="function-soclekernel-grpperm"></a>
##### `SocleKernel(G): GrpPerm -> GrpPerm`

Given a non-trivial permutation group $G$ which has trivial Fitting subgroup, construct the kernel of the action of $G$ on the simple factors of $N$.

<a id="function-soclequotient-grpperm"></a>
##### `SocleQuotient(G): GrpPerm -> GrpPerm, Hom, GrpPerm`

Given a permutation group $G$ which has trivial Fitting subgroup, construct a permutation representation of $G/N$. If $U_i$ denote the simple factors of $N$, then the degree of the result is bounded by $\sum_i |Out(U_i)|$ (see Cannon and Souvignier [[CS](https://docs.magma-maths.org/references.md#cite-normal-subgps-permg)]). Note that a primitive group has a perfect socle if and only if it has no elementary abelian regular normal subgroup. `SocleQuotient` returns $G/N$, the quotient homomorphism, and the kernel of the map (which is the socle of G).

<a id="function-refinesection-grpperm-grpperm-grpperm"></a>
##### `RefineSection(G, M, N): GrpPerm, GrpPerm, GrpPerm -> [ GrpPerm ]`

Given $M$, $N$ normal subgroups of $G$ with $N < M$, return a sequence of $G$-normal subgroups $L_1,\dots,L_r$ with $N = L_0$, $L_i < L_{i+1}$, and $L_r = M$ such that each of the quotients $L_{i+1}/L_i$ is either elementary abelian or a direct product of non-abelian simple groups.

<a id="example-ex-5535a8"></a>
##### `Example: Normal Structure of a Primitive Group (ex-5535a8)`

We examine the normal structure of a primitive group, the primitive-wreath product of ${\operatorname{Sym}}(5)$ and ${\operatorname{Sym}}(3)$ (with product action).

```magma
> G := PrimitiveWreathProduct(Sym(5), Sym(3));
> FactoredOrder(G);
[ <2, 10>, <3, 4>, <5, 3> ]
> E := EARNS(G);
> E;
Permutation group E acting on a set of cardinality 125
Order = 1
> DerivedSeries(G);
[
    Permutation group G acting on a set of cardinality 125
    Order = 10368000 = 2^10 * 3^4 * 5^3

    Permutation group acting on a set of cardinality 125
    Order = 2592000 = 2^8 * 3^4 * 5^3,

    Permutation group acting on a set of cardinality 125
    Order = 864000 = 2^8 * 3^3 * 5^3,

    Permutation group S acting on a set of cardinality 125
    Order = 216000 = 2^6 * 3^3 * 5^3
]
> S := Socle(G);
> S;
Permutation group S acting on a set of cardinality 125
Order = 216000 = 2^6 * 3^3 * 5^3
> Q := SocleFactors(G);
> Q;
[
    Permutation group acting on a set of cardinality 125
    Order = 60 = 2^2 * 3 * 5,

    Permutation group acting on a set of cardinality 125
    Order = 60 = 2^2 * 3 * 5,

    Permutation group acting on a set of cardinality 125
    Order = 60 = 2^2 * 3 * 5
]
> R := SocleSeries(G);
> R;
[
    Permutation group acting on a set of cardinality 125
    Order = 60 = 2^2 * 3 * 5,

    Permutation group acting on a set of cardinality 125
    Order = 3600 = 2^4 * 3^2 * 5^2,

    Permutation group acting on a set of cardinality 125
    Order = 216000 = 2^6 * 3^3 * 5^3
]
> SQ := SocleQuotient(G);
> SQ;
Permutation group SQ acting on a set of cardinality 6
Order = 48 = 2^4 * 3
    (1, 2, 3)(4, 5, 6)
    (2, 3)(4, 5)
    Id($)
    (2, 4)
```

#### The Soluble Radical and its Quotient

Very efficient algorithms have been developed for computing invariants such as subgroups, normal subgroups, and conjugacy classes of elements for soluble groups defined by means of polycyclic presentations. Almost all such algorithms employ a top-down *Lifting Strategy*. Let $P$ be a quotient-invariant property for a soluble group. In general, an algorithm that constructs the set of elements or subgroups $X_P(G)$ satisfying property $P$ for the group $G$, proceeds as follows: Let $G$ be a non-simple soluble group and let $N$ be a normal subgroup of $G$. The set $X_P(G/N)$ is constructed and its elements are lifted back into $G$, thereby yielding $X_P(G)$. This process is usually iterated with successive normal subgroups $N$ being chosen as the terms of some descending normal series (e.g., an elementary abelian series).

In generalizing this approach to permutation groups, our approach has been to construct the soluble radical $R$ of $G$, use special methods to solve the problem for the quotient $G/R$, and then proceed (as in the case of a soluble group) to lift the solution down the successive terms of an elementary abelian series for $G$ using the Lifting Strategy. Derek Holt has shown that the quotient group $G/R$ has a faithful permutation representation of degree no greater than that of $G$.

The functions in this section enable the user to construct the radical, its quotient, and an elementary abelian series.

<a id="function-radical-grpperm"></a>
##### `Radical(G): GrpPerm -> GrpPerm`

<a id="function-solubleradical-grpperm"></a>
##### `SolubleRadical(G): GrpPerm -> GrpPerm`

<a id="function-solvableradical-grpperm"></a>
##### `SolvableRadical(G): GrpPerm -> GrpPerm`

Given a group $G$, return the maximal normal solvable subgroup of $G$. The algorithm used is described in Unger [[Ung06b](https://docs.magma-maths.org/references.md#cite-unger)].

<a id="function-radicalquotient-grpperm"></a>
##### `RadicalQuotient(G): GrpPerm -> GrpPerm, Hom(GrpPerm), GrpPerm`

Given a group $G$, compute a representation of the quotient $G/R$ where $R$ is the (solvable) radical of $G$. The resulting representation has the same degree as $G$. Both the permutation group $Q$ isomorphic to $G/R$ and a homomorphism $\phi: G\rightarrow Q$ are returned. The algorithm proceeds by repeatedly applying `AbelianNormalQuotient` up the terms of the derived series of the radical. The third return value is $R$, the radical of $G$ and the kernel of the homomorphism.

<a id="function-elementaryabelianseries-grpperm"></a>
##### `ElementaryAbelianSeries(G: parameters): GrpPerm -> [ GrpPerm ]`

<a id="function-elementaryabelianseries-grpperm-grpperm"></a>
##### `ElementaryAbelianSeries(G, N: parameters): GrpPerm, GrpPerm -> [ GrpPerm ]`

```magma
LayerSizes: SeqEnum[RngIntElt]                    Default: []
```

An elementary abelian series is a chain of normal subgroups $R = N_1 > N_2 > ... > N_r = 1$ with the property that the quotient of each pair of successive terms in the series is elementary abelian and that there is no group $R < H < G$ such that $H/R$ is elementary abelian and $H$ normal in $G$. The top of the series $R$ is called the solvable radical and is the maximal normal solvable subgroup of $G$.

In the second form $N$ must be a normal subgroup of $G$ and the returned series has the form $R = N_1 > N_2 > ... > N_r = N$, so is an elementary abelian series for $G/N$.

The parameter `LayerSizes` controls possible refinement of the series. The default is no refinement. As an example, take `LayerSizes := [ 2, 5, 3, 4, 7, 3, 11, 2, 17, 1]`. When constructing an elementary abelian series for the group, attempt to split 2-layers of size gt $2^5$, 3-layers of size gt $3^4$, etc. The implied exponent for 13 is 2 and for all primes greater than 17 the exponent is 1. Setting `LayerSizes` to `[2, 1]` will attempt to split all layers, resulting in a portion of a chief series for $G$.

<a id="function-elementaryabelianseriescanonical-grpperm"></a>
##### `ElementaryAbelianSeriesCanonical(G): GrpPerm -> [ GrpPerm ]`

Gives a similar result to using `ElementaryAbelianSeries`, except the series returned depends only on the isomorphism type of the solvable radical, and consists of characteristic subgroups of $G$. This function may be slower than `ElementaryAbelianSeries`.

<a id="example-ex-034f3d"></a>
##### `Example: Soluble Radical and Its Quotient (ex-034f3d)`

We illustrate these functions by considering the group of degree $16$ generated by the following permutations:

$$
\begin{aligned}&(1, 8, 11, 3, 6, 14, 15, 10)(2, 7, 12, 4, 5, 13, 16, 9),\\
   &(1, 2)(3, 16, 9, 14, 8, 12)(4, 15, 10, 13, 7, 11),\\
   &(1, 13, 12, 16)(2, 14, 11, 15)(7, 9)(8, 10),\end{aligned}
$$

```magma
> G := PermutationGroup< 16 |
>         (1, 8, 11, 3, 6, 14, 15, 10)(2, 7, 12, 4, 5, 13, 16, 9),
>         (1, 2)(3, 16, 9, 14, 8, 12)(4, 15, 10, 13, 7, 11),
>         (1, 13, 12, 16)(2, 14, 11, 15)(7, 9)(8, 10) >;
> Radical(G);
Permutation group acting on a set of cardinality 16
Order = 256 = 2^8
   (3, 4)(5, 6)(7, 8)(13, 14)(15, 16)
   (3, 4)(7, 8)(9, 10)(11, 12)
   (7, 8)(13, 14)
   (1, 2)(7, 8)(9, 10)(11, 12)(13, 14)(15, 16)
   (9, 10)
   (15, 16)
   (11, 12)(15, 16)
   (13, 14)(15, 16)
> RadicalQuotient(G);
Permutation group acting on a set of cardinality 16
Order = 40320 = 2^7 * 3^2 * 5 * 7
   (1, 7, 11, 3, 5, 13, 15, 9)(2, 8, 12, 4, 6, 14, 16, 10)
   (3, 15, 9, 13, 7, 11)(4, 16, 10, 14, 8, 12)
   (1, 13, 11, 15)(2, 14, 12, 16)(7, 9)(8, 10)
Mapping from: GrpPerm: g to GrpPerm: $, Degree 16
> ElementaryAbelianSeries(G);
[
   Permutation group acting on a set of cardinality 16
   Order = 256 = 2^8
       (3, 4)(5, 6)(7, 8)(13, 14)(15, 16)
       (3, 4)(7, 8)(9, 10)(11, 12)
       (7, 8)(13, 14)
       (1, 2)(7, 8)(9, 10)(11, 12)(13, 14)(15, 16)
       (9, 10)
       (15, 16)
       (11, 12)(15, 16)
       (13, 14)(15, 16),
   Permutation group acting on a set of cardinality 16
   Order = 1
]
```

#### Complements and Supplements

<a id="function-complements-grpperm-grpperm"></a>
##### `Complements(G, M): GrpPerm, GrpPerm -> [ GrpPerm ]`

Given a group $G$ and a normal subgroup $M$, this function returns a sequence containing one representative from each conjugacy class of complements of $M$ in $G$.

<a id="function-complements-grpperm-grpperm-grpperm"></a>
##### `Complements(G, M, N): GrpPerm, GrpPerm, GrpPerm -> [ GrpPerm ]`

Given a group $G$, a normal subgroup $M$ of $G$, and a normal subgroup $N$ of $G$, that is strictly contained in $M$, the function returns a sequence comprising representatives for the conjugacy classes of complements of $M/N$ in $G/N$, as subgroups of $G$.

<a id="function-hascomplement-grpperm-grpperm"></a>
##### `HasComplement(G, M): GrpPerm, GrpPerm -> BoolElt, GrpPerm`

The group $M$ must be a normal subgroup of $G$. Returns whether $M$ has a complement in $G$ and, if so, one such complement.

<a id="function-supplements-grpperm-grpperm"></a>
##### `Supplements(G, M): GrpPerm, GrpPerm -> [ GrpPerm ]`

Given a group $G$ and a soluble normal subgroup $M$ of $G$, the function returns a sequence containing one representative from each conjugacy class of minimal supplements for $M$ in $G$.

<a id="function-supplements-grpperm-grpperm-grpperm"></a>
##### `Supplements(G, M, N): GrpPerm, GrpPerm, GrpPerm -> [ GrpPerm ]`

Given a group $G$, a normal subgroup $M$ of $G$, and a normal subgroup $N$ of $G$ such that (a), $N$ is strictly contained in $M$, and (b), $M/N$ is soluble, the function returns a sequence comprising representatives for the conjugacy classes of minimal supplements of $M/N$ in $G/N$, as subgroups of $G$.

<a id="function-hassupplement-grpperm-grpperm"></a>
##### `HasSupplement(G, M): GrpPerm, GrpPerm -> BoolElt, GrpPerm`

The group $M$ must be a soluble normal subgroup of $G$. Returns whether $M$ has a proper supplement in $G$ and, if so, one such supplement.

<a id="example-ex-f9be31"></a>
##### `Example: Complements of a Normal Subgroup (ex-f9be31)`

We illustrate these functions by considering a normal subgroup $H$ of the group $G$ of degree $16$ generated by the following permutations:

$$
\begin{aligned}&(1, 3, 2, 4)(5, 16, 6, 13)(7, 14, 8, 15)(9, 12, 11, 10),\\
   &(1, 16, 9)(2, 15, 12)(3, 14, 11)(4, 13, 10)(6, 8, 7).\end{aligned}
$$

```magma
> G := PermutationGroup< 16 |
>         (1, 3, 2, 4)(5, 16, 6, 13)(7, 14, 8, 15)(9, 12, 11, 10),
>         (1, 16, 9)(2, 15, 12)(3, 14, 11)(4, 13, 10)(6, 8, 7) >;
Permutation group G acting on a set of cardinality 16
Order = 165888 = 2^11 * 3^4
    (1, 3, 2, 4)(5, 16, 6, 13)(7, 14, 8, 15)(9, 12, 11, 10)
    (1, 16, 9)(2, 15, 12)(3, 14, 11)(4, 13, 10)(6, 8, 7)
> H := ncl< G | (6, 7, 8)(14, 16, 15) >;
> H;
Permutation group H acting on a set of cardinality 16
Order = 6912 = 2^8 * 3^3
   (6, 7, 8)(14, 16, 15)
   (6, 7, 8)(13, 14, 15)
   (6, 7, 8)(9, 12, 11)
   (5, 8, 7)(13, 14, 15)
   (6, 7, 8)(10, 11, 12)
   (1, 2, 3)(6, 7, 8)
   (2, 4, 3)(6, 7, 8)
> C := Complements(G, H);
> C;
[
   Permutation group acting on a set of cardinality 16
   Order = 24 = 2^3 * 3
       (3, 4)(5, 14)(6, 15)(7, 16)(8, 13)(10, 12)
       (2, 4)(6, 7)(9, 14)(10, 15)(11, 13)(12, 16)
       (1, 14)(2, 15)(3, 16)(4, 13)(7, 8)(10, 11)
       (1, 14, 9)(2, 13, 10)(3, 16, 12)(4, 15, 11)(6, 8, 7)
]
```

So the normal subgroup has one conjugacy class of complements. We check that the representative subgroup is indeed a complement for $H$.

```magma
> K := C[1];
> IsTrivial(K meet H );
true
> #K * #H eq #G;
true
```

#### Abelian Normal Subgroups

<a id="function-abeliannormalsubgroup-grpperm"></a>
##### `AbelianNormalSubgroup(G): GrpPerm -> GrpPerm`

An abelian normal subgroup of $G$. If none exists, the trivial subgroup is returned.

<a id="function-abeliannormalquotient-grpperm-grpperm"></a>
##### `AbelianNormalQuotient(G, H): GrpPerm, GrpPerm -> GrpPerm, Hom(GrpPerm), GrpPerm`

A quotient of $G$ by an abelian normal subgroup that contains the abelian normal subgroup $H$. The quotient is represented as a permutation group of the same degree as $G$. The other values returned are the quotient epimorphism and its kernel $K$. The kernel $K$ will be abelian, $K$ will contain $H$, $\#K$ and $\#H$ will have the same prime divisors, and if $H$ is elementary abelian then so is $K$.

<a id="function-solublenormalquotient-grpperm"></a>
##### `SolubleNormalQuotient(G, H): GrpPerm -> GrpPerm, Hom(GrpPerm), GrpPerm`

A quotient of $G$ by a soluble normal subgroup that contains the soluble normal subgroup $H$. The quotient is represented as a permutation group of the same degree as $G$. The other values returned are the quotient epimorphism and its kernel $K$. As with `AbelianNormalQuotient`, $K$ will contain $H$, and $\#K$ and $\#H$ will have the same prime divisors.

<a id="function-elementaryabeliannormalsubgroup-grpperm"></a>
##### `ElementaryAbelianNormalSubgroup(G): GrpPerm -> GrpPerm`

An elementary abelian normal subgroup of $G$. If none exists, the trivial subgroup is returned. The group returned is the last non-trivial group in an elementary abelian series for the radical of $G$.

<a id="function-pelementaryabeliannormalsubgroup-grpperm-rngintelt"></a>
##### `pElementaryAbelianNormalSubgroup(G, p): GrpPerm, RngIntElt -> GrpPerm`

An elementary abelian normal $p$-subgroup of $G$. If none exists, the trivial subgroup is returned. The group returned is the last non-trivial group in an elementary abelian series for the $p$-core of $G$.

<a id="function-means-grpperm"></a>
##### `MEANS(G): GrpPerm -> GrpPerm`

A minimal elementary abelian normal subgroup of $G$.

<a id="function-means-grpperm-grpperm"></a>
##### `MEANS(G, N): GrpPerm, GrpPerm -> GrpPerm`

A minimal elementary abelian normal subgroup of $G$ that lies in the elementary abelian normal subgroup $N$ of $G$.

### Cosets and Transversals

#### Cosets

<a id="operation-op-times-grpperm-grppermelt"></a>
##### `H * g: GrpPerm, GrpPermElt -> Elt`

Right coset of the subgroup $H$ of the group $G$, where $g$ is an element of $G$.

<a id="function-doublecoset-grpperm-grpperm-grppermelt-grpperm"></a>
##### `DoubleCoset(G, H, g, K): GrpPerm, GrpPerm, GrpPermElt, GrpPerm -> GrpPermDcosElt`

The double coset $H*g*K$ of the subgroups $H$ and $K$ of the group $G$, where $g$ is an element of $G$.

<a id="function-doublecosetrepresentatives-grpperm-grpperm-grpperm"></a>
##### `DoubleCosetRepresentatives(G, H, K): GrpPerm, GrpPerm, GrpPerm -> SeqEnum, SeqEnum`

Given a group $G$ and two subgroups $H$ and $K$ of $G$, return a sequence $S$ containing representatives of the $H$-$K$-double cosets in $G$. The first element of $S$ is guaranteed to be the identity element of $G$. The second return sequence gives the sizes of the corresponding double cosets. The algorithm used refines double cosets down a chain of subgroups from $G$ to one of $H$ or $K$.

<a id="function-doublecosetcanonical-grpperm-grpperm-grppermelt-grpperm"></a>
##### `DoubleCosetCanonical(G, H, g, K: parameters): GrpPerm, GrpPerm, GrpPermElt, GrpPerm -> SeqEnum, SeqEnum`

```magma
B: SeqEnum                    Default: 
M: GrpPerm                    Default: H meet K^(g^-1)
```

Returns a canonical base image for the double coset $HgK$ in $G$. The desired base may be supplied as parameter `B`, and `M` may be set as a subgroup of $H\cap K^{g^{-1}}$. If this group is large then the calculation will go more quickly. If these parameters are not supplied then an appropriate value is computed. The return values are the canonical base image, and the base used. The base used for one calculation may be supplied as parameter `B` for another to avoid recalculation and ensure consistency of base image returned.

<a id="function-processladder-grpperm-grpperm-grpperm"></a>
##### `ProcessLadder(L, G, U): [GrpPerm], GrpPerm, GrpPerm -> Rec`

```magma
DoubleCosets: Verbose                    Default: 3
```

Given permutation groups $U<G$ and a sequence of permutation groups $L$ such that $L_1 = G$, compute data for computations with the $L_n$-$U$-double cosets in $G$. The algorithm relies on the indices $(L_i : L_{i+1})$ (for $L_i<L_{i+1}$) or $(L_{i+1}:L_i)$ otherwise to be small. In contrast to the method used by `DoubleCosetRepresentatives`, the sequence used in the computation is a ladder, not necessarily a descending chain. For details see [[Sch90a](https://docs.magma-maths.org/references.md#cite-schmalz-ladder)].

<a id="function-getrep-grppermelt-rec"></a>
##### `GetRep(p, R): GrpPermElt, Rec -> GrpPermElt`

For $R$ being the result of a call to `ProcessLadder` and a permutation $p\in G$, return the canonical double coset representative for $p$.

<a id="procedure-deletedata-rec"></a>
##### `DeleteData(R): Rec`

Deletes the data computed using `ProcessLadder`.

<a id="function-youngsubgroupladder-rngintelt"></a>
##### `YoungSubgroupLadder(L): [RngIntElt] -> [GrpPerm]`

```magma
Full: RngIntElt                    Default: false
```

Computes a ladder from the full symmetric group down to the Young subgroup parametrised by the sequence $L$ suitable for double coset enumeration using `ProcessLadder`. The optional parameter `Full` can be used if the Young subgroup should be considered as a subgroup of the symmetric group on `Full` points rather than on `\&*L`.

<a id="function-stabilizerladder-grpperm-rngmpolelt"></a>
##### `StabilizerLadder(G, d): GrpPerm, RngMPolElt -> [GrpPerm]`

Given a subgroup $G$ of the symmetric group of degree $n$ and a monomial in $n$ indeterminates, compute a ladder down from the full symmetric group to the stabilizer of the monomial, suitable for processing with `ProcessLadder`.

<a id="operation-op-in-grppermelt-elt"></a>
##### `x in C: GrpPermElt, Elt -> BoolElt`

Returns `true` if element $g$ of group $G$ lies in the coset $C$.

<a id="operation-op-notin-grppermelt-elt"></a>
##### `x notin C: GrpPermElt, Elt -> BoolElt`

Returns `true` if element $g$ of group $G$ does not lie in the coset $C$.

<a id="operation-op-eq-elt-elt"></a>
##### `C₁ eq C₂: Elt, Elt -> BoolElt`

Returns `true` if the coset $C_1$ is equal to the coset $C_2$.

<a id="operation-op-ne-elt-elt"></a>
##### `C₁ ne C₂: Elt, Elt -> BoolElt`

Returns `true` if the coset $C_1$ is not equal to the coset $C_2$.

<a id="operation-operation-elt-rngintelt"></a>
##### `# C: Elt -> RngIntElt`

The cardinality of the coset $C$.

<a id="function-cosettable-grp-grp"></a>
##### `CosetTable(G, H): Grp, Grp -> Map`

The (right) coset table for $G$ over subgroup $H$ relative to its defining generators.

<a id="function-cosettable-grp-map"></a>
##### `CosetTable(G, f): Grp, Map -> Map`

The coset table for $G$ corresponding to the permutation representation $f$ of $G$, where $f$ is a homomorphism of $G$ onto a transitive permutation group.

#### Transversals

<a id="function-transversal-grpperm-grpperm"></a>
##### `Transversal(G, H): GrpPerm, GrpPerm -> {@ GrpPermElt @}, Map`

<a id="function-righttransversal-grpperm-grpperm"></a>
##### `RightTransversal(G, H): GrpPerm, GrpPerm -> {@ GrpPermElt @}, Map`

Given a permutation group $G$ and a subgroup $H$ of $G$, this function returns

**(a)**
An indexed set of elements $T$ of $G$ forming a right transversal for $G$ over $H$; and

**(b)**
The corresponding transversal mapping $\phi: G \rightarrow T$. If $T = [t_1, \ldots, t_r]$ and $g \in G$, $\phi$ is defined by $\phi(g) = t_i$, where $g\in H*t_i$.

<a id="function-transversalprocess-grpperm-grpperm"></a>
##### `TransversalProcess(G, H): GrpPerm, GrpPerm -> GrpPermTransProc`

Given a permutation group $G$ and $H$, a subgroup of $G$, create a process to run through a left transversal for $H$ in $G$. The method used is a backtrack search for a canonical coset representative. The intrinsic `TransversalProcess` can be used when the index of $H$ in $G$ is too large to allow a full transversal to be created.

<a id="function-transversalprocessremaining-grppermtransproc"></a>
##### `TransversalProcessRemaining(P): GrpPermTransProc -> RngIntElt`

The number of coset representatives the process has yet to produce. Initially this will be the index of the subgroup in the group.

<a id="function-transversalprocessnext-grppermtransproc"></a>
##### `TransversalProcessNext(P): GrpPermTransProc -> GrpPermElt`

Advance the process to the next coset representative and return that representative. This may only be used when `TransversalProcessRemaining(P)` is positive. The first call to `TransversalProcessNext` will always give the identity element.

<a id="function-shortcosets-grppermelt-grpperm-grpperm"></a>
##### `ShortCosets(p, H, G): GrpPermElt, GrpPerm, GrpPerm -> [GrpPermElt]`

Computes a set of representatives for the transversal of $G$ modulo $H$ of all cosets that contain $p$. This computation does not do a full transversal of $G$ modulo $H$ and may therefore be used even if the index of $(G:H)$ is very large.

### Presentations

In this section we describe how to compute a presentation in terms of generators and relations for a permutation group and also how to obtain a representation of a permutation as word in the defining generators.

#### Generators and Relations

<a id="function-fpgroup-grpperm"></a>
##### `FPGroup(G): GrpPerm -> GrpFP, Hom(Grp)`

Construct a presentation for the permutation group $G$ on the set of defining generators and return the presentation in the form of a finitely presented group $F$ that is isomorphic to $G$. The presentation is obtained by first computing the regular representation of $G$ and then using the Todd-Coxeter Schreier algorithm to construct a presentation on the strong generators. In this situation the strong generators are identical to the defining generators.

A group homomorphism $\phi: F \rightarrow G$, defining $G$ as a permutation representation of $F$, is also returned.

<a id="function-fpgroup-grpperm-grpperm"></a>
##### `FPGroup(G, N): GrpPerm, GrpPerm -> GrpFP, Hom(Grp)`

<a id="function-fpquotient-grpperm-grpperm"></a>
##### `FPQuotient(G, N): GrpPerm, GrpPerm -> GrpFP, Hom(Grp)`

Given a normal subgroup $N$ of $G$, compute an fp-group representation $F$ of the quotient $G/N$ and the homomorphism $\phi: G\rightarrow F$.

<a id="function-fpgroupstrong-grpperm"></a>
##### `FPGroupStrong(G: parameters): GrpPerm -> GrpFP, Hom(Grp)`

```magma
Random: BoolElt                      Default: true
Run   : RngIntElt                    Default: 20
```

Construct a presentation for the permutation group $G$ on a set of strong generators and return the presentation in the form of a finitely presented group $F$ that is isomorphic to $G$. In Magma, a combination of the Schreier Todd-Coxeter Sims algorithm and the Brownie-Cannon-Sims verification procedure is used to construct the presentation. See Leon [[Leo80](https://docs.magma-maths.org/references.md#cite-leon3)] and Gebhardt [[Geb00](https://docs.magma-maths.org/references.md#cite-gebhardt-presentations)] for more details of the individual algorithms.

If strong generators are not already known for $G$, they will be constructed. If strong generators have to be constructed, the parameters `Random` and `Run` may be used to control the application of the random schreier algorithm to construct a probable BSGS before commencing the construction of the presentation. If `Random` is set to false then no randomising is performed, and the algorithm becomes the straight STCS algorithm. In the case in which strong generators are already known for $G$, the presentation will be on these strong generators.

The presentation will have the property that it includes a presentation for each group in the stabilizer chain of the BSGS.

The group isomorphism $\phi: F \rightarrow G$, defining $G$ as a permutation representation of $F$, is also returned.

#### Permutations as Words

Consider a permutation group $G$ defined on $d$ generators. The *word group* of $G$ is a free group $W$ of rank $d$. Then we regard $G$ as a homomorphic image of $F$ with associated homomorphism $\phi: W \rightarrow G$. All operations involving words in the generators of $G$ will be performed in $W$.

<a id="function-wordgroup-grpperm"></a>
##### `WordGroup(G): GrpPerm -> GrpBB, Map`

Given a permutation group $G$ defined on $d$ generators, return (a) a free group $W$ on $d$ generators represented as a group whose elements are defined by straight-line programs (SLP group), and (b) the homomorphism $\phi$ from $W$ to $G$ such that $W.i \rightarrow G.i$, for $i = 1, \ldots, d$. The group $W$ associated with $G$ by this function will be referred to as the *word group* for $G$.

<a id="function-inversewordmap-grpperm"></a>
##### `InverseWordMap(G): GrpPerm -> Map`

Given a permutation group $G$ and its associated word group $W$ with canonical homomorphism $\phi:W \rightarrow G$, construct the inverse mapping $\rho$. Thus, given a permutation $g$ of $G$, $g@\rho$ returns an element in the preimage of $g$ under $\phi$. If the word group $W$ does not already exist, it will be created.

<a id="function-actingword-grpperm-elt-elt"></a>
##### `ActingWord(G, x, y): GrpPerm, Elt, Elt -> GrpFPElt`

Given points $x$ and $y$ belonging to the same $G$-orbit of the natural $G$-set $X$, return a word $w$ in the word group $W$ of $G$ such that $x^{\phi(w)} = y$. Here $\phi$ is the canonical homomorphism from $W$ to $G$.

<a id="function-wordingenerators-grpperm-grppermelt"></a>
##### `WordInGenerators(G, g : parameters): GrpPerm, GrpPermElt -> GrpFPElt`

```magma
RegLimit: RngIntElt                    Default: 1000000
Print   : RngIntElt                    Default: 0
```

Compute a word in a free group with generators corresponding to those of the group $G$ that evaluates to the element $g \in G$.

If $G$ has order at most `RegLimit` then the word will be computed using the regular permutation representation of $G$, and will be guaranteed to be a shortest word representing $g$. Otherwise an algorithm of Minkwitz [[Min98](https://docs.magma-maths.org/references.md#cite-minkwitz)] is used, which will find a reasonably short word for $g$ but not necessarily a shortest word. The optional parameter `Print` controls the printing of diagnostics.

The first call of this function for an element $g$ of the group $G$ will take longer than subsequent calls for elements of the same group, because some necessary data is calculated with the first call.

<a id="automorphisms"></a>
<a id="permg-auto"></a>
### Automorphism Groups

The automorphism group of a permutation group may be computed in Magma, subject to the same restrictions on the group as when computing maximal subgroups. (That is, the non-abelian composition factors of the group must appear in a certain database.) The methods used are those described in Cannon and Holt [[CH03](https://docs.magma-maths.org/references.md#cite-autos-permg)]. Isomorphism of permutation groups may also be determined using the same methods.

<a id="function-automorphismgroup-grpperm"></a>
#### `AutomorphismGroup(G: parameters): GrpPerm -> GrpAuto`

Compute the full automorphism group of the permutation group $G$.

<a id="function-isisomorphic-grpperm-grpperm"></a>
#### `IsIsomorphic(G, H: parameters): GrpPerm, GrpPerm -> BoolElt, Hom(Grp)`

Test whether or not the two permutation groups $G$ and $H$ are isomorphic as abstract groups. If so, both the result `true` and an isomorphism from $G$ to $H$ is returned. If not, the result `false` is returned.

<a id="example-ex-c36bda"></a>
#### `Example: Isomorphism Testing for Groups of Order 120 (ex-c36bda)`

We take some groups of order 120 and test for isomorphism.

```magma
> G1 := PermutationGroup<20 |
>  [ 2, 5, 9, 11, 12, 3, 17, 13, 18, 16, 7, 15, 10, 8, 1,
>   14, 20, 19, 6, 4 ],
>  [ 3, 6, 1, 10, 14, 2, 18, 17, 15, 4, 16, 13, 12, 5, 9,
>   11, 8, 7, 20, 19 ] >;
> #G1;
120
> G2 := PermutationGroup<24 |
>   [ 2, 4, 6, 5, 1, 7, 8, 3, 13, 15, 14, 16, 11, 9, 12, 10,
>   19, 20, 18, 17, 24, 21, 22, 23 ],
>   [ 3, 1, 2, 7, 4, 9, 5, 11, 10, 6, 12, 8, 16, 15, 18, 17,
>   13, 14, 21, 23, 22, 19, 24, 20 ],
>   [ 4, 5, 7, 1, 2, 8, 3, 6, 11, 12, 9, 10, 14, 13, 16, 15,
>   18, 17, 20, 19, 23, 24, 21, 22 ] >;
> #G2;
120
> IsIsomorphic(G1, G2);
false
> flag, isom := IsIsomorphic(G1, Sym(5));
> flag;
true
> (G1.1)@ isom;
(1, 3, 5, 4, 2)
```

The reader is invited to check that `G2` is perfect while `G1` is not, so the `false` result for their isomorphism is correct. What is the automorphism group of `G2`?

```magma
> A := AutomorphismGroup(G2);
> #A;
120
> #Centre(G2);
2
> OuterFPGroup(A);
Finitely presented group on 1 generator
Relations
  $.1^2 = Id($)
> A.1;
Automorphism of GrpPerm: G2, Degree 24, Order 2^3 * 3 * 5
which maps:
  (1, 2, 4, 5)(3, 6, 7, 8)(9, 13, 11, 14)(10, 15, 12,
    16)(17, 19, 18, 20)(21, 24, 23, 22) |--> (1, 16, 4,
    15)(2, 21, 5, 23)(3, 20, 7, 19)(6, 11, 8, 9)(10, 24, 12,
    22)(13, 17, 14, 18)
  (1, 3, 2)(4, 7, 5)(6, 9, 10)(8, 11, 12)(13, 16, 17)(14,
    15, 18)(19, 21, 22)(20, 23, 24) |--> (1, 11, 16)(2, 18,
    19)(3, 23, 6)(4, 9, 15)(5, 17, 20)(7, 21, 8)(10, 22,
    13)(12, 24, 14)
  (1, 4)(2, 5)(3, 7)(6, 8)(9, 11)(10, 12)(13, 14)(15,
    16)(17, 18)(19, 20)(21, 23)(22, 24) |--> (1, 4)(2, 5)(3,
    7)(6, 8)(9, 11)(10, 12)(13, 14)(15, 16)(17, 18)(19,
    20)(21, 23)(22, 24)
> IsInnerAutomorphism(A.4);
false
```

So the outer automorphism group of `G2` has order 2, and `A.4` gives this automorphism.

### Cohomology

In the following description, $G$ is a finite permutation group, $p$ is a prime number, and $K$ is the finite field of order $p$. Further, $F$ is a finitely presented group having the same number of generators as $G$, and is such that its relations are satisfied by the corresponding generators of $G$. In other words, the mapping taking the $i$-th generator of $F$ to the $i$-th generator of $G$ must be an epimorphism. Usually this mapping will be an isomorphism, although this is not mandatory. The algorithms used are those of Holt, see [[Hol84](https://docs.magma-maths.org/references.md#cite-holt-multiplier)], [[Hol85a](https://docs.magma-maths.org/references.md#cite-holt-cover)], and [[Hol85b](https://docs.magma-maths.org/references.md#cite-holt-cohom)].

<a id="function-pmultiplicator-grpperm-rngintelt"></a>
#### `pMultiplicator(G, p): GrpPerm, RngIntElt -> [ RngIntElt ]`

Given the group $G$ and a prime $p$, return the invariant factors of the $p$-part of the Schur multiplicator of $G$.

<a id="function-pcover-grpperm-grpfp-rngintelt"></a>
#### `pCover(G, F, p): GrpPerm, GrpFP, RngIntElt -> GrpFP`

Given the group $G$ and the finitely presented group $F$ such that $G$ is an epimorphic image of $G$ in the sense described above, return a presentation for the $p$-cover of $G$, constructed as an extension of the $p$-multiplier by $F$.

<a id="function-cohomologicaldimension-grpperm-modrng-rngintelt"></a>
#### `CohomologicalDimension(G, M, i): GrpPerm, ModRng, RngIntElt -> RngIntElt`

Given the group $G$, the $K[G]$-module $M$, and an integer $i$ (equal to 1 or 2), return the dimension of the $i$-th cohomology group of $G$ acting on $M$.

<a id="function-extensionprocess-grpperm-modrng-grpfp"></a>
#### `ExtensionProcess(G, M, F): GrpPerm, ModRng, GrpFP -> Process`

Create an extension process for the group $G$ by the module $M$.

<a id="function-extension-process"></a>
#### `Extension(P, Q): Process -> GrpFP`

<a id="function-nextextension-process"></a>
#### `NextExtension(P): Process -> GrpFP`

Return the next extension of $G$ as defined by the process $P$.

Assume that $F$ is isomorphic to the permutation group $G$, and that we wish to determine presentations for one or more extensions of the $K$-module $M$ by $F$, where $K$ is the field of $p$ elements. We first create an extension process using `ExtensionProcess(G, M, F)`. The possible extensions of $M$ by $G$ are in one-one correspondence with the elements of the second cohomology group $H^2(G,M)$ of $G$ acting on $M$. Let $b_1, \ldots, b_l$ be a basis of $H^2(G,M)$. A general element of $H^2(G,M)$ therefore has the form $a_1b_1 + \cdots + a_lb_l$ and so can be defined by a sequence $Q$ of $l$ integers $[a_1, \ldots, a_l]$. Now, to construct the corresponding extension of $M$ by $G$ we call the function `Extension(P, Q)`. The required extension is returned as a finitely presented group. If all the extensions are required then they may be obtained successively by making $p^l$ calls to the function `NextExtension`.

<a id="function-splitextension-grpperm-modrng-grpfp"></a>
#### `SplitExtension(G, M, F): GrpPerm, ModRng, GrpFP -> GrpFP`

The split extension of the module $M$ by the group $G$.

<a id="example-ex-5181ae"></a>
#### `Example: Schur Cover Presentation of A6 (ex-5181ae)`

We construct a presentation for $A_6$ over its Schur multiplicator. First we find the size of the multiplicator by applying the `pMultiplicator` function to each relevant prime.

```magma
> G := Alt(6);
> &cat [pMultiplicator(G, p[1]): p in FactoredOrder(G)];
[ 2, 3, 1 ]
```

The multiplicator has order $2\times 3 = 6$. We next construct the two-fold cover of $A_6$. We use the `FPGroup` function to get a presentation for $A_6$.

```magma
> F := FPGroup(G);
> F2 := pCover(G, F, 2);
```

Now we construct a three-fold cover of the two-fold cover to get the extension we are after. First we need a permutation representation of `F2`, the two-fold covering group.

```magma
> G2 := DegreeReduction(CosetImage(F2, sub<F2|>));
> Degree(G2);
144
> #G2;
720
> F6 := pCover(G2, F2, 3);
> F6;
Finitely presented group F6 on 4 generators
Relations
  F6.4^3 = Id(F6)
  (F6.1, F6.4) = Id(F6)
  (F6.2, F6.4) = Id(F6)
  (F6.3, F6.4) = Id(F6)
  F6.3^2 = Id(F6)
  (F6.1, F6.3) = Id(F6)
  (F6.2, F6.3) = Id(F6)
  F6.1^4 * F6.3 = Id(F6)
  F6.2^3 * F6.3 = Id(F6)
  F6.1^-1 * F6.2^-1 * F6.1 * F6.2 * F6.1^-1 * F6.2^-1 *
  F6.1 * F6.2 * F6.3 * F6.4 = Id(F6)
  F6.1^-1 * F6.2 * F6.1^2 * F6.2 * F6.1^2 * F6.2 *
  F6.1^-2 * F6.2 * F6.1^-1 * F6.3 * F6.4^-1 = Id(F6)
  F6.2 * F6.1 * F6.2 * F6.1 * F6.2 * F6.1 * F6.2 *
  F6.1 * F6.2 * F6.1 * F6.3 * F6.4 = Id(F6)
> AbelianQuotientInvariants(F6);
[]
```

The group `F6` is the six-fold cover of $A_6$. We easily see from the presentation that the 3rd and 4th generators generate a central cyclic subgroup of order 6. The sequence of invariants for the maximal abelian quotient of `F6` is empty, so `F6` is perfect.

<a id="example-ex-d836b8"></a>
#### `Example: Extension of A5 by a Permutation Module (ex-d836b8)`

We construct an extension of $A_5$. This time the normal subgroup will be elementary abelian of order $2^5$, with the action of $A_5$ being the natural permutation action.

```magma
> G := Alt(5);
> M := PermutationModule(G, GF(2));
> CohomologicalDimension(G, M, 2);
1
```

The dimension of the 2nd cohomology group is 1 over ${\bf F}_{2}$, so there are two possible extensions. We will construct them both.

```magma
> F := FPGroup(G);
> P := ExtensionProcess(G, M, F);
> E0 := Extension(P, [0]);
> E1 := Extension(P, [1]);
> AbelianQuotientInvariants(E0);
[ 2 ]
> AbelianQuotientInvariants(E1);
[]
```

The split extension, `E0`, is not perfect, but the non-split extension, `E1`, is a perfect group.

### Representation Theory

A set of functions are provided for computing with the characters of a group. Full details of these functions may be found in Chapter [Characters of Finite Groups](https://docs.magma-maths.org/RepresentationTheory/CharactersOfFiniteGroups/index-characters-of-finite-groups.md#chapchtr). For convenience we include here two of the more useful character functions. Also, functions are provided for computing with the modular representations of a group. Full details of these functions may be found in Chapter [Modules over an Algebra and Group Representations](https://docs.magma-maths.org/RepresentationTheory/ModulesOverAnAlgebraAndGroupRepresentations/index-modules-over-an-algebra-and-group-representations.md#chapmodalg). For the reader’s convenience we include here the functions which may be used to define a $R[G]$-module for a permutation group.

<a id="function-charactertable-grpperm"></a>
#### `CharacterTable(G: parameters): GrpPerm -> TabChtr`

```magma
Al         : MonStgElt                    Default: "Default"
DSSizeLimit: RngIntElt                    Default: 0
```

Construct the table of ordinary irreducible characters for the group $G$.

This parameter controls the algorithm used. The string `"DS"` forces use of the Dixon-Schneider algorithm. The string `"IR"` forces the use of Unger’s induction/reduction algorithm [[Ung06a](https://docs.magma-maths.org/references.md#cite-chtr-table-unger)]. The `"Default"` algorithm is to use Dixon-Schneider for groups of order $\le 5000$ and Unger’s algorithm for larger groups. This may change in future.

When the default algorithm is selected, a positive value $n$ for `DSSizeLimit` means that before using Unger’s algorithm, the full character space is split by some passes of Dixon-Schneider, restricted to using class matrices corresponding to conjugacy classes with size at most $n$.

<a id="function-permutationcharacter-grpperm"></a>
#### `PermutationCharacter(G): GrpPerm -> AlgChtrElt`

Given a group $G$ represented as a permutation group, construct the character of $G$ afforded by the defining permutation representation of $G$.

<a id="function-permutationcharacter-grpperm-grpperm"></a>
#### `PermutationCharacter(G, H): GrpPerm, GrpPerm -> AlgChtrElt`

Given a group $G$ and some subgroup $H$ of $G$, construct the ordinary character of $G$ afforded by the permutation representation of $G$ given by the action of $G$ on the coset space of the subgroup $H$ in $G$.

<a id="function-gmodule-grp-algmat"></a>
#### `GModule(G, S): Grp, AlgMat -> ModGrp`

Let $G$ be a group defined on $r$ generators and let $S$ be a subalgebra of the matrix algebra $M_n(R)$, also defined by $r$ non-singular matrices. It is assumed that the mapping from $G$ to $S$ defined by $\phi(G.i) \rightarrow S.i$, for $i = 1, \ldots, r$, is a group homomorphism. Let $M$ be the natural module for the matrix algebra $S$. The function `GModule` gives $M$ the structure of an $S[G]$-module, where the action of the $i$-th generator of $G$ on $M$ is given by the $i$-th generator of $S$.

<a id="function-gmodule-grp-grp-grp"></a>
#### `GModule(G, A, B): Grp, Grp, Grp -> ModGrp, Map`

Given a finite group $G$, a normal subgroup $A$ of G, and a normal subgroup $B$ of $A$ such that the section $A/B$ is elementary abelian of order $p^n,$ create the $K[G]$-module $M$ corresponding to the action of $G$ on $A/B$, where $K$ is the field ${\bf F}_{p}$. If $B$ is trivial, it may be omitted. The function returns

**(a)**
the module $M$; and

**(b)**
the homomorphism $\phi : A/B \rightarrow M$.

<a id="function-permutationmodule-grp-grp-rng"></a>
#### `PermutationModule(G, H, R): Grp, Grp, Rng -> ModGrp`

Given a finite group $G$ and a ring $R$, create the $R[G]$-module for $G$ corresponding to the permutation action of $G$ on the cosets of $H$.

<a id="function-permutationmodule-grpperm-rng"></a>
#### `PermutationModule(G, R): GrpPerm, Rng -> ModGrp`

Given a finite permutation group $G$ and a ring $R$, create the natural permutation module for $G$ over $R$.

<a id="example-ex-7c0920"></a>
#### `Example: Refining an Elementary Abelian Subgroup (ex-7c0920)`

We refine an elementary abelian normal subgroup of a permutation group to a sequence of normal subgroups.

```magma
> G := PermutationGroup<24 |
>  [ 3, 4, 1, 2,23,24, 7, 8, 9,10,12,11,14,13,16,15,18,17,22,21,
>    20,19, 5, 6 ],
>  [ 7, 8,11,12,13,14,22,21,20,19,15,16,17,18, 6, 5, 4, 3, 1, 2,23,
>    24, 9,10 ] >;
> N := sub<G |
>  [ 24, 23, 6, 5, 4, 3, 10, 9, 8, 7, 14, 13, 12, 11, 18, 17, 16, 15, 22, 21,
>    20, 19, 2, 1 ],
>  [ 23, 24, 5, 6, 3, 4, 8, 7, 10, 9, 12, 11, 14, 13, 15, 16, 17, 18, 19, 20,
>    21, 22, 1, 2 ],
>  [ 2, 1, 4, 3, 6, 5, 7, 8, 9, 10, 11, 12, 13, 14, 17, 18, 15, 16, 21, 22, 19,
>    20, 24, 23 ]>;
> #N;
8
> IsNormal(G, N);
true
> IsElementaryAbelian(N);
true
> M, f := GModule(G, N);
> SM := Submodules(M);
> #SM;
4
> refined := [ x @@ f : x in SM ];
> forall{x : x in refined | IsNormal(G, x) };
true;
> [ #x : x in refined];
[ 1, 2, 4, 8 ]
```

The original elementary abelian normal subgroup of order 8 is the top of a chain of normal subgroups of length 3.

### Identification

#### Identification as an Abstract Group

<a id="function-namesimple-grpperm"></a>
##### `NameSimple(G): GrpPerm -> <RngIntElt, RngIntElt, RngIntElt>`

Given a simple group $G$, determine the isomorphism type of $G$. The type is returned in the form of a triple of three integers $f, d$ and $q$, where the interpretation of these integers is that given in the description of the function `CompositionFactors`.

#### Identification as a Permutation Group

The first functions described in this subsection detect whether or not a permutation group is alternating or symmetric in its natural representation. They are based on the algorithm ‘Detect Alternating’ outlined in [[CB92](https://docs.magma-maths.org/references.md#cite-struct-gps)].

<a id="function-isalternating-grpperm"></a>
##### `IsAlternating(G): GrpPerm -> BoolElt`

Returns `true` if the permutation group $G$ defined as acting on $X$ is the alternating group ${\operatorname{Alt}}(X)$.

<a id="function-issymmetric-grpperm"></a>
##### `IsSymmetric(G): GrpPerm -> BoolElt`

Returns `true` if the permutation group $G$ defined as acting on $X$ is the symmetric group ${\operatorname{Sym}}(X)$.

<a id="function-isaltsym-grpperm"></a>
##### `IsAltsym(G : parameters): GrpPerm -> BoolElt`

```magma
Limit: RngIntElt                    Default: 0
Proof: BoolElt                      Default: true
```

Returns `true` if the permutation group $G$ defined as acting on $X$ contains the alternating group ${\operatorname{Alt}}(X)$.

The `Limit` argument controls the number of random elements of the group inspected in an attempt to show that the group does contain ${\operatorname{Alt}}(X)$ cheaply. The 0 value indicates the default strategy.

The `Proof` argument set to false will restrict the algorithm to its probabilistic part. This will mean that there is a chance that a return value of false is incorrect. Return value of true is always correct.

<a id="function-twotransitivegroupidentification-grpperm"></a>
##### `TwoTransitiveGroupIdentification(G): GrpPerm -> Tup`

Given a $2$-transitive group $G$, return a tuple giving the abstract isomorphism type of the group. This is an implementation of the method of Cameron and Cannon [[CC91](https://docs.magma-maths.org/references.md#cite-two-trans)].

<a id="function-iseven-grpperm"></a>
##### `IsEven(G): GrpPerm -> BoolElt`

Given a permutation group $G$ check if $G$ is even, ie. contained in the alternating group.

<a id="function-recognisealternatingorsymmetric-grp-rngintelt"></a>
##### `RecogniseAlternatingOrSymmetric(G : parameters): Grp, RngIntElt -> BoolElt, Map, Map, Map, Map, BoolElt`

```magma
N         : RngIntElt                    Default: 0
Extension : BoolElt                      Default: false
Epsilon   : FldRElt                      Default: 0.01
Asymptotic: BoolElt                      Default: false
```

The input group $G$ is isomorphic to $H$, the alternating or symmetric group for some $n \geq 5$. Note that $G$ can be either a matrix or permutation representation of $H$.

The algorithm used is that of [[JLNP13](https://docs.magma-maths.org/references.md#cite-altsymrecogn)]. Since this is Las Vegas, there is a small probability controlled by the optional parameter `Epsilon` that it returns `false` incorrectly.

If the algorithm succeeds, then it returns `true`, an isomorphism from $G$ to $H$, an isomorphism from $H$ to $G$, the map from $G$ to its word group, and the map from the word group to $G$. The sixth value returned is `true` if $H$ is the symmetric group, otherwise `false`.

The optional parameter `N` is an upper bound for the degree of $H$. If `N` is 0, then the maximal theoretically possible bound for the degree is assumed; this is the degree of $G$ if $G$ is a permutation group, and $\max(9, d + 2)$ or $\max(9, d+1)$ if $G$ is a matrix group of degree $d$, depending on the characteristic of the field. If the optional parameter `Extension` is `true`, then $G$ is isomorphic to a central extension of $H$ for some $n \geq 5$. Now the first two maps returned are an epimorphism from $G$ onto $H$ with kernel $Z(G)$ and a map from $H$ to $G$ that induces an isomorphism from $H$ onto $G/Z(G)$.

If the optional parameter `Asymptotic` is `true`, then the map from $H$ to $G$ implements the asymptotically efficient algorithm of Beals et al. [[BLGN+03b](https://docs.magma-maths.org/references.md#cite-altsymrecog1)]. Otherwise, the algorithm employed for this map is that of [[BP00](https://docs.magma-maths.org/references.md#cite-bratus-pak)], which is usually faster for moderate degrees.

If the algorithm is not successful, then `false` is returned.

The algorithm consists of two parts. The first part finds the degree of the alternating group and constructs standard generators, cf. [[JLNP13](https://docs.magma-maths.org/references.md#cite-altsymrecogn)]. The second part verifies that these elements generate $G$, and constructs isomorphisms between $G$ and $H$, cf. [[BLGN+03b](https://docs.magma-maths.org/references.md#cite-altsymrecog1)]. The implementation of the first part was developed by Sebastian Jambor. The implementation of the second part was developed by Jonathan Conder; he also extended the algorithm to work for both $n \in \{5,\ldots,10\}$ and central extensions.

<a id="function-alternatingorsymmetricelementtoword-grp-grpelt"></a>
##### `AlternatingOrSymmetricElementToWord(G, g): Grp, GrpElt -> BoolElt, GrpSLPElt`

If $g \in G$ and $G$ has been recognised by `RecogniseAlternatingOrSymmetric`, this function returns `true` and an element of the word group for $G$ which evaluates to $g$. Otherwise, it returns `false`. This facilitates membership testing in $G$.

The implementation was developed by Jonathan Conder.

<a id="example-ex-29961f"></a>
##### `Example: Recognising A13 in a Coset Action (ex-29961f)`

We illustrate the use of these functions for a representation of $A_{13}$.

```magma
> A:= AlternatingGroup (13);
> H:= Stabiliser(A, {1,2});
> G := CosetImage (A, H);
> Degree (G);
78
> success, bb_to_perm, perm_to_bb, bb_to_wg, wg_to_bb, is_sym :=
> RecogniseAlternatingOrSymmetric (G);
>
> success;
true
> is_sym;
false
>
>  x:= Sym(78)!(1, 35, 16, 28, 14, 26, 69, 5, 74)(2, 54,
>  67, 18, 51, 63, 6, 50, 77)(3, 33, 78, 12, 34, 29, 19, 15, 73)
>  (4, 52, 61, 24, 49, 60, 68, 38, 64)(7, 20, 71, 17,
>  32, 11, 72, 8, 36)(9, 76, 47, 31, 56, 62, 13, 53, 59)
>  (10, 70, 57, 23, 37, 22, 21, 27, 25)(30, 45, 46, 43, 42,
>  44, 40, 41, 75)(39, 55, 65)(48, 66, 58);
>
> flag, w := AlternatingOrSymmetricElementToWord (G, x);
> "Is x in G?", flag;
Is x in G? true
> Evaluate (w, [G.i: i in [1..Ngens (G)]]) eq x;
true
>
> perm_image:= bb_to_perm(x);
> perm_image;
(1, 4, 9)(2, 6, 3, 5, 10, 7, 8, 11, 12)
>
> y := Random (G);
> w := bb_to_wg (y);
> Evaluate (w, [G.i: i in [1..Ngens (G)]]) eq y;
true
```

<a id="function-recognisesymmetric-grp-rngintelt"></a>
##### `RecogniseSymmetric(G, n: parameters): Grp, RngIntElt -> BoolElt, Map, Map, Map, Map, BoolElt`

```magma
maxtries : RngIntElt                    Default: 100n + 5000
Extension: BoolElt                      Default: false
```

The group $G$ should be known to be isomorphic to the symmetric group $S_n$ for some $n \ge 8$. The Bratus-Pak algorithm [[BP00](https://docs.magma-maths.org/references.md#cite-bratus-pak)] (implemented by Derek Holt) is used to define an isomorphism between $G$ and $S_n$. If successful, return `true`, homomorphism from $G$ to $S_n$, homomorphism from $S_n$ to $G$, the map from $G$ to its word group and the map from the word group to $G$.

If the optional parameter `Extension` is set, then the group $G$ should be known to be isomorphic either to $S_n$ or to a perfect central extension $2.S_n$. In that case, the first two maps returned will be a homomorphism from $G$ to $S_n$ and a map from $S_n$ to $G$ that induces a homomorphism onto $G/Z(G)$. The sixth value returned will be `true`, if $G \cong 2.S_n$ and `false`, if $G \cong 2.A_n$.

If unsuccessful, `false` is returned. This will always occur if the input group is not isomorphic to $S_n$ (or $2.S_n$ when `Extension` is set) with $n \ge 8$, and may occur occasionally even when $G$ is isomorphic to $S_n$. The optional parameter `maxtries` (default $100n + 5000$) can be used to control the number of random elements chosen before giving up.

<a id="function-symmetricelementtoword-grp-grpelt"></a>
##### `SymmetricElementToWord(G, g): Grp, GrpElt -> BoolElt, GrpSLPElt`

If $g$ is an element of $G$ which has been constructively recognised to be isomorphic to $S_n$ (or $2.S_n$), then return `true` and element of word group for $G$ which evaluates to $g$. Otherwise return `false`. This facilitates membership testing in $G$.

<a id="function-recognisealternating-grp-rngintelt"></a>
##### `RecogniseAlternating(G, n: parameters): Grp, RngIntElt -> BoolElt, Map, Map, Map, Map, BoolElt`

```magma
maxtries : RngIntElt                    Default: 100n + 5000
Extension: BoolElt                      Default: false
```

The group $G$ should be known to be isomorphic to the alternating group $A_n$ for some $n \ge 9$. The Bratus-Pak algorithm [[BP00](https://docs.magma-maths.org/references.md#cite-bratus-pak)] (implemented by Derek Holt) is used to define an isomorphism between $G$ and $A_n$. If successful, return `true`, homomorphism from $G$ to $A_n$, homomorphism from $A_n$ to $G$, the map from $G$ to its word group and the map from the word group to $G$.

If the optional parameter `Extension` is set, then the group $G$ should be known to be isomorphic either to $A_n$ or to a perfect central extension $2.A_n$. In that case, the first two maps returned will be a homomorphism from $G$ to $A_n$ and a map from $A_n$ to $G$ that induces a homomorphism onto $G/Z(G)$. The sixth value returned will be `true`, if $G \cong 2.A_n$ and `false` otherwise.

If unsuccessful, `false` is returned. This will always occur if the input group is not isomorphic to $A_n$ (or $2.A_n$ when `Extension` is set) with $n \ge 9$, and may occur occasionally even when $G$ is isomorphic to $A_n$. The optional parameter `maxtries` (default $100n + 5000$) can be used to control the number of random elements chosen before giving up.

<a id="function-alternatingelementtoword-grp-grpelt"></a>
##### `AlternatingElementToWord(G, g): Grp, GrpElt -> BoolElt, GrpSLPElt`

If $g$ is an element of $G$ which has been constructively recognised to be isomorphic to $A_n$ (or $2.A_n$), then return `true` and element of word group for $G$ which evaluates to $g$. Otherwise return `false`. This facilitates membership testing in $G$.

<a id="function-guessaltsymdegree-grp"></a>
##### `GuessAltsymDegree(G: parameters): Grp -> BoolElt, MonStgElt, RngIntElt`

```magma
maxtries : RngIntElt                    Default: 5000
Extension: BoolElt                      Default: false
```

The group $G$ should be believed to be isomorphic to $S_n$ or $A_n$ for some $n > 6$, or to $2.S_n$ or $2.A_n$ if the optional parameter `Extension` is set. This function attempts to determine $n$ and whether $G$ is symmetric or alternating. It does this by sampling orders of elements. It returns either `false`, if it is unable to make a decision after sampling `maxtries` elements (default $5000$), or `true`, `type`, and $n$, where `type` is “Symmetric” or “Alternating”, and $n$ is the degree. If $G$ is not isomorphic to $S_n$ or $A_n$ (or $2.S_n$ or $2.A_n$ when `Extension` is set) for $n > 6$, then the output is meaningless - there is no guarantee that `false` will be returned. There is also a small probability of a wrong result or `false` being returned even when $G$ is $S_n$ or $A_n$ with $n > 6$. This function was written by Derek Holt.

<a id="example-ex-51196d"></a>
##### `Example: Guessing an Alternating or Symmetric Degree (ex-51196d)`

For a group $G$ which is believed to be isomorphic to $S_n$ or $A_n$ for some unknown value of $n > 6$, the function `GuessAltsymDegree` can be used to try to guess $n$, and then `RecogniseSymmetric` or `RecogniseAlternating` can be used to confirm the guess.

```magma
> SetSeed(1);
> G:= sub< GL(10,5) |
> PermutationMatrix(GF(5),Sym(10)![2,3,4,5,6,7,8,9,1,10]),
> PermutationMatrix(GF(5),Sym(10)![1,3,4,5,6,7,8,9,10,2]) >;
> GuessAltsymDegree(G);
true Alternating 10
> flag, m1, m2, m3, m4  := RecogniseAlternating(G,10);
> flag;
true
> x:=Random(G); Order(x);
8
> m1(x);
(1, 2, 4, 9, 10, 8, 6, 3)(5, 7)
> m2(m1(x)) eq x;
true
> m4(m3(x)) eq x;
true
> flag, w := AlternatingElementToWord(G,x);
> flag;
true
> m4(w) eq x;
true
> y := Random(Generic(G));
> flag, w := AlternatingElementToWord(G,y);
> flag;
false
> flag, m1, m2, m3, m4 := RecogniseAlternating(G,11);
> flag;
false
> flag, m1, m2, m3, m4 := RecogniseSymmetric(G,10);
> flag;
false
```

The nature of the `GuessAltsymDegree` function is that it assumes that its input is either an alternating or symmetric group and then tries to guess which one and the degree. As such, it is almost always correct when the input is an alternating or symmetric group, but will often return a bad guess when the input group is not of this form, as in the following example.

```magma
> GuessAltsymDegree(Sym(50));
true Symmetric 50
> GuessAltsymDegree(Alt(73));
true Alternating 73
> GuessAltsymDegree(PSL(5,5));
true Alternating 82
```

### Base and Strong Generating Set

The key concept for representing a permutation group is that of a *base and strong generating set* (BSGS). Given a BSGS for a group, its order may be deduced immediately. Brownie, Cannon, and Sims (1991) showed that it is practical, in some cases at least, to construct a BSGS for short-base groups having degree up to ten million.

The great majority of functions for computing with permutation groups require a BSGS to be present. If one is not known, Magma will attempt to automatically compute one. For large degree groups, the computation of a BSGS may be expensive and in such cases the user may achieve better performance through directly invoking a function which creates a BSGS. For example, if the group order is known in advance, it may be supplied to Magma and then a random method for computing a BSGS is applied which will use the group order as a termination condition.

In the first part of this section we present the elementary functions that use a BSGS, while towards the end we describe firstly, functions which allow the user to select and control the algorithm employed, and secondly, functions which provide access to the BSGS data structures. The material specific to BSGS should be omitted on a first reading.

#### Construction of a Base and Strong Generating Set

Computing structural information for a permutation group $G$ requires, in most cases, a representation of the set of elements of $G$. Magma represents this set by means of a *base and strong generating set*, or *BSGS*, for $G$. Suppose the group $G$ acts on the set $\Omega$. A *base* $B$ for $G$ is a sequence of distinct points from $\Omega$ with the property that the identity is the only element of $G$ that fixes $B$ pointwise. A base $B$ of length $n$ determines a sequence of subgroups $G^{(i)}$, $1 \leq i \leq n+1$, where $G^{(i)}$ is the stabilizer of the first $i-1$ points of $B$. (In particular, $G^{(1)}=G$ and $G^{(n+1)}$ is trivial.) Given a base $B$ for $G$, a subset $S$ of $G$ is said to be a *strong generating set* for $G$ (with respect to $B$) if $G^{(i)} = \langle S \cap G^{(i)}\rangle$, for $i = 1, \ldots, n$.

<a id="procedure-bsgs-grpperm"></a>
##### `BSGS(G): GrpPerm`

The general procedure for constructing a BSGS. This version uses the default algorithm choices.

<a id="procedure-simsschreier-grpperm"></a>
##### `SimsSchreier(G: parameters): GrpPerm`

```magma
SV: BoolElt                    Default: true
```

Construct a base and strong generating set for the group $G$ using the standard Schreier-Sims algorithm. If the parameter `SV` is set `true` (default) the transversals are stored in the form of Schreier vectors. If `SV` is set `false`, then the transversals are stored both as lists of permutations and as Schreier vectors. If the base attribute has been previously defined for $G$, a variant of the Sims-Schreier algorithm will be employed, in which permutation multiplications are replaced by base image calculations wherever possible.

<a id="procedure-randomschreier-grpperm"></a>
##### `RandomSchreier(G: parameters): GrpPerm`

```magma
Max: RngIntElt                    Default: 100
Run: RngIntElt                    Default: 20
```

Construct a probable base and strong generating set for the group $G$. The strong generators are constructed from a set of randomly chosen elements of $G$. The expectation is that, if sufficient random elements are taken, then, upon termination, the algorithm will have produced a BSGS for $G$. If the attribute Order is defined for G, the random Schreier will continue until a BSGS defining a group of the indicated order is obtained. In such circumstances this method is the fastest method of constructing a base and strong generating set for $G$. This is particularly so for groups of large degree. If nothing is known about $G$, the random Schreier algorithm provides a cheap way of obtaining lower bounds on the group’s order and, in the case of a permutation group, on its degree of transitivity. This parameter has two associated parameters, `Max` and `Run`, which take positive integer values. The parameter `Max` specifies the number of random elements to be used (default 100). If the value of `Run` is $n_2$, then the algorithm terminates after $n_2$ consecutive random elements are found to lie in the set defined by the current BSGS (default 20). The two limits are independent of one another. It should be emphasized that unpredictable results may arise if the programmer uses the base and strong generators produced by this algorithm when, in fact, it does not constitute a BSGS for $G$.

If the order of the group is known then construction of a BSGS stops when a BSGS of this order is reached.

<a id="procedure-toddcoxeterschreier-grpperm"></a>
##### `ToddCoxeterSchreier(G: parameters): GrpPerm`

Construct a BSGS for $G$ using the Todd-Coxeter Schreier algorithm.

<a id="procedure-solubleschreier-grpperm"></a>
##### `SolubleSchreier(G: parameters): GrpPerm`

<a id="procedure-solvableschreier-grpperm"></a>
##### `SolvableSchreier(G: parameters): GrpPerm`

```magma
Depth: RngIntElt                    Default: See below
```

Construct a base and strong generating set for the soluble permutation group $G$ using the algorithm of Sims [[Sim90](https://docs.magma-maths.org/references.md#cite-sol-schreier)]. The algorithm proceeds by recursively constructing the terms of the derived series. If $G$ is not soluble then the algorithm will not terminate. In order to avoid non-termination, a limit on the number of terms in the normal subgroup chain constructed must be prescribed. The user may set this limit as the value of the parameter `Depth`. The default value, $\lceil 1.6\ \ log_2\ Degree(G) \rceil$, is based on an upper limit (due to Dixon) on the length of the derived series of a soluble permutation group. This algorithm is often significantly faster than the general Schreier-Sims algorithm.

<a id="procedure-verify-grpperm"></a>
##### `Verify(G: parameters): GrpPerm`

```magma
Levels    : RngIntElt                    Default: 0
OrbitLimit: RngIntElt                    Default: 4,000
```

Given a permutation group $G$ for which a probable BSGS is stored, verify the correctness of the BSGS. If it is not complete, proceed to complete it. The two parameters `Levels` and `OrbitLimit` define how many levels the Todd-Coxeter-Schreier-Sims verifies before switching to the Brownie-Cannon-Sims algorithm. If `Levels` is set to $n$ non-zero then $n$ levels are verified by the TCSS algorithm before switching. If `Levels` is zero, the switch-over point is determined by the value of the parameter `OrbitLimit`. All levels with basic orbit length at most `OrbitLimit` are verified using TCSS. When a level is encountered with orbit length greater than this, a decision based on expected amount of work to do for this level by each algorithm determines what strategy is used for this level. Once one level uses the BCS method, all levels from then on will use it.

<a id="example-ex-12dc1e"></a>
##### `Example: BSGS for the Higman-Sims Group (ex-12dc1e)`

The Higman-Sims simple group represented on 100 letters is generated by two permutations. To create a base and strong generating set for it using the Todd-Coxeter-Schreier algorithm, we can use the `ToddCoxeterSchreier` procedure as follows:

```magma
> G := sub<Sym(100) |
>    (2,8,13,17,20,22,7)(3,9,14,18,21,6,12)(4,10,15,19,5,11,16)
>        (24,77,99,72,64,82,40)(25,92,49,88,28,65,90)(26,41,70,98,91,38,75)
>        (27,55,43,78,86,87,45)(29,69,59,79,76,35,67)(30,39,42,81,36,57,89)
>        (31,93,62,44,73,71,50)(32,53,85,60,51,96,83)(33,37,58,46,84,100,56)
>        (34,94,80,61,97,48,68)(47,95,66,74,52,54,63),
>    (1,35)(3,81)(4,92)(6,60)(7,59)(8,46)(9,70)(10,91)(11,18)(12,66)(13,55)
>        (14,85)(15,90)(17,53)(19,45)(20,68)(21,69)(23,84)(24,34)(25,31)(26,32)
>        (37,39)(38,42)(40,41)(43,44)(49,64)(50,63)(51,52)(54,95)(56,96)(57,100)
>        (58,97)(61,62)(65,82)(67,83)(71,98)(72,99)(74,77)(76,78)(87,89) >;
> ToddCoxeterSchreier(G);
> Order(G);
44352000
```

<a id="example-ex-6e86d0"></a>
##### `Example: BSGS for the Rudvalis Group (ex-6e86d0)`

The simple group of Rudvalis has a permutation representation of degree $4060$. A generating set for the Rudvalis group, $Ru$, may be found in the standard Magma database `pergps`, where it is called `ru`. We use the random Schreier algorithm followed by the `Verify` procedure to produce a base and strong generating set. We increase the limits for `RandomSchreier` to increase the probability that a complete base and strong generating set is found. This is done as follows:

```magma
> load "ru";
> RandomSchreier(G : Max := 50, Run := 20);
> Order(G);
145926144000
> Verify(G);
> Order(G);
145926144000
> Base(G);
[ 1, 2, 3, 4 ]
> BasicOrbitLengths(G);
[ 4060, 2304, 780, 20 ]
```

#### Defining Values for Attributes

If the order of a permutation group is known in advance, the construction of a base and strong generating set can be greatly speeded up by taking advantage of this knowledge. The `AssertAttribute` constructor may be used to communicate this and other useful information to Magma.

<a id="procedure-assertattribute-grpperm-monstgelt-rngintelt-order"></a>
##### `AssertAttribute(G, "Order", n): GrpPerm, MonStgElt, RngIntElt`

Define the order attribute for the permutation group $G$.

<a id="procedure-assertattribute-grpperm-monstgelt-rngintelt-rngintelt-order"></a>
##### `AssertAttribute(G, "Order", Q): GrpPerm, MonStgElt, [<RngIntElt, RngIntElt>]`

Define the (factored) order of the permutation group $G$ to be $Q$.

<a id="procedure-assertattribute-grpperm-monstgelt-grppermbsgs-bsgs"></a>
##### `AssertAttribute(G, "BSGS", S): GrpPerm, MonStgElt, GrpPermBSGS`

Define the base and strong generating set structure $S$ to be the BSGS for $G$.

<a id="example-ex-f89434"></a>
##### `Example: Random Schreier-Sims with Known Order (ex-f89434)`

The ability to set the order provides a short cut when constructing a BSGS. If the order attribute is set and the random Schreier-Sims algorithm applied, it will run until a BSGS for a group of the designated order has been constructed. We illustrate this in the case of the wreath product, with product action, of ${\operatorname{Sym}}(42)$ with ${\operatorname{Alt}}(8)$.

```magma
> G := WreathProduct(Sym(42), Alt(8));
> AssertAttribute(G, "Order", Factorial(42)^8 * (Factorial(8) div 2));
> RandomSchreier(G);
> Order(G);
3061373016723610165203127456307122124535329726578404327\\
5428034073188691030999256052666924787022950130890371891\\
0525089665194187638747340938406861181340150889944654752\\
7025207255845130274434558221633869210079882581975069742\\
1672055466250914291002570275499685768646240411055766098\\
2370739110690651875215676663235534126138270781440155683\\
9906515353600000000000000000000000000000000000000000000\\
00000000000000000000000000000
```

#### Accessing the Base and Strong Generating Set

<a id="function-base-grpperm"></a>
##### `Base(G): GrpPerm -> [Elt]`

A base for the permutation group $G$. The base is returned as a sequence of points of its natural $G$-set. If a base is not known, one will be constructed.

<a id="function-basepoint-grpperm-rngintelt"></a>
##### `BasePoint(G, i): GrpPerm, RngIntElt -> Elt`

The $i$-th base point for the permutation group $G$. A base and strong generating set must be known for $G$.

<a id="function-basicorbit-grpperm-rngintelt"></a>
##### `BasicOrbit(G, i): GrpPerm, RngIntElt -> SetIndx`

The basic orbit at level $i$ as defined by the current base for the permutation group $G$. This function assumes that a BSGS is known for $G$.

<a id="function-basicorbits-grpperm"></a>
##### `BasicOrbits(G): GrpPerm -> [SetIndx]`

The basic orbits as defined by the current base for the permutation group $G$. This function assumes that a BSGS is known for $G$. The orbits are returned as a sequence of indexed sets.

<a id="function-basicorbitlength-grpperm-rngintelt"></a>
##### `BasicOrbitLength(G, i): GrpPerm, RngIntElt -> RngIntElt`

The length of the basic orbit at level $i$ as defined by the current base for the permutation group $G$. This function assumes that a BSGS is known for $G$.

<a id="function-basicorbitlengths-grpperm"></a>
##### `BasicOrbitLengths(G): GrpPerm -> [RngIntElt]`

The lengths of the basic orbits as defined by the current base for the permutation group $G$. This function assumes that a BSGS is known for $G$. The lengths are returned as a sequence of integers.

<a id="function-basicstabilizer-grpperm-rngintelt"></a>
##### `BasicStabilizer(G, i): GrpPerm, RngIntElt -> GrpPerm`

<a id="function-basicstabiliser-grpperm-rngintelt"></a>
##### `BasicStabiliser(G, i): GrpPerm, RngIntElt -> GrpPerm`

Given a permutation group $G$ for which a base and strong generating set are known, and an integer $i$, where $1 \leq i \leq k$ with $k$ the length of the base, return the subgroup of $G$ which fixes the first $i-1$ points of the base.

<a id="function-basicstabilizerchain-grpperm"></a>
##### `BasicStabilizerChain(G): GrpPerm -> [GrpPerm]`

<a id="function-basicstabiliserchain-grpperm"></a>
##### `BasicStabiliserChain(G): GrpPerm -> [GrpPerm]`

Given a permutation group $G$, return the stabilizer chain defined by the base as a sequence of subgroups of $G$. If a BSGS is not already known for $G$, it will be created.

<a id="function-ismemberbasicorbit-grpperm-rngintelt-elt"></a>
##### `IsMemberBasicOrbit(G, i, a): GrpPerm, RngIntElt, Elt -> BoolElt`

Returns `true` if the point a of $\Omega$ lies in the basic orbit at level $i$. This function assumes that a BSGS is known for $G$.

<a id="function-numberofstronggenerators-grpperm"></a>
##### `NumberOfStrongGenerators(G): GrpPerm -> RngIntElt`

<a id="function-nsgens-grpperm"></a>
##### `Nsgens(G): GrpPerm -> RngIntElt`

The number of elements in the current strong generating set for $G$.

<a id="function-numberofstronggenerators-grpperm-rngintelt"></a>
##### `NumberOfStrongGenerators(G, i): GrpPerm, RngIntElt -> RngIntElt`

<a id="function-nsgens-grpperm-rngintelt"></a>
##### `Nsgens(G, i): GrpPerm, RngIntElt -> RngIntElt`

The number of elements in the strong generating set for the $i$-th term of the stabilizer chain for $G$.

<a id="function-schreiervectors-grpperm"></a>
##### `SchreierVectors(G): GrpPerm -> [ [RngIntElt] ]`

The Schreier vectors corresponding to the current BSGS for the permutation group $G$. The vectors are returned as a sequence of integer sequences.

<a id="function-schreiervector-grpperm-rngintelt"></a>
##### `SchreierVector(G, i): GrpPerm, RngIntElt -> [RngIntElt]`

The Schreier vector corresponding the $i$-th term of the stabilizer chain defined by the current BSGS for the permutation group $G$. The vector is returned as a sequence of integers.

<a id="function-stronggenerators-grpperm"></a>
##### `StrongGenerators(G): GrpPerm -> SetIndx(GrpPermElt)`

A set of strong generators for the permutation group $G$. If they are not currently available, they will be computed.

<a id="function-stronggenerators-grpperm-rngintelt"></a>
##### `StrongGenerators(G, i): GrpPerm, RngIntElt -> SetIndx(GrpPermElt)`

A set of strong generators for the $i$-th term in the stabilizer chain for the permutation group $G$. A BSGS must be known for $G$.

#### Working with a Base and Strong Generating Set

<a id="function-baseimage-grppermelt"></a>
##### `BaseImage(x): GrpPermElt -> [Elt]`

Given a permutation $x$ belonging to the group $G$, for which a base and strong generating set is known, form the base image of $x$.

<a id="function-permutation-grpperm-elt"></a>
##### `Permutation(G, Q): GrpPerm, [Elt] -> GrpPermElt`

Given a permutation group $G$ acting on the set $\Omega$, for which a base and strong generating set are known, and a sequence $Q$ of distinct points of $\Omega$ defining an element $x$ of $G$, return $x$ as a permutation.

<a id="function-svpermutation-grpperm-rngintelt-elt"></a>
##### `SVPermutation(G, i, a): GrpPerm, RngIntElt, Elt -> GrpPermElt`

The permutation of $G$ defined by the Schreier vector at level $i$, which takes the point $a$ of $\Omega$ to the base point at level $i$. This function assumes that a BSGS is known for $G$.

<a id="function-svword-grpperm-rngintelt-elt"></a>
##### `SVWord(G, i, a): GrpPerm, RngIntElt, Elt -> GrpFPElt`

An element in the word group of $G$ defined by the Schreier vector at level $i$, which takes the point $a$ of $\Omega$ to the base point at level $i$. This function assumes that a BSGS is known for $G$.

<a id="function-strip-grpperm-grppermelt"></a>
##### `Strip(H, x): GrpPerm, GrpPermElt -> BoolElt, GrpPermElt, RngIntElt`

Given an element $x$ of a permutation group $G$, and given a group $H$ for which a base and strong generating set is known, returns:

**(a)**
the value of `x in H`

**(b)**
The residual permutation $y$ resulting from the stripping of $x$ with respect to the BSGS for $H$; and

**(c)**
The first level $i$ such that $y$ is not contained in $H^{(i)}$.

<a id="function-wordstrip-grpperm-grppermelt"></a>
##### `WordStrip(H, x): GrpPerm, GrpPermElt -> BoolElt, GrpFPElt, RngIntElt`

Given an element $x$ of a permutation group $G$, and given a group $H$ for which a base and strong generating set is known, returns:

**(a)**
the value of `x in H`

**(b)**
the residual word $w$ (an element in the word group of $G$) resulting from the stripping of $x$ with respect to the BSGS for $H$,

**(c)**
The first level $i$ such that $y$ is not contained in $H^{(i)}$.

<a id="function-baseimagewordstrip-grpperm-grppermelt"></a>
##### `BaseImageWordStrip(H, x): GrpPerm, GrpPermElt -> BoolElt, GrpFPElt, RngIntElt`

Given an element $x$ of a permutation group $G$, and given a group $H$ for which a base and strong generating set is known, returns:

**(a)**
Whether the base image strip succeeded at all levels. Note that a true value here does *not*, on its own, imply $x \in H$.

**(b)**
the residual word $w$ (an element in the word group of $G$) resulting from the stripping of $x$ with respect to the BSGS for $H$,

**(c)**
The first level $i$ such that the strip could not continue.

<a id="function-wordinstronggenerators-grpperm-grppermelt"></a>
##### `WordInStrongGenerators(H, x): GrpPerm, GrpPermElt -> GrpFPElt`

Given an element $x$ of a permutation group $H$ for which a base and strong generating set is known, returns a word in the strong generators of $H$ which represents $x$. This function uses base images to determine the word for $x$, so giving $x\not\in H$ will have unpredictable results. This function returns the inverse of the second return value of `BaseImageWordStrip`, when the latter is successful.

#### Modifying a Base and Strong Generating Set

<a id="procedure-changebase-grpperm-elt-ref"></a>
##### `ChangeBase(~G, Q): GrpPerm, [Elt]`

Given a group $H$ with a base and strong generating set, change the base of $G$, so that the points in the sequence $Q$ form an initial segment of the new base.

<a id="procedure-addnormalizinggenerator-grpperm-grppermelt-ref"></a>
##### `AddNormalizingGenerator(~H, x): GrpPerm, GrpPermElt`

Given a group $H$ with a base $B$ and strong generating set $X$, and an element $x$ that normalizes $H$ belonging to a group that contains $H$, extend the existing BSGS for $H$ so that they form a BSGS for the subgroup $<H, x>$.

<a id="procedure-reducegenerators-grpperm-ref"></a>
##### `ReduceGenerators(~G): GrpPerm`

Given a group $G$ with a base and strong generating set, remove redundant strong generators.

### Permutation Representations of Linear Groups

Each of the functions in this family returns two values:

**(a)**
A permutation group $G$ corresponding to the action of a designated matrix group $M$ on a vector space $V$; and

**(b)**
An indexed set of affine or projective points on which $M$ acts, such that the indexing gives the correspondence between this set and the $G$-set of $M$.

Furthermore, most of the function in this family are parameterized by two objects: the *degree* and the *coefficient field* of the matrix group. These can be supplied in one of the following three forms:

**(i)**
Integers $n$ and $q$ corresponding to the degree and the field ${\bf F}_{q}$ of $M$ (${\bf F}_{q^2}$ in the case of the unitary groups).

**(ii)**
An integer $n$ and a finite field $K$ corresponding to the degree and the coefficient field of $M$.

**(iii)**
A vector space $V = K^n$ on which $M$ naturally acts.

The Suzuki group, however, is only parametrised by the field, as the degree is always four. As such, it can be described by the integer $q$, the field $K = {\bf F}_{q}$, or the vector space $K^4$.

<a id="literal-literal-affinegenerallineargroup-affinegenerallineargroup-arguments"></a>
#### `AffineGeneralLinearGroup(arguments)`

<a id="literal-literal-agl-agl-arguments"></a>
#### `AGL(arguments)`

<a id="function-affinegenerallineargroup-rngintelt-rngintelt"></a>
#### `AffineGeneralLinearGroup(n, q): RngIntElt, RngIntElt -> GrpPerm, {@ ModTupFldElt @}`

<a id="function-affinegenerallineargroup-rngintelt-fldfin"></a>
#### `AffineGeneralLinearGroup(n, K): RngIntElt, FldFin -> GrpPerm, {@ ModTupFldElt @}`

<a id="function-affinegenerallineargroup-modtuprng"></a>
#### `AffineGeneralLinearGroup(V): ModTupRng -> GrpPerm, {@ ModTupFldElt @}`

<a id="function-agl-rngintelt-rngintelt"></a>
#### `AGL(n, q): RngIntElt, RngIntElt -> GrpPerm, {@ ModTupFldElt @}`

<a id="function-agl-rngintelt-fldfin"></a>
#### `AGL(n, K): RngIntElt, FldFin -> GrpPerm, {@ ModTupFldElt @}`

<a id="function-agl-modtuprng"></a>
#### `AGL(V): ModTupRng -> GrpPerm, {@ ModTupFldElt @}`

Construct the affine general linear group $G = {\operatorname{AGL}}(n, q)$, i.e., the group corresponding to the action of ${\operatorname{GL}}(n, q)$ on the affine points of the $n$-dimensional vector space $V$ over $K = {\bf F}_{q}$. The function returns:

**(a)**
The group $G$;

**(b)**
An indexed set giving the correspondence between the affine points and the $G$-set of $G$.

<a id="literal-literal-affinespeciallineargroup-affinespeciallineargroup-arguments"></a>
#### `AffineSpecialLinearGroup(arguments)`

<a id="literal-literal-asl-asl-arguments"></a>
#### `ASL(arguments)`

<a id="function-affinespeciallineargroup-rngintelt-rngintelt"></a>
#### `AffineSpecialLinearGroup(n, q): RngIntElt, RngIntElt -> GrpPerm, {@ ModTupFldElt @}`

<a id="function-affinespeciallineargroup-rngintelt-fldfin"></a>
#### `AffineSpecialLinearGroup(n, K): RngIntElt, FldFin -> GrpPerm, {@ ModTupFldElt @}`

<a id="function-affinespeciallineargroup-modtuprng"></a>
#### `AffineSpecialLinearGroup(V): ModTupRng -> GrpPerm, {@ ModTupFldElt @}`

<a id="function-asl-rngintelt-rngintelt"></a>
#### `ASL(n, q): RngIntElt, RngIntElt -> GrpPerm, {@ ModTupFldElt @}`

<a id="function-asl-rngintelt-fldfin"></a>
#### `ASL(n, K): RngIntElt, FldFin -> GrpPerm, {@ ModTupFldElt @}`

<a id="function-asl-modtuprng"></a>
#### `ASL(V): ModTupRng -> GrpPerm, {@ ModTupFldElt @}`

Construct the affine special linear group $G = {\operatorname{ASL}}(n, q)$, i.e., the group corresponding to the action of ${\operatorname{SL}}(n, q)$ on the affine points of the $n$-dimensional vector space $V$ over $K = {\bf F}_{q}$. The function returns:

**(a)**
The group $G$;

**(b)**
An indexed set giving the correspondence between the affine points and the $G$-set of $G$.

<a id="literal-literal-affinegammalineargroup-affinegammalineargroup-arguments"></a>
#### `AffineGammaLinearGroup(arguments)`

<a id="literal-literal-agammal-agammal-arguments"></a>
#### `AGammaL(arguments)`

<a id="function-affinegammalineargroup-rngintelt-rngintelt"></a>
#### `AffineGammaLinearGroup(n, q): RngIntElt, RngIntElt -> GrpPerm, {@ ModTupFldElt @}`

<a id="function-affinegammalineargroup-rngintelt-fldfin"></a>
#### `AffineGammaLinearGroup(n, K): RngIntElt, FldFin -> GrpPerm, {@ ModTupFldElt @}`

<a id="function-affinegammalineargroup-modtuprng"></a>
#### `AffineGammaLinearGroup(V): ModTupRng -> GrpPerm, {@ ModTupFldElt @}`

<a id="function-agammal-rngintelt-rngintelt"></a>
#### `AGammaL(n, q): RngIntElt, RngIntElt -> GrpPerm, {@ ModTupFldElt @}`

<a id="function-agammal-rngintelt-fldfin"></a>
#### `AGammaL(n, K): RngIntElt, FldFin -> GrpPerm, {@ ModTupFldElt @}`

<a id="function-agammal-modtuprng"></a>
#### `AGammaL(V): ModTupRng -> GrpPerm, {@ ModTupFldElt @}`

Construct the affine gamma linear group $G = {\operatorname{A\Gamma L}}(n, q)$, i.e., the group corresponding to the action of ${\operatorname{\Gamma L}}(n, q)$ (the automorphism group of ${\operatorname{GL}}(n, q)$) on the affine points of the $n$-dimensional vector space $V$ over $K = {\bf F}_{q}$. The function returns:

**(a)**
The group $G$;

**(b)**
An indexed set giving the correspondence between the points and the $G$-set of $G$.

<a id="literal-literal-affinesigmalineargroup-affinesigmalineargroup-arguments"></a>
#### `AffineSigmaLinearGroup(arguments)`

<a id="literal-literal-asigmal-asigmal-arguments"></a>
#### `ASigmaL(arguments)`

<a id="function-affinesigmalineargroup-rngintelt-rngintelt"></a>
#### `AffineSigmaLinearGroup(n, q): RngIntElt, RngIntElt -> GrpPerm, {@ ModTupFldElt @}`

<a id="function-affinesigmalineargroup-rngintelt-fldfin"></a>
#### `AffineSigmaLinearGroup(n, K): RngIntElt, FldFin -> GrpPerm, {@ ModTupFldElt @}`

<a id="function-affinesigmalineargroup-modtuprng"></a>
#### `AffineSigmaLinearGroup(V): ModTupRng -> GrpPerm, {@ ModTupFldElt @}`

<a id="function-asigmal-rngintelt-rngintelt"></a>
#### `ASigmaL(n, q): RngIntElt, RngIntElt -> GrpPerm, {@ ModTupFldElt @}`

<a id="function-asigmal-rngintelt-fldfin"></a>
#### `ASigmaL(n, K): RngIntElt, FldFin -> GrpPerm, {@ ModTupFldElt @}`

<a id="function-asigmal-modtuprng"></a>
#### `ASigmaL(V): ModTupRng -> GrpPerm, {@ ModTupFldElt @}`

Construct the affine sigma linear group $G = {\operatorname{A\Sigma L}}(n, q)$, i.e., the group corresponding to the action of ${\operatorname{\Sigma L}}(n, q)$ (the automorphism group of ${\operatorname{SL}}(n, q)$) on the affine points of the $n$-dimensional vector space $V$ over $K = {\bf F}_{q}$. The function returns:

**(a)**
The group $G$;

**(b)**
An indexed set giving the correspondence between the points and the $G$-set of $G$.

<a id="literal-literal-affinesymplecticgroup-affinesymplecticgroup-arguments"></a>
#### `AffineSymplecticGroup(arguments)`

<a id="literal-literal-asp-asp-arguments"></a>
#### `ASp(arguments)`

<a id="function-affinesymplecticgroup-rngintelt-rngintelt"></a>
#### `AffineSymplecticGroup(n, q): RngIntElt, RngIntElt -> GrpPerm, {@ ModTupFldElt @}`

<a id="function-affinesymplecticgroup-rngintelt-fldfin"></a>
#### `AffineSymplecticGroup(n, K): RngIntElt, FldFin -> GrpPerm, {@ ModTupFldElt @}`

<a id="function-affinesymplecticgroup-modtuprng"></a>
#### `AffineSymplecticGroup(V): ModTupRng -> GrpPerm, {@ ModTupFldElt @}`

<a id="function-asp-rngintelt-rngintelt"></a>
#### `ASp(n, q): RngIntElt, RngIntElt -> GrpPerm, {@ ModTupFldElt @}`

<a id="function-asp-rngintelt-fldfin"></a>
#### `ASp(n, K): RngIntElt, FldFin -> GrpPerm, {@ ModTupFldElt @}`

<a id="function-asp-modtuprng"></a>
#### `ASp(V): ModTupRng -> GrpPerm, {@ ModTupFldElt @}`

Construct the affine symplectic linear group $G$, i.e., the group corresponding to the action of $Sp(n, q)$ on the affine points of the $n$-dimensional vector space $V$ over $K = {\bf F}_{q}$. The function returns:

**(a)**
The group $G$;

**(b)**
An indexed set giving the correspondence between the affine points and the $G$-set of $G$.

<a id="literal-literal-affinesigmasymplecticgroup-affinesigmasymplecticgroup-arguments"></a>
#### `AffineSigmaSymplecticGroup(arguments)`

<a id="literal-literal-asigmasp-asigmasp-arguments"></a>
#### `ASigmaSp(arguments)`

<a id="function-affinesigmasymplecticgroup-rngintelt-rngintelt"></a>
#### `AffineSigmaSymplecticGroup(n, q): RngIntElt, RngIntElt -> GrpPerm, {@ ModTupFldElt @}`

<a id="function-affinesigmasymplecticgroup-rngintelt-fldfin"></a>
#### `AffineSigmaSymplecticGroup(n, K): RngIntElt, FldFin -> GrpPerm, {@ ModTupFldElt @}`

<a id="function-affinesigmasymplecticgroup-modtuprng"></a>
#### `AffineSigmaSymplecticGroup(V): ModTupRng -> GrpPerm, {@ ModTupFldElt @}`

<a id="function-asigmasp-rngintelt-rngintelt"></a>
#### `ASigmaSp(n, q): RngIntElt, RngIntElt -> GrpPerm, {@ ModTupFldElt @}`

<a id="function-asigmasp-rngintelt-fldfin"></a>
#### `ASigmaSp(n, K): RngIntElt, FldFin -> GrpPerm, {@ ModTupFldElt @}`

<a id="function-asigmasp-modtuprng"></a>
#### `ASigmaSp(V): ModTupRng -> GrpPerm, {@ ModTupFldElt @}`

Construct the affine sigma symplectic linear group $G$, i.e., the group corresponding to the action of $Sp(n, q)$ on the affine points of the $n$-dimensional vector space $V$ over $K = {\bf F}_{q}$, plus the action of a field automorphism. The function returns:

**(a)**
The group $G$;

**(b)**
An indexed set giving the correspondence between the affine points and the $G$-set of $G$.

<a id="literal-literal-projectivegenerallineargroup-projectivegenerallineargroup-arguments"></a>
#### `ProjectiveGeneralLinearGroup(arguments)`

<a id="literal-literal-pgl-pgl-arguments"></a>
#### `PGL(arguments)`

<a id="function-projectivegenerallineargroup-rngintelt-rngintelt"></a>
#### `ProjectiveGeneralLinearGroup(n, q): RngIntElt, RngIntElt -> GrpPerm, {@ ModTupFldElt @}`

<a id="function-projectivegenerallineargroup-rngintelt-fldfin"></a>
#### `ProjectiveGeneralLinearGroup(n, K): RngIntElt, FldFin -> GrpPerm, {@ ModTupFldElt @}`

<a id="function-projectivegenerallineargroup-modtuprng"></a>
#### `ProjectiveGeneralLinearGroup(V): ModTupRng -> GrpPerm, {@ ModTupFldElt @}`

<a id="function-pgl-rngintelt-rngintelt"></a>
#### `PGL(n, q): RngIntElt, RngIntElt -> GrpPerm, {@ ModTupFldElt @}`

<a id="function-pgl-rngintelt-fldfin"></a>
#### `PGL(n, K): RngIntElt, FldFin -> GrpPerm, {@ ModTupFldElt @}`

<a id="function-pgl-modtuprng"></a>
#### `PGL(V): ModTupRng -> GrpPerm, {@ ModTupFldElt @}`

Construct the projective general linear group $G = {\operatorname{PGL}}(n, q)$, i.e., the group corresponding to the action of ${\operatorname{GL}}(n, q)$ on the projective points of the $n$-dimensional vector space $V$ over $K = {\bf F}_{q}$, where $n \geq 2$ and $q$ is a prime power. The function returns:

**(a)**
The group $G$;

**(b)**
An indexed set of the generators of the 1-dimensional subspaces of $K^{(n)}$, giving the correspondence between these vectors and the $G$-set of $G$.

<a id="literal-literal-projectivespeciallineargroup-projectivespeciallineargroup-arguments"></a>
#### `ProjectiveSpecialLinearGroup(arguments)`

<a id="literal-literal-psl-psl-arguments"></a>
#### `PSL(arguments)`

<a id="function-projectivespeciallineargroup-rngintelt-rngintelt"></a>
#### `ProjectiveSpecialLinearGroup(n, q): RngIntElt, RngIntElt -> GrpPerm, {@ ModTupFldElt @}`

<a id="function-projectivespeciallineargroup-rngintelt-fldfin"></a>
#### `ProjectiveSpecialLinearGroup(n, K): RngIntElt, FldFin -> GrpPerm, {@ ModTupFldElt @}`

<a id="function-projectivespeciallineargroup-modtuprng"></a>
#### `ProjectiveSpecialLinearGroup(V): ModTupRng -> GrpPerm, {@ ModTupFldElt @}`

<a id="function-psl-rngintelt-rngintelt"></a>
#### `PSL(n, q): RngIntElt, RngIntElt -> GrpPerm, {@ ModTupFldElt @}`

<a id="function-psl-rngintelt-fldfin"></a>
#### `PSL(n, K): RngIntElt, FldFin -> GrpPerm, {@ ModTupFldElt @}`

<a id="function-psl-modtuprng"></a>
#### `PSL(V): ModTupRng -> GrpPerm, {@ ModTupFldElt @}`

Construct the projective special linear group $G = {\operatorname{PSL}}(n, q)$, i.e., the group corresponding to the action of ${\operatorname{SL}}(n, q)$ on the projective points of the $n$-dimensional vector space $V$ over $K = {\bf F}_{q}$, where $n \geq 2$ and $q$ is a prime power. The function returns:

**(a)**
The group $G$;

**(b)**
An indexed set of the generators of the 1-dimensional subspaces of $K^{(n)}$, giving the correspondence between these vectors and the $G$-set of $G$.

<a id="literal-literal-projectivegammalineargroup-projectivegammalineargroup-arguments"></a>
#### `ProjectiveGammaLinearGroup(arguments)`

<a id="literal-literal-pgammal-pgammal-arguments"></a>
#### `PGammaL(arguments)`

<a id="function-projectivegammalineargroup-rngintelt-rngintelt"></a>
#### `ProjectiveGammaLinearGroup(n, q): RngIntElt, RngIntElt -> GrpPerm, {@ ModTupFldElt @}`

<a id="function-projectivegammalineargroup-rngintelt-fldfin"></a>
#### `ProjectiveGammaLinearGroup(n, K): RngIntElt, FldFin -> GrpPerm, {@ ModTupFldElt @}`

<a id="function-projectivegammalineargroup-modtuprng"></a>
#### `ProjectiveGammaLinearGroup(V): ModTupRng -> GrpPerm, {@ ModTupFldElt @}`

<a id="function-pgammal-rngintelt-rngintelt"></a>
#### `PGammaL(n, q): RngIntElt, RngIntElt -> GrpPerm, {@ ModTupFldElt @}`

<a id="function-pgammal-rngintelt-fldfin"></a>
#### `PGammaL(n, K): RngIntElt, FldFin -> GrpPerm, {@ ModTupFldElt @}`

<a id="function-pgammal-modtuprng"></a>
#### `PGammaL(V): ModTupRng -> GrpPerm, {@ ModTupFldElt @}`

Construct an automorphism group $G = {\operatorname{P\Gamma L}}(n, q)$ of the projective general linear group $B = {\operatorname{PGL}}(n, q)$, by adding the field automorphisms of ${\bf F}_{q}$ to $B$. The permutation action corresponds to the natural action on 1-dimensional subspaces of the $n$-dimensional vector space $V$ over the field $K = {\bf F}_{q}$, where $n \geq 2$ and $q$ is a prime power. The function returns:

**(a)**
The group $G$;

**(b)**
An indexed set giving the correspondence between the points and the $G$-set of $G$.

<a id="literal-literal-projectivesigmalineargroup-projectivesigmalineargroup-arguments"></a>
#### `ProjectiveSigmaLinearGroup(arguments)`

<a id="literal-literal-psigmal-psigmal-arguments"></a>
#### `PSigmaL(arguments)`

<a id="function-projectivesigmalineargroup-rngintelt-rngintelt"></a>
#### `ProjectiveSigmaLinearGroup(n, q): RngIntElt, RngIntElt -> GrpPerm, {@ ModTupFldElt @}`

<a id="function-projectivesigmalineargroup-rngintelt-fldfin"></a>
#### `ProjectiveSigmaLinearGroup(n, K): RngIntElt, FldFin -> GrpPerm, {@ ModTupFldElt @}`

<a id="function-projectivesigmalineargroup-modtuprng"></a>
#### `ProjectiveSigmaLinearGroup(V): ModTupRng -> GrpPerm, {@ ModTupFldElt @}`

<a id="function-psigmal-rngintelt-rngintelt"></a>
#### `PSigmaL(n, q): RngIntElt, RngIntElt -> GrpPerm, {@ ModTupFldElt @}`

<a id="function-psigmal-rngintelt-fldfin"></a>
#### `PSigmaL(n, K): RngIntElt, FldFin -> GrpPerm, {@ ModTupFldElt @}`

<a id="function-psigmal-modtuprng"></a>
#### `PSigmaL(V): ModTupRng -> GrpPerm, {@ ModTupFldElt @}`

Construct an automorphism group $G = {\operatorname{P\Sigma L}}(n, q)$ of the projective special linear group $B = {\operatorname{PSL}}(n, q)$, by adding the field automorphisms of ${\bf F}_{q}$ to $B$. The permutation action corresponds to the natural action on 1-dimensional subspaces of the $n$-dimensional vector space $V$ over the field $K = {\bf F}_{q}$, where $n \geq 2$ and $q$ is a prime power. The function returns:

**(a)**
The group $G$;

**(b)**
An indexed set giving the correspondence between the points and the $G$-set of $G$.

<a id="literal-literal-projectivegeneralunitarygroup-projectivegeneralunitarygroup-arguments"></a>
#### `ProjectiveGeneralUnitaryGroup(arguments)`

<a id="literal-literal-pgu-pgu-arguments"></a>
#### `PGU(arguments)`

<a id="function-projectivegeneralunitarygroup-rngintelt-rngintelt"></a>
#### `ProjectiveGeneralUnitaryGroup(n, q): RngIntElt, RngIntElt -> GrpPerm, {@ ModTupFldElt @}`

<a id="function-projectivegeneralunitarygroup-rngintelt-fldfin"></a>
#### `ProjectiveGeneralUnitaryGroup(n, K): RngIntElt, FldFin -> GrpPerm, {@ ModTupFldElt @}`

<a id="function-projectivegeneralunitarygroup-modtuprng"></a>
#### `ProjectiveGeneralUnitaryGroup(V): ModTupRng -> GrpPerm, {@ ModTupFldElt @}`

<a id="function-pgu-rngintelt-rngintelt"></a>
#### `PGU(n, q): RngIntElt, RngIntElt -> GrpPerm, {@ ModTupFldElt @}`

<a id="function-pgu-rngintelt-fldfin"></a>
#### `PGU(n, K): RngIntElt, FldFin -> GrpPerm, {@ ModTupFldElt @}`

<a id="function-pgu-modtuprng"></a>
#### `PGU(V): ModTupRng -> GrpPerm, {@ ModTupFldElt @}`

Construct the projective general unitary group $G = {\operatorname{PGU}}(n, q)$ corresponding to the $n$-dimensional vector space $V$ over the field $K = {\bf F}_{q^2}$, where $n \geq 2$ and $q$ is a prime power. The function returns:

**(a)**
The group $G$;

**(b)**
An indexed set of the generators of the 1-dimensional subspaces of $K^{(n)}$, giving the correspondence between these vectors and the $G$-set of $G$.

<a id="literal-literal-projectivespecialunitarygroup-projectivespecialunitarygroup-arguments"></a>
#### `ProjectiveSpecialUnitaryGroup(arguments)`

<a id="literal-literal-psu-psu-arguments"></a>
#### `PSU(arguments)`

<a id="function-projectivespecialunitarygroup-rngintelt-rngintelt"></a>
#### `ProjectiveSpecialUnitaryGroup(n, q): RngIntElt, RngIntElt -> GrpPerm, {@ ModTupFldElt @}`

<a id="function-projectivespecialunitarygroup-rngintelt-fldfin"></a>
#### `ProjectiveSpecialUnitaryGroup(n, K): RngIntElt, FldFin -> GrpPerm, {@ ModTupFldElt @}`

<a id="function-projectivespecialunitarygroup-modtuprng"></a>
#### `ProjectiveSpecialUnitaryGroup(V): ModTupRng -> GrpPerm, {@ ModTupFldElt @}`

<a id="function-psu-rngintelt-rngintelt"></a>
#### `PSU(n, q): RngIntElt, RngIntElt -> GrpPerm, {@ ModTupFldElt @}`

<a id="function-psu-rngintelt-fldfin"></a>
#### `PSU(n, K): RngIntElt, FldFin -> GrpPerm, {@ ModTupFldElt @}`

<a id="function-psu-modtuprng"></a>
#### `PSU(V): ModTupRng -> GrpPerm, {@ ModTupFldElt @}`

Construct the projective special unitary group $G = {\operatorname{PSU}}(n, q)$ corresponding to the $n$-dimensional vector space $V$ over the field $K = {\bf F}_{q^2}$, where $n \geq 2$ and $q$ is a prime power. The function returns:

**(a)**
The group $G$;

**(b)**
An indexed set of the generators of the 1-dimensional subspaces of $V$, giving the correspondence between these vectors and the $G$-set of $G$.

<a id="literal-literal-projectivegammaunitarygroup-projectivegammaunitarygroup-arguments"></a>
#### `ProjectiveGammaUnitaryGroup(arguments)`

<a id="literal-literal-pgammau-pgammau-arguments"></a>
#### `PGammaU(arguments)`

<a id="function-projectivegammaunitarygroup-rngintelt-rngintelt"></a>
#### `ProjectiveGammaUnitaryGroup(n, q): RngIntElt, RngIntElt -> GrpPerm, {@ ModTupFldElt @}`

<a id="function-projectivegammaunitarygroup-rngintelt-fldfin"></a>
#### `ProjectiveGammaUnitaryGroup(n, K): RngIntElt, FldFin -> GrpPerm, {@ ModTupFldElt @}`

<a id="function-projectivegammaunitarygroup-modtuprng"></a>
#### `ProjectiveGammaUnitaryGroup(V): ModTupRng -> GrpPerm, {@ ModTupFldElt @}`

<a id="function-pgammau-rngintelt-rngintelt"></a>
#### `PGammaU(n, q): RngIntElt, RngIntElt -> GrpPerm, {@ ModTupFldElt @}`

<a id="function-pgammau-rngintelt-fldfin"></a>
#### `PGammaU(n, K): RngIntElt, FldFin -> GrpPerm, {@ ModTupFldElt @}`

<a id="function-pgammau-modtuprng"></a>
#### `PGammaU(V): ModTupRng -> GrpPerm, {@ ModTupFldElt @}`

Construct an automorphism group $G = {\operatorname{P\Gamma U}}(n, q)$ of the projective general unitary group $B = {\operatorname{PGU}}(n, q)$, by adding the field automorphisms of ${\bf F}_{q^2}$ to $B$. The permutation action corresponds to the natural action on 1-dimensional subspaces of the $n$-dimensional vector space $V$ over the field $K = {\bf F}_{q^2}$, where $n \geq 2$ and $q$ is a prime power. The function returns:

**(a)**
The group $G$;

**(b)**
An indexed set giving the correspondence between the points and the $G$-set of $G$.

<a id="literal-literal-projectivesigmaunitarygroup-projectivesigmaunitarygroup-arguments"></a>
#### `ProjectiveSigmaUnitaryGroup(arguments)`

<a id="literal-literal-psigmau-psigmau-arguments"></a>
#### `PSigmaU(arguments)`

<a id="function-projectivesigmaunitarygroup-rngintelt-rngintelt"></a>
#### `ProjectiveSigmaUnitaryGroup(n, q): RngIntElt, RngIntElt -> GrpPerm, {@ ModTupFldElt @}`

<a id="function-projectivesigmaunitarygroup-rngintelt-fldfin"></a>
#### `ProjectiveSigmaUnitaryGroup(n, K): RngIntElt, FldFin -> GrpPerm, {@ ModTupFldElt @}`

<a id="function-projectivesigmaunitarygroup-modtuprng"></a>
#### `ProjectiveSigmaUnitaryGroup(V): ModTupRng -> GrpPerm, {@ ModTupFldElt @}`

<a id="function-psigmau-rngintelt-rngintelt"></a>
#### `PSigmaU(n, q): RngIntElt, RngIntElt -> GrpPerm, {@ ModTupFldElt @}`

<a id="function-psigmau-rngintelt-fldfin"></a>
#### `PSigmaU(n, K): RngIntElt, FldFin -> GrpPerm, {@ ModTupFldElt @}`

<a id="function-psigmau-modtuprng"></a>
#### `PSigmaU(V): ModTupRng -> GrpPerm, {@ ModTupFldElt @}`

Construct the automorphism group $G = {\operatorname{P\Sigma U}}(n, q)$ of the projective special unitary group $B = {\operatorname{PSU}}(n, q)$, by adding the field automorphisms of ${\bf F}_{q^2}$ to $B$. The permutation action corresponds to the natural action on 1-dimensional subspaces of the $n$-dimensional vector space $V$ over the field $K = {\bf F}_{q^2}$, where $n \geq 2$ and $q$ is a prime power. The function returns:

**(a)**
The group $G$;

**(b)**
An indexed set giving the correspondence between the points and the $G$-set of $G$.

<a id="literal-literal-projectivesymplecticgroup-projectivesymplecticgroup-arguments"></a>
#### `ProjectiveSymplecticGroup(arguments)`

<a id="literal-literal-psp-psp-arguments"></a>
#### `PSp(arguments)`

<a id="function-projectivesymplecticgroup-rngintelt-rngintelt"></a>
#### `ProjectiveSymplecticGroup(n, q): RngIntElt, RngIntElt -> GrpPerm, {@ ModTupFldElt @}`

<a id="function-projectivesymplecticgroup-rngintelt-fldfin"></a>
#### `ProjectiveSymplecticGroup(n, K): RngIntElt, FldFin -> GrpPerm, {@ ModTupFldElt @}`

<a id="function-projectivesymplecticgroup-modtuprng"></a>
#### `ProjectiveSymplecticGroup(V): ModTupRng -> GrpPerm, {@ ModTupFldElt @}`

<a id="function-psp-rngintelt-rngintelt"></a>
#### `PSp(n, q): RngIntElt, RngIntElt -> GrpPerm, {@ ModTupFldElt @}`

<a id="function-psp-rngintelt-fldfin"></a>
#### `PSp(n, K): RngIntElt, FldFin -> GrpPerm, {@ ModTupFldElt @}`

<a id="function-psp-modtuprng"></a>
#### `PSp(V): ModTupRng -> GrpPerm, {@ ModTupFldElt @}`

Construct the projective symplectic group $G = {\operatorname{PSp}}(n, q)$, where $K = {\bf F}_{q}$, $V$ is an $n$-dimensional vector space over $K$, and $n$ is an even integer greater than or equal to 4. The function returns:

**(a)**
The group $G$;

**(b)**
An indexed set of the generators of the 1-dimensional subspaces of $K^{(n)}$, giving the correspondence between these vectors and the $G$-set of $G$.

<a id="literal-literal-projectivesigmasymplecticgroup-projectivesigmasymplecticgroup-arguments"></a>
#### `ProjectiveSigmaSymplecticGroup(arguments)`

<a id="literal-literal-psigmasp-psigmasp-arguments"></a>
#### `PSigmaSp(arguments)`

<a id="function-projectivesigmasymplecticgroup-rngintelt-rngintelt"></a>
#### `ProjectiveSigmaSymplecticGroup(n, q): RngIntElt, RngIntElt -> GrpPerm, {@ ModTupFldElt @}`

<a id="function-projectivesigmasymplecticgroup-rngintelt-fldfin"></a>
#### `ProjectiveSigmaSymplecticGroup(n, K): RngIntElt, FldFin -> GrpPerm, {@ ModTupFldElt @}`

<a id="function-projectivesigmasymplecticgroup-modtuprng"></a>
#### `ProjectiveSigmaSymplecticGroup(V): ModTupRng -> GrpPerm, {@ ModTupFldElt @}`

<a id="function-psigmasp-rngintelt-rngintelt"></a>
#### `PSigmaSp(n, q): RngIntElt, RngIntElt -> GrpPerm, {@ ModTupFldElt @}`

<a id="function-psigmasp-rngintelt-fldfin"></a>
#### `PSigmaSp(n, K): RngIntElt, FldFin -> GrpPerm, {@ ModTupFldElt @}`

<a id="function-psigmasp-modtuprng"></a>
#### `PSigmaSp(V): ModTupRng -> GrpPerm, {@ ModTupFldElt @}`

Construct the group $G = {\operatorname{P\Sigma Sp}}(n, q)$ of the projective symplectic group ${\operatorname{PSp}}(n, q)$ extended by field automorphisms of $K = {\bf F}_{q}$, where $V$ is an $n$-dimensional vector space over $K$, and $n$ is an even integer greater than or equal to 4. The function returns:

**(a)**
The group $G$;

**(b)**
An indexed set giving the correspondence between the points and the $G$-set of $G$.

<a id="literal-literal-projectivegeneralorthogonalgroup-projectivegeneralorthogonalgroup-arguments"></a>
#### `ProjectiveGeneralOrthogonalGroup(arguments)`

<a id="literal-literal-pgo-pgo-arguments"></a>
#### `PGO(arguments)`

<a id="function-projectivegeneralorthogonalgroup-rngintelt-rngintelt"></a>
#### `ProjectiveGeneralOrthogonalGroup(n, q): RngIntElt, RngIntElt -> GrpPerm, {@ ModTupFldElt @}`

<a id="function-projectivegeneralorthogonalgroup-rngintelt-fldfin"></a>
#### `ProjectiveGeneralOrthogonalGroup(n, K): RngIntElt, FldFin -> GrpPerm, {@ ModTupFldElt @}`

<a id="function-projectivegeneralorthogonalgroup-modtuprng"></a>
#### `ProjectiveGeneralOrthogonalGroup(V): ModTupRng -> GrpPerm, {@ ModTupFldElt @}`

<a id="function-pgo-rngintelt-rngintelt"></a>
#### `PGO(n, q): RngIntElt, RngIntElt -> GrpPerm, {@ ModTupFldElt @}`

<a id="function-pgo-rngintelt-fldfin"></a>
#### `PGO(n, K): RngIntElt, FldFin -> GrpPerm, {@ ModTupFldElt @}`

<a id="function-pgo-modtuprng"></a>
#### `PGO(V): ModTupRng -> GrpPerm, {@ ModTupFldElt @}`

Construct the projective general orthogonal group $G = {\operatorname{PGO}}(n, q)$, where $K = {\bf F}_{q}$, $V$ is an $n$-dimensional vector space over $K$, and $n$ is an odd integer greater than or equal to 3. The function returns:

**(a)**
The group $G$;

**(b)**
An indexed set of the generators of the 1-dimensional subspaces of $K^{(n)}$, giving the correspondence between these vectors and the $G$-set of $G$.

<a id="literal-literal-projectivegeneralorthogonalgroupplus-projectivegeneralorthogonalgroupplus-arguments"></a>
#### `ProjectiveGeneralOrthogonalGroupPlus(arguments)`

<a id="literal-literal-pgoplus-pgoplus-arguments"></a>
#### `PGOPlus(arguments)`

<a id="function-projectivegeneralorthogonalgroupplus-rngintelt-rngintelt"></a>
#### `ProjectiveGeneralOrthogonalGroupPlus(n, q): RngIntElt, RngIntElt -> GrpPerm, {@ ModTupFldElt @}`

<a id="function-projectivegeneralorthogonalgroupplus-rngintelt-fldfin"></a>
#### `ProjectiveGeneralOrthogonalGroupPlus(n, K): RngIntElt, FldFin -> GrpPerm, {@ ModTupFldElt @}`

<a id="function-projectivegeneralorthogonalgroupplus-modtuprng"></a>
#### `ProjectiveGeneralOrthogonalGroupPlus(V): ModTupRng -> GrpPerm, {@ ModTupFldElt @}`

<a id="function-pgoplus-rngintelt-rngintelt"></a>
#### `PGOPlus(n, q): RngIntElt, RngIntElt -> GrpPerm, {@ ModTupFldElt @}`

<a id="function-pgoplus-rngintelt-fldfin"></a>
#### `PGOPlus(n, K): RngIntElt, FldFin -> GrpPerm, {@ ModTupFldElt @}`

<a id="function-pgoplus-modtuprng"></a>
#### `PGOPlus(V): ModTupRng -> GrpPerm, {@ ModTupFldElt @}`

Construct the projective general orthogonal group $G = {\operatorname{PGO}}^+(n, q)$, where $K = {\bf F}_{q}$, $V$ is an $n$-dimensional vector space over $K$, and $n$ is an even integer greater than or equal to 2. The function returns:

**(a)**
The group $G$;

**(b)**
An indexed set of the generators of the 1-dimensional subspaces of $K^{(n)}$, giving the correspondence between these vectors and the $G$-set of $G$.

<a id="literal-literal-projectivegeneralorthogonalgroupminus-projectivegeneralorthogonalgroupminus-arguments"></a>
#### `ProjectiveGeneralOrthogonalGroupMinus(arguments)`

<a id="literal-literal-pgominus-pgominus-arguments"></a>
#### `PGOMinus(arguments)`

<a id="function-projectivegeneralorthogonalgroupminus-rngintelt-rngintelt"></a>
#### `ProjectiveGeneralOrthogonalGroupMinus(n, q): RngIntElt, RngIntElt -> GrpPerm, {@ ModTupFldElt @}`

<a id="function-projectivegeneralorthogonalgroupminus-rngintelt-fldfin"></a>
#### `ProjectiveGeneralOrthogonalGroupMinus(n, K): RngIntElt, FldFin -> GrpPerm, {@ ModTupFldElt @}`

<a id="function-projectivegeneralorthogonalgroupminus-modtuprng"></a>
#### `ProjectiveGeneralOrthogonalGroupMinus(V): ModTupRng -> GrpPerm, {@ ModTupFldElt @}`

<a id="function-pgominus-rngintelt-rngintelt"></a>
#### `PGOMinus(n, q): RngIntElt, RngIntElt -> GrpPerm, {@ ModTupFldElt @}`

<a id="function-pgominus-rngintelt-fldfin"></a>
#### `PGOMinus(n, K): RngIntElt, FldFin -> GrpPerm, {@ ModTupFldElt @}`

<a id="function-pgominus-modtuprng"></a>
#### `PGOMinus(V): ModTupRng -> GrpPerm, {@ ModTupFldElt @}`

Construct the projective general orthogonal group $G = {\operatorname{PGO}}^-(n, q)$, where $K = {\bf F}_{q}$, $V$ is an $n$-dimensional vector space over $K$, and $n$ is an even integer greater than or equal to 2. The function returns:

**(a)**
The group $G$;

**(b)**
An indexed set of the generators of the 1-dimensional subspaces of $K^{(n)}$, giving the correspondence between these vectors and the $G$-set of $G$.

<a id="literal-literal-projectivespecialorthogonalgroup-projectivespecialorthogonalgroup-arguments"></a>
#### `ProjectiveSpecialOrthogonalGroup(arguments)`

<a id="literal-literal-pso-pso-arguments"></a>
#### `PSO(arguments)`

<a id="function-projectivespecialorthogonalgroup-rngintelt-rngintelt"></a>
#### `ProjectiveSpecialOrthogonalGroup(n, q): RngIntElt, RngIntElt -> GrpPerm, {@ ModTupFldElt @}`

<a id="function-projectivespecialorthogonalgroup-rngintelt-fldfin"></a>
#### `ProjectiveSpecialOrthogonalGroup(n, K): RngIntElt, FldFin -> GrpPerm, {@ ModTupFldElt @}`

<a id="function-projectivespecialorthogonalgroup-modtuprng"></a>
#### `ProjectiveSpecialOrthogonalGroup(V): ModTupRng -> GrpPerm, {@ ModTupFldElt @}`

<a id="function-pso-rngintelt-rngintelt"></a>
#### `PSO(n, q): RngIntElt, RngIntElt -> GrpPerm, {@ ModTupFldElt @}`

<a id="function-pso-rngintelt-fldfin"></a>
#### `PSO(n, K): RngIntElt, FldFin -> GrpPerm, {@ ModTupFldElt @}`

<a id="function-pso-modtuprng"></a>
#### `PSO(V): ModTupRng -> GrpPerm, {@ ModTupFldElt @}`

Construct the projective special orthogonal group $G = {\operatorname{PSO}}(n, q)$, where $K = {\bf F}_{q}$, $V$ is an $n$-dimensional vector space over $K$, and $n$ is an odd integer greater than or equal to 3. The function returns:

**(a)**
The group $G$;

**(b)**
An indexed set of the generators of the 1-dimensional subspaces of $K^{(n)}$, giving the correspondence between these vectors and the $G$-set of $G$.

<a id="literal-literal-projectivespecialorthogonalgroupplus-projectivespecialorthogonalgroupplus-arguments"></a>
#### `ProjectiveSpecialOrthogonalGroupPlus(arguments)`

<a id="literal-literal-psoplus-psoplus-arguments"></a>
#### `PSOPlus(arguments)`

<a id="function-projectivespecialorthogonalgroupplus-rngintelt-rngintelt"></a>
#### `ProjectiveSpecialOrthogonalGroupPlus(n, q): RngIntElt, RngIntElt -> GrpPerm, {@ ModTupFldElt @}`

<a id="function-projectivespecialorthogonalgroupplus-rngintelt-fldfin"></a>
#### `ProjectiveSpecialOrthogonalGroupPlus(n, K): RngIntElt, FldFin -> GrpPerm, {@ ModTupFldElt @}`

<a id="function-projectivespecialorthogonalgroupplus-modtuprng"></a>
#### `ProjectiveSpecialOrthogonalGroupPlus(V): ModTupRng -> GrpPerm, {@ ModTupFldElt @}`

<a id="function-psoplus-rngintelt-rngintelt"></a>
#### `PSOPlus(n, q): RngIntElt, RngIntElt -> GrpPerm, {@ ModTupFldElt @}`

<a id="function-psoplus-rngintelt-fldfin"></a>
#### `PSOPlus(n, K): RngIntElt, FldFin -> GrpPerm, {@ ModTupFldElt @}`

<a id="function-psoplus-modtuprng"></a>
#### `PSOPlus(V): ModTupRng -> GrpPerm, {@ ModTupFldElt @}`

Construct the projective special orthogonal group $G = {\operatorname{PSO}}^+(n, q)$, where $K = {\bf F}_{q}$, $V$ is an $n$-dimensional vector space over $K$, and $n$ is an even integer greater than or equal to 2. The function returns:

**(a)**
The group $G$;

**(b)**
An indexed set of the generators of the 1-dimensional subspaces of $K^{(n)}$, giving the correspondence between these vectors and the $G$-set of $G$.

<a id="literal-literal-projectivespecialorthogonalgroupminus-projectivespecialorthogonalgroupminus-arguments"></a>
#### `ProjectiveSpecialOrthogonalGroupMinus(arguments)`

<a id="literal-literal-psominus-psominus-arguments"></a>
#### `PSOMinus(arguments)`

<a id="function-projectivespecialorthogonalgroupminus-rngintelt-rngintelt"></a>
#### `ProjectiveSpecialOrthogonalGroupMinus(n, q): RngIntElt, RngIntElt -> GrpPerm, {@ ModTupFldElt @}`

<a id="function-projectivespecialorthogonalgroupminus-rngintelt-fldfin"></a>
#### `ProjectiveSpecialOrthogonalGroupMinus(n, K): RngIntElt, FldFin -> GrpPerm, {@ ModTupFldElt @}`

<a id="function-projectivespecialorthogonalgroupminus-modtuprng"></a>
#### `ProjectiveSpecialOrthogonalGroupMinus(V): ModTupRng -> GrpPerm, {@ ModTupFldElt @}`

<a id="function-psominus-rngintelt-rngintelt"></a>
#### `PSOMinus(n, q): RngIntElt, RngIntElt -> GrpPerm, {@ ModTupFldElt @}`

<a id="function-psominus-rngintelt-fldfin"></a>
#### `PSOMinus(n, K): RngIntElt, FldFin -> GrpPerm, {@ ModTupFldElt @}`

<a id="function-psominus-modtuprng"></a>
#### `PSOMinus(V): ModTupRng -> GrpPerm, {@ ModTupFldElt @}`

Construct the projective general orthogonal group $G = {\operatorname{PSO}}^-(n, q)$, where $K = {\bf F}_{q}$, $V$ is an $n$-dimensional vector space over $K$, and $n$ is an even integer greater than or equal to 2. The function returns:

**(a)**
The group $G$;

**(b)**
An indexed set of the generators of the 1-dimensional subspaces of $K^{(n)}$, giving the correspondence between these vectors and the $G$-set of $G$.

<a id="literal-literal-projectiveomega-projectiveomega-arguments"></a>
#### `ProjectiveOmega(arguments)`

<a id="literal-literal-pomega-pomega-arguments"></a>
#### `POmega(arguments)`

<a id="function-projectiveomega-rngintelt-rngintelt"></a>
#### `ProjectiveOmega(n, q): RngIntElt, RngIntElt -> GrpPerm, {@ ModTupFldElt @}`

<a id="function-projectiveomega-rngintelt-fldfin"></a>
#### `ProjectiveOmega(n, K): RngIntElt, FldFin -> GrpPerm, {@ ModTupFldElt @}`

<a id="function-projectiveomega-modtuprng"></a>
#### `ProjectiveOmega(V): ModTupRng -> GrpPerm, {@ ModTupFldElt @}`

<a id="function-pomega-rngintelt-rngintelt"></a>
#### `POmega(n, q): RngIntElt, RngIntElt -> GrpPerm, {@ ModTupFldElt @}`

<a id="function-pomega-rngintelt-fldfin"></a>
#### `POmega(n, K): RngIntElt, FldFin -> GrpPerm, {@ ModTupFldElt @}`

<a id="function-pomega-modtuprng"></a>
#### `POmega(V): ModTupRng -> GrpPerm, {@ ModTupFldElt @}`

Construct the projective orthogonal group $G = {\operatorname{P}\Omega}(n, q)$, where $K = {\bf F}_{q}$, $V$ is an $n$-dimensional vector space over $K$, and $n$ is an odd integer greater than or equal to 3. The function returns:

**(a)**
The group $G$;

**(b)**
An indexed set of the generators of the 1-dimensional subspaces of $K^{(n)}$, giving the correspondence between these vectors and the $G$-set of $G$.

<a id="literal-literal-projectiveomegaplus-projectiveomegaplus-arguments"></a>
#### `ProjectiveOmegaPlus(arguments)`

<a id="literal-literal-pomegaplus-pomegaplus-arguments"></a>
#### `POmegaPlus(arguments)`

<a id="function-projectiveomegaplus-rngintelt-rngintelt"></a>
#### `ProjectiveOmegaPlus(n, q): RngIntElt, RngIntElt -> GrpPerm, {@ ModTupFldElt @}`

<a id="function-projectiveomegaplus-rngintelt-fldfin"></a>
#### `ProjectiveOmegaPlus(n, K): RngIntElt, FldFin -> GrpPerm, {@ ModTupFldElt @}`

<a id="function-projectiveomegaplus-modtuprng"></a>
#### `ProjectiveOmegaPlus(V): ModTupRng -> GrpPerm, {@ ModTupFldElt @}`

<a id="function-pomegaplus-rngintelt-rngintelt"></a>
#### `POmegaPlus(n, q): RngIntElt, RngIntElt -> GrpPerm, {@ ModTupFldElt @}`

<a id="function-pomegaplus-rngintelt-fldfin"></a>
#### `POmegaPlus(n, K): RngIntElt, FldFin -> GrpPerm, {@ ModTupFldElt @}`

<a id="function-pomegaplus-modtuprng"></a>
#### `POmegaPlus(V): ModTupRng -> GrpPerm, {@ ModTupFldElt @}`

Construct the projective orthogonal group $G = {\operatorname{P}\Omega}(n, q)$, where $K = {\bf F}_{q}$, $V$ is an $n$-dimensional vector space over $K$, and $n$ is an even integer greater than or equal to 2. The function returns:

**(a)**
The group $G$;

**(b)**
An indexed set of the generators of the 1-dimensional subspaces of $K^{(n)}$, giving the correspondence between these vectors and the $G$-set of $G$.

<a id="literal-literal-projectiveomegaminus-projectiveomegaminus-arguments"></a>
#### `ProjectiveOmegaMinus(arguments)`

<a id="literal-literal-pomegaminus-pomegaminus-arguments"></a>
#### `POmegaMinus(arguments)`

<a id="function-projectiveomegaminus-rngintelt-rngintelt"></a>
#### `ProjectiveOmegaMinus(n, q): RngIntElt, RngIntElt -> GrpPerm, {@ ModTupFldElt @}`

<a id="function-projectiveomegaminus-rngintelt-fldfin"></a>
#### `ProjectiveOmegaMinus(n, K): RngIntElt, FldFin -> GrpPerm, {@ ModTupFldElt @}`

<a id="function-projectiveomegaminus-modtuprng"></a>
#### `ProjectiveOmegaMinus(V): ModTupRng -> GrpPerm, {@ ModTupFldElt @}`

<a id="function-pomegaminus-rngintelt-rngintelt"></a>
#### `POmegaMinus(n, q): RngIntElt, RngIntElt -> GrpPerm, {@ ModTupFldElt @}`

<a id="function-pomegaminus-rngintelt-fldfin"></a>
#### `POmegaMinus(n, K): RngIntElt, FldFin -> GrpPerm, {@ ModTupFldElt @}`

<a id="function-pomegaminus-modtuprng"></a>
#### `POmegaMinus(V): ModTupRng -> GrpPerm, {@ ModTupFldElt @}`

Construct the projective orthogonal group $G = {\operatorname{P}\Omega}(n, q)$, where $K = {\bf F}_{q}$, $V$ is an $n$-dimensional vector space over $K$, and $n$ is an even integer greater than or equal to 2. The function returns:

**(a)**
The group $G$;

**(b)**
An indexed set of the generators of the 1-dimensional subspaces of $K^{(n)}$, giving the correspondence between these vectors and the $G$-set of $G$.

<a id="literal-literal-projectivesuzukigroup-projectivesuzukigroup-arguments"></a>
#### `ProjectiveSuzukiGroup(arguments)`

<a id="literal-literal-psz-psz-arguments"></a>
#### `PSz(arguments)`

<a id="function-projectivesuzukigroup-rngintelt"></a>
#### `ProjectiveSuzukiGroup(q): RngIntElt -> GrpPerm, {@ ModTupFldElt @}`

<a id="function-projectivesuzukigroup-fldfin"></a>
#### `ProjectiveSuzukiGroup(K): FldFin -> GrpPerm, {@ ModTupFldElt @}`

<a id="function-projectivesuzukigroup-modtuprng"></a>
#### `ProjectiveSuzukiGroup(V): ModTupRng -> GrpPerm, {@ ModTupFldElt @}`

<a id="function-psz-rngintelt"></a>
#### `PSz(q): RngIntElt -> GrpPerm, {@ ModTupFldElt @}`

<a id="function-psz-fldfin"></a>
#### `PSz(K): FldFin -> GrpPerm, {@ ModTupFldElt @}`

<a id="function-psz-modtuprng"></a>
#### `PSz(V): ModTupRng -> GrpPerm, {@ ModTupFldElt @}`

Construct the permutation representation $G = {\operatorname{PSz}}(q)$ of the Suzuki simple group ${\operatorname{Sz}}(q)$, given by its action on projective points, where $q$ is of the form $2^{2n+1}$. If $K$ is given, its cardinality is $q$. If $V$ is given, it must be 4-dimensional, and over $K$. The function returns:

**(a)**
The group $G$;

**(b)**
An indexed set of the generators of the 1-dimensional subspaces of $K^{(n)}$, giving the correspondence between these vectors and the $G$-set of $G$.

<a id="function-affinegroup-grpmat-fldfin"></a>
#### `AffineGroup(M): GrpMat[FldFin] -> GrpPerm, {@ ModTupFldElt @}`

Given a matrix group of degree $d$ over a finite field $F$, construct the semidirect product $V:M$, where $V=F^d$ is the natural $M$-module. The result $G$ is a standard permutation group of degree $|V| = |F|^d$, where the second return value gives the correspondence between the elements of $V$ and the standard $G$-set.

### Permutation Group Databases

Magma includes databases that contain all transitive permutation groups of degree up to 32 and all primitive permutation groups of degree up to 4095. Descriptions of these databases may be found in Chapter [Databases of Groups](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/index-databases-of-groups.md#chapgrpdata).

### Ordering of Permutation Groups

Magma has an implementation of the Hulpke–Linton algorithm for a lexicographically least generating set of a permutation group [[HL03](https://docs.magma-maths.org/references.md#cite-hulpkelinton)]. The underlying point ordering is as given by the `Labelling` intrinsic function. This generating set is used internally by Magma for fast access in sets of permutation groups. Direct access is possible by the intrinsic functions below.

<a id="function-canonicalgenerators-grpperm"></a>
#### `CanonicalGenerators(G): GrpPerm -> SeqEnum[GrpPermElt], GrpPermElt`

Returns the sequence of lexicographically minimal generators of $G$ as described in [[HL03](https://docs.magma-maths.org/references.md#cite-hulpkelinton)]. The underlying point order is as given by the `Labelling` intrinsic function. Two subgroups of the same symmetric group are equal if and only if the two lexicographically minimal generating sequences are equal. The second return value is the lexicographically last group element. This may be used to construct a linear ordering of subgroups compatible with the standard subset ordering (see Lemma 6 of *op. cit.*).

<a id="function-canonicalinvariant-grpperm"></a>
#### `CanonicalInvariant(G): GrpPerm -> SeqEnum[SeqEnum], Seqenum`

Return the same permutations as `CanonicalGenerators` but as sequences which may be tested easily for equality and lexicographic ordering.

<a id="example-ex-3ece73"></a>
#### `Example: Canonical Generators (ex-3ece73)`

We take a transitive group and a random subgroup and compare their canonical generating sets.

```magma
> G := TransitiveGroup(6,4);
> G;
Permutation group G acting on a set of cardinality 6
Order = 12 = 2^2 * 3
  (1, 4)(2, 5)
  (1, 3, 5)(2, 4, 6)
> CanonicalGenerators(G);
[
  (2, 5)(3, 6),
  (1, 2, 3)(4, 5, 6)
]
(1, 6, 5)(2, 4, 3)
> H := sub<G|Random(G), Random(G)>;
> H;
Permutation group H acting on a set of cardinality 6
  (1, 6, 2)(3, 5, 4)
  (1, 5, 6)(2, 3, 4)
> CanonicalGenerators(H);
[
  (2, 5)(3, 6),
  (1, 2, 3)(4, 5, 6)
]
(1, 6, 5)(2, 4, 3)
```

The equality of the canonical generators shows that $G$ equals $H$, despite different defining generators.

### Ordered Partition Stacks

Ordered partition stacks have been implemented with their own type and Magma intrinsics. They implement the data structure described very briefly in section 2 of Jeff Leon’s 1997 paper [[Leo97](https://docs.magma-maths.org/references.md#cite-leon2)]. They can be used as an aid to implementing various backtrack searches in the Magma language.

The domain set of the partitions is always $\{1..n\}$, where $n$ is called the degree of the stack. The basic “push” operation for these stacks involves refining an ordered partition, and the precise definition of refinement used in the Magma implementation is Definition 2 of [[Leo97](https://docs.magma-maths.org/references.md#cite-leon2)]. This differs from the definition in Chapter 9 of [[Ser03](https://docs.magma-maths.org/references.md#cite-seress2003)], for instance.

The word “ordered” refers to the cells of the partition being in a fixed order. The order of points in a cell is not significant, and may vary as the data structure is manipulated.

#### Construction of Ordered Partition Stacks

<a id="function-orderedpartitionstack-rngintelt"></a>
##### `OrderedPartitionStack(n): RngIntElt -> StkPtnOrd`

Create a data structure representing a complete ordered partition stack of degree $n$. Initially the stack has one partition on it, which is the partition having a single block.

<a id="function-orderedpartitionstackzero-rngintelt-rngintelt"></a>
##### `OrderedPartitionStackZero(n, h): RngIntElt, RngIntElt -> StkPtnOrd`

Create a data structure representing a zero-based ordered partition stack of degree $n$ with height limited to $h$. Initially the stack has one partition on it, which is the partition having a single block, and has height $0$.

#### Properties of Ordered Partition Stacks

<a id="function-degree-stkptnord"></a>
##### `Degree(P): StkPtnOrd -> RngIntElt`

The degree of the ordered partition stack $P$.

<a id="function-height-stkptnord"></a>
##### `Height(P): StkPtnOrd -> RngIntElt`

The height of the ordered partition stack $P$. For a complete stack, this equals the number of cells of the finest partition on the stack.

<a id="function-numberofcells-stkptnord-rngintelt"></a>
##### `NumberOfCells(P, h): StkPtnOrd, RngIntElt -> RngIntElt`

<a id="function-numberofcells-stkptnord"></a>
##### `NumberOfCells(P): StkPtnOrd -> RngIntElt`

The number of cells in the partition on stack $P$ at height $h$. If $h$ is omitted it is taken to be the height of $P$, so giving the number of cells in the finest partition on the stack $P$.

<a id="function-cellnumber-stkptnord-rngintelt-rngintelt"></a>
##### `CellNumber(P, h, x): StkPtnOrd, RngIntElt, RngIntElt -> RngIntElt`

<a id="function-cellnumber-stkptnord-rngintelt"></a>
##### `CellNumber(P, x): StkPtnOrd, RngIntElt -> RngIntElt`

The number of the cell of the partition at height $h$ in $P$ that contains the element $x$. If $h$ is omitted it is taken to be the height of $P$.

<a id="function-cellsize-stkptnord-rngintelt-rngintelt"></a>
##### `CellSize(P, h, i): StkPtnOrd, RngIntElt, RngIntElt -> RngIntElt`

<a id="function-cellsize-stkptnord-rngintelt"></a>
##### `CellSize(P, i): StkPtnOrd, RngIntElt -> RngIntElt`

The size of cell $i$ of the partition at height $h$ in $P$. If $h$ is omitted it is taken to be the height of $P$.

<a id="function-cell-stkptnord-rngintelt-rngintelt"></a>
##### `Cell(P, h, i): StkPtnOrd, RngIntElt, RngIntElt -> SeqEnum`

<a id="function-cell-stkptnord-rngintelt"></a>
##### `Cell(P, i): StkPtnOrd, RngIntElt -> SeqEnum`

The contents of cell $i$ of the partition at height $h$ in $P$ as a sequence of integers. If $h$ is omitted it is taken to be the height of $P$. Note that the order of the points in the returned sequence may vary, as the order of points in a cell of an ordered partition is not fixed.

<a id="function-random-stkptnord-rngintelt"></a>
##### `Random(P, i): StkPtnOrd, RngIntElt -> RngIntElt`

A random element of cell $i$ of the finest partition on $P$.

<a id="function-representative-stkptnord-rngintelt"></a>
##### `Representative(P, i): StkPtnOrd, RngIntElt -> RngIntElt`

<a id="function-rep-stkptnord-rngintelt"></a>
##### `Rep(P, i): StkPtnOrd, RngIntElt -> RngIntElt`

An element of cell $i$ of the finest partition on $P$.

<a id="function-parentcell-stkptnord-rngintelt"></a>
##### `ParentCell(P, i): StkPtnOrd, RngIntElt -> RngIntElt`

The number of the cell that was split to first create cell number $i$.

#### Operations on Ordered Partition Stacks

Here are listed the basic operations provided for pushing a finer partition onto an ordered partition stack, called splitting, and for popping ordered partitions off the stack.

If the top partition on the stack has $k$ cells, and one of these cells is split to form a finer partition, then the new cell will have number $k+1$, and the residue of the split cell will have the same number as the cell that was split. This agrees with the definition of refinement given in [[Leo97](https://docs.magma-maths.org/references.md#cite-leon2)], Definition 2, but disagrees with [[Ser03](https://docs.magma-maths.org/references.md#cite-seress2003)], Chapter 9.2, and [[McK81](https://docs.magma-maths.org/references.md#cite-bdm-nauty-paper)].

<a id="function-splitcell-stkptnord-rngintelt-rngintelt"></a>
##### `SplitCell(P, i, x): StkPtnOrd, RngIntElt, RngIntElt -> BoolElt`

<a id="function-splitcell-stkptnord-rngintelt-seqenum-rngintelt"></a>
##### `SplitCell(P, i, Q): StkPtnOrd, RngIntElt, SeqEnum[RngIntElt] -> BoolElt`

Attempt to refine the top partition on stack $P$ by splitting cell $i$. The new cell created will be $\{x\}$ if $x$ is in cell $i$, or will be the intersection of $Q$ with cell $i$ (in the second form), if this is not empty and not all of cell $i$. The new partition, if any, is pushed onto the stack. The return value is true when $P$ is changed, false otherwise. This implements the operation in Definition 6 of [[Leo97](https://docs.magma-maths.org/references.md#cite-leon2)].

<a id="function-splitallbyvalues-stkptnord-seqenum-rngintelt"></a>
##### `SplitAllByValues(P, V): StkPtnOrd, SeqEnum[RngIntElt] -> BoolElt, RngIntElt`

Refine the top partition on stack $P$ by splitting all possible cells using the values in $V$. This implements the operation given in Definition 15 of [[Leo97](https://docs.magma-maths.org/references.md#cite-leon2)]. Cells are split in increasing order of cell number, and the resulting new cells are in the curious order given in the cited definition.

The first return value is `true` when $P$ is changed, `false` otherwise. The second is a hash value based on which cells are split, the values from $V$ used in the split, and the sizes of the resulting cells. It is suitable for use as an indicator function, as defined in 2-16 of [[McK81](https://docs.magma-maths.org/references.md#cite-bdm-nauty-paper)].

<a id="function-splitcellsbyvalues-stkptnord-seqenum-rngintelt-seqenum-rngintelt"></a>
##### `SplitCellsByValues(P, C, V): StkPtnOrd, SeqEnum[RngIntElt], SeqEnum[RngIntElt] -> BoolElt, RngIntElt`

<a id="function-splitcellsbyvalues-stkptnord-rngintelt-seqenum-rngintelt"></a>
##### `SplitCellsByValues(P, i, V): StkPtnOrd, RngIntElt, SeqEnum[RngIntElt] -> BoolElt, RngIntElt`

Refine the top partition on stack $P$ by splitting all cells given in $C$, or cell $i$, using the values in $V$. Splitting and return values are as for `SplitAllByValues`, with an important difference: cells will be split in the order given in $C$, and, if some cell in $C$ does not split, the operation will be terminated there, and `false` returned.

<a id="procedure-pop-stkptnord"></a>
##### `Pop(P): StkPtnOrd`

<a id="procedure-pop-stkptnord-rngintelt"></a>
##### `Pop(P, h): StkPtnOrd, RngIntElt`

Reduce the height of the partition stack $P$ to height $h$, or by one if $h$ is not given. The method used is the “retract” algorithm of [[Leo97](https://docs.magma-maths.org/references.md#cite-leon2)], Fig. 7.

<a id="procedure-advance-stkptnord-seqenum-rngintelt-stkptnord-rngintelt"></a>
##### `Advance(X, L, P, h): StkPtnOrd, SeqEnum[RngIntElt], StkPtnOrd, RngIntElt`

This implements the “advance” algorithm of [[Leo97](https://docs.magma-maths.org/references.md#cite-leon2)], Fig. 7: $X$ is a zero-based stack of degree $d$ say, $L$ is a sequence of length $n$ taking values in $\{1..d\}$, representing an unordered partition of $\{1..n\}$ into $d$ blocks, $P$ is a complete stack of degree $n$, and $h$ is a positive integer which is at most the height of $P$. This is a fundamental operation in Leon’s unordered partition stabilizer algorithm.

<a id="example-ex-23b5b0"></a>
##### `Example: Operations on an Ordered Partition Stack (ex-23b5b0)`

We set up an ordered partition stack of degree 12, and try out a few basic operations on it. The printing of a stack shows the top partition of the stack.

```magma
> P := OrderedPartitionStack(12);
> P;
Partn stack, degree 12, height 1
[ 1 2 3 4 5 6 7 8 9 10 11 12]
> SplitCell(P, 1, 4);
true
> P;
Partn stack, degree 12, height 2
[ 1 2 3 12 5 6 7 8 9 10 11 | 4]
```

Note that the order of the points in cell 1 is not significant. Now we will split on the values in a vector $V$.

```magma
> V := [i mod 5 + 1: i in [0..11]];
> V;
[ 1, 2, 3, 4, 5, 1, 2, 3, 4, 5, 1, 2 ]
> SplitAllByValues(P, V);
true 119375796
> P;
Partn stack, degree 12, height 6
[ 1 6 11 | 4 | 10 5 | 9 | 8 3 | 12 2 7]
```

Only cell 1 has been split. The points corresponding to the minimum value in $V$ remain in cell 1. The new cells are cells 2 to 6. They correspond to the higher values in $V$, in descending order. Now pop the stack back to height 4 and try the effect of a different split by values.

```magma
> Pop(P, 4);
> P;
Partn stack, degree 12, height 4
[ 1 6 11 12 2 7 8 3 | 4 | 10 5 | 9]
> V := [i mod 4 + 1: i in [0..11]];
> V;
[ 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4 ]
> SplitAllByValues(P, V);
true 985543242
> P;
Partn stack, degree 12, height 8
[ 1 | 4 | 5 | 9 | 8 12 | 11 7 3 | 6 2 | 10]
> Pop(P, 3);
> P;
Partn stack, degree 12, height 3
[ 1 6 2 11 7 3 8 12 9 | 4 | 5 10]
```

<a id="matrix"></a>
<a id="chapgrpmat"></a>
## Matrix Groups over General Rings

- [Introduction](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/introduction.md)
  - [Introduction to Matrix Groups](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/introduction.md#introduction-to-matrix-groups)
  - [The Support](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/introduction.md#the-support)
  - [The Category of Matrix Groups](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/introduction.md#the-category-of-matrix-groups)
  - [The Construction of a Matrix Group](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/introduction.md#the-construction-of-a-matrix-group)
- [Creation of a Matrix Group](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/creation-general-linear-group.md)
  - [Construction of the General Linear Group](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/creation-general-linear-group.md#construction-of-the-general-linear-group)
    - [`GeneralLinearGroup(n, R): RngIntElt, Rng → GrpMat`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/creation-general-linear-group.md#function-generallineargroup-rngintelt-rng)
    - [`GL(n, R): RngIntElt, Rng → GrpMat`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/creation-general-linear-group.md#function-gl-rngintelt-rng)
    - [Example: Constructing GL(3, 4)](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/creation-general-linear-group.md#example-ex-59ac81)
  - [Construction of a Matrix Group Element](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/creation-general-linear-group.md#construction-of-a-matrix-group-element)
    - [`elt< G | L >: GrpMat, List(RngElt) → GrpMatElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/creation-general-linear-group.md#constructor-constructor-elt-grpmat-list-rngelt-grpmatelt)
    - [`G ! Q: GrpMat, [ RngElt ] → GrpMatElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/creation-general-linear-group.md#operation-op-grpmat-rngelt)
    - [`ElementToSequence(g): GrpMatElt → [ RngElt ]`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/creation-general-linear-group.md#function-elementtosequence-grpmatelt)
    - [`Eltseq(g): GrpMatElt → [ RngElt ]`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/creation-general-linear-group.md#function-eltseq-grpmatelt)
    - [`Identity(G): GrpMat → GrpMatElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/creation-general-linear-group.md#function-identity-grpmat)
    - [`Id(G): GrpMat → GrpMatElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/creation-general-linear-group.md#function-id-grpmat)
    - [`G ! 1: GrpMat, RngIntElt → GrpMatElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/creation-general-linear-group.md#operation-op-grpmat-rngintelt)
    - [Example: Elements of GL(3, 4)](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/creation-general-linear-group.md#example-ex-da01c4)
  - [Construction of a General Matrix Group](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/creation-general-linear-group.md#construction-of-a-general-matrix-group)
    - [`MatrixGroup< n, R | L >: RngIntElt, Rng, List → GrpMat`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/creation-general-linear-group.md#constructor-constructor-matrixgroup-rngintelt-rng-list-grpmat)
    - [Example: Subgroup of GL(3, 4) by Generators](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/creation-general-linear-group.md#example-ex-383e20)
    - [Example: Sylow Subgroup of a General Linear Group](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/creation-general-linear-group.md#example-ex-0a504f)
  - [Changing Rings](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/creation-general-linear-group.md#changing-rings)
    - [`ChangeRing(G, S): GrpMat, Rng → GrpMat, Map`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/creation-general-linear-group.md#function-changering-grpmat-rng)
    - [`ChangeRing(G, S, f): GrpMat, Rng, Map → GrpMat, Map`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/creation-general-linear-group.md#function-changering-grpmat-rng-map)
    - [`RestrictField(G, S): GrpMat, FldFin → GrpMat, Map`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/creation-general-linear-group.md#function-restrictfield-grpmat-fldfin)
    - [`ExtendField(G, L): GrpMat, FldFin → GrpMat, Map`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/creation-general-linear-group.md#function-extendfield-grpmat-fldfin)
  - [Coercion between Matrix Structures](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/creation-general-linear-group.md#coercion-between-matrix-structures)
    - [`R ! g: AlgMat, GrpMatElt → RngMatElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/creation-general-linear-group.md#operation-op-algmat-grpmatelt)
    - [`G ! r: GrpMat, AlgMatElt → GrpMatElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/creation-general-linear-group.md#operation-op-grpmat-algmatelt)
    - [`M ! g: ModMatRng, GrpMatElt → ModMatRngElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/creation-general-linear-group.md#operation-op-modmatrng-grpmatelt)
    - [`G ! m: GrpMat, ModMatRngElt → GrpMatElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/creation-general-linear-group.md#operation-op-grpmat-modmatrngelt)
    - [`ProjectionLocalization(g, pi): GrpMatElt, Map → GrpMatElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/creation-general-linear-group.md#function-projectionlocalization-grpmatelt-map)
  - [Accessing Associated Structures](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/creation-general-linear-group.md#accessing-associated-structures)
    - [`G . i: GrpMat, RngIntElt → GrpMatElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/creation-general-linear-group.md#operation-operation-grpmat-rngintelt-grpmatelt)
    - [`Degree(G): GrpMat → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/creation-general-linear-group.md#function-degree-grpmat)
    - [`Generators(G): GrpMat → { GrpMatElt }`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/creation-general-linear-group.md#function-generators-grpmat)
    - [`NumberOfGenerators(G): GrpMat → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/creation-general-linear-group.md#function-numberofgenerators-grpmat)
    - [`Ngens(G): GrpMat → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/creation-general-linear-group.md#function-ngens-grpmat)
    - [`CoefficientRing(G): GrpMat → Rng`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/creation-general-linear-group.md#function-coefficientring-grpmat)
    - [`BaseRing(G): GrpMat → Rng`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/creation-general-linear-group.md#function-basering-grpmat)
    - [`RSpace(G): GrpMat → ModTupRng`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/creation-general-linear-group.md#function-rspace-grpmat)
    - [`VectorSpace(G): GrpMat → ModTupFld`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/creation-general-linear-group.md#function-vectorspace-grpmat)
    - [`GModule(G): GrpMat → ModGrp`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/creation-general-linear-group.md#function-gmodule-grpmat)
    - [`Generic(G): GrpMat → GrpMat`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/creation-general-linear-group.md#function-generic-grpmat)
    - [`Parent(G): GrpMatElt → GrpMat`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/creation-general-linear-group.md#function-parent-grpmatelt)
- [Homomorphisms](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/homomorphism.md)
  - [`hom<G -> H | L>: GrpMat, Grp, List → Map`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/homomorphism.md#constructor-constructor-hom-grpmat-grp-list-map)
  - [`Domain(f): Map → Grp`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/homomorphism.md#function-domain-map)
  - [`Codomain(f): Map → Grp`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/homomorphism.md#function-codomain-map)
  - [`Image(f): Map → Grp`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/homomorphism.md#function-image-map)
  - [`Kernel(f): Map → Grp`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/homomorphism.md#function-kernel-map)
  - [`IsHomomorphism(G, H, Q): GrpMat, GrpMat, SeqEnum[GrpMatElt] → Bool, Map`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/homomorphism.md#function-ishomomorphism-grpmat-grpmat-seqenum-grpmatelt)
  - [Example: Dihedral Group to Symmetric Group](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/homomorphism.md#example-ex-868ec0)
  - [`PermutationRepresentation(G): GrpMat → Map, GrpPerm, GrpMat`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/homomorphism.md#function-permutationrepresentation-grpmat)
  - [Example: Permutation Representation of SL(4, 5)](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/homomorphism.md#example-ex-2bcb12)
  - [Construction of Extensions](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/homomorphism.md#construction-of-extensions)
    - [`DirectProduct(G, H): GrpMat, GrpMat → GrpMat`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/homomorphism.md#function-directproduct-grpmat-grpmat)
    - [`DirectProduct(Q): [ GrpMat ] → GrpMat`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/homomorphism.md#function-directproduct-grpmat)
    - [`SemiLinearGroup(G, S): GrpMat, FldFin → GrpMat`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/homomorphism.md#function-semilineargroup-grpmat-fldfin)
    - [`TensorWreathProduct(G, H): GrpMat, GrpPerm → GrpMat`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/homomorphism.md#function-tensorwreathproduct-grpmat-grpperm)
    - [`WreathProduct(G, H): GrpMat, GrpPerm → GrpMat`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/homomorphism.md#function-wreathproduct-grpmat-grpperm)
    - [Example: Direct, Tensor, and Wreath Products](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/homomorphism.md#example-ex-112242)
- [Operations on Matrices](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/operation-element.md)
  - [Arithmetic with Matrices](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/operation-element.md#arithmetic-with-matrices)
    - [`g * h: GrpMatElt, GrpMatElt → GrpMatElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/operation-element.md#operation-op-times-grpmatelt-grpmatelt)
    - [`g ^ n: GrpMatElt, RngIntElt → GrpMatElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/operation-element.md#operation-op-pow-grpmatelt-rngintelt)
    - [`g / h: GrpMatElt, GrpMatElt → GrpMatElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/operation-element.md#operation-op-div-grpmatelt-grpmatelt)
    - [`g ^ h: GrpMatElt, GrpMatElt → GrpMatElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/operation-element.md#operation-op-pow-grpmatelt-grpmatelt)
    - [`(g, h): GrpMatElt, GrpMatElt → GrpMatElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/operation-element.md#literal-literal-g-h-grpmatelt-grpmatelt-grpmatelt)
    - [`(g₁, ..., gᵣ): GrpMatElt, ..., GrpMatElt → GrpMatElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/operation-element.md#literal-literal-g1-gr-grpmatelt-grpmatelt-grpmatelt)
    - [Example: Arithmetic with Matrices in GL(3, 4)](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/operation-element.md#example-ex-383e92)
  - [Predicates for Matrices](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/operation-element.md#predicates-for-matrices)
    - [`g eq h: GrpMatElt, GrpMatElt → BoolElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/operation-element.md#operation-op-eq-grpmatelt-grpmatelt)
    - [`g ne h: GrpMatElt, GrpMatElt → BoolElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/operation-element.md#operation-op-ne-grpmatelt-grpmatelt)
    - [`IsIdentity(g): GrpMatElt → BoolElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/operation-element.md#function-isidentity-grpmatelt)
    - [`IsId(g): GrpMatElt → BoolElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/operation-element.md#function-isid-grpmatelt)
    - [`IsScalar(g): GrpMatElt → BoolElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/operation-element.md#function-isscalar-grpmatelt)
  - [Matrix Invariants](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/operation-element.md#matrix-invariants)
    - [`Degree(g): GrpMatElt → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/operation-element.md#function-degree-grpmatelt)
    - [`HasFiniteOrder(g): GrpMatElt → BoolElt, RngIntElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/operation-element.md#function-hasfiniteorder)
    - [`Order(g): GrpMatElt → RngIntElt, BoolElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/operation-element.md#function-order-grpmatelt)
    - [`FactoredOrder(g): GrpMatElt → [ <RngIntElt, RngIntElt> ], BoolElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/operation-element.md#function-factoredorder-grpmatelt)
    - [`ProjectiveOrder(g): GrpMatElt → RngIntElt, RngElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/operation-element.md#function-projectiveorder-grpmatelt)
    - [`FactoredProjectiveOrder(A): AlgMatElt → [ <RngIntElt, RngIntElt> ], RngElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/operation-element.md#function-factoredprojectiveorder-algmatelt)
    - [`CentralOrder(g : parameters): GrpMatElt → RngIntElt, BoolElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/operation-element.md#function-centralorder-grpmatelt)
    - [`CentralOrder(g): GrpPermElt → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/operation-element.md#function-centralorder-grppermelt)
    - [`Determinant(g): GrpMatElt → RngElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/operation-element.md#function-determinant-grpmatelt)
    - [`Trace(g): GrpMatElt → RngElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/operation-element.md#function-trace-grpmatelt)
    - [`CharacteristicPolynomial(g: parameters): GrpMatElt → RngPolElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/operation-element.md#function-characteristicpolynomial-grpmatelt)
    - [`MinimalPolynomial(g): GrpMatElt → RngPolElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/operation-element.md#function-minimalpolynomial-grpmatelt)
    - [Example: Invariants of Matrices in GL(3, 4)](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/operation-element.md#example-ex-cc263c)
- [Global Properties](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/global-properties.md)
  - [Group Order](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/global-properties.md#group-order)
    - [`IsFinite(G): GrpMat → Bool, RngIntElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/global-properties.md#function-isfinite-grpmat)
    - [`Order(G): GrpMat → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/global-properties.md#function-order-grpmat)
    - [`# G: GrpMat → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/global-properties.md#operation-operation-grpmat-rngintelt)
    - [`FactoredOrder(G): GrpMat → [ <RngIntElt, RngIntElt> ]`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/global-properties.md#function-factoredorder-grpmat)
    - [`Exponent(G): GrpMat → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/global-properties.md#function-exponent-grpmat)
    - [Example: Order After Reduction Modulo 24](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/global-properties.md#example-ex-731a24)
  - [Membership and Equality](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/global-properties.md#membership-and-equality)
    - [`g in G: GrpMatElt, GrpMat → BoolElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/global-properties.md#operation-op-in-grpmatelt-grpmat)
    - [`g notin G: GrpMatElt, GrpMat → BoolElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/global-properties.md#operation-op-notin-grpmatelt-grpmat)
    - [`S subset G: { GrpMatElt }, GrpMat → BoolElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/global-properties.md#operation-op-subset-grpmatelt-grpmat)
    - [`H subset G: GrpMat, GrpMat → BoolElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/global-properties.md#operation-op-subset-grpmat-grpmat)
    - [`IsSubgroup(H,G): GrpMat, GrpMat → BoolElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/global-properties.md#function-issubgroup-grpmat-grpmat)
    - [`S notsubset G: { GrpMatElt }, GrpMat → BoolElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/global-properties.md#operation-operation-notsubset-grpmatelt-grpmat-boolelt)
    - [`H notsubset G: GrpMat, GrpMat → BoolElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/global-properties.md#operation-operation-notsubset-grpmat-grpmat-boolelt)
    - [`H eq G: GrpMat, GrpMat → BoolElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/global-properties.md#operation-op-eq-grpmat-grpmat)
    - [`H ne G: GrpMat, GrpMat → BoolElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/global-properties.md#operation-op-ne-grpmat-grpmat)
  - [Set Operations](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/global-properties.md#set-operations)
    - [`NumberingMap(G): GrpMat → Map`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/global-properties.md#function-numberingmap-grpmat)
    - [`RandomProcess(G): GrpMat → Process`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/global-properties.md#function-randomprocess-grpmat)
    - [`Random(G: parameters): GrpMat → GrpMatElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/global-properties.md#function-random-grpmat)
    - [`Random(P): Process → GrpMatElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/global-properties.md#function-random-process)
    - [Example: Element Orders in GL(20, 16)](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/global-properties.md#example-ex-b51498)
- [Abstract Group Predicates](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/abstract-group.md)
  - [`IsAbelian(G): GrpMat → BoolElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/abstract-group.md#function-isabelian-grpmat)
  - [`IsCyclic(G): GrpMat → BoolElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/abstract-group.md#function-iscyclic-grpmat)
  - [`IsElementaryAbelian(G): GrpMat → BoolElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/abstract-group.md#function-iselementaryabelian-grpmat)
  - [`IsNilpotent(G): GrpMat → BoolElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/abstract-group.md#function-isnilpotent-grpmat)
  - [`IsSoluble(G): GrpMat → BoolElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/abstract-group.md#function-issoluble-grpmat)
  - [`IsSolvable(G): GrpMat → BoolElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/abstract-group.md#function-issolvable-grpmat)
  - [`IsPerfect(G): GrpMat → BoolElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/abstract-group.md#function-isperfect-grpmat)
  - [`IsSimple(G): GrpMat → BoolElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/abstract-group.md#function-issimple-grpmat)
  - [Example: Order and Predicates of a Matrix Group](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/abstract-group.md#example-ex-3d20f4)
- [Conjugacy](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/conjugate.md)
  - [`Class(H, x): GrpMat, GrpMatElt → { GrpMatElt }`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/conjugate.md#function-class-grpmat-grpmatelt)
  - [`Conjugates(H, x): GrpMat, GrpMatElt → { GrpMatElt }`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/conjugate.md#function-conjugates-grpmat-grpmatelt)
  - [`ClassMap(G): GrpMat → Map`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/conjugate.md#function-classmap-grpmat)
  - [`ConjugacyClasses(G: parameters): GrpMat → [ < RngIntElt, RngIntElt, GrpMatElt > ]`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/conjugate.md#function-conjugacyclasses)
  - [`Classes(G: parameters): GrpMat → [ < RngIntElt, RngIntElt, GrpMatElt > ]`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/conjugate.md#function-classes-grpmat)
  - [`ClassRepresentative(G, x): GrpMat, GrpMatElt → GrpMatElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/conjugate.md#function-classrepresentative-grpmat-grpmatelt)
  - [`ClassRepresentative(G, i): GrpMat, RngIntElt → GrpMatElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/conjugate.md#function-classrepresentative-grpmat-rngintelt)
  - [`ClassCentraliser(G, i): GrpMat, RngIntElt → GrpMat`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/conjugate.md#function-classcentraliser-grpmat-rngintelt)
  - [`ClassCentralizer(G, i): GrpMat, RngIntElt → GrpMat`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/conjugate.md#function-classcentralizer-grpmat-rngintelt)
  - [`ClassRepresentativeFromInvariants(G, p, h, t): GrpMat, SeqEnum, SeqEnum, FldFinElt → GrpMatElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/conjugate.md#function-classrepresentativefrominvariants-grpmat-seqenum-seqenum-fldfinelt)
  - [`IsConjugate(G, g, h): GrpMat, GrpMatElt, GrpMatElt → BoolElt, GrpMatElt | Unass`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/conjugate.md#function-isconjugate-grpmat-grpmatelt-grpmatelt)
  - [`NumberOfClasses(G): GrpMat → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/conjugate.md#function-numberofclasses-grpmat)
  - [`Nclasses(G): GrpMat → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/conjugate.md#function-nclasses-grpmat)
  - [`PowerMap(G): GrpMat → Map`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/conjugate.md#function-powermap-grpmat)
  - [`AssertAttribute(G, "Classes", Q): GrpMat, MonStgElt, SeqEnum`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/conjugate.md#procedure-assertattribute-grpmat-monstgelt-seqenum-classes)
  - [Example: Conjugacy Classes from the Rational Database](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/conjugate.md#example-ex-f393ee)
  - [Conjugacy in Classical Groups](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/conjugate.md#conjugacy-in-classical-groups)
    - [`DualPolynomial(f): RngUPolElt → RngUPolElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/conjugate.md#function-dualpolynomial-rngupolelt)
    - [`StarIrreduciblePolynomials(F,d): FldFin, RngIntElt → SeqEnum`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/conjugate.md#function-starirreduciblepolynomials-fldfin-rngintelt)
    - [`PhiDual(f,phi): RngUPolElt → RngUPolElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/conjugate.md#function-phidual-rngupolelt)
    - [`PhiIrreduciblePolynomials(F,d): FldFin, RngIntElt → SeqEnum[Tup]`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/conjugate.md#function-phiirreduciblepolynomials-fldfin-rngintelt)
    - [`ExtendedSymplecticGroup(n,q,m): RngIntElt, RngIntElt, RngIntElt → GrpMat`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/conjugate.md#function-extendedsymplecticgroup-rngintelt-rngintelt-rngintelt)
    - [`ExtendedSp(n,q,m): RngIntElt, RngIntElt, RngIntElt → GrpMat`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/conjugate.md#function-extendedsp-rngintelt-rngintelt-rngintelt)
    - [`IndexOfSp(G): GrpMat → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/conjugate.md#function-indexofsp-grpmat)
    - [`TildeDualPolynomial(f): RngUPolElt → RngUPolElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/conjugate.md#function-tildedualpolynomial-rngupolelt)
    - [`TildeIrreduciblePolynomials(q,d): RngIntElt, RngIntElt → SeqEnum`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/conjugate.md#function-tildeirreduciblepolynomials-rngintelt-rngintelt)
    - [`ExtendedSpecialUnitaryGroup(n,q,m): RngIntElt, RngIntElt, RngIntElt → GrpMat`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/conjugate.md#function-extendedspecialunitarygroup-rngintelt-rngintelt-rngintelt)
    - [`ExtendedSU(n,q,m): RngIntElt, RngIntElt, RngIntElt → GrpMat`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/conjugate.md#function-extendedsu-rngintelt-rngintelt-rngintelt)
    - [`IndexOfSU(G): GrpMat → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/conjugate.md#function-indexofsu-grpmat)
    - [`ClassicalConjugacyClasses(G): GrpMat → SeqEnum, SetIndx`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/conjugate.md#function-classicalconjugacyclasses-grpmat)
    - [`ClassicalClasses(G): GrpMat → SeqEnum, SetIndx`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/conjugate.md#function-classicalclasses-grpmat)
    - [`ClassicalConjugacyClasses(type,d,q): MonStgElt, RngIntElt, RngIntElt → SeqEnum, SetIndx`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/conjugate.md#function-classicalconjugacyclasses-monstgelt-rngintelt-rngintelt)
    - [`ClassicalClasses(type,d,q): MonStgElt, RngIntElt, RngIntElt → SeqEnum, SetIndx`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/conjugate.md#function-classicalclasses-monstgelt-rngintelt-rngintelt)
    - [`ClassicalCentralizer(G,g): GrpMat, GrpMatElt → GrpMat`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/conjugate.md#function-classicalcentralizer-grpmat-grpmatelt)
    - [`ClassicalCentraliserOrder(G,g): GrpMat, GrpMatElt → RngIntEltFact`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/conjugate.md#function-classicalcentraliserorder-grpmat-grpmatelt)
    - [`ClassicalClassSize(G,g): GrpMat, GrpMatElt → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/conjugate.md#function-classicalclasssize-grpmat-grpmatelt)
    - [`ClassicalIsConjugate(G,g,h): GrpMat, GrpMatElt, GrpMatElt → BoolElt, GrpMatElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/conjugate.md#function-classicalisconjugate-grpmat-grpmatelt-grpmatelt)
    - [Example: Centralisers in an Orthogonal Group](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/conjugate.md#example-ex-99ff8c)
    - [`ClassicalClassMap(G): GrpMat → Map`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/conjugate.md#function-classicalclassmap-grpmat)
    - [`ClassicalClassMap(G,C,L): GrpMat, SeqEnum, SetIndx → Map`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/conjugate.md#function-classicalclassmap-grpmat-seqenum-setindx)
    - [`ClassesForFixedSemisimple(G,x): GrpMat, GrpMatElt → SeqEnum, SetIndx`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/conjugate.md#function-classesforfixedsemisimple-grpmat-grpmatelt)
    - [`IsometryGroupClassLabel(type, g): MonStgElt, GrpMatElt → SetMulti`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/conjugate.md#function-isometrygroupclasslabel-monstgelt-grpmatelt)
    - [Example: Classical Class Map for SO+(6, 9)](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/conjugate.md#example-ex-af187c)
    - [Example: Conjugacy Classes of GO(7, 9)](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/conjugate.md#example-ex-745ee8)
    - [Example: Products of Involutions in Sp(d, q)](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/conjugate.md#example-ex-fd370f)
    - [`UnipotentClasses(type,d,q): MonStgElt, RngIntElt, RngIntElt → SeqEnum, SeqEnum`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/conjugate.md#function-unipotentclasses-monstgelt-rngintelt-rngintelt)
    - [`UnipotentClasses(type,d,F): MonStgElt, RngIntElt, FldFin → SeqEnum, SeqEnum`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/conjugate.md#function-unipotentclasses-monstgelt-rngintelt-fldfin)
    - [`SemisimpleClasses(type,d,q): MonStgElt, RngIntElt, RngIntElt → SeqEnum`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/conjugate.md#function-semisimpleclasses-monstgelt-rngintelt-rngintelt)
    - [`SemisimpleClasses(type,d,F): MonStgElt, RngIntElt, FldFin → SeqEnum`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/conjugate.md#function-semisimpleclasses-monstgelt-rngintelt-fldfin)
    - [`IsometryGroupNumberOfClasses(type, n): MonStgElt, RngIntElt → RngUPolElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/conjugate.md#function-isometrygroupnumberofclasses-monstgelt-rngintelt)
    - [Example: Unipotent Classes of SU(12, 9)](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/conjugate.md#example-ex-c14a80)
    - [`ProjectiveClassicalClasses(type,d,q): MonStgElt, RngIntElt, RngIntElt → SeqEnum, GrpPerm, HomGrp, SeqEnum`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/conjugate.md#function-projectiveclassicalclasses-monstgelt-rngintelt-rngintelt)
    - [`ProjectiveClassicalCentraliser(G, g): GrpMat, GrpMatElt → GrpMat`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/conjugate.md#function-projectiveclassicalcentraliser-grpmat-grpmatelt)
    - [`ProjectiveClassicalIsConjugate(G, g, h): GrpMat, GrpMatElt, GrpMatElt → BoolElt, GrpMatElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/conjugate.md#function-projectiveclassicalisconjugate-grpmat-grpmatelt-grpmatelt)
    - [Example: Fast Projective Conjugacy Classes](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/conjugate.md#example-ex-fbd04d)
    - [Example: Projective Class Preimages as Matrices](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/conjugate.md#example-ex-b45e6a)
    - [`SpinConjugacyClasses(G): GrpMat → SeqEnum, SeqEnum`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/conjugate.md#function-spinconjugacyclasses-grpmat)
    - [`SpinClasses(G): GrpMat → SeqEnum, SeqEnum`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/conjugate.md#function-spinclasses-grpmat)
    - [`SpinCentralizer(G,g): GrpMat, GrpMatElt → GrpMat`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/conjugate.md#function-spincentralizer-grpmat-grpmatelt)
    - [`SpinIsConjugate(G,g,h): GrpMat, GrpMatElt, GrpMatElt → BoolElt, GrpMatElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/conjugate.md#function-spinisconjugate-grpmat-grpmatelt-grpmatelt)
    - [`SpinClassMap(G): GrpMat → Map`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/conjugate.md#function-spinclassmap-grpmat)
- [Subgroups](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/subgroups.md)
  - [Construction of Subgroups](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/subgroups.md#construction-of-subgroups)
    - [`sub<G | L>: GrpMat, List → GrpMat`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/subgroups.md#constructor-constructor-sub-grpmat-list-grpmat)
    - [`ncl<G | L>: GrpMat, List → GrpMat`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/subgroups.md#constructor-constructor-ncl-grpmat-list-grpmat)
    - [Example: Orthogonal Subgroup of GL(4, 2)](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/subgroups.md#example-ex-494271)
  - [Elementary Properties of Subgroups](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/subgroups.md#elementary-properties-of-subgroups)
    - [`Index(G, H): GrpMat, GrpMat → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/subgroups.md#function-index-grpmat-grpmat)
    - [`FactoredIndex(G, H): GrpMat, GrpMat → [ <RngIntElt, RngIntElt> ]`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/subgroups.md#function-factoredindex-grpmat-grpmat)
    - [`IsCentral(G, H): GrpMat, GrpMat → BoolElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/subgroups.md#function-iscentral-grpmat-grpmat)
    - [`IsMaximal(G, H): GrpMat, GrpMat → BoolElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/subgroups.md#function-ismaximal-grpmat-grpmat)
    - [`IsNormal(G, H): GrpMat, GrpMat → BoolElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/subgroups.md#function-isnormal-grpmat-grpmat)
    - [`IsSubnormal(G, H): GrpMat, GrpMat → BoolElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/subgroups.md#function-issubnormal-grpmat-grpmat)
  - [Standard Subgroups](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/subgroups.md#standard-subgroups)
    - [`H ^ g: GrpMat, GrpMatElt → GrpMat`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/subgroups.md#operation-op-pow-grpmat-grpmatelt)
    - [`Conjugate(H, g): GrpMat, GrpMatElt → GrpMat`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/subgroups.md#function-conjugate-grpmat-grpmatelt)
    - [`H meet K: GrpMat, GrpMat → GrpMat`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/subgroups.md#operation-op-meet-grpmat-grpmat)
    - [`CommutatorSubgroup(G, H, K): GrpMat, GrpMat, GrpMat → GrpMat`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/subgroups.md#function-commutatorsubgroup-grpmat-grpmat-grpmat)
    - [`CommutatorSubgroup(H, K): GrpMat, GrpMat → GrpMat`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/subgroups.md#function-commutatorsubgroup-grpmat-grpmat)
    - [`Centraliser(G, g): GrpMat, GrpMatElt → GrpMat`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/subgroups.md#function-centraliser-grpmat-grpmatelt)
    - [`Centralizer(G, g): GrpMat, GrpMatElt → GrpMat`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/subgroups.md#function-centralizer-grpmat-grpmatelt)
    - [`Centraliser(G, H): GrpMat, GrpMat → GrpMat`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/subgroups.md#function-centraliser-grpmat-grpmat)
    - [`Centralizer(G, H): GrpMat, GrpMat → GrpMat`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/subgroups.md#function-centralizer-grpmat-grpmat)
    - [`Core(G, H): GrpMat, GrpMat → GrpMat`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/subgroups.md#function-core-grpmat-grpmat)
    - [`H ^ G: GrpMat, GrpMat → GrpMat`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/subgroups.md#operation-op-pow-grpmat-grpmat)
    - [`NormalClosure(G, H): GrpMat, GrpMat → GrpMat`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/subgroups.md#function-normalclosure-grpmat-grpmat)
    - [`Normalizer(G, H): GrpMat, GrpMat → GrpMat`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/subgroups.md#function-normalizer-grpmat-grpmat)
    - [`GLNormalizer(H : parameter): GrpMat → GrpMat`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/subgroups.md#function-glnormalizer-grpmat)
    - [`SylowSubgroup(G, p): GrpMat, RngIntElt → GrpMat`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/subgroups.md#function-sylowsubgroup-grpmat-rngintelt)
    - [`Sylow(G, p): GrpMat, RngIntElt → GrpMat`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/subgroups.md#function-sylow-grpmat-rngintelt)
    - [`pCore(G, p): GrpMat, RngIntElt → GrpMat`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/subgroups.md#function-pcore-grpmat-rngintelt)
  - [Low Index Subgroups](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/subgroups.md#low-index-subgroups)
    - [`LowIndexSubgroups(G,n: parameters): GrpMat, RngIntElt → SeqEnum`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/subgroups.md#function-lowindexsubgroups-grpmat-rngintelt)
    - [`LowIndexSubgroups(G,t: parameters): GrpMat, Tup → SeqEnum`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/subgroups.md#function-lowindexsubgroups-grpmat-tup)
    - [`LowIndexSubgroups(G, N, n: parameters): GrpMat, RngIntElt → SeqEnum`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/subgroups.md#function-lowindexsubgroups-grpmat-rngintelt-2)
    - [`LowIndexSubgroups(G, N, t: parameters): GrpMat, Tup → SeqEnum`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/subgroups.md#function-lowindexsubgroups-grpmat-tup-2)
    - [`LowIndexSubgroupsCT(G, R : parameters): GrpMat, RngIntElt → [ GrpMat ]`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/subgroups.md#function-lowindexsubgroupsct-grpmat-rngintelt)
    - [`LowIndexSubgroupsCT(G, R: parameters): GrpMat, <RngIntElt, RngIntElt> → [ GrpMat ]`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/subgroups.md#function-lowindexsubgroupsct-grpmat-rngintelt-rngintelt)
    - [Example: Low Index Subgroups of GL(4, 5)](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/subgroups.md#example-ex-39331d)
  - [Conjugacy Classes of Subgroups](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/subgroups.md#conjugacy-classes-of-subgroups)
    - [`SubgroupClasses(G: parameters): GrpMat → [ rec< GrpMat, RngIntElt, RngIntElt, GrpFP> ]`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/subgroups.md#function-subgroupclasses-grpmat)
    - [`Subgroups(G: parameters): GrpMat → [ rec< GrpMat, RngIntElt, RngIntElt, GrpFP> ]`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/subgroups.md#function-subgroups-grpmat)
    - [`MaximalSubgroups(G: parameters): GrpMat → [ rec< GrpMat, RngIntElt, RngIntElt, GrpFP> ]`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/subgroups.md#function-maximalsubgroups-grpmat)
    - [`MaximalSubgroups(G,N: parameters): GrpMat, GrpMat → [ rec< GrpMat, RngIntElt, RngIntElt, GrpFP> ]`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/subgroups.md#function-maximalsubgroups-grpmat-grpmat)
    - [`SubgroupsLift(G, A, B, Q: parameters): GrpMat, GrpMat, GrpMat, SeqEnum → SeqEnum`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/subgroups.md#function-subgroupslift-grpmat-grpmat-grpmat-seqenum)
    - [`IsConjugate(G, H, K): GrpMat, GrpMat, GrpMat → BoolElt, GrpMatElt | Unass`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/subgroups.md#function-isconjugate-grpmat-grpmat-grpmat)
    - [`IsGLConjugate(H, K): GrpMat, GrpMat → BoolElt, GrpMatElt | Unass`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/subgroups.md#function-isglconjugate-grpmat-grpmat)
- [Quotient Groups](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/quotient.md)
  - [Construction of Quotient Groups](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/quotient.md#construction-of-quotient-groups)
    - [`quo<G | L>: GrpMat, List → GrpPerm, Map`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/quotient.md#constructor-constructor-quo-grpmat-list-grpperm-map)
    - [`G / N: GrpMat, GrpMat → GrpPerm`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/quotient.md#operation-op-div-grpmat-grpmat)
    - [Example: Quotient of a Soluble Matrix Group](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/quotient.md#example-ex-8aed52)
  - [Abelian, Nilpotent, and Soluble Quotients](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/quotient.md#abelian-nilpotent-and-soluble-quotients)
    - [`AbelianQuotient(G): GrpMat → GrpAb, Map`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/quotient.md#function-abelianquotient-grpmat)
    - [`ElementaryAbelianQuotient(G, p): GrpMat, RngIntElt → GrpAb, Map`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/quotient.md#function-elementaryabelianquotient-grpmat-rngintelt)
    - [`pQuotient(G, p, c): GrpMat, RngIntElt, RngIntElt → GrpPC, Map, SeqEnum, BoolElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/quotient.md#function-pquotient-grpmat-rngintelt-rngintelt)
    - [`NilpotentQuotient(G, c): GrpMat, RngIntElt → GrpGPC, Map`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/quotient.md#function-nilpotentquotient-grpmat-rngintelt)
    - [`SolvableQuotient(G): GrpMat → GrpPC, Map`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/quotient.md#function-solvablequotient-grpmat)
    - [`SolubleQuotient(G): GrpMat → GrpPC, Map`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/quotient.md#function-solublequotient-grpmat)
    - [`PCGroup(G): GrpMat → GrpPC, Map`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/quotient.md#function-pcgroup-grpmat)
    - [Example: Abelian and Soluble Quotients](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/quotient.md#example-ex-b8249f)
- [Matrix Group Actions](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/actions.md)
  - [Orbits and Stabilizers](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/actions.md#orbits-and-stabilizers)
    - [`u * g: ModTupRngElt, GrpMatElt → ModTupRngElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/actions.md#operation-op-times-modtuprngelt-grpmatelt)
    - [`y ^ g: Elt, GrpMatElt → Elt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/actions.md#operation-op-pow-elt-grpmatelt)
    - [`y ^ G: Elt, GrpMat → SetEnum`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/actions.md#operation-op-pow-elt-grpmat)
    - [`Orbit(G, y): GrpMat, Elt → SetEnum`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/actions.md#function-orbit-grpmat-elt)
    - [`OrbitBounded(G, y, b): GrpMat, Elt, RngIntElt → BoolElt, SetEnum`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/actions.md#function-orbitbounded-grpmat-elt-rngintelt)
    - [`Orbits(G): GrpMat → [ SetIndx ]`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/actions.md#function-orbits-grpmat)
    - [`LineOrbits(G): GrpMat → [ SetIndx ]`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/actions.md#function-lineorbits-grpmat)
    - [`OrbitClosure(G, S): GrpMat, { Elt } → GSet`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/actions.md#function-orbitclosure-grpmat-elt)
    - [`Stabilizer(G, y): GrpMat, Elt → GrpMat`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/actions.md#function-stabilizer-grpmat-elt)
    - [Example: Orbits of Vectors and Subspaces](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/actions.md#example-ex-3be539)
  - [Orbit and Stabilizer Functions for Large Groups](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/actions.md#orbit-and-stabilizer-functions-for-large-groups)
    - [`OrbitsOfSpaces(G, k): GrpMat, RngIntElt → SeqEnum`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/actions.md#function-orbitsofspaces-grpmat-rngintelt)
    - [`NumberOfFixedSpaces(x, s): GrpMatElt, RngIntElt → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/actions.md#function-numberoffixedspaces-grpmatelt-rngintelt)
    - [`NumberOfFixedSpaces(x, s): AlgMatElt, RngIntElt → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/actions.md#function-numberoffixedspaces-algmatelt-rngintelt)
    - [Example: Orbits of 2-Spaces under an Exterior Square](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/actions.md#example-ex-dc691e)
    - [`EstimateOrbit(G, v: parameters): GrpMat, ModTupFldElt → RngIntElt, RngIntElt, RngIntElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/actions.md#function-estimateorbit-grpmat-modtupfldelt)
    - [`EstimateOrbit(G, U: parameters): GrpMat, ModTupFld → RngIntElt, RngIntElt, RngIntElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/actions.md#function-estimateorbit-grpmat-modtupfld)
    - [`ApproximateStabiliser(G, A, U: parameters): GrpMat, GrpMat, ModTupFld → GrpMat, GrpMat, RngIntElt, RngIntElt, RngIntElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/actions.md#function-approximatestabiliser-grpmat-grpmat-modtupfld)
    - [Example: Estimating an Orbit and Stabiliser](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/actions.md#example-ex-32857e)
    - [`StabiliserOfSpaces(Q): SeqEnum → GrpMat, SeqEnum`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/actions.md#function-stabiliserofspaces-seqenum)
    - [Example: Stabiliser of Spaces](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/actions.md#example-ex-3c31f0)
    - [`IsUnipotent(G): GrpMat → BoolElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/actions.md#function-isunipotent-grpmat)
    - [`UnipotentStabiliser(G, U: parameters): GrpMat, ModTupFld → GrpMat, ModTupFld, GrpMatElt, GrpSLPElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/actions.md#function-unipotentstabiliser-grpmat-modtupfld)
    - [Example: Unipotent Stabiliser of Spaces](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/actions.md#example-ex-78b096)
  - [Action on Orbits](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/actions.md#action-on-orbits)
    - [`OrbitAction(G, T): GrpMat, Elt → Hom(Grp), GrpPerm, GrpMat`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/actions.md#function-orbitaction-grpmat-elt)
    - [`OrbitActionBounded(G, T, b): GrpMat, Elt, RngIntElt → BoolElt, Hom(Grp), GrpPerm, GrpMat`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/actions.md#function-orbitactionbounded-grpmat-elt-rngintelt)
    - [`OrbitImage(G, T): GrpMat, Set → GrpPerm, SetIndx`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/actions.md#function-orbitimage-grpmat-set)
    - [`OrbitImageBounded(G, T, b): GrpMat, Set, RngIntElt → BoolElt, GrpPerm, SetIndx`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/actions.md#function-orbitimagebounded-grpmat-set-rngintelt)
    - [`OrbitKernel(G, T): GrpMat, Set → GrpMat`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/actions.md#function-orbitkernel-grpmat-set)
    - [`OrbitKernelBounded(G, T, b): GrpMat, Set, RngIntElt → BoolElt, GrpMat`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/actions.md#function-orbitkernelbounded-grpmat-set-rngintelt)
    - [Example: Permutation Representation from Eigenspaces](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/actions.md#example-ex-2b1162)
  - [Action on a Coset Space](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/actions.md#action-on-a-coset-space)
    - [`CosetAction(G, H): GrpMat, GrpMat → Hom(Grp), GrpPerm, GrpMat`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/actions.md#function-cosetaction-grpmat-grpmat)
    - [`CosetImage(G, H): GrpMat, GrpMat → GrpPerm`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/actions.md#function-cosetimage-grpmat-grpmat)
    - [`CosetKernel(G, H): GrpMat, GrpMat → GrpMat`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/actions.md#function-cosetkernel-grpmat-grpmat)
    - [Example: Action on Cosets in SL(3, 3)](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/actions.md#example-ex-71335a)
  - [Action on the Natural $G$-Module](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/actions.md#action-on-the-natural-g-module)
    - [`GModule(G): GrpMat → ModGrp`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/actions.md#function-gmodule-grpmat-2)
    - [`IsIrreducible(G): GrpMat → BoolElt, ModGrp`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/actions.md#function-isirreducible-grpmat)
    - [`SubmoduleAction(G, S): GrpMat → Map, GrpMat`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/actions.md#function-submoduleaction-grpmat)
    - [`SubmoduleImage(G, S): GrpMat → GrpMat`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/actions.md#function-submoduleimage-grpmat)
    - [`QuotientModuleAction(G, S): GrpMat → Map, GrpMat`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/actions.md#function-quotientmoduleaction-grpmat)
    - [`QuotientModuleImage(G, S): GrpMat → GrpMat`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/actions.md#function-quotientmoduleimage-grpmat)
    - [`IsAbsolutelyIrreducible(G): GrpMat → BoolElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/actions.md#function-isabsolutelyirreducible-grpmat)
    - [`AbsoluteRepresentation(G): GrpMat → GrpMat, Map`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/actions.md#function-absoluterepresentation-grpmat)
    - [`MinimalField(G): GrpMat → FldFin`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/actions.md#function-minimalfield-grpmat)
- [Normal and Subnormal Subgroups](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/characteristic-subgroup-normal-structure.md)
  - [Characteristic Subgroups and Subgroup Series](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/characteristic-subgroup-normal-structure.md#characteristic-subgroups-and-subgroup-series)
    - [`Centre(G): GrpMat → GrpMat`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/characteristic-subgroup-normal-structure.md#function-centre-grpmat)
    - [`Center(G): GrpMat → GrpMat`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/characteristic-subgroup-normal-structure.md#function-center-grpmat)
    - [`DerivedLength(G): GrpMat → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/characteristic-subgroup-normal-structure.md#function-derivedlength-grpmat)
    - [`DerivedSeries(G): GrpMat → [ GrpMat ]`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/characteristic-subgroup-normal-structure.md#function-derivedseries-grpmat)
    - [`CommutatorSubgroup(G): GrpMat → GrpMat`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/characteristic-subgroup-normal-structure.md#function-commutatorsubgroup-grpmat)
    - [`DerivedSubgroup(G): GrpMat → GrpMat`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/characteristic-subgroup-normal-structure.md#function-derivedsubgroup-grpmat)
    - [`DerivedGroup(G): GrpMat → GrpMat`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/characteristic-subgroup-normal-structure.md#function-derivedgroup-grpmat)
    - [`FittingSubgroup(G): GrpMat → GrpMat`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/characteristic-subgroup-normal-structure.md#function-fittingsubgroup-grpmat)
    - [`LowerCentralSeries(G): GrpMat → [ GrpMat ]`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/characteristic-subgroup-normal-structure.md#function-lowercentralseries-grpmat)
    - [`NilpotencyClass(G): GrpMat → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/characteristic-subgroup-normal-structure.md#function-nilpotencyclass-grpmat)
    - [`H ^ G: GrpMat → GrpMat`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/characteristic-subgroup-normal-structure.md#operation-op-pow-grpmat)
    - [`NormalClosure(G, H): GrpMat → GrpMat`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/characteristic-subgroup-normal-structure.md#function-normalclosure-grpmat)
    - [`SolubleResidual(G): GrpMat → GrpMat`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/characteristic-subgroup-normal-structure.md#function-solubleresidual-grpmat)
    - [`SolvableResidual(G): GrpMat → GrpMat`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/characteristic-subgroup-normal-structure.md#function-solvableresidual-grpmat)
    - [`SubnormalSeries(G, H): GrpMat, GrpMat → [ GrpMat ]`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/characteristic-subgroup-normal-structure.md#function-subnormalseries-grpmat-grpmat)
    - [`UpperCentralSeries(G): GrpMat → [ GrpMat ]`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/characteristic-subgroup-normal-structure.md#function-uppercentralseries-grpmat)
    - [Example: Subgroup Series of a Soluble Group](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/characteristic-subgroup-normal-structure.md#example-ex-32b53b)
  - [The Soluble Radical and its Quotient](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/characteristic-subgroup-normal-structure.md#the-soluble-radical-and-its-quotient)
    - [`Radical(G): GrpMat → GrpMat`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/characteristic-subgroup-normal-structure.md#function-radical-grpmat)
    - [`SolubleRadical(G): GrpMat → GrpMat`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/characteristic-subgroup-normal-structure.md#function-solubleradical-grpmat)
    - [`SolvableRadical(G): GrpMat → GrpMat`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/characteristic-subgroup-normal-structure.md#function-solvableradical-grpmat)
    - [`RadicalQuotient(G): GrpMat → GrpPerm, Hom(Grp), GrpMat`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/characteristic-subgroup-normal-structure.md#function-radicalquotient-grpmat)
    - [`ElementaryAbelianSeries(G: parameters): GrpMat → [ GrpMat ]`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/characteristic-subgroup-normal-structure.md#function-elementaryabelianseries-grpmat)
    - [`ElementaryAbelianSeriesCanonical(G): GrpMat → [ GrpMat ]`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/characteristic-subgroup-normal-structure.md#function-elementaryabelianseriescanonical-grpmat)
  - [Composition and Chief Factors](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/characteristic-subgroup-normal-structure.md#composition-and-chief-factors)
    - [`CompositionFactors(G): GrpMat → [ <RngIntElt, RngIntElt, RngIntElt> ]`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/characteristic-subgroup-normal-structure.md#function-compositionfactors-grpmat)
    - [`ChiefFactors(G): GrpMat → [ <RngIntElt, RngIntElt, RngIntElt, RngIntElt> ]`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/characteristic-subgroup-normal-structure.md#function-chieffactors-grpmat)
    - [`ChiefSeries(G): GrpMat → [ GrpMat ], [ <RngIntElt, RngIntElt, RngIntElt, Rng IntElt> ]`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/characteristic-subgroup-normal-structure.md#function-chiefseries-grpmat)
    - [Example: Chief Factors over a Cyclotomic Field](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/characteristic-subgroup-normal-structure.md#example-ex-76e310)
- [Coset Tables and Transversals](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/coset-table-transversal.md)
  - [`CosetTable(G, H): Grp, Grp → Hom(Grp)`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/coset-table-transversal.md#function-cosettable-grp-grp)
  - [`Transversal(G, H): GrpMat, GrpMat → {@ GrpMatElt  @}, Map`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/coset-table-transversal.md#function-transversal-grpmat-grpmat)
  - [`RightTransversal(G, H): GrpMat, GrpMat → {@ GrpMatElt  @}, Map`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/coset-table-transversal.md#function-righttransversal-grpmat-grpmat)
- [Presentations](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/finitely_presented_group.md)
  - [Presentations](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/finitely_presented_group.md#id1)
    - [`FPGroup(G): GrpMat → GrpFP, Hom(Grp)`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/finitely_presented_group.md#function-fpgroup-grpmat)
    - [`FPGroupStrong(G): GrpMat → GrpFP, Hom(Grp)`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/finitely_presented_group.md#function-fpgroupstrong-grpmat)
  - [Matrices as Words](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/finitely_presented_group.md#matrices-as-words)
    - [`WordGroup(G): GrpMat → GrpSLP, Map`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/finitely_presented_group.md#function-wordgroup-grpmat)
    - [`InverseWordMap(G): GrpMat → Map`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/finitely_presented_group.md#function-inversewordmap-grpmat)
    - [`WordInGenerators(G, g : parameters): GrpMat, GrpMatElt → GrpFPElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/finitely_presented_group.md#function-wordingenerators-grpmat-grpmatelt)
- [Automorphism Groups](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/automorphisms.md)
  - [`AutomorphismGroup(G: parameters): GrpMat → GrpAuto`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/automorphisms.md#function-automorphismgroup-grpmat)
  - [Example: Automorphism Group of a Matrix Group](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/automorphisms.md#example-ex-dc7caf)
  - [`IsIsomorphic(G, H: parameters): GrpMat, GrpMat → BoolElt, Hom(Grp)`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/automorphisms.md#function-isisomorphic-grpmat-grpmat)
  - [`IsIsomorphic(G, H: parameters): GrpMat, GrpPerm → BoolElt, Hom(Grp)`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/automorphisms.md#function-isisomorphic-grpmat-grpperm)
  - [`IsIsomorphic(G, H: parameters): GrpPerm, GrpMat → BoolElt, Hom(Grp)`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/automorphisms.md#function-isisomorphic-grpperm-grpmat)
  - [Example: Isomorphism with a Dihedral Group](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/automorphisms.md#example-ex-ea03aa)
- [Representation Theory](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/character-representation.md)
  - [`LinearCharacters(G): GrpMat → [ Chtr ]`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/character-representation.md#function-linearcharacters-grpmat)
  - [`CharacterTable(G: parameters): GrpMat → TabChtr`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/character-representation.md#function-charactertable-grpmat)
  - [`PermutationCharacter(G, H): GrpMat, GrpMat → AlgChtrElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/character-representation.md#function-permutationcharacter-grpmat-grpmat)
  - [`GModule(G): GrpMat → ModGrp`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/character-representation.md#function-gmodule-grpmat-3)
  - [`GModule(G, A): GrpMat, AlgMat → ModGrp`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/character-representation.md#function-gmodule-grpmat-algmat)
  - [`GModule(G, Q): GrpMat, [ AlgMatElt ] → ModGrp`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/character-representation.md#function-gmodule-grpmat-algmatelt)
  - [`GModule(G, A, B): GrpMat, GrpMat, GrpMat → ModGrp, Map`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/character-representation.md#function-gmodule-grpmat-grpmat-grpmat)
  - [`PermutationModule(G, H, R): GrpMat, GrpMat, Rng → ModGrp`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/character-representation.md#function-permutationmodule-grpmat-grpmat-rng)
  - [`ChangeOfBasisMatrix(G, S): GrpMat, ModGrp → AlgMatElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/character-representation.md#function-changeofbasismatrix-grpmat-modgrp)
  - [Example: Refining a Normal Subgroup with Modules](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/character-representation.md#example-ex-089525)
- [Base and Strong Generating Set](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/BSGS-base-strong-generator.md)
  - [Introduction](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/BSGS-base-strong-generator.md#introduction)
  - [Controlling Selection of a Base](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/BSGS-base-strong-generator.md#controlling-selection-of-a-base)
    - [`GoodBasePoints(G: parameters): GrpMat → []`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/BSGS-base-strong-generator.md#function-goodbasepoints-grpmat)
    - [`AssertAttribute(G, "Base", B): GrpMat, MonStgElt, Tup`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/BSGS-base-strong-generator.md#procedure-assertattribute-grpmat-monstgelt-tup-base)
    - [`HasAttribute(G, "Base"): GrpMat, MonStgElt → BoolElt, Tup`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/BSGS-base-strong-generator.md#function-hasattribute-grpmat-monstgelt-base)
    - [`AssertAttribute(GrpMat, "FirstBasicOrbitBound", n): Cat, MonStgElt, RngIntElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/BSGS-base-strong-generator.md#procedure-assertattribute-cat-monstgelt-rngintelt-firstbasicorbitbound)
    - [`HasAttribute(GrpMat, "FirstBasicOrbitBound"): Cat, MonStgElt → BoolElt, RngIntElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/BSGS-base-strong-generator.md#function-hasattribute-cat-monstgelt-firstbasicorbitbound)
  - [Construction of a Base and Strong Generating Set](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/BSGS-base-strong-generator.md#construction-of-a-base-and-strong-generating-set)
    - [`BSGS(G): GrpMat`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/BSGS-base-strong-generator.md#procedure-bsgs-grpmat)
    - [`BSGS(G, str): GrpMat, MonStgElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/BSGS-base-strong-generator.md#procedure-bsgs-grpmat-monstgelt)
    - [`RandomSchreier(G: parameters): GrpMat`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/BSGS-base-strong-generator.md#procedure-randomschreier-grpmat)
    - [`RandomSchreier(G, str : parameters): GrpMat, MonStgElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/BSGS-base-strong-generator.md#procedure-randomschreier-grpmat-monstgelt)
    - [`RandomSchreierBounded(G, L: parameters): GrpMat, RngIntElt → BoolElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/BSGS-base-strong-generator.md#function-randomschreierbounded-grpmat-rngintelt)
    - [`ToddCoxeterSchreier(G): GrpMat`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/BSGS-base-strong-generator.md#procedure-toddcoxeterschreier-grpmat)
    - [`Verify(G): GrpMat`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/BSGS-base-strong-generator.md#procedure-verify-grpmat)
  - [Defining Values for Attributes](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/BSGS-base-strong-generator.md#defining-values-for-attributes)
    - [`AssertAttribute(G, "Order", n): GrpMat, MonStgElt, RngIntElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/BSGS-base-strong-generator.md#procedure-assertattribute-grpmat-monstgelt-rngintelt-order)
    - [`AssertAttribute(G, "Order", Q): GrpMat, MonStgElt, [Tup(RngIntElt, RngIntElt)]`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/BSGS-base-strong-generator.md#procedure-assertattribute-grpmat-monstgelt-tup-rngintelt-rngintelt-order)
    - [`AssertAttribute(G, "IsVerified", b): GrpMat, MonStgElt, BoolElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/BSGS-base-strong-generator.md#procedure-assertattribute-grpmat-monstgelt-boolelt-isverified)
    - [`HasAttribute(G, "Order"): GrpMat, MonStgElt → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/BSGS-base-strong-generator.md#function-hasattribute-grpmat-monstgelt-order)
    - [`HasAttribute(G, "FactoredOrder"): GrpMat, MonStgElt → [Tup(RngIntElt, RngIntElt)]`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/BSGS-base-strong-generator.md#function-hasattribute-grpmat-monstgelt-factoredorder)
    - [`HasAttribute(G, "IsVerified"): GrpMat, MonStgElt → BoolElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/BSGS-base-strong-generator.md#function-hasattribute-grpmat-monstgelt-isverified)
  - [Accessing the Base and Strong Generating Set](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/BSGS-base-strong-generator.md#accessing-the-base-and-strong-generating-set)
    - [`Base(G): GrpMat → [Elt]`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/BSGS-base-strong-generator.md#function-base-grpmat)
    - [`BasePoint(G, i): GrpMat, RngIntElt → Elt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/BSGS-base-strong-generator.md#function-basepoint-grpmat-rngintelt)
    - [`BasicOrbit(G, i): GrpMat, RngIntElt → SetIndx`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/BSGS-base-strong-generator.md#function-basicorbit-grpmat-rngintelt)
    - [`BasicOrbitLength(G, i): GrpMat, RngIntElt → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/BSGS-base-strong-generator.md#function-basicorbitlength-grpmat-rngintelt)
    - [`BasicOrbitLengths(G): GrpMat → [RngIntElt]`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/BSGS-base-strong-generator.md#function-basicorbitlengths-grpmat)
    - [`BasicStabilizer(G, i): GrpMat, RngIntElt → GrpMat`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/BSGS-base-strong-generator.md#function-basicstabilizer-grpmat-rngintelt)
    - [`BasicStabiliser(G, i): GrpMat, RngIntElt → GrpMat`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/BSGS-base-strong-generator.md#function-basicstabiliser-grpmat-rngintelt)
    - [`BasicStabilizerChain(G): GrpMat → [GrpMat]`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/BSGS-base-strong-generator.md#function-basicstabilizerchain-grpmat)
    - [`BasicStabiliserChain(G): GrpMat → [GrpMat]`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/BSGS-base-strong-generator.md#function-basicstabiliserchain-grpmat)
    - [`NumberOfStrongGenerators(G): GrpMat → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/BSGS-base-strong-generator.md#function-numberofstronggenerators-grpmat)
    - [`Nsgens(G): GrpMat → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/BSGS-base-strong-generator.md#function-nsgens-grpmat)
    - [`StrongGenerators(G): GrpMat → SetIndx(GrpMat)`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/BSGS-base-strong-generator.md#function-stronggenerators-grpmat)
- [Soluble Matrix Groups](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/soluble-matrix-group.md)
  - [Conversion to a PC-Group](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/soluble-matrix-group.md#conversion-to-a-pc-group)
    - [`PolycyclicGenerators(G): GrpMat → [ GrpPCElt ]`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/soluble-matrix-group.md#function-polycyclicgenerators-grpmat)
    - [`PCGroup(G): GrpMat → GrpPC, Map`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/soluble-matrix-group.md#function-pcgroup-grpmat-2)
  - [Soluble Group Functions](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/soluble-matrix-group.md#soluble-group-functions)
    - [`pCentralSeries(G, p): GrpMat, RngIntElt → [ GrpMat ]`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/soluble-matrix-group.md#function-pcentralseries-grpmat-rngintelt)
  - [$p$-group Functions](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/soluble-matrix-group.md#p-group-functions)
    - [`IsSpecial(G): GrpMat → BoolElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/soluble-matrix-group.md#function-isspecial-grpmat)
    - [`IsExtraSpecial(G): GrpMat → BoolElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/soluble-matrix-group.md#function-isextraspecial-grpmat)
    - [`FrattiniSubgroup(G): GrpMat → GrpMat`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/soluble-matrix-group.md#function-frattinisubgroup-grpmat)
    - [`JenningsSeries(G): GrpMat → [ GrpMat ]`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/soluble-matrix-group.md#function-jenningsseries-grpmat)
  - [Abelian Group Functions](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/soluble-matrix-group.md#abelian-group-functions)
    - [`PrimaryAbelianInvariants(G): GrpMat → [ RngIntElt ]`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/soluble-matrix-group.md#function-primaryabelianinvariants-grpmat)
    - [`AbelianInvariants(G): GrpMat → [ RngIntElt ]`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/soluble-matrix-group.md#function-abelianinvariants-grpmat)
    - [`PrimaryAbelianBasis(G): GrpMat → [ GrpMatElt ], [ RngIntElt ]`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/soluble-matrix-group.md#function-primaryabelianbasis-grpmat)
    - [`AbelianBasis(G): GrpMat → [ GrpMatElt ], [ RngIntElt ]`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/soluble-matrix-group.md#function-abelianbasis-grpmat)
- [Bibliography](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/bibliography.md)

### Introduction

#### Introduction to Matrix Groups

A matrix group $G$ may be defined over any ring $R$ for which Magma has a method for computing the inverse of a matrix. However, the availability of machinery for determining structural information is dependent upon the properties of the base ring $R$.

We distinguish several different cases.

**(i)**
If the ring $R$ is a finite field then the group must be finite. If the group has moderate degree and it is possible to find a low dimensional subspace of the natural vector space for $G$ whose orbit under $G$ has length bounded by a million or so, then it is possible to construct a stabilizer chain representation for the group similar to that used for permutation groups (the *BSGS representation* [[But76](https://docs.magma-maths.org/references.md#cite-butler-schreier-matrix)]). In order to increase the chances of finding a short orbit the Murray–O’Brien [[MO95](https://docs.magma-maths.org/references.md#cite-murray-obrien)] strategy for selecting base points is used. The availability of a BSGS representation allows the structure of the group to be investigated in detail.

**(ii)**
If the coefficient ring $R$ is a finite field but the degree and size of the group are such that it is not possible to construct a useful BSGS representation then the group may be investigated using techniques based on a theorem of Aschbacher that classifies the maximal subgroups of $\GL(n, q)$. This approach is under intensive development by Leedham-Green, O’Brien, and others. Code implementing some parts is documented in Chapter [Matrix Groups over Finite Fields](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/index-matrix-groups-over-finite-fields.md#chapgrpmatff).

**(iii)**
If the ring $R$ is the Euclidean Ring ${\mathbb{Z}}/m{\mathbb{Z}}$, then the group must be finite. If the group has moderate degree and it is possible to find a vector in the natural $R$-module for $G$ whose orbit has length bounded by a million or so, then again it is possible to compute structural information using the BSGS representation.

**(iv)**
If the ring $R$ has infinite cardinality and satisfies certain properties, Magma can sometimes determine whether the group is finite or infinite. In particular, this can be done when $R$ is the ring of integers, the field of rational numbers, or an algebraic number field (including cyclotomic and quadratic fields). If $G$ is infinite, and has not been created as a Lie group, then Magma currently provides little beyond basic arithmetic on elements.

**(v)**
If the ring $R$ has infinite cardinality but the group $G$ is finite and $R$ is either a field or an Euclidean Domain then it may be possible to construct a *BSGS representation* as above and thereby undertake structural computation.

**(vi)**
If an (infinite) matrix group can be created as a Lie group then machinery based on Lie Theory may be used to analyse the group. The facilities for Lie groups are described in Chapter [Groups of Lie Type](https://docs.magma-maths.org/LieTheory/ChevalleyGroups/index-chevalley-groups.md#chapgrplie).

Matrix groups over rings of infinite cardinality may be created regardless as to whether they are finite or not. If the coefficient ring $R$ is either the ring of integers, the rational field, a quadratic field, a cyclotomic field, or a number field a matrix group may then be tested for finiteness by use of the function `IsFinite`. However, most functions that determine structural properties of a group apply only to finite groups.

#### The Support

Matrix groups may be defined over any ring for which Magma has a method for computing matrix inverses. However, the structure algorithms assume that the group is finite and is defined over either a field, an Euclidean Domain, or the Euclidean Ring $\Z/m\Z$.

#### The Category of Matrix Groups

The family of matrix groups over a particular ring $R$ forms a category where the objects are the matrix groups and the morphisms are group homomorphisms. The collection of all matrix groups forms a family of categories indexed by the category of rings. The Magma designation for this family of categories of matrix groups is `GrpMat`.

#### The Construction of a Matrix Group

A group of $n \times n$ matrices defined over the ring $R$ is created as a subgroup of the general linear group ${\operatorname{GL}}(n, R)$. Thus the construction of a general matrix group is a two step process:

**(i)**
The appropriate general linear group, ${\operatorname{GL}}(n, R)$, is constructed;

**(ii)**
The required group $G$ is then defined as a subgroup of ${\operatorname{GL}}(n, R)$.

For convenience, a constructor `MatrixGroup< ... >`, which combines these two steps, is provided.

### Creation of a Matrix Group

#### Construction of the General Linear Group

<a id="function-generallineargroup-rngintelt-rng"></a>
##### `GeneralLinearGroup(n, R): RngIntElt, Rng -> GrpMat`

<a id="function-gl-rngintelt-rng"></a>
##### `GL(n, R): RngIntElt, Rng -> GrpMat`

Given an integer $n \geq 1$ and a ring $R$, create the generic matrix group, i.e. the general linear group ${\operatorname{GL}}(n, R)$. Initially, only a structure table is created for ${\operatorname{GL}}(n, R)$, so that, in particular, generators are not defined. This function is normally used to provide a context for the creation of elements and subgroups of ${\operatorname{GL}}(n, R)$. If structural computation is attempted with the group created by `GeneralLinearGroup(n, R)`, then generators will be created where possible. At present, this is only permitted in the cases in which $R$ is a finite field.

<a id="example-ex-59ac81"></a>
##### `Example: Constructing GL(3, 4) (ex-59ac81)`

We define the general linear group ${\operatorname{GL}}(3, K)$, where $K$ is the finite field ${\bf F}_{4}$.

```magma
> K<w> := FiniteField(4);
> GL34 := GeneralLinearGroup(3, K);
> GL34;
GL(3, GF(2, 2))
```

#### Construction of a Matrix Group Element

Throughout this subsection we shall assume that the matrix group $G$ is defined over the ring $R$.

<a id="constructor-constructor-elt-grpmat-list-rngelt-grpmatelt"></a>
##### `elt< G | L >: GrpMat, List(RngElt) -> GrpMatElt`

Given a matrix group $G$ defined as a subgroup of ${\operatorname{GL}}(n, R)$, and the list $L$ of expressions $a_{ij}$ ($1 \leq i, j \leq n$), defining elements of the ring $R$, construct the $n\times n$ matrix

$$
\begin{pmatrix}a_{11}&a_{12}&\ldots&a_{1n}\\ a_{21}&a_{22}&\ldots&a_{2n}\\ \vdots&\vdots&\ddots&\vdots\\ a_{n1}&a_{n2}&\ldots&a_{nn}\end{pmatrix}
$$

Unless $G$ is known to be the generic matrix group of degree $n$, the matrix will be tested for membership of $G$, and if $g$ is not an element of $G$, the function will fail. If $g$ does lie in $G$, $g$ will have $G$ as its parent. Since the membership test may involve constructing a base and strong generating set for $G$, this constructor may occasionally be very costly. Hence a matrix $g$ should be defined as an element of a subgroup of the generic group only when membership of $G$ is required by subsequent operations involving $g$.

<a id="operation-op-grpmat-rngelt"></a>
##### `G ! Q: GrpMat, [ RngElt ] -> GrpMatElt`

Given the sequence $Q$ of expressions $a_{ij}$ ($1 \leq i, j \leq n$), defining elements of the ring $R$, construct the $n\times n$ matrix

$$
\begin{pmatrix}a_{11}&a_{12}&\ldots&a_{1n}\\ a_{21}&a_{22}&\ldots&a_{2n}\\ \vdots&\vdots&\ddots&\vdots\\ a_{n1}&a_{n2}&\ldots&a_{nn}\end{pmatrix}
$$

This matrix will have $G$ as its parent structure. As in the case of the `elt`-constructor, the operation will fail if $g$ is not an element of $G$, and the same observations concerning the cost of membership testing apply.

<a id="function-elementtosequence-grpmatelt"></a>
##### `ElementToSequence(g): GrpMatElt -> [ RngElt ]`

<a id="function-eltseq-grpmatelt"></a>
##### `Eltseq(g): GrpMatElt -> [ RngElt ]`

Given an $n \times n$ matrix $g = (a_{ij}), 1 \le i, j \le n$, where $a_{ij}$ is an element of the ring $R$, construct the sequence

$$
[ a_{11}, \ldots, a_{1n}, a_{21}, \ldots, a_{2n}, \ldots a_{n1}, \ldots, a_{nn}]
$$

of $n^2$ elements of the ring $R$.

<a id="function-identity-grpmat"></a>
##### `Identity(G): GrpMat -> GrpMatElt`

<a id="function-id-grpmat"></a>
##### `Id(G): GrpMat -> GrpMatElt`

<a id="operation-op-grpmat-rngintelt"></a>
##### `G ! 1: GrpMat, RngIntElt -> GrpMatElt`

Construct the identity matrix in the matrix group $G$.

<a id="example-ex-da01c4"></a>
##### `Example: Elements of GL(3, 4) (ex-da01c4)`

The different constructions are illustrated by the following code, which assigns to each of the variables $x$ and $y$ an element of ${\operatorname{GL}}(3, 4)$.

```magma
> K<w> := FiniteField(4);
> GL34 := GeneralLinearGroup(3, K);
> x := elt<GL34 | w,0,1, 0,1,0, 1,0,1 >;
> x;
[w 0 1]
[0 1 0]
[1 0 1]
> y := GL34 ! [w,0,1, 0,1,0, 1,0,1];
> y;
[w 0 1]
[0 1 0]
[1 0 1]
> GL34 ! 1;
[1 0 0]
[0 1 0]
[0 0 1]
```

#### Construction of a General Matrix Group

<a id="constructor-constructor-matrixgroup-rngintelt-rng-list-grpmat"></a>
##### `MatrixGroup< n, R | L >: RngIntElt, Rng, List -> GrpMat`

Construct the matrix group $G$ of degree $n$ over the ring $R$ generated by the matrices defined by the list $L$. A term of the list $L$ must be an object of one of the following types:

**(a)**
A sequence of $n^2$ elements of $R$ defining a matrix of ${\operatorname{GL}}(n, R)$;

**(b)**
A set or sequence of sequences of type (a);

**(c)**
An element of ${\operatorname{GL}}(n, R)$;

**(d)**
A set or sequence of elements of ${\operatorname{GL}}(n, R)$;

**(e)**
A subgroup of ${\operatorname{GL}}(n, R)$;

**(f)**
A set or sequence of subgroups of ${\operatorname{GL}}(n, R)$.

Each element or group specified by the list must belong to the *same* generic matrix group. The group $G$ will be constructed as a subgroup of some group which contains each of the elements and groups specified in the list. The generators of $G$ consist of the elements specified by the terms of the list $L$ together with the stored generators for groups specified by terms of the list. Repetitions of an element and occurrences of the identity element are removed.

The `MatrixGroup` constructor is shorthand for the two statements:

```
   GL := GeneralLinearGroup(n, R);

   G := sub< GL | L >;
```

where `sub< ... >` is the subgroup constructor described in the next subsection.

<a id="example-ex-383e20"></a>
##### `Example: Subgroup of GL(3, 4) by Generators (ex-383e20)`

We use the `MatrixGroup` constructor to define a small subgroup of ${\operatorname{GL}}(3, 4)$.

```magma
> K<w> := FiniteField(4);
> H := MatrixGroup< 3, K | [1,w,0, 0,1,0, 1,w^2,1], [w,0,0, 0,1,0, 0,0,w] >;
> H;
MatrixGroup(3, GF(2, 2))
Generators:
[  1   w   0]
[  0   1   0]
[  1 w^2   1]

[w 0 0]
[0 1 0]
[0 0 w]
> Order(H);
96
```

<a id="example-ex-0a504f"></a>
##### `Example: Sylow Subgroup of a General Linear Group (ex-0a504f)`

We present a function which will construct the Sylow $p$-subgroup of ${\operatorname{GL}}(n, K)$, where $K$ is a finite field of characteristic $p$.

```magma
> GLSyl := function(n, K)
>    R := MatrixRing(K, n);
>    e := func< i, j | MatrixUnit(R, i, j) >;
>    return MatrixGroup< n, K | { R!1 + a*e(i,j) : a in K, j in [i+1],
>          i in [1 .. n - 1] | a ne 0 } >;
> end function;
> T := GLSyl(3, GF(8));
> FactoredOrder(T);
[ <2, 9> ]
> FactoredOrder(GL(3, GF(8)));
[ <2, 9>, <3, 2>, <7, 3>, <73, 1> ]
```

#### Changing Rings

<a id="function-changering-grpmat-rng"></a>
##### `ChangeRing(G, S): GrpMat, Rng -> GrpMat, Map`

Given a matrix group $G$ with base ring $R$, construct a new matrix group $H$ with base ring $S$ derived from $G$ by coercing entries of the generators of $G$ from $R$ into $S$.

<a id="function-changering-grpmat-rng-map"></a>
##### `ChangeRing(G, S, f): GrpMat, Rng, Map -> GrpMat, Map`

Given a matrix group $G$ with base ring $R$, construct a new matrix group $H$ with base ring $S$ derived from $G$ by applying $f$ to the entries of the generators of $G$.

<a id="function-restrictfield-grpmat-fldfin"></a>
##### `RestrictField(G, S): GrpMat, FldFin -> GrpMat, Map`

Given a matrix group $G$ with base ring $K$, a finite field, and $S$ a subfield of $K$, construct the matrix group $H$ with base ring $S$ obtained by restricting the scalars of the components of elements of $G$ into $S$, together with the restriction map from $G$ onto $H$.

<a id="function-extendfield-grpmat-fldfin"></a>
##### `ExtendField(G, L): GrpMat, FldFin -> GrpMat, Map`

Given a matrix group $G$ with base ring $K$, a finite field, and $L$ an extension of $K$, construct the matrix group $H$ with base ring $L$ obtained by lifting the components of elements of $G$ into $L$, together with the inclusion homomorphism from $G$ into $H$.

#### Coercion between Matrix Structures

A square non-singular matrix may be defined as an element of any of the following structures:

- A subring of the complete matrix ring $M_{n}(R)$;
- A subgroup of the general linear group ${\operatorname{GL}}(n, R)$;
- A submodule of the matrix module $M^{(m \times n)}(R)$.

The coercion operator may be used to transfer matrices between any two of these three structures.

<a id="operation-op-algmat-grpmatelt"></a>
##### `R ! g: AlgMat, GrpMatElt -> RngMatElt`

Transfer the matrix $g$ from a group into a matrix ring $R$.

<a id="operation-op-grpmat-algmatelt"></a>
##### `G ! r: GrpMat, AlgMatElt -> GrpMatElt`

Transfer the matrix $r$ from a ring into a matrix group $G$.

<a id="operation-op-modmatrng-grpmatelt"></a>
##### `M ! g: ModMatRng, GrpMatElt -> ModMatRngElt`

Transfer the matrix $g$ from a group into a matrix module $M$.

<a id="operation-op-grpmat-modmatrngelt"></a>
##### `G ! m: GrpMat, ModMatRngElt -> GrpMatElt`

Transfer the matrix $m$ from a module into a matrix group $G$.

<a id="function-projectionlocalization-grpmatelt-map"></a>
##### `ProjectionLocalization(g, pi): GrpMatElt, Map -> GrpMatElt`

For a square matrix $g$ with elements inside a localization $R_{(p)}$ of a ring $R$ (so all denominators are prime to $p$), given a projection map $\pi : R \to R/p$, returns the image of $g$ under the map induced by $\pi$.

#### Accessing Associated Structures

The functions in this group provide access to basic information stored for a matrix group $G$.

<a id="operation-operation-grpmat-rngintelt-grpmatelt"></a>
##### `G . i: GrpMat, RngIntElt -> GrpMatElt`

The $i$-th defining generator for the matrix group $G$. A negative subscript indicates that the inverse of the generator is to be created. The $0$th generator `G.0` is `Identity(G)`.

<a id="function-degree-grpmat"></a>
##### `Degree(G): GrpMat -> RngIntElt`

The degree of the matrix group $G$.

<a id="function-generators-grpmat"></a>
##### `Generators(G): GrpMat -> { GrpMatElt }`

A set containing the defining generators for the matrix group $G$.

<a id="function-numberofgenerators-grpmat"></a>
##### `NumberOfGenerators(G): GrpMat -> RngIntElt`

<a id="function-ngens-grpmat"></a>
##### `Ngens(G): GrpMat -> RngIntElt`

The number of defining generators for the matrix group $G$.

<a id="function-coefficientring-grpmat"></a>
##### `CoefficientRing(G): GrpMat -> Rng`

<a id="function-basering-grpmat"></a>
##### `BaseRing(G): GrpMat -> Rng`

The coefficient ring for the matrix group $G$.

<a id="function-rspace-grpmat"></a>
##### `RSpace(G): GrpMat -> ModTupRng`

Given a matrix group $G$ of degree $n$ defined over a ring $R$, return the space $R^{(n)}$, where the action is multiplication by elements of $R$, i.e. scalar action.

<a id="function-vectorspace-grpmat"></a>
##### `VectorSpace(G): GrpMat -> ModTupFld`

Given a matrix group $G$ of degree $n$ defined over a field $K$, return the space $K^{(n)}$, where the action is multiplication by elements of $K$, i.e. scalar action.

<a id="function-gmodule-grpmat"></a>
##### `GModule(G): GrpMat -> ModGrp`

The natural $R[G]$-module for the matrix group $G$.

<a id="function-generic-grpmat"></a>
##### `Generic(G): GrpMat -> GrpMat`

The generic group containing the matrix group $G$, i.e. the general linear group in which $G$ is naturally embedded.

<a id="function-parent-grpmatelt"></a>
##### `Parent(G): GrpMatElt -> GrpMat`

The power structure for the group $G$ (the set consisting of all matrix groups).

### Homomorphisms

Homomorphisms are an important part of group theory, and Magma supports homomorphisms between groups. Many useful homomorphisms are returned by constructors and intrinsic functions. Examples of these are the `quo` constructor, the `sub` constructor, and intrinsic functions such as `OrbitAction` and `FPGroup`, which are described in more detail elsewhere in this chapter. In this section we describe how the user may create their own homomorphisms with domain a matrix group.

<a id="constructor-constructor-hom-grpmat-grp-list-map"></a>
#### `hom<G -> H | L>: GrpMat, Grp, List -> Map`

Given the matrix group $G$ and a group $H$, construct the homomorphism $f : G \to H$ given by the generator images in $L$. The clause $L$ may be any one of the following types:

**(a)**
A list of elements of $H$, giving images of the generators of $G$;

**(b)**
A list of pairs, where the first in the pair is an element of $G$ and the second its image in $H$, where pairs may be given in either of the (equivalent) forms `<g,h>` or `g -> h`;

**(c)**
A sequence of elements of $H$, as in (a);

**(d)**
A set or sequence of pairs, as in (b);

Each image element specified by the list must belong to the *same* group $H$. In the cases where pairs are given the given elements of $G$ must generate $G$.

<a id="function-domain-map"></a>
#### `Domain(f): Map -> Grp`

The domain of the homomorphism $f$.

<a id="function-codomain-map"></a>
#### `Codomain(f): Map -> Grp`

The codomain of the homomorphism $f$.

<a id="function-image-map"></a>
#### `Image(f): Map -> Grp`

The image or range of the homomorphism $f$. This will be a subgroup of the codomain of $f$. The algorithm computes the image and kernel simultaneously (see [[LGPS91](https://docs.magma-maths.org/references.md#cite-grp-homs)]).

<a id="function-kernel-map"></a>
#### `Kernel(f): Map -> Grp`

The kernel of the homomorphism $f$. This will be a normal subgroup of the domain of $f$. The algorithm computes the image and kernel simultaneously (see [[LGPS91](https://docs.magma-maths.org/references.md#cite-grp-homs)]).

<a id="function-ishomomorphism-grpmat-grpmat-seqenum-grpmatelt"></a>
#### `IsHomomorphism(G, H, Q): GrpMat, GrpMat, SeqEnum[GrpMatElt] -> Bool, Map`

Return the value `true` if the sequence $Q$ defines a homomorphism from the group $G$ to the group $H$. The sequence $Q$ must have length `Ngens(G)` and must contain elements of $H$. The $i$-th element of $Q$ is interpreted as the image of the $i$-th generator of $G$ and the function decides if these images extend to a homomorphism. If so, the homomorphism is also returned.

<a id="example-ex-868ec0"></a>
#### `Example: Dihedral Group to Symmetric Group (ex-868ec0)`

We construct the usual degree 2 matrix representation of the dihedral group of order 20, and a homomorphism from it to the symmetric group of degree 5.

```magma
> K<z> := CyclotomicField(20);
> zz := RootOfUnity(10, K);
> i := RootOfUnity(4, K);
> cos := (zz+ComplexConjugate(zz))/2;
> sin := (zz-ComplexConjugate(zz))/(2*i);
> gl := GeneralLinearGroup(2, K);
> M := sub< gl | [cos, sin, -sin, cos], [-1,0,0,1]>;
> #M;
20
> S := SymmetricGroup(5);
> f := hom<M->S |[S|(1,2,3,4,5), (1,5)(2,4)]>;
> Codomain(f);
Symmetric group S acting on a set of cardinality 5
Order = 120 = 2^3 * 3 * 5
> Image(f);
Permutation group acting on a set of cardinality 5
Order = 10 = 2 * 5
  (1, 2, 3, 4, 5)
  (1, 5)(2, 4)
> Kernel(f);
MatrixGroup(2, K) of order 2
Generators:
  [-1  0]
  [ 0 -1]
```

<a id="function-permutationrepresentation-grpmat"></a>
#### `PermutationRepresentation(G): GrpMat -> Map, GrpPerm, GrpMat`

```magma
ModScalars: BoolElt                    Default: false
```

Given a finite matrix group $G$, return a homomorphism $f$, a permutation group $P$, and a matrix group $K$. If the parameter `ModScalars` is `false` (the default), then $f : G\to P$ is a faithful permutation representation of $G$, and $K$ is the trivial group. If `ModScalars` ie `true`, then $f : G \to P$ is a homomorphism whose kernel $K$ is the subgroup of scalars in $G$.

<a id="example-ex-2bcb12"></a>
#### `Example: Permutation Representation of SL(4, 5) (ex-2bcb12)`

Construct a homomorphism from the special linear matrix group SL(4,5) onto the projective permutation group PSL(4,5).

```magma
> S := SL(4,5);
> f, P, K := PermutationRepresentation(S : ModScalars);
> #K;
4
$$a> assert $1 eq 4;
> Degree(P);
156
$$a> assert $1 eq 156;
> L := PSL(4,5);
> ok, phi := IsIsomorphic(P,L);
> ok;
true
> phi:Minimal;
Homomorphism of GrpPerm: P, Degree 156, Order 2^7 * 3^2 * 5^6 * 13 * 31 into
GrpPerm: L, Degree 156, Order 2^7 * 3^2 * 5^6 * 13 * 31
```

#### Construction of Extensions

<a id="function-directproduct-grpmat-grpmat"></a>
##### `DirectProduct(G, H): GrpMat, GrpMat -> GrpMat`

Given two matrix groups $G$ and $H$ of degrees $m$ and $n$ respectively, construct the direct product of $G$ and $H$ as a matrix group of degree $m + n$.

<a id="function-directproduct-grpmat"></a>
##### `DirectProduct(Q): [ GrpMat ] -> GrpMat`

Given a sequence $Q$ of $n$ matrix groups, construct the direct product $Q[1] \times Q[2] \times \ldots \times Q[n]$ as a matrix group of degree equal to the sum of the degrees of the groups $Q[i]$, $(i = 1, \ldots, n)$.

<a id="function-semilineargroup-grpmat-fldfin"></a>
##### `SemiLinearGroup(G, S): GrpMat, FldFin -> GrpMat`

Given a matrix group $G$ over the finite field $K$ and a subfield $S$ of $K$, construct the semilinear extension of $G$ over the subfield $S$.

<a id="function-tensorwreathproduct-grpmat-grpperm"></a>
##### `TensorWreathProduct(G, H): GrpMat, GrpPerm -> GrpMat`

Given a matrix group $G$ and a permutation group $H$, construct action of the wreath product on the tensor power of $G$ by $H$, which is the (image of) the wreath product in its action on the tensor power (of the space that $G$ acts on). The degree of the new group is $d^k$ where $d$ is the degree of $G$ and $k$ is the degree of $H$.

<a id="function-wreathproduct-grpmat-grpperm"></a>
##### `WreathProduct(G, H): GrpMat, GrpPerm -> GrpMat`

Given a matrix group $G$ and a permutation group $H$, construct the wreath product $G \wr H$ of $G$ and $H$.

<a id="example-ex-112242"></a>
##### `Example: Direct, Tensor, and Wreath Products (ex-112242)`

We define $G$ to be ${\operatorname{SU}}(3, 4)$ and $H$ to be the symmetric group of order $6$. We then proceed to form the direct product of $G$ with itself and the tensor and wreath products of $G$ and $H$.

```magma
> K<w> := FiniteField(4);
> G := SpecialUnitaryGroup(3, K);
> D := DirectProduct(G, G);
> D;
MatrixGroup(6, GF(2, 2))
Generators:
[  1   w   w   0   0   0]
[  0   1 w^2   0   0   0]
[  0   0   1   0   0   0]
[  0   0   0   1   0   0]
[  0   0   0   0   1   0]
[  0   0   0   0   0   1]

[w 1 1 0 0 0]
[1 1 0 0 0 0]
[1 0 0 0 0 0]
[0 0 0 1 0 0]
[0 0 0 0 1 0]
[0 0 0 0 0 1]

[  1   0   0   0   0   0]
[  0   1   0   0   0   0]
[  0   0   1   0   0   0]
[  0   0   0   1   w   w]
[  0   0   0   0   1 w^2]
[  0   0   0   0   0   1]

[1 0 0 0 0 0]
[0 1 0 0 0 0]
[0 0 1 0 0 0]
[0 0 0 w 1 1]
[0 0 0 1 1 0]
[0 0 0 1 0 0]
> Order(D);
46656
> H := SymmetricGroup(3);
> E := WreathProduct(G, H);
> Degree(E);
9
> Order(E);
60466176
> F := TensorWreathProduct(G, H);
> Degree(F);
27
> Order(F);
6718464
```

### Operations on Matrices

#### Arithmetic with Matrices

<a id="operation-op-times-grpmatelt-grpmatelt"></a>
##### `g * h: GrpMatElt, GrpMatElt -> GrpMatElt`

The product of matrix $g$ and matrix $h$, where $g$ and $h$ belong to the same generic group $U$. If $g$ and $h$ both belong to the same proper subgroup $G$ of $U$, then the result will be returned as an element of $G$; if $g$ and $h$ belong to subgroups $H$ and $K$ of a subgroup $G$ of $U$ then the product is returned as an element of $G$. Otherwise, the product is returned as an element of $U$.

<a id="operation-op-pow-grpmatelt-rngintelt"></a>
##### `g ^ n: GrpMatElt, RngIntElt -> GrpMatElt`

The $n$-th power of the matrix $g$, where $n$ is a positive or negative integer.

<a id="operation-op-div-grpmatelt-grpmatelt"></a>
##### `g / h: GrpMatElt, GrpMatElt -> GrpMatElt`

The product of the matrix $g$ by the inverse of the matrix $h$, i.e. the element $g*h^{-1}$. Here $g$ and $h$ must belong to the same generic group $U$. The rules for determining the parent group of $g / h$ are the same as for $g*h$.

<a id="operation-op-pow-grpmatelt-grpmatelt"></a>
##### `g ^ h: GrpMatElt, GrpMatElt -> GrpMatElt`

The conjugate of the matrix $g$ by the matrix $h$, i.e. the element $h^{-1}*g*h$. Here $g$ and $h$ must belong to the same generic group $U$. The rules for determining the parent group of $g^h$ are the same as for $g*h$.

<a id="literal-literal-g-h-grpmatelt-grpmatelt-grpmatelt"></a>
##### `(g, h): GrpMatElt, GrpMatElt -> GrpMatElt`

The commutator of the matrices $g$ and $h$, i.e. the element $g^{-1}*h^{-1}*g*h$. Here $g$ and $h$ must belong to the same generic group $U$. The rules for determining the parent group of $(g, h)$ are the same as those for $g*h$.

<a id="literal-literal-g1-gr-grpmatelt-grpmatelt-grpmatelt"></a>
##### `(g₁, ..., gᵣ): GrpMatElt, ..., GrpMatElt -> GrpMatElt`

Given $r$ matrices $g_1, \ldots, g_r$ belonging to a common group, return their commutator. Commutators are *left-normed*, so they are evaluated from left to right.

<a id="example-ex-383e92"></a>
##### `Example: Arithmetic with Matrices in GL(3, 4) (ex-383e92)`

These operations will be illustrated using the group ${\operatorname{GL}}(3, 4)$.

```magma
> K<w> := FiniteField(4);
> GL34 := GeneralLinearGroup(3, K);
> x := GL34 ! [1,w,0, 0,w,1, w^2,0,1];
> y := GL34 ! [1,0,0, 1,w,0, 1,1,w];
> x;
[  1   w   0]
[  0   w   1]
[w^2   0   1]
> y;
[1 0 0]
[1 w 0]
[1 1 w]
> x*y;
[w^2 w^2   0]
[w^2   w   w]
[  w   1   w]
> x^10;
[  w   w   1]
[  w   1   1]
[  w w^2   w]
> x^-1;
[w^2 w^2 w^2]
[  1   w   w]
[  w   w w^2]
> x^y;
[w^2 w^2   0]
[  0 w^2   1]
[w^2 w^2   w]
> x/y;
[  0   1   0]
[  0 w^2 w^2]
[  w   w w^2]
> (x, y);
[  0   w   w]
[  w w^2   1]
[w^2   w w^2]
> (x,y,y);
[w^2   w w^2]
[w^2   w   0]
[w^2   1   w]
```

Arithmetic with group elements is not limited to elements of finite groups. We illustrate with a group of degree 3 over a function field.

```magma
> P<a,b,c,m,x,y,z> := FunctionField(RationalField(), 7);
> S := MatrixGroup< 3, P | [1,a,b,0,1,c,0,0,1],
>                          [1,0,m,0,1,0,0,0,1],
>                          [1,x,y,0,1,z,0,0,1] >;
>
> t := S.1 * S.2;
> t;
[    1     a b + m]
[    0     1     c]
[    0     0     1]
> t^-1;
[          1          -a a*c - b - m]
[          0           1          -c]
[          0           0           1]
> Determinant(t);
1
> t^2;
[              1             2*a a*c + 2*b + 2*m]
[              0               1             2*c]
[              0               0               1]
```

#### Predicates for Matrices

<a id="operation-op-eq-grpmatelt-grpmatelt"></a>
##### `g eq h: GrpMatElt, GrpMatElt -> BoolElt`

Given matrices $g$ and $h$ belonging to the same generic group, return `true` if $g$ and $h$ are the same element, `false` otherwise.

<a id="operation-op-ne-grpmatelt-grpmatelt"></a>
##### `g ne h: GrpMatElt, GrpMatElt -> BoolElt`

Given matrices $g$ and $h$ belonging to the same generic group, return `true` if $g$ and $h$ are distinct elements, `false` otherwise.

<a id="function-isidentity-grpmatelt"></a>
##### `IsIdentity(g): GrpMatElt -> BoolElt`

<a id="function-isid-grpmatelt"></a>
##### `IsId(g): GrpMatElt -> BoolElt`

Returns `true` if the matrix $g$ is the identity matrix.

<a id="function-isscalar-grpmatelt"></a>
##### `IsScalar(g): GrpMatElt -> BoolElt`

Returns `true` if the matrix $g$ is a scalar matrix.

#### Matrix Invariants

All of the functions for computing invariants of a square matrix apply to the elements of a matrix group. Here only operations of interest in the context of group elements are described. The reader is referred to Chapter [Matrices](https://docs.magma-maths.org/MatricesLinearAlgebra/Matrices/index-matrices.md#chapmat) for a complete list of functions applicable to matrices.

<a id="function-degree-grpmatelt"></a>
##### `Degree(g): GrpMatElt -> RngIntElt`

The degree of the matrix $g$, i.e. the number of rows/columns of $g$.

<a id="function-hasfiniteorder"></a>
##### `HasFiniteOrder(g): GrpMatElt -> BoolElt, RngIntElt`

Returns `true` iff the matrix $g$ has finite order. The second return value is the order if it is finite. The function rigorously proves its result (i.e., the result is not probable). Let $R$ be the ring over which $g$ is defined, and let the degree of the group in which $g$ lies be $n$. If $R$ is finite, then the first return value is trivially `true`. If $R$ is the integer ring then the function works as follows. Suppose first that $g$ has finite order $o$. By a theorem of Minkowski (see Theorem 1.4 [[KP02](https://docs.magma-maths.org/references.md#cite-kuzpav2002)]), for any odd prime $p$, the reduction mod $p$ of $g$ has order $o$. Let $f(x)\in R[x]$ be the minimal polynomial of $g$. The matrix subalgebra generated by $g$ is isomorphic to the quotient ring $R[x]/\langle f(x) \rangle$, so the order $o$ of $g$ equals the order of $x$ mod $f(x)$. For arbitrary $g$, the algorithm computes the order, $\bar{o}$, of the reduction of $g$ modulo a small odd prime. If $\bar{o}$ is a possible order of an integer matrix of $g$’s dimensions (see Theorem 2.7 *op. cit.*) then this is repeated with a larger prime. If this gives a different order, or the first attempt gave an impossible order, then $g$ has infinite order. We now compute $x^{\bar{o}}\bmod f(x)$. If this is 1, then $\bar{o}$ is the order of $g$, otherwise $g$ has infinite order. If $R$ is the rational field then a necessary condition for $g$ to have finite order is that $f(x)$ has integer coefficients, thus the above algorithm applies in this case. If $R$ is an algebraic number field of degree $d$ over ${\mathbb{Q}}$ (including cyclotomic and quadratic fields), then the standard companion matrix blowup is applied to $g$ to obtain a $(nd)\times(nd)$ matrix over ${\mathbb{Q}}$, and the above algorithm is then applied to this matrix.

<a id="function-order-grpmatelt"></a>
##### `Order(g): GrpMatElt -> RngIntElt, BoolElt`

```magma
Proof: BoolElt                    Default: true
```

Given an element $g$ of finite order belonging to a matrix group, this function returns the order of $g$. If $g$ has infinite order, a runtime error results. In the case of a matrix group over a finite field, the algorithm described in [[CLG97b](https://docs.magma-maths.org/references.md#cite-clg-order)] is used. In all other cases, simple powering of $g$ is used.

The parameter `Proof` is associated with the case when the coefficient ring for $g$ is a finite field. In that case, if `Proof` is set to `false`, then difficult integer factorizations will not attempted. In this situation two values are returned of which the first is a multiple $n$ of the order of $g$. and the second value indicates whether $n$ is known to be the exact order of $g$.

<a id="function-factoredorder-grpmatelt"></a>
##### `FactoredOrder(g): GrpMatElt -> [ <RngIntElt, RngIntElt> ], BoolElt`

```magma
Proof: BoolElt                    Default: true
```

Given an element $g$ of finite order belonging to a matrix group, this function returns the order of $g$ as a factored integer. If $g$ has infinite order, a runtime error results. If $g$ has infinite order, the function generates a runtime error. In the case of a matrix group over a finite field, the algorithm described in [[CLG97b](https://docs.magma-maths.org/references.md#cite-clg-order)] is used. In all other cases, simple powering of $g$ is used. In that case it is more efficient to use this function rather than factorizing the integer returned by `Order(g)`. If $g$ has infinite order, an error ensues.

If the parameter `Proof` is `false`, then difficult integer factorizations are not attempted and the first return value $F$ may contain composite numbers (so that the factorization expands to a multiple of the order of $g$); in any case the second return value indicates whether $F$ is known to be the exact factored order of $g$.

<a id="function-projectiveorder-grpmatelt"></a>
##### `ProjectiveOrder(g): GrpMatElt -> RngIntElt, RngElt`

```magma
Proof: BoolElt                    Default: true
```

The projective order $n$ of the matrix $g$, and a scalar $s$ such that $g^n = sI$. The projective order of $g$ is the smallest $n$ such that $g^n$ is a scalar matrix (not just the identity matrix), and it always divides the true order of $A$. The parameter `Proof` is as for `Order`.

<a id="function-factoredprojectiveorder-algmatelt"></a>
##### `FactoredProjectiveOrder(A): AlgMatElt -> [ <RngIntElt, RngIntElt> ], RngElt`

```magma
Proof: BoolElt                    Default: true
```

Given a square invertible matrix $A$ over a finite field $K$, return the projective order $n$ of $A$ in factored form and a scalar $s\in K$ such that $A^n = sI$. The parameter `Proof` is as for `FactoredOrder`.

<a id="function-centralorder-grpmatelt"></a>
##### `CentralOrder(g : parameters): GrpMatElt -> RngIntElt, BoolElt`

<a id="function-centralorder-grppermelt"></a>
##### `CentralOrder(g): GrpPermElt -> RngIntElt`

```magma
Proof: BoolElt                    Default: true
```

Return the smallest $n$ such that $g^n$ is central in its parent group. If $g$ is a matrix and the optional parameter `Proof` is `false`, then accept a multiple of this value; the second value returned is `true` if the answer is exact.

<a id="function-determinant-grpmatelt"></a>
##### `Determinant(g): GrpMatElt -> RngElt`

The determinant of the matrix $g$.

<a id="function-trace-grpmatelt"></a>
##### `Trace(g): GrpMatElt -> RngElt`

The trace of the matrix $g$.

<a id="function-characteristicpolynomial-grpmatelt"></a>
##### `CharacteristicPolynomial(g: parameters): GrpMatElt -> RngPolElt`

```magma
Al   : MonStgElt                    Default: "Modular"
Proof: BoolElt                      Default: true
```

Given a matrix $g$ belonging to a subgroup of ${\operatorname{GL}}(n, R)$, where $R$ is a field or Euclidean Domain, return the characteristic polynomial of $g$ as an element of the univariate polynomial ring over $R$. For details on the parameters, see the function `CharacteristicPolynomial` in the chapter on matrices.

<a id="function-minimalpolynomial-grpmatelt"></a>
##### `MinimalPolynomial(g): GrpMatElt -> RngPolElt`

Given a matrix $g$ belonging to a subgroup of ${\operatorname{GL}}(n, R)$, where $R$ is a field or $Z$, return the minimal polynomial of $g$ as an element of the univariate polynomial ring over $R$.

<a id="example-ex-cc263c"></a>
##### `Example: Invariants of Matrices in GL(3, 4) (ex-cc263c)`

We illustrate the matrix operations by applying them to some elements of ${\operatorname{GL}}(3, 4)$.

```magma
> K<w> := FiniteField(4);
> GL34 := GeneralLinearGroup(3, K);
> x := GL34 ! [w,0,1, 0,1,0, 1,0,1];
> x;
[w 0 1]
[0 1 0]
[1 0 1]
> Degree(x);
3
> Determinant(x);
w^2
> Trace(x);
w
> Order(x);
15
> m<t> := MinimalPolynomial(x);
> m;
t^3 + w*t^2 + w^2
> Factorization(m);
[
    <t + 1, 1>,
    <t^2 + w^2*t + w^2, 1>
]
> c<t> := CharacteristicPolynomial(x);
> c;
t^3 + w*t^2 + w^2
```

### Global Properties

Unless otherwise noted, the functions in this section assume that a BSGS-representation for the group can be constructed.

#### Group Order

Unless the order is already known, each of the functions in this family will create a base and strong generating set for the group if one does not already exist.

<a id="function-isfinite-grpmat"></a>
##### `IsFinite(G): GrpMat -> Bool, RngIntElt`

Given a matrix group $G$, return whether $G$ is finite together with the order of $G$ if $G$ is finite. The function rigorously proves its result (i.e., the result is not probable). Let $R$ be the ring over which $G$ is defined, and let the degree of $G$ be $n$. If $R$ is finite, then the first return value is trivially `true`. If $R$ is the integer ring or rational field, then the function works as follows. The function successively generates random elements of $G$ and tests whether each element has infinite order via the function [`HasFiniteOrder`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/operation-element.md#function-hasfiniteorder); if so, then the non-finiteness of $G$ is proven. Otherwise, at regular intervals, the function attempts to construct a positive definite form fixed by $G$ (see the function [`PositiveDefiniteForm`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverQAndZ/forms.md#function-grpmatqz-positivedefiniteform) in the chapter on matrix groups over ${\mathbb{Q}}$ and ${\mathbb{Z}}$), using a finite number of steps; if one is successively constructed, then the finiteness of $G$ is proven. The number of steps attempted for the positive definite form constructed is increased as the algorithm progresses; if $G$ is finite, such a form must exist and will be found when enough steps are tried, while if $G$ is infinite, an element of infinite order is found very quickly in practice. If $R$ is an algebraic number field of degree $d$ over ${\mathbb{Q}}$ (including cyclotomic and quadratic fields), then the standard companion matrix blowup is applied to the generators of $G$ to obtain an isomorphic matrix group of $(nd)$ over ${\mathbb{Q}}$, and the above algorithm is then applied to this matrix group.

<a id="function-order-grpmat"></a>
##### `Order(G): GrpMat -> RngIntElt`

<a id="operation-operation-grpmat-rngintelt"></a>
##### `# G: GrpMat -> RngIntElt`

The order of the group $G$ as an integer. If the order is not currently known, a base and strong generating set will be constructed for $G$. If $G$ has infinite order, an error ensues.

<a id="function-factoredorder-grpmat"></a>
##### `FactoredOrder(G): GrpMat -> [ <RngIntElt, RngIntElt> ]`

The order of the group $G$ returned as a factored integer. The format is the same as for `FactoredIndex`. If the order of $G$ is not known, it will be computed. If $G$ has infinite order, an error ensues.

<a id="function-exponent-grpmat"></a>
##### `Exponent(G): GrpMat -> RngIntElt`

The exponent of the group $G$.

<a id="example-ex-731a24"></a>
##### `Example: Order After Reduction Modulo 24 (ex-731a24)`

```magma
> G := MatrixGroup<2,Integers()|[1,1,0,1],[0,1,-1,0]>;
> IsFinite(G);
false
> G24, e := ChangeRing(G, Integers(24));
> Order(G24);
9216
> G.-1*G.2;
[ 1  1]
[-1  0]
> (G.-1*G.2) @ e;
[ 1  1]
[23  0]
> (G24.2^2) @@ e;
[23  0]
[ 0 23]
```

#### Membership and Equality

<a id="operation-op-in-grpmatelt-grpmat"></a>
##### `g in G: GrpMatElt, GrpMat -> BoolElt`

Given a matrix $g$ and a matrix group $G$, return `true` if $g$ is an element of $G$, `false` otherwise.

<a id="operation-op-notin-grpmatelt-grpmat"></a>
##### `g notin G: GrpMatElt, GrpMat -> BoolElt`

Given a matrix $g$ and a matrix group $G$, return `true` if $g$ is not an element of $G$, `false` otherwise.

<a id="operation-op-subset-grpmatelt-grpmat"></a>
##### `S subset G: { GrpMatElt }, GrpMat -> BoolElt`

Given a matrix group $G$ and a set $S$ of matrices belonging to a group $H$, where $G$ and $H$ belong to the same generic group, return `true` if $S$ is a subset of $G$, `false` otherwise.

<a id="operation-op-subset-grpmat-grpmat"></a>
##### `H subset G: GrpMat, GrpMat -> BoolElt`

<a id="function-issubgroup-grpmat-grpmat"></a>
##### `IsSubgroup(H, G): GrpMat, GrpMat -> BoolElt`

Given matrix groups $G$ and $H$ belonging to the same generic group, return `true` if $H$ is a subgroup of $G$, `false` otherwise.

<a id="operation-operation-notsubset-grpmatelt-grpmat-boolelt"></a>
##### `S notsubset G: { GrpMatElt }, GrpMat -> BoolElt`

Given a matrix group $G$ and a set $S$ of matrices belonging to a group $H$, where $G$ and $H$ belong to the same generic group, return `true` if $S$ is not a subset of $G$, `false` otherwise.

<a id="operation-operation-notsubset-grpmat-grpmat-boolelt"></a>
##### `H notsubset G: GrpMat, GrpMat -> BoolElt`

Given matrix groups $G$ and $H$ belonging to the same generic group, return `true` if $H$ is not a subgroup of $G$, `false` otherwise.

<a id="operation-op-eq-grpmat-grpmat"></a>
##### `H eq G: GrpMat, GrpMat -> BoolElt`

Given matrix groups $G$ and $H$ belonging to the same generic group, return `true` if $G$ and $H$ are the same group, `false` otherwise.

<a id="operation-op-ne-grpmat-grpmat"></a>
##### `H ne G: GrpMat, GrpMat -> BoolElt`

Given matrix groups $G$ and $H$ belonging to the same generic group, return `true` if $G$ and $H$ are distinct groups, `false` otherwise.

#### Set Operations

The creation of a base and strong generating set for a matrix group $G$ provides us with a very compact representation of the set of elements of $G$. A particular BSGS imposes an order on the elements of $G$ (lexicographic ordering of base images). It thus makes sense to talk about the ‘number’ of a group element relative to a particular BSGS.

<a id="function-numberingmap-grpmat"></a>
##### `NumberingMap(G): GrpMat -> Map`

A bijective mapping from the group $G$ onto the set of integers $\{ 1 \ldots |G| \rbrace$. The actual mapping depends upon the base and strong generating set chosen for G.

<a id="function-randomprocess-grpmat"></a>
##### `RandomProcess(G): GrpMat -> Process`

```magma
Slots   : RngIntElt                    Default: 10
Scramble: RngIntElt                    Default: 20
```

Create a process to generate randomly chosen elements from the finite group $G$. The process is based on the product-replacement algorithm of [[CLGM+95](https://docs.magma-maths.org/references.md#cite-randomelements)], modified by the use of an accumulator. At all times, $N$ elements are stored where $N$ is the maximum of the specified value for `Slots` and `Ngens`$(G) + 1$. Initially, these are just the generators of $G$. As well, one extra group element is stored, the accumulator. Initially, this is the identity. Random elements are now produced by successive calls to `Random(P)`, where $P$ is the process created by this function. Each such call chooses one of the elements in the slots and multiplies it into the accumulator. The element in that slot is replaced by the product of it and another randomly chosen slot. The random value returned is the new accumulator value. Setting `Scramble := m` causes $m$ such operations to be performed before the process is returned.

<a id="function-random-grpmat"></a>
##### `Random(G: parameters): GrpMat -> GrpMatElt`

```magma
Short: BoolElt                    Default: false
```

A randomly chosen element for the group $G$. If a BSGS is known for $G$, then the element chosen will be genuinely random. If no BSGS is known, then the *random* element is chosen by multiplying out a *random* word in the generators. Since it is not usually practical to choose words long enough to properly sample the elements of $G$, the element returned will usually be biased. The boolean-valued parameter `Short` is used in this situation to indicate that a short word will suffice. Thus, if `Random` is invoked with `Short` assigned the value `true` then the element is constructed using a short word.

<a id="function-random-process"></a>
##### `Random(P): Process -> GrpMatElt`

Given a random element process $P$ created by the function `RandomProcess(G)` for the finite group $G$, construct a random element of $G$ by forming a random product over the expanded generating set constructed when the process was created. For large degree groups, or groups for which a BSGS is not known, this function should be used in preference to `Random(G)`.

<a id="example-ex-b51498"></a>
##### `Example: Element Orders in GL(20, 16) (ex-b51498)`

We use the random function to sample the orders of elements in the group ${\operatorname{GL}}(20, 16)$.

```magma
> G := GeneralLinearGroup(20, GF(16));
> RP := RandomProcess(G);
> [ FactoredOrder(Random(RP)) : i in [1..20] ];
[
    [ <3, 1>, <5, 1> ],
    [ <3, 2>, <5, 1>, <7, 1>, <11, 1>, <13, 1>, <17, 1>, <31, 1>, <41, 1>,
    <61681, 1> ],
    [ <3, 1>, <5, 1>, <17, 1>, <23, 1>, <89, 1>, <257, 1>, <397, 1>, <683, 1>,
    <2113, 1> ],
    [ <3, 1>, <5, 1> ],
    [ <3, 2>, <5, 1>, <7, 1>, <11, 1>, <13, 1>, <17, 1>, <31, 1>, <41, 1>,
    <61681, 1> ],
    [ <3, 1>, <31, 1>, <8191, 1> ],
    [ <3, 2>, <5, 1>, <7, 1>, <11, 1>, <13, 1>, <17, 1>, <31, 1>, <41, 1>,
    <61681, 1> ],
    [ <3, 3>, <5, 1>, <7, 1>, <13, 1>, <17, 1>, <19, 1>, <29, 1>, <37, 1>,
    <43, 1>, <73, 1>, <109, 1>, <113, 1>, <127, 1>, <257, 1> ],
    [ <5, 1> ],
    [ <3, 1>, <5, 1> ],
    [ <3, 1>, <5, 2>, <11, 1>, <17, 1>, <31, 1>, <41, 1>, <53, 1>, <157, 1>,
    <1613, 1>, <2731, 1>, <8191, 1> ],
    [ <3, 2>, <5, 1>, <7, 1>, <13, 1>, <17, 1>, <97, 1>, <241, 1>, <257, 1>,
    <673, 1> ],
    [ <3, 1>, <5, 1>, <17, 1>, <29, 1>, <43, 1>, <113, 1>, <127, 1>, <257, 1>,
    <65537, 1> ],
    [ <3, 1>, <5, 2>, <11, 1>, <29, 1>, <31, 1>, <41, 1>, <43, 1>, <113, 1>,
    <127, 1> ],
    [ <3, 1>, <5, 2>, <11, 1>, <17, 1>, <31, 1>, <41, 1>, <53, 1>, <157, 1>,
    <1613, 1>, <2731, 1>, <8191, 1> ],
    [ <3, 2>, <5, 2>, <11, 1>, <13, 1>, <17, 1>, <31, 1>, <41, 1>, <61, 1>,
    <151, 1>, <257, 1>, <331, 1>, <1321, 1> ],
    [ <3, 1>, <5, 1>, <11, 1>, <31, 1>, <41, 1>, <257, 1>, <61681, 1>,
    <4278255361, 1> ],
    [ <3, 2>, <5, 1>, <7, 1>, <11, 1>, <13, 1>, <17, 1>, <31, 1>, <41, 1>,
    <61681, 1> ],
    [ <3, 1>, <5, 1>, <17, 1>, <23, 1>, <89, 1>, <257, 1>, <397, 1>, <683, 1>,
    <2113, 1> ], [ <3, 2>, <5, 1>, <7, 1>, <11, 1>, <13, 1>, <23, 1>, <31, 1>,
    <41, 1>, <89, 1>, <397, 1>, <683, 1>, <2113, 1> ]
]
```

### Abstract Group Predicates

<a id="function-isabelian-grpmat"></a>
#### `IsAbelian(G): GrpMat -> BoolElt`

Returns `true` if the group $G$ is abelian, `false` otherwise.

<a id="function-iscyclic-grpmat"></a>
#### `IsCyclic(G): GrpMat -> BoolElt`

Returns `true` if the group $G$ is cyclic, `false` otherwise.

<a id="function-iselementaryabelian-grpmat"></a>
#### `IsElementaryAbelian(G): GrpMat -> BoolElt`

Returns `true` if the group $G$ is elementary abelian, `false` otherwise.

<a id="function-isnilpotent-grpmat"></a>
#### `IsNilpotent(G): GrpMat -> BoolElt`

Returns `true` if the group $G$ is nilpotent, `false` otherwise.

<a id="function-issoluble-grpmat"></a>
#### `IsSoluble(G): GrpMat -> BoolElt`

<a id="function-issolvable-grpmat"></a>
#### `IsSolvable(G): GrpMat -> BoolElt`

Returns `true` if the group $G$ is soluble, `false` otherwise.

<a id="function-isperfect-grpmat"></a>
#### `IsPerfect(G): GrpMat -> BoolElt`

Returns `true` if the group $G$ is perfect, `false` otherwise.

<a id="function-issimple-grpmat"></a>
#### `IsSimple(G): GrpMat -> BoolElt`

Returns `true` if the group $G$ is simple, `false` otherwise.

<a id="example-ex-3d20f4"></a>
#### `Example: Order and Predicates of a Matrix Group (ex-3d20f4)`

We illustrate the functions of the last two section by applying them to a group of degree $6$ over the field ${\bf F}_{9}$.

```magma
> F9<w> := GF(9);
> y := w^6;  z := w^2;
> J2A2 := MatrixGroup< 6, F9 | [y, 1-y, z,0,0,0, 1-y ,z, -1,0,0,0, z, -1,1+y,
>                               0,0,0,0,0,0, z, 1+y, y, 0,0,0,1+y, y, -1, 0,
>                               0,0, y ,-1,1-y],
>                              [1+y, z, y, 0,0,0, z, 1+y, z, 0,0,0, y, z, 1+y,
>                               0,0,0, z, 0,0,1-y, y, z, 0, z, 0, y, 1-y, y,
>                               0,0, z, z, y, 1-y],
>                              [0,0,0,y, 0,0, 0,0,0,0,y, 0, 0,0,0,0,0,y,
>                               y, 0,0,0,0,0, 0,y, 0,0,0,0, 0,0,y, 0,0,0] >;
> J2A2;
MatrixGroup(6, GF(3, 2))
Generators:
[w^6 w^3 w^2   0   0   0]
[w^3 w^2   2   0   0   0]
[w^2   2   w   0   0   0]
[  0   0   0 w^2   w w^6]
[  0   0   0   w w^6   2]
[  0   0   0 w^6   2 w^3]

[  w w^2 w^6   0   0   0]
[w^2   w w^2   0   0   0]
[w^6 w^2   w   0   0   0]
[w^2   0   0 w^3 w^6 w^2]
[  0 w^2   0 w^6 w^3 w^6]
[  0   0 w^2 w^2 w^6 w^3]

[  0   0   0 w^6   0   0]
[  0   0   0   0 w^6   0]
[  0   0   0   0   0 w^6]
[w^6   0   0   0   0   0]
[  0 w^6   0   0   0   0]
[  0   0 w^6   0   0   0]
> Order(J2A2);
1209600
> FactoredOrder(J2A2);
[ <2, 8>, <3, 3>, <5, 2>, <7, 1> ]
> IsSoluble(J2A2);
false
> IsPerfect(J2A2);
true
> IsSimple(J2A2);
false
```

Thus the group is non-soluble and perfect but it is not a simple group. We examine its Sylow$2$-subgroup.

```magma
> S2 := SylowSubgroup(J2A2, 2);
> IsAbelian(S2);
false
> IsNilpotent(S2);
true
> IsSpecial(S2);
false
```

### Conjugacy

<a id="function-class-grpmat-grpmatelt"></a>
#### `Class(H, x): GrpMat, GrpMatElt -> { GrpMatElt }`

<a id="function-conjugates-grpmat-grpmatelt"></a>
#### `Conjugates(H, x): GrpMat, GrpMatElt -> { GrpMatElt }`

Given a group $H$ and an element $x$ belonging to a group $K$ such that $H$ and $K$ are subgroups of the same general linear group, this function returns the set of conjugates of $x$ under the action of $H$. If $H = K$, the function returns the conjugacy class of $x$ in $H$.

<a id="function-classmap-grpmat"></a>
#### `ClassMap(G): GrpMat -> Map`

Given a group $G$, construct the conjugacy classes and the class map $f$ for $G$. For any element $x$ of $G$, $f(x)$ will be the conjugacy class representative chosen by the `Classes` function.

<a id="function-conjugacyclasses"></a>
#### `ConjugacyClasses(G: parameters): GrpMat -> [ < RngIntElt, RngIntElt, GrpMatElt > ]`

<a id="function-classes-grpmat"></a>
#### `Classes(G: parameters): GrpMat -> [ < RngIntElt, RngIntElt, GrpMatElt > ]`

```magma
WeakLimit  : RngIntElt                    Default: 500
StrongLimit: RngIntElt                    Default: 5000
Al         : MonStgElt                    Default: 
```

Construct a set of representatives for the conjugacy classes of the matrix group $G$. The classes are returned as a sequence of triples containing the element order, the class length, and a representative element for the class. The parameter `Al` enables the user to select the algorithm that is to be used.

`Al := "Action"`: Create the classes of $G$ by computing the orbits of the set of elements of $G$ under the action of conjugation. This option is only feasible for small groups.

`Al := "Random"`: Construct the conjugacy classes of elements for a matrix group $G$ using an algorithm that searches for representatives of all conjugacy of $G$ by examining a random selection of group elements and their powers. The behaviour of this algorithm is controlled by two associated optional parameters `WeakLimit` and `StrongLimit`, whose values are positive integers $n_1$ and $n_2$, say. Before describing the effect of these parameters, some definitions are needed: A mapping $f: G\rightarrow I$ is called a class invariant if $f(g) = f(g^h)$ for all $g, h\in G$. In matrix groups, the primary invariant factors are used where possible, or the characteristic or minimal polynomials otherwise. Two matrices $g$ and $h$ are said to be *weakly conjugate* with respect to the class invariant $f$ if $f(g) = f(h)$. By definition, conjugacy implies weak conjugacy, but the converse is false. The random algorithm first examines $n_1$ random elements and their powers, using a test for weak conjugacy. It then proceeds to examine a further $n_2$ random elements and their powers, using a test for ordinary conjugacy. The idea behind this strategy is that the algorithm should attempt to find as many classes as possible using the very cheap test for weak conjugacy, before employing the more expensive ordinary conjugacy test to recognize the remaining classes.

`Al := "Extend"`: Construct the conjugacy classes of $G$ by first computing classes in a quotient $G/N$ and then extending these classes to successively larger quotients $G/H$ until the classes for $G/1$ are known. More precisely, a series of subgroups $1 = G_0 < G_1 < \cdots < G_r = R < G$ is computed such that $R$ is the (solvable) radical of $G$ and $G_{i+1}/G_i$ is elementary abelian. The radical quotient $G/R$ is computed and its classes and centralizers of their representatives found using the permutation group algorithm, and pulled back to $G$. The parameters `TFAl` and `ASAl` control the algorithm used to compute the classes of $G/R$. See the [`GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/index-permutation-groups.md#chapgrpperm) chapter for more information on these parameters.

To extend from $G/G_{i+1}$ to the next larger quotient $G/G_i$, an affine action of each centralizer on a quotient of the elementary abelian layer $G_{i+1}/G_i$ is computed. Each distinct orbit in that action gives rise to a new class of the larger quotient (see Mecky and Neubuser [[MN89](https://docs.magma-maths.org/references.md#cite-mecky-neubuser)]).

`Al := "Lifting"`: Construct a permutation representation for $G$, compute the classes of the representation, and lift them back to $G$ through the kernel of the representation. Successful when the kernel is small. Currently uses the permutation action of $G$ on its first basic orbit as the permutation representation.

`Al := "Classic"`: Construct the conjugacy classes by the enumeration of class invariants or by the algorithms described in [[Fra20](https://docs.magma-maths.org/references.md#cite-defranceschi-2020)]. This option is available only for the following classical groups.

**(i)**
groups containing the special linear group;

**(ii)**
the symplectic groups;

**(iii)**
in odd characteristic, the subgroups of the conformal symplectic group that contain the symplectic group;

**(iv)**
the conformal unitary group;

**(v)**
subgroups of the general unitary group that contain the special unitary group;

**(vi)**
the general and special orthogonal groups and the derived groups of the special orthogonal groups;

**(vii)**
the conformal orthogonal groups in odd characteristic.

*Default*: The `Classic` algorithm will be used if $G$ is recognised to be one of the groups in the above list and $|G| > 100$.

The action algorithm will be used if $|G| \leq 2000$. If $G$ is soluble, classes are computed in a PC-representation of $G$.

When $|G| >  2000$, $G$ is not classical, and the base ring of $G$ is a finite field, the `Extension` algorithm is used.

Otherwise the `Lifting` algorithm is used, unless the kernel size exceeds 10000. If there is a big kernel and the base ring of the group can be embedded in a field then the extension algorithm is used. If this does not succeed the random algorithm will be applied with the limits given by the parameters `WeakLimit` and `StrongLimit`. If that fails to compute all the classes and $|G|\leq 100000$, then the action algorithm will be used.

<a id="function-classrepresentative-grpmat-grpmatelt"></a>
#### `ClassRepresentative(G, x): GrpMat, GrpMatElt -> GrpMatElt`

<a id="function-classrepresentative-grpmat-rngintelt"></a>
#### `ClassRepresentative(G, i): GrpMat, RngIntElt -> GrpMatElt`

Given a group $G$ for which the conjugacy classes are known, return the designated representative for the conjugacy class of $G$ containing $x$ or the stored representative for conjugacy class $i$.

<a id="function-classcentraliser-grpmat-rngintelt"></a>
#### `ClassCentraliser(G, i): GrpMat, RngIntElt -> GrpMat`

<a id="function-classcentralizer-grpmat-rngintelt"></a>
#### `ClassCentralizer(G, i): GrpMat, RngIntElt -> GrpMat`

The centraliser of the representative element stored for conjugacy class number $i$ in group $G$. The group computed is stored with the class table for reference by future calls to this function.

<a id="function-classrepresentativefrominvariants-grpmat-seqenum-seqenum-fldfinelt"></a>
#### `ClassRepresentativeFromInvariants(G, p, h, t): GrpMat, SeqEnum, SeqEnum, FldFinElt -> GrpMatElt`

Given a group $G$, for which the *classic* algorithm for computing conjugacy classes is available, and the class invariants $p$, $h$, and $t$, return the standard class representative for the conjugacy class in $G$ with the given invariants. Currently this is available only for the general linear group and the conformal unitary group.

<a id="function-isconjugate-grpmat-grpmatelt-grpmatelt"></a>
#### `IsConjugate(G, g, h): GrpMat, GrpMatElt, GrpMatElt -> BoolElt, GrpMatElt | Unass`

Given a group $G$ and elements $g$ and $h$ belonging to $G$, return the value `true` if $g$ and $h$ are conjugate in $G$. The function returns a second value in the event that the elements are conjugate: an element $k$ which conjugates $g$ into $h$.

<a id="function-numberofclasses-grpmat"></a>
#### `NumberOfClasses(G): GrpMat -> RngIntElt`

<a id="function-nclasses-grpmat"></a>
#### `Nclasses(G): GrpMat -> RngIntElt`

The number of conjugacy classes of elements for the group $G$.

<a id="function-powermap-grpmat"></a>
#### `PowerMap(G): GrpMat -> Map`

Given a group $G$, construct the power map for $G$. Suppose that the order of $G$ is $m$ and that $G$ has $r$ conjugacy classes. When the classes are determined by Magma, they are numbered from $1$ to $r$. Let $C$ be the set of class indices $\{ 1, \ldots, r \rbrace$ and let $P$ be the set of integers $\{ 1, \ldots, m \rbrace$. The *power map* $f$ for $G$ is the mapping,  $f : C \times P \rightarrow C$ where the value of $f(i, j)$ for $i \in C$ and $j \in P$ is the number of the class which contains $x_i^j$, where $x_i$ is a representative of the $i$-th conjugacy class.

<a id="procedure-assertattribute-grpmat-monstgelt-seqenum-classes"></a>
#### `AssertAttribute(G, "Classes", Q): GrpMat, MonStgElt, SeqEnum`

The preferred method for setting this attribute is ``G`Classes := Q;`` and this should be used instead of `AssertAttribute`. Given a group $G$, and a sequence $Q$ of $k$ distinct elements of $G$, one from each conjugacy class, use $Q$ to define the classes attribute of $G$. The sequence $Q$ may be one of 3 options. The first is a sequence of elements of $G$. The second is a sequence of pairs `<GrpMatElt, RngIntElt>` giving class representatives and their class length. In these cases the ordering of the classes may not be preserved. The third possibility is giving the classes by element order, class length, and class representative as a sequence of triples `<RngIntElt, RngIntElt, GrpMatElt>`. In this last case the triples must be ordered by element order, then by class length, and then the classes are installed into $G$ in the order given.

<a id="example-ex-f393ee"></a>
#### `Example: Conjugacy Classes from the Rational Database (ex-f393ee)`

We take a group from the database of rational matrix groups and compute its conjugacy classes. The group has degree 12 and is written over the integers.

```magma
> DB := RationalMatrixGroupDatabase();
> G := Group(DB, 12, 3);
> FactoredOrder(G);
[ <2, 17>, <3, 8>, <5, 2> ]
> CompositionFactors(G);
    G
    |  Cyclic(2)
    *
    |  Cyclic(2)
    *
    |  C(2, 3)                = S(4, 3)
    *
    |  Cyclic(2)
    *
    |  Cyclic(2)
    *
    |  C(2, 3)                = S(4, 3)
    *
    |  Cyclic(2)
    1
```

The conjugacy classes of `G` are computed as follows:

```magma
> time cl := Classes(G);
Time: 18.580
> #cl;
1325
```

The group has 1325 conjugacy classes of elements.

#### Conjugacy in Classical Groups

According to Kleidman and Liebeck [[KL90](https://docs.magma-maths.org/references.md#cite-kl90)] a group $G$ is a finite classical group if $\Omega\subseteq G\subseteq A$ or $\overline{\Omega}\subseteq G\subseteq \overline{A}$, where $\Omega$ and $A$ are given by the following table and where the symbols $\overline{\Omega}$ and $\overline{A}$ denote the groups $\Omega$ and $A$ modulo scalars.

```
   type        Omega        Delta     A
   ----------------------------------------------
   linear      SL(n,q)      GL(n,q)   GammaL*(n,q)
   symplectic  Sp(n,q)      CSp(n,q)  GammaSp(n,q)
   unitary     SU(n,q)      CU(n,q)   GamaU(n,q)
   orthogonal  Omega^e(n,q) CO^e(n,q) GammaO^e(n,q)
   ------------------------------------------------
```

If $V$ is a vector space of dimension $n$ over the field ${\bf F}_{q}$, then ${\operatorname{\Gamma L}}^*(n,q)$ is the set of all semilinear bijections from $V$ to $V$ together with all semilinear bijections from $V$ to $V^*$. There is a well-defined multiplication (see [[Tay92](https://docs.magma-maths.org/references.md#cite-taylor-1992)]) which makes this set a group; the group ${\operatorname{\Gamma L}}(n,q)$ of all semilinear transformations of $V$ is a subgroup of index $2$. The other groups in column $A$ are the subgroups of ${\operatorname{\Gamma L}}(n,q^d)$ which preserve an alternating, hermitian, or quadratic form up to a scalar multiple, where $d$ is $2$ in the case of unitary groups and $1$ otherwise.

The groups in the last three rows of column $\Delta$ are the so-called *conformal* groups; they are the groups $A\cap\GL(n,q)$ which preserve an alternating, hermitian, or quadratic form up to a scalar multiple.

Important examples of classical groups, which in general are in neither column $\Omega$ nor column $\Delta$, are the general orthogonal groups $\GO^\eps(n,q)$, which preserve a quadratic form. In Magma these are the groups `GO(n,q), GOPlus(n,q)` or `GOMinus(n,q)` where $\eps$ is respectively $0$, $+$, or $-$.

As described in the documentation for the [`ConjugacyClasses`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/conjugate.md#function-conjugacyclasses) intrinsic, Magma constructs the classes by computing a complete collection of invariants and then determining a representative matrix for each invariant or by using the algorithms described in [[Fra20](https://docs.magma-maths.org/references.md#cite-defranceschi-2020)].

The intention is to implement this for all groups $G$ such that $\Omega\subseteq G\subseteq \Delta$. Currently this implementation is invoked automatically when constructing the conjugacy classes for $G$ such that $\SL(n,q)\subseteq G\subseteq \GL(n,q)$, the symplectic groups $G = \Sp(2n,q)$, the unitary groups $\SU(n,q)\subseteq G\subseteq \GU(n,q)$, the conformal unitary groups $\CU(n,q)$, and the orthogonal groups $\Omega^\eps(n,q)$, $\SO^\eps(n,q)$, and $\GO^\eps(n,q)$ where $\eps$ is $0$, $+$, or $-$. In addition, when $q$ is odd, it is invoked for the conformal groups symplectic groups $\CSp(2n,q)$ and the conformal orthogonal groups $\CO^\eps(n,q)$

The implementation is based on Milnor [[Mil69](https://docs.magma-maths.org/references.md#cite-milnor-1969)] combined with the fundamental work of Wall [[Wal63](https://docs.magma-maths.org/references.md#cite-wall-1963)] as interpreted in Gonshaw, Liebeck and O’Brien [[GLO17](https://docs.magma-maths.org/references.md#cite-gonshaw-etal-2017)] and the theses of Fulman [[Ful97a](https://docs.magma-maths.org/references.md#cite-fulman-phd)], Britnell [[Bri03](https://docs.magma-maths.org/references.md#cite-britnell-dphil)], and De Franceschi [[Fra18](https://docs.magma-maths.org/references.md#cite-defranceschi-2018), [Fra20](https://docs.magma-maths.org/references.md#cite-defranceschi-2020)].

**Class invariants.** The conjugacy classes in the group ${\operatorname{GL}}(n,q)$ are parametrised by sequences of pairs $\langle f,\mu(f)\rangle$ where $f$ is an irreducible polynomial and $\mu(f)$ is a partition such that

$$
\sum_f\deg(f)|\mu(f)| = n.
$$

In the following description a partition of an integer $n$ will be represented either by a sequence $[\lambda_1,\lambda_2,\dots,\lambda_r]$ such that $\lambda_1\ge\lambda_2\ge\cdots\ge\lambda_r$ and $n= \sum_{i=1}^r\lambda_i$ or by the sequence of multiplicities $[\langle 1,m_1\rangle, \langle 2,m_2\rangle,\dots, \langle n,m_n\rangle]$, omitting the terms with $m_i = 0$, where $n = \sum_{i=1}^n im_i$.

For the conjugacy classes of the classical groups there are restrictions on the polynomials and partitions that can occur.

If $f(t)\in k[t]$ is a polynomial of degree $d$ (over a field $k$) such that $f(0)\ne 0$, the *dual* of $f(t)$ is the polynomial $f^*(t) = f(0)^{-1}t^df(t^{-1})$.

A polynomial $f(t)$ is $*$-*symmetric* if $f^*(t) = f(t)$; it is $*$-*irreducible* if it has no proper $*$-symmetric factors.

<a id="function-dualpolynomial-rngupolelt"></a>
##### `DualPolynomial(f): RngUPolElt -> RngUPolElt`

The dual of the polynomial $f$.

<a id="function-starirreduciblepolynomials-fldfin-rngintelt"></a>
##### `StarIrreduciblePolynomials(F, d): FldFin, RngIntElt -> SeqEnum`

The sequence of all $*$-irreducible polynomials of degree $d$ with coefficients in $F$.

**Symplectic groups.** If $g\in{\operatorname{Sp}}(2n,q)$, then $g$ preserves a non-degenerate alternating form and from this it follows that the minimal polynomial of $g$ is $*$-symmetric. A symplectic *signed partition* of an integer $n$ is a sequence $[\langle 1,m_1\rangle, \langle\pm2,m_2\rangle,\dots, \langle n,m_n\rangle]$, such that the unsigned sequence $[\langle 1,m_1\rangle, \langle 2,m_2\rangle,\dots, \langle n,m_n\rangle]$ is a partition of $n$, where $m_i$ is even for all odd $i$. Only the terms $\langle i,m_i\rangle$ where $i$ is even are signed.

The conjugacy classes of ${\operatorname{Sp}}(2n,q)$ are in one-to-one correspondence with sequences of pairs $\langle f,\mu(f)\rangle$, where $f$ is a $*$-irreducible polynomial and $\mu(f)$ is a partition if $\deg (f) > 1$ and a symplectic signed partition if $\deg(f) = 1$. (Note that $t -1$ and $t + 1$ are the only $*$-irreducible polynomials of odd degree.) When $q$ is a power of 2, more elaborate labels are needed to distinguish the conjugacy classes.

After invoking the command `cc := Classes(G);` the conjugacy classes for of the group $G$ will be returned as the value of `cc` and assigned to ``G`Classes``. In addition, the labels for the conjugacy classes will be assigned either to ``G`Labels_S`` or ``G`Labels_A`` (or both). These labels are used internally.

**Conformal symplectic groups.** If $g$ belongs to the conformal symplectic group $C$ over the field $F$ there is a non-zero element $\phi\in F$ such that $gJg^{\mathrm{tr}} = \phi J$, where $J$ is the matrix of the alternating form preserved by $C$. In this case the minimal polynomial of $g$ is $\phi$-symmetric in the sense of the following definition.

Given $\phi\in F^\times$ and a polynomial $f(t)$ of degree $d$ such that $f(0)\ne 0$, the $\phi$-*dual* of $f(t)$ is

$$
f^{[\phi]}(t) = f(0)^{-1}t^d f(\phi t^{-1}).
$$

The polynomial $f(t)$ is $\phi$-*symmetric* if $f^{[\phi]}(t) = f(t)$. Thus $f(t)$ is $\phi$-symmetric if and only if $t^d f(\phi t^{-1}) = f(0)f(t)$. For example $t^2 - \phi$ and $t^2 + \phi$ are $\phi$-symmetric and if $\phi = \lambda^2$, then $t - \lambda$ and $t + \lambda$ are $\phi$-symmetric.

A polynomial $f(t)$ is $\phi$-*irreducible* if it is $\phi$-symmetric and has no proper $\phi$-symmetric factors.

<a id="function-phidual-rngupolelt"></a>
##### `PhiDual(f, phi): RngUPolElt -> RngUPolElt`

The $\phi$-dual of the polynomial $f$.

<a id="function-phiirreduciblepolynomials-fldfin-rngintelt"></a>
##### `PhiIrreduciblePolynomials(F, d): FldFin, RngIntElt -> SeqEnum[Tup]`

The sequence of pairs $\langle\phi,\ \hbox{\tt pols}\rangle$ where `pols` is the sequence of all monic polynomials of degree $d$ over the field $F$ with no proper $\phi$-symmetric factor and $\phi$ runs through the non-zero elements of $F$.

Each conjugacy class of ${\operatorname{CSp}}(2n,q)$ will be represented by a pair $\langle \phi, \Xi\rangle$, where $\phi\in F^\times$ and $\Xi$ is an indexed set of pairs $\langle f,\mu\rangle$, where $f$ is a $\phi$-irreducible polynomial and $\mu$ is either a partition or, in the case that $f$ divides $t^2 - \phi$, a symplectic signed partition. That is, a conjugacy class invariant has the form $\langle \phi, \{@~ \langle f_1,\mu_1\rangle, \langle f_2,\mu_2\rangle,\ \cdots\ @\}\rangle$.

**Extended symplectic groups.** A group $G$ is an *extended symplectic group* if ${\operatorname{Sp}}(n,q)\subseteq G \subseteq {\operatorname{CSp}}(n,q)$.

<a id="function-extendedsymplecticgroup-rngintelt-rngintelt-rngintelt"></a>
##### `ExtendedSymplecticGroup(n, q, m): RngIntElt, RngIntElt, RngIntElt -> GrpMat`

<a id="function-extendedsp-rngintelt-rngintelt-rngintelt"></a>
##### `ExtendedSp(n, q, m): RngIntElt, RngIntElt, RngIntElt -> GrpMat`

The subgroup of ${\operatorname{CSp}}(n,q)$ that contains ${\operatorname{Sp}}(n,q)$ as a subgroup of index $m$.

<a id="function-indexofsp-grpmat"></a>
##### `IndexOfSp(G): GrpMat -> RngIntElt`

The index of the symplectic group in $G$. This function fails with a runtime exception if $G$ is not an extended symplectic group.

**Unitary groups.** If $f(t)\in k[t]$ is a polynomial of degree $d$ (over a field $k$ with an automorphism $x \mapsto \overline x$ where $x\ne\overline{x}$ and $\overline{\overline{x}} = x$) such that $f(0)\ne 0$, the *twisted dual* of $f(t)$ is the polynomial $f^\sim(t) = \overline{f(0)}^{-1}t^d \overline{f}(t^{-1})$.

A polynomial $f(t)$ is *tilde-symmetric* if $f^\sim(t) = f(t)$; it is *tilde-irreducible* if it has no proper tilde-symmetric factors. If $g\in {\operatorname{GU}}(n,q)$, then $g$ preserves a non-degenerate hermitian form and from this it follows that the minimal polynomial of $g$ is tilde-symmetric with respect to the automorphism $x \mapsto x^q$ of ${\bf F}_{q^2}$.

<a id="function-tildedualpolynomial-rngupolelt"></a>
##### `TildeDualPolynomial(f): RngUPolElt -> RngUPolElt`

The twisted dual of the polynomial $f$.

<a id="function-tildeirreduciblepolynomials-rngintelt-rngintelt"></a>
##### `TildeIrreduciblePolynomials(q, d): RngIntElt, RngIntElt -> SeqEnum`

The sequence of all tilde-irreducible polynomials of degree $d$ with coefficients in $GF(q^2)$.

The conjugacy classes of ${\operatorname{GU}}(n,q)$ are in one-to-one correspondence with sequences of pairs $\langle f,\mu(f)\rangle$, where $f$ is a tilde-irreducible polynomial and $\mu(f)$ is a partition, written as a sequence of multiplicities $\langle i, m_i \rangle$.

**Extended special unitary groups.** A group $G$ is an *extended special unitary group* of index $m$ if ${\operatorname{SU}}(n,q)\subseteq G \subseteq {\operatorname{GU}}(n,q)$ and $m = |G : {\operatorname{SU}}(n,q)|$.

<a id="function-extendedspecialunitarygroup-rngintelt-rngintelt-rngintelt"></a>
##### `ExtendedSpecialUnitaryGroup(n, q, m): RngIntElt, RngIntElt, RngIntElt -> GrpMat`

<a id="function-extendedsu-rngintelt-rngintelt-rngintelt"></a>
##### `ExtendedSU(n, q, m): RngIntElt, RngIntElt, RngIntElt -> GrpMat`

The subgroup of ${\operatorname{GU}}(n,q)$ that contains ${\operatorname{SU}}(n,q)$ as a subgroup of index $m$.

<a id="function-indexofsu-grpmat"></a>
##### `IndexOfSU(G): GrpMat -> RngIntElt`

The index of the special unitary group in $G$. This function fails with a runtime exception if $G$ is not an extended special unitary group.

**Orthogonal groups.** An orthogonal *signed partition* of an integer $n$ is a sequence

$$
[\langle\pm1,m_1\rangle, \langle 2,m_2\rangle,\dots, \langle n,m_n\rangle],
$$

such that the unsigned sequence $[\langle 1,m_1\rangle, \langle 2,m_2\rangle,\dots, \langle n,m_n\rangle]$ is a partition of $n$ (in multiplicity format), where $m_i$ is even for all even $i$. Only the terms $\langle i,m_i\rangle$ where $i$ is odd are signed.

The conjugacy classes of ${\operatorname{GO}}^\varepsilon(n,q)$ are in one-to-one correspondence with sequences of pairs $\langle f,\mu(f)\rangle$, where $f$ is a $*$-irreducible polynomial and $\mu(f)$ is a partition if $\deg (f) > 1$ and an orthogonal signed partition if $\deg(f) = 1$. (Note that $t -1$ and $t + 1$ are the only $*$-irreducible polynomials of odd degree.) When $q$ is a power of 2, more elaborate labels are needed to distinguish the conjugacy classes.

**Standard and natural classical groups.**

Here we describe intrinsics to list conjugacy classes, determine centralisers, and decide conjugacy in the classical groups. The classes are listed using algorithms developed and implemented by De Franceschi [[Fra18](https://docs.magma-maths.org/references.md#cite-defranceschi-2018), [Fra20](https://docs.magma-maths.org/references.md#cite-defranceschi-2020)], Gonshaw, Liebeck and O’Brien [[GLO17](https://docs.magma-maths.org/references.md#cite-gonshaw-etal-2017)], and Taylor. The algorithms to construct centralisers and decide conjugacy were developed and implemented by De Franceschi [[Fra18](https://docs.magma-maths.org/references.md#cite-defranceschi-2018), [Fra20](https://docs.magma-maths.org/references.md#cite-defranceschi-2020)], and De Franceschi, O’Brien and Liebeck [[FLO25](https://docs.magma-maths.org/references.md#cite-dfol-classes)]. O’Brien and Taylor prepared the final versions of these functions for inclusion in Magma.

The functions listed below with arguments (`type`, $d$, $q$) refer to the ‘standard’ classical groups: the groups returned by Magma functions such as `GU(d,q)` and so on. The accepted values for the argument (or parameter) `type` are the strings `"SL", "GL", "Sp", "SU", "GU", "Omega+", "Omega-", "Omega", "SO+", "SO-", "SO", "GO+", "GO-",` and `"GO"`.

The conjugates of these groups within the ambient general linear group are the ‘natural copy’ classical groups. Those functions which accept as argument a group $G$ can be applied to all such `conjugates` of the standard copy of $G$. The type of a standard or natural copy of $G$ is returned by `ClassicalGroupType`.

<a id="function-classicalconjugacyclasses-grpmat"></a>
##### `ClassicalConjugacyClasses(G): GrpMat -> SeqEnum, SetIndx`

<a id="function-classicalclasses-grpmat"></a>
##### `ClassicalClasses(G): GrpMat -> SeqEnum, SetIndx`

The sequence of conjugacy classes and the corresponding sequence of labels for the natural classical group $G$.

<a id="function-classicalconjugacyclasses-monstgelt-rngintelt-rngintelt"></a>
##### `ClassicalConjugacyClasses(type, d, q): MonStgElt, RngIntElt, RngIntElt -> SeqEnum, SetIndx`

<a id="function-classicalclasses-monstgelt-rngintelt-rngintelt"></a>
##### `ClassicalClasses(type, d, q): MonStgElt, RngIntElt, RngIntElt -> SeqEnum, SetIndx`

The conjugacy classes and their labels for the standard classical group of the supplied type, rank $d$, and field size $q$.

<a id="function-classicalcentralizer-grpmat-grpmatelt"></a>
##### `ClassicalCentralizer(G, g): GrpMat, GrpMatElt -> GrpMat`

The centralizer of $g$ in the natural classical group $G$.

<a id="function-classicalcentraliserorder-grpmat-grpmatelt"></a>
##### `ClassicalCentraliserOrder(G, g): GrpMat, GrpMatElt -> RngIntEltFact`

The factored order of the centralizer of $g$ in the natural classical group $G$.

<a id="function-classicalclasssize-grpmat-grpmatelt"></a>
##### `ClassicalClassSize(G, g): GrpMat, GrpMatElt -> RngIntElt`

The size of the conjugacy class of $g$ in the natural classical group $G$.

<a id="function-classicalisconjugate-grpmat-grpmatelt-grpmatelt"></a>
##### `ClassicalIsConjugate(G, g, h): GrpMat, GrpMatElt, GrpMatElt -> BoolElt, GrpMatElt`

If $g$ and $h$ are conjugate in the natural classical group $G$, return `true` and a conjugating element, otherwise return `false`.

<a id="example-ex-99ff8c"></a>
##### `Example: Centralisers in an Orthogonal Group (ex-99ff8c)`

```magma
> G := OmegaPlus (16, 4);

> // some natural copy of the group
> G := RandomConjugate (G);

> g := Random (G);

> z := ClassicalCentraliserOrder (G, g);

> C := ClassicalCentraliser (G, g);

> FactoredOrder (C) eq z;

true

> g := Random (G);

> m := ClassicalClassSize (G, g);

> C := ClassicalCentraliser (G, g);
> #G div #C eq m;
true

> x := Random (G);
> flag, c := ClassicalIsConjugate (G, g, g^x);
> g^c eq g^x;
true
```

<a id="function-classicalclassmap-grpmat"></a>
##### `ClassicalClassMap(G): GrpMat -> Map`

<a id="function-classicalclassmap-grpmat-seqenum-setindx"></a>
##### `ClassicalClassMap(G, C, L): GrpMat, SeqEnum, SetIndx -> Map`

```magma
type: MonStgElt                    Default: 
```

The class map for the natural classical group $G$. The input parameters $C$ and $L$ are the outputs of `ClassicalClasses`: $C$ is the sequence of classes and $L$ is the list of corresponding labels. The optional parameter `type` is the type of the classical group.

<a id="function-classesforfixedsemisimple-grpmat-grpmatelt"></a>
##### `ClassesForFixedSemisimple(G, x): GrpMat, GrpMatElt -> SeqEnum, SetIndx`

Given a semisimple element $x$ in a natural classical group $G$ return representatives and labels of the conjugacy classes in $G$ with semisimple part $x$.

<a id="function-isometrygroupclasslabel-monstgelt-grpmatelt"></a>
##### `IsometryGroupClassLabel(type, g): MonStgElt, GrpMatElt -> SetMulti`

Return a label for the conjugacy class of the element $g$ of the standard isometry group $G$ determined by `type`. The labels of the elements of $G$ agree if and only if the elements are conjugate in $G$. The allowed types are `"GU"`, `"Sp"`, `"GO+"`, `"GO-"`, and `"GO"`.

<a id="example-ex-af187c"></a>
##### `Example: Classical Class Map for SO+(6, 9) (ex-af187c)`

```magma
> G := SOPlus (6, 9);

> g := G.1^G.2;

> Cg := ClassicalCentraliser (G, g);

> #Cg;
728

> C := ClassicalClasses (G);
> phi := ClassicalClassMap (G);

> index := phi (g);
> index;
123

> assert #G div C[index][2] eq #Cg;

> g := C[11][3]^G.1;
> h := C[12][3]^G.1;
> label_g := IsometryGroupClassLabel ("GO+", g);
> label_h := IsometryGroupClassLabel ("GO+", g);

> // are these elements conjugate in GO+?
> label_g eq label_h;
true

> // are these elements conjugate in G?
> ClassicalIsConjugate (G, g, h);

false
>
```

<a id="example-ex-745ee8"></a>
##### `Example: Conjugacy Classes of GO(7, 9) (ex-745ee8)`

```magma
> C, L := ClassicalClasses ("GO", 7, 9);
> L[4];
{*
    <0, $.1 + 1, {* <1, 1>^^5, <1, w> *}>,
    <0, $.1 + 2, {* <1, 1> *}>
*}
> G := GO(7, 9);
> phi := ClassicalClassMap (G, C, L);
> phi;
> X := {@ G.i^a * G.j^b: a in [1..Order (G.i)], b in [1..Order (G.j)],
>     i, j in [1..Ngens (G)] @};
> x := X[46];
> phi (x);
682
```

<a id="example-ex-fd370f"></a>
##### `Example: Products of Involutions in Sp(d, q) (ex-fd370f)`

Let $G = {\operatorname{Sp}}(d,q)$. For $g\in G$ let $\iota(g)$ be the minimal number $k$ such that $g$ is a product of $k$ involutions. If $d > 2$, $\iota(g)$ is well-defined for all $g\in G$ and depends only on the conjugacy class of $g$. In this example we define a function `iseq` which returns a sequence `reps`, where `reps[k]` is the set of conjugacy class representatives of elements $g$ such that $\iota(g) = k -1$. (If $g$ is the identity element, then $\iota(g) = 0$.)

```magma
> iseq := function(d,q)
>   G := Sp(d,q);
>   cc := ConjugacyClasses(G);
>   reps := [{ One(G) }];
>   labels := [{@ IsometryGroupClassLabel("Sp",One(G)) @}];
>   R := {c[3] : c in cc | c[1] eq 2};
>   T := &join[ Class(G,x) : x in R ];
>   L := {@ IsometryGroupClassLabel("Sp",t) : t in R @};
>
>   k := 1;
>   total := 1 + #R;
>   print "Layer", k, ":", #R;;
>
>   repeat
>     Append(~reps, R);
>     Append(~labels, L);
>     if total eq #cc then break; end if;
>     R := { };
>     L := {@  @};
>     k +:= 1;
>     for g in reps[k] do
>       for t in T do
>         h := g*t;
>         mu := IsometryGroupClassLabel("Sp",h);
>         if mu notin labels[k-1] and mu notin labels[k] and mu notin L then
>           Include(~R,h);
>           Include(~L, mu);
>           if total + #R eq #cc then break g; end if;
>         end if;
>       end for;
>     end for;
>     total +:= #R;
>     print "Layer", k, ":", #R;;
>   until IsEmpty(R);
>   return reps;
> end function;
```

The set `T` is the set of involutions. Given an element $g$ such that $\iota(g) = k$ and an involution $t\in T$, the function `IsometryGroupClassLabel` is used to check whether $g*t$ is conjugate to an element already in the sequence of conjugacy class representatives. This is considerably faster than using `ClassicalIsConjugate` because it avoids computing the conjugating element. (Thanks to Oliver Villa for suggesting this example.)

```magma
> reps := iseq(4,3);
Layer 1 : 2
Layer 2 : 3
Layer 3 : 7
Layer 4 : 15
Layer 5 : 6
```

<a id="function-unipotentclasses-monstgelt-rngintelt-rngintelt"></a>
##### `UnipotentClasses(type, d, q): MonStgElt, RngIntElt, RngIntElt -> SeqEnum, SeqEnum`

<a id="function-unipotentclasses-monstgelt-rngintelt-fldfin"></a>
##### `UnipotentClasses(type, d, F): MonStgElt, RngIntElt, FldFin -> SeqEnum, SeqEnum`

The conjugacy classes of the unipotent elements of the standard classical group of the supplied type, rank $d$, and field $F$, or field size $q$.

<a id="function-semisimpleclasses-monstgelt-rngintelt-rngintelt"></a>
##### `SemisimpleClasses(type, d, q): MonStgElt, RngIntElt, RngIntElt -> SeqEnum`

<a id="function-semisimpleclasses-monstgelt-rngintelt-fldfin"></a>
##### `SemisimpleClasses(type, d, F): MonStgElt, RngIntElt, FldFin -> SeqEnum`

The conjugacy classes of the semisimple elements of the standard classical group of the supplied type which preserves a form, rank $d$, and field $F$, or field size $q$.

<a id="function-isometrygroupnumberofclasses-monstgelt-rngintelt"></a>
##### `IsometryGroupNumberOfClasses(type, n): MonStgElt, RngIntElt -> RngUPolElt`

Return the number of conjugacy classes of the finite isometry group of given `type` and degree $n$ as a polynomial in the field size $q$. The allowed type is one of `"GL"`, `"GU"`, `"SpOdd"`, `"SpEven"`, `"GO+Even"`, `"GO+Odd"` `"GO-Even"`, `"GO-Odd"` and `"GO"`. Here `"Even"` and `"Odd"` indicate the characteristic of ${\bf F}_{q}$: the relevant polynomial depends on the characteristic.

<a id="example-ex-c14a80"></a>
##### `Example: Unipotent Classes of SU(12, 9) (ex-c14a80)`

```magma
> H := SU(12, 9);
> // set up just unipotent classes
> U := UnipotentClasses ("SU", 12, 9);
> #U;
88
> C := ClassicalCentraliser (H, U[4][3]);
> FactoredOrder (C);
[ <2, 2>, <3, 28>, <5, 1> ]
>
> K := Sp (6, 8);
> // set up just semisimple classes
> S := SemisimpleClasses ("Sp", 6, 8);
> // for each semisimple class rep, construct all classes for that rep
> G := Sp(6, 8);
> T := [ClassesForFixedSemisimple (G, S[i][3]): i in [1..#S]];
> // Total number of classes of K
> &+[#x: x in T];
684
>
> // polynomial for number of classes in isometry group of this rank
> f := IsometryGroupNumberOfClasses ("SpEven", 6);
> f;
q^3 + 2*q^2 + 5*q + 4
> Evaluate (f, 8);
684
```

<a id="function-projectiveclassicalclasses-monstgelt-rngintelt-rngintelt"></a>
##### `ProjectiveClassicalClasses(type, d, q): MonStgElt, RngIntElt, RngIntElt -> SeqEnum, GrpPerm, HomGrp, SeqEnum`

```magma
UseLMGHom   : BoolElt                    Default: false
MatricesOnly: BoolElt                    Default: false
```

The conjugacy classes for the standard projective classical group of the given type of dimension $d$ over the field of $q$ elements. The second return value is the projective group $P$, the third return value is the homomorphism from the classical matrix group $G$ to $P$ and fourth return value is the sequence of preimages of the class representatives of $P$ in $G$.

The accepted values for the argument `type` are the strings `"SL", "GL", "Sp", "SU", "GU", "Omega+", "Omega-", "Omega", "SO+", "SO-", "SO", "GO+", "GO-"` and `"GO"`, which describe the corresponding classical matrix group.

If the parameter `UseLMGHom` is `true`, the code will use `LMGHomomorphism` as the homomorphism from the matrix group to the projective group.

If the parameter `MatricesOnly` is `true`, matrices in the classical matrix group which represent the conjugacy classes in the projective group will be returned as the first (and only) return value.

<a id="function-projectiveclassicalcentraliser-grpmat-grpmatelt"></a>
##### `ProjectiveClassicalCentraliser(G, g): GrpMat, GrpMatElt -> GrpMat`

Return preimage in the standard classical group $G$ of the centraliser of image of $g$ in the central quotient of $G$. Note that $G$ must be the standard classical group with type listed as valid argument for `ProjectiveClassicalClasses`.

<a id="function-projectiveclassicalisconjugate-grpmat-grpmatelt-grpmatelt"></a>
##### `ProjectiveClassicalIsConjugate(G, g, h): GrpMat, GrpMatElt, GrpMatElt -> BoolElt, GrpMatElt`

If the images of $g$ and $h$ are conjugate in the central quotient of the classical group $G$, then return `true` and preimage in $G$ of a conjugating element, else return `false`. Note that $G$ must be the standard classical group with type listed as valid argument for `ProjectiveClassicalClasses`.

<a id="example-ex-fbd04d"></a>
##### `Example: Fast Projective Conjugacy Classes (ex-fbd04d)`

Using `ProjectiveClassicalClasses` to compute conjugacy classes is generally faster than using the generic function `ConjugacyClasses`.

```magma
> time cc, P, f, mm := ProjectiveClassicalClasses("SL",6,3);
Time: 0.150
> H := sub<Generic(P) | P>;
> time hh := Classes(H);
Time: 3.510
> P eq PSL(6,3);
true
```

<a id="example-ex-b45e6a"></a>
##### `Example: Projective Class Preimages as Matrices (ex-b45e6a)`

The preimages of the conjugacy classes of the standard projective classical group will be returned as a sequence of triples $\langle\, n, c, M\,\rangle$ where $n$ is the order of the matrix $M$ and $c$ is the number of conjugates of $M$.

```magma
> cc, P, f, mm := ProjectiveClassicalClasses("Sp",4,3);
> mm[4];
  <
     3,

     40,

     [1 0 0 0]
     [0 1 1 0]
     [0 0 1 0]
     [0 0 0 1]
  >
> cc[4][3] eq f(mm[4][3]);
true
```

<a id="function-spinconjugacyclasses-grpmat"></a>
##### `SpinConjugacyClasses(G): GrpMat -> SeqEnum, SeqEnum`

<a id="function-spinclasses-grpmat"></a>
##### `SpinClasses(G): GrpMat -> SeqEnum, SeqEnum`

The sequence of conjugacy classes and their corresponding centralizers in the spin group $G$ returned by one of the intrinsics `Spin`($d,q$), `SpinPlus`($d,q$), or `SpinPlus`($d,q$), with $q$ odd. These are calculated by calling `ClassicalClasses` on the central quotient group $G/Z$ with $|Z|=2$ and $G = \Omega^{\epsilon}(d,q)$, and then lifting the class representatives through the subgroup $Z$.

<a id="function-spincentralizer-grpmat-grpmatelt"></a>
##### `SpinCentralizer(G, g): GrpMat, GrpMatElt -> GrpMat`

The centralizer of $g$ in the spin group $G$.

<a id="function-spinisconjugate-grpmat-grpmatelt-grpmatelt"></a>
##### `SpinIsConjugate(G, g, h): GrpMat, GrpMatElt, GrpMatElt -> BoolElt, GrpMatElt`

If $g$ and $h$ are conjugate in the spin group $G$ then return `true` and a conjugating element, otherwise return `false`.

<a id="function-spinclassmap-grpmat"></a>
##### `SpinClassMap(G): GrpMat -> Map`

The class map for the spin group $G$.

### Subgroups

#### Construction of Subgroups

<a id="constructor-constructor-sub-grpmat-list-grpmat"></a>
##### `sub<G | L>: GrpMat, List -> GrpMat`

Given the matrix group $G$, construct the subgroup $H$ of $G$ generated by the elements specified by the list $L$, where $L$ is a list of one or more items of the following types:

**(a)**
A sequence of $n$ integers defining a matrix of $G$;

**(b)**
A set or sequence of sequences of type (a);

**(c)**
An element of $G$;

**(d)**
A set or sequence of elements of $G$;

**(e)**
A subgroup of $G$;

**(f)**
A set or sequence of subgroups of $G$.

Each element or group specified by the list must belong to the *same* generic matrix group. The subgroup $H$ will be constructed as a subgroup of some group which contains each of the elements and groups specified in the list. The generators of $H$ consist of the elements specified by the terms of the list $L$ together with the stored generators for groups specified by terms of the list. Repetitions of an element and occurrences of the identity element are removed.

<a id="constructor-constructor-ncl-grpmat-list-grpmat"></a>
##### `ncl<G | L>: GrpMat, List -> GrpMat`

Given the matrix group $G$, construct the subgroup $H$ of $G$ that is the *normal closure* of the subgroup $H$ generated by the elements specified by the list $L$, where the possibilities for $L$ are the same as for the `sub`-constructor.

<a id="example-ex-494271"></a>
##### `Example: Orthogonal Subgroup of GL(4, 2) (ex-494271)`

We define $O^{-}(4,2)$ as a subgroup of ${\operatorname{GL}}(4, 2)$. Recall that $O^{-}(4,2)$ is isomorphic to $S_5$. We then locate a subset of its generators that lie within the subgroup isomorphic to $A_5$.

```magma
> GL42 := GeneralLinearGroup(4, GF(2));
> Ominus42 := sub< GL42 | [1,0,0,0, 1,1,0,1, 1,0,1,0, 0,0,0,1 ],
>                               [0,1,0,0, 1,0,0,0, 0,0,1,0, 0,0,0,1 ],
>                               [0,1,0,0, 1,0,0,0, 0,0,1,0, 0,0,1,1 ] >;
> Order(Ominus42);
120
> H := sub< Ominus42 | $.1, $.3 >;
print Order(H);
10
> N := ncl< Ominus42 | $.1, $.3 >;
> Order(N);
60
```

#### Elementary Properties of Subgroups

<a id="function-index-grpmat-grpmat"></a>
##### `Index(G, H): GrpMat, GrpMat -> RngIntElt`

The index of the subgroup $H$ in the group $G$. The index is returned as an integer. If the orders of $G$ and $H$ are not known, they will be computed.

<a id="function-factoredindex-grpmat-grpmat"></a>
##### `FactoredIndex(G, H): GrpMat, GrpMat -> [ <RngIntElt, RngIntElt> ]`

The index of the subgroup $H$ in the group $G$. The index is returned as a factored integer. The factorization is returned in the form of a sequence $Q$ which is defined as follows: If $[ G : H ]  = p_1^{e_1}\ldots p_n^{e_n}, \quad e_i \neq 0$, then $Q$ will be the integer sequence $[ <p_1, e_1>, \ldots, <p_n, e_n> ]$. If the orders of $G$ and $H$ are not known, they will be computed.

<a id="function-iscentral-grpmat-grpmat"></a>
##### `IsCentral(G, H): GrpMat, GrpMat -> BoolElt`

Returns `true` if the subgroup $H$ of the group $G$ lies in the centre of $G$, `false` otherwise.

<a id="function-ismaximal-grpmat-grpmat"></a>
##### `IsMaximal(G, H): GrpMat, GrpMat -> BoolElt`

Returns `true` if the subgroup $H$ of the group $G$ is a maximal subgroup of $G$. This function is evaluated by constructing the permutation representation of $G$ on the cosets of $H$ and testing this representation for primitivity. For this reason, the use of `IsMaximal` should be avoided if the index of $H$ in $G$ exceeds a few thousand.

<a id="function-isnormal-grpmat-grpmat"></a>
##### `IsNormal(G, H): GrpMat, GrpMat -> BoolElt`

Returns `true` if the subgroup $H$ of the group $G$ is a normal subgroup of $G$, `false` otherwise.

<a id="function-issubnormal-grpmat-grpmat"></a>
##### `IsSubnormal(G, H): GrpMat, GrpMat -> BoolElt`

Returns `true` if the subgroup $H$ of the group $G$ is subnormal in $G$, `false` otherwise.

#### Standard Subgroups

<a id="operation-op-pow-grpmat-grpmatelt"></a>
##### `H ^ g: GrpMat, GrpMatElt -> GrpMat`

<a id="function-conjugate-grpmat-grpmatelt"></a>
##### `Conjugate(H, g): GrpMat, GrpMatElt -> GrpMat`

Construct the conjugate $g^{-1}*H*g$ of the matrix group $H$ by the matrix $g$. The group $H$ and the element $g$ must belong to a common matrix group.

<a id="operation-op-meet-grpmat-grpmat"></a>
##### `H meet K: GrpMat, GrpMat -> GrpMat`

Given groups $H$ and $K$ which belong to the same matrix group, construct the intersection of $H$ and $K$.

<a id="function-commutatorsubgroup-grpmat-grpmat-grpmat"></a>
##### `CommutatorSubgroup(G, H, K): GrpMat, GrpMat, GrpMat -> GrpMat`

<a id="function-commutatorsubgroup-grpmat-grpmat"></a>
##### `CommutatorSubgroup(H, K): GrpMat, GrpMat -> GrpMat`

Given subgroups $H$ and $K$ of the group $G$, construct the commutator subgroup of $H$ and $K$ as a subgroup of $G$. If $K$ is a subgroup of $H$, then $G$ may be omitted.

<a id="function-centraliser-grpmat-grpmatelt"></a>
##### `Centraliser(G, g): GrpMat, GrpMatElt -> GrpMat`

<a id="function-centralizer-grpmat-grpmatelt"></a>
##### `Centralizer(G, g): GrpMat, GrpMatElt -> GrpMat`

Construct the centralizer of the matrix $g$ in the group $G$; $g$ and $G$ must belong to a common matrix group.

<a id="function-centraliser-grpmat-grpmat"></a>
##### `Centraliser(G, H): GrpMat, GrpMat -> GrpMat`

<a id="function-centralizer-grpmat-grpmat"></a>
##### `Centralizer(G, H): GrpMat, GrpMat -> GrpMat`

Construct the centralizer of the group $H$ in the group $G$; $G$ and $H$ must belong to a common matrix group.

<a id="function-core-grpmat-grpmat"></a>
##### `Core(G, H): GrpMat, GrpMat -> GrpMat`

Given a subgroup $H$ of the matrix group $G$, construct the maximal normal subgroup of $G$ that is contained in the subgroup $H$.

<a id="operation-op-pow-grpmat-grpmat"></a>
##### `H ^ G: GrpMat, GrpMat -> GrpMat`

<a id="function-normalclosure-grpmat-grpmat"></a>
##### `NormalClosure(G, H): GrpMat, GrpMat -> GrpMat`

Given a subgroup $H$ of the matrix group $G$, construct the normal closure of $H$ in $G$.

<a id="function-normalizer-grpmat-grpmat"></a>
##### `Normalizer(G, H): GrpMat, GrpMat -> GrpMat`

Given a subgroup $H$ of the group $G$, construct the normalizer of $H$ in $G$.

<a id="function-glnormalizer-grpmat"></a>
##### `GLNormalizer(H : parameter): GrpMat -> GrpMat`

```magma
Print    : RngIntElt                    Default: 0
OverGroup: RngIntElt                    Default: 0
```

Given $H \leq GL_n(q)$, return the normalizer of $H$ in $GL_n(q)$. The algorithm is described in Coutts [[Cou11](https://docs.magma-maths.org/references.md#cite-coutts-phd)]. It exploits Aschbacher’s description of the maximal subgroups of a classical group to obtain an overgroup $M$ of the normaliser $N$ and, where necessary, then applies `LMGNormaliser` $(M, H)$ to construct $N$. If the optional argument `OverGroup` is `true`, then return $M$, so skipping the last step. The optional argument `Print` takes values between 0 and 2, and determines the amount of information printed.

<a id="function-sylowsubgroup-grpmat-rngintelt"></a>
##### `SylowSubgroup(G, p): GrpMat, RngIntElt -> GrpMat`

<a id="function-sylow-grpmat-rngintelt"></a>
##### `Sylow(G, p): GrpMat, RngIntElt -> GrpMat`

Given a group $G$ and a prime $p$, construct the Sylow $p$-subgroup of $G$.

<a id="function-pcore-grpmat-rngintelt"></a>
##### `pCore(G, p): GrpMat, RngIntElt -> GrpMat`

Given a group $G$ and a prime $p$ dividing the order of $G$, construct the maximal normal $p$-subgroup of $G$.

#### Low Index Subgroups

<a id="function-lowindexsubgroups-grpmat-rngintelt"></a>
##### `LowIndexSubgroups(G, n: parameters): GrpMat, RngIntElt -> SeqEnum`

<a id="function-lowindexsubgroups-grpmat-tup"></a>
##### `LowIndexSubgroups(G, t: parameters): GrpMat, Tup -> SeqEnum`

Returns a sequence of subgroups of $G$, each with index at most $n$. The sequence will contain one representative from each conjugacy class of $G$-subgroups satisfying the index constraint. The algorithm used is described in Cannon, Holt, Slattery & Steel [[CHSS03](https://docs.magma-maths.org/references.md#cite-chss-lix)]. The previous version of the algorithm is available by setting the parameter `Algorithm` to the string `"Subgroups"`. In this case the group $G$ is subject to the same restrictions as the group input to the `Subgroups` function above. In the second form $t$ should be a pair of integers $\langle a,b\rangle$, and subgroups with index in the interval $[a,b]$ will be returned. Other parameters are `Presentation` which may be set `true` to return a second sequence of presentations of the groups found, and `Print` which may be set to a positive integer to turn on diagnostic printing of the progress of the algorithms.

<a id="function-lowindexsubgroups-grpmat-rngintelt-2"></a>
##### `LowIndexSubgroups(G, N, n: parameters): GrpMat, RngIntElt -> SeqEnum`

<a id="function-lowindexsubgroups-grpmat-tup-2"></a>
##### `LowIndexSubgroups(G, N, t: parameters): GrpMat, Tup -> SeqEnum`

Same as above, but only those subgroups containing the normal subgroup $N$ of $G$ are returned. This is equivalent to computing the low index subgroups of $G/N$. Only the `Print` parameter is available for this command.

<a id="function-lowindexsubgroupsct-grpmat-rngintelt"></a>
##### `LowIndexSubgroupsCT(G, R : parameters): GrpMat, RngIntElt -> [ GrpMat ]`

<a id="function-lowindexsubgroupsct-grpmat-rngintelt-rngintelt"></a>
##### `LowIndexSubgroupsCT(G, R: parameters): GrpMat, <RngIntElt, RngIntElt> -> [ GrpMat ]`

```magma
Limit: RngIntElt                    Default: Infinity()
Print: RngIntElt                    Default: 0
```

Given a matrix group $G$, and an expression $R$ defining a positive integer range (see below), determine the conjugacy classes of subgroups of $G$ whose indices lie in the range specified by $R$. The subgroups are returned as a sequence of subgroups of $G$. The argument $R$ is one of the following:

**(a)**
An integer $n$ representing the range $[1, n]$;

**(b)**
A tuple $<a, b>$ representing the range $[a, b]$.

This is an alternative method for computing low index subgroups that uses an algorithm due to Leedham-Green & O’Brien [[LGO02](https://docs.magma-maths.org/references.md#cite-crlg-eaob)]. In practice, the algorithm is most useful for small values of $n$, say up to 8.

The algorithm proceeds by iteratively constructing better approximations to finite presentations for $G/K$, where $K$ is the intersection of kernels of all homomorphisms from $G$ into $S_n$, and applying `LowIndexSubgroups` to the resulting finitely-presented group. The output information displayed for various values of the `Print` parameter about the number and existence of putative subgroups of index at most $n$ refers to the current finite presentation only, may change as this presentation is further refined, and need not be reflected in the final answer.

Terminate after finding $n$ conjugacy classes of subgroups satisfying the designated conditions.

The `Print` parameter takes values from 0 to 3.

<a id="example-ex-39331d"></a>
##### `Example: Low Index Subgroups of GL(4, 5) (ex-39331d)`

```magma
> G := GL (4, 5);
> L := LowIndexSubgroups (G, 4);
> #L;
3
> L[3];
MatrixGroup(4, GF(5))
Generators:
    [4 0 0 4]
    [1 0 0 0]
    [0 4 0 0]
    [0 0 4 0]

    [4 0 0 3]
    [3 0 0 0]
    [0 4 0 0]
    [0 0 4 0]

    [4 0 0 1]
    [4 0 0 0]
    [0 4 0 0]
    [0 0 4 0]

    [4 0 0 2]
    [2 0 0 0]
    [0 4 0 0]
    [0 0 4 0]
```

#### Conjugacy Classes of Subgroups

<a id="function-subgroupclasses-grpmat"></a>
##### `SubgroupClasses(G: parameters): GrpMat -> [ rec< GrpMat, RngIntElt, RngIntElt, GrpFP> ]`

<a id="function-subgroups-grpmat"></a>
##### `Subgroups(G: parameters): GrpMat -> [ rec< GrpMat, RngIntElt, RngIntElt, GrpFP> ]`

```magma
Al                 : MonStgElt                    Default: "All"
LayerSizes         : SeqEnum                      Default: See below
Series             : SeqEnum                      Default: See below
Presentation       : BoolElt                      Default: false
OrderEqual         : RngIntElt                    Default: 
OrderDividing      : RngIntElt                    Default: 
OrderMultipleOf    : RngIntElt                    Default: 
IndexLimit         : RngIntElt                    Default: 
IsElementaryAbelian: BoolElt                      Default: false
IsCyclic           : BoolElt                      Default: false
IsAbelian          : BoolElt                      Default: false
IsNilpotent        : BoolElt                      Default: false
IsSolvable         : BoolElt                      Default: false
IsNotSolvable      : BoolElt                      Default: false
IsPerfect          : BoolElt                      Default: false
```

Representatives for the conjugacy classes of subgroups for the group $G$. The subgroups are returned as a sequence of records where the $i$-th record contains:

**(a)**
A representative subgroup $H$ for the $i$-th conjugacy class (field name `subgroup`).

**(b)**
The order of the subgroup (field name `order`).

**(c)**
The number of subgroups in the class (field name `length`).

**(d)**
[Optional] A presentation for $H$ (field name `presentation`).

`Al := "All"`: Construct all subgroups of $G$.

`Al := "Maximal"`: Only construct maximal subgroups of $G$. This option reduces the number of intersections with any elementary abelian layer that need be considered and eliminates the need to recursively apply the algorithm.

`Al := "Normal"`: Only construct normal subgroups of $G$. This option does not use database lookup to find the normal subgroups of the radical quotient of $G$ and also reduces the number of intersections with any layer that need be considered.

`LayerSizes := [ 2, 5, 3, 4, 7, 3, 11, 2, 17, 1]` is equivalent to the default. When constructing an Elementary Abelian series for the group, attempt to split 2-layers of size gt $2^5$, 3-layers of size gt $3^4$, etc. The implied exponent for 13 is 2 and for all primes greater than 17 the exponent is 1.

Use the given elementary abelian series rather than constructing the default series. The first subgroup in the series must be the solvable radical of $G$. The subgroups must form a descending chain of normal subgroups of $G$, such that each quotient is elementary abelian. The last subgroup in the series must be either elementary abelian or trivial.

`Presentation := true`: Construct a presentation for each subgroup.

`OrderEqual := n`: Only construct subgroups having order equal to $n$.

`OrderDividing := n`: Only construct subgroups having order dividing $n$.

`OrderMultipleOf := n`: Only construct subgroups having order a multiple of $n$.

`IndexLimit := n`: Only construct subgroups having index in $G$ less than or equal to $n$.

`IsElementaryAbelian := true`: Only construct elementary abelian subgroups of $G$.

`IsCyclic := true`: Only construct cyclic subgroups of $G$.

`IsAbelian := true`: Only construct abelian subgroups of $G$.

`IsNilpotent := true`: Only construct nilpotent subgroups of $G$.

`IsSolvable := true`: Only construct solvable subgroups of $G$.

`IsNotSolvable := true`: Only construct insolvable subgroups of $G$.

`IsPerfect := true`: Only construct perfect subgroups of $G$.

**The Algorithm:** (See Cannon, Cox, and Holt [[CCH01b](https://docs.magma-maths.org/references.md#cite-subgroups-permg)]) This command proceeds by first constructing an elementary abelian series for $G$ together with $G$’s radical quotient $Q$ as a permutation group. (Thus this function is limited to matrix groups over fields, where the group has a BSGS.) The required subgroups of $Q$ are then found as for permutation groups. We first attempt to locate the quotient in a database of groups with trivial Fitting subgroup. This database contains all such groups of order up to $216\,000$, and all such which are perfect of order up to $1\,000\,000$. If $Q$ is found then either all its subgroups, or its maximal subgroups are read from the database. (In some cases only the maximal subgroups are stored.) If $Q$ is not found then we attempt to find the maximal subgroups of $Q$ using a method of Derek Holt. For this to succeed all simple factors of the socle of $Q$ must be found in a second database which currently contains all simple groups of order less than $1.6 \times 10^7$, as well as $M_{24}$, $HS$, $J_3$, $McL$, $Sz(32)$, and $L_6(2)$. There are also special routines to handle numerous other groups. These include: $A_n$ for $n \le 999$, $L_2(q)$, $L_3(q)$, $L_4(q)$ and $L_5(q)$ for all $q$, $U_3(q)$ for $q$ prime and $q=8,9,16,25$, $U_4(q)$ for $q=4,5,7$, $S_4(q)$ for all odd $q$ and even $q\le 16$, $L_d(2)$ for $d \le 14$, and the following groups: $L_6(3)$, $L_7(3)$, $U_6(2)$, $S_8(2)$, $S_{10}(2)$, $O^\pm_8(2)$, $O^\pm_{10}(2)$, $S_6(3)$, $O_7(3)$, $O^-_8(3)$, $G_2(4)$, $G_2(5)$, ${}^3D_4(2)$, ${}^2F_4(2)'$, $Co_2$, $Co_3$, $He$, $Fi_{22}$.

If we have only maximal subgroups of $Q$, and more are required, we apply the algorithm recursively to the maximal subgroups to determine all subgroups of $Q$. This may take some time.

The subgroups of $Q$ are then pulled back to $G$ and extended to the whole group by stepwise extension through each layer of the elementary abelian series. For each layer this involves determining all possible intersections of a subgroup with this layer and all extensions with this intersection.

The limitations are that the simple factors of the socle of $Q$ must be in the list above. Further, it may take some time to construct all subgroups from the maximal subgroups first found, and, if there is a large elementary abelian layer, there will be many possible intersections, which could also make the algorithm prohibitively slow.

There are numerous parameters for this function which allow the user to place restrictions on which subgroup classes are constructed. Using these restrictions may help overcome the problems noted above.

<a id="function-maximalsubgroups-grpmat"></a>
##### `MaximalSubgroups(G: parameters): GrpMat -> [ rec< GrpMat, RngIntElt, RngIntElt, GrpFP> ]`

Construct the sequence of maximal subgroup classes of the matrix group $G$. This is equivalent to the command `Subgroups(G: Al := "Maximal")`. The same parameters as for `Subgroups` are available to limit the search.

<a id="function-maximalsubgroups-grpmat-grpmat"></a>
##### `MaximalSubgroups(G, N: parameters): GrpMat, GrpMat -> [ rec< GrpMat, RngIntElt, RngIntElt, GrpFP> ]`

Construct the sequence of maximal subgroup classes of $G$ that contain the normal subgroup $N$ of $G$. So this is equivalent to computing the maximal subgroups of $G$ that contain $N$. *Warning*: Some parameters may have no effect.

<a id="function-subgroupslift-grpmat-grpmat-grpmat-seqenum"></a>
##### `SubgroupsLift(G, A, B, Q: parameters): GrpMat, GrpMat, GrpMat, SeqEnum -> SeqEnum`

This function isolates one step of the extension process used by the `Subgroups` family of functions. $Q$ is a sequence of records such as returned by `Subgroups(G)`. $A$ and $B$ are normal subgroups of $G$ with $A/B$ elementary abelian. The records in $Q$ are interpreted as subgroups of $G/A$, which are lifted to all possible corresponding subgroups of $G/B$, subject to the parameters given.

<a id="function-isconjugate-grpmat-grpmat-grpmat"></a>
##### `IsConjugate(G, H, K): GrpMat, GrpMat, GrpMat -> BoolElt, GrpMatElt | Unass`

Given a group $G$ and subgroups $H$ and $K$ belonging to $G$, return the value `true` if $H$ and $K$ are conjugate in $G$. The function returns a second value in the event that the subgroups are conjugate: an element $z$ which conjugates $H$ into $K$.

<a id="function-isglconjugate-grpmat-grpmat"></a>
##### `IsGLConjugate(H, K): GrpMat, GrpMat -> BoolElt, GrpMatElt | Unass`

Given $H$ and $K$, both subgroups of the same general linear group $G = GL_n(q)$, return the value `true` if $H$ and $K$ are conjugate in $G$. The function returns a second value in the event that the subgroups are conjugate: an element $z$ which conjugates $H$ into $K$. The algorithm is described in Roney-Dougal [[RD04](https://docs.magma-maths.org/references.md#cite-isglconjugate)].

### Quotient Groups

The functions described in this section apply only to finite groups for which a base and strong generating set may be constructed.

#### Construction of Quotient Groups

<a id="constructor-constructor-quo-grpmat-list-grpperm-map"></a>
##### `quo<G | L>: GrpMat, List -> GrpPerm, Map`

Given the matrix group $G$, construct the quotient group $Q = G/N$, where $N$ is the normal closure of the subgroup of $G$ generated by the elements specified by $L$. The clause $L$ is a list of one or more items of the following types:

**(a)**
A sequence of $n$ integers defining a matrix of $G$;

**(b)**
A set or sequence of sequences of type (a);

**(c)**
An element of $G$;

**(d)**
A set or sequence of elements of $G$;

**(e)**
A subgroup of $G$;

**(f)**
A set or sequence of subgroups of $G$.

Each element or group specified by the list must belong to the *same* generic matrix group. The function returns

**(a)**
the quotient group $Q$, and

**(b)**
the natural homomorphism $f: G\rightarrow Q$.

Currently in Magma, the quotient group is constructed via the regular representation of the quotient, so that the application of this operator is restricted to the case where the index of $N$ in $G$ is small. The representation of the quotient that is returned is the result of applying degree reduction to the regular representation, so need not be regular.

The generators of the quotient group correspond to the generators of $G$.

<a id="operation-op-div-grpmat-grpmat"></a>
##### `G / N: GrpMat, GrpMat -> GrpPerm`

Given a normal subgroup $N$ of the matrix group $G$, construct the quotient of $G$ by $N$. Currently in Magma, the quotient group is constructed via the regular representation of the quotient, so the application of this operator is restricted to the case where the index of $N$ in $G$ is small. The representation of the quotient that is returned is the result of applying degree reduction to the regular representation, so need not be regular.

<a id="example-ex-8aed52"></a>
##### `Example: Quotient of a Soluble Matrix Group (ex-8aed52)`

We determine the structure of a quotient in a soluble subgroup of ${\operatorname{GL}}(3, 5)$.

```magma
> G := MatrixGroup< 3, GF(5) | [0,1,0, 1,0,0, 0,0,1], [0,1,0, 0,0,1, 1,0,0 ],
>                                       [2,0,0, 0,1,0, 0,0,1] >;
> Order(G);
384
> Q, f := quo< G | G.2 >;
> Q;
Permutation group Q of degree 8
    (1, 2)(3, 4)(5, 6)(7, 8)
    Id(Q)
    (1, 3, 5, 7)(2, 4, 6, 8)
> IsAbelian(Q);
true
> AbelianInvariants(Q);
[ 4, 2 ]
```

#### Abelian, Nilpotent, and Soluble Quotients

A number of standard quotients may be constructed. The method first constructs a presentation for the matrix group and then applies the appropriate fp-group algorithm.

<a id="function-abelianquotient-grpmat"></a>
##### `AbelianQuotient(G): GrpMat -> GrpAb, Map`

The maximal abelian quotient $G/G^\prime$ of the group $G$ as `GrpAb` (cf. chapter [Abelian Groups](https://docs.magma-maths.org/FinitelyPresentedGroups/AbelianGroups/index-abelian-groups.md#chapgrpab)). The natural epimorphism $\pi:G\rightarrow G/G^\prime$ is returned as second value.

<a id="function-elementaryabelianquotient-grpmat-rngintelt"></a>
##### `ElementaryAbelianQuotient(G, p): GrpMat, RngIntElt -> GrpAb, Map`

The maximal $p$-elementary abelian quotient $Q$ of the group $G$ as `GrpAb` (cf. chapter [Abelian Groups](https://docs.magma-maths.org/FinitelyPresentedGroups/AbelianGroups/index-abelian-groups.md#chapgrpab)). The natural epimorphism $\pi:G\rightarrow Q$ is returned as second value.

<a id="function-pquotient-grpmat-rngintelt-rngintelt"></a>
##### `pQuotient(G, p, c): GrpMat, RngIntElt, RngIntElt -> GrpPC, Map, SeqEnum, BoolElt`

Given a matrix group $G$, a prime $p$, and a positive integer $c$, construct a pc-presentation for the largest $p$-quotient $P$ of $G$ having lower exponent-$p$ class at most $c$. If $c$ is given as $0$, then the limit 127 is placed on the class. The prime $p$ must be less than $65536$.

The function also returns the natural homomorphism $\pi$ from $G$ to $P$, a sequence $S$ describing the definitions of the pc-generators of $P$ and a flag indicating whether $P$ is the maximal $p$-quotient of $G$.

The $k$-th element of $S$ is a sequence of two integers, describing the definition of the $k$-th pc-generator $P.k$ of $P$ as follows.

- If $S[k] = [0,r]$, then $P.k$ is defined via the image of $G.r$ under $\pi$.
- If $S[k] = [r,0]$, then $P.k$ is defined via the power relation for $P.r$.
- If $S[k] = [r,s]$, then $P.k$ is defined via the conjugate relation involving $P.r^{P.s}$.

<a id="function-nilpotentquotient-grpmat-rngintelt"></a>
##### `NilpotentQuotient(G, c): GrpMat, RngIntElt -> GrpGPC, Map`

This function returns the class $c$ nilpotent quotient of the matrix group $G$, together with the epimorphism $\pi$ from $G$ onto this quotient.

<a id="function-solvablequotient-grpmat"></a>
##### `SolvableQuotient(G): GrpMat -> GrpPC, Map`

<a id="function-solublequotient-grpmat"></a>
##### `SolubleQuotient(G): GrpMat -> GrpPC, Map`

The function returns the largest soluble quotient $S$ of the matrix group $G$ together with the epimorphism $\pi:G\rightarrow S$.

<a id="function-pcgroup-grpmat"></a>
##### `PCGroup(G): GrpMat -> GrpPC, Map`

For a solvable group $G$, the function returns an isomorphic group of type `GrpPC` together with an isomorphism from $G$ to the new group. If $G$ is not solvable, then the call to `PCGroup` will result in an error.

<a id="example-ex-b8249f"></a>
##### `Example: Abelian and Soluble Quotients (ex-b8249f)`

We take a degree 10 matrix group over the integers and compute its maximal abelian and soluble quotients. The epimorphisms supplied by these two functions may be used to pass between the group and its quotients.

```magma
> DB := RationalMatrixGroupDatabase();
> G := Group(DB, 10, 2);
> G : Minimal;
MatrixGroup(10, Integer Ring) of order 4147200
> A := AbelianQuotient(G); A;
Abelian Group isomorphic to Z/2 + Z/2 + Z/2
Defined on 3 generators
Relations:
  2*A.1 = 0
  2*A.2 = 0
  2*A.3 = 0
> S, f := SolubleQuotient(G); S;
GrpPC : S of order 32 = 2^5
PC-Relations:
  S.2^2 = S.4,
  S.2^S.1 = S.2 * S.4,
  S.3^S.2 = S.3 * S.4 * S.5
> G.1 @ f;
S.1 * S.4 * S.5
> S.5 @@ f in DerivedGroup(G);
true
```

### Matrix Group Actions

The functions described in this section apply only to finite groups for which a base and strong generating set may be constructed.

#### Orbits and Stabilizers

Let $G$ be a matrix group and let $M$ be its natural module. Now $G$ has an action on the elements and submodules of $M$. A derived $G$-set for $G$ consists of the closure under the natural action of $G$ of one of the following:

- A set of vectors of $M$;
- A set of $k$ element subsets of vectors of $M$;
- A set of $k$ element sequences of vectors of $M$;
- A set of submodules of $M$, each of which has fixed dimension $k$;
- A cartesian product of $G$-sets.

<a id="operation-op-times-modtuprngelt-grpmatelt"></a>
##### `u * g: ModTupRngElt, GrpMatElt -> ModTupRngElt`

Given an element $g$ belonging to the matrix group $G$ with natural module $M$ and an element $u$ of this module, return the vector $u*g$.

<a id="operation-op-pow-elt-grpmatelt"></a>
##### `y ^ g: Elt, GrpMatElt -> Elt`

Given an element $g$ belonging to the matrix group $G$ with natural module $M$ and an object $y$ which is an element of some derived $G$-set of $M$, find the image of $y$ under $g$.

<a id="operation-op-pow-elt-grpmat"></a>
##### `y ^ G: Elt, GrpMat -> SetEnum`

<a id="function-orbit-grpmat-elt"></a>
##### `Orbit(G, y): GrpMat, Elt -> SetEnum`

Given a matrix group $G$ with natural module $M$ and an object $y$ which is either a vector of $M$, a submodule of $M$, or a tuple whose components are either vectors or submodules, find the orbit of $y$ under $G$.

<a id="function-orbitbounded-grpmat-elt-rngintelt"></a>
##### `OrbitBounded(G, y, b): GrpMat, Elt, RngIntElt -> BoolElt, SetEnum`

Given a matrix group $G$ with natural module $M$ and an object $y$ which is either a vector of $M$, a submodule of $M$, or a tuple whose components are either vectors or submodules, return `true` if the orbit of $y$ under $G$ has length less than or equal to $b$. Otherwise the function returns `false`. If it returns `true`, then the orbit of $y$ is returned as the second value.

<a id="function-orbits-grpmat"></a>
##### `Orbits(G): GrpMat -> [ SetIndx ]`

Given a matrix group $G$ with natural $R$-module $M$, construct the orbits of $G$ on the vectors of $M$. The orbits are returned as a sequence of sets.

<a id="function-lineorbits-grpmat"></a>
##### `LineOrbits(G): GrpMat -> [ SetIndx ]`

Given a matrix group $G$ with natural $R$-module $M$, construct the orbits of $G$ on the rank-1 submodules of $M$. The orbits are returned as a sequence of sets.

<a id="function-orbitclosure-grpmat-elt"></a>
##### `OrbitClosure(G, S): GrpMat, { Elt } -> GSet`

Given a matrix group $G$ with natural module $M$ and a set $S$ of vectors or subspaces of $M$, return the union of orbits of the elements of $S$ under the natural action of $G$ on $M$.

<a id="function-stabilizer-grpmat-elt"></a>
##### `Stabilizer(G, y): GrpMat, Elt -> GrpMat`

Given a matrix group $G$ with natural module $M$ and an object $y$ which is either a vector of $M$, a submodule of $M$, or a tuple whose components are either vectors or submodules, determine the stabilizer of $y$ in $G$.

<a id="example-ex-3be539"></a>
##### `Example: Orbits of Vectors and Subspaces (ex-3be539)`

We continue with the group $J2A2$ introduced above.

```magma
> V := RSpace(G);
> u := V![1,0,0,0,0,0];
> U := sub< V | u >;
> x := < u, U >;
> W := sub< V | u, u*G.1 >;
> u^G.1;
(w^6 w^3 w^2   0   0   0)
> U^G.1;
Vector space of degree 6, dimension 1 over GF(3, 2)
Echelonized basis:
(  1 w^5   2   0   0   0)
> W^G.1;
Vector space of degree 6, dimension 2 over GF(3, 2)
Echelonized basis:
(  1 w^5   0   0   0   0)
(  0   0   1   0   0   0)
> x^G.1;
<(w^6 w^3 w^2   0   0   0), Vector space of degree 6,
dimension 1 over GF(3, 2)
Echelonized basis:
(  1 w^5   2   0   0   0)>
> H := sub< G | G.1, G.2 >;
> #Orbit(H, u);
252
> #Orbit(H, U);
63
> #Orbit(G, U);
3150
> Stabilizer(G, U);
MatrixGroup(6, GF(3^2)) of order 384 = 2^7 * 3
Generators:
[  2   0   0   0   0   0]
[w^3   w   w   0   2 w^2]
[w^5 w^7 w^7   0   1 w^2]
[  0   0   1   2   1   0]
[w^7 w^5   0   0   0 w^6]
[  w w^3   0   0   0 w^6]

[w^2   0   0   0   0   0]
[w^5 w^5 w^5   0   w   0]
[w^7 w^3 w^3   0   0 w^7]
[w^2 w^3   w w^6   w w^3]
[w^3   1 w^6   0   w w^7]
[  w w^6   2   0   w w^7]

[w^6   0   0   0   0   0]
[  0   2   0   0   0   0]
[  0   0 w^6   0   0   0]
[w^2 w^7 w^6 w^2   0   0]
[  w   0   w   0   2   0]
[w^6 w^7 w^2   0   0 w^2]

[  2   0   0   0   0   0]
[  0   2   0   0   0   0]
[  0   0   2   0   0   0]
[  0   0   0   2   0   0]
[  0   0   0   0   2   0]
[  0   0   0   0   0   2]
> #Orbit(H, x);
252
> #Orbit(H, W);
28
```

#### Orbit and Stabilizer Functions for Large Groups

In this section we describe a number of constructions for orbits and stabilizers which in certain circumstances may be applicable to much larger groups than the functions described above.

<a id="function-orbitsofspaces-grpmat-rngintelt"></a>
##### `OrbitsOfSpaces(G, k): GrpMat, RngIntElt -> SeqEnum`

Determine representatives and lengths for the orbits of all $k$-dimensional subspaces of the natural vector space under action of a matrix group defined over a prime field; return a sequence of tuples each containing an orbit length and representative. This function is very space-efficient and hence has a significantly larger range than the general-purpose `Orbits`; however, only representatives and lengths are stored. Theoretical details of the algorithm used may be found in O’Brien [[OBr90](https://docs.magma-maths.org/references.md#cite-obrien-pgroup)].

<a id="function-numberoffixedspaces-grpmatelt-rngintelt"></a>
##### `NumberOfFixedSpaces(x, s): GrpMatElt, RngIntElt -> RngIntElt`

<a id="function-numberoffixedspaces-algmatelt-rngintelt"></a>
##### `NumberOfFixedSpaces(x, s): AlgMatElt, RngIntElt -> RngIntElt`

Return number of subspaces of dimension $s$ fixed by matrix $x$.

<a id="example-ex-dc691e"></a>
##### `Example: Orbits of 2-Spaces under an Exterior Square (ex-dc691e)`

```magma
> G := GL (4, 5);
> H := ExteriorSquare (G);
> H;
MatrixGroup(6, GF(5))
Generators:
    [2 0 0 0 0 0]
    [0 2 0 0 0 0]
    [0 0 1 0 0 0]
    [0 0 0 2 0 0]
    [0 0 0 0 1 0]
    [0 0 0 0 0 1]

    [0 0 0 1 0 0]
    [1 0 0 0 1 0]
    [1 0 0 0 0 0]
    [0 1 0 0 0 1]
    [0 1 0 0 0 0]
    [0 0 1 0 0 0]
> O := OrbitsOfSpaces (H, 2);
```

We see that there are four orbits:

```magma
> O;
[
    <
        4836,

        Vector space of degree 6, dimension 2 over GF(5)
        Generators:
        (1 0 0 0 0 0)
        (0 1 0 0 0 0)
        Echelonized basis:
        (1 0 0 0 0 0)
        (0 1 0 0 0 0)
    >,

    <
        96720,

        Vector space of degree 6, dimension 2 over GF(5)
        Generators:
        (1 0 1 1 0 0)
        (0 1 0 0 0 0)
        Echelonized basis:
        (1 0 1 1 0 0)
        (0 1 0 0 0 0)
    >,

    <
        251875,

        Vector space of degree 6, dimension 2 over GF(5)
        Generators:
        (1 0 0 0 1 0)
        (0 1 0 0 0 0)
        Echelonized basis:
        (1 0 0 0 1 0)
        (0 1 0 0 0 0)
    >,

    <
        155000,

        Vector space of degree 6, dimension 2 over GF(5)
        Generators:
        (1 0 1 1 1 0)
        (0 1 1 1 0 0)
        Echelonized basis:
        (1 0 1 1 1 0)
        (0 1 1 1 0 0)
    >
]
```

We compute the number of spaces of dimension 2 fixed by $H.1$ and the number of spaces of dimension 3 fixed by $H.2$.

```magma
> NumberOfFixedSpaces(H.1, 2);
1023
> NumberOfFixedSpaces(H.2, 3);
2
```

<a id="function-estimateorbit-grpmat-modtupfldelt"></a>
##### `EstimateOrbit(G, v: parameters): GrpMat, ModTupFldElt -> RngIntElt, RngIntElt, RngIntElt`

<a id="function-estimateorbit-grpmat-modtupfld"></a>
##### `EstimateOrbit(G, U: parameters): GrpMat, ModTupFld -> RngIntElt, RngIntElt, RngIntElt`

```magma
MaxSize           : RngIntElt                    Default: 10000
NumberCoincidences: RngIntElt                    Default: 15
```

Estimate the size of the orbit of the vector $v$ or subspace $U$ of natural vector space under the action of matrix group $G$ by constructing at most `MaxSize` random elements of the orbit and counting at most `NumberCoincidences` coincidences. The function returns a lower bound, upper bound, and estimate of size; if insufficient coincidences are found to estimate the orbit size, the function returns 0. Theoretical details of the algorithm used may be found in Eick, Leedham-Green, and O’Brien [[ELGO02](https://docs.magma-maths.org/references.md#cite-elo-auts)].

<a id="function-approximatestabiliser-grpmat-grpmat-modtupfld"></a>
##### `ApproximateStabiliser(G, A, U: parameters): GrpMat, GrpMat, ModTupFld -> GrpMat, GrpMat, RngIntElt, RngIntElt, RngIntElt`

```magma
ImageGenerators   : SeqEnum                      Default: []
MaxSize           : RngIntElt                    Default: 10000
NumberCoincidences: RngIntElt                    Default: 15
OrderCheck        : BoolElt                      Default: false
```

The matrix group $A$ is the image of the representation of the matrix group $G$ and $A$ acts on $U$, a subspace or vector. Approximate the stabiliser of $U$ under $A$. We assume either a $1-1$ correspondence between generators of $G$ and those of $A$, or between generators of $G$ and those elements of $A$ supplied as `ImageGenerators`. Elements of $G$ whose images in $A$ fix $U$ are obtained by constructing at most `MaxSize` elements of the orbit of $U$ under $A$ or until we find `Numbercoincidences` repetitions in this orbit; if `OrderCheck` is `true`, report the order of the subgroup $S$ of $A$ which is found. Return preimage of $S$ in $G$ and $S$, together with a lower bound, upper bound, and estimate of the size of orbit of $U$. If insufficient coincidences are found to estimate the orbit size, the function returns these last values as 0.

<a id="example-ex-32857e"></a>
##### `Example: Estimating an Orbit and Stabiliser (ex-32857e)`

```magma
> G := GL (4, 5);
> A := ExteriorSquare (G);
> V := VectorSpace (GF (5), 6);
> U := sub < V | [Random (V): i in [1..2]]>;
> U;
Vector space of degree 6, dimension 2 over GF(5)
Generators:
(4 3 2 1 0 2)
(3 2 2 4 4 1)
Echelonized basis:
(1 0 2 0 2 4)
(0 1 3 2 4 2)
> EstimateOrbit (A, U);
209316 594421 324272
> H, B, lb, ub, estimate := ApproximateStabiliser (G, A, U);
> #H, #B;
460800 230400
```

<a id="function-stabiliserofspaces-seqenum"></a>
##### `StabiliserOfSpaces(Q): SeqEnum -> GrpMat, SeqEnum`

Determine the subgroup of $GL(d, F)$, for $F$ a finite field, which stabilises the sequence $Q$ of subspaces of the natural vector space. The function also returns generators for the largest unipotent subgroup of the stabiliser. For a description of this algorithm, see Schwingel [[Sch00b](https://docs.magma-maths.org/references.md#cite-schwingel-thesis)]; this implementation was prepared by Eamonn O’Brien.

<a id="example-ex-3c31f0"></a>
##### `Example: Stabiliser of Spaces (ex-3c31f0)`

```magma
> V := VectorSpace(GF (3), 4);
> Spaces := [sub< V | [1,1,0,2]>, sub < V | [ 1, 0, 2, 0 ], [ 0, 1, 0, 0]>];
> S, P := StabiliserOfSpaces(Spaces);
> #S;
5184
> P;
[
    [1 1 0 0]
    [0 1 0 0]
    [0 1 1 0]
    [0 1 0 1],

    [2 0 2 0]
    [0 1 0 0]
    [1 0 0 0]
    [1 0 2 1],

    [1 0 1 2]
    [0 1 0 0]
    [0 0 2 2]
    [0 0 1 0]
]
```

Thus, the unipotent subgroup generated by $P$ has order $3^3$.

<a id="function-isunipotent-grpmat"></a>
##### `IsUnipotent(G): GrpMat -> BoolElt`

If $G$ is a $p$-subgroup of $GL(d, F)$, where $F$ is a finite field of characteristic $p$, then return `true`, else return `false`.

<a id="function-unipotentstabiliser-grpmat-modtupfld"></a>
##### `UnipotentStabiliser(G, U: parameters): GrpMat, ModTupFld -> GrpMat, ModTupFld, GrpMatElt, GrpSLPElt`

Given a unipotent subgroup $G$ of $GL(d, F)$, for $F$ a finite field, $U$ a subspace of the natural vector space, determine the stabiliser in $G$ of $U$. The function returns the stabiliser in $G$ of $U$, the *canonical* element $C$ of the orbit of $U$ under $G$, an element $x$ of $G$ such that $U^x = C$, and an SLP for $x$ as an element of `WordGroup`$(G)$. This function does *not* compute the orbit of $U$ under $G$, but instead constructs the canonical element of the orbit. Hence it can be used to decide whether or not two subspaces belong to the same orbit. For a description of this algorithm, see [[Sch00b](https://docs.magma-maths.org/references.md#cite-schwingel-thesis)]; this implementation was prepared by Elliot Costi.

<a id="example-ex-78b096"></a>
##### `Example: Unipotent Stabiliser of Spaces (ex-78b096)`

```magma
> V := VectorSpace(GF (3), 4);
> G := sub< GL (4, 3) |
>     [ 1, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 1, 0, 1 ],
>     [ 2, 0, 2, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 2, 1 ],
>     [ 1, 0, 1, 2, 0, 1, 0, 0, 0, 0, 2, 2, 0, 0, 1, 0 ] >;
> U := sub < V | [ 1, 2, 0, 1 ],[ 2, 2, 1, 0 ]>;
> S, C, x, w := UnipotentStabiliser(G, U);
> S;
MatrixGroup(4, GF(3))
Generators:
    [2 1 2 0]
    [0 1 0 0]
    [1 1 0 0]
    [1 1 2 1]
> #S;
3
> Index(G, S);
9
```

So the stabiliser of U has order 3 and U lies in an orbit of size 9. We print the canonical element of the orbit of U under G. The element x maps U to C and w evaluates to x.

```magma
> C;
Vector space of degree 4, dimension 2 over GF(3)
Echelonized basis:
(1 0 0 0)
(0 1 2 0)
>  U^x;
Vector space of degree 4, dimension 2 over GF(3)
Echelonized basis:
(1 0 0 0)
(0 1 2 0)
> W, phi := WordGroup (G);
>  phi (w);
[1 0 2 1]
[0 1 0 0]
[0 0 0 1]
[0 0 2 2]
```

#### Action on Orbits

<a id="function-orbitaction-grpmat-elt"></a>
##### `OrbitAction(G, T): GrpMat, Elt -> Hom(Grp), GrpPerm, GrpMat`

Given a matrix group $G$ with natural module $M$, and a set $T$ consisting of either (a) elements of $M$, (b) submodules of $M$ or (c) tuples, form the $G$-closure $Y$ of $T$ and construct the homomorphism $\phi: G \rightarrow L$, where the permutation group $L$ gives the action of $G$ on the set $Y$. The function returns:

**(a)**
The natural homomorphism $\phi: G \rightarrow  L$;

**(b)**
The induced group $L$;

**(c)**
The kernel of the action (a subgroup of $G$).

The permutation group $L$ acts on the set $X = \{1..\#Y\}$. The map $\phi$ can be used to pass between $X$ and $Y$. If $k\in X$ then $\phi(k)$ is the corresponding element of $Y$, while if $t\in Y$ then the inverse image of $t$ under $\phi$ is the corresponding element of $X$.

<a id="function-orbitactionbounded-grpmat-elt-rngintelt"></a>
##### `OrbitActionBounded(G, T, b): GrpMat, Elt, RngIntElt -> BoolElt, Hom(Grp), GrpPerm, GrpMat`

Given a matrix group $G$ with natural module $M$, and a set $T$ consisting of either (a) elements of $M$, (b) submodules of $M$ or (c) tuples, form the $G$-closure $Y$ of $T$. If the cardinality of $Y$ does not exceed $b$, then construct the homomorphism $\phi: G \rightarrow L$, where the permutation group $L$ gives the action of $G$ on the set $Y$. In this case the function returns:

**(a)**
The boolean value `true`.

**(b)**
The natural homomorphism $\phi: G \rightarrow  L$;

**(c)**
The induced group $L$;

**(d)**
The kernel of the action (a subgroup of $G$). If the cardinality of $Y$ exceeds $b$, simply return `false`. (The action of $G$ on $Y$ is not constructed in this case).

<a id="function-orbitimage-grpmat-set"></a>
##### `OrbitImage(G, T): GrpMat, Set -> GrpPerm, SetIndx`

Given a matrix group $G$ with natural module $M$, and a set $T$ consisting of either (a) elements of $M$, (b) submodules of $M$ or (c) tuples, form the $G$-closure $Y$ of $T$ and return the permutation group $L$ giving the action of $G$ on $Y$. The second return value is $Y$, with the indexing of $Y$ giving the correspondence between $Y$ and the points acted on by $L$.

<a id="function-orbitimagebounded-grpmat-set-rngintelt"></a>
##### `OrbitImageBounded(G, T, b): GrpMat, Set, RngIntElt -> BoolElt, GrpPerm, SetIndx`

Given a matrix group $G$ with natural module $M$, and set $T$ consisting of either (a) elements of $M$, (b) submodules of $M$ or (c) tuples, form the $G$-closure $Y$ of $T$. If the cardinality of $Y$ does not exceed $b$, return `true` together with the permutation group $L$ giving the action of $G$ on $Y$. If the cardinality of $Y$ does exceed $b$, the action is not constructed and the single value `false` is returned.

<a id="function-orbitkernel-grpmat-set"></a>
##### `OrbitKernel(G, T): GrpMat, Set -> GrpMat`

Given a matrix group $G$ with natural module $M$, and a set $T$ consisting of either (a) elements of $M$, (b) submodules of $M$ or (c) tuples, form the $G$-closure $Y$ of $T$ and return the kernel of the action of $G$ on $Y$.

<a id="function-orbitkernelbounded-grpmat-set-rngintelt"></a>
##### `OrbitKernelBounded(G, T, b): GrpMat, Set, RngIntElt -> BoolElt, GrpMat`

Given a matrix group $G$ with natural module $M$, and set $T$ consisting of either (a) elements of $M$, (b) submodules of $M$ or (c) tuples, form the $G$-closure $Y$ of $T$. If the cardinality of $Y$ does not exceed $b$, return the boolean value `true` together with the kernel of the action of $G$ on $Y$. If the cardinality of $Y$ does exceed $b$, the kernel is not constructed and the single value `false` is returned.

<a id="example-ex-2b1162"></a>
##### `Example: Permutation Representation from Eigenspaces (ex-2b1162)`

We look for a small $G$-set for the group $J2A2$ (defined above) by examining eigenspaces of its generators. Having found a reasonably sized set, we then construct a permutation representation for $G$ on this set.

```magma
> [ Factorization(CharacteristicPolynomial(G.i)) : i in [1..3] ];
[
    [
          <x^3 + w^5*x^2 + w^3*x + 2, 1>,
          <x^3 + w^7*x^2 + w*x + 2, 1>
    ],
    [
          <x + 2, 6>
    ],
    [
         <x + w^2, 3>,
         <x + w^6, 3>
    ]
]
> y := Eigenspace(G.2, -2);
> y;
Vector space of degree 6, dimension 3 over GF(3, 2)
Echelonized basis:
(1 0 0 1 2 1)
(0 1 0 2 1 2)
(0 0 1 1 2 1)
> #Orbit(G, y);
280
> P := OrbitImage(G, y);
> P;
Permutation group P of degree 280
> Order(P);
604800
> CompositionFactors(P);
    G
    |  J2
    1
```

Thus, our group has the simple group $J_2$ of Janko as a composition factor.

```magma
> Order(G);
1209600
```

Hence the kernel of this action has order 2.

#### Action on a Coset Space

<a id="function-cosetaction-grpmat-grpmat"></a>
##### `CosetAction(G, H): GrpMat, GrpMat -> Hom(Grp), GrpPerm, GrpMat`

Given a subgroup $H$ of the group $G$, construct the permutation representation of $G$ given by the action of $G$ on the set of (right) cosets of $H$ in $G$. The function returns:

**(a)**
The natural homomorphism $f: G \rightarrow  L$;

**(b)**
The induced permutation group $L$;

**(c)**
The kernel $K$ of the action (a subgroup of $G$).

<a id="function-cosetimage-grpmat-grpmat"></a>
##### `CosetImage(G, H): GrpMat, GrpMat -> GrpPerm`

Given a subgroup $H$ of the group $G$, construct the image $L$ of $G$ given by the action of $G$ on the set of (right) cosets of $H$ in $G$. $L$ is returned as a permutation group.

<a id="function-cosetkernel-grpmat-grpmat"></a>
##### `CosetKernel(G, H): GrpMat, GrpMat -> GrpMat`

Given a subgroup $H$ of the group $G$, construct the kernel of the action of $G$ on the set of (right) cosets of $H$ in $G$.

<a id="example-ex-71335a"></a>
##### `Example: Action on Cosets in SL(3, 3) (ex-71335a)`

We construct $G = {\operatorname{SL}}(3, 3)$, a subgroup $H$ of $G$, and the permutation representation of $G$ given by its action on the cosets of $H$.

```magma
> G := MatrixGroup< 3, GF(3) | [0,2,0, 1,1,0, 0,0,1], [0,1,0, 0,0,1, 1,0,0] >;
> Order(G);
5616
> H := sub< G | G.1^2, G.2 >;
> Order(H);
216
> P := CosetImage(G, H);
> P;
Permutation group P of degree 26
    (1, 2)(3, 4, 6, 5, 7, 9)(8, 11)(10, 13, 15, 20, 18, 17)
      (12, 16, 21, 14, 19, 24)(23, 26)
    (2, 3, 5)(4, 6, 8)(7, 10, 14)(9, 12, 17)(11, 15, 20)(13, 18, 23)
      (16, 22, 21)(19, 25, 24)
```

#### Action on the Natural $G$-Module

A set of functions is provided for working with the action of $G$ on the natural $G$-module $M$, for a matrix group $G$ defined over a finite field. Many of these functions are similar to those presented in the general module chapter.

<a id="function-gmodule-grpmat-2"></a>
##### `GModule(G): GrpMat -> ModGrp`

The natural $R[G]$-module $M$ for the matrix group $G$.

<a id="function-isirreducible-grpmat"></a>
##### `IsIrreducible(G): GrpMat -> BoolElt, ModGrp`

Given a matrix group $G$, return `true` iff $G$ acts irreducibly on its natural module $M$. If $G$ acts reducibly on $M$, a proper submodule $S$ of $M$ is also returned.

<a id="function-submoduleaction-grpmat"></a>
##### `SubmoduleAction(G, S): GrpMat -> Map, GrpMat`

Given a matrix group $G$ and a submodule $S$ of the natural module $M$ of $G$, return the action homomorphism $f$ of $G$ on $S$, together with the image of $f$.

<a id="function-submoduleimage-grpmat"></a>
##### `SubmoduleImage(G, S): GrpMat -> GrpMat`

Given a matrix group $G$ and a submodule $S$ of the natural module $M$ of $G$, return the image of the action homomorphism of $G$ on $S$.

<a id="function-quotientmoduleaction-grpmat"></a>
##### `QuotientModuleAction(G, S): GrpMat -> Map, GrpMat`

Given a matrix group $G$ and a submodule $S$ of the natural module $M$ of $G$, return the quotient action homomorphism $f$ of $G$ on $S$, together with the image of $f$.

<a id="function-quotientmoduleimage-grpmat"></a>
##### `QuotientModuleImage(G, S): GrpMat -> GrpMat`

Given a matrix group $G$ and a submodule $S$ of the natural module $M$ of $G$, return the quotient image of the action homomorphism of $G$ on $S$.

<a id="function-isabsolutelyirreducible-grpmat"></a>
##### `IsAbsolutelyIrreducible(G): GrpMat -> BoolElt`

Given a matrix group $G$, return `true` if and only if $G$ acts absolutely irreducibly on its natural module $M$. In addition, if $G$ is absolutely irreducible, the function returns the (matrix algebra) generator of the endomorphism algebra $E$ of $M$ (which is always a field), and the dimension of $E$.

<a id="function-absoluterepresentation-grpmat"></a>
##### `AbsoluteRepresentation(G): GrpMat -> GrpMat, Map`

Given an irreducible matrix group $G$, return the isomorphic reduced-degree absolute representation $A$ of $G$, which is over the absolute field of the natural module $M$ of $G$ and is absolutely irreducible, together with the corresponding isomorphism.

<a id="function-minimalfield-grpmat"></a>
##### `MinimalField(G): GrpMat -> FldFin`

Given a matrix group $G$ defined over a finite field $K$, return the minimal subfield of $K$ over which $G$ can be realised.

### Normal and Subnormal Subgroups

The functions described in this section apply only to finite groups for which a base and strong generating set may be constructed.

#### Characteristic Subgroups and Subgroup Series

<a id="function-centre-grpmat"></a>
##### `Centre(G): GrpMat -> GrpMat`

<a id="function-center-grpmat"></a>
##### `Center(G): GrpMat -> GrpMat`

Construct the centre of the group $G$.

<a id="function-derivedlength-grpmat"></a>
##### `DerivedLength(G): GrpMat -> RngIntElt`

The derived length of the matrix group $G$. If $G$ is non-soluble, the function returns the number of terms in the series terminating with the soluble residual.

<a id="function-derivedseries-grpmat"></a>
##### `DerivedSeries(G): GrpMat -> [ GrpMat ]`

The derived series of the group $G$. The series is returned as a sequence of subgroups.

<a id="function-commutatorsubgroup-grpmat"></a>
##### `CommutatorSubgroup(G): GrpMat -> GrpMat`

<a id="function-derivedsubgroup-grpmat"></a>
##### `DerivedSubgroup(G): GrpMat -> GrpMat`

<a id="function-derivedgroup-grpmat"></a>
##### `DerivedGroup(G): GrpMat -> GrpMat`

The derived subgroup of the group $G$.

<a id="function-fittingsubgroup-grpmat"></a>
##### `FittingSubgroup(G): GrpMat -> GrpMat`

The Fitting subgroup of the group $G$.

<a id="function-lowercentralseries-grpmat"></a>
##### `LowerCentralSeries(G): GrpMat -> [ GrpMat ]`

The lower central series of the matrix group $G$. The series is returned as a sequence of subgroups.

<a id="function-nilpotencyclass-grpmat"></a>
##### `NilpotencyClass(G): GrpMat -> RngIntElt`

The nilpotency class of the group $G$.

<a id="operation-op-pow-grpmat"></a>
##### `H ^ G: GrpMat -> GrpMat`

<a id="function-normalclosure-grpmat"></a>
##### `NormalClosure(G, H): GrpMat -> GrpMat`

The normal closure of the subgroup $H$ of group $G$.

<a id="function-solubleresidual-grpmat"></a>
##### `SolubleResidual(G): GrpMat -> GrpMat`

<a id="function-solvableresidual-grpmat"></a>
##### `SolvableResidual(G): GrpMat -> GrpMat`

The solvable residual of the group $G$.

<a id="function-subnormalseries-grpmat-grpmat"></a>
##### `SubnormalSeries(G, H): GrpMat, GrpMat -> [ GrpMat ]`

Given a group $G$ and a subnormal subgroup $H$ of $G$, return a sequence of subgroups commencing with $G$ and terminating with $H$, such that each subgroup is normal in the previous one. If $H$ is not subnormal in $G$, the empty sequence is returned.

<a id="function-uppercentralseries-grpmat"></a>
##### `UpperCentralSeries(G): GrpMat -> [ GrpMat ]`

The upper central series of the matrix group $G$. The series is returned as a sequence of subgroups. As the algorithm used requires the conjugacy classes of $G$, this function is much more restricted in its range of application than `DerivedSeries` and `LowerCentralSeries`.

<a id="example-ex-32b53b"></a>
##### `Example: Subgroup Series of a Soluble Group (ex-32b53b)`

We demonstrate some of the series functions by applying them to a soluble subgroup of ${\operatorname{GL}}(3, 5)$.

```magma
> G := MatrixGroup< 3, GF(5) | [0,1,0, 1,0,0, 0,0,1],
>                                      [0,1,0, 0,0,1, 1,0,0],
>                                      [2,0,0, 0,1,0, 0,0,1] >;
> Order(G);
384
> DerivedGroup(G);
MatrixGroup(3, GF(5, 1))
Generators:
[0 0 1]
[1 0 0]
[0 1 0]

[2 0 0]
[0 3 0]
[0 0 1]
> D := DerivedSeries(G);
> [ Order(d) : d in D ];
[ 384, 48, 16, 1 ]
> L := LowerCentralSeries(G);
> [ Order(l) : l in L ];
[ 384, 48 ]
> K := sub< G | [ 2,0,0, 0,3,0, 0,0,2 ] >;
> S := SubnormalSeries(G, K);
> [ Order(s) : s in S ];
[ 384, 16, 4 ]
```

#### The Soluble Radical and its Quotient

The functions in this section enable the user to construct the radical, its quotient, and an elementary abelian series. They are currently restricted to matrix groups where a base and strong generating set can be constructed and the base ring is either a field or can be embedded into a field.

<a id="function-radical-grpmat"></a>
##### `Radical(G): GrpMat -> GrpMat`

<a id="function-solubleradical-grpmat"></a>
##### `SolubleRadical(G): GrpMat -> GrpMat`

<a id="function-solvableradical-grpmat"></a>
##### `SolvableRadical(G): GrpMat -> GrpMat`

Given a group $G$, return the maximal normal solvable subgroup of $G$. The algorithm is to compute the radical quotient map, and then compute its kernel. The algorithm used is described in Unger [[Ung06b](https://docs.magma-maths.org/references.md#cite-unger)].

<a id="function-radicalquotient-grpmat"></a>
##### `RadicalQuotient(G): GrpMat -> GrpPerm, Hom(Grp), GrpMat`

Given a group $G$, compute a permutation representation of the quotient $G/R$ where $R$ is the (solvable) radical of $G$. Both the permutation group $Q$ isomorphic to $G/R$ and a homomorphism $\phi: G\rightarrow Q$ are returned. The third return value is $R$, the radical of $G$ and the kernel of the homomorphism. The algorithm used is described in Unger [[Ung06b](https://docs.magma-maths.org/references.md#cite-unger)].

<a id="function-elementaryabelianseries-grpmat"></a>
##### `ElementaryAbelianSeries(G: parameters): GrpMat -> [ GrpMat ]`

```magma
LayerSizes: SeqEnum[RngIntElt]                    Default: []
```

An elementary abelian series is a chain of normal subgroups $R = N_1 > N_2 > ... > N_r = 1$ with the property that the quotient of each pair of successive terms in the series is elementary abelian and that there is no group $R < H < G$ such that $H/R$ is elementary abelian and $H$ normal in $G$. The top of the series $R$ is called the solvable radical and is the maximal normal solvable subgroup of $G$.

The parameter `LayerSizes` controls possible refinement of the series. As an example, take `LayerSizes := [ 2, 5, 3, 4, 7, 3, 11, 2, 17, 1]`. When constructing an elementary abelian series for the group, attempt to split 2-layers of size gt $2^5$, 3-layers of size gt $3^4$, etc. The implied exponent for 13 is 2 and for all primes greater than 17 the exponent is 1. Setting `LayerSizes` to `[2, 1]` will attempt to split all layers, resulting in a portion of a chief series for $G$.

<a id="function-elementaryabelianseriescanonical-grpmat"></a>
##### `ElementaryAbelianSeriesCanonical(G): GrpMat -> [ GrpMat ]`

Gives a similar result to using `ElementaryAbelianSeries`, except the series returned depends only on the isomorphism type of the solvable radical, and consists of characteristic subgroups of $G$. This function may be slower than `ElementaryAbelianSeries`.

#### Composition and Chief Factors

The functions in this section enable the user to find the composition factors of a matrix group. They are restricted to matrix groups where a base and strong generating set can be constructed. The chief series and factors functions are further restricted to groups where the base ring is either a field or can be embedded into a field.

<a id="function-compositionfactors-grpmat"></a>
##### `CompositionFactors(G): GrpMat -> [ <RngIntElt, RngIntElt, RngIntElt> ]`

Given a matrix group $G$, return a sequence $S$ of tuples that represent the composition factors of $G$, ordered according to some composition series of $G$. Each tuple is a triple of integers $f$, $d$, $q$ that defines the isomorphism type of the corresponding composition factor. A triple $< f,d,q >$ describes a simple group as follows. The integer $f$ defines the family to which the group belongs, and $d$ and $q$ are the parameters of the family. The length of the sequence $S$ is the number of composition factors of $G$. The numbering of the simple group families is given in [Tables 1 and 2](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/characteristic-subgroup-normal-structure.md#grpperm-tablecompositionfactors) of the chapter on permutation groups.

<a id="function-chieffactors-grpmat"></a>
##### `ChiefFactors(G): GrpMat -> [ <RngIntElt, RngIntElt, RngIntElt, RngIntElt> ]`

Given a group $G$, return a sequence of the isomorphism types $<f, d, q, m>$ of the chief factors. An isomorphism type in a chief factor should be understood as the direct product of $m$ copies of the simple group described by $<f, d, q>$ (see `CompositionFactors` above). For the algorithm, see Unger [[Ung](https://docs.magma-maths.org/references.md#cite-chief-series-unger)].

<a id="function-chiefseries-grpmat"></a>
##### `ChiefSeries(G): GrpMat -> [ GrpMat ], [ <RngIntElt, RngIntElt, RngIntElt, Rng IntElt> ]`

Given a group $G$, return the chief series of $G$ and a sequence of the corresponding isomorphism types $<f, d, q, m>$ of the chief factors. An isomorphism type in a chief factor should be understood as the direct product of $m$ copies of the simple group described by $<f, d, q>$ (see `CompositionFactors` above). The series will be organised to contain the soluble radical of $G$, and, if $G$ is insoluble, the socle of the quotient of $G$ by the soluble radical.

<a id="example-ex-76e310"></a>
##### `Example: Chief Factors over a Cyclotomic Field (ex-76e310)`

We get the chief factors of a group of degree 4 defined over the cyclotomic field of order 8.

```magma
> L<zeta_8> := CyclotomicField(8);
> w := -( - zeta_8^3 - zeta_8^2 + zeta_8);
> // Define sqrt(q)
> rt2 := -1/6*w^3 + 5/6*w;
> // Define sqrt(-1)
> ii := -1/6*w^3 - 1/6*w;
> f := rt2;
> t := f/2 + (f/2)*ii;
> GL4L := GeneralLinearGroup(4, L);
>
> A := GL4L ! [ 1/2, 1/2, 1/2, 1/2,
>             1/2,-1/2, 1/2,-1/2,
>             1/2, 1/2,-1/2,-1/2,
>             1/2,-1/2,-1/2, 1/2 ];
>
> B := GL4L ! [ 1/f,   0, 1/f,   0,
>               0, 1/f,   0, 1/f,
>             1/f,   0,-1/f,   0,
>               0, 1/f,   0,-1/f ];
>
> g4 := GL4L ! [  1, 0, 0, 0,
>               0, 1, 0, 0,
>               0, 0, 1, 0,
>               0, 0, 0,-1 ];
>
> D1 := GL4L ! [ 1, 0, 0, 0,
>              0,ii, 0, 0,
>              0, 0, 1, 0,
>              0, 0, 0,ii ];
>
> D3 := GL4L ! [ t, 0, 0, 0,
>              0, t, 0, 0,
>              0, 0, t, 0,
>              0, 0, 0, t ];
>
> G3 := sub< GL4L | A, B, g4, D1, D3 >;
> Order(G3);
92160
> ChiefFactors(G3);
    G
    |  Cyclic(2)
    *
    |  Alternating(6)
    *
    |  Cyclic(2) (4 copies)
    *
    |  Cyclic(2)
    *
    |  Cyclic(2)
    *
    |  Cyclic(2)
    1
```

### Coset Tables and Transversals

The functions described in this section apply only to finite groups for which a base and strong generating set may be constructed.

<a id="function-cosettable-grp-grp"></a>
#### `CosetTable(G, H): Grp, Grp -> Hom(Grp)`

The (right) coset table for the group $G$ over subgroup $H$ relative to its defining generators.

<a id="function-transversal-grpmat-grpmat"></a>
#### `Transversal(G, H): GrpMat, GrpMat -> {@ GrpMatElt @}, Map`

<a id="function-righttransversal-grpmat-grpmat"></a>
#### `RightTransversal(G, H): GrpMat, GrpMat -> {@ GrpMatElt @}, Map`

Given a matrix group $G$ and a subgroup $H$ of $G$, this function returns

**(a)**
A set of elements $T$ of $G$ forming a right transversal for $G$ over $H$; and

**(b)**
The corresponding transversal mapping $\phi: G \rightarrow T$. If $T = [t_1, \ldots, t_r]$ and $g \in G$, $\phi$ is defined by $\phi(g) = t_i$, where $g\in H*t_i$.

### Presentations

The functions described in this section apply only to finite groups for which a base and strong generating set may be constructed.

<a id="id1"></a>
#### Presentations

<a id="function-fpgroup-grpmat"></a>
##### `FPGroup(G): GrpMat -> GrpFP, Hom(Grp)`

Construct a presentation for the matrix group $G$ on the set of defining generators and return the presentation in the form of a finitely presented group $F$ that is isomorphic to $G$. The presentation is obtained by first computing the regular representation of $G$ and then using the Todd-Coxeter Schreier algorithm to construct a presentation on the strong generators. In this situation the strong generators are identical to the defining generators.

A group homomorphism $\phi: F \rightarrow G$, defining $G$ as a matrix representation of $F$, is also returned.

<a id="function-fpgroupstrong-grpmat"></a>
##### `FPGroupStrong(G): GrpMat -> GrpFP, Hom(Grp)`

Construct a presentation for the matrix group $G$ on a set of strong generators and return the presentation in the form of a finitely presented group $F$ that is isomorphic to $G$. In Magma, the Todd-Coxeter Schreier algorithm is used to construct the presentation. If strong generators are not already known for $G$, they will be constructed. In the case in which strong generators are already known for $G$, the presentation will be on these strong generators.

The presentation will have the property that it contains presentations for all stabilizer subgroups defined by the BSGS.

The group homomorphism $f: F \rightarrow G$, defining $G$ as a matrix representation of $F$, is also returned.

#### Matrices as Words

Consider a matrix group $G$ defined on $d$ generators. The *word group* of $G$ is a free group $W$ of rank $d$. Then we regard $G$ as a homomorphic image of $F$ with associated homomorphism $\phi: W \rightarrow G$. All operations involving words in the generators of $G$ will be performed in $W$.

<a id="function-wordgroup-grpmat"></a>
##### `WordGroup(G): GrpMat -> GrpSLP, Map`

Given a matrix group $G$ defined on $d$ generators, return (a) a free group $W$ on $d$ generators as an SLP-group, and (b) the homomorphism $\phi$ from $W$ to $G$ such that $W.i \rightarrow G.i$, for $i = 1, \ldots, d$. The group $W$ associated with $G$ by this function will be referred to as the *word group* for $G$.

<a id="function-inversewordmap-grpmat"></a>
##### `InverseWordMap(G): GrpMat -> Map`

Given a matrix group $G$ and its associated word group $W$ with canonical homomorphism $\phi:W \rightarrow G$, construct the inverse mapping $\rho$. Thus, given a matrix $g$ of $G$, $g@\rho$ returns an element in the preimage of $g$ under $\phi$. If the word group $W$ does not already exist, it will be created.

<a id="function-wordingenerators-grpmat-grpmatelt"></a>
##### `WordInGenerators(G, g : parameters): GrpMat, GrpMatElt -> GrpFPElt`

```magma
RegLimit: RngIntElt                    Default: 1000000
Print   : RngIntElt                    Default: 0
```

Compute a word in a free group with generators corresponding to those of the group $G$ that evaluates to the element $g \in G$.

If $G$ has order at most `RegLimit` then the word will be computed using the regular permutation representation of $G$, and will be guaranteed to be a shortest word representing $g$. Otherwise an algorithm of Minkwitz [[Min98](https://docs.magma-maths.org/references.md#cite-minkwitz)] is used, which will find a reasonably short word for $g$ but not necessarily a shortest word. The optional parameter `Print` controls the printing of diagnostics.

The first call of this function for an element $g$ of the group $G$ will take longer than subsequent calls for elements of the same group, because some necessary data is calculated with the first call.

### Automorphism Groups

The automorphism group of a finite matrix group may be computed in Magma, subject to the same restrictions on the group as when computing maximal subgroups. (That is, all of the non-abelian composition factors of the group must appear in a certain database.) The methods used are those described in Cannon and Holt [[CH03](https://docs.magma-maths.org/references.md#cite-autos-permg)]. The existence of an isomorphism between a given matrix group and any other type of finite group (`GrpPerm` or `GrpPC`) may also be determined using similar methods.

<a id="function-automorphismgroup-grpmat"></a>
#### `AutomorphismGroup(G: parameters): GrpMat -> GrpAuto`

```magma
SmallOuterAutGroup: RngIntElt                    Default: 20000
Print             : RngIntElt                    Default: 0
PrintSearchCount  : RngIntElt                    Default: 1000
```

Given a finite matrix group $G$, construct the full automorphism group $F$ of $G$. The function returns the full automorphism group of $G$ as a group of mappings (i.e., as a group of type `GrpAuto`). The automorphism group $F$ is also computed as a finitely presented group and can be accessed via the function `FPGroup(F)`. A function `PermutationRepresentation` is provided that when applied to $F$, attempts to construct a faithful permutation representation of reasonable degree. The algorithm described in Cannon and Holt [[CH03](https://docs.magma-maths.org/references.md#cite-autos-permg)] is used.

`SmallOuterAutGroup := t`: Specify the strategy for the backtrack search when testing an automorphism for lifting to the next layer. If the outer automorphism group $O$ at the previous level has order at most $t$, then the regular representation of $O$ is used, otherwise the program tries to find a smaller degree permutation representation of $O$.

The level of verbose printing. The possible values are 0, 1, 2, or 3.

`PrintSearchCount := s`: If `Print := 3`, then a message is printed at each $s$-th iteration during the backtrack search for lifting automorphisms.

Further information about the construction of the automorphism group and a description of machinery for computing with group automorphisms may be found in Chapter [Automorphism Groups](https://docs.magma-maths.org/FiniteGroups/AutomorphismGroups/index-automorphism-groups.md#chapgrpauto).

<a id="example-ex-dc7caf"></a>
#### `Example: Automorphism Group of a Matrix Group (ex-dc7caf)`

We construct a $3$-dimensional matrix group over $GF(4)$ and determine the order of its automorphism group.

```magma
> k<w> := GF(4);
> G := MatrixGroup< 3, k |
> [w^2, 0, 0, 0, w^2, 0, 0, 0, w^2],
> [w^2, 0, w^2, 0, w^2, w^2, 0, 0, w^2],
> [1, 0, 0, 1, 0, w, w^2, w^2, 0],
> [w, 0, 0, w^2, 1, w^2, w, w, 0],
> [w, 0, 0, 0, w, 0, 0, 0, w] >;
> G;
MatrixGroup(3, GF(2^2))
Generators:
    [w^2   0   0]
    [  0 w^2   0]
    [  0   0 w^2]

    [w^2   0 w^2]
    [  0 w^2 w^2]
    [  0   0 w^2]

    [  1   0   0]
    [  1   0   w]
    [w^2 w^2   0]

    [  w   0   0]
    [w^2   1 w^2]
    [  w   w   0]

    [  w   0   0]
    [  0   w   0]
    [  0   0   w]
> #G;
576
> A := AutomorphismGroup(G);
> #A;
3456
> OuterOrder(A);
72
> F := FPGroup(A);
> P := DegreeReduction(CosetImage(F, sub<F|>));
> P;
Permutation group P acting on a set of cardinality 48
```

Thus, we see that $G$ has an automorphism group of order 3456 and the quotient group of $A$ consisting of outer automorphisms, has order 72. The automorphism group may be realised as a permutation group of degree 48.

<a id="function-isisomorphic-grpmat-grpmat"></a>
#### `IsIsomorphic(G, H: parameters): GrpMat, GrpMat -> BoolElt, Hom(Grp)`

<a id="function-isisomorphic-grpmat-grpperm"></a>
#### `IsIsomorphic(G, H: parameters): GrpMat, GrpPerm -> BoolElt, Hom(Grp)`

<a id="function-isisomorphic-grpperm-grpmat"></a>
#### `IsIsomorphic(G, H: parameters): GrpPerm, GrpMat -> BoolElt, Hom(Grp)`

```magma
SmallOuterAutGroup: RngIntElt                    Default: 20000
Print             : RngIntElt                    Default: 0
PrintSearchCount  : RngIntElt                    Default: 1000
```

Test whether or not the two finite groups $G$ and $H$ are isomorphic as abstract groups. If so, both the result `true` and an isomorphism from $G$ to $H$ is returned. If not, the result `false` is returned. The algorithm described in Cannon and Holt [[CH03](https://docs.magma-maths.org/references.md#cite-autos-permg)] is used.

`SmallOuterAutGroup := t`: Specify the strategy for the backtrack search when testing an automorphism for lifting to the next layer. If the outer automorphism group $O$ at the previous level has order at most $t$, then the regular representation of $O$ is used, otherwise the program tries to find a smaller degree permutation representation of $O$.

The level of verbose printing. The possible values are 0, 1, 2, or 3.

`PrintSearchCount := s`: If `Print := 3`, then a message is printed at each $s$-th iteration during the backtrack search for lifting automorphisms.

<a id="example-ex-ea03aa"></a>
#### `Example: Isomorphism with a Dihedral Group (ex-ea03aa)`

We construct a $3$-dimensional point group of order $8$ and test it for isomorphism with the dihedral group of order 8 given as a permutation group.

```magma
> n := 4;
> N := 4*n;
> K<z> := CyclotomicField(N);
> zz := z^4;
> i := z^n;
> cos := (zz+ComplexConjugate(zz))/2;
> sin := (zz-ComplexConjugate(zz))/(2*i);
> gl := GeneralLinearGroup(3, K);
> G := sub< gl | [ cos, sin, 0,
>                 -sin, cos, 0,
>                    0,   0, 1 ],
>
>                [  -1,   0, 0,
>                    0,   1, 0,
>                    0,   0, 1 ] >;
>
>  #G;
8
> D8 := DihedralGroup(4);
> D8;
Permutation group G acting on a set of cardinality 4
Order = 8 = 2^3
    (1, 2, 3, 4)
    (1, 4)(2, 3)
> #D8;
8
> bool, iso := IsIsomorphic(G, D8);
> bool;
true
> iso;
Homomorphism of MatrixGroup(3, K) of order 2^3 into
GrpPerm: D8, Degree 4, Order 2^3 induced by
    [ 0  1  0]
    [-1  0  0]
    [ 0  0  1] |--> (1, 2, 3, 4)

    [-1  0  0]
    [ 0  1  0]
    [ 0  0  1] |--> (1, 3)
```

### Representation Theory

A set of functions are provided for computing with the characters of a group. Full details of these functions may be found in Chapter [Characters of Finite Groups](https://docs.magma-maths.org/RepresentationTheory/CharactersOfFiniteGroups/index-characters-of-finite-groups.md#chapchtr). For convenience we include here two of the more useful character functions. Also, functions are provided for computing with the modular representations of a group. Full details of these functions may be found in Chapter [Modules over an Algebra and Group Representations](https://docs.magma-maths.org/RepresentationTheory/ModulesOverAnAlgebraAndGroupRepresentations/index-modules-over-an-algebra-and-group-representations.md#chapmodalg). For the reader’s convenience we include here the functions which may be used to define a $K[G]$-module for a matrix group.

The functions described in this section apply only to finite groups for which a base and strong generating set may be constructed.

<a id="function-linearcharacters-grpmat"></a>
#### `LinearCharacters(G): GrpMat -> [ Chtr ]`

A sequence containing the linear characters for the group $G$.

<a id="function-charactertable-grpmat"></a>
#### `CharacterTable(G: parameters): GrpMat -> TabChtr`

```magma
Al         : MonStgElt                    Default: "Default"
DSSizeLimit: RngIntElt                    Default: 0
```

Construct the table of ordinary irreducible characters for the group $G$.

This parameter controls the algorithm used. The string `"DS"` forces use of the Dixon-Schneider algorithm. The string `"IR"` forces the use of Unger’s induction/reduction algorithm [[Ung06a](https://docs.magma-maths.org/references.md#cite-chtr-table-unger)]. The `"Default"` algorithm is to use Dixon-Schneider for groups of order $\le 5000$ and Unger’s algorithm for larger groups. This may change in future.

When the default algorithm is selected, a positive value $n$ for `DSSizeLimit` means that before using Unger’s algorithm, the full character space is split by some passes of Dixon-Schneider, restricted to using class matrices corresponding to conjugacy classes with size at most $n$.

<a id="function-permutationcharacter-grpmat-grpmat"></a>
#### `PermutationCharacter(G, H): GrpMat, GrpMat -> AlgChtrElt`

Given a group $G$ and a subgroup $H$ of $G$, construct the ordinary character afforded by the representation of $G$ given by its action on the coset space of the subgroup $H$.

<a id="function-gmodule-grpmat-3"></a>
#### `GModule(G): GrpMat -> ModGrp`

The natural $R[G]$-module for the matrix group $G$.

<a id="function-gmodule-grpmat-algmat"></a>
#### `GModule(G, A): GrpMat, AlgMat -> ModGrp`

Let $A$ be a matrix ring defined over the ring $R$ and let $G$ be a finite group defined on $m$ generators. Let $M$ denote the underlying module of $A$. Suppose there is a one-to-one correspondence between the generators of $G$ and the generators $[ A_1, \ldots, A_m ]$ of $A$. The function `GModule` creates the $R[G]$-module corresponding to an action of $G$ on $M$ defined by $A$, where the action of the $i$-th generator of $G$ on $M$ is given by $A_i$.

<a id="function-gmodule-grpmat-algmatelt"></a>
#### `GModule(G, Q): GrpMat, [ AlgMatElt ] -> ModGrp`

Let $A$ be a matrix ring defined over the ring $R$ and let $G$ be a finite group defined on $m$ generators. Let $M$ denote the underlying module of $A$. Given a sequence $Q$ of $m$ elements of $A$, the function `GModule` creates the $R[G]$-module corresponding to an action of $G$ on $M$ defined by $Q$, where the action of the $i$-th generator of $G$ on $M$ is given by $Q[i]$.

<a id="function-gmodule-grpmat-grpmat-grpmat"></a>
#### `GModule(G, A, B): GrpMat, GrpMat, GrpMat -> ModGrp, Map`

Let $A$ and $B$ be normal subgroups of $G$ such that $B$ is contained in $A$. Further, assume that $A/B$ is elementary abelian of order $p^n$, $p$ a prime. Let $K$ denote the field of $p$ elements. This function constructs a $K[G]$-module corresponding to the action of the group $G$ on the elementary abelian section $A/B$ of $G$. The map from $A$ to the $K[G]$-module’s underlying vector space is also returned.

<a id="function-permutationmodule-grpmat-grpmat-rng"></a>
#### `PermutationModule(G, H, R): GrpMat, GrpMat, Rng -> ModGrp`

The permutation module for the matrix group $G$ over the ring $R$ defined by its action on the cosets of the subgroup $H$.

<a id="function-changeofbasismatrix-grpmat-modgrp"></a>
#### `ChangeOfBasisMatrix(G, S): GrpMat, ModGrp -> AlgMatElt`

Given a matrix group $G$ and a submodule $S$ of its natural module, return an invertible matrix with topmost rows a basis for $S$. Conjugating by the inverse of this matrix puts the generators of $G$ into a block form that exhibits their action on $S$ and the quotient module.

<a id="example-ex-089525"></a>
#### `Example: Refining a Normal Subgroup with Modules (ex-089525)`

We use the module machinery to refine an elementary abelian normal subgroup by finding a normal subgroup contained in it.

```magma
> G := MatrixGroup<4, IntegerRing(4) |
>  [ 3, 3, 1, 3, 0, 2, 2, 3, 3, 0, 1, 3, 3, 2, 2, 1 ],
>  [ 2, 2, 3, 3, 0, 3, 1, 1, 3, 0, 1, 1, 2, 0, 1, 2 ] >;
> #G;
660602880
> H := pCore(G, 2);
> FactoredOrder(H);
[ <2, 15> ]
> IsElementaryAbelian(H);
true
> M, f := GModule(G, H, sub<H|>);
> SM := Submodules(M);
> #SM;
3
```

One of these submodules is 0, one is all `M`, we are interested in the one in the middle. Note that the result returned by `Submodules` is sorted by dimension.

```magma
> N := SM[2] @@ f;
> N;
MatrixGroup(4, IntegerRing(4))
Generators:
  [3 0 0 0]
  [0 3 0 0]
  [0 0 3 0]
  [0 0 0 3]
```

We have found `N`, a normal subgroup of `G`, contained in the 2-core, with order 2.

<a id="bsgs-base-strong-generator"></a>
<a id="sec-bsgs"></a>
### Base and Strong Generating Set

#### Introduction

Computing structural information for a matrix group $G$ requires, in most cases, a representation of the set of elements of $G$. Magma represents this set by means of a *base and strong generating set, or BSGS* for $G$. Suppose the group $G$ has the natural module $M$. A *base* $B$ for $G$ is a sequence of distinct elements and submodules of $M$ with the property that the identity is the only element of $G$ that fixes $B$ pointwise. A base $B$ of length $n$ determines a sequence of subgroups $G^{(i)}$, $1 \leq i \leq n+1$, where $G^{(i)}$ is the stabilizer of the first $i-1$ points of $B$. Given a base $B$ for $G$, a subset $S$ of $G$ is said to be a *strong generating set* for $G$ if $G^{(i)} = \langle S \cap G^{(i)} \rangle$, for $i = 1, \ldots, n$.

Unlike permutation groups, however, the orbits of the $i$-th base point under the stabilizer $G^{(i)}$ are not bounded by the degree, but rather, by (where the base point is a 1-dimensional subspace) $(q^n-1)/(q-1)$ where $q$ is the cardinality of the coefficient field and $n$ is the degree of $G$. Clearly, it is essential to find small orbits if one is to compute with matrix groups in this manner. Unfortunately, there are no methods which are guaranteed to find short orbits. There are, however, some heuristics developed by Scott Murray and Eamonn O’Brien which often find good base points. These heuristics are used in Magma if the most likely standard base point would generate an orbit longer than 10000 (this bound may be changed).

Note also, that for matrix groups over a finite field, there is an alternative function `LMGBase` described in Section [Finding a Base](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/findbase.md#sec-findbase) that starts by computing a *composition tree* (Section [Composition Trees for Matrix Groups](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/composition-tree.md#sec-composition-tree)) for $G$.

#### Controlling Selection of a Base

Given the difficulties in automatically finding a good base for a matrix group, it is possible to apply the Murray-O’Brien base point selection procedure and preset a suitable base manually.

<a id="function-goodbasepoints-grpmat"></a>
##### `GoodBasePoints(G: parameters): GrpMat -> []`

```magma
Slots      : RngIntElt                    Default: 10
NoCycle    : RngIntElt                    Default: false
Eigenspaces: RngIntElt                    Default: false
```

Apply the Murray–O’Brien base point selection procedure and return a sequence of vectors or subspaces according to the parameters. The procedure computes and sorts a collection of eigenspaces $[V_1, \ldots, V_m]$ for a generating set for the matrix group $G$. The default action is then to return $[V_1.1, \ldots, V_m.1, V_1.2, \ldots]$ where each new vector is only added if it is not in the span of the preceding vectors.

Expand the number of generators to work with to `Slots` matrices by adding random words in the generators of $G$.

If `NoCycle := true`, instead of cycling through the eigenspaces, return the sequence $[V_1.1, \ldots, V_1.({\rm dim} V_1), V_2.1, \ldots]$, with the addition of each vector subject to the same condition above.

If `Eigenspaces := true`, then return the subsequence of the eigenspaces where all the eigenspaces have dimension $d\leq10$. If there are no such eigenspaces, all the eigenspaces are returned.

<a id="procedure-assertattribute-grpmat-monstgelt-tup-base"></a>
##### `AssertAttribute(G, "Base", B): GrpMat, MonStgElt, Tup`

Set the base of the matrix group $G$ to be $[B[1], \ldots, B[n]]$ where the tuple $B$ has $n$ components. An error will be reported if the matrix group $G$ already has a base set.

<a id="function-hasattribute-grpmat-monstgelt-base"></a>
##### `HasAttribute(G, "Base"): GrpMat, MonStgElt -> BoolElt, Tup`

Return whether the matrix group $G$ has a base set, and if so, the base.

<a id="procedure-assertattribute-cat-monstgelt-rngintelt-firstbasicorbitbound"></a>
##### `AssertAttribute(GrpMat, "FirstBasicOrbitBound", n): Cat, MonStgElt, RngIntElt`

Set the limit for the size of the first basic orbit to be $n$. If $n$ is non-zero and the orbit of the first base point (a 1-dimensional subspace generated by a standard basis vector) has length exceeding $n$, then the Murray-O’Brien base point selection procedure is used to find a point more likely to have a short orbit. This assertion will affect all matrix groups. If $n = 1$ then use of the Murray-O’Brien procedure is guaranteed.

<a id="function-hasattribute-cat-monstgelt-firstbasicorbitbound"></a>
##### `HasAttribute(GrpMat, "FirstBasicOrbitBound"): Cat, MonStgElt -> BoolElt, RngIntElt`

Get the limit for the size of the first basic orbit. This will always return `true` and the limit.

#### Construction of a Base and Strong Generating Set

The functions described below give user control of the construction of a base and strong generating set (BSGS) of a finite matrix group.

Many functions described in this chapter require a group to have a BSGS. In case the given group does not have a BSGS, then one will be constructed using the default algorithm, which is equivalent to using the `BSGS` procedure described below.

It should be noted that if the user constructs a BSGS for a group $G$ using the `RandomSchreier` procedure, then other functions that require a BSGS will assume that the random BSGS is a complete BSGS. If this is not the case then results will be unpredictable.

<a id="procedure-bsgs-grpmat"></a>
##### `BSGS(G): GrpMat`

<a id="procedure-bsgs-grpmat-monstgelt"></a>
##### `BSGS(G, str): GrpMat, MonStgElt`

The general procedure for constructing a base and strong generating set for the matrix group $G$. This version uses the default algorithm choices. Currently this is as follows: if the order of the group is known to the program then a BSGS is constructed using the random Schreier algorithm, if not then the Sims-Todd-Coxeter-Schreier procedure is used. If `str` is the name of a sporadic group, we assume that $G$ is a representation for this group and choose base points specific to this group. This should ensure better performance. Information on the progress of these algorithms may be obtained by setting the verbose flags `RandomSchreier` and `STCS` `true`.

<a id="procedure-randomschreier-grpmat"></a>
##### `RandomSchreier(G: parameters): GrpMat`

<a id="procedure-randomschreier-grpmat-monstgelt"></a>
##### `RandomSchreier(G, str : parameters): GrpMat, MonStgElt`

```magma
Run: RngIntElt                    Default: 40
```

Construct a probable base and strong generating set for the group $G$. The strong generators are constructed from a set of randomly chosen elements of $G$. The expectation is that if sufficiently many random elements are taken then, upon termination, the algorithm will have produced a BSGS for $G$. If the attribute Order is defined for G, the random Schreier will continue until a BSGS defining a group of the indicated order is obtained (except when the `Run` parameter is set - see below). In such circumstances this method is the fastest method of constructing a base and strong generating set for $G$. This is particularly so for groups of large degree. If nothing is known about $G$, the random Schreier algorithm provides a cheap way of obtaining lower bounds on the group’s order. This procedure has one associated parameter `Run`, which takes a positive integer value. If the value of `Run` is $n$, then the algorithm terminates after $n$ consecutive random elements are found to lie in the set defined by the current BSGS (default 40). This will happen even if the Order attribute is defined for $G$. It should be emphasized that unpredictable results may arise if the user uses the base and strong generators produced by this algorithm, when, in fact, it does not constitute a complete BSGS for $G$. The `Verify` procedure, described below, may be used to check the completeness of the BSGS constructed by this function.

If `str` is the name of a sporadic group, we assume that $G$ is a representation for this group and choose base points specific to this group. This should ensure better performance.

Information on the progress of this algorithm may be obtained by setting the verbose flag `RandomSchreier` to `true`.

<a id="function-randomschreierbounded-grpmat-rngintelt"></a>
##### `RandomSchreierBounded(G, L: parameters): GrpMat, RngIntElt -> BoolElt`

Causes a `RandomSchreier` to be attempted on $G$, with basic orbit lengths limited to at most $L$. If this limit is exceeded (for any one orbit) then the attempt is abandoned and `false` is returned. If `true` is returned then the result is the same as `RandomSchreier` applied to $G$.

<a id="procedure-toddcoxeterschreier-grpmat"></a>
##### `ToddCoxeterSchreier(G): GrpMat`

Construct a BSGS for the matrix group $G$ using the Sims-Todd-Coxeter-Schreier algorithm. Information on the progress of this algorithm may be obtained by setting the verbose flag `STCS` to `true`.

<a id="procedure-verify-grpmat"></a>
##### `Verify(G): GrpMat`

Given a matrix group $G$ for which a possible BSGS is stored, verify the correctness of the BSGS. If it is not complete, proceed to complete it. The Sims-Todd-Coxeter-Schreier method is used.

If $G$ has no BSGS stored, then use of `Verify` is equivalent to using the `BSGS` procedure described above.

Information on the progress of these algorithms may be obtained by setting the verbose flags `RandomSchreier` and `STCS` `true`.

#### Defining Values for Attributes

<a id="procedure-assertattribute-grpmat-monstgelt-rngintelt-order"></a>
##### `AssertAttribute(G, "Order", n): GrpMat, MonStgElt, RngIntElt`

<a id="procedure-assertattribute-grpmat-monstgelt-tup-rngintelt-rngintelt-order"></a>
##### `AssertAttribute(G, "Order", Q): GrpMat, MonStgElt, [Tup(RngIntElt, RngIntElt)]`

Define the order of the matrix group $G$ to be the integer $n$ (factored integer $Q$).

<a id="procedure-assertattribute-grpmat-monstgelt-boolelt-isverified"></a>
##### `AssertAttribute(G, "IsVerified", b): GrpMat, MonStgElt, BoolElt`

If the boolean variable $b$ is `true`, the existing pseudo strong generators for the matrix group $G$ (possibly created by `RandomSchreier`) are to be taken as correct.

<a id="function-hasattribute-grpmat-monstgelt-order"></a>
##### `HasAttribute(G, "Order"): GrpMat, MonStgElt -> RngIntElt`

<a id="function-hasattribute-grpmat-monstgelt-factoredorder"></a>
##### `HasAttribute(G, "FactoredOrder"): GrpMat, MonStgElt -> [Tup(RngIntElt, RngIntElt)]`

Returns `true` iff the order of the group $G$ is known. In that case, the order is also returned as the second value of the function.

<a id="function-hasattribute-grpmat-monstgelt-isverified"></a>
##### `HasAttribute(G, "IsVerified"): GrpMat, MonStgElt -> BoolElt`

Returns `true` iff the matrix group $G$ has a verified set of strong generators.

#### Accessing the Base and Strong Generating Set

<a id="function-base-grpmat"></a>
##### `Base(G): GrpMat -> [Elt]`

A base for the matrix group $G$. The base is returned as a sequence of points of $\Omega$. If a base is not known, one will be constructed.

<a id="function-basepoint-grpmat-rngintelt"></a>
##### `BasePoint(G, i): GrpMat, RngIntElt -> Elt`

The $i$-th base point for the matrix group $G$. A base and strong generating set must be known for $G$.

<a id="function-basicorbit-grpmat-rngintelt"></a>
##### `BasicOrbit(G, i): GrpMat, RngIntElt -> SetIndx`

The basic orbit at level $i$ as defined by the current base for the matrix group $G$. This function assumes that a BSGS is known for $G$.

<a id="function-basicorbitlength-grpmat-rngintelt"></a>
##### `BasicOrbitLength(G, i): GrpMat, RngIntElt -> RngIntElt`

The length of the basic orbit at level $i$ as defined by the current base for the matrix group $G$. This function assumes that a BSGS is known for $G$.

<a id="function-basicorbitlengths-grpmat"></a>
##### `BasicOrbitLengths(G): GrpMat -> [RngIntElt]`

The lengths of the basic orbits as defined by the current base for the matrix group $G$. This function assumes that a BSGS is known for $G$. The lengths are returned as a sequence of integers.

<a id="function-basicstabilizer-grpmat-rngintelt"></a>
##### `BasicStabilizer(G, i): GrpMat, RngIntElt -> GrpMat`

<a id="function-basicstabiliser-grpmat-rngintelt"></a>
##### `BasicStabiliser(G, i): GrpMat, RngIntElt -> GrpMat`

Given a matrix group $G$ for which a base and strong generating set are known, and an integer $i$, where $1 \leq i \leq k$ with $k$ the length of the base, return the subgroup of $G$ which fixes the first $i-1$ points of the base.

<a id="function-basicstabilizerchain-grpmat"></a>
##### `BasicStabilizerChain(G): GrpMat -> [GrpMat]`

<a id="function-basicstabiliserchain-grpmat"></a>
##### `BasicStabiliserChain(G): GrpMat -> [GrpMat]`

Given a matrix group $G$, return the stabilizer chain defined by the base as a sequence of subgroups of $G$. If a BSGS is not already known for $G$, it will be created.

<a id="function-numberofstronggenerators-grpmat"></a>
##### `NumberOfStrongGenerators(G): GrpMat -> RngIntElt`

<a id="function-nsgens-grpmat"></a>
##### `Nsgens(G): GrpMat -> RngIntElt`

The number of elements in the current strong generating set for the matrix group $G$.

<a id="function-stronggenerators-grpmat"></a>
##### `StrongGenerators(G): GrpMat -> SetIndx(GrpMat)`

A set of strong generators for the matrix group $G$. If they are not currently available, they will be computed.

### Soluble Matrix Groups

The functions described in this section apply only to finite groups for which a base and strong generating set may be constructed.

#### Conversion to a PC-Group

<a id="function-polycyclicgenerators-grpmat"></a>
##### `PolycyclicGenerators(G): GrpMat -> [ GrpPCElt ]`

Construct a polycyclic generating sequence for the soluble group $G$.

<a id="function-pcgroup-grpmat-2"></a>
##### `PCGroup(G): GrpMat -> GrpPC, Map`

Given a soluble group $G$, construct a group $S$ in category [`GrpPC`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/index-finite-soluble-groups.md#chapgrppc), isomorphic to $G$. In addition to returning $S$, the function returns an isomorphism $\phi: G \ar S$.

#### Soluble Group Functions

<a id="function-pcentralseries-grpmat-rngintelt"></a>
##### `pCentralSeries(G, p): GrpMat, RngIntElt -> [ GrpMat ]`

Given a soluble group $G$, and a prime $p$ dividing $|G|$, return the lower $p$-central series for $G$. The series is returned as a sequence of subgroups.

#### $p$-group Functions

<a id="function-isspecial-grpmat"></a>
##### `IsSpecial(G): GrpMat -> BoolElt`

Given a $p$-group $G$, return `true` if $G$ is special, `false` otherwise.

<a id="function-isextraspecial-grpmat"></a>
##### `IsExtraSpecial(G): GrpMat -> BoolElt`

Given a $p$-group $G$, return `true` if $G$ is extraspecial, `false` otherwise.

<a id="function-frattinisubgroup-grpmat"></a>
##### `FrattiniSubgroup(G): GrpMat -> GrpMat`

Given a $p$-group $G$, return the Frattini subgroup.

<a id="function-jenningsseries-grpmat"></a>
##### `JenningsSeries(G): GrpMat -> [ GrpMat ]`

Given a $p$-group $G$, return the Jennings series for $G$. The series is returned as a sequence of subgroups.

#### Abelian Group Functions

<a id="function-primaryabelianinvariants-grpmat"></a>
##### `PrimaryAbelianInvariants(G): GrpMat -> [ RngIntElt ]`

<a id="function-abelianinvariants-grpmat"></a>
##### `AbelianInvariants(G): GrpMat -> [ RngIntElt ]`

Given an abelian group $G$, return a sequence $Q$ containing the types of each $p$-primary component of $G$. The non-primary form gives the Smith form invariants, i.e. each element of the sequence divides the next.

<a id="function-primaryabelianbasis-grpmat"></a>
##### `PrimaryAbelianBasis(G): GrpMat -> [ GrpMatElt ], [ RngIntElt ]`

<a id="function-abelianbasis-grpmat"></a>
##### `AbelianBasis(G): GrpMat -> [ GrpMatElt ], [ RngIntElt ]`

Given an abelian group $G$, return sequences $B$ and $I$, where $I$ are $p$-primary invariants for $G$, and $B$ are generators for $G$ having the orders in $I$. The non-primary form uses the Smith form invariants, i.e. each element of the sequence divides the next.

<a id="matrix-ff"></a>
<a id="chapgrpmatff"></a>
## Matrix Groups over Finite Fields

- [Introduction](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/introduction.md)
- [Finding Elements with Prescribed Properties](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/element-order.md)
  - [`RandomElementOfOrder(G, n : parameters): GrpMat, RngIntElt → BoolElt, GrpMatElt, GrpSLPElt, BoolElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/element-order.md#function-randomelementoforder-grpmat-rngintelt)
  - [`RandomElementOfNormalClosure(G, N): Grp → GrpElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/element-order.md#function-randomelementofnormalclosure-grp)
  - [`InvolutionClassicalGroupEven(G : parameters): GrpMat[FldFin] → GrpMatElt[FldFin], GrpSLPElt, RngIntElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/element-order.md#function-involutionclassicalgroupeven-grpmat-fldfin)
- [Monte Carlo Algorithms for Subgroups](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/monte-carlo.md)
  - [`CentraliserOfInvolution(G, g : parameters): GrpMat, GrpMatElt → GrpMat`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/monte-carlo.md#function-centraliserofinvolution-grpmat-grpmatelt)
  - [`CentraliserOfInvolution(G, g, w : parameters): GrpMat, GrpMatElt, GrpSLPElt → GrpMat, []`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/monte-carlo.md#function-centraliserofinvolution-grpmat-grpmatelt-grpslpelt)
  - [`AreInvolutionsConjugate(G, x, wx, y, wy : parameters): GrpMat, GrpMatElt, GrpSLPElt, GrpMatElt, GrpSLPElt → BoolElt, GrpMatElt, GrpSLPElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/monte-carlo.md#function-areinvolutionsconjugate-grpmat-grpmatelt-grpslpelt-grpmatelt-grpslpelt)
  - [`NormalClosureMonteCarlo(G, H ): GrpMat, GrpMat → GrpMat`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/monte-carlo.md#function-normalclosuremontecarlo-grpmat-grpmat)
  - [`NormalClosureMonteCarlo(G, H : parameters): GrpPerm, GrpPerm → GrpMat`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/monte-carlo.md#function-normalclosuremontecarlo-grpperm-grpperm)
  - [`DerivedGroupMonteCarlo(G : parameters): GrpMat → GrpMat`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/monte-carlo.md#function-derivedgroupmontecarlo-grpmat)
  - [`IsProbablyPerfect(G : parameters): Grp → BoolElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/monte-carlo.md#function-isprobablyperfect-grp)
  - [Example: Testing a Subgroup for Perfection](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/monte-carlo.md#example-ex-00c3d9)
- [Aschbacher Reduction](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/aschbacher-reduction.md)
  - [Introduction](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/aschbacher-reduction.md#introduction)
  - [Primitivity](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/aschbacher-reduction.md#primitivity)
    - [`IsPrimitive(G: parameters): GrpMat → BoolElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/aschbacher-reduction.md#function-isprimitive-grpmat)
    - [`ImprimitiveBasis(G): GrpMat → SeqEnum`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/aschbacher-reduction.md#function-imprimitivebasis-grpmat)
    - [`Blocks(G): GrpMat → SeqEnum`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/aschbacher-reduction.md#function-blocks-grpmat)
    - [`BlocksImage(G): GrpMat → GrpPerm`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/aschbacher-reduction.md#function-blocksimage-grpmat)
    - [`ImprimitiveAction(G, g): GrpMat, GrpMatElt → GrpPermElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/aschbacher-reduction.md#function-imprimitiveaction-grpmat-grpmatelt)
    - [Example: Testing for Primitivity](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/aschbacher-reduction.md#example-ex-cc4edb)
  - [Semilinearity](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/aschbacher-reduction.md#semilinearity)
    - [`IsSemiLinear(G): GrpMat → BoolElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/aschbacher-reduction.md#function-issemilinear-grpmat)
    - [`DegreeOfFieldExtension(G): GrpMat → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/aschbacher-reduction.md#function-degreeoffieldextension-grpmat)
    - [`CentralisingMatrix(G): GrpMat → AlgMatElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/aschbacher-reduction.md#function-centralisingmatrix-grpmat)
    - [`FrobeniusAutomorphisms(G): GrpMat → SeqEnum`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/aschbacher-reduction.md#function-frobeniusautomorphisms-grpmat)
    - [`WriteOverLargerField(G): GrpMat → GrpMat, GrpAb, SeqEnum`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/aschbacher-reduction.md#function-writeoverlargerfield-grpmat)
    - [Example: Analysing a Semilinear Group](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/aschbacher-reduction.md#example-ex-0459a8)
  - [Tensor Products](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/aschbacher-reduction.md#tensor-products)
    - [`IsTensor(G: parameters): GrpMat → BoolElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/aschbacher-reduction.md#function-istensor-grpmat)
    - [`TensorBasis(G): GrpMat → GrpMatElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/aschbacher-reduction.md#function-tensorbasis-grpmat)
    - [`TensorFactors(G): GrpMat → GrpMat, GrpMat`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/aschbacher-reduction.md#function-tensorfactors-grpmat)
    - [`IsProportional(X, k): Mtrx, RngIntElt → BoolElt, Tup`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/aschbacher-reduction.md#function-isproportional-mtrx-rngintelt)
    - [Example: Tensor Decomposition of a Matrix Group](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/aschbacher-reduction.md#example-ex-8c10fc)
  - [Tensor-induced Groups](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/aschbacher-reduction.md#tensor-induced-groups)
    - [`IsTensorInduced(G : parameters): GrpMat → BoolElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/aschbacher-reduction.md#function-istensorinduced-grpmat)
    - [`TensorInducedBasis(G): GrpMat → GrpMatElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/aschbacher-reduction.md#function-tensorinducedbasis-grpmat)
    - [`TensorInducedPermutations(G): GrpMat → SeqEnum`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/aschbacher-reduction.md#function-tensorinducedpermutations-grpmat)
    - [`TensorInducedAction(G, g): GrpMat, GrpMatElt → GrpPermElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/aschbacher-reduction.md#function-tensorinducedaction-grpmat-grpmatelt)
    - [Example: Tensor-Induced Groups](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/aschbacher-reduction.md#example-ex-1ef8b8)
  - [Normalisers of Extraspecial $r$-groups and Symplectic 2-groups](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/aschbacher-reduction.md#normalisers-of-extraspecial-r-groups-and-symplectic-2-groups)
    - [`IsExtraSpecialNormaliser(G): GrpMat → BoolElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/aschbacher-reduction.md#function-isextraspecialnormaliser-grpmat)
    - [`ExtraSpecialParameters(G): GrpMat → [RngIntElt, RngIntElt]`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/aschbacher-reduction.md#function-extraspecialparameters-grpmat)
    - [`ExtraSpecialGroup(G): GrpMat → GrpMat`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/aschbacher-reduction.md#function-extraspecialgroup-grpmat)
    - [`ExtraSpecialNormaliser(G): GrpMat → SeqEnum`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/aschbacher-reduction.md#function-extraspecialnormaliser-grpmat)
    - [`ExtraSpecialAction(G, g): GrpMat, GrpMatElt → GrpMatElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/aschbacher-reduction.md#function-extraspecialaction-grpmat-grpmatelt)
    - [`ExtraSpecialBasis(G): GrpMat → GrpMatElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/aschbacher-reduction.md#function-extraspecialbasis-grpmat)
    - [Example: Normaliser of an Extraspecial Group](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/aschbacher-reduction.md#example-ex-2adbb0)
  - [Writing Representations over Subfields](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/aschbacher-reduction.md#writing-representations-over-subfields)
    - [`IsOverSmallerField(G : parameters): GrpMat → BoolElt, GrpMat`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/aschbacher-reduction.md#function-isoversmallerfield-grpmat)
    - [`IsOverSmallerField(G, k : parameters): GrpMat → BoolElt, GrpMat`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/aschbacher-reduction.md#function-isoversmallerfield-grpmat-2)
    - [`SmallerField(G): GrpMat → FLdFin`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/aschbacher-reduction.md#function-smallerfield-grpmat)
    - [`SmallerFieldBasis(G): GrpMat → GrpMatElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/aschbacher-reduction.md#function-smallerfieldbasis-grpmat)
    - [`SmallerFieldImage(G, g): GrpMat, GrpMatElt → GrpMatElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/aschbacher-reduction.md#function-smallerfieldimage-grpmat-grpmatelt)
    - [Example: Detecting a Smaller Field of Definition](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/aschbacher-reduction.md#example-ex-3b0781)
    - [`WriteOverSmallerField(G, F): GrpMat, FldFin → GrpMat, Map`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/aschbacher-reduction.md#function-writeoversmallerfield-grpmat-fldfin)
    - [Example: Rewriting over a Smaller Field](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/aschbacher-reduction.md#example-ex-c2e1e0)
  - [Decompositions with Respect to a Normal Subgroup](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/aschbacher-reduction.md#decompositions-with-respect-to-a-normal-subgroup)
    - [`SearchForDecomposition(G, S): GrpMat, [GrpMatElt] → BoolElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/aschbacher-reduction.md#function-searchfordecomposition-grpmat-grpmatelt)
    - [Accessing the Decomposition Information](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/aschbacher-reduction.md#accessing-the-decomposition-information)
      - [Example: Searching for a Decomposition](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/aschbacher-reduction.md#example-ex-14d37b)
- [Constructive Recognition for Simple Groups](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/natural-copy-classical.md)
  - [Constructive Recognition for Classical Groups](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/natural-copy-classical.md#constructive-recognition-for-classical-groups)
    - [`ClassicalStandardGenerators(type, d, q): MonStgElt, RngIntElt, RngIntElt → []`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/natural-copy-classical.md#function-classicalstandardgenerators-monstgelt-rngintelt-rngintelt)
    - [`ClassicalConstructiveRecognition(G, type, d, q): GrpMat[FldFin], MonStgElt, RngIntElt, RngIntElt → BoolElt, Map, Map, Map, Map, SeqEnum, SeqEnum`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/natural-copy-classical.md#function-classicalconstructiverecognition-grpmat-fldfin-monstgelt-rngintelt-rngintelt)
    - [`ClassicalConstructiveRecognition(G): GrpMat[FldFin] → BoolElt, SeqEnum, SeqEnum`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/natural-copy-classical.md#function-classicalconstructiverecognition-grpmat-fldfin)
    - [Example: Constructive Recognition of Sp(6, 125)](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/natural-copy-classical.md#example-ex-0be2ca)
    - [`ClassicalChangeOfBasis(G): GrpMat[FldFin] → GrpMatElt[FldFin]`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/natural-copy-classical.md#function-classicalchangeofbasis-grpmat-fldfin)
    - [`ClassicalRewrite(G, gens, type, dim, q, g : parameters): Grp, SeqEnum, MonStgElt, RngIntElt, RngIntElt, GrpElt → BoolElt, GrpElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/natural-copy-classical.md#function-classicalrewrite-grp-seqenum-monstgelt-rngintelt-rngintelt-grpelt)
    - [`ClassicalRewriteNatural(type, CB, g): MonStgElt, GrpMatElt, GrpMatElt → BoolElt, GrpElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/natural-copy-classical.md#function-classicalrewritenatural-monstgelt-grpmatelt-grpmatelt)
    - [`ClassicalRewriteNatural(G, type, CB, g): MonStgElt, GrpMatElt, GrpMatElt → BoolElt, GrpElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/natural-copy-classical.md#function-classicalrewritenatural-monstgelt-grpmatelt-grpmatelt-2)
    - [`ClassicalStandardPresentation(type, d, q : parameters): MonStgElt, RngIntElt, RngIntElt → SLPGroup, []`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/natural-copy-classical.md#function-classicalstandardpresentation-monstgelt-rngintelt-rngintelt)
    - [Example: Standard Generators for SL(6, 125)](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/natural-copy-classical.md#example-ex-7ccc3b)
  - [Constructive Recognition for Exceptional Groups](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/natural-copy-classical.md#constructive-recognition-for-exceptional-groups)
    - [`ExceptionalStandardGenerators(type, rank, q): MonStgElt, RngIntElt, RngIntElt → []`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/natural-copy-classical.md#function-exceptionalstandardgenerators-monstgelt-rngintelt-rngintelt)
    - [`ExceptionalConstructiveRecognition(G, type, rank, q): GrpMat[FldFin], MonStgElt, RngIntElt, RngIntElt → BoolElt, Map, Map, Map, Map, SeqEnum, SeqEnum`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/natural-copy-classical.md#function-exceptionalconstructiverecognition-grpmat-fldfin-monstgelt-rngintelt-rngintelt)
    - [Example: Constructive Recognition of an Exceptional Group](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/natural-copy-classical.md#example-ex-111a3c)
    - [`ExceptionalRewrite(type, rank, q, X, Xm, g): MonStgElt, RngIntElt, RngIntElt, SeqEnum, SeqEnum, GrpElt → BoolElt, GrpElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/natural-copy-classical.md#function-exceptionalrewrite-monstgelt-rngintelt-rngintelt-seqenum-seqenum-grpelt)
    - [`ExceptionalStandardPresentation(type, rank, q): MonStgElt, RngIntElt, RngIntElt → SLPGroup, []`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/natural-copy-classical.md#function-exceptionalstandardpresentation-monstgelt-rngintelt-rngintelt)
    - [Example: Standard Presentation of G2](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/natural-copy-classical.md#example-ex-b84999)
- [Composition Trees for Matrix Groups](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/composition-tree.md)
  - [The Composition Tree Algorithm](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/composition-tree.md#the-composition-tree-algorithm)
  - [Constructing the Composition Tree](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/composition-tree.md#constructing-the-composition-tree)
    - [`CompositionTree(G): GrpMat[FldFin] → []`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/composition-tree.md#function-compositiontree-grpmat-fldfin)
    - [Example: Composition Tree for J4](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/composition-tree.md#example-ex-009621)
    - [`CompositionTree(G : parameters): GrpMat[FldFin] → []`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/composition-tree.md#function-compositiontree-grpmat-fldfin-2)
    - [`CompositionTreeFastVerification(G): Grp → BoolElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/composition-tree.md#function-compositiontreefastverification-grp)
    - [`CompositionTreeVerify(G): Grp → BoolElt, []`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/composition-tree.md#function-compositiontreeverify-grp)
    - [Example: Verifying a Composition Tree](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/composition-tree.md#example-ex-1c147a)
  - [Accessing the Composition Tree](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/composition-tree.md#accessing-the-composition-tree)
    - [`CompositionTreeOrder(G): Grp → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/composition-tree.md#function-compositiontreeorder-grp)
    - [`CompositionTreeNonAbelianFactors(G): Grp → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/composition-tree.md#function-compositiontreenonabelianfactors-grp)
    - [`DisplayCompTreeNodes(G : parameters): Grp`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/composition-tree.md#procedure-displaycomptreenodes-grp)
    - [Example: Subgroup Order and Membership in J4](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/composition-tree.md#example-ex-8acf9e)
    - [`CompositionTreeNiceGroup(G): Grp → GrpMat[FldFin]`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/composition-tree.md#function-compositiontreenicegroup-grp)
    - [`CompositionTreeSLPGroup(G): Grp → GrpSLP, Map`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/composition-tree.md#function-compositiontreeslpgroup-grp)
    - [`CompositionTreeNiceToUser(G): Grp → Map, []`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/composition-tree.md#function-compositiontreenicetouser-grp)
    - [`CompositionTreeOrder(G): Grp → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/composition-tree.md#function-compositiontreeorder-grp-2)
    - [`CompositionTreeFactoredOrder(G): Grp → RngIntEltFact`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/composition-tree.md#function-compositiontreefactoredorder-grp)
    - [`CompositionTreeElementToWord(G, g): Grp, GrpElt → BoolElt, GrpSLPElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/composition-tree.md#function-compositiontreeelementtoword-grp-grpelt)
    - [`CompositionTreeNonAbelianFactors(G): GrpMat[FldFin] → List`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/composition-tree.md#function-compositiontreenonabelianfactors-grpmat-fldfin)
    - [`CompositionTreeCBM(G): GrpMat[FldFin] → GrpMatElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/composition-tree.md#function-compositiontreecbm-grpmat-fldfin)
    - [`CompositionTreeReductionInfo(G, t): Grp, RngIntElt → MonStgElt, Grp, Grp`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/composition-tree.md#function-compositiontreereductioninfo-grp-rngintelt)
    - [`CompositionTreeSeries(G): Grp → SeqEnum, List, List, List, BoolElt, []`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/composition-tree.md#function-compositiontreeseries-grp)
    - [`CompositionTreeFactorNumber(G, g): Grp, GrpElt → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/composition-tree.md#function-compositiontreefactornumber-grp-grpelt)
    - [`HasCompositionTree(G): Grp → BoolElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/composition-tree.md#function-hascompositiontree-grp)
    - [`CleanCompositionTree(G): Grp`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/composition-tree.md#procedure-cleancompositiontree-grp)
    - [Example: Composition Tree of a Conformal Orthogonal Group](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/composition-tree.md#example-ex-0bfaff)
    - [Example: Composition Tree of a Maximal Subgroup](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/composition-tree.md#example-ex-b767f8)
- [The LMG functions](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/LMG.md)
  - [`SetLMGSchreierBound(n): RngIntElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/LMG.md#procedure-setlmgschreierbound-rngintelt)
  - [`LMGInitialize(G : parameters): GrpMat`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/LMG.md#procedure-lmginitialize-grpmat)
  - [`LMGInitialise(G : parameters): GrpMat`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/LMG.md#procedure-lmginitialise-grpmat)
  - [`LMGOrder(G): GrpMat[FldFin] → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/LMG.md#function-lmgorder-grpmat-fldfin)
  - [`LMGFactoredOrder(G): GrpMat[FldFin] → SeqEnum`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/LMG.md#function-lmgfactoredorder-grpmat-fldfin)
  - [`LMGIsIn(G, x): GrpMat, GrpMatElt → BoolElt, GrpSLPElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/LMG.md#function-lmgisin-grpmat-grpmatelt)
  - [`LMGIsSubgroup(G, H): GrpMat, GrpMat → BoolElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/LMG.md#function-lmgissubgroup-grpmat-grpmat)
  - [`LMGEqual(G, H): GrpMat, GrpMat → BoolElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/LMG.md#function-lmgequal-grpmat-grpmat)
  - [`LMGIndex(G, H): GrpMat, GrpMat → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/LMG.md#function-lmgindex-grpmat-grpmat)
  - [`LMGIsNormal(G, H): GrpMat, GrpMat → BoolElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/LMG.md#function-lmgisnormal-grpmat-grpmat)
  - [`LMGNormalClosure(G, H): GrpMat, GrpMat → GrpMat`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/LMG.md#function-lmgnormalclosure-grpmat-grpmat)
  - [`LMGDerivedGroup(G): GrpMat → GrpMat`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/LMG.md#function-lmgderivedgroup-grpmat)
  - [`LMGCommutatorSubgroup(G, H): GrpMat, GrpMat → GrpMat`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/LMG.md#function-lmgcommutatorsubgroup-grpmat-grpmat)
  - [`LMGIsSoluble(G): GrpMat → BoolElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/LMG.md#function-lmgissoluble-grpmat)
  - [`LMGIsSolvable(G): GrpMat → BoolElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/LMG.md#function-lmgissolvable-grpmat)
  - [`LMGIsNilpotent(G): GrpMat → BoolElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/LMG.md#function-lmgisnilpotent-grpmat)
  - [`LMGCompositionSeries(G): GrpMat[FldFin] → SeqEnum`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/LMG.md#function-lmgcompositionseries-grpmat-fldfin)
  - [`LMGCompositionFactors(G): GrpMat[FldFin] → SeqEnum`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/LMG.md#function-lmgcompositionfactors-grpmat-fldfin)
  - [`LMGChiefSeries(G): GrpMat[FldFin] → SeqEnum`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/LMG.md#function-lmgchiefseries-grpmat-fldfin)
  - [`LMGChiefFactors(G): GrpMat[FldFin] → SeqEnum`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/LMG.md#function-lmgchieffactors-grpmat-fldfin)
  - [`LMGUnipotentRadical(G): GrpMat → GrpMat, GrpPC, Map`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/LMG.md#function-lmgunipotentradical-grpmat)
  - [`LMGSolubleRadical(G): GrpMat → GrpMat, GrpPC, Map`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/LMG.md#function-lmgsolubleradical-grpmat)
  - [`LMGSolvableRadical(G): GrpMat → GrpMat, GrpPC, Map`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/LMG.md#function-lmgsolvableradical-grpmat)
  - [`LMGFittingSubgroup(G): GrpMat → GrpMat, GrpPC, Map`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/LMG.md#function-lmgfittingsubgroup-grpmat)
  - [`LMGCentre(G): GrpMat → GrpMat`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/LMG.md#function-lmgcentre-grpmat)
  - [`LMGCenter(G): GrpMat → GrpMat`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/LMG.md#function-lmgcenter-grpmat)
  - [`LMGSylow(G,p): GrpMat, RngIntElt → GrpMat`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/LMG.md#function-lmgsylow-grpmat-rngintelt)
  - [`LMGSocleStar(G): GrpMat → GrpMat`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/LMG.md#function-lmgsoclestar-grpmat)
  - [`LMGSocleStarFactors(G): GrpMat → SeqEnum, SeqEnum`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/LMG.md#function-lmgsoclestarfactors-grpmat)
  - [`LMGSocleStarAction(G): GrpMat → Map, GrpPerm, GrpMat`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/LMG.md#function-lmgsoclestaraction-grpmat)
  - [`LMGSocleStarActionKernel(G): GrpMat → GrpMat, GrpPC, Map`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/LMG.md#function-lmgsoclestaractionkernel-grpmat)
  - [`LMGSocleStarQuotient(G): GrpMat → GrpPerm, Map, GrpMat`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/LMG.md#function-lmgsoclestarquotient-grpmat)
  - [Example: LMG Functions on a Maximal Subgroup](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/LMG.md#example-ex-533478)
  - [`LMGRadicalQuotient(G): GrpMat → GrpPerm, Map, GrpMat`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/LMG.md#function-lmgradicalquotient-grpmat)
  - [`LMGCentraliser(G, g): GrpMat, GrpMatElt → GrpMat`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/LMG.md#function-lmgcentraliser-grpmat-grpmatelt)
  - [`LMGCentralizer(G, g): GrpMat, GrpMatElt → GrpMat`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/LMG.md#function-lmgcentralizer-grpmat-grpmatelt)
  - [`LMGIsConjugate(G, g, h): GrpMat, GrpMatElt, GrpMatElt → BoolElt, GrpMatElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/LMG.md#function-lmgisconjugate-grpmat-grpmatelt-grpmatelt)
  - [`LMGClasses(G): GrpMat → SeqEnum`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/LMG.md#function-lmgclasses-grpmat)
  - [`LMGConjugacyClasses(G): GrpMat → SeqEnum`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/LMG.md#function-lmgconjugacyclasses-grpmat)
  - [`LMGNormaliser(G, H): GrpMat, GrpMat → GrpMat`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/LMG.md#function-lmgnormaliser-grpmat-grpmat)
  - [`LMGNormalizer(G, H): GrpMat, GrpMat → GrpMat`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/LMG.md#function-lmgnormalizer-grpmat-grpmat)
  - [`LMGIsConjugate(G, H, K): GrpMat, GrpMat, GrpMat → BoolElt, GrpMatElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/LMG.md#function-lmgisconjugate-grpmat-grpmat-grpmat)
  - [`LMGMeet(G, H, K): GrpMat, GrpMat, GrpMat → GrpMat`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/LMG.md#function-lmgmeet-grpmat-grpmat-grpmat)
  - [`LMGMaximalSubgroups(G): GrpMat → SeqEnum`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/LMG.md#function-lmgmaximalsubgroups-grpmat)
  - [`LMGNormalSubgroups(G): GrpMat → SeqEnum`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/LMG.md#function-lmgnormalsubgroups-grpmat)
  - [`LMGLowIndexSubgroups(G,n): GrpMat, RngIntElt → SeqEnum`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/LMG.md#function-lmglowindexsubgroups-grpmat-rngintelt)
  - [`LMGCosetAction(G,H : parameters): GrpMat, GrpMat → Map, GrpPerm, GrpMat`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/LMG.md#function-lmgcosetaction-grpmat-grpmat)
  - [`LMGCosetImage(G,H): GrpMat, GrpMat → GrpPerm`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/LMG.md#function-lmgcosetimage-grpmat-grpmat)
  - [`LMGCosetActionInverseImage(G, f, i): GrpMat, Map, RngIntElt → GrpMatElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/LMG.md#function-lmgcosetactioninverseimage-grpmat-map-rngintelt)
  - [`LMGRightTransversal(G,H : parameters): GrpMat, GrpMat → SeqEnum`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/LMG.md#function-lmgrighttransversal-grpmat-grpmat)
  - [`LMGIsPrimitive(G): GrpMat → BoolElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/LMG.md#function-lmgisprimitive-grpmat)
  - [`LMGCharacterTable(G : parameters): GrpMat → SeqEnum`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/LMG.md#function-lmgcharactertable-grpmat)
  - [Example: Classes and Characters of the Dempwolff Group](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/LMG.md#example-ex-fa2be2)
- [Finding a Base](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/findbase.md)
  - [`LMGBase(G : parameters): GrpMat → Tup, SeqEnum, SeqEnum`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/findbase.md#function-lmgbase-grpmat)
  - [Example: Base of a Large Matrix Group](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/findbase.md#example-ex-c9a7be)
- [Unipotent Matrix Groups](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/UnipPC.md)
  - [`UnipotentMatrixGroup(G): GrpMat → GrpMatUnip`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/UnipPC.md#function-unipotentmatrixgroup-grpmat)
  - [`WordMap(G): GrpMatUnip → Map`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/UnipPC.md#function-wordmap-grpmatunip)
  - [Example: Word Map of a Unipotent Group](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/UnipPC.md#example-ex-30af78)
  - [`PCPresentation(G): GrpMatUnip → GrpPC, Map, Map`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/UnipPC.md#function-pcpresentation-grpmatunip)
  - [`Order(G): GrpMatUnip → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/UnipPC.md#function-order-grpmatunip)
  - [`# G: GrpMatUnip → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/UnipPC.md#operation-operation-grpmatunip-rngintelt)
  - [`FactoredOrder(G): GrpMatUnip → [ <RngIntElt, RngIntElt> ]`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/UnipPC.md#function-factoredorder-grpmatunip)
  - [`g in G: GrpMatElt, GrpMatUnip → BoolElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/UnipPC.md#operation-op-in-grpmatelt-grpmatunip)
  - [Example: Pc-Presentation of a Unipotent Group](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/UnipPC.md#example-ex-f568e8)
- [Bibliography](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/bibliography.md)

### Introduction

If a matrix group $G$ is defined over a finite field then, provided that the group is not too large, we can construct a BSGS-representation for $G$ and consequently apply the standard algorithms for group structure as described in Chapter [Matrix Groups over General Rings](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/index-matrix-groups-over-general-rings.md#chapgrpmat). However, there are many examples of groups having moderately small dimension where we cannot find a BSGS-representation.

In this chapter we describe techniques for computing with matrix groups that do not assume that a BSGS-representation is available. Thus, the techniques described here apply to matrix groups possibly having much larger order or much larger dimension than those that can be handled with the techniques of Chapter [Matrix Groups over General Rings](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/index-matrix-groups-over-general-rings.md#chapgrpmat).

The `CompositionTree` package introduced in Section [Composition Trees for Matrix Groups](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/composition-tree.md#sec-composition-tree), which includes the collection of LMG (large matrix group) functions described in Section [The LMG functions](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverFiniteFields/LMG.md#sec-lmg), provides a framework for such investigations. The package was prepared by Henrik Bäärnhielm, Derek Holt, C.R. Leedham-Green, and E.A. O’Brien, and includes code developed by Peter Brooksbank, Elliot Costi, Kenneth Clarkson, Heiko Dietrich, Alice Niemeyer, and Csaba Schneider.

For recent surveys of work in this area, we refer the reader to [[OBr06](https://docs.magma-maths.org/references.md#cite-obrien-survey), [OBr11](https://docs.magma-maths.org/references.md#cite-obrien10)].

The techniques described in this chapter fall roughly into two categories.

**(a)**
Functions based on Aschbacher’s theorem classifying maximal subgroups of the general linear group. The main thrust of this work is to devise a framework for computing arbitrary structural information for a matrix group without the use of a BSGS-representation.

**(b)**
Functions which employ Monte Carlo and Las Vegas algorithms to determine some property of the group.

### Finding Elements with Prescribed Properties

<a id="function-randomelementoforder-grpmat-rngintelt"></a>
#### `RandomElementOfOrder(G, n : parameters): GrpMat, RngIntElt -> BoolElt, GrpMatElt, GrpSLPElt, BoolElt`

```magma
Central   : BoolElt                        Default: false
Proof     : BoolElt                        Default: true
Randomiser: GrpRandProc                    Default: 
MaxTries  : RngIntElt                      Default: 100
```

Given a finite matrix group $G$, this intrinsic attempts to locate an element $x$ of order $n$ in $G$ by random search. If such an element is found, then the return values are the boolean value `true`, the element $x$, and an SLP for this element.

If `Central` is `true`, then an element is sought which has order $n$ modulo the centre of $G$. If `Proof` is `false`, then the element returned may have order a multiple of $n$. In either case, the final return value indicates whether the element returned is known to have the precise order. The parameter `MaxTries` specifies the maximum number of random elements that are chosen. The parameter `Randomiser` specifies the random process that is to be used to construct the element and the SLP returned for the element is in the word group associated with this process. The default value of `Randomiser` is the process `RandomProcessWithWords(G)`.

<a id="function-randomelementofnormalclosure-grp"></a>
#### `RandomElementOfNormalClosure(G, N): Grp -> GrpElt`

Given a group $G$ and a subgroup $N$ of $G$, this intrinsic returns a random element of the normal closure of $N$ in $G$. Note that $G$ may be a permutation or matrix group. The algorithm is due to Leedham-Green and O’Brien [[LGO02](https://docs.magma-maths.org/references.md#cite-crlg-eaob)].

<a id="function-involutionclassicalgroupeven-grpmat-fldfin"></a>
#### `InvolutionClassicalGroupEven(G : parameters): GrpMat[FldFin] -> GrpMatElt[FldFin], GrpSLPElt, RngIntElt`

```magma
SmallCorank: BoolElt                      Default: false
Case       : MonStgElt                    Default: "unknown"
```

Let $G$ be a quasisimple classical group in its natural representation and in even characteristic. If $G$ is of type $\Omega^+$ or $\Omega^-$ then it must have even degree at least $4$ and be defined over a field with at least $4$ elements. The corank of an involution $I$ is the rank of $I-$`Identity`$(G)$. This function returns an involution $I$ of corank in $[d/4, \ldots, d/2]$, the SLP for $I$ in `WordGroup`$(G)$, and the corank of the involution. The parameter `Case` should be one of `"SL"`, `"Sp"`, `"SU"`, `"Omega-"`, or `"Omega+"`. If `SmallCorank` is `true`, then accept involution of small corank. The algorithm used to construct the involution is described in [[DLLGO13](https://docs.magma-maths.org/references.md#cite-dlgo-even)]; it was implemented by Heiko Dietrich.

### Monte Carlo Algorithms for Subgroups

<a id="function-centraliserofinvolution-grpmat-grpmatelt"></a>
#### `CentraliserOfInvolution(G, g : parameters): GrpMat, GrpMatElt -> GrpMat`

```magma
Central        : BoolElt                        Default: false
NumberRandom   : RngIntElt                      Default: 100
CompletionCheck: UserProgram                    Default: 
```

Given an involution $g$ in $G$, this function returns the centraliser $C$ of $g$ in $G$ using an algorithm of John Bray [[Bra00](https://docs.magma-maths.org/references.md#cite-bray00)]. Since it is Monte Carlo, it may return only a subgroup of the centraliser. If `Central` is `true`, the projective centraliser of $g$ will be constructed: its elements commute with $g$ modulo the centre of $G$.

The optional argument `CompletionCheck` is a function which can be used to determine when we have constructed the centraliser. It takes the following arguments: the parent group $G$; the proposed centraliser $C$; the involution $g$. By default, the algorithm completes when 20 generators have been found for the centraliser or when `NumberRandom` elements have been considered.

<a id="function-centraliserofinvolution-grpmat-grpmatelt-grpslpelt"></a>
#### `CentraliserOfInvolution(G, g, w : parameters): GrpMat, GrpMatElt, GrpSLPElt -> GrpMat, []`

```magma
Randomiser     : GrpRandProc                    Default: 
Central        : BoolElt                        Default: false
NumberRandom   : RngIntElt                      Default: 100
CompletionCheck: UserProgram                    Default: 
```

Given an involution $g$ in a matrix group $G$ together with a SLP $w$ corresponding to $g$, this function returns the centraliser $C$ of $g$ in $G$ and SLPs for the generators of $C$. The algorithm used is due to John Bray [[Bra00](https://docs.magma-maths.org/references.md#cite-bray00)]. Since it is Monte Carlo, it may return a proper subgroup of the centraliser. If `Central` is `true`, the projective centraliser of $g$ is constructed: its elements commute with $g$ modulo the centre of $G$.

The parameter `Randomiser` specifies the random process that is to be used to construct the centraliser. By default `Randomiser` is the value returned by `RandomProcessWithWords (G)`. The SLP for $g$ must lie in the word group of this process. The optional argument `CompletionCheck` is a function which can be used to determine when we have constructed the centraliser. It takes four arguments: the parent group $G$; the proposed centraliser $C$; the involution $g$; and the list of the SLPs for the generators of $C$. By default, the algorithm completes when 20 generators have been found for the centraliser or when `NumberRandom` elements have been considered.

<a id="function-areinvolutionsconjugate-grpmat-grpmatelt-grpslpelt-grpmatelt-grpslpelt"></a>
#### `AreInvolutionsConjugate(G, x, wx, y, wy : parameters): GrpMat, GrpMatElt, GrpSLPElt, GrpMatElt, GrpSLPElt -> BoolElt, GrpMatElt, GrpSLPElt`

```magma
Randomiser: GrpRandProc                    Default: 
MaxTries  : RngIntElt                      Default: 100
```

This Monte Carlo algorithm attempts to construct an element $c$ of the group $G$ which conjugates the involution $x$ to the involution $y$. The corresponding SLPs for $x$ and $y$ are $wx$ and $wy$ respectively. If such an element $c$ is found, then three values are returned: `true`, $c$, and the SLP for $c$. Otherwise, the boolean value `false` is returned. At most `MaxTries` random elements are considered.

The parameter `Randomiser` specifies the random process to be used. By default `Randomiser` is the value returned by `RandomProcessWithWords (G)`. The SLPs for $x$ and $y$ must lie in the word group of this process and the SLP for $c$ will also lie in this word group.

<a id="function-normalclosuremontecarlo-grpmat-grpmat"></a>
#### `NormalClosureMonteCarlo(G, H): GrpMat, GrpMat -> GrpMat`

<a id="function-normalclosuremontecarlo-grpperm-grpperm"></a>
#### `NormalClosureMonteCarlo(G, H : parameters): GrpPerm, GrpPerm -> GrpMat`

```magma
slpsH              : []                           Default: []
ErrorProb          : FltRatElt                    Default: 9/10
SubgroupChainLength: RngIntElt                    Default: Degree(H)
```

This Monte Carlo algorithm constructs the normal closure $N$ of $H$ in $G$. If SLPs of the generators of $H$ in the generators of $G$ are supplied via the parameter `slpsH`, then the function also returns SLPs for the generators of $N$. The parameter `SubgroupChainLength` is used to specify an upper bound on the length of any subgroup chain in $H$. The probability that $N$ is a proper subgroup of the normal closure is bounded above by `ErrorProb`, assuming that `SubgroupChainLength` is correctly set.

<a id="function-derivedgroupmontecarlo-grpmat"></a>
#### `DerivedGroupMonteCarlo(G : parameters): GrpMat -> GrpMat`

```magma
Randomiser      : GrpRandProc                    Default: 
NumberGenerators: RngIntElt                      Default: 10
MaxGenerators   : RngIntElt                      Default: 100
```

Given a matrix group $G$ defined over a finite field, this intrinsic returns the derived group of $G$, and a list of SLPs of its generators in the generators of $G$. The SLPs are elements of the word group of the random process. The algorithm is Monte Carlo and may return a proper subgroup of the derived group. The parameter `Randomiser` specifies the random process to be used. By default `Randomiser` is the value returned by `RandomProcessWithWords (G)`. At least `NumberGenerators` and at most `MaxGenerators` will be constructed for the derived group.

<a id="function-isprobablyperfect-grp"></a>
#### `IsProbablyPerfect(G : parameters): Grp -> BoolElt`

```magma
NumberRandom: RngIntElt                    Default: 100
```

This intrinsic attempts to prove that a matrix or permutation group $G$ is perfect by establishing that its generators are in $G'$. Since it is Monte-Carlo, there is a small probability of error. If the function returns `true`, then $G$ is perfect; if it returns `false`, then $G$ might still be perfect. Each call considers `NumberRandom` random elements.

The algorithm is due to Leedham-Green and O’Brien [[LGO02](https://docs.magma-maths.org/references.md#cite-crlg-eaob)] and it uses `NormalSubgroupRandomElement`.

<a id="example-ex-00c3d9"></a>
#### `Example: Testing a Subgroup for Perfection (ex-00c3d9)`

We illustrate `IsProbablyPerfect` with a subgroup of $GU(4, 9)$.

```magma
> G := GU(4, 9);
> N := sub<G | (G.1, G.2)>;
```

The generators of $N$ have been chosen to be a normal generating set for the derived group of $G$.

```magma
> IsProbablyPerfect(N);
false
> x := NormalSubgroupRandomElement(G, N);
> x;
[$.1^68 $.1^34 $.1^26 $.1^55]
[$.1^23 $.1^78 $.1^16 $.1^72]
[$.1^42  $.1^2 $.1^24      2]
[$.1^11 $.1^66 $.1^13 $.1^29]
>  L := sub< G | N, x>;
> IsProbablyPerfect(L);
true
```

We now consider $SO(7, 5)$ and $\Omega(7, 5)$.

```magma
> G := SO(7, 5);
> IsProbablyPerfect(G);
false
> G := Omega(7, 5);
> IsProbablyPerfect(G);
true
```

### Aschbacher Reduction

#### Introduction

An on-going international research project seeks to develop algorithms to explore the structure of groups having either large order or large degree. The approach relies on the following theorem of Aschbacher [[Asc84](https://docs.magma-maths.org/references.md#cite-asch-maximal-subgps)]:

A matrix group $G$ acting on the finite dimensional $K[G]$-module $V$ over a finite field $K$ satisfies at least one of the following conditions (which we have simplified slightly for brevity):

**(i)**
$G$ acts reducibly on $V$;

**(ii)**
$G$ acts semilinearly over an extension field of $K$;

**(iii)**
$G$ acts imprimitively on $V$;

**(iv)**
$G$ preserves a nontrivial tensor-product decomposition of $V$;

**(v)**
$G$ has a normal subgroup $N$, acting absolutely irreducibly on $V$, which is an extraspecial $p$-group or 2-group of symplectic type;

**(vi)**
$G$ preserves a tensor-induced decomposition of $V$;

**(vii)**
$G$ acts (modulo scalars) linearly over a proper subfield of $K$;

**(viii)**
$G$ contains a classical group in its natural action over $K$;

**(ix)**
$G$ is almost simple modulo scalars.

The philosophy underpinning the research program is to attempt to decide that $G$ lies in at least one of the above categories, and to calculate the associated isomorphism or decomposition explicitly. Groups in Category (i) can be recognised easily by means of the Meataxe functions described in the chapter on $R$-modules. Groups which act irreducibly but not absolutely irreducibly on $V$ fall theoretically into Category (ii), and furthermore act linearly over an extension field of $K$. In fact, absolute irreducibility can be tested using the built-in Magma functions and, by redefining their field to be an extension field $L$ of $K$ and reducing, they can be rewritten as absolutely irreducible groups of smaller dimension, but over $L$ instead of $K$. We can therefore concentrate on absolutely irreducible matrix groups. The `CompositionTree` package currently includes functions which seek to decide membership in all categories.

#### Primitivity

Let $G$ be a subgroup of ${\operatorname{GL}}(d, q)$ and assume that $G$ acts irreducibly on the underlying vector space $V$. Then $G$ acts *imprimitively* on $V$ if there is a non-trivial direct sum decomposition

$$
V = V_1 \oplus V_2 \oplus \ldots \oplus V_r
$$

where $V_1,\ldots, V_r$ are permuted by $G$. In such a case, each block $V_i$ has the same dimension or size, and we have the *block system* $\{V_1, \ldots, V_r\}$. If no such system exists, then $G$ is *primitive*.

Theoretical details of the algorithm used may be found in Holt, Leedham-Green, O’Brien, and Rees [[HLGOR96b](https://docs.magma-maths.org/references.md#cite-matg-primitivity)].

`SetVerbose ("Smash", 1)` will provide information on the progress of the algorithm.

<a id="function-isprimitive-grpmat"></a>
##### `IsPrimitive(G: parameters): GrpMat -> BoolElt`

```magma
BlockSizes: [RngIntElt]                    Default: []
```

Given a matrix group $G$ defined over a finite field, this intrinsic returns `true` if $G$ is primitive, `false` if $G$ is not primitive, or `"unknown"` if no decision can be reached.

If `BlockSizes` is supplied, then the search is restricted to systems of imprimitivity whose block sizes are given in the sequence `BlockSizes` only. Otherwise all valid sizes will be considered.

<a id="function-imprimitivebasis-grpmat"></a>
##### `ImprimitiveBasis(G): GrpMat -> SeqEnum`

Given a matrix group $G$ defined over a finite field which is imprimitive, this intrinsic returns the change-of-basis matrix which exhibits the block structure for $G$.

<a id="function-blocks-grpmat"></a>
##### `Blocks(G): GrpMat -> SeqEnum`

Given a matrix group $G$ defined over a finite field which is imprimitive, this intrinsic returns the blocks of imprimitivity of $G$.

<a id="function-blocksimage-grpmat"></a>
##### `BlocksImage(G): GrpMat -> GrpPerm`

Given a matrix group $G$ defined over a finite field which is imprimitive, this intrinsic returns the group induced by the action of $G$ on the system of imprimitivity.

<a id="function-imprimitiveaction-grpmat-grpmatelt"></a>
##### `ImprimitiveAction(G, g): GrpMat, GrpMatElt -> GrpPermElt`

Given a matrix group $G$ defined over a finite field which is imprimitive and an element $g$ of $G$, this intrinsic returns action of $g$ on blocks of imprimitivity as a permutation.

<a id="example-ex-cc4edb"></a>
##### `Example: Testing for Primitivity (ex-cc4edb)`

We construct an imprimitive group by taking the wreath product of $GL(4, 7)$ with $S_3$.

```magma
> MG := GL (4, 7);
> PG := Sym (3);
> G := WreathProduct (MG, PG);
>
> IsPrimitive (G);
false
```

We investigate the block system for $G$.

```magma
> B := Blocks (G);
> B;
> #B;
3
> B[1];
Vector space of degree 12, dimension 4 over GF(7)
Generators:
(0 0 0 0 1 0 0 0 0 0 0 0)
(0 0 0 0 0 1 0 0 0 0 0 0)
(0 0 0 0 0 0 1 0 0 0 0 0)
(0 0 0 0 0 0 0 1 0 0 0 0)
Echelonized basis:
(0 0 0 0 1 0 0 0 0 0 0 0)
(0 0 0 0 0 1 0 0 0 0 0 0)
(0 0 0 0 0 0 1 0 0 0 0 0)
(0 0 0 0 0 0 0 1 0 0 0 0)
```

Now we obtain a permutation representation of $G$ in its action on the blocks.

```magma
> P := BlocksImage (G);
> P;
Permutation group P acting on a set of cardinality 3
    (1, 2, 3)
    (2, 3)
> g := G.4 * G.3;
> ImprimitiveAction (G, g);
(1, 2)
```

#### Semilinearity

Let $G$ be a subgroup of ${\operatorname{GL}}(d, q)$ and assume that $G$ acts absolutely irreducibly on the underlying vector space $V$. Assume that a normal subgroup $N$ of $G$ embeds in ${\operatorname{GL}}(d/e,q^e)$, for $e>1$, and a $d \times d$ matrix $C$ acts as multiplication by a scalar $\lambda$ (a field generator of ${\bf F}_{q^e}$) for that embedding. We say that $G$ acts as a *semilinear* group of automorphisms on the $d/e$-dimensional space if and only if, for each generator $g$ of $G$, there is an integer $i = i(g)$ such that $Cg = gC^{i}$, that is, $g$ corresponds to the field automorphism $\lambda \rightarrow \lambda^{i}$. If so, we have a map from $G$ to the (cyclic) group ${\rm Aut}(GF(q^e))$, and $C$ centralises the kernel of this map, which thus lies in ${\operatorname{GL}}(d,q^e)$.

Theoretical details of the algorithm used may be found in Holt, Leedham-Green, O’Brien, and Rees [[HLGOR96a](https://docs.magma-maths.org/references.md#cite-decomps-modules)].

`SetVerbose ("SemiLinear", 1)` will provide information on the progress of the algorithm.

<a id="function-issemilinear-grpmat"></a>
##### `IsSemiLinear(G): GrpMat -> BoolElt`

Given a matrix group $G$ defined over a finite field, this intrinsic returns `true` if $G$ is semilinear, `false` if $G$ is not semilinear, or `"unknown"` if no decision can be reached.

<a id="function-degreeoffieldextension-grpmat"></a>
##### `DegreeOfFieldExtension(G): GrpMat -> RngIntElt`

Let $G$ be a subgroup of $K = {\operatorname{GL}}(d, q)$. The intrinsic returns the degree $e$ of the extension field of $F_q$ over which $G$ is semilinear.

<a id="function-centralisingmatrix-grpmat"></a>
##### `CentralisingMatrix(G): GrpMat -> AlgMatElt`

Let $G$ be a semilinear subgroup of $K = {\operatorname{GL}}(d, q)$. The intrinsic returns the matrix $C$ which centralises the normal subgroup of $G$ which acts linearly over the extension field of $F_q$.

<a id="function-frobeniusautomorphisms-grpmat"></a>
##### `FrobeniusAutomorphisms(G): GrpMat -> SeqEnum`

Let $G$ be a semilinear subgroup of $K = {\operatorname{GL}}(d, q)$ and let $C$ be the corresponding centralising matrix. The intrinsic returns a sequence $S$ of positive integers, one for each generator $g_i$ of $G$. The element $S[i]$ is the least positive integer such that $g_i^{-1} C g_i = C^{S[i]}$.

<a id="function-writeoverlargerfield-grpmat"></a>
##### `WriteOverLargerField(G): GrpMat -> GrpMat, GrpAb, SeqEnum`

Let $G$ be a semilinear subgroup of ${\operatorname{GL}}(d, q)$ with extension degree $e$. This intrinsic returns:

**(i)**
The normal subgroup $N$ of the matrix group $G$ which is the kernel of the map from $G$ to $C_e$; this subgroup acts linearly over the extension field of $K$ and is precisely the centraliser of $C$ in $G$.

**(ii)**
A cyclic group $E$ of order $e$ which is isomorphic to $G/N$.

**(iii)**
A sequence of images of the generators of $G$ in $E$.

<a id="example-ex-0459a8"></a>
##### `Example: Analysing a Semilinear Group (ex-0459a8)`

We analyse a semilinear group.

```magma
> P := GL(6,3);
> g1 := P![0,1,0,0,0,0,-1,0,0,0,0,0,
>          0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,1];
> g2 := P![-1,0,0,0,1,0,0,-1,0,0,0,1,
>          -1,0,0,0,0,0,0,-1,0,0,0,0,0,0,-1,0,0,0,0,0,0,-1,0,0];
> g3 := P![1,0,0,0,0,0,0,-1,0,0,0,0,
>          0,0,1,0,0,0,0,0,0,-1,0,0,0,0,0,0,1,0,0,0,0,0,0,-1];
> G := sub <P | g1, g2, g3 >;
>
> IsSemiLinear (G);
true
> DegreeOfFieldExtension (G);
2
> CentralisingMatrix (G);
[2 2 0 0 0 0]
[1 2 0 0 0 0]
[0 0 2 2 0 0]
[0 0 1 2 0 0]
[0 0 0 0 2 2]
[0 0 0 0 1 2]
> FrobeniusAutomorphisms (G);
[ 1, 1, 3 ]
> K, E, phi := WriteOverLargerField (G);
```

The group $K$ is the kernel of the homomorphism from $G$ into $E$.

```magma
> K.1;
[0 1 0 0 0 0]
[2 0 0 0 0 0]
[0 0 1 0 0 0]
[0 0 0 1 0 0]
[0 0 0 0 1 0]
[0 0 0 0 0 1]
```

The return value $E$ is the cyclic group of order $e$ while `phi` gives the sequence of images of $G.i$ in $E$.

```magma
> E;
Abelian Group isomorphic to Z/2
Defined on 1 generator
Relations:
    2*E.1 = 0
>
> phi;
[ 0, 0, E.1 ]
```

#### Tensor Products

Let $G$ be a subgroup of ${\operatorname{GL}}(d, K)$, where $K = GF(q)$, and let $V$ be the natural $K[G]$-module. We say that $G$ preserves a tensor decomposition of $V$ as $U\otimes W$ if there is an isomorphism of $V$ onto $U\otimes W$ such that the induced image of $G$ in ${\operatorname{GL}}(U\otimes W)$ lies in ${\operatorname{GL}}(U) \circ {\operatorname{GL}}(W)$.

Theoretical details of the algorithm used may be found in Leedham-Green and O’Brien [[LGO97a](https://docs.magma-maths.org/references.md#cite-recog-tensor), [LGO97b](https://docs.magma-maths.org/references.md#cite-tp-pg)].

The verbose flag `SetVerbose ("Tensor", 1)` will provide information on the progress of the algorithm.

<a id="function-istensor-grpmat"></a>
##### `IsTensor(G: parameters): GrpMat -> BoolElt`

```magma
Factors: [SeqEnum]                    Default: []
```

Given a matrix group $G$ defined over a finite field, this intrinsic returns `true` if $G$ preserves a non-trivial tensor decomposition, `false` if $G$ is does not preserve a tensor decomposition, or `"unknown"` if no decision can be reached.

A sequence of valid dimensions for potential factors may be supplied using the parameter `Factors`. Then for each element $[u, w]$ of the sequence `Factors`, the algorithm will search for decompositions of $V$ as $U \otimes W$, where $U$ must have dimension $u$ and $W$ must have dimension $w$ only. If this parameter is not set, then all valid factorisations will be considered.

<a id="function-tensorbasis-grpmat"></a>
##### `TensorBasis(G): GrpMat -> GrpMatElt`

Given a matrix group $G$ defined over a finite field that admits a tensor decomposition, this intrinsic returns the change-of-basis matrix which exhibits the tensor decomposition of $G$.

<a id="function-tensorfactors-grpmat"></a>
##### `TensorFactors(G): GrpMat -> GrpMat, GrpMat`

Given a matrix group $G$ defined over a finite field that admits a tensor decomposition, this intrinsic returns two groups which are the tensor factors of $G$.

<a id="function-isproportional-mtrx-rngintelt"></a>
##### `IsProportional(X, k): Mtrx, RngIntElt -> BoolElt, Tup`

Given a matrix group $G$ defined over a finite field that admits a tensor decomposition, this intrinsic returns `true` if and only if the matrix $X$ is composed of $k \times k$ blocks which differ only by scalars. If this is indeed the case, the tensor decomposition of $X$ is also returned.

<a id="example-ex-8c10fc"></a>
##### `Example: Tensor Decomposition of a Matrix Group (ex-8c10fc)`

We define a subgroup of $GL(6, 3)$ which admits a non-trivial tensor decomposition.

```magma
> P := GL(6, 3);
>
> g := P![ 0, 1, 1, 2, 1, 0, 2, 2, 1, 2, 1, 1, 1, 0, 2, 1, 2, 2, 1, 2, 2,
>          2, 2, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 2, 2 ];
>
> h := P![ 1, 0, 2, 1, 1, 2, 0, 0, 2, 0, 0, 2, 2, 0, 1, 0, 2, 1, 2, 1, 2,
>          2, 1, 1, 0, 2, 0, 1, 0, 0, 0, 0, 0, 2, 1, 2 ];
>
> G := sub< P | g, h >;
> IsTensor(G);
true
> C := TensorBasis(G);
```

So $C$ is the change-of-basis matrix. If we conjugate $G.1$ by $C$, we obtain a visible Kronecker product.

```magma
> G.1^C;
[0 0 2 0 2 0]
[0 0 2 2 2 2]
[2 0 0 0 2 0]
[2 2 0 0 2 2]
[0 0 0 0 1 0]
[0 0 0 0 1 1]
>
```

We use the function `IsProportional` to verify that $G.1^C$ is a Kronecker product.

```magma
> IsProportional(G.1^C, 2);
true
<
 [2 0]
 [2 2],

 [0 1 1]
 [1 0 1]
 [0 0 2]
>
```

Finally, we display the tensor factors.

```magma
> A := TensorFactors(G);
> A[1];
MatrixGroup(2, GF(3))
Generators:
    [1 2]
    [2 2]

    [2 0]
    [2 2]
> A[2];
MatrixGroup(3, GF(3))
Generators:
    [0 1 0]
    [1 2 1]
    [1 2 0]

    [0 1 1]
    [1 0 1]
    [0 0 2]
```

#### Tensor-induced Groups

Let $G$ be a subgroup of ${\operatorname{GL}}(d, K)$, where $K = {\bf F}_{q}$ and $q = p^e$ for some prime $p$, and let $V$ be the natural $K[G]$-module. Assume that $d$ has a proper factorisation as $u^r$. We say that $G$ is tensor-induced if $G$ preserves a decomposition of $V$ as

$$
U_1 \otimes U_2 \otimes \cdots \otimes U_r
$$

where each $U_i$ has dimension $u > 1$, $r > 1$, and the set of $U_i$ is permuted by $G$. If $G$ is tensor-induced, then there is a homomorphism of $G$ into the symmetric group $S_r$.

Theoretical details of the algorithm used may be found in Leedham-Green and O’Brien [[LGO02](https://docs.magma-maths.org/references.md#cite-crlg-eaob)].

`SetVerbose ("TensorInduced", 1)` will provide information on the progress of the algorithm.

<a id="function-istensorinduced-grpmat"></a>
##### `IsTensorInduced(G : parameters): GrpMat -> BoolElt`

```magma
InducedDegree: RngIntElt                    Default: "All"
```

Given a matrix group $G$ defined over a finite field, return `true` if $G$ is tensor-induced, `false` if $G$ is not tensor-induced, and `"unknown"` if no decision can be reached.

If the value of the parameter `InducedDegree` is set to $r$, then the algorithm will search for homomorphisms into the symmetric group of degree $r$ only. Otherwise is will consider all valid degrees.

<a id="function-tensorinducedbasis-grpmat"></a>
##### `TensorInducedBasis(G): GrpMat -> GrpMatElt`

Given a matrix group $G$ defined over a finite field that is tensor-induced, this intrinsic returns the change-of-basis matrix which exhibits that $G$ is tensor-induced.

<a id="function-tensorinducedpermutations-grpmat"></a>
##### `TensorInducedPermutations(G): GrpMat -> SeqEnum`

Given a matrix group $G$ defined over a finite field that is tensor-induced, this intrinsic returns a sequence whose $i$-th entry is the homomorphic image of $G.i$ in $S_r$.

<a id="function-tensorinducedaction-grpmat-grpmatelt"></a>
##### `TensorInducedAction(G, g): GrpMat, GrpMatElt -> GrpPermElt`

Given a matrix group $G$ defined over a finite field that is tensor-induced, this intrinsic returns the tensor-induced action of the element $g \in G$.

<a id="example-ex-1ef8b8"></a>
##### `Example: Tensor-Induced Groups (ex-1ef8b8)`

We illustrate the use of the functions for determining if a matrix group is tensor-induced.

```magma
> G := GL(2, 3);
> S := Sym(3);
> G := TensorWreathProduct(G, S);
> IsTensorInduced(G);
true
```

We next recover the permutations.

```magma
> TensorInducedPermutations(G);
[
    Id(S),
    Id(S),
    (1, 2, 3),
    (1, 2)
]
```

Hence $G.1$ and $G.2$ are in the kernel of the homomorphism from $G$ to $S$. We extract the change-of-basis matrix $C$ and then conjugate $G.1$ by $C$, thereby obtaining a visible Kronecker product.

```magma
> C := TensorInducedBasis(G);
> x := G.1^C;
> x;
[2 0 0 0 0 0 0 0]
[0 2 0 0 0 0 0 0]
[0 0 2 0 0 0 0 0]
[0 0 0 2 0 0 0 0]
[1 0 0 0 1 0 0 0]
[0 1 0 0 0 1 0 0]
[0 0 1 0 0 0 1 0]
[0 0 0 1 0 0 0 1]
```

Finally, we verify that $x = G.1^C$ is a Kronecker product for each of $2$ and $4$.

```magma
> IsProportional(x, 2);
true
<[2 0]
[0 2], [1 0 0 0]
[0 1 0 0]
[2 0 2 0]
[0 2 0 2]>
> IsProportional(x, 4);
true
<[2 0 0 0]
[0 2 0 0]
[0 0 2 0]
[0 0 0 2], [1 0]
[2 2]>
```

#### Normalisers of Extraspecial $r$-groups and Symplectic 2-groups

Let $G \leq GL(d, q)$, where $d=r^m$ for some prime $r$. If $G$ is contained in the normaliser of an $r$-group $R$, of order either $r^{2m+1}$ or $2^{2m+2}$, then either $R$ is extraspecial (in the first case), or $R$ is a $2$-group of symplectic type (that is, a central product of an extraspecial $2$-group with the cyclic group of order $4$).

If $d = r$ is an odd prime, we use the Monte Carlo algorithm of Niemeyer [[Nie05](https://docs.magma-maths.org/references.md#cite-niemeyer-normalisers)] to decide whether or not $G$ normalises such a subgroup. Otherwise, the corresponding intrinsic `IsExtraSpecialNormaliser` searches for elements of the normal subgroup, and can only reach a negative conclusion in certain limited cases. If it cannot reach a conclusion it returns `"unknown"`.

<a id="function-isextraspecialnormaliser-grpmat"></a>
##### `IsExtraSpecialNormaliser(G): GrpMat -> BoolElt`

Given a matrix group $G$ defined over a finite field, the intrinsic returns `true` if $G$ normalises an extraspecial $r$-group or 2-group of symplectic type, `false` if $G$ is known not to normalise an extraspecial $r$-group or a 2-group of symplectic type, or `"unknown"` if it cannot reach a conclusion.

<a id="function-extraspecialparameters-grpmat"></a>
##### `ExtraSpecialParameters(G): GrpMat -> [RngIntElt, RngIntElt]`

Given a matrix group $G$ defined over a finite field that is known to normalise an extraspecial $r$-group or 2-group of symplectic type, this intrinsic returns a sequence of two integers, $r$ and $n$, where the extraspecial or symplectic subgroup $R$ normalised by $G$ has order $r^{n}$.

<a id="function-extraspecialgroup-grpmat"></a>
##### `ExtraSpecialGroup(G): GrpMat -> GrpMat`

Given a matrix group $G$ defined over a finite field that is known to normalise an extraspecial $r$-group or 2-group of symplectic type, this intrinsic returns the extraspecial or symplectic subgroup normalised by $G$.

<a id="function-extraspecialnormaliser-grpmat"></a>
##### `ExtraSpecialNormaliser(G): GrpMat -> SeqEnum`

Given a matrix group $G$ defined over a finite field that is known to normalise an extraspecial $r$-group or 2-group of symplectic type, this intrinsic returns the action of the generators of $G$ on its normal extraspecial or symplectic subgroup as a sequence of matrices, each of degree $2r$, one for each generator of $G$.

<a id="function-extraspecialaction-grpmat-grpmatelt"></a>
##### `ExtraSpecialAction(G, g): GrpMat, GrpMatElt -> GrpMatElt`

Given a matrix group $G$ defined over a finite field that is known to normalise an extraspecial $r$-group or 2-group of symplectic type, this intrinsic returns a matrix of degree $2r$ describing the action of element $g$ on the extraspecial or symplectic group normalised by $G$.

<a id="function-extraspecialbasis-grpmat"></a>
##### `ExtraSpecialBasis(G): GrpMat -> GrpMatElt`

Given a matrix group $G$ defined over a finite field, which is the odd prime degree case of $G$ normalising an extraspecial $r$-group or 2-group of symplectic type, this intrinsic returns the change-of-basis matrix which conjugates the normal extraspecial subgroup into a “nice” representation, generated by a diagonal and a permutation matrix.

<a id="example-ex-2adbb0"></a>
##### `Example: Normaliser of an Extraspecial Group (ex-2adbb0)`

For this example we construct a subgroup $G$ of ${\operatorname{GL}}(7, 8)$ that normalises an extraspecial $r$-group or $2$-group of symplectic type.

```magma
> F:=GF(8);
> P:=GL(7,F);
> w := PrimitiveElement(F);
> g1:=P![
> w,0,w^2,w^5,0,w^3,w,w,1,w^6,w^3,0,w^4,w,w^2,w^6,w^4,1,w^3,w^3,w^5,
> w^6,w,w^3,1,w^5,0,w^4,1,w^6,w^3,w^6,w^3,w^2,w^2,w^3,w^6,w^6,w^4,1,w^2,w^4,
> w^5,w^4,w^2,w^6,1,w^5,w ];
> g2:=P![w^3,w^4,w^2,w^6,w,w,w^3,w^3,w^4,w,w,w^2,w^3,w^3,w,w^3,w^5,w,1,w^3,w,
> 0,w^2,w^6,w,w^5,1,w,w^6,0,w^3,0,w^4,w,w^5,w^3,w^3,1,w^3,w^5,w^5,w^3,
> w^4,w^6,w,w^6,w^4,w^4,0 ];
> g3:=P![w^5,w^6,w^2,w,w,w^4,w^6,w^6,w^6,w,w^6,w,1,w^3,w,w^6,w^2,w,w^6,w^3,w^6,
> w^2,w^6,w^6,w^3,w,w^6,w^5,0,w^4,w^6,w^6,w,w^2,0,w,w^3,w^5,w^2,w^3,w^4,w^6,
> 0,w^3,w,w^3,w^4,w^3,1];
> gens := [g1,g2,g3];
> G := sub< P | gens >;
> IsExtraSpecialNormaliser(G);
true
```

So $G$ has the desired normaliser property.

```magma
> ExtraSpecialParameters (G);
[ 7, 3 ]
> N:=ExtraSpecialNormaliser(G);
> N;
[
    [3 4]
    [1 4],

    [4 3]
    [0 2],

    [1 0]
    [0 1]
]
```

#### Writing Representations over Subfields

The algorithm implemented by these functions is due to Glasby, Leedham-Green, and O’Brien [[GLGO05](https://docs.magma-maths.org/references.md#cite-glasby-lg-obrien)]. We also provide access to an earlier algorithm for the non-scalar case developed by Glasby and Howlett [[GH97](https://docs.magma-maths.org/references.md#cite-minimal-fields)].

<a id="function-isoversmallerfield-grpmat"></a>
##### `IsOverSmallerField(G : parameters): GrpMat -> BoolElt, GrpMat`

```magma
Scalars  : BoolElt                      Default: false
Algorithm: MonStgElt                    Default: "GLO"
```

Given an absolutely irreducible matrix group $G$ defined over a finite field $K$, this intrinsic decides whether or not $G$ has an equivalent representation over a subfield of $K$. If so, it returns `true` and the representation over the smallest possible subfield, otherwise it returns `false`. If the optional argument `Scalars` is `true` then decide whether or $G$ modulo scalars has an equivalent representation over a subfield of $K$. If the optional argument `Algorithm` is set to `"GH"`, then the non-scalar case uses the original Glasby and Howlett algorithm. The default is the Glasby, Leedham-Green, and O’Brien algorithm, specified by `"GLO"`.

<a id="function-isoversmallerfield-grpmat-2"></a>
##### `IsOverSmallerField(G, k : parameters): GrpMat -> BoolElt, GrpMat`

```magma
Scalars  : BoolElt                      Default: false
Algorithm: MonStgElt                    Default: "GLO"
```

Given an absolutely irreducible matrix group $G$ defined over a finite field $K$, and a positive integer $k$ which is a proper divisor of the degree of $K$, this intrinsic decides whether or not $G$ has an equivalent representation over a proper subfield of $K$ having degree $k$ over the prime field. If so, it returns `true` and the representation over this subfield, else it returns `false`. If the optional argument `Scalars` is `true` then it decides whether or not $G$ modulo scalars has an equivalent representation over a degree $k$ subfield of $K$. If the optional argument `Algorithm` is set to `"GH"`, then the non-scalar case uses the original Glasby and Howlett algorithm. The default is the Glasby, Leedham-Green, and O’Brien algorithm, specified by `"GLO"`.

<a id="function-smallerfield-grpmat"></a>
##### `SmallerField(G): GrpMat -> FLdFin`

Given an absolutely irreducible matrix group $G$ defined over a finite field $K$, which can be written over a proper subfield of $K$ (possibly modulo scalars), return the subfield.

<a id="function-smallerfieldbasis-grpmat"></a>
##### `SmallerFieldBasis(G): GrpMat -> GrpMatElt`

Given an absolutely irreducible matrix group $G$ defined over a finite field $K$, which can be written over a proper subfield of $K$ (possibly modulo scalars), return the change of basis matrix for $G$ which rewrites $G$ over the smaller field.

<a id="function-smallerfieldimage-grpmat-grpmatelt"></a>
##### `SmallerFieldImage(G, g): GrpMat, GrpMatElt -> GrpMatElt`

Given an absolutely irreducible matrix group $G$ defined over a finite field $K$, which can be written over a proper subfield of $K$ (possibly modulo scalars), return the image of $g \in G$ in the group defined over the subfield.

<a id="example-ex-3b0781"></a>
##### `Example: Detecting a Smaller Field of Definition (ex-3b0781)`

We define a subgroup of ${\operatorname{GL}}(3, 8)$ which can be written over ${\bf F}_{2}$.

```magma
> G := GL (2, GF (3, 2));
> H := GL (2, GF (3, 8));
> K := sub < H | G.1, G.2 >;
> K;
MatrixGroup(2, GF(3^8))
Generators:
    [ $.1^820        0]
    [       0        1]

    [       2        1]
    [       2        0]
> flag, M := IsOverSmallerField (K);
> flag;
true
> M;
MatrixGroup(2, GF(3^2))
Generators:
    [$.1^7 $.1^2]
    [    1     2]

    [$.1^7 $.1^6]
    [$.1^2 $.1^5]
> F := GF(3, 4);
> G := MatrixGroup<2, F | [ F.1^52, F.1^72, F.1^32, 0 ],
>                                [ 1, 0, F.1^20, 2 ] >;
> flag, X := IsOverSmallerField (G);
> flag;
false
```

We now see if $G$ has an equivalent representation modulo scalars.

```magma
> flag, X := IsOverSmallerField (G: Scalars := true);
> flag;
true
> X;
MatrixGroup(2, GF(3))
Generators:
    [2 1]
    [1 0]

    [2 1]
    [1 1]
> SmallerField (G);
Finite field of size 3
> SmallerFieldBasis (G);
[F.1^33 F.1^23]
[F.1^43 F.1^63]
> g := G.1 * G.2^2; g;
[F.1^52 F.1^72]
[F.1^32      0]
> SmallerFieldImage (G, g);
[1 2]
[2 0]
```

<a id="function-writeoversmallerfield-grpmat-fldfin"></a>
##### `WriteOverSmallerField(G, F): GrpMat, FldFin -> GrpMat, Map`

Given a group $G$ of $d \times d$ matrices over a finite field $E$ having degree $e$ and a subfield $F$ of $E$ having degree $f$, write the matrices of $G$ as $de/f$ by $de/f$ matrices over $F$ and return the group and the isomorphism.

<a id="example-ex-c2e1e0"></a>
##### `Example: Rewriting over a Smaller Field (ex-c2e1e0)`

We define the group ${\operatorname{GL}}(2, 4)$ and then rewrite in over ${\bf F}_{2}$ as a degree 4 matrix group.

```magma
> G := GL(2, 4);
> H := WriteOverSmallerField(G, GF(2));
> H;
MatrixGroup(4, GF(2))
Generators:
    [0 1 0 0]
    [1 1 0 0]
    [0 0 1 0]
    [0 0 0 1]

    [1 0 1 0]
    [0 1 0 1]
    [1 0 0 0]
    [0 1 0 0]
```

#### Decompositions with Respect to a Normal Subgroup

<a id="function-searchfordecomposition-grpmat-grpmatelt"></a>
##### `SearchForDecomposition(G, S): GrpMat, [GrpMatElt] -> BoolElt`

Given a matrix group $G$ defined over a finite field and a sequence $S$ of elements of $G$, this intrinsic first constructs the normal closure $N$ of $S$ in $G$. It then seeks to decide whether or not $G$, with respect to $N$, has a decomposition corresponding to one of the categories (ii)–(vi) in the theorem of Aschbacher stated at the beginning of this section. Theoretical details of the algorithms used may be found in Holt, Leedham-Green, O’Brien, and Rees [[HLGOR96a](https://docs.magma-maths.org/references.md#cite-decomps-modules)]. In summary, it tests for one of the following possibilities:

**(ii)**
$G$ acts semilinearly over an extension field $L$ of $K$, and $N$ acts linearly over $L$;

**(iii)**
$G$ acts imprimitively on $V$ and $N$ fixes each block of imprimitivity;

**(iv)**
$G$ preserves a tensor product decomposition $U \otimes W$ of $V$, where $N$ acts as scalar matrices on $U$;

**(v)**
$N$ acts absolutely irreducibly on $V$ and is an extraspecial $p$-group for some prime $p$, or a 2-group of symplectic type;

**(vi)**
$G$ preserves a tensor-induced decomposition $V = \otimes ^mU$ of $V$ for some $m>1$, where $N$ acts absolutely irreducibly on $V$ and fixes each of the $m$ factors. If one of the listed decompositions is found, then the function *reports* the type found and returns `true`; if no decomposition is found with respect to $N$, then the function returns `false`. The answer provided by the function is conclusive for decompositions of types (ii)–(v), but a negative answer for (vi) is not necessarily conclusive. Each test involves a decomposition of $G$ with respect to the normal subgroup $N$ (which may sometimes be trivial or scalar). In (ii), $N$ is the subgroup of $G$ acting linearly over the extension field irreducibly on $V$. In (iii), $N$ is the subgroup which fixes each of the subspaces in the imprimitive decomposition of $V$. In (iv), it is the subgroup acting as scalar matrices on one of the factors in the tensor-product decomposition. In (v), $N$ is already described, and in (vi), it is the subgroup fixing each of the factors in the tensor-induced decomposition (so $N$ itself falls in Category (iv)). If any one of these decompositions can be found, then it may be possible to obtain an explicit representation of $G/N$ and hence reduce the study of $G$ to a smaller problem. For example, in Category (iii), $G/N$ acts as a permutation group on the subspaces in the imprimitive decomposition of $V$. Currently only limited facilities are provided to construct $G/N$.

Information about the progress of the algorithm can be output by setting the verbose flag `SetVerbose ("Smash", 1)`.

##### Accessing the Decomposition Information

The access functions described in the sections on Primitivity Testing, Semilinearity, Tensor Products, Tensor Induction, and Normalisers of extraspecial groups may be used to extract information about decompositions of type (ii), (iii), (iv), (v) and (vi). We illustrate such decompositions below.

<a id="example-ex-14d37b"></a>
###### `Example: Searching for a Decomposition (ex-14d37b)`

We begin with an example where no decomposition exists.

```magma
> G := GL(4, 5);
> SearchForDecomposition (G, [G.1]);
Smash: No decomposition found
false
```

The second example is of an imprimitive decomposition.

```magma
> M := GL (4, 7);
> P := Sym (3);
> G := WreathProduct (M, P);
> SearchForDecomposition (G, [G.1, G.2]);
Smash: G is imprimitive
true
> IsPrimitive (G);
false
> BlocksImage (G);
Permutation group acting on a set of cardinality 3
    Id($)
    Id($)
    (1, 2, 3)
    (1, 2)
```

The third example admits a semilinear decomposition.

```magma
> P := GL(6,3);
> g1 := P![0,1,0,0,0,0,-1,0,0,0,0,0,
>          0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,1];
> g2 := P![-1,0,0,0,1,0,0,-1,0,0,0,1,
>          -1,0,0,0,0,0,0,-1,0,0,0,0,0,0,-1,0,0,0,0,0,0,-1,0,0];
> g3 := P![1,0,0,0,0,0,0,-1,0,0,0,0,
>          0,0,1,0,0,0,0,0,0,-1,0,0,0,0,0,0,1,0,0,0,0,0,0,-1];
> G := sub <P | g1, g2, g3 >;
>
> SearchForDecomposition (G, [g1]);
Smash: G is semilinear
true
> IsSemiLinear (G);
true
> DegreeOfFieldExtension (G);
2
> CentralisingMatrix (G);
[2 2 0 0 0 0]
[1 2 0 0 0 0]
[0 0 2 2 0 0]
[0 0 1 2 0 0]
[0 0 0 0 2 2]
[0 0 0 0 1 2]
> FrobeniusAutomorphisms (G);
[ 1, 1, 3 ]
```

The fourth example admits a tensor product decomposition.

```magma
> F := GF(5);
> G := GL(5, F);
> H := GL(3, F);
> P := GL(15, F);
> A := MatrixAlgebra (F, 5);
> B := MatrixAlgebra (F, 3);
> g1 := A!G.1; g2 := A!G.2;  g3 := A!Identity(G);
> h1 := B!H.1; h2 := B!H.2; h3 := B!Identity(H);
> w := TensorProduct (g1, h3);
> x := TensorProduct (g2, h3);
> y := TensorProduct (g3, h1);
> z := TensorProduct (g3, h2);
> G := sub < P | w, x, y, z>;
> SearchForDecomposition (G, [G.1, G.2]);
Smash: G is a tensor product
true
> IsTensor (G);
true
> TensorBasis (G);
[1 0 0 0 0 0 0 0 0 0 0 0 0 0 0]
[0 0 0 1 0 0 0 0 0 0 0 0 0 0 0]
[0 0 0 0 0 0 1 0 0 0 0 0 0 0 0]
[0 0 0 0 0 0 0 0 0 0 0 0 1 0 0]
[0 0 0 0 0 0 0 0 0 1 0 0 0 0 0]
[4 0 1 0 0 0 0 0 0 0 0 0 0 0 0]
[0 0 0 4 0 1 0 0 0 0 0 0 0 0 0]
[0 0 0 0 0 0 4 0 1 0 0 0 0 0 0]
[0 0 0 0 0 0 0 0 0 0 0 0 4 0 1]
[0 0 0 0 0 0 0 0 0 4 0 1 0 0 0]
[1 4 4 0 0 0 0 0 0 0 0 0 0 0 0]
[0 0 0 1 4 4 0 0 0 0 0 0 0 0 0]
[0 0 0 0 0 0 1 4 4 0 0 0 0 0 0]
[0 0 0 0 0 0 0 0 0 0 0 0 1 4 4]
[0 0 0 0 0 0 0 0 0 1 4 4 0 0 0]
```

Our fifth example is of a tensor-induced decomposition.

```magma
> M := GL (3, GF(2));
> P := Sym (3);
> G := TensorWreathProduct (M, P);
> SearchForDecomposition (G, [G.1]);
Smash: G is tensor induced
true
>
> IsTensorInduced (G);
true
> TensorInducedPermutations (G);
[ Id(P), Id(P), (1, 3, 2), (1, 3) ]
```

Our final example is of a normaliser of a symplectic group.

```magma
> F := GF(5);
> P := GL(4,F);
> g1 := P![ 1,0,0,0,0,4,0,0,2,0,2,3,3,0,4,3];
> g2 := P![ 4,0,0,1,2,4,4,0,1,0,1,2,0,0,0,1];
> g3 := P![ 4,0,1,1,0,1,0,0,0,1,3,4,0,4,3,2];
> g4 := P![ 2,0,4,3,4,4,2,4,0,1,3,4,4,2,0,1];
> g5 := P![ 1,1,3,4,0,0,3,4,2,0,0,4,3,1,3,4];
> g6 := P![ 2,0,0,0,0,2,0,0,0,0,2,0,0,0,0,2];
> G := sub < P | g1, g2, g3, g4, g5, g6 >;
> SearchForDecomposition (G, [G.4]);
Smash: G is normaliser of symplectic 2-group
true
> IsExtraSpecialNormaliser (G);
true
> ExtraSpecialParameters (G);
[2, 6]
> g := G.1 * G.2;
> ExtraSpecialAction(G, g);
[0 1 0 0]
[1 1 0 0]
[0 1 1 1]
[1 1 1 0]
```

### Constructive Recognition for Simple Groups

For each finite non-abelian simple group $S$, we designate a specific *standard copy* of $S$. The standard copy has a designated set of *standard generators*. For example, the standard copy of ${\operatorname{Alt}}(n)$ is on $n$ points; its standard generators are $(1,2,3)$ and either of $(3,\ldots, n)$ or $(1, 2)(3,\ldots, n)$ according to the parity of $n$. For a projective representation, the standard copy is the quotient of a matrix group by its scalar subgroup. For example, the standard copy of ${\operatorname{PSL}}(n,q)$ is the quotient of ${\operatorname{SL}}(n,q)$ by its scalar subgroup.

To compute in a copy $G$ of $S$, we first construct effective isomorphisms between $G$ and its standard copy. We do this by finding generators in $G$ that correspond to the standard generators of $S$ under an isomorphism. More formally, a *constructive recognition algorithm* for a non-abelian simple group $G$ (possibly with decorations) solves the following problem: construct an isomorphism $\phi$ from $G$ to a standard copy $S$ of $G$, such that $\phi(g)$ can be computed efficiently for every $g \in G$. This is done by constructing standard generators in both $G$ and its standard copy $S$.

A *rewriting algorithm* for $G$ solves the *constructive membership problem*: given $g \in U \geq G = \langle X \rangle$, decide whether or not $g \in G$, and if so express $g$ as an SLP in $X$. (Here $U$ is the generic overgroup of $G$, such as ${\operatorname{GL}}(d,q)$ or ${\operatorname{Sym}}(n)$.) The rewriting algorithm is used to make the isomorphism between $S$ and $G$ effective. To compute the image of an arbitrary element $s$ of $S$ in $G$, we first write $s$ as an SLP in the standard generators of $S$ and then evaluate the SLP in the copy of the standard generators in $G$.

To verify that the homomorphism from $S$ to $G$ is an isomorphism, we can evaluate in $G$ a *standard presentation* for $S$ on its standard generators. If the copy of the standard generators in $G$ satisfy the presentation, then we have proved that we have an isomorphism.

For a detailed discussion of these topics, see [[LGO09](https://docs.magma-maths.org/references.md#cite-lgo-odd), [OBr11](https://docs.magma-maths.org/references.md#cite-obrien10)]. Here we discuss recognition of classical and exceptional groups. See `RecogniseAlternatingOrSymmetric` for alternating groups.

#### Constructive Recognition for Classical Groups

<a id="function-classicalstandardgenerators-monstgelt-rngintelt-rngintelt"></a>
##### `ClassicalStandardGenerators(type, d, q): MonStgElt, RngIntElt, RngIntElt -> []`

This intrinsic produces the standard generators of Leedham-Green and O’Brien for the quasisimple classical group of specified type in dimension $d$ over a field of size $q$. The type is designated by the argument `type` which must be one of the strings “SL”, “Sp”, “SU”, “Omega”, “Omega-”, or “Omega+”. The standard generators generate a specific copy of a classical group and are defined in [[LGO09](https://docs.magma-maths.org/references.md#cite-lgo-odd)] and [[DLLGO13](https://docs.magma-maths.org/references.md#cite-dlgo-even)].

<a id="function-classicalconstructiverecognition-grpmat-fldfin-monstgelt-rngintelt-rngintelt"></a>
##### `ClassicalConstructiveRecognition(G, type, d, q): GrpMat[FldFin], MonStgElt, RngIntElt, RngIntElt -> BoolElt, Map, Map, Map, Map, SeqEnum, SeqEnum`

<a id="function-classicalconstructiverecognition-grpmat-fldfin"></a>
##### `ClassicalConstructiveRecognition(G): GrpMat[FldFin] -> BoolElt, SeqEnum, SeqEnum`

The input group $G = \langle X \rangle$ is a permutation group, or a matrix group defined over a finite field. It must be isomorphic to a central quotient of a classical group of specified type in dimension $d$ over a field of size $q$. The type is designated by one of the strings “SL”, “Sp”, “SU”, “Omega”, “Omega-”, or “Omega+”. The function constructs standard generators for $G$. If it is successful, then return `true`; four maps $m_1, m_2, m_3, m_4$; standard generators ${\cal S}$ for $G$; and their SLPs in $X$; otherwise return `false`. The map $m_1$ is from $G$ to the standard copy $S$ of $G$; the map $m_2$ is from $S$ to $G$; the map $m_3$ is from $G$ to `WordGroup(G)`; the map $m_4$ is from `WordGroup(G)` to $G$. Since, in general, $G$ is isomorphic to a central quotient of $S$, the maps $m_1$ and $m_2$ are homomorphisms modulo scalars.

In the second signature, $G$ must be a matrix group defined over a finite field such that $G = \langle X \rangle$ is conjugate to a quasisimple classical group in its natural representation in dimension at least 2. The intrinsic constructs a copy ${\cal S}$ in $G$ of the generators defined by `StandardGenerators`. If $G$ is quasisimple and classical, then the function returns `true`, the standard generators ${\cal S}$, and SLPs for these in $X$; otherwise it returns `false`.

The algorithms used are described in [[LGO09](https://docs.magma-maths.org/references.md#cite-lgo-odd)], [[DLLGO13](https://docs.magma-maths.org/references.md#cite-dlgo-even)], and [[DLGO15](https://docs.magma-maths.org/references.md#cite-dlgo-black)]. The implementations for even and odd characteristic were developed by Heiko Dietrich and Eamonn O’Brien respectively. Some base case functions were implemented by Kenneth Clarkson.

<a id="example-ex-0be2ca"></a>
##### `Example: Constructive Recognition of Sp(6, 125) (ex-0be2ca)`

We illustrate these functions with two examples.

```magma
> G := Sp (6, 5^3);
> G := ExteriorSquare (G);
> f, m1, m2, m3, m4, E, W := ClassicalConstructiveRecognition( G, "Sp", 6, 5^3 );

> Q, R := ClassicalStandardPresentation ("Sp", 6, 5^3);
> #{Evaluate( r, E ) : r in R} eq 1;
true
> x := Random (G);
> y := m1 (x);
> y;
> w := m3 (x);
> "Length of SLP is ", #w;
> Evaluate (w, [G.i: i in [1..Ngens (G)]]) eq x;
true
> E eq Evaluate( W, [G.i : i in [ 1 .. Ngens( G )]]);

> G := PSL( 6, 4 );
> f, m1, m2, m3, m4, E, W := ClassicalConstructiveRecognition( G, "SL", 6, 4 );
> E eq Evaluate( W, [G.i : i in [ 1 .. Ngens( G )]]);
true
>
> Q, rels := ClassicalStandardPresentation( "SL" , 6, 4);
> #{Evaluate( r, E ) : r in rels} eq 1;
true
>
> g := Random( G );
> s := m1( g );
> s in SL(6,4);
true
> m2( s ) eq g;
true
>
> h := Random( SL( 6, 4 ) );
> g := m2( h );
> g in G;
true
> m1( g ) eq h;
false
> IsScalar( m1( g ) * h^-1 );
true
>
> w := m3( g );
> w in WordGroup( G );
true
> m4( w ) eq g;
true
> g eq Evaluate( w, [G.i : i in [ 1 .. Ngens( G )]]);
true
```

<a id="function-classicalchangeofbasis-grpmat-fldfin"></a>
##### `ClassicalChangeOfBasis(G): GrpMat[FldFin] -> GrpMatElt[FldFin]`

Let $G$ be a classical group in its natural representation; return a change-of-basis matrix to conjugate the generators returned by `ClassicalStandardGenerators` to those returned by `ClassicalConstructiveRecognition` $(G)$. The latter intrinsic must have been applied to $G$.

<a id="function-classicalrewrite-grp-seqenum-monstgelt-rngintelt-rngintelt-grpelt"></a>
##### `ClassicalRewrite(G, gens, type, dim, q, g : parameters): Grp, SeqEnum, MonStgElt, RngIntElt, RngIntElt, GrpElt -> BoolElt, GrpElt`

```magma
Method: MonStgElt                    Default: "choose"
```

Let $G$ be a classical group of type `type`, which is one of the strings “SL”, “Sp”, “SU”, “Omega”, “Omega-”, or “Omega+”, with dimension `dim` over the field ${\bf F}_{q}$ generated by `gens` which satisfy `ClassicalStandardPresentation (type, dim, q)`. Further, let $g$ be an element of `Generic`$(G)$.

If $g \in G$, then the function returns `true` and an SLP for $g$ in `gens`; if $g\not\in G$ then the function searches for an SLP $w$ such that $g \cdot$`Evaluate`$(w, gens)^{-1}$ centralizes $G$; if it is successful, it returns `false` and $w$. Otherwise the function returns `false, false`.

The function chooses one of the following methods:

**(i)**
If $G$ is in its natural representation and `gens` is `ClassicalStandardGenerators (type, dim, q)` then an algorithm of Costi [[Cos09](https://docs.magma-maths.org/references.md#cite-costi-phd)] is used.

**(ii)**
If (i) is not valid, but $G$ is an absolutely irreducible representation in the defining characteristic, then an algorithm of Costi [[Cos09](https://docs.magma-maths.org/references.md#cite-costi-phd)] is used.

**(iii)**
If neither of (i) and (ii) is valid, then a “black-box” method, independent of the representation of $G$, developed by Csaba Schneider is used.

The optional parameter `Method` can be used to override the default choice of method. The possible values of `Method` are `CharP` and `BB`.

A description of the algorithm used in the defining characteristic case appears in [[Cos09](https://docs.magma-maths.org/references.md#cite-costi-phd)]; a short description of the black-box algorithm appears in [[AMPS10a](https://docs.magma-maths.org/references.md#cite-ambroseetal)].

The code was developed and written by Csaba Schneider.

<a id="function-classicalrewritenatural-monstgelt-grpmatelt-grpmatelt"></a>
##### `ClassicalRewriteNatural(type, CB, g): MonStgElt, GrpMatElt, GrpMatElt -> BoolElt, GrpElt`

<a id="function-classicalrewritenatural-monstgelt-grpmatelt-grpmatelt-2"></a>
##### `ClassicalRewriteNatural(G, type, CB, g): MonStgElt, GrpMatElt, GrpMatElt -> BoolElt, GrpElt`

This is a faster specialized version of the intrinsic `ClassicalRewrite` discussed above; it is designed for classical groups in their **natural representation**.

The argument `type` must be one of the strings “SL”, “Sp”, “SU”, “Omega”, “Omega-”, or “Omega+”. Both `CB` and $g$ are elements of some ${\operatorname{GL}}(d, q)$.

If $g$ is a member of the group generated by `ClassicalStandardGenerators (type, d, q)`$^{{\tt CB}}$ then the function returns `true` and an SLP $w$ such that `Evaluate (w, ClassicalStandardGenerators (type, d, q)`$^{{\tt CB}}) = g$. Otherwise the function returns `false, false`.

If many elements of the same group $G$ are rewritten in terms of standard generators, then the second signature with $G$ as an argument is recommended on efficiency grounds since the results of some necessary precomputations are stored in $G$.

This algorithm, based on that developed by Elliot Costi [[Cos09](https://docs.magma-maths.org/references.md#cite-costi-phd)], was implemented by Csaba Schneider.

<a id="function-classicalstandardpresentation-monstgelt-rngintelt-rngintelt"></a>
##### `ClassicalStandardPresentation(type, d, q : parameters): MonStgElt, RngIntElt, RngIntElt -> SLPGroup, []`

```magma
Projective: BoolElt                    Default: false
```

Given the specification `type, d, q` of a quasisimple group $G$, this intrinsic constructs a presentation on the standard generators for $G$. The string `type` must be one of “SL”, “Sp”, “SU”, “Omega”, “Omega-”, or “Omega+”, while $d$ is the dimension and $q$ is the cardinality of the finite field. The presentations are described in [[LGO20](https://docs.magma-maths.org/references.md#cite-lgo-pres)]. The relations are returned as SLPs together with the parent SLPGroup.

If the parameter `Projective` is set to true, the intrinsic constructs a presentation for the corresponding projective group.

<a id="example-ex-7ccc3b"></a>
##### `Example: Standard Generators for SL(6, 125) (ex-7ccc3b)`

As our first illustration, we produce standard generators for ${\operatorname{SL}}(6, 5^3)$:

```magma
> E := ClassicalStandardGenerators ("SL", 6, 5^3);
> E;
[
    [      0       1       0       0       0       0]
    [      4       0       0       0       0       0]
    [      0       0       1       0       0       0]
    [      0       0       0       1       0       0]
    [      0       0       0       0       1       0]
    [      0       0       0       0       0       1],

    [      0       0       0       0       0       1]
    [      4       0       0       0       0       0]
    [      0       4       0       0       0       0]
    [      0       0       4       0       0       0]
    [      0       0       0       4       0       0]
    [      0       0       0       0       4       0],

    [      1       1       0       0       0       0]
    [      0       1       0       0       0       0]
    [      0       0       1       0       0       0]
    [      0       0       0       1       0       0]
    [      0       0       0       0       1       0]
    [      0       0       0       0       0       1],

    [    $.1       0       0       0       0       0]
    [      0 $.1^123       0       0       0       0]
    [      0       0       1       0       0       0]
    [      0       0       0       1       0       0]
    [      0       0       0       0       1       0]
    [      0       0       0       0       0       1]
]
```

We now perform constructive recognition on ${\operatorname{SL}}(6, 5^3)$, and so obtain $S$, conjugate to $E$ in ${\operatorname{GL}}(6, 5^3)$. Observe that the change-of-basis matrix returned by `ClassicalChangeOfBasis` performs this conjugation.

```magma
> G := SL (6, 5^3);
> f, S, W := ClassicalConstructiveRecognition (G);
> f;
true
> CB := ClassicalChangeOfBasis (G);
> E^CB eq S;
true
```

Note that $W$ is list of SLPs expressing $S$ in terms of defining generators of $G$.

```magma
> S eq Evaluate (W, [G.i: i in [1..Ngens (G)]]);
true
```

We next express a random element of $G$ as a SLP in $S$ and then check that the standard generators satisfy the standard presentation.

```magma
> g := Random (G);
> f, w := ClassicalRewriteNatural ("SL", CB, g);
> Evaluate (w, S) eq g;
true
>
> P, R := ClassicalStandardPresentation ("SL", 6, 5^3);
> Set (Evaluate (R, S));
{
    [      1       0       0       0       0       0]
    [      0       1       0       0       0       0]
    [      0       0       1       0       0       0]
    [      0       0       0       1       0       0]
    [      0       0       0       0       1       0]
    [      0       0       0       0       0       1]
}
```

We perform constructive recognition on a random conjugate of ${\operatorname{Sp}}(10, 3^6)$ and again check that the standard generators satisfy the standard presentation.

```magma
> G := RandomConjugate (Sp(10, 3^6));
> f, S, W := ClassicalConstructiveRecognition (G);
> f;
true
```

The return variable $W$ is list of SLPs expressing $S$ in terms of defining generators of $G$.

```magma
> S eq Evaluate (W, [G.i: i in [1..Ngens (G)]]);
true
>
> g := Random (G);
> CB := ClassicalChangeOfBasis (G);
> f, w := ClassicalRewriteNatural ("Sp", CB, g);
> Evaluate (w, S) eq g;
true
>
> P, R := ClassicalStandardPresentation ("Sp", 10, 3^6);
> Set (Evaluate (R, S));
{
    [1 0 0 0 0 0 0 0 0 0]
    [0 1 0 0 0 0 0 0 0 0]
    [0 0 1 0 0 0 0 0 0 0]
    [0 0 0 1 0 0 0 0 0 0]
    [0 0 0 0 1 0 0 0 0 0]
    [0 0 0 0 0 1 0 0 0 0]
    [0 0 0 0 0 0 1 0 0 0]
    [0 0 0 0 0 0 0 1 0 0]
    [0 0 0 0 0 0 0 0 1 0]
    [0 0 0 0 0 0 0 0 0 1]
}
```

As another demonstration, we constructively recognise $\Omega^{-}(16, 2^6)$.

```magma
> G := RandomConjugate (OmegaMinus (16, 2^6));
> f, S, W := ClassicalConstructiveRecognition (G);
> f;
true
```

A random element of $G$ is expressed as an SLP in $S$:

```magma
> g := Random (G);
> CB := ClassicalChangeOfBasis (G);
> f, w := ClassicalRewriteNatural ("Omega-", CB, g);
> Evaluate (w, S) eq g;
true
```

Finally, we illustrate using `ClassicalRewrite` to write an element of a classical group in a non-natural representation as an SLP in its standard generators.

```magma
> gens := [ExteriorSquare (x) : x in ClassicalStandardGenerators ("Sp", 6, 25)];
> G := sub<Universe (gens) | gens>;
> x := Random (G);
> f, w := ClassicalRewrite (G, gens, "Sp", 6, 25, x);
> f;
true
> Evaluate (w, gens) eq x;
true
> f, w := ClassicalRewrite (G, gens, "Sp", 6, 25, x : Method := "BB");
> f;
true
> Evaluate (w, gens) eq x;
true
```

#### Constructive Recognition for Exceptional Groups

Here we discuss machinery for constructive recognition of most of the finite exceptional groups. For the remainder, see `RecogniseSz`, `RecogniseRee`, and `RecogniseLargeRee`.

<a id="function-exceptionalstandardgenerators-monstgelt-rngintelt-rngintelt"></a>
##### `ExceptionalStandardGenerators(type, rank, q): MonStgElt, RngIntElt, RngIntElt -> []`

Return standard generators for the finite exceptional simple group of specified type `type` and rank `rank` over a field of size $q$. The type is designated by the argument `type` which must be one of the strings “E”, “F”, “G”, “2E”, “3D”. The standard generators, $X$ and $X_m$, are defined in [[LO16](https://docs.magma-maths.org/references.md#cite-exceptional-lob16)]; they label the positive and negative root groups of the group respectively and satisfy the presentation returned by `ExceptionalStandardPresentation`. The copy of the exceptional group generated by $X$ and $X_m$ is that defined in [[HRT01](https://docs.magma-maths.org/references.md#cite-howlett-rylands-taylor)]. This function is essentially a wrapper for `CST_Generators` prepared by Don Taylor.

```magma
> X, Xm := ExceptionalStandardGenerators ("F", 4, 5^3);
> #X;
8
> #X[1];
3

> X, Xm := ExceptionalStandardGenerators ("2E", 6, 3^4);
> #X;
8
> #X[1];
4
```

<a id="function-exceptionalconstructiverecognition-grpmat-fldfin-monstgelt-rngintelt-rngintelt"></a>
##### `ExceptionalConstructiveRecognition(G, type, rank, q): GrpMat[FldFin], MonStgElt, RngIntElt, RngIntElt -> BoolElt, Map, Map, Map, Map, SeqEnum, SeqEnum`

The input group $G = \langle Y \rangle$ is a matrix group defined over a finite field. It must be isomorphic to a central quotient of an exceptional group of specified type `type` and rank `rank` over a field of size $q$. The type is designated by the argument `type` which must be one of the strings “E”, “F”, “G”, “2E”, “3D”. The function constructs standard generators for $G$. If it is successful, then return `true`; four maps $m_1, m_2, m_3, m_4$; the standard generators $E$ for $G$; and their SLPs $W$ in $Y$; otherwise return `false`. The map $m_1$ is from $G$ to the standard copy $S$ of $G$; the map $m_2$ is from $S$ to $G$; the map $m_3$ is from $G$ to `WordGroup(G)`; the map $m_4$ is from `WordGroup(G)` to $G$. Since, in general, $G$ is isomorphic to a central quotient of $S$, the maps $m_1$ and $m_2$ are homomorphisms modulo scalars. The maps $m_1$, $m_2$, and $m_3$ are returned only if $G$ is a defining characteristic absolutely irreducible matrix representation of the exceptional group. The standard generators $E$ are returned as a sequence of length 2: its entries, $X$ and $X_m$, label the positive and negative root groups respectively.

The algorithm used is that of [[LO16](https://docs.magma-maths.org/references.md#cite-exceptional-lob16)]; the implementation was developed by Eamonn O’Brien. The maps $m_1$, $m_2$, and $m_3$ are provided by `ExceptionalRewrite`, developed and implemented by Don Taylor.

The verbose flag `SetVerbose("Except", 1)` may be used to print information on the progress of the function.

<a id="example-ex-111a3c"></a>
##### `Example: Constructive Recognition of an Exceptional Group (ex-111a3c)`

We illustrate these functions with two examples.

```magma
> G := MatrixGroup ("G25", 6);
> G: Minimal;
MatrixGroup(27, GF(5)) of order 2^6 * 3^3 * 5^6 * 7 * 31
> f, m1, m2, m3, m4, E, W := ExceptionalConstructiveRecognition( G, "G", 2, 5 );
> Q, R := ExceptionalStandardPresentation ("G", 2, 5);
> X := E[1]; Xm := E[2];
> #Set (Evaluate( R, &cat X cat &cat Xm)) eq 1;
true
> x := Random (G);
> m1;
Mapping from: GL(27, GF(5)) to GL(7, GF(5)) given by a rule [no inverse]
> y := m1 (x);
> m3;
Mapping from: GL(27, GF(5)) to SLPGroup(2) given by a rule [no inverse]
> w := m3 (x);
> Evaluate (w, [G.i: i in [1..Ngens (G)]]) eq x;
true
> &cat X eq Evaluate( &cat W[1], [G.i : i in [ 1 .. Ngens( G )]]);
true
> &cat Xm eq Evaluate( &cat W[2], [G.i : i in [ 1 .. Ngens( G )]]);
true
>
> G := ChevalleyGroup ("3D", 4, 4);
> G := RandomConjugate (G);
> G: Minimal;
MatrixGroup(8, GF(2^6))
> f, m1, m2, m3, m4, E, W := ExceptionalConstructiveRecognition( G, "3D", 4, 4);
> Q, R := ExceptionalStandardPresentation ("3D", 4, 4);
> X := E[1]; Xm := E[2];
> #Set (Evaluate( R, &cat X cat &cat Xm)) eq 1;
true
```

<a id="function-exceptionalrewrite-monstgelt-rngintelt-rngintelt-seqenum-seqenum-grpelt"></a>
##### `ExceptionalRewrite(type, rank, q, X, Xm, g): MonStgElt, RngIntElt, RngIntElt, SeqEnum, SeqEnum, GrpElt -> BoolElt, GrpElt`

Let $G$ be a finite exceptional group of type `type` and rank `rank` over a field of size $q$. The type is designated by the argument `type` which must be one of the strings “E”, “F”, “G”, “2E”, “3D”. Also $X$ and $X_m$ are generators which satisfy `ExceptionalStandardPresentation (type, rank, q)`. Further, let $g$ be an element of `Generic`$(G)$.

If $g \in G$, then the function returns `true` and an SLP for $g$ in `&cat X cat &cat Xm`; if $g\not\in G$ then the function searches for an SLP $w$ such that $g \cdot$ `Evaluate`(`w, &cat X cat &cat Xm`)$^{-1}$ centralizes $G$; if it is successful, it returns `false` and $w$. Otherwise the function returns `false, false`.

A description of the algorithm used appears in [[CMT04](https://docs.magma-maths.org/references.md#cite-cohenmurraytaylor), [CT19](https://docs.magma-maths.org/references.md#cite-cohen-taylor-preprint)]. This function is essentially a wrapper for `LieTypeRewrite` prepared by Don Taylor.

```magma
> g := Random (G);
> f, w := ExceptionalRewrite ("G", 2, 5, X, Xm, g);
> f;
true
> g eq Evaluate (w, &cat X cat &cat Xm);
true
```

<a id="function-exceptionalstandardpresentation-monstgelt-rngintelt-rngintelt"></a>
##### `ExceptionalStandardPresentation(type, rank, q): MonStgElt, RngIntElt, RngIntElt -> SLPGroup, []`

Let $G$ be a finite exceptional group of type `type` and rank `rank` defined over a field of size $q$. The type is designated by the argument `type` which must be one of the strings “E”, “F”, “G”, “2E”, “3D”. This intrinsic constructs a presentation on the standard generators for $G$. The relations are returned as SLPs together with the parent SLPGroup. The standard presentations returned by this function are listed explicitly in [[LO16](https://docs.magma-maths.org/references.md#cite-exceptional-lob16)]. This function is essentially a wrapper for `CST_Presentation` prepared by Don Taylor.

`ExceptionalStandardGenerators` returns matrices satisfying this presentation. `ExceptionalConstructiveRecognition` constructs such generators in an arbitrary matrix representation $G$.

<a id="example-ex-b84999"></a>
##### `Example: Standard Presentation of G2 (ex-b84999)`

```magma
> Q, R := ExceptionalStandardPresentation ("G", 2, 5^3);
> X, Xm := ExceptionalStandardGenerators ("G", 2, 5^3);
> #Set (Evaluate (R, &cat X cat &cat Xm));
1
> G := ChevalleyGroup ("G", 2, 5^3);
> G := RandomConjugate (ExteriorSquare (G));
> G:Minimal;
MatrixGroup(21, GF(5^3))
> f, m1, m2, m3, m4, E, W := ExceptionalConstructiveRecognition(G, "G",
>                                                                 2, 5^3);
> X := E[1]; Xm := E[2];
> #Set (Evaluate (R, &cat X cat &cat Xm));
1
```

<a id="composition-tree"></a>
<a id="sec-composition-tree"></a>
### Composition Trees for Matrix Groups

#### The Composition Tree Algorithm

A *composition tree* for a group $G$ can be viewed as a data structure which presents a group in terms of its composition factors. The tree is constructed recursively and the data structure facilitates the rewriting of elements of $G$ in terms of different generating sets.

The basic strategy for computing a *composition tree* of a matrix group employs a combination of a constructive version of Aschbacher’s theorem [[Asc84](https://docs.magma-maths.org/references.md#cite-asch-maximal-subgps)] and constructive recognition algorithms for finite simple groups. The basic algorithms are described in [[LG01](https://docs.magma-maths.org/references.md#cite-crlg01), [OBr06](https://docs.magma-maths.org/references.md#cite-obrien-survey), [OBr11](https://docs.magma-maths.org/references.md#cite-obrien10)] while some new ideas introduced in [[NS06](https://docs.magma-maths.org/references.md#cite-neunhoeffer-seress)] are incorporated. A detailed account of the entire [`CompositionTree`](https://docs.magma-maths.org/search.html?q=CompositionTree&show=intrinsics&match=exact) procedure appears in [[BHLGO15](https://docs.magma-maths.org/references.md#cite-baarnhielmetal11)].

The algorithm for constructing a composition tree for a group $G$ proceeds as follows.

**(i)**
Attempt to construct an effective homomorphism $\phi : G \to G_1$, for some group $G_1$. The homomorphism $\phi$ is called a *reduction* of $G$ since $G_1$ is “smaller” than $G$ in some sense – for example, with respect to its degree or field of definition.

**(ii)**
Otherwise deduce that $G$ is cyclic, elementary abelian, or “close” to being non-abelian simple. In this case $G$ becomes a *leaf* in the tree.

If Case (i) applies the algorithm proceeds as follows:-

1. Construct a composition tree for $G_1$.
2. Determine generators for $G_0 := {\rm Ker}(\phi)$. This requires a rewriting algorithm for $G_1$.
3. Construct a composition tree for $G_0$.
4. Combine the composition trees for $G_1$ and $G_0$ to produce a composition tree for $G$.

If $G \leq {\operatorname{GL}}(d, q)$, then Aschbacher’s theorem [[Asc84](https://docs.magma-maths.org/references.md#cite-asch-maximal-subgps)] is applied in Step (1). This requires algorithms that can decide whether $G$ lies in a certain Aschbacher class, and to construct the corresponding $\phi$. Other homomorphisms, such as the determinant map, may also be used.

The group associated with a leaf need not be simple. It may be cyclic or elementary abelian, a soluble or non-abelian simple primitive permutation group, or an absolutely irreducible matrix group that is simple modulo its centre. The decision on just which groups are treated as leaves is partly dictated by complexity considerations, and partly based on the quality of available algorithms for processing a leaf. For example, refining a cyclic group into its composition factors appears to offer no practical advantage.

Once a composition tree for $G = \langle X \rangle$ has been constructed, then a second list $Y$ of *nice generators* are stored with $G$. The group $\langle Y \rangle$ is called the *nice group*. The intrinsic `CompositionTree` constructs the nice generators $Y$ as straight-line programs (SLPs) with respect to $X$. The rewriting algorithm solves rewriting problems with respect to $Y$ and the resulting SLPs can then be rewritten to provide SLPs on $X$.

The verbose flag `SetVerbose("CompositionTree", n)` with $n=1, \ldots, 10$ may be used to print increasing levels of information on the progress of the functions.

#### Constructing the Composition Tree

<a id="function-compositiontree-grpmat-fldfin"></a>
##### `CompositionTree(G): GrpMat[FldFin] -> []`

Let $G$ be a finite group generated by matrices over a finite field. The intrinsic constructs a composition tree for $G$ using the algorithm outlined at the beginning of this section. The tree is returned as the value of this intrinsic and is also stored with $G$ and it is usually accessed by reference to $G$.

The intrinsic has a number of parameters that are described below. Even in the case of a small group, the tree is a very voluminous object so that information about it should be extracted using the intrinsics described below. The tree is constructed using Monte Carlo algorithms and so there is a small probability that it is incorrect. Algorithms are available to verify the correctness of the tree and may be invoked either by setting a parameter for the `CompositionTree` intrinsic or by a separate intrinsic `CompositionTreeVerify` that may be applied to the tree produced by a call to `CompositionTree` and which is described below.

<a id="example-ex-009621"></a>
##### `Example: Composition Tree for J4 (ex-009621)`

The minimum degree of a permutation representation of the sporadic simple group $J_4$ is $173,067,389$ while there is a matrix representation of degree $112$ over the finite field $F_2$. We extract this matrix representation of $J_4$ from the Atlas database and apply `CompositionTree` to it.

```magma
> G := MatrixGroup(AtlasGroup("J4"));
> G:Minimal;
MatrixGroup(112, GF(2))
> time G_Tree := CompositionTree(G);
Time: 3.030
```

We now extract the order and list the isomorphism types of the non-abelian composition trees.

```magma
> CompositionTreeOrder(G);
86775571046077562880
> nafact := CompositionTreeNonAbelianFactors(G);
> nafact[1][3];
"J4"
```

<a id="function-compositiontree-grpmat-fldfin-2"></a>
##### `CompositionTree(G : parameters): GrpMat[FldFin] -> []`

```magma
Verify            : BoolElt                      Default: false
Scalar            : FldFinElt                    Default: 1
KernelBatchSize   : RngIntElt                    Default: 5
MandarinBatchSize : RngIntElt                    Default: 100
MaxHomFinderFails : RngIntElt                    Default: 1
MaxQuotientOrder  : RngIntElt                    Default: 10^6
FastTensorTest    : BoolElt                      Default: true
MaxBSGSVerifyOrder: RngIntElt                    Default: 2000
AnalysePermGroups : BoolElt                      Default: false
KnownLeaf         : BoolElt                      Default: false
NamingElements    : RngIntElt                    Default: 200
UnipotentBatchSize: RngIntElt                    Default: 100
PresentationKernel: BoolElt                      Default: true
```

Let $G$ be a finite group generated by matrices over a finite field. The intrinsic constructs a composition tree for $G$ and returns the tree using the algorithm outlined at the beginning of this section. The intrinsic has a number of parameters which are now described.

`Verify`: If `true`, then verify correctness of the tree during construction.

`KernelBatchSize`: The number of normal generators used to construct the kernel of homomorphism.

`MandarinBatchSize`: The number of random elements used to check correctness of the outcome of Monte-Carlo algorithms.

`MaxHomFinderFails`: Assume a negative answer after `MaxHomFinderFails` failures of certain Monte Carlo algorithms.

`MaxQuotientOrder`: A leaf with larger order will not be fully refined to its composition factors.

`FastTensorTest`: Use only the fast tensor product test.

`MaxBSGSVerifyOrder`: If `RandomSchreier` is used on a leaf and it has order less than `MaxBSGSVerifyOrder`, then `Verify` the calculation.

`AnalysePermGroups`: If `false`, then always treat the permutation group as a leaf, and do not analyse its structure.

`NamingElements:` The number of random elements used in calls to `LieType` and `RecogniseClassical`.

`PresentationKernel`: Use presentations to obtain kernels, where possible.

`UnipotentBatchSize`: Batch size for the unipotent kernels.

<a id="function-compositiontreefastverification-grp"></a>
##### `CompositionTreeFastVerification(G): Grp -> BoolElt`

The argument $G$ must be a matrix group over a finite field for which a composition tree datastructure has previously been constructed. The intrinsic determines if correctness of the composition tree can be verified at modest cost using presentations. In effect, the intrinsic determines whether presentations on nice generators are known for all the leaves.

<a id="function-compositiontreeverify-grp"></a>
##### `CompositionTreeVerify(G): Grp -> BoolElt, []`

The argument $G$ must be a matrix group over a finite field for which a composition tree datastructure has previously been constructed. The intrinsic verifies the correctness of the composition tree by using it to construct a presentation for $G$. If $G$ satisfies the presentation, then return `true`, and the relators of the presentation as SLPs; otherwise return `false`. The presentation is on the group returned by `CompositionTreeNiceGroup`$(G)$.

<a id="example-ex-1c147a"></a>
##### `Example: Verifying a Composition Tree (ex-1c147a)`

We use the two methods of establishing correctness to verify the result of applying `CompositionTree` to a wreath product.

```magma
> U33 := MatrixGroup(AtlasGroup("U33"), 1);
> G := TensorWreathProduct( U33, Sym(3) );
> time G_Tree := CompositionTree(G);
Time: 26.620
```

```magma
> G := TensorWreathProduct( U33, Sym(3) );
> time G_Tree := CompositionTree(G : Verify := true);
Time: 28.450
```

Thus, verification adds a little under $2$ seconds to the runtime.

```magma
> G := TensorWreathProduct( U33, Sym(3) );
> time G_Tree := CompositionTree(G );
Time: 26.620
> time CompositionTreeFastVerification(G);
Time: 0.000
true
> time CompositionTreeVerify(G);
Time: 1.850
true
```

In this case we use `CompositionTreeFastVerification` to check that verification wont be expensive and then apply the intrinsic `CompositionTreeVerify` to actually do the verification. Again, it takes less than $2$ seconds.

#### Accessing the Composition Tree

<a id="function-compositiontreeorder-grp"></a>
##### `CompositionTreeOrder(G): Grp -> RngIntElt`

The argument $G$ must be a matrix group over a finite field for which a composition tree datastructure has previously been constructed. This intrinsic returns the order of $G$.

<a id="function-compositiontreenonabelianfactors-grp"></a>
##### `CompositionTreeNonAbelianFactors(G): Grp -> RngIntElt`

The argument $G$ must be a matrix group over a finite field for which a composition tree datastructure has previously been constructed. The intrinsic returns the isomorphism types of the non-abelian composition factors of $G$ as a sequence of triples where each triple defines an isomorphism type.

<a id="procedure-displaycomptreenodes-grp"></a>
##### `DisplayCompTreeNodes(G : parameters): Grp`

```magma
NonTrivial: BoolElt                    Default: true
Leaves    : BoolElt                    Default: false
```

The argument $G$ must be a matrix group over a finite field for which a composition tree datastructure has previously been constructed. This intrinsic displays information about the nodes in the composition tree for $G$. The tree is traversed in-order. If parameter `NonTrivial` is `true`, then only non-trivial nodes will be displayed. If parameter `Leaves` is `true` then only leaves will be displayed.

<a id="example-ex-8acf9e"></a>
##### `Example: Subgroup Order and Membership in J4 (ex-8acf9e)`

The composition tree (CT) machinery allows us to create a subgroup $H$ of a group $G$ with a CT, to determine the order of $H$, and to test membership in $H$. In general, additional machinery is needed in order to be able to determine information about the subgroup structure of $G$. However, there are two Monte Carlo algorithms for computing subgroups, specifically, an algorithm for computing the centralizer of an involution and an algorithm for computing the normal closure of a subgroup. We illustrate how the centralizer algorithm can be used by applying it to compute a large subgroup in the sporadic group $J_4$. The group $J_4$ has a maximal subgroup of order 21,799,895,040 which is the centralizer of an involution. We will try to find this maximal subgroup by working with $J_4$ in its matrix representation of degree 112 over $GF(2)$.

```magma
> G := MatrixGroup(AtlasGroup("J4"));
> G:Minimal;
MatrixGroup(112, GF(2))
> CT := CompositionTree(G);
> CompositionTreeOrder(G);
86775571046077562880

> found := false;
> for i := 1 to 30 do
>    bool, x := RandomElementOfOrder(G, 2);
>    C := CentraliserOfInvolution(G, x);
>    CTree := CompositionTree(C);
>    n := CompositionTreeOrder(C);
>    if n eq 21799895040 then
>       found := true;
>       break;
>    end if;
> end for;

> found;
true

> CompositionTreeOrder(C);
21799895040
```

Our random search has produced a subgroup of the right order. We now display part of the composition tree in order to get an idea of the group structure of $C$.

```magma
> DisplayCompTreeNodes(C : Leaves := true);
node = 6
parent = 5
depth = 5
scalar = 1
info = leaf, GrpPerm, RandomSchreier, order 2
fast verify = true
----------
node = 7
parent = 5
depth = 5
scalar = 1
info = leaf, GrpMat, almost simple, <18, 3, "M22">
fast verify = true
----------
node = 15
parent = 14
depth = 11
scalar = 1
info = leaf, GrpAb, abelian group, order 3
fast verify = true
----------
node = 25
parent = 24
depth = 3
scalar = 1
info = leaf, GrpAb, abelian group, order 16
fast verify = true
----------
node = 27
parent = 26
depth = 4
scalar = 1
info = leaf, GrpAb, abelian group, order 256
fast verify = true
----------
node = 29
parent = 28
depth = 5
scalar = 1
info = leaf, GrpAb, abelian group, order 2
fast verify = true
----------
```

From this information we deduce that structure of the subgroup is consistent with $2^{1+12}.3.M_{22}.2$ which is the structure of the second largest maximal subgroup of $J_4$.

<a id="function-compositiontreenicegroup-grp"></a>
##### `CompositionTreeNiceGroup(G): Grp -> GrpMat[FldFin]`

The argument $G$ must be a matrix group over a finite field for which a composition tree datastructure has previously been constructed. The intrinsic returns the nice group for $G$.

<a id="function-compositiontreeslpgroup-grp"></a>
##### `CompositionTreeSLPGroup(G): Grp -> GrpSLP, Map`

The argument $G$ must be a matrix group over a finite field for which a composition tree datastructure and the associated nice group $H$ has previously been constructed. The intrinsic returns the word group $W$ for $H$, and the map from $W$ to $H$.

<a id="function-compositiontreenicetouser-grp"></a>
##### `CompositionTreeNiceToUser(G): Grp -> Map, []`

The argument $G$ must be a matrix group over a finite field for which a composition tree datastructure has previously been constructed. This intrinsic returns the coercion map from SLPs in nice generators of $G$ to SLPs in input user generators of $G$, as well as the SLPs of the nice generators given in terms the user generators.

<a id="function-compositiontreeorder-grp-2"></a>
##### `CompositionTreeOrder(G): Grp -> RngIntElt`

<a id="function-compositiontreefactoredorder-grp"></a>
##### `CompositionTreeFactoredOrder(G): Grp -> RngIntEltFact`

The argument $G$ must be a matrix group over a finite field for which a composition tree datastructure has previously been constructed. The intrinsics return the (factored) order of $G$.

<a id="function-compositiontreeelementtoword-grp-grpelt"></a>
##### `CompositionTreeElementToWord(G, g): Grp, GrpElt -> BoolElt, GrpSLPElt`

The argument $G$ must be a matrix group over a finite field for which a composition tree datastructure has previously been constructed. Given an element $g\in G$, return `true` and an SLP for $g$ in the nice generators of $G$, otherwise return `false`.

<a id="function-compositiontreenonabelianfactors-grpmat-fldfin"></a>
##### `CompositionTreeNonAbelianFactors(G): GrpMat[FldFin] -> List`

The argument $G$ must be a matrix group over a finite field for which a composition tree datastructure has previously been constructed. This intrinsic returns a list naming the non-abelian composition factors of $G$.

<a id="function-compositiontreecbm-grpmat-fldfin"></a>
##### `CompositionTreeCBM(G): GrpMat[FldFin] -> GrpMatElt`

The argument $G$ must be a matrix group over a finite field for which a composition tree datastructure has previously been constructed. This intrinsic returns a change-of-basis matrix that exhibits the Aschbacher reductions of $G$ given by the composition tree.

<a id="function-compositiontreereductioninfo-grp-rngintelt"></a>
##### `CompositionTreeReductionInfo(G, t): Grp, RngIntElt -> MonStgElt, Grp, Grp`

The argument $G$ must be a matrix group over a finite field for which a composition tree datastructure has previously been constructed. This intrinsic returns a string description of the reduction at the internal node $t$ in the composition tree for $G$, as well as the image and kernel of this reduction.

<a id="function-compositiontreeseries-grp"></a>
##### `CompositionTreeSeries(G): Grp -> SeqEnum, List, List, List, BoolElt, []`

The argument $G$ must be a matrix group over a finite field for which a composition tree datastructure has previously been constructed. This intrinsic returns:

1. A normal series of subgroups $1 = G_0 < G_1 < ... < G_k = G$.
2. Maps $G_i \mapsto S_i$, where $S_i$ is the standard copy of $G_i / G_{i-1}$, where $i \geq 1$. The kernel of this map is $G_{i-1}$. Observe that $S_i$ may be the standard copy plus scalars $Z$, and the map is then a homomorphism modulo scalars, so that the kernel is $(G_{i-1}.Z)/Z$.
3. Maps $S_i \mapsto G_i$.
4. Maps $S_i \mapsto$ `WordGroup`$(S_i)$.
5. Boolean flag `true` or `false` to indicate if the series is a true composition series.
6. A sequence of the leaf nodes in the composition tree corresponding to each composition factor. All maps are defined by rules, so `Function` can be applied on them to avoid built-in membership testing.

<a id="function-compositiontreefactornumber-grp-grpelt"></a>
##### `CompositionTreeFactorNumber(G, g): Grp, GrpElt -> RngIntElt`

The argument $G$ must be a matrix group over a finite field for which a composition tree datastructure has previously been constructed. This intrinsic returns the minimal integer $i$ such that $g$ lies in the $i$th-term of the normal series returned by `CompositionTreeSeries` for $G$.

<a id="function-hascompositiontree-grp"></a>
##### `HasCompositionTree(G): Grp -> BoolElt`

Given a matrix group $G$ defined over a finite field, this intrinsic returns `true` if $G$ has a composition tree and `false` otherwise.

<a id="procedure-cleancompositiontree-grp"></a>
##### `CleanCompositionTree(G): Grp`

The argument $G$ must be a matrix group over a finite field for which a composition tree datastructure has previously been constructed. This intrinsic removes all data related to the composition tree datastructure for $G$.

<a id="example-ex-0bfaff"></a>
##### `Example: Composition Tree of a Conformal Orthogonal Group (ex-0bfaff)`

A composition tree for the conformal orthogonal group $G$ of plus type of degree $4$ over ${\bf F}_{5^2}$ will be constructed.

```magma
> G := CGOPlus(4, 5^2);
>
> T := CompositionTree(G);
>
> DisplayCompTreeNodes (G: Leaves:=true);
node = 2
parent = 1
depth = 1
scalar = 1
info = leaf, GrpAb, cyclic group, order 12
fast verify = true
----------
node = 4
parent = 3
depth = 2
scalar = 1
info = leaf, GrpAb, cyclic group, order 4
fast verify = true
----------
node = 7
parent = 6
depth = 4
scalar = 12
info = leaf, GrpAb, cyclic group, order 24
fast verify = true
----------
node = 8
parent = 6
depth = 4
scalar = 2
info = leaf, GrpMat, almost simple, <"A", 1, 25>
fast verify = true
----------
node = 9
parent = 5
depth = 3
scalar = 1
info = leaf, GrpMat, almost simple, <"A", 1, 25>
fast verify = true
----------
```

Next the correctness of the composition tree is verified. In order to demonstrate what is going on, various pieces of the verification process will be examined. Firstly, the nice group H for G and its associated SLP group, is set up; observe that $H = G$. After checking that verification can be carried out quickly, the verification is actually performed.

```magma
> H := CompositionTreeNiceGroup(G);
> W := CompositionTreeSLPGroup(G);
>
> CompositionTreeFastVerification(G);
true
>
> f, R := CompositionTreeVerify(G);
```

At this point correctness has been verified. To show what verification actually involves, the relations $R$ on the generators of $H$ will be explicitly evaluated. This step has already been performed by `CompositionTreeVerify` and is shown here just for demonstration purposes.

```magma
> Set(Evaluate(R, [H.i:i in [1..Ngens(H)]]));
{
    [     1      0      0      0]
    [     0      1      0      0]
    [     0      0      1      0]
    [     0      0      0      1]
}
```

Knowing that the composition tree is correct, the order of $G$ is printed.

```magma
> CompositionTreeOrder(G);
11681280000
```

Express the element $g$ of $G$ as a SLP on the generators of the nice group $H$.

```magma
> g := Random(G);
> f, w := CompositionTreeElementToWord(G, g);
> Evaluate(w, [H.i:i in [1..Ngens(H)]]) eq g;
true
```

Rewrite the SLP in terms of the user-supplied generators for $G$.

```magma
> tau := CompositionTreeNiceToUser(G);
> tau;
Mapping from: GrpSLP: W to SLPGroup(5)
```

Images of elements of $W$ under $tau$ lie in `WordGroup`$(G)$.

```magma
> v := tau(w);
> Evaluate (v, [G.i : i in [1..Ngens(G)]]) eq g;
true
```

Test a random element of the generic group for $G$ for membership. (The generic group will be the general linear group ${\operatorname{GL}}(4, 5^2)$.)

```magma
> x := Random(Generic(G));
> f, w := CompositionTreeElementToWord(G, x);
> f;
false
```

Finally, we construct a normal series for $G$ and locate a random element within this series.

```magma
> CS, _, _, _, flag := CompositionTreeSeries(G);
> "Series is composition series? ", flag;
Series is composition series?  true
> "Length is ", #CS;
Length is  10
>
> g := Random(G);
> CompositionTreeFactorNumber(G, g);
10
```

<a id="example-ex-b767f8"></a>
##### `Example: Composition Tree of a Maximal Subgroup (ex-b767f8)`

In this example, we choose a maximal subgroup of the linear group $SL(10, 2^8)$ and compute its composition tree.

```magma
> X := ClassicalMaximals ("L", 10, 2^8);
> G := X[1];
>
> T := CompositionTree (G);
>
> DisplayCompTreeNodes (G: Leaves:=true, NonTrivial:=true);
node = 6
parent = 5
depth = 5
scalar = 1
info = leaf, GrpAb, cyclic group, order 255
fast verify = true
----------
node = 9
parent = 8
depth = 5
scalar = 1
info = leaf, GrpMat, almost simple, <"A", 8, 256>
fast verify = true
----------
node = 13
parent = 12
depth = 3
scalar = 1
info = leaf, GrpPC, abelian group, order 256
fast verify = true
----------
node = 15
parent = 14
depth = 4
scalar = 1
info = leaf, GrpPC, abelian group, order 256
fast verify = true
----------
node = 17
parent = 16
depth = 5
scalar = 1
info = leaf, GrpPC, abelian group, order 256
fast verify = true
----------
node = 19
parent = 18
depth = 6
scalar = 1
info = leaf, GrpPC, abelian group, order 256
fast verify = true
----------
node = 21
parent = 20
depth = 7
scalar = 1
info = leaf, GrpPC, abelian group, order 256
fast verify = true
----------
----------
node = 23
parent = 22
depth = 8
scalar = 1
info = leaf, GrpPC, abelian group, order 256
fast verify = true
----------
node = 25
parent = 24
depth = 9
scalar = 1
info = leaf, GrpPC, abelian group, order 256
fast verify = true
----------
node = 27
parent = 26
depth = 10
scalar = 1
info = leaf, GrpPC, abelian group, order 256
fast verify = true
----------
node = 29
parent = 28
depth = 11
scalar = 1
info = leaf, GrpPC, abelian group, order 256
fast verify = true
----------
```

We now set up the nice group $H$ for $G$ and its associated SLP group; observe that $H = G$.

```magma
> H := CompositionTreeNiceGroup(G);
> "# of generators of H is ", Ngens(H);
# of generators of H is  77
> W := CompositionTreeSLPGroup(G);
```

After checking that correctness of the composition tree can be verified quickly, we perform verification.

```magma
> CompositionTreeFastVerification(G);
true
> f, R := CompositionTreeVerify(G);
```

Evaluate the relations on the generators of $H$.

```magma
> Set (Evaluate (R, [H.i:i in [1..Ngens (H)]]));
{
    [1 0 0 0 0 0 0 0 0 0]
    [0 1 0 0 0 0 0 0 0 0]
    [0 0 1 0 0 0 0 0 0 0]
    [0 0 0 1 0 0 0 0 0 0]
    [0 0 0 0 1 0 0 0 0 0]
    [0 0 0 0 0 1 0 0 0 0]
    [0 0 0 0 0 0 1 0 0 0]
    [0 0 0 0 0 0 0 1 0 0]
    [0 0 0 0 0 0 0 0 1 0]
    [0 0 0 0 0 0 0 0 0 1]
}
```

Express the element $g$ of $G$ as a SLP on the generators of the nice group $H$. Then rewrite the SLP in terms of user generators for $G$.

```magma
> g := Random (G);
> f, w := CompositionTreeElementToWord (G, g);
> Evaluate (w, [H.i:i in [1..Ngens (H)]]) eq g;
true
>
> tau := CompositionTreeNiceToUser (G);
> tau;
Mapping from: GrpSLP: W to SLPGroup(4)
>
> v := tau (w);
> Evaluate (v, [G.i : i in [1..Ngens (G)]]) eq g;
true
```

Next test a random element of the generic group of $G$ for membership of $G$.

```magma
> x := Random (Generic (G));
> f, w := CompositionTreeElementToWord (G, x);
> f;
false
```

Finally, we construct a normal series for $G$.

```magma
> CS, _, _, _, flag := CompositionTreeSeries (G);
> "Series is composition series? ", flag;
Series is composition series?  true
> "Length is ", #CS;
Length is  78
```

<a id="lmg"></a>
<a id="sec-lmg"></a>
### The LMG functions

The LMG (large matrix group) functions are designed to provide a user-friendly interface to the `CompositionTree` package, and thereby enable the user to carry out a limited range of structural calculations in a matrix group that is too large for the use of BSGS methods.

By default, these methods have a small probability of failing or even of returning incorrect results. For most examples, at the cost of some extra time, the user can ensure that the computed results are verified as correct by calling `LMGInitialise` with the `Verify` flag on the group $G$ before calling any of the other functions. (Once `CompositionTree` or any of the LMG functions has been called on a group, further calls of `LMGInitialise` will have no effect.)

Let $G$ be a matrix group over a finite field. On the first call of any of the LMG functions on $G$, Magma decides whether it will use BSGS or Composition Tree based methods on $G$. It does this by carrying out a quick calculation to decide whether any of the basic orbit lengths would be larger than a constant `LMGSchreierBound`, which is set to 40000 by default, but can be changed by the user. If all basic orbit lengths are at most `LMGSchreierBound`, then BSGS methods are used on $G$, and the LMG functions are executed using the corresponding standard Magma functions. Otherwise, Composition Tree methods are used, starting with a call of `CompositionTree`$(G)$.

Composition Tree methods are also used if the user calls `CompositionTree` on the group before using th LMG functions, or if the user calls `LMGInitialize` with the `Al` option set to `"CompositionTree"`.

`SetVerbose("LMG", n)` with $n=1,2$ or 3 will provide increasing levels of information on the progress of the functions.

<a id="procedure-setlmgschreierbound-rngintelt"></a>
#### `SetLMGSchreierBound(n): RngIntElt`

Set the constant `LMGSchreierBound` to $n$.

<a id="procedure-lmginitialize-grpmat"></a>
#### `LMGInitialize(G : parameters): GrpMat`

<a id="procedure-lmginitialise-grpmat"></a>
#### `LMGInitialise(G : parameters): GrpMat`

```magma
Al                 : MonStgElt                    Default: ""
Verify             : BoolElt                      Default: false
RandomSchreierBound: RngIntElt                    Default: LMGSchreierBound
```

It is not normally necessary to call this function but, by setting the optional parameters, it can be used to initialise $G$ for LMG computations with a different value of `LMGSchreierBound` or, by setting `Al` to be `"CompositionTree"` (or `"CT"` or `"RandomSchreier"` (or `"RS"`), to force the use of either Composition Tree or BSGS methods on $G$.

If the `Verify` flag is set, then an attempt will be made to verify the correctness of the computed BSGS or Composition Tree. This will make the initialisation process slower, and for some groups the increased memory requirements will make verification impractical. In that case, a warning message is displayed.

<a id="function-lmgorder-grpmat-fldfin"></a>
#### `LMGOrder(G): GrpMat[FldFin] -> RngIntElt`

Given a matrix group $G$ defined over a finite field, this intrinsic returns the order of $G$.

<a id="function-lmgfactoredorder-grpmat-fldfin"></a>
#### `LMGFactoredOrder(G): GrpMat[FldFin] -> SeqEnum`

Given a matrix group $G$ defined over a finite field, this intrinsic returns the factored order of $G$.

<a id="function-lmgisin-grpmat-grpmatelt"></a>
#### `LMGIsIn(G, x): GrpMat, GrpMatElt -> BoolElt, GrpSLPElt`

Given a matrix group $G$ defined over a finite field $\F_q$, and an element $x$ of the generic overgroup $\GL(n,q)$ of $G$; if $x \in G$ then the intrinsic returns `true` and the corresponding element of `WordGroup(G)`; and `false` otherwise.

<a id="function-lmgissubgroup-grpmat-grpmat"></a>
#### `LMGIsSubgroup(G, H): GrpMat, GrpMat -> BoolElt`

Given a matrix group $G$ defined over a finite field $\F_q$, and a subgroup $H$ of the generic overgroup $\GL(n,q)$ of $G$, the intrinsic returns `true` if $H \le G$ and `false` otherwise.

<a id="function-lmgequal-grpmat-grpmat"></a>
#### `LMGEqual(G, H): GrpMat, GrpMat -> BoolElt`

Given a matrix groups $G$ and $H$ belonging to a common overgroup $\GL(n,q)$, the intrinsic returns `true` if $G$ and $H$ are equal and `false` otherwise.

<a id="function-lmgindex-grpmat-grpmat"></a>
#### `LMGIndex(G, H): GrpMat, GrpMat -> RngIntElt`

Given a matrix group $G$ defined over a finite field, and a subgroup $H$ of $G$, the intrinsic returns the index of $H$ in $G$.

<a id="function-lmgisnormal-grpmat-grpmat"></a>
#### `LMGIsNormal(G, H): GrpMat, GrpMat -> BoolElt`

Given a matrix group $G$ defined over a finite field, and a subgroup $H$ of $G$, the intrinsic returns `true` if $H$ is normal in $G$ and `false` otherwise.

<a id="function-lmgnormalclosure-grpmat-grpmat"></a>
#### `LMGNormalClosure(G, H): GrpMat, GrpMat -> GrpMat`

Given a matrix group $G$ defined over a finite field, and a subgroup $H$ of $G$, the intrinsic returns the normal closure of $H$ in $G$.

<a id="function-lmgderivedgroup-grpmat"></a>
#### `LMGDerivedGroup(G): GrpMat -> GrpMat`

Given a matrix group $G$ defined over a finite field, the intrinsic returns the derived subgroup of $G$.

<a id="function-lmgcommutatorsubgroup-grpmat-grpmat"></a>
#### `LMGCommutatorSubgroup(G, H): GrpMat, GrpMat -> GrpMat`

Let $g$ and $H$ be subgroups of $\GL(n,q)$. This intrinsic returns the commutator subgroup of $G$ and $H$ as a subgroup of $\GL(n,q)$.

<a id="function-lmgissoluble-grpmat"></a>
#### `LMGIsSoluble(G): GrpMat -> BoolElt`

<a id="function-lmgissolvable-grpmat"></a>
#### `LMGIsSolvable(G): GrpMat -> BoolElt`

Given a matrix group $G$ defined over a finite field, the intrinsic returns `true` if $G$ is soluble and `false` otherwise.

<a id="function-lmgisnilpotent-grpmat"></a>
#### `LMGIsNilpotent(G): GrpMat -> BoolElt`

Given a matrix group $G$ defined over a finite field, the intrinsic returns `true` if $G$ is nilpotent and `false` otherwise.

<a id="function-lmgcompositionseries-grpmat-fldfin"></a>
#### `LMGCompositionSeries(G): GrpMat[FldFin] -> SeqEnum`

Given a matrix group $G$ defined over a finite field, the intrinsic returns a composition series for $G$.

<a id="function-lmgcompositionfactors-grpmat-fldfin"></a>
#### `LMGCompositionFactors(G): GrpMat[FldFin] -> SeqEnum`

Given a matrix group $G$ defined over a finite field, the intrinsic returns the composition factors of $G$. The Handbook entry for `CompositionFactors(G)` of a finite group gives a detailed description of how to interpret the returned sequence.

<a id="function-lmgchiefseries-grpmat-fldfin"></a>
#### `LMGChiefSeries(G): GrpMat[FldFin] -> SeqEnum`

Given a matrix group $G$ defined over a finite field, the intrinsic returns a chief series for $G$.

<a id="function-lmgchieffactors-grpmat-fldfin"></a>
#### `LMGChiefFactors(G): GrpMat[FldFin] -> SeqEnum`

Given a matrix group $G$ defined over a finite field, the intrinsic returns the chief factors $G$. The Handbook entry for `ChiefFactors(G)` of a finite group gives a detailed description of how to interpret the returned sequence.

<a id="function-lmgunipotentradical-grpmat"></a>
#### `LMGUnipotentRadical(G): GrpMat -> GrpMat, GrpPC, Map`

Given a matrix group $G$ defined over a finite field, the intrinsic returns the unipotent radical $U$ of the matrix group $G$. A group $P$ of type `GrpPC` and an isomorphism $U \rightarrow P$ are also returned.

<a id="function-lmgsolubleradical-grpmat"></a>
#### `LMGSolubleRadical(G): GrpMat -> GrpMat, GrpPC, Map`

<a id="function-lmgsolvableradical-grpmat"></a>
#### `LMGSolvableRadical(G): GrpMat -> GrpMat, GrpPC, Map`

Given a matrix group $G$ defined over a finite field, the intrinsic returns the soluble radical $S$ of $G$. A group $P$ of type `GrpPC` and an isomorphism $S \rightarrow P$ are also returned.

<a id="function-lmgfittingsubgroup-grpmat"></a>
#### `LMGFittingSubgroup(G): GrpMat -> GrpMat, GrpPC, Map`

Given a matrix group $G$ defined over a finite field, the intrinsic returns the Fitting subgroup $S$ of $G$. A group $P$ of type `GrpPC` and an isomorphism $S \rightarrow P$ are also returned.

<a id="function-lmgcentre-grpmat"></a>
#### `LMGCentre(G): GrpMat -> GrpMat`

<a id="function-lmgcenter-grpmat"></a>
#### `LMGCenter(G): GrpMat -> GrpMat`

Given a matrix group $G$ defined over a finite field, the intrinsic returns the centre of $G$.

<a id="function-lmgsylow-grpmat-rngintelt"></a>
#### `LMGSylow(G, p): GrpMat, RngIntElt -> GrpMat`

Given a matrix group $G$ defined over a finite field, the intrinsic returns a Sylow $p$-subgroup of $G$.

<a id="function-lmgsoclestar-grpmat"></a>
#### `LMGSocleStar(G): GrpMat -> GrpMat`

Given a matrix group $G$ defined over a finite field, the intrinsic returns the inverse image in $G$ of the socle of $G/S$, where $S$ is the soluble radical of $G$.

<a id="function-lmgsoclestarfactors-grpmat"></a>
#### `LMGSocleStarFactors(G): GrpMat -> SeqEnum, SeqEnum`

Given a matrix group $G$ defined over a finite field, the intrinsic returns the simple direct factors of `LMGSocleStar(G)`/`LMGSolubleRadical(G)`, which may be represented projectively for large classical groups. A list of maps from the factors to $G$ is also returned.

<a id="function-lmgsoclestaraction-grpmat"></a>
#### `LMGSocleStarAction(G): GrpMat -> Map, GrpPerm, GrpMat`

Given a matrix group $G$ defined over a finite field, the intrinsic returns the map $\phi$ representing the conjugation action of $G$ on the simple direct factors of `LMGSocleStar(G)`/`LMGSolubleRadical(G)`. The image and kernel of $\phi$ are also returned.

<a id="function-lmgsoclestaractionkernel-grpmat"></a>
#### `LMGSocleStarActionKernel(G): GrpMat -> GrpMat, GrpPC, Map`

Given a matrix group $G$ defined over a finite field, this intrinsic returns three values. The first is the kernel of the conjugation action of $G$ on the simple direct factors of `LMGSocleStar(G)`/`LMGSolubleRadical(G)`. A group $P$ of type `GrpPC` isomorphic to `LMGSocleStarActionKernel(G)`/`LMGSocleStar(G)` and the epimorphism $G \rightarrow P$ are also returned.

<a id="function-lmgsoclestarquotient-grpmat"></a>
#### `LMGSocleStarQuotient(G): GrpMat -> GrpPerm, Map, GrpMat`

Given a matrix group $G$ defined over a finite field, the intrinsic returns the quotient group `G`/`LMGSocleStar(G)` represented as a permutation group, with associated epimorphism and kernel.

<a id="example-ex-533478"></a>
#### `Example: LMG Functions on a Maximal Subgroup (ex-533478)`

We apply the LMG functions to a maximal subgroup of ${\operatorname{SL}}(12, 5)$.

```magma
> SetVerbose("LMG", 1);
> C := ClassicalMaximals("L", 12, 5);
> G := C[4];
> LMGFactoredOrder(G);
RandomSchreierBound is 40000
Using CompositionTree on this group
Composition tree computed
Composition series has length 40
Order of group is:  27845944957511377275508129969239234924316406250000000000000\\
0000000000000000000
[ <2, 32>, <3, 7>, <5, 66>, <7, 1>, <11, 1>, <13, 3>, <31, 3>, <71, 1>, <313,
1>, <19531, 1> ]
> LMGChiefFactors(G);
Classifying composition factors
Defined PCGroup of solvable radical
Computed PCGroup of SocleKernel/SocleStar
    G
    |  Cyclic(2)
    *
    |  Cyclic(2)
    *
    |  A(3, 5)                = L(4, 5)
    *
    |  A(7, 5)                = L(8, 5)
    *
    |  Cyclic(2)
    *
    |  Cyclic(2)
    *
    |  Cyclic(2)
    *
    |  Cyclic(2)
    *
    |  Cyclic(5) (32 copies)
    1
> D := LMGDerivedGroup(G);
RandomSchreierBound is 40000
Using CompositionTree on this group
Composition tree computed
Composition series has length 38
Order of group is:  69614862393778443188770324923098087310791015625000000000000\\
000000000000000000
> LMGIndex(G, D);
4
> SetVerbose("LMG", 0);
> LMGEqual( LMGDerivedGroup(D), D );
true
> S := LMGSolubleRadical(G);
> LMGFactoredOrder(S);
[ <2, 4>, <5, 32> ]
> LMGIsSoluble(G);
false
> LMGIsSoluble(S);
true
> LMGIsNilpotent(S);
false
> #LMGCentre(G);
4
> #LMGCentre(S);
4
```

We carelessly used the standard Magma Order function in the above two commands, but it did not matter, because it was small. We will be more careful next time!

```magma
> F := LMGFittingSubgroup(G);
> LMGFactoredOrder( LMGCentre(F) );
[ <2, 2>, <5, 32> ]
> P := LMGSylow(G, 5);
> LMGFactoredOrder(P);
[ <5, 66> ]
> LMGEqual( D, LMGNormalClosure(G,P) );
true
> facs, maps := LMGSocleStarFactors(G);
> #facs;
2
> LMGChiefFactors(facs[1]);
    G
    |  A(7, 5)                = L(8, 5)
    *
    |  Cyclic(2)
    *
    |  Cyclic(2)
    1
```

Note that, for large classical groups, the socle-star factors are represented projectively.

```magma
> I := sub< Generic(G) | [ facs[2].i @ maps[2] : i in [1..Ngens(facs[2])] ] >;
> LMGChiefFactors( LMGNormalClosure(G, I) );
    G
    |  A(3, 5)                = L(4, 5)
    *
    |  Cyclic(2)
    *
    |  Cyclic(2)
    *
    |  Cyclic(2)
    *
    |  Cyclic(2)
    *
    |  Cyclic(5) (4 copies)
    *
    |  Cyclic(5) (4 copies)
    *
    |  Cyclic(5) (4 copies)
    *
    |  Cyclic(5) (4 copies)
    *
    |  Cyclic(5) (4 copies)
    *
    |  Cyclic(5) (4 copies)
    *
    |  Cyclic(5) (4 copies)
    *
    |  Cyclic(5) (4 copies)
    1
```

The remaining functions in this section will work only if a permutation representation can be computed for $G/L$, where $L$ is the soluble radical of $G$. Apart from `LMGRadicalQuotient` itself, they all operate by solving the problem first in $G/L$ and then lifting the solution through elementary abelian layers of $L$. Results are returned using the same formats as for other types of finite groups.

<a id="function-lmgradicalquotient-grpmat"></a>
#### `LMGRadicalQuotient(G): GrpMat -> GrpPerm, Map, GrpMat`

Given a matrix group $G$ defined over a finite field, the intrinsic returns a permutation group $P$ isomorphic to $G/L$, where $L$ is the soluble radical of $G$. An epimorphism $G \to P$ and its kernel $L$ are also returned.

Of course, this will only work if $G/L$ has such a representation of sufficiently small degree. This function is called implicitly as a first step in all of the remaining functions in this section.

<a id="function-lmgcentraliser-grpmat-grpmatelt"></a>
#### `LMGCentraliser(G, g): GrpMat, GrpMatElt -> GrpMat`

<a id="function-lmgcentralizer-grpmat-grpmatelt"></a>
#### `LMGCentralizer(G, g): GrpMat, GrpMatElt -> GrpMat`

Given a matrix group $G$ defined over a finite field, the intrinsic returns the centraliser in the matrix group $G$ of $g \in G$.

<a id="function-lmgisconjugate-grpmat-grpmatelt-grpmatelt"></a>
#### `LMGIsConjugate(G, g, h): GrpMat, GrpMatElt, GrpMatElt -> BoolElt, GrpMatElt`

Given a matrix group $G$ defined over a finite field, the intrinsic returns `true` if the elements $g,h$ in $G$ are conjugate. If so, a conjugating element will also be returned.

<a id="function-lmgclasses-grpmat"></a>
#### `LMGClasses(G): GrpMat -> SeqEnum`

<a id="function-lmgconjugacyclasses-grpmat"></a>
#### `LMGConjugacyClasses(G): GrpMat -> SeqEnum`

Given a matrix group $G$ defined over a finite field, the intrinsic returns the conjugacy classes of $G$.

<a id="function-lmgnormaliser-grpmat-grpmat"></a>
#### `LMGNormaliser(G, H): GrpMat, GrpMat -> GrpMat`

<a id="function-lmgnormalizer-grpmat-grpmat"></a>
#### `LMGNormalizer(G, H): GrpMat, GrpMat -> GrpMat`

Given a matrix group $G$ defined over a finite field, and a subgroup $H$ of $G$, the intrinsic returns the normaliser of $H$ in $G$.

<a id="function-lmgisconjugate-grpmat-grpmat-grpmat"></a>
#### `LMGIsConjugate(G, H, K): GrpMat, GrpMat, GrpMat -> BoolElt, GrpMatElt`

Given a matrix group $G$ defined over a finite field, and subgroups $H$ and $K$ of $G$, the intrinsic returns `true` if the subgroups $H$ and $K$ are conjugate in $G$. If so, a conjugating element will also be returned.

<a id="function-lmgmeet-grpmat-grpmat-grpmat"></a>
#### `LMGMeet(G, H, K): GrpMat, GrpMat, GrpMat -> GrpMat`

Given a matrix group $G$ defined over a finite field, and subgroups $H$ and $K$ of $G$, the intrinsic returns their intersection.

<a id="function-lmgmaximalsubgroups-grpmat"></a>
#### `LMGMaximalSubgroups(G): GrpMat -> SeqEnum`

Given a matrix group $G$ defined over a finite field, the intrinsic returns a list of subgroup records defining representatives of the conjugacy classes of maximal subgroups of $G$.

<a id="function-lmgnormalsubgroups-grpmat"></a>
#### `LMGNormalSubgroups(G): GrpMat -> SeqEnum`

Given a matrix group $G$ defined over a finite field, the intrinsic returns a list of subgroup records defining the normal subgroups of $G$.

<a id="function-lmglowindexsubgroups-grpmat-rngintelt"></a>
#### `LMGLowIndexSubgroups(G, n): GrpMat, RngIntElt -> SeqEnum`

Given a matrix group $G$ defined over a finite field, the intrinsic returns a list of representatives of the conjugacy classes of subgroups of index at most $n$ in $G$.

<a id="function-lmgcosetaction-grpmat-grpmat"></a>
#### `LMGCosetAction(G, H : parameters): GrpMat, GrpMat -> Map, GrpPerm, GrpMat`

```magma
ker: BoolElt                    Default: true
```

Given a subgroup $H$ of a matrix group $G$ defined over a finite field, return the homomorphism $f:G \to P$ defining the action of $G$ by multiplication on the right cosets of $H$ in $G$. The image $P$ (a permutation group) and the kernel of $f$ are also returned.

If the optional parameter `ker` is set to `false` then the kernel of $f$ is not computed.

A right transversal of $H$ in $G$, in which the ordering corresponds to the order on the points permuted by $P$, is computed at the same time, and this can be accessed by calling `LMGRightTransversal(G,H : ca:=f)`.

<a id="function-lmgcosetimage-grpmat-grpmat"></a>
#### `LMGCosetImage(G, H): GrpMat, GrpMat -> GrpPerm`

Given a subgroup $H$ of a matrix group $G$ defined over a finite field, return the image $P$ of the homomorphism $f:G \to P$ defining the action of $G$ by multiplication on the right cosets of $H$ in $G$.

<a id="function-lmgcosetactioninverseimage-grpmat-map-rngintelt"></a>
#### `LMGCosetActionInverseImage(G, f, i): GrpMat, Map, RngIntElt -> GrpMatElt`

The map $f$ should be the result of a call of `LMGCosetAction` on some subgroup of the matrix group $G$. An element of $g \in G$ for which $1^{f(g)} = i$ is returned.

<a id="function-lmgrighttransversal-grpmat-grpmat"></a>
#### `LMGRightTransversal(G, H : parameters): GrpMat, GrpMat -> SeqEnum`

```magma
ca: Map                    Default: 
```

Given a subgroup $H$ of a matrix group $G$ defined over a finite field, return a right transversal of $H$ in $G$. The optional parameter `ca` should be the map returned by `LMGCosetAction(G,H)`, and if this option is used then the elements in the transversal will be ordered in the same way as the points permuted by the image of `ca`.

<a id="function-lmgisprimitive-grpmat"></a>
#### `LMGIsPrimitive(G): GrpMat -> BoolElt`

Decide whether matrix group $G$ defined over a finite field is primitive.

<a id="function-lmgcharactertable-grpmat"></a>
#### `LMGCharacterTable(G : parameters): GrpMat -> SeqEnum`

Compute the character table of the matrix group $G$, using LMG functions for the calculations within the group. The overall method is as for the standard `CharacterTable` command.

<a id="example-ex-fa2be2"></a>
#### `Example: Classes and Characters of the Dempwolff Group (ex-fa2be2)`

We apply the LMG classes and character table functions to the Dempwolff Group. We will use `LMGInitialize` to force use of the composition tree methods.

```magma
> G := MatrixGroup(ATLASGroup("25L52"));
> G:Minimal;
MatrixGroup(69, GF(2)) of order 2^15 * 3^2 * 5 * 7 * 31
> LMGInitialize(G:Al := "CT");
> LMGChiefFactors(G);
  G
  |  A(4, 2)                    = L(5, 2)
  *
  |  Cyclic(2) (5 copies)
  1
> time cl := LMGClasses(G);
#Warning: we will need to find a perm rep of the radical quotient!
#Found perm rep of the radical quotient of degree 31
Time: 0.750
> #cl;
41
> time X := LMGCharacterTable(G);
Time: 4.510
> {* Degree(x): x in X *};
{* 1, 30, 124, 155, 217, 248, 280, 315^^6, 465^^4, 496,
651^^3, 744^^2, 868, 930^^3, 960, 1024, 1240, 1488, 1736^^4,
1984, 3720^^3, 11160^^2 *}
> &+[d^2 : d in $1] eq #G;
true
```

<a id="findbase"></a>
<a id="sec-findbase"></a>
### Finding a Base

If the radical quotient $Q$ of the matrix group $G$ over a finite field has been successfully computed using `RadicalQuotient` or `LMGRadicalQuotient`, then $Q$ and the associated homomorphism $Q \to Q$ can be used to look for a base for $G$ (see [Base and Strong Generating Set](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/BSGS-base-strong-generator.md#sec-bsgs)). This will typically make further structural computations with $G$ either possible (if they were not possible without a base) or more efficient. Even if a base is already known, the new base computed may be better: it will often have shorter associated basic orbit lengths, for example.

<a id="function-lmgbase-grpmat"></a>
#### `LMGBase(G : parameters): GrpMat -> Tup, SeqEnum, SeqEnum`

```magma
SetBase: BoolElt                      Default: true
DimLim : RngIntElt                    Default: 0
Print  : RngIntElt                    Default: 0
```

Use the radical quotient $Q$ of $G$ and associated homomorphism $G \to Q$ to find a base for $G$. return the base `B`, the sequence `BDim` of dimensions of the subspaces (or vectors, assigned dimension $1$) in $B$, and the sequence `BOL` of associated basic orbit lengths. If no base is found then ane empty tuple and sequences are returned.

If the parameter `SetBase` is `true` and a base `B` is found, then the `Base` attribute for $G$ is set to `B`, and so this base will be used for all subsequent calculations.

The parameter `DimLim` is a limit on the dimensions of subspaces that will be considered as possible base points. The default is half od the dimension of $G$. Subspaces of large dimension in a base can result in slower subsequent calculations but, on the other hand, restricting the dimension can result in a base with longer basic orbit lengths, so it can be difficult to find the right balance. If is important to find an optimal base (because it will be used for lengthy subsequent calculations) then it is worthwhile running `LMGBase` several times with different values of `DimLim` to try and get the best possible result.

As an example, we compute a base of a group from the ATLAS database.

<a id="example-ex-c9a7be"></a>
#### `Example: Base of a Large Matrix Group (ex-c9a7be)`

```magma
> G := MatrixGroup("6M22",1);
> G:Minimal;
MatrixGroup(66, GF(5^2)) of order 2^8 * 3^3 * 5 * 7 * 11
> B, BDim, BOL := LMGBase(G);
> BDim, BOL;
[ 6, 6, 6, 6, 6, 1 ]
[ 22, 21, 20, 16, 3, 6 ]
> B, BDim, BOL := LMGBase(G : DimLim := 1);
> BDim, BOL;
[ 1, 1, 1, 1 ]
[ 672, 66, 10, 6 ]
```

Note that the default methods for computing a base of this group usually result in much longer basic orbit lengths (but this varies from run to run).

```magma
> G := MatrixGroup("6M22",1);
> BSGS(G);
> BasicOrbitLengths(G);
[ 3696, 6, 60, 2 ]
```

<a id="unippc"></a>
<a id="sec-unippc"></a>
### Unipotent Matrix Groups

The *power-conjugate presentation* is a very efficient way of representing a unipotent group; see Chapter [Finite Soluble Groups](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/index-finite-soluble-groups.md#chapgrppc) for more information. In this section we describe a number of functions for finding such a *PC-presentation* for a unipotent matrix group defined over a finite field.

The algorithm used is a straightforward echelonisation-like procedure.

<a id="function-unipotentmatrixgroup-grpmat"></a>
#### `UnipotentMatrixGroup(G): GrpMat -> GrpMatUnip`

Given a matrix group $G$ defined over a finite field, the intrinsic constructs a known unipotent matrix group from $G$. Note that Magma does not at this stage check that $G$ is in fact unipotent.

<a id="function-wordmap-grpmatunip"></a>
#### `WordMap(G): GrpMatUnip -> Map`

Given a unipotent matrix group $G$ defined over a finite field, the intrinsic constructs the *word map* for $G$. The word map is a map from $G$ to the group of straight-line programs on $n$ generators, where $n$ is the number of generators of $G$. More information on SLP-groups may be found in Chapter [Groups of Straight-Line Programs](https://docs.magma-maths.org/FinitelyPresentedGroups/GroupsOfStraightLinePrograms/index-groups-of-straight-line-programs.md#chapgrpslp).

<a id="example-ex-30af78"></a>
#### `Example: Word Map of a Unipotent Group (ex-30af78)`

We construct a unipotent matrix group, and use the word map.

```magma
> G := MatrixGroup<4, GF(5) | [1,1,0,0, 0,1,0,0, 0,0,1,0, 0,0,0,1],
>       [1,-1,0,0, 0,1,1,0, 0,0,1,0, 0,0,0,1]>;
> G;
MatrixGroup(4, GF(5))
Generators:
    [1 1 0 0]
    [0 1 0 0]
    [0 0 1 0]
    [0 0 0 1]

    [1 4 0 0]
    [0 1 1 0]
    [0 0 1 0]
    [0 0 0 1]
> IsUnipotent(G);
true
>
> G := UnipotentMatrixGroup(G);
> g := GL(4,5)![1,4,4,0, 0,1,3,0, 0,0,1,0, 0,0,0,1];
> g in G;
true
> phi := WordMap(G);
> phi;
Mapping from: GL(4, GF(5)) to SLPGroup(2) given by a rule [no inverse]
>
> assert g in G;
> wg := phi(g); wg;
function(G)
    w6 := G.1^4; w1 := G.1^-4; w2 := G.2 * w1; w7 := w2^3; w8 := w6 *
    w7; w3 := G.1^-1; w4 := G.1^w2; w5 := w3 * w4; w9 := w5^2; w10 :=
    w8 * w9; return w10;
end function
> Evaluate(wg, G);
[1 4 4 0]
[0 1 3 0]
[0 0 1 0]
[0 0 0 1]
> Evaluate(wg, G) eq g;
true
```

<a id="function-pcpresentation-grpmatunip"></a>
#### `PCPresentation(G): GrpMatUnip -> GrpPC, Map, Map`

Given a unipotent matrix group $G$ defined over a finite field, the intrinsic constructs a PC-presentation for $G$. It returns a finite soluble group $H$ as first return value, a map from $G$ to $H$ as the second value, and a map from $H$ to $G$ as the third.

<a id="function-order-grpmatunip"></a>
#### `Order(G): GrpMatUnip -> RngIntElt`

<a id="operation-operation-grpmatunip-rngintelt"></a>
#### `# G: GrpMatUnip -> RngIntElt`

<a id="function-factoredorder-grpmatunip"></a>
#### `FactoredOrder(G): GrpMatUnip -> [ <RngIntElt, RngIntElt> ]`

Given a unipotent matrix group $G$ defined over a finite field, this intrinsic returns the order of $G$ as an integer or as a factored integer (depending upon the choice of intrinsic). It is faster than the standard matrix group order intrinsic because of the use of the PC-presentation of $G$.

<a id="operation-op-in-grpmatelt-grpmatunip"></a>
#### `g in G: GrpMatElt, GrpMatUnip -> BoolElt`

Given a matrix $g$ and a unipotent matrix group $G$ defined over a finite field, the intrinsic returns `true` if $g$ is an element of $G$, and `false` otherwise. It is faster than the standard matrix group membership intrinsic because of the use of the PC-presentation of $G$.

<a id="example-ex-f568e8"></a>
#### `Example: Pc-Presentation of a Unipotent Group (ex-f568e8)`

We construct the PC-presentation of some Sylow subgroup and demonstrate the use of the `FactoredOrder` function.

```magma
> G := UnipotentMatrixGroup(ClassicalSylow(GL(9,7), 7));
> H,phi,psi := PCPresentation(G);
> phi;
Mapping from: GrpMatUnip: G to GrpPC: H given by a rule [no inverse]
> psi;
Mapping from: GrpPC: H to GrpMatUnip: G
> phi(G.2);
H.9
> psi(H.3);
[1 0 0 0 0 0 0 0 0]
[0 1 0 0 0 0 0 0 0]
[0 0 1 1 0 0 0 0 0]
[0 0 0 1 0 0 0 0 0]
[0 0 0 0 1 0 0 0 0]
[0 0 0 0 0 1 0 0 0]
[0 0 0 0 0 0 1 0 0]
[0 0 0 0 0 0 0 1 0]
[0 0 0 0 0 0 0 0 1]
> FactoredOrder(G);
[ <7, 36> ]
```

<a id="matrix-group-inf"></a>
<a id="grpmatinf"></a>
## Matrix Groups over Infinite Fields

- [Overview](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverInfiniteFields/Overview.md)
- [Construction of Congruence Homomorphisms](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverInfiniteFields/congruence.md)
  - [`CongruenceImage(G : parameters): GrpMat → GrpMat, HomGrp, []`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverInfiniteFields/congruence.md#function-congruenceimage-grpmat)
- [Testing Finiteness](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverInfiniteFields/finite-test.md)
  - [`IsFinite(G : parameters): GrpMat → BoolElt, RngIntElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverInfiniteFields/finite-test.md#function-isfinite-grpmat)
  - [`IsomorphicCopy(G : parameters): GrpMat → BoolElt, GrpMat, HomGrp`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverInfiniteFields/finite-test.md#function-isomorphiccopy-grpmat)
  - [`Order(G : parameters): GrpMat → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverInfiniteFields/finite-test.md#function-order-grpmat)
- [Deciding Virtual Properties of Linear Groups](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverInfiniteFields/virtual_tests.md)
  - [`IsSolubleByFinite(G : parameters): GrpMat → BoolElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverInfiniteFields/virtual_tests.md#function-issolublebyfinite-grpmat)
  - [`IsPolycyclicByFinite(G : parameters): GrpMat → BoolElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverInfiniteFields/virtual_tests.md#function-ispolycyclicbyfinite-grpmat)
  - [`IsNilpotentByFinite(G : parameters): GrpMat → BoolElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverInfiniteFields/virtual_tests.md#function-isnilpotentbyfinite-grpmat)
  - [`IsAbelianByFinite(G : parameters): GrpMat → BoolElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverInfiniteFields/virtual_tests.md#function-isabelianbyfinite-grpmat)
  - [`IsCentralByFinite(G : parameters): GrpMat → BoolElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverInfiniteFields/virtual_tests.md#function-iscentralbyfinite-grpmat)
- [Hirsch Number and Prüfer Rank](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverInfiniteFields/hirsch_rank.md)
  - [`HasFiniteRank(G): GrpMat → BoolElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverInfiniteFields/hirsch_rank.md#function-hasfiniterank-grpmat)
  - [`HirschNumber(G): GrpMat → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverInfiniteFields/hirsch_rank.md#function-hirschnumber-grpmat)
  - [`HasFiniteIndex(G, H): GrpMat, GrpMat → BoolElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverInfiniteFields/hirsch_rank.md#function-hasfiniteindex-grpmat-grpmat)
  - [`PrueferRankBound(G): GrpMat → BoolElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverInfiniteFields/hirsch_rank.md#function-prueferrankbound-grpmat)
- [Other Properties of Linear Groups](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverInfiniteFields/other-properties.md)
  - [`IsCompletelyReducible(G : parameters): GrpMat → BoolElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverInfiniteFields/other-properties.md#function-iscompletelyreducible-grpmat)
  - [`CompletelyReduciblePart(G): GrpMat → GrpMat, GrpMatElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverInfiniteFields/other-properties.md#function-completelyreduciblepart-grpmat)
  - [`IsUnipotent(G): GrpMat → BoolElt, GrpMatElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverInfiniteFields/other-properties.md#function-isunipotent-grpmat)
  - [`IsNilpotent(G): GrpMat → BoolElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverInfiniteFields/other-properties.md#function-isnilpotent-grpmat)
  - [`IsSoluble(G : parameters): GrpMat → BoolElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverInfiniteFields/other-properties.md#function-issoluble-grpmat)
  - [`IsPolycyclic(G : parameters): GrpMat → BoolElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverInfiniteFields/other-properties.md#function-ispolycyclic-grpmat)
  - [`HasFiniteOrder(g : parameters ): GrpMatElt → BoolElt, RngIntElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverInfiniteFields/other-properties.md#function-hasfiniteorder-grpmatelt)
- [Other Functions for Nilpotent Matrix Groups](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverInfiniteFields/nilpotent_groups.md)
  - [`RecogniseAbelian(G): GrpMat → GrpGPC, Map, Map`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverInfiniteFields/nilpotent_groups.md#function-recogniseabelian-grpmat)
  - [`SylowSystem(G : parameters): GrpMat[FldFin] → []`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverInfiniteFields/nilpotent_groups.md#function-sylowsystem-grpmat-fldfin)
  - [`IsIrreducibleFiniteNilpotent(G : parameters): GrpMat → BoolElt, Any`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverInfiniteFields/nilpotent_groups.md#function-isirreduciblefinitenilpotent-grpmat)
  - [`IsPrimitiveFiniteNilpotent(G : parameters): GrpMat → BoolElt, Any`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverInfiniteFields/nilpotent_groups.md#function-isprimitivefinitenilpotent-grpmat)
- [Examples](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverInfiniteFields/examples.md)
  - [Example: Finite Group over a Rational Function Field](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverInfiniteFields/examples.md#example-ex-3405c0)
  - [Example: Finite Group in Characteristic 5](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverInfiniteFields/examples.md#example-ex-eadd93)
  - [Example: Infinite Group in Characteristic 5](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverInfiniteFields/examples.md#example-ex-b89ce7)
  - [Example: Infinite Integral Matrix Group](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverInfiniteFields/examples.md#example-ex-83679b)
  - [Example: Infinite Group over a Quadratic Field](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverInfiniteFields/examples.md#example-ex-cd9712)
  - [Example: Infinite Group over a Quartic Number Field](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverInfiniteFields/examples.md#example-ex-d1ef57)
  - [Example: Group over an Algebraic Function Field](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverInfiniteFields/examples.md#example-ex-e6bb73)
  - [Example: Finite Group in Characteristic 2](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverInfiniteFields/examples.md#example-ex-b2fc02)
  - [Example: Hirsch Number and Finite Index](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverInfiniteFields/examples.md#example-ex-65cc00)
  - [Example: Completely Reducible Part of a Group](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverInfiniteFields/examples.md#example-ex-b02d39)
  - [Example: Imprimitive Finite Nilpotent Group](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverInfiniteFields/examples.md#example-ex-1259d9)
  - [Example: Recognising an Abelian Matrix Group](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverInfiniteFields/examples.md#example-ex-a460de)
  - [Example: Sylow System of a Nilpotent Group](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverInfiniteFields/examples.md#example-ex-644306)
  - [Example: Infinite Nilpotent Group over a Function Field](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverInfiniteFields/examples.md#example-ex-8207b7)
- [Bibliography](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverInfiniteFields/bibliography.md)

### Overview

In this chapter we provide algorithms for computing with a group $G$ given by a finite set $S = \{ g_1, \ldots, g_r \}$ of invertible $n \times n$ matrices over an infinite field $K$. The algorithms are based on special techniques developed for computing in this class of groups ([[DEF11](https://docs.magma-maths.org/references.md#cite-def-survey), [DF08](https://docs.magma-maths.org/references.md#cite-draft), [DF09](https://docs.magma-maths.org/references.md#cite-zero), [DFO09](https://docs.magma-maths.org/references.md#cite-positive), [DFO11](https://docs.magma-maths.org/references.md#cite-tits), [DFO13a](https://docs.magma-maths.org/references.md#cite-rank), [DFO13b](https://docs.magma-maths.org/references.md#cite-recog)]), which rely on properties of finitely generated linear groups.

The group $G$ is defined over the subring $R$ of $K$ generated by the entries of the matrices $g_i, {g_i}^{-1}$ , $1 \leq i \leq r$. If $\rho$ is an ideal of $R$, then it induces a congruence homomorphism from $GL(n, R)$ onto $GL(n, R/\rho)$, which replaces every entry of an element in $S$ by its image in $R/\rho$. Our techniques depend on the construction of a congruence homomorphism with the property that all torsion elements of its kernel $G_{\rho}$ (called a congruence subgroup) are unipotent. The existence of a normal subgroup of finite index in $G$ with such a property was proved by Selberg and Wehrfritz. One advantage of the congruence homomorphism techniques is that they replace the ground domain by a domain that is more convenient for computing. In particular, if the ideal $\rho$ is maximal, then we get a reduction to a finite field $R/\rho$. For more details on the method see [[DF08](https://docs.magma-maths.org/references.md#cite-draft), Section 3].

In this chapter we provide four sets of functions based on the above techniques.

(a) Functions which test finiteness of matrix groups over a wide range of infinite domains. These functions are implementations of algorithms developed in [[DF09](https://docs.magma-maths.org/references.md#cite-zero), [DFO09](https://docs.magma-maths.org/references.md#cite-positive), [DFO13b](https://docs.magma-maths.org/references.md#cite-recog)]. Together with other currently available algorithms for deciding finiteness, they enable testing finiteness of a finitely generated linear group over an arbitrary field (subject to special representation of input data). Additionally, if a group is found to be finite, then we can construct an isomorphic copy over a finite field, and use that for further structural investigation of the group.

(b) Functions for testing various properties of infinite matrix groups. These functions test whether $G$ is soluble-by-finite or soluble, nilpotent-by-finite or nilpotent, abelian-by-finite, or central-by-finite. In effect, they provide access to the first publicly available implementations of algorithms to decide the “Tits alternative” for a linear group. If $G$ is soluble-by-finite we can test whether it is completely reducible. These functions are implementations of algorithms developed in [[DFO11](https://docs.magma-maths.org/references.md#cite-tits)].

(c) Functions to decide whether a soluble-by finite group $G$ defined over $Q$ or a number field has finite rank, to determine its Hirsch number, and to decide if a subgroup of $G$ has finite index. These functions are implementations of algorithms developed in [[DFO13a](https://docs.magma-maths.org/references.md#cite-rank)].

(d) Functions for testing nilpotency and computing with nilpotent matrix groups. These functions are implementation of algorithms developed in [[DF08](https://docs.magma-maths.org/references.md#cite-draft)], which in turn are based on algorithms in [[DF06](https://docs.magma-maths.org/references.md#cite-large)] for computing with nilpotent matrix groups over finite fields. The functions may also be used for investigating the structure of nilpotent matrix groups. In particular, special algorithms have been developed for deciding finiteness of nilpotent matrix groups. Functions are also available to decide irreducibility and primitivity for finite nilpotent matrix groups over number fields and function fields in zero characteristic; these algorithms, developed and implemented by Tobias Rossmann, are described in [[Ros10](https://docs.magma-maths.org/references.md#cite-ros10a), [Ros11](https://docs.magma-maths.org/references.md#cite-ros10b)].

Since $G$ is finitely generated, it is defined over a finitely generated subfield of $K$. Hence, the main fields to be considered are finite degree extensions of $F(x_1, \ldots, x_m)$, where the $x_1, \ldots, x_m$ are algebraically independent indeterminates, $m \geq 0$, and the coefficient field $F$ is an number field or a finite field.

For a recent survey of work in the area of computing with matrix groups over infinite fields, we refer to [[DEF11](https://docs.magma-maths.org/references.md#cite-def-survey)].

Verbose output for these functions can be obtained with `SetVerbose ("Infinite", 1);`

### Construction of Congruence Homomorphisms

In this section, $K$ is a finite degree extension of $F(x_1, \ldots, x_m)$, where $F$ is $Q$, a number field, or a finite field. Also $m \geq 0$ if char $F$ = 0, and $m > 0$ otherwise.

<a id="function-congruenceimage-grpmat"></a>
#### `CongruenceImage(G : parameters): GrpMat -> GrpMat, HomGrp, []`

```magma
Virtual  : BoolElt                      Default: false
Prime    : RngIntElt                    Default: 3
Limit    : RngIntElt                    Default: 10
ExtDegree: RngIntElt                    Default: 1
```

If $G$ is a finitely generated subgroup of ${\operatorname{GL}}(n, K)$, then $G$ has a normal subgroup $N$ whose torsion elements are unipotent; so $N$ is torsion-free if $K$ has characteristic 0.

This function constructs a *congruence homomorphism* from $G$ into ${\operatorname{GL}}(n, {\bf F}_{q})$ for some prime power $q$; its kernel is $N$. If char $K$ is positive, then ${\bf F}_{q}$ has the same characteristic.

For a detailed description of the congruence homomorphisms see [[DFO13b](https://docs.magma-maths.org/references.md#cite-recog), Section 3]. The function returns the congruence image $H$, the congruence homomorphism, and the list of images of generators of $G$.

If the optional parameter `Virtual` is set to `true` then the congruence homomorphism satisfies additional properties [[DFO11](https://docs.magma-maths.org/references.md#cite-tits)]. In particular it can be used to test whether $G$ satisfies the “virtual” properties described in Section [Deciding Virtual Properties of Linear Groups](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverInfiniteFields/virtual_tests.md#virtual).

The optional parameter `Prime` applies if $K$ has characteristic 0: if `Prime` is positive, then it is a lower bound for the characteristic of the congruence image; if it is 0 then the function returns a congruence image defined over a field of characteristic 0.

The optional parameter `Limit` applies to groups defined over (rational) function fields. If char $K > 0$, then we consider extensions of $F$ to degree `Limit` only; otherwise we examine tuples in the ring of integers mod `Limit`.

The optional parameter `ExtDegree` applies to groups defined over (algebraic) function fields of positive characteristic: we construct a congruence image over an extension of (at least) this degree of coefficient field.

### Testing Finiteness

In this section, $K$ is a finite degree extension of the field $F(x_1, \ldots, x_m)$, where $F$ is $Q$, a number field, or a finite field. Also $m \geq 0$ if char $F = 0$, and $m > 0$ otherwise.

<a id="function-isfinite-grpmat"></a>
#### `IsFinite(G : parameters): GrpMat -> BoolElt, RngIntElt`

```magma
NumberRandom  : RngIntElt                    Default: 10
Presentation  : MonStgElt                    Default: "CT"
Small         : RngIntElt                    Default: 10^6
OrderLimit    : RngIntElt                    Default: 10^15
Algebra       : BoolElt                      Default: true
Nilpotent     : BoolElt                      Default: false
UseCongruence : BoolElt                      Default: false
DetermineOrder: BoolElt                      Default: false
Prime         : RngintElt                    Default: 3
```

Let $G$ be a finitely generated subgroup of ${\operatorname{GL}}(n, K)$. If $G$ is finite then the function returns `true`, otherwise `false`. The function is an implementation of algorithms from [[DF08](https://docs.magma-maths.org/references.md#cite-draft), [DF09](https://docs.magma-maths.org/references.md#cite-zero), [DFO09](https://docs.magma-maths.org/references.md#cite-positive), [DFO13b](https://docs.magma-maths.org/references.md#cite-recog)].

The algorithm first tests whether `NumberRandom` random elements of $G$ have finite order.

If the optional parameter `Algebra` is `true` and $K$ is a function field of characteristic zero (resp. positive characteristic), then we use the “algebra algorithm” of [[DF09](https://docs.magma-maths.org/references.md#cite-zero)] (resp. [[DFO09](https://docs.magma-maths.org/references.md#cite-positive)]) to decide finiteness.

Otherwise, we prove that $G$ is finite by first constructing a congruence homomorphism, then a presentation for the congruence image, and finally evaluates its relations to obtain normal generators for the congruence kernel. If char $K = 0$, then the kernel should be trivial, otherwise the kernel is unipotent.

The optional parameter `Presentation` is used to dictate how the presentation is constructed. If its value is “CT”, then we use the presentation provided by `CompositionTreeVerify`. If its value is “PC” and the image is soluble, then we use a PC-presentation provided by `LMGSolubleRadical`. If its value is “FP” then we use the presentation provided by `FPGroup` or `FPGroupStrong`. If the order of the congruence image is less than the value of the optional argument `Small`, then we use `FPGroup` to construct the presentation; if it is less than the value of the optional argument `OrderLimit`, then we use `FPGroupStrong` to construct the presentation; otherwise we use the presentation provided by `CompositionTreeVerify`.

If $K$ is $Q$ or a number field and `UseCongruence` is `true`, then use congruence homomorphism machinery to decide; otherwise use default algorithm.

If $G$ is known to be nilpotent then by setting the optional parameter `Nilpotent` to `true`, the function will call a special procedure for testing finiteness of nilpotent groups (see [[DF08](https://docs.magma-maths.org/references.md#cite-draft), Section 4.3]).

If the optional parameter `DetermineOrder` is set to `true`, and $G$ is finite, then the function returns the order of $G$. This may sometimes be more expensive than deciding finiteness.

The optional parameter `Prime` applies if $K$ has characteristic 0: if `Prime` is positive, then it is a lower bound for the characteristic of the congruence image; if it is 0 then the function constructs a congruence image defined over a field of characteristic 0.

<a id="function-isomorphiccopy-grpmat"></a>
#### `IsomorphicCopy(G : parameters): GrpMat -> BoolElt, GrpMat, HomGrp`

```magma
Presentation       : MonStgElt                    Default: "CT"
Small              : RngIntElt                    Default: 10^6
OrderLimit         : RngIntElt                    Default: 10^15
Verify             : BoolElt                      Default: false
Algebra            : BoolElt                      Default: false
StartDegree        : RngIntElt                    Default: 1
EndDegree          : RngIntElt                    Default: 5
CompletelyReducible: BoolElt                      Default: false
```

The input is a finite subgroup $G$ of ${\operatorname{GL}}(n, K)$. If the function succeeds, then it returns `true` and an isomorphic copy of $G$ in ${\operatorname{GL}}(n,{\bf F}_{q})$ where $q$ is a prime power; otherwise it returns `false`. A description of the method used is in [[DFO13b](https://docs.magma-maths.org/references.md#cite-recog), Section 4.3]. If char $K > 0$, then ${\bf F}_{q}$ has the same characteristic. Note that the function always succeeds if $K$ has zero characteristic.

If the optional parameter `Algebra` is `true` and $K$ is a function field of characteristic zero (resp. positive characteristic), then we use the “algebra algorithm” of [[DF09](https://docs.magma-maths.org/references.md#cite-zero)] (resp. [[DFO09](https://docs.magma-maths.org/references.md#cite-positive)]) to construct an isomorphic copy.

Otherwise we prove that a congruence homomorphism is an isomorphism by constructing a presentation for the congruence image and evaluating its relations to obtain normal generators for the congruence kernel.

The optional parameter `Presentation` is used to dictate how the presentation is constructed. If its value is “CT”, then we use the presentation provided by `CompositionTreeVerify`. If its value is “PC” and the image is soluble, then we use a PC-presentation provided by `LMGSolubleRadical`. If its value is “FP” then we use the presentation provided by `FPGroup` or `FPGroupStrong`. If the order of the congruence image is less than the value of the optional argument `Small`, then we use `FPGroup` to construct the presentation; if it is less than the value of the optional argument `OrderLimit`, then we use `FPGroupStrong` to construct the presentation; otherwise we use the presentation provided by `CompositionTreeVerify`.

If the optional parameter `Verify` is set to `true` then we first check whether $G$ is finite.

If the characteristic of the coefficient field $F$ is positive, then we investigate extensions of $F$ in the range `StartDegree` $\ldots$ `EndDegree`.

If the optional parameter `CompletelyReducible` is set to `true` then we use a more efficient algorithm to construct the isomorphic copy.

<a id="function-order-grpmat"></a>
#### `Order(G : parameters): GrpMat -> RngIntElt`

```magma
Verify       : BoolElt                    Default: false
UseCongruence: BoolElt                    Default: false
```

Given a finite subgroup $G$ of ${\operatorname{GL}}(n,K)$, the function returns the order of $G$ by applying `IsomorphicCopy` to $G$.

If the optional parameter `Verify` is set to `true`, then we first check that $G$ is finite.

If $K$ is $Q$ or a number field and `UseCongruence` is `true`, then use congruence homomorphism machinery to decide; otherwise use default algorithm.

<a id="virtual-tests"></a>
<a id="virtual"></a>
### Deciding Virtual Properties of Linear Groups

In this section, $K$ is a finite degree extension of $F(x_1, \ldots, x_m)$, where $F$ is $Q$, a number field, or a finite field. Also $m \geq 0$ if char $F = 0$, and $m > 0$ otherwise.

We describe algorithms to decide various “virtual” properties of a finitely generated linear group over an infinite field. Details of the algorithms can be found in [[DFO11](https://docs.magma-maths.org/references.md#cite-tits)].

<a id="function-issolublebyfinite-grpmat"></a>
#### `IsSolubleByFinite(G : parameters): GrpMat -> BoolElt`

```magma
Presentation     : MonStgElt                    Default: "CT"
OrderLimit       : RngIntElt                    Default: 10^15
Small            : RngIntElt                    Default: 10^6
NeedChangeOfBasis: BoolElt                      Default: false
```

This function takes as input a finitely generated matrix group $G$ over $K$, and tests whether $G$ is soluble-by-finite. If so, it returns `true`, otherwise `false`. Note that currently the function is valid only for $p>n$ if $K$ has characteristic $p>0$.

The algorithm first constructs a congruence homomorphism, then a presentation for the congruence image, and finally evaluates its relations to obtain normal generators for the congruence kernel. For further details, see [[DFO11](https://docs.magma-maths.org/references.md#cite-tits), Section 3.2].

The optional parameter `Presentation` is used to dictate how the presentation is constructed. If its value is “CT”, then we use the presentation provided by `CompositionTreeVerify`. If its value is “PC” and the image is soluble, then we use a PC-presentation provided by `LMGSolubleRadical`. If its value is “FP” then we use the presentation provided by `FPGroup` or `FPGroupStrong`. If the order of the congruence image is less than the value of the optional argument `Small`, then we use `FPGroup` to construct the presentation; if it is less than the value of the optional argument `OrderLimit`, then we use `FPGroupStrong` to construct the presentation; otherwise we use the presentation provided by `CompositionTreeVerify`. If `NeedChangeOfBasis` is `true`, then a change-of-basis matrix is computed and recorded which explictly exhibits $G$ as a group of block lower-triangular matrices.

<a id="function-ispolycyclicbyfinite-grpmat"></a>
#### `IsPolycyclicByFinite(G : parameters): GrpMat -> BoolElt`

```magma
Presentation: MonStgElt                    Default: "CT"
OrderLimit  : RngIntElt                    Default: 10^15
Small       : RngIntElt                    Default: 10^6
```

This function takes as input a finitely generated matrix group $G$ over $Z$, and tests whether $G$ is polycyclic-by-finite. If so, it returns `true`, otherwise `false`. See [[DFO11](https://docs.magma-maths.org/references.md#cite-tits), Section 3.2] for details.

The optional parameter `Presentation` is used to dictate how the presentation is constructed. If its value is “CT”, then we use the presentation provided by `CompositionTreeVerify`. If its value is “PC” and the image is soluble, then we use a PC-presentation provided by `LMGSolubleRadical`. If its value is “FP” then we use the presentation provided by `FPGroup` or `FPGroupStrong`. If the order of the congruence image is less than the value of the optional argument `Small`, then we use `FPGroup` to construct the presentation; if it is less than the value of the optional argument `OrderLimit`, then we use `FPGroupStrong` to construct the presentation; otherwise we use the presentation provided by `CompositionTreeVerify`.

<a id="function-isnilpotentbyfinite-grpmat"></a>
#### `IsNilpotentByFinite(G : parameters): GrpMat -> BoolElt`

```magma
Presentation: MonStgElt                    Default: "CT"
OrderLimit  : RngIntElt                    Default: 10^15
Small       : RngIntElt                    Default: 10^6
```

This function takes as input a finitely generated matrix group $G$ over $K$, and tests whether $G$ is nilpotent-by-finite. If so, it returns `true`, otherwise `false`. Here $K$ must currently be $Q$, a number field, or an (algebraic) function field with a single indeterminate.

The algorithm first constructs a congruence homomorphism, then a presentation for the congruence image, and finally evaluates its relations to obtain normal generators for the congruence kernel. Further details of the algorithm can be found in [[DFO11](https://docs.magma-maths.org/references.md#cite-tits), Section 5.2].

The optional parameter `Presentation` is used to dictate how the presentation is constructed. If its value is “CT”, then we use the presentation provided by `CompositionTreeVerify`. If its value is “PC” and the image is soluble, then we use a PC-presentation provided by `LMGSolubleRadical`. If its value is “FP” then we use the presentation provided by `FPGroup` or `FPGroupStrong`. If the order of the congruence image is less than the value of the optional argument `Small`, then we use `FPGroup` to construct the presentation; if it is less than the value of the optional argument `OrderLimit`, then we use `FPGroupStrong` to construct the presentation; otherwise we use the presentation provided by `CompositionTreeVerify`.

<a id="function-isabelianbyfinite-grpmat"></a>
#### `IsAbelianByFinite(G : parameters): GrpMat -> BoolElt`

```magma
Presentation: MonStgElt                    Default: "CT"
OrderLimit  : RngIntElt                    Default: 10^15
Small       : RngIntElt                    Default: 10^6
```

This function takes as input a finitely generated matrix group $G$ over $K$, and tests whether $G$ is abelian-by-finite. If so, it returns `true`, otherwise `false`. As before, $K$ must currently be $Q$, a number field, or an (algebraic) function field with a single indeterminate.

The algorithm first constructs a congruence homomorphism, then a presentation for the congruence image, and finally evaluates its relations to obtain normal generators for the congruence kernel. Further details of the algorithm can be found in [[DFO11](https://docs.magma-maths.org/references.md#cite-tits), Section 5.2].

The optional parameter `Presentation` is used to dictate how the presentation is constructed. If its value is “CT”, then we use the presentation provided by `CompositionTreeVerify`. If its value is “PC” and the image is soluble, then we use a PC-presentation provided by `LMGSolubleRadical`. If its value is “FP” then we use the presentation provided by `FPGroup` or `FPGroupStrong`. If the order of the congruence image is less than the value of the optional argument `Small`, then we use `FPGroup` to construct the presentation; if it is less than the value of the optional argument `OrderLimit`, then we use `FPGroupStrong` to construct the presentation; otherwise we use the presentation provided by `CompositionTreeVerify`.

<a id="function-iscentralbyfinite-grpmat"></a>
#### `IsCentralByFinite(G : parameters): GrpMat -> BoolElt`

```magma
Presentation       : MonStgElt                    Default: "CT"
OrderLimit         : RngIntElt                    Default: 10^15
Small              : RngIntElt                    Default: 10^6
CompletelyReducible: BoolElt                      Default: false
```

This function takes as input a finitely generated matrix group $G$ over a field $K$, and tests whether $G$ is central-by-finite. If so, it returns `true`, otherwise `false`. Here $K$ is (a finite degree extension of) $F(x_1, \ldots, x_m)$, where $F$ is $Q$ or a number field.

The algorithm first constructs a congruence homomorphism, then a presentation for the congruence image, and finally evaluates its relations to obtain normal generators for the congruence kernel. Further details of the algorithm can be found in [[DFO11](https://docs.magma-maths.org/references.md#cite-tits), Section 5.3].

The optional parameter `Presentation` is used to dictate how the presentation is constructed. If its value is “CT”, then we use the presentation provided by `CompositionTreeVerify`. If its value is “PC” and the image is soluble, then we use a PC-presentation provided by `LMGSolubleRadical`. If its value is “FP” then we use the presentation provided by `FPGroup` or `FPGroupStrong`. If the order of the congruence image is less than the value of the optional argument `Small`, then we use `FPGroup` to construct the presentation; if it is less than the value of the optional argument `OrderLimit`, then we use `FPGroupStrong` to construct the presentation; otherwise we use the presentation provided by `CompositionTreeVerify`.

If the optional parameter `CompletelyReducible` is set to `true` then we use a more efficient algorithm to test whether $G$ is central-by-finite.

<a id="hirsch-number-and-prufer-rank"></a>
<a id="hirsch-rank"></a>
<a id="rank"></a>
### Hirsch Number and Prüfer Rank

<a id="function-hasfiniterank-grpmat"></a>
#### `HasFiniteRank(G): GrpMat -> BoolElt`

This function takes as input a finitely generated matrix group $G$ defined over $Q$ or a number field, and determines if it has finite Hirsch number and Prüfer rank. If so, it returns `true`, else `false`.

<a id="function-hirschnumber-grpmat"></a>
#### `HirschNumber(G): GrpMat -> RngIntElt`

This function takes as input a finitely generated finite rank matrix group $G$ defined over $Q$ or a number field, and returns its Hirsch number.

<a id="function-hasfiniteindex-grpmat-grpmat"></a>
#### `HasFiniteIndex(G, H): GrpMat, GrpMat -> BoolElt`

If the subgroup $H$ has finite index in the soluble-by-finite matrix group $G$ defined over $Q$ or a number field, then this function returns `true`, else it returns `false`. It decides this by checking whether $G$ and $H$ have identical Hirsch numbers.

<a id="function-prueferrankbound-grpmat"></a>
#### `PrueferRankBound(G): GrpMat -> BoolElt`

This function takes as input a finitely generated finite rank matrix group $G$ defined over $Q$ or a number field, and returns an upper bound to its Prüfer rank.

### Other Properties of Linear Groups

In this section, $K$ is a finite degree extension of $F(x_1, \ldots, x_m)$, where $F$ is $Q$, a number field, or a finite field, and $m\geq 0$.

<a id="function-iscompletelyreducible-grpmat"></a>
#### `IsCompletelyReducible(G : parameters): GrpMat -> BoolElt`

```magma
SolubleByFinite  : BoolElt                      Default: false
NilpotentByFinite: BoolElt                      Default: false
AbelianByFinite  : BoolElt                      Default: false
Nilpotent        : BoolElt                      Default: false
Presentation     : MonStgElt                    Default: "CT"
OrderLimit       : RngIntElt                    Default: 10^15
Small            : RngIntElt                    Default: 10^6
```

This function takes as input a finitely generated matrix group $G$ over $K$, and tests whether $G$ is completely reducible. If so, it returns `true`, otherwise `false`.

The algorithm used is described in [[DFO11](https://docs.magma-maths.org/references.md#cite-tits), Section 4]. It applies only if $G$ is soluble-by-finite, nilpotent-by-finite, or abelian-by-finite. Hence one (and only one) of the four optional arguments `SolubleByFinite, NilpotentByFinite, AbelianByFinite, Nilpotent` must be true. In particular, if `Nilpotent` is set to be true, then a more efficient algorithm (from [[DF08](https://docs.magma-maths.org/references.md#cite-draft)]) is used.

In positive characteristic $p$, if $p$ divides the order of the congruence image of $G$ then currently the algorithm cannot decide complete reducibility of $G$.

The optional parameter `Presentation` is used to dictate how the presentation is constructed. If its value is “CT”, then we use the presentation provided by `CompositionTreeVerify`. If its value is “PC” and the image is soluble, then we use a PC-presentation provided by `LMGSolubleRadical`. If its value is “FP” then we use the presentation provided by `FPGroup` or `FPGroupStrong`. If the order of the congruence image is less than the value of the optional argument `Small`, then we use `FPGroup` to construct the presentation; if it is less than the value of the optional argument `OrderLimit`, then we use `FPGroupStrong` to construct the presentation; otherwise we use the presentation provided by `CompositionTreeVerify`.

<a id="function-completelyreduciblepart-grpmat"></a>
#### `CompletelyReduciblePart(G): GrpMat -> GrpMat, GrpMatElt`

Let $H$ be a matrix group in block lower triangular form, and let $\mu$ be the projection of $H$ onto its diagonal blocks. If all diagonal blocks of $H$ are completely reducible, then $\ker \mu$ is the unipotent radical of $H$ and $\mu(H)$ is a ‘completely reducible part’ of $H$.

$G$ is a soluble-by-finite group defined over $Q$ or over a number field. The function returns a completely reducible part of $G$ and a change-of-basis matrix to exhibit this.

In positive characteristic $p$, if $p$ divides the order of the congruence image of $G$ then currently the algorithm cannot construct a completely reducible part.

<a id="function-isunipotent-grpmat"></a>
#### `IsUnipotent(G): GrpMat -> BoolElt, GrpMatElt`

This function takes as input a finitely generated matrix group $G$ defined over an exact field $F$, and tests whether $G$ is unipotent, i.e., whether it is conjugate in ${\operatorname{GL}}(n, F)$ to a group of upper unitriangular matrices. If $G$ is unipotent then the function returns `true` and a change-of-basis matrix $c \in {\operatorname{GL}}(n, F)$ such that $G^c$ is upper unitriangular, otherwise `false`. See [[DF06](https://docs.magma-maths.org/references.md#cite-large), Section 2.1] for details of the algorithm.

<a id="function-isnilpotent-grpmat"></a>
#### `IsNilpotent(G): GrpMat -> BoolElt`

Let $G$ be a finitely generated subgroup of ${\operatorname{GL}}(n, K)$. This function returns `true` if $G$ is nilpotent; otherwise it returns `false`. If $K$ is finite then the function is an implementation of the algorithm of [[DF06](https://docs.magma-maths.org/references.md#cite-large)]. If $K$ is infinite then the function is similar to the algorithm in [[DF08](https://docs.magma-maths.org/references.md#cite-draft)], and is based on the construction of a homomorphic image $H$ of $G$ via `CongruenceImage`.

<a id="function-issoluble-grpmat"></a>
#### `IsSoluble(G : parameters): GrpMat -> BoolElt`

```magma
Presentation : MonStgElt                    Default: "CT"
OrderLimit   : RngIntElt                    Default: 10^15
Small        : RngIntElt                    Default: 10^6
UseCongruence: BoolElt                      Default: false
```

Let $G$ be a finitely generated subgroup of ${\operatorname{GL}}(n, K)$. This function returns `true` if $G$ is soluble; otherwise it returns `false`. If $K$ is infinite and has characteristic $p>0$, then the algorithm is applicable only for $p > n$. For details see [[DFO11](https://docs.magma-maths.org/references.md#cite-tits), Section 3.2].

If $K$ is $Q$ or a number field and `UseCongruence` is `true`, then use congruence homomorphism machinery to decide; otherwise use default algorithm.

The other optional arguments are those described above for `IsSolubleByFinite`.

<a id="function-ispolycyclic-grpmat"></a>
#### `IsPolycyclic(G : parameters): GrpMat -> BoolElt`

```magma
Presentation: MonStgElt                    Default: "CT"
OrderLimit  : RngIntElt                    Default: 10^15
Small       : RngIntElt                    Default: 10^6
```

This function takes as input a finite matrix group $G$ over $Z$, and tests whether $G$ is polycyclic. If so, it returns `true`, otherwise `false`.

The optional arguments are those described above for `IsSolubleByFinite`.

<a id="function-hasfiniteorder-grpmatelt"></a>
#### `HasFiniteOrder(g : parameters): GrpMatElt -> BoolElt, RngIntElt`

```magma
UseCongruence: BoolElt                    Default: false
```

Let $g$ be an invertible matrix defined over $Z$, $Q$, a number field, a function field, or an algebraic function field.

If $g$ has finite order, then return `true` and, if known, a multiplicative upper bound for the order of $g$; else return `false`.

If $g$ is defined over $Z$, $Q$, or a number field and `UseCongruence` is `true`, then use congruence homomorphism machinery to decide; otherwise use default algorithm.

### Other Functions for Nilpotent Matrix Groups

<a id="function-recogniseabelian-grpmat"></a>
#### `RecogniseAbelian(G): GrpMat -> GrpGPC, Map, Map`

Given a completely reducible abelian matrix group $G$ defined over $Q$ or a number field, return an isomorphic polycyclic copy $P$, a map from $G$ to $P$, and a map from $P$ to $G$. It uses an algorithm of Biasse and Fieker [[BF12](https://docs.magma-maths.org/references.md#cite-fieker)] to work with irreducible abelian groups defined over number fields.

<a id="function-sylowsystem-grpmat-fldfin"></a>
#### `SylowSystem(G : parameters): GrpMat[FldFin] -> []`

```magma
Verify: BoolElt                    Default: false
```

Given a nilpotent matrix group $G$ over a finite field, this function constructs one Sylow $p$-subgroup for each prime $p$ dividing $|G|$ using the algorithm of [[DF06](https://docs.magma-maths.org/references.md#cite-large)]. If the optional parameter `Verify` is set to `true`, then we first verify that $G$ is nilpotent.

The next two functions were developed and implemented by Tobias Rossmann.

<a id="function-isirreduciblefinitenilpotent-grpmat"></a>
#### `IsIrreducibleFiniteNilpotent(G : parameters): GrpMat -> BoolElt, Any`

```magma
DecideOnly: BoolElt                    Default: false
Verify    : BoolElt                    Default: false
```

Let $G$ be a finite nilpotent matrix group over $K$, where $K$ is a number field or a rational function field over a number field. The function returns `true` if $G$ is irreducible or `false` and a proper submodule of `GModule(G)`. The construction of a submodule can be suppressed by setting `DecideOnly` to `true`. If the optional parameter `Verify` is set to `true`, then the function checks if $G$ is nilpotent and finite. The algorithm used for irreducibility testing is described in [Ros10a].

<a id="function-isprimitivefinitenilpotent-grpmat"></a>
#### `IsPrimitiveFiniteNilpotent(G : parameters): GrpMat -> BoolElt, Any`

```magma
DecideOnly: BoolElt                    Default: false
Verify    : BoolElt                    Default: false
```

Let $G$ be an irreducible finite nilpotent matrix group over $K$, where $K$ is a number field or a rational function field over a number field. The function returns `true` if $G$ is primitive, or `false` and a system of imprimitivity for $G$ given as a sequence of subspaces of `RSpace(G)`. The construction of a system of imprimitivity can be suppressed by setting `DecideOnly` to `true`. If the optional parameter `Verify` is set to `true`, then the function checks if $G$ is nilpotent and finite. The algorithm used for primitivity testing is described in [Ros10b].

### Examples

<a id="example-ex-3405c0"></a>
#### `Example: Finite Group over a Rational Function Field (ex-3405c0)`

```magma
> Q := Rationals ();
> F<t>:= RationalFunctionField (Q);
> M:= MatrixAlgebra (F, 3);
> a:= M![-1, 2*t^2, -2*t^4 - 2*t^3 - 2*t^2, 0, 1, 0, 0, 0, 1];
> b:= M![1, 0, 0, 1/t^2, -1, (2*t^3 - 1)/(t - 1), 0, 0, 1];
> c:= M![t, -t^3 + t^2, t^5 - t^2 - t, t^2, -t^4, (t^8 - t^5 + 1)/
> (t^2 - t), (t - 1)/t, -t^2 + t, t^4 - t];
> G:= sub<GL(3,F)|a,b,c>;
> IsFinite(G);
true
> flag, H := IsomorphicCopy(G);
> H;
MatrixGroup(3, GF(3))
Generators:
    [2 2 1]
    [0 1 0]
    [0 0 1]

    [1 0 0]
    [1 2 0]
    [0 0 1]

    [2 2 2]
    [1 2 0]
    [2 1 2]
> #H;
48
```

<a id="example-ex-eadd93"></a>
#### `Example: Finite Group in Characteristic 5 (ex-eadd93)`

```magma
> F<t>:= RationalFunctionField (GF(5));
> M:= MatrixAlgebra (F, 6);
> a:= M![2, 2*t^2, 4, 1, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0,
> 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1];
> b:= M![(4*t + 4)/t, 4*t, (t + 1)/t, 0, t, t^2 + t, 0, 4, 0, 0, 0,
> 1/t, 4/t, t^2 + 4*t, 1/t, 0, 0, 0, 0, 4*t, 0, 0, 0, 0, 0, 0, 4, 4,
> 0, 0, 0, 0, 0, 4, 0, 0];
> G:= sub<GL(6,F)|a,b>;
> IsFinite(G);
true
> flag, H := IsomorphicCopy (G);
> flag;
true
> H;
MatrixGroup(6, GF(5)) of order 2^7 * 3 * 5^4 * 31
Generators:
    [2 2 4 1 0 0]
    [0 2 0 0 0 0]
    [0 0 1 1 0 0]
    [0 0 0 1 0 0]
    [0 0 0 0 1 1]
    [0 0 0 0 0 1]

    [3 4 2 0 1 2]
    [0 4 0 0 0 1]
    [4 0 1 0 0 0]
    [0 4 0 0 0 0]
    [0 0 4 4 0 0]
    [0 0 0 4 0 0]
> #H;
7440000
```

<a id="example-ex-b89ce7"></a>
#### `Example: Infinite Group in Characteristic 5 (ex-b89ce7)`

```magma
>  L<t> := RationalFunctionField (GF (5^2));
>  G := GL (2, L);
>  a := G![t,1,0,-1];
>  b:= G![t/(t + 1), 1, 0, 1/t];
>  H := sub <GL(2, L) | a, b>;
> f :=IsFinite(H);
> f;
false
> IsSolubleByFinite (H);
true
> IsCompletelyReducible (H);
false
```

<a id="example-ex-83679b"></a>
#### `Example: Infinite Integral Matrix Group (ex-83679b)`

```magma
> G := MatrixGroup<3, IntegerRing() |
>  [ 5608, 711, -711, 6048, 766, -765, 1071, 135, -134 ],
>  [ 1, -2415, 5475, 0, 4471, -10140, 0, 780, -1769 ],
>  [ 5743, -5742, 639, -576, 577, -72, -711, 711, -80 ],
>  [ 526168, -618507, 729315, 621984, -731138, 862125,
>        274455, -322620, 380419      ]  ,
>  [ 648226, -4621455, 9226791, 660687, -4710305, 9404184,
>        85626, -610473, 1218820 ],
>  [ 32581, -39465, 46350, 53100, -64319, 75540, 24210,
>        -29325, 34441 ]>;
> IsFinite (G);
false
> IsSolubleByFinite (G);
false
> IsNilpotentByFinite (G);
false
> time IsCentralByFinite (G);
false
> IsAbelianByFinite (G);
false
```

<a id="example-ex-cd9712"></a>
#### `Example: Infinite Group over a Quadratic Field (ex-cd9712)`

```magma
> Q<z> := QuadraticField(5);
> O<w> := sub< MaximalOrder(Q) | 7 >;
> G := GL(2, Q);
> x := G![1,1+w,0,w];
> y :=  G![-1/2, 2, 2 + w, 5 + w^2];
> H:=sub<G | x, y>;
> IsFinite (H);
false
> IsSolubleByFinite (H);
false
```

<a id="example-ex-d1ef57"></a>
#### `Example: Infinite Group over a Quartic Number Field (ex-d1ef57)`

```magma
>  R<x> := PolynomialRing(Integers());
>  K<y> := NumberField(x^4-420*x^2+40000);
>  G := GL (2, K);
>  a := G![y,1,0,-1];
>  b:= G![y/(y + 1), 1, 0, 1/y];
>  H := sub <GL(2, K) | a, b>;
> time IsFinite(H);
false
```

<a id="example-ex-e6bb73"></a>
#### `Example: Group over an Algebraic Function Field (ex-e6bb73)`

```magma
> /* example over algebraic extension of a function field */
>
> R<u> := FunctionField (Rationals ());
> v := u; w := -2 * v;
> Px<X> := PolynomialRing (R);
> Py<Y> := PolynomialRing (R);
> f :=  Y^2- 3 * u * X * Y^2  + v * X^3;
> facs := Factorisation (f);
> F:=ext <R | facs[2][1]>;
> F;
Algebraic function field defined over Univariate rational function
field over Rational Field by Y - 1/2/u
>
> n := 3;
> G:= GL(n,F);
> Z := 4 * X * Y;
> MA:= MatrixAlgebra(F,n);
> h1:= Id(MA);
> h1[n][n]:= (X^2+Y+Z+1);
> h1[1][n]:= X+1;
> h1[1][n]:= X+1;
> h1[1][1]:=(Z^5-X^2*Z+Z*X*Y);
> h1[2][1]:=1-X*Y*Z;
> h1[2][n]:= X^20+X*Y^15+Y^10+Z^4*Y*X^5+1;
> h2:= Id(MA);
> h2[n][n]:= (X^7+Z^6+1);
> h2[1][n]:= X^2+X+1;
> h2[1][1]:=(Y^3+X^2+X+1);
> h2[1][1]:=(Y^3+X^2+X+1);
> h2[2][1]:=1-X^2;
> h2[2][n]:= X^50+Y^35+X^20+X^13+Y^2+1;
> G := sub< GL(n, F) | h1, h2>;
> G;
MatrixGroup(3, F)
Generators:
    [1/u^10 0 (u + 1/2)/u]
    [(u^4 - 1/4)/u^4 1 (u^20 + 1/1024*u^10 + 1/64*u^6 + 1/65536*u^4 +
        1/1048576)/u^20]
    [0 0 (u^2 + 1/2*u + 5/4)/u^2]

    [(u^3 + 1/2*u^2 + 1/4*u + 1/8)/u^3 0 (u^2 + 1/2*u + 1/4)/u^2]
    [(u^2 - 1/4)/u^2 1 (u^50 + 1/4*u^48 + 1/8192*u^37 + 1/1048576*u^30 +
        1/34359738368*u^15 + 1/1125899906842624)/u^50]
    [0 0 (u^12 + 1/128*u^5 + 1)/u^12]
> time IsFinite(G);
false
Time: 0.010
> time IsSolubleByFinite (G);
true
```

<a id="example-ex-b2fc02"></a>
#### `Example: Finite Group in Characteristic 2 (ex-b2fc02)`

```magma
> F := GF(2);
> P := PolynomialRing (F);
> P<t> := PolynomialRing (F);
> F := ext < F | t^2+t+1>;
> G := GL (2, FunctionField (F));
> a := G![1,1/t, 0, 1];
> b := [1,1/(t + 1), 0, 1];
> c := [1,1/(t^2 + t + 1), 0, 1];
> d := [1,1/(t^2 + t), 0, 1];
> G := sub < G | a,b,c,d>;
> time IsFinite (G);
true
> f, I, tau := IsomorphicCopy (G);
> f;
true
```

<a id="example-ex-65cc00"></a>
#### `Example: Hirsch Number and Finite Index (ex-65cc00)`

```magma
> G := MatrixGroup<10, K | [
>     Matrix(SparseMatrix(K, 10, 10, [
>     <1, 3, -1>, <2, 1, 1>, <2, 2, 1>, <2, 3, 1>, <2, 4, 1>, <2, 5, 1>,
>     <3, 4, -1>, <4, 5, -1>, <5, 2, -1>, <6, 8, -1>, <7, 6, 1>,
>     <7, 7, 1>, <7, 8, 1>,
>     <7, 9, 1>, <7, 10, 1>, <8, 9, -1>, <9, 10, -1>, <10, 7, -1>])),
>     Matrix(SparseMatrix(K, 10, 10, [
>     <1, 2, 1>, <2, 3, 1>, <3, 1, -1>, <3, 2, -1>, <3, 3, -1>, <3, 4, -1>,
>     <3, 5, -1>, <4, 4, 1>, <5, 1, 1>, <6, 7, 1>, <7, 8, 1>, <8, 6, -1>,
>     <8, 7, -1>, <8,8, -1>, <8, 9, -1>, <8, 10, -1>, <9, 9, 1>, <10, 6, 1>])),
>     ScalarMatrix(K, 10, -1),
>     Matrix(SparseMatrix(K, 10, 10, [
>     <1, 6, 1>, <2, 7, 1>, <3, 8, 1>, <4, 9, 1>, <5, 10, 1>, <6, 1, w + 3>,
>     <7, 2, w + 3>, <8, 3, w + 3>, <9, 4, w + 3>, <10, 5, w + 3>])),
>     Matrix(SparseMatrix(K, 10, 10, [
>     <1, 6, 1>, <2, 7, 1>, <3, 8, 1>, <4, 9, 1>, <5, 10, 1>,
>     <6, 1, 1/5*(5*w - 7)>, <7, 2, 1/5*(5*w - 7)>, <8, 3, 1/5*(5*w - 7)>,
>     <9, 4, 1/5*(5*w - 7)>, <10, 5, 1/5*(5*w - 7)>]))
> ]> where w := K.1 where K := ext<K|Polynomial(K, [1, 0, 1])> where K is
> RationalField();
>
> IsIrreducible (GModule (G));
true
> IsSolubleByFinite (G);
true
>
> flag := HasFiniteRank (G);
> "G has finite rank?", flag;
G has finite rank? true
>
> h := HirschNumber(G);
> "Hirsch number of G is ", h;
Hirsch number of G is  3
>
> H := sub<G | G.2 * G.1 * G.2, G.3 * G.4, G.5>;
> HasFiniteIndex (G, H);
true
```

<a id="example-ex-b02d39"></a>
#### `Example: Completely Reducible Part of a Group (ex-b02d39)`

```magma
> G := MatrixGroup<8, RationalField() |
>     Matrix(RationalField(), 8, 8, [ -402, -128, 32, 24, -452, 798, -293,
>     349, 3, 37, 20, -9, 5, -11, 29, 7, -67, 56, 5, -15, -105, 133, 21,
>     65, -114, 660, 80, -164, -325, 208, 528, 199, -2, 220, 0, -55, -90,
>     4, 199, 18,-213, 236, 16, -63, -359, 423, 121, 209, -36, 260, 0,
>     -65, -144, 72, 221, 57, 3, -228, 0, 57, 94, -6, -206, -20 ]),
>     Matrix(RationalField(), 8, 8, [ -446, 1144, -64, -288, -1114, 910,
>     833, 407, -9, 37, -4, -9, -31, 19, 29, 7, -125, 155, -7, -39, -223,
>     252, 77, 113, -510, 428, -16, -106, -779, 1024, 104, 457, -108, 28,
>     0, -7, -134, 216, -35, 96, -407, 608, -32, -153, -781, 823, 347, 367,
>     -190, 92, 0, -23,  -254, 380, -23, 171, 159, 12, 0, -3, 176, -318,
>     98, -140 ]) >;
>
> IsSolubleByFinite (G: NeedChangeOfBasis := true);
true
> IsCompletelyReducible (G);
false
> I, CB := CompletelyReduciblePart (G);
> "Completely reducible part ", I;
Completely reducible part
MatrixGroup(8, Rational Field)
Generators:
    [    24   -600    266   -535    -69      0      0      0]
    [  63/2   -128  345/4   -103 -171/4      0      0      0]
    [    -2    220    -90    199     18      0      0      0]
    [   -36    260   -144    221     57      0      0      0]
    [     3   -228     94   -206    -20      0      0      0]
    [     0      0      0      0      0      1      0      0]
    [     0      0      0      0      0      0      1      0]
    [     0      0      0      0      0      0      0      1]

    [   368    -72    448    139   -327      0      0      0]
    [ 237/2    -70  655/4      3 -429/4      0      0      0]
    [  -108     28   -134    -35     96      0      0      0]
    [  -190     92   -254    -23    171      0      0      0]
    [   159     12    176     98   -140      0      0      0]
    [     0      0      0      0      0      1      0      0]
    [     0      0      0      0      0      0      1      0]
    [     0      0      0      0      0      0      0      1]
> "Change-of-basis matrix is ", CB;
Change-of-basis matrix is
[   1    0    0    0    0   -2    0    0]
[   0    1    0 -1/4    0    0    0    0]
[   0    0    0    0    1    0    0    0]
[   0    0    0    0    0    0    1    0]
[   0    0    0    0    0    0    0    1]
[   0    0    1    0    0 -1/4    0    0]
[   0    0    0    1    0    0    0    0]
[   0    0    0    0    0    1    0    0]
>

Total time: 0.790 seconds, Total memory usage: 32.09MB
```

<a id="example-ex-1259d9"></a>
#### `Example: Imprimitive Finite Nilpotent Group (ex-1259d9)`

```magma
> // irreducible but (evidently) imprimitive
> K<w> := QuadraticField (2);
> G := MatrixGroup< 8, K |
>     [1/2*w,1/2*w,0,0,0,0,0,0,-1/2*w,1/2*w,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,
>      0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,
>      0,0,0,1],
>     [1,0,0,0,0,0,0,0,0,-1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,
>      0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1],
>     [0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,
>     0,0,0,0,1,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0] >;
> G;
MatrixGroup(8, K)
Generators:
    [ 1/2*w  1/2*w        0        0        0        0        0        0]
    [-1/2*w  1/2*w        0        0        0        0        0        0]
    [       0        0        1        0        0        0        0        0]
    [       0        0        0        1        0        0        0        0]
    [       0        0        0        0        1        0        0        0]
    [       0        0        0        0        0        1        0        0]
    [       0        0        0        0        0        0        1        0]
    [       0        0        0        0        0        0        0        1]

    [ 1  0  0  0  0  0  0  0]
    [ 0 -1  0  0  0  0  0  0]
    [ 0  0  1  0  0  0  0  0]
    [ 0  0  0  1  0  0  0  0]
    [ 0  0  0  0  1  0  0  0]
    [ 0  0  0  0  0  1  0  0]
    [ 0  0  0  0  0  0  1  0]
    [ 0  0  0  0  0  0  0  1]

    [0 0 1 0 0 0 0 0]
    [0 0 0 1 0 0 0 0]
    [0 0 0 0 1 0 0 0]
    [0 0 0 0 0 1 0 0]
    [0 0 0 0 0 0 1 0]
    [0 0 0 0 0 0 0 1]
    [1 0 0 0 0 0 0 0]
    [0 1 0 0 0 0 0 0]
> IsIrreducibleFiniteNilpotent(G);
true
> r, B := IsPrimitiveFiniteNilpotent(G);
> r;
false
> #B;
2
```

<a id="example-ex-a460de"></a>
#### `Example: Recognising an Abelian Matrix Group (ex-a460de)`

```magma
> G := MatrixGroup<8, RationalField() |
>     Matrix(RationalField(),8,8,[2008, -20376, 10986, -17499, -2961, 0, 0, 0,
>     2205/2, -4964, 13545/4, -3990, -5355/4, 0, 0, 0, -546, 7212, -3698, 6267,
>     882, 0, 0, 0, -1512, 9348, -5724, 7765, 1953, 0, 0, 0, 651, -7812, 4074,
>     -6762, -1016, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0,
>     0, 0, 0, 0, 0, 0, 0, 1 ]),
>     Matrix(RationalField(), 8, 8, [ -6371, -304884, 123147, -274455, -2268, 0,
>     0,0,-6741, -91988, 31500, -341397/4, 3591, 0, 0, 0, 1764, 103896, -42443,
>     93312, 1134, 0, 0, 0, 8442, 157356, -57510, 144370, -3402, 0, 0, 0, -378,
>     -112644, 47817, -100359, -2591, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0,
>      0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1 ]),
>     Matrix(RationalField(), 8, 8, [ 68095, -10044, 95553, 20763, -58968, 0, 0,
>     0,49203/2,622, 64575/2, 45423/4, -42903/2, 0, 0, 0, -22176, 1080, -29969,
>     -8748, 19278, 0, 0, 0, -39060, 108, -51840, -17036, 34020, 0, 0, 0, 24192,
>     -9828, 37233, 1701, -20735, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0,
>     0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1 ]),
>     Matrix(RationalField(), 8, 8, [ -8810, -109512, 45447, -103143, 11133, 0,
>     0, 0, -5685/2, -35609, 14820, -134115/4, 14445/4, 0, 0, 0, 2748, 33924,
>     -14042, 31959, -3456, 0, 0, 0, 4626, 57696, -23973, 54334, -5859, 0,
>     0, 0, -3543,  -44244, 18393, -41664, 4492, 0, 0, 0, 0, 0, 0, 0, 0, 1,
>     0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1 ]) >;
>
> IsAbelian (G);
true
> IsCompletelyReducible (G);
true
>
> I, phi, tau := RecogniseAbelian (G);
> I;
GrpGPC : I of infinite order on 3 PC-generators
PC-Relations:
> phi;
Mapping from: GL(8, RationalField()) to GrpGPC: I given by a rule [no inverse]
> tau;
Mapping from: GrpGPC: I to GrpMat: G given by a rule [no inverse]
> images := [phi (G.i): i in [1..Ngens (G)]];
> "images of matrix generators are ", images;
images of matrix generators are  [ I.3, I.1, I.1^-1, I.2 ]
>
> "Preimage of I.1 is ", tau (I.1);
Preimage of I.1 is
[-6371 -304884 123147 -274455 -2268 0 0 0]
[-6741 -91988 31500 -341397/4 3591 0 0 0]
[1764 103896 -42443 93312 1134 0 0 0]
[8442 157356 -57510 144370 -3402 0 0 0]
[-378 -112644 47817 -100359 -2591 0 0 0]
[0 0 0 0 0 1 0 0]
[0 0 0 0 0 0 1 0]
[0 0 0 0 0 0 0 1]
```

<a id="example-ex-644306"></a>
#### `Example: Sylow System of a Nilpotent Group (ex-644306)`

```magma
> M:= MatrixAlgebra (GF(17), 4);
> a:= M![5, 5, 3, 3, 0, 5, 0, 3, 16, 16, 14, 14, 0, 16, 0, 14];
> b:= M![9, 9, 0, 0, 0, 9, 0, 0, 10, 10, 8, 8, 0, 10, 0, 8];
> G:= sub<GL(4,17)|a,b>;
> IsNilpotent(G);
true
> SylowSystem (G);
[
    MatrixGroup(4, GF(17))
    Generators:
        [ 5  0  3  0]
        [ 0  5  0  3]
        [16  0 14  0]
        [ 0 16  0 14]

        [ 9  0  0  0]
        [ 0  9  0  0]
        [10  0  8  0]
        [ 0 10  0  8],

    MatrixGroup(4, GF(17))
    Generators:
        [ 1  1  0  0]
        [ 0  1  0  0]
        [ 0  0  1  1]
        [ 0  0  0  1]
]
> Order(G);
8704
```

<a id="example-ex-8207b7"></a>
#### `Example: Infinite Nilpotent Group over a Function Field (ex-8207b7)`

```magma
> R<s>:= QuadraticField(-1);
> F<t>:= FunctionField(R);
> M:= MatrixAlgebra (F, 2);
> a:= M![-s*t^2 + 1, s*t^3, -s*t, s*t^2 + 1];
> b:= M![t^2 - 3*t + 1, 0, 0, t^2 - 3*t + 1];
> G:= sub<GL(2,F)|a,b>;
> IsNilpotent(G);
true
> IsFinite(G);
false
```

<a id="matrix-group-qz"></a>
## Matrix Groups over Q and Z

- [Overview](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverQAndZ/Overview.md)
- [Invariant Forms](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverQAndZ/forms.md)
  - [`PositiveDefiniteForm(G): GrpMat → Mtrx`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverQAndZ/forms.md#function-grpmatqz-positivedefiniteform)
  - [`InvariantForms(G): GrpMat → [ AlgMatElt ]`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverQAndZ/forms.md#function-invariantforms-grpmat)
  - [`SymmetricForms(G): GrpMat → [ AlgMatElt ]`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverQAndZ/forms.md#function-symmetricforms-grpmat)
  - [`AntisymmetricForms(G): GrpMat → [ AlgMatElt ]`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverQAndZ/forms.md#function-antisymmetricforms-grpmat)
  - [`InvariantForms(G, n): GrpMat, RngIntElt → [ AlgMatElt ]`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverQAndZ/forms.md#function-invariantforms-grpmat-rngintelt)
  - [`SymmetricForms(G, n): GrpMat, RngIntElt → [ AlgMatElt ]`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverQAndZ/forms.md#function-symmetricforms-grpmat-rngintelt)
  - [`AntisymmetricForms(G, n): GrpMat, RngIntElt → [ AlgMatElt ]`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverQAndZ/forms.md#function-antisymmetricforms-grpmat-rngintelt)
  - [`NumberOfInvariantForms(G): GrpMat → RngIntElt, RngIntElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverQAndZ/forms.md#function-numberofinvariantforms-grpmat)
  - [`NumberOfSymmetricForms(G): GrpMat → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverQAndZ/forms.md#function-numberofsymmetricforms-grpmat)
  - [`NumberOfAntisymmetricForms(G): GrpMat → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverQAndZ/forms.md#function-numberofantisymmetricforms-grpmat)
- [Endomorphisms](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverQAndZ/Endomorphisms.md)
  - [`EndomorphismRing(G): GrpMat → AlgMat`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverQAndZ/Endomorphisms.md#function-endomorphismring-grpmat)
  - [`EndomorphismAlgebra(G): GrpMat → AlgMat`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverQAndZ/Endomorphisms.md#function-endomorphismalgebra-grpmat)
  - [`CentreOfEndomorphismRing(G): GrpMat → AlgMat`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverQAndZ/Endomorphisms.md#function-centreofendomorphismring-grpmat)
  - [`CentreOfEndomorphismAlgebra(G): GrpMat → AlgMat`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverQAndZ/Endomorphisms.md#function-centreofendomorphismalgebra-grpmat)
  - [`DimensionOfEndomorphismRing(G): GrpMat → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverQAndZ/Endomorphisms.md#function-dimensionofendomorphismring-grpmat)
  - [`DimensionOfCentreOfEndomorphismRing(G): GrpMat → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverQAndZ/Endomorphisms.md#function-dimensionofcentreofendomorphismring-grpmat)
  - [`Endomorphisms(G, n): GrpMat, RngIntElt → [ AlgMatElt ]`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverQAndZ/Endomorphisms.md#function-endomorphisms-grpmat-rngintelt)
  - [`CentralEndomorphisms(G, n): GrpMat, RngIntElt → [ AlgMatElt ]`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverQAndZ/Endomorphisms.md#function-centralendomorphisms-grpmat-rngintelt)
- [New Groups From Others](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverQAndZ/Others.md)
  - [`BravaisGroup(G): GrpMat[RngInt] → GrpMat`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverQAndZ/Others.md#function-bravaisgroup-grpmat-rngint)
  - [`IntegralGroup(G): GrpMat → GrpMat, AlgMatElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverQAndZ/Others.md#function-integralgroup-grpmat)
  - [`IntegralGroup(G): [Mtrx] → [Mtrx], AlgMatElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverQAndZ/Others.md#function-integralgroup-mtrx)
- [Perfect Forms and Normalizers](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverQAndZ/Normalizer.md)
  - [`PerfectForms(G): GrpMat[RngInt] → SeqEnum`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverQAndZ/Normalizer.md#function-perfectforms-grpmat-rngint)
  - [`NormalizerGLZ(G): GrpMat[RngInt] → GrpMat[RngInt]`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverQAndZ/Normalizer.md#function-normalizerglz-grpmat-rngint)
  - [`CentralizerGLZ(G): GrpMat[RngInt] → GrpMat[RngInt]`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverQAndZ/Normalizer.md#function-centralizerglz-grpmat-rngint)
- [Conjugacy](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverQAndZ/Conjugacy.md)
  - [`ZClasses(G): GrpMat → SeqEnum, SeqEnum`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverQAndZ/Conjugacy.md#function-zclasses-grpmat)
  - [`IsGLZConjugate(G, H): GrpMat[RngInt], GrpMat[RngInt] → BoolElt, GrpMatElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverQAndZ/Conjugacy.md#function-isglzconjugate-grpmat-rngint-grpmat-rngint)
  - [`IsBravaisEquivalent(G, H): GrpMat[RngInt], GrpMat[RngInt] → BoolElt, GrpMatElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverQAndZ/Conjugacy.md#function-isbravaisequivalent-grpmat-rngint-grpmat-rngint)
  - [`IsGLQConjugate(G, H): GrpMat, GrpMat → BoolElt, GrpMatElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverQAndZ/Conjugacy.md#function-isglqconjugate-grpmat-grpmat)
- [Conjugacy Tests for Matrices](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverQAndZ/Conjugacy_Matrices.md)
  - [`IsGLZConjugate(A, B): AlgMatElt, AlgMatElt → BoolElt, GrpMatElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverQAndZ/Conjugacy_Matrices.md#function-isglzconjugate-algmatelt-algmatelt)
  - [`IsGLZConjugate(A, B): GrpMatElt, GrpMatElt → BoolElt, GrpMatElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverQAndZ/Conjugacy_Matrices.md#function-isglzconjugate-grpmatelt-grpmatelt)
  - [`IsSLZConjugate(A, B): AlgMatElt, AlgMatElt → BoolElt, GrpMatElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverQAndZ/Conjugacy_Matrices.md#function-isslzconjugate-algmatelt-algmatelt)
  - [`IsSLZConjugate(A, B): GrpMatElt, GrpMatElt → BoolElt, GrpMatElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverQAndZ/Conjugacy_Matrices.md#function-isslzconjugate-grpmatelt-grpmatelt)
  - [`CentralizerGLZ(A): AlgMatElt → GrpMat`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverQAndZ/Conjugacy_Matrices.md#function-centralizerglz-algmatelt)
  - [`CentralizerGLZ(A): GrpMatElt → GrpMat`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverQAndZ/Conjugacy_Matrices.md#function-centralizerglz-grpmatelt)
  - [`AreGLConjugate(A, B : parameters): AlgMatElt, AlgMatElt → BoolElt, AlgMatElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverQAndZ/Conjugacy_Matrices.md#function-areglconjugate-algmatelt-algmatelt)
  - [`AreGLConjugate(A, B : parameters): GrpMatElt, GrpMatElt → BoolElt, GrpMatElt`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverQAndZ/Conjugacy_Matrices.md#function-areglconjugate-grpmatelt-grpmatelt)
  - [`GLCentraliser(A : parameters): AlgMatElt → GrpMat`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverQAndZ/Conjugacy_Matrices.md#function-glcentraliser-algmatelt)
  - [`GLCentraliser(A : parameters): GrpMatElt → GrpMat`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverQAndZ/Conjugacy_Matrices.md#function-glcentraliser-grpmatelt)
- [Examples](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverQAndZ/Examples.md)
  - [Example: Integral Classes of a Dihedral Representation](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverQAndZ/Examples.md#example-ex-000ead)
  - [Example: Rational but Not Integral Conjugacy](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverQAndZ/Examples.md#example-ex-0cc747)
  - [Example: Unimodular Conjugating Matrix](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverQAndZ/Examples.md#example-ex-7ed711)
  - [Example: Integral Conjugacy and Centralisers](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverQAndZ/Examples.md#example-ex-2c3b15)
- [Bibliography](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverQAndZ/bibliography.md)

### Overview

In addition to the functionality explained in Chapter [Matrix Groups over Infinite Fields](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverInfiniteFields/index-matrix-groups-over-infinite-fields.md#grpmatinf) and the functions that are available for all finite (matrix) groups, Magma can also compute normalizers and centralizers of a finite integral matrix group $G$ in ${\operatorname{GL}}_n({\mathbb{Z}})$ as well as decide conjugacy in ${\operatorname{GL}}_n({\mathbb{Z}})$ and ${\operatorname{GL}}_n({\mathbb{Q}})$.

These algorithms are based on the sublattice machinery (see Section [$G$-invariant Sublattices](https://docs.magma-maths.org/LatticesQuadraticForms/LatticesWithGroupAction/G-lattices.md#glat-sublattices)) and the enumeration of $G$-perfect forms. They are explained in [[Opg01](https://docs.magma-maths.org/references.md#cite-opgenorth), [OPS98](https://docs.magma-maths.org/references.md#cite-plesken-acta)]. The algorithms perform very well, as long as the space of $G$-invariant symmetric forms has small dimension (say less than 15) and the index of the groups in their Bravais groups is not too large.

The databases of maximal finite irreducible rational, integral, symplectic, and quaternionic matrix groups are explained in Chapter [Databases of Groups](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/index-databases-of-groups.md#chapgrpdata).

### Invariant Forms

Let $G$ be a finite matrix group $G < {\operatorname{GL}}_n({\mathbb{Q}})$. A matrix $F \in M_n({\mathbb{Q}})$ is $G$-invariant if $gFg^{tr} = F$ for all $g \in G$.

<a id="function-grpmatqz-positivedefiniteform"></a>
#### `PositiveDefiniteForm(G): GrpMat -> Mtrx`

For a finite integral or rational matrix group $G$, return a positive definite symmetric $G$-invariant form.

<a id="function-invariantforms-grpmat"></a>
#### `InvariantForms(G): GrpMat -> [ AlgMatElt ]`

<a id="function-symmetricforms-grpmat"></a>
#### `SymmetricForms(G): GrpMat -> [ AlgMatElt ]`

<a id="function-antisymmetricforms-grpmat"></a>
#### `AntisymmetricForms(G): GrpMat -> [ AlgMatElt ]`

For an integral or rational matrix group $G$, return a basis for the space of $G$-linear forms or for the subspace of (anti-) symmetric forms respectively.

The first form returned by `InvariantForms` and `SymmetricForms` will be positive definite.

<a id="function-invariantforms-grpmat-rngintelt"></a>
#### `InvariantForms(G, n): GrpMat, RngIntElt -> [ AlgMatElt ]`

<a id="function-symmetricforms-grpmat-rngintelt"></a>
#### `SymmetricForms(G, n): GrpMat, RngIntElt -> [ AlgMatElt ]`

<a id="function-antisymmetricforms-grpmat-rngintelt"></a>
#### `AntisymmetricForms(G, n): GrpMat, RngIntElt -> [ AlgMatElt ]`

For an integral or rational matrix group $G$, return a sequence consisting of $n\geq 0$ $G$-invariant (symmetric or antisymmetric) bilinear forms for $G$.

<a id="function-numberofinvariantforms-grpmat"></a>
#### `NumberOfInvariantForms(G): GrpMat -> RngIntElt, RngIntElt`

<a id="function-numberofsymmetricforms-grpmat"></a>
#### `NumberOfSymmetricForms(G): GrpMat -> RngIntElt`

<a id="function-numberofantisymmetricforms-grpmat"></a>
#### `NumberOfAntisymmetricForms(G): GrpMat -> RngIntElt`

For an integral or rational matrix group $G$ or a $G$-lattice $L$, return the dimension of the space of (symmetric or anti-symmetric) invariant bilinear forms for $G$.

The algorithm uses a modular method which is much faster than the actual computation of the forms.

### Endomorphisms

<a id="function-endomorphismring-grpmat"></a>
#### `EndomorphismRing(G): GrpMat -> AlgMat`

<a id="function-endomorphismalgebra-grpmat"></a>
#### `EndomorphismAlgebra(G): GrpMat -> AlgMat`

For an integral or rational matrix group $G$, return the endomorphism ring (i.e. the commuting algebra) of $G$ as a subalgebra of $M_n({\mathbb{Z}})$ or $M_n({\mathbb{Q}})$ respectively.

<a id="function-centreofendomorphismring-grpmat"></a>
#### `CentreOfEndomorphismRing(G): GrpMat -> AlgMat`

<a id="function-centreofendomorphismalgebra-grpmat"></a>
#### `CentreOfEndomorphismAlgebra(G): GrpMat -> AlgMat`

For an integral or rational matrix group $G$, return the center of the endomorphism ring (i.e. the commuting algebra) of $G$ as a subalgebra of $M_n({\mathbb{Z}})$ or $M_n({\mathbb{Q}})$ respectively.

<a id="function-dimensionofendomorphismring-grpmat"></a>
#### `DimensionOfEndomorphismRing(G): GrpMat -> RngIntElt`

Return the dimension of the endomorphism ring of an integral or rational matrix group $G$ by a modular method.

<a id="function-dimensionofcentreofendomorphismring-grpmat"></a>
#### `DimensionOfCentreOfEndomorphismRing(G): GrpMat -> RngIntElt`

Return the dimension of the centre of the endomorphism ring of an integral or rational matrix group $G$ by a modular method.

<a id="function-endomorphisms-grpmat-rngintelt"></a>
#### `Endomorphisms(G, n): GrpMat, RngIntElt -> [ AlgMatElt ]`

For an integral or rational matrix group $G$, return a sequence containing $n$ independent endomorphisms of $G$. $n$ must be in the range $[0 .. d]$, where $d$ is the dimension of the endomorphism ring of $G$.

<a id="function-centralendomorphisms-grpmat-rngintelt"></a>
#### `CentralEndomorphisms(G, n): GrpMat, RngIntElt -> [ AlgMatElt ]`

For an integral or rational matrix group $G$, return a sequence containing $n$ independent central endomorphisms of $G$. $n$ must be in the range $[0 .. d]$, where $d$ is the dimension of the centre of the endomorphism ring of $G$.

### New Groups From Others

<a id="function-bravaisgroup-grpmat-rngint"></a>
#### `BravaisGroup(G): GrpMat[RngInt] -> GrpMat`

For a finite integral matrix group $G$, compute its Bravais group which is the integral group fixing all symmetric bilinear forms fixed by $G$.

<a id="function-integralgroup-grpmat"></a>
#### `IntegralGroup(G): GrpMat -> GrpMat, AlgMatElt`

<a id="function-integralgroup-mtrx"></a>
#### `IntegralGroup(G): [Mtrx] -> [Mtrx], AlgMatElt`

Return the action of the finite rational matrix group $G$ on an invariant lattice as an integral matrix group, thus giving an equivalent integral group $H$, together with the transformation matrix $T$ from the standard lattice to the invariant lattice. Thus $H = T\cdot G\cdot T^{-1}$.

### Perfect Forms and Normalizers

<a id="function-perfectforms-grpmat-rngint"></a>
#### `PerfectForms(G): GrpMat[RngInt] -> SeqEnum`

```magma
Limit: RngIntElt                    Default: Infinity()
```

A positive definite symmetric $G$-invariant form $F$ is called $G$-perfect if for every nonzero symmetric $G$-invariant form $F'$ there exists some shortest vector $x$ of $F$ such that $F'x^{tr}x$ has nonzero trace.

The normalizer of the Bravais group of $G$ in ${\operatorname{GL}}_n({\mathbb{Z}})$ acts on the set of integral $G$-perfect forms whose entries have GCD $1$ and the number of orbits is finite. This function returns a sequence of representatives of these orbits.

If `Limit` is set to a positive integer $m$, then the algorithm stops after $m$ orbits have been enumerated.

<a id="function-normalizerglz-grpmat-rngint"></a>
#### `NormalizerGLZ(G): GrpMat[RngInt] -> GrpMat[RngInt]`

<a id="function-centralizerglz-grpmat-rngint"></a>
#### `CentralizerGLZ(G): GrpMat[RngInt] -> GrpMat[RngInt]`

```magma
IsBravais: BoolElt                    Default: false
```

Given a finite subgroup $G$ of ${\operatorname{GL}}_n({\mathbb{Z}})$, returns the normalizer or centralizer of $G$ in ${\operatorname{GL}}_n({\mathbb{Z}})$.

If $G$ is known to be equal to its Bravais group, one can set `IsBravais` to `true` to speed up the computation.

The algorithm employed is a variation of Opgenorth’s normalizer algorithm [[Opg01](https://docs.magma-maths.org/references.md#cite-opgenorth)].

### Conjugacy

<a id="function-zclasses-grpmat"></a>
#### `ZClasses(G): GrpMat -> SeqEnum, SeqEnum`

```magma
Homogeneously: BoolElt                    Default: false
```

Given a finite integral or rational matrix group $G$, its ${\operatorname{GL}}_n({\mathbb{Q}})$-conjugacy class splits into finitely many ${\operatorname{GL}}(n,{\mathbb{Z}})$-conjugacy classes. Representatives of these classes are constructed as the action of $G$ on some $G$-invariant sublattices. More precisely, the ${\operatorname{GL}}(n,{\mathbb{Z}})$-conjugacy classes are in bijection with the orbits of $G$-invariant lattices under the normalizer $N$ of $G$ in ${\operatorname{GL}}(n, {\mathbb{Q}})$.

A $G$-lattice $L'$ belongs to a $G$-lattice $L$ if $L = \sum_i L' e_i$ where $e_1,\dots,e_r$ denote the central idempotents of the endomorphism ring of $G$. Further, $L$ is called *homogeneously decomposable* if $L$ belongs to itself.

The algorithm will first compute representatives $L_1, \dots,L_k$ of the orbits of homogeneously decomposable $G$-lattices under the action of $N$.

In a second step, it will then compute the $G$-lattices $L_{i, j}$ belonging to $L_i$ up to the action of $N$.

The second return value will then consist of a sequence of $k$ sequences $T_1,\dots,T_k$. The first element $T_i[1]$ is the basis matrix of $L_i$, the following entries are basis matrices of the lattices $L_{i, j}$.

The first return value is a sequence of integral matrix groups describing the action of $G$ on the lattices $L_{1,1}, L_{1,2}, \dots$. Hence these groups correspond to the ${\operatorname{GL}}_n({\mathbb{Z}})$-conjugacy classes of $G$.

If `Homogeneously` is set to `true`, the function will only compute the homogeneously decomposable lattices $L_1,\dots, L_k$ and the corresponding matrix groups. (If $G$ is reducible, this option is much faster, but will not yield all conjugacy classes / orbits of lattices.)

<a id="function-isglzconjugate-grpmat-rngint-grpmat-rngint"></a>
#### `IsGLZConjugate(G, H): GrpMat[RngInt], GrpMat[RngInt] -> BoolElt, GrpMatElt`

Tests whether the finite integral matrix groups $G$ and $H$ are conjugate in ${\operatorname{GL}}_n({\mathbb{Z}})$. If so, a matrix $x$ such that $G^x = H$ is also returned.

<a id="function-isbravaisequivalent-grpmat-rngint-grpmat-rngint"></a>
#### `IsBravaisEquivalent(G, H): GrpMat[RngInt], GrpMat[RngInt] -> BoolElt, GrpMatElt`

Given two finite integral matrix groups $G$ and $H$, tests whether their Bravais groups $B(G)$ and $B(H)$ are conjugate in ${\operatorname{GL}}_n({\mathbb{Z}})$. If so, a matrix $x$ such that $B(G)^x = B(H)$ is also returned.

Note that this function does not need to compute the Bravais groups and hence it is faster than calling `IsGLZConjugate` on the Bravais groups directly.

If $G$ and $H$ are known to be Bravais groups, this function is usually more efficient than calling `IsGLZConjugate`.

<a id="function-isglqconjugate-grpmat-grpmat"></a>
#### `IsGLQConjugate(G, H): GrpMat, GrpMat -> BoolElt, GrpMatElt`

```magma
Al: MonStgElt                    Default: 
```

Tests whether the finite rational matrix groups $G$ and $H$ are conjugate in ${\operatorname{GL}}_n({\mathbb{Q}})$. If so, a matrix $x$ such that $G^x = H$ is also returned.

There are currently two algorithms available. If the optional parameter `Al` equals `"Aut"`, Magma will use the `GModule`-machinery together with the outer automorphism group of $H$. If `Al` is set to `"ZClasses"`, Magma splits the ${\operatorname{GL}}(n, {\mathbb{Q}})$-conjugacy class of $H$ into ${\operatorname{GL}}_n({\mathbb{Z}})$-conjugacy classes and then decides whether an integral copy of $G$ lies in one of these classes by several calls to `IsGLZConjugate`.

If `Al` is not provided, a sensible choice is made by the system.

### Conjugacy Tests for Matrices

Given two $n \times n$ matrices $A$ and $B$ with rational or integral entries, Magma can test whether $A$ is conjugate to $B$ in ${\operatorname{GL}}_n(Z)$.

Two algorithms are available for this task. Currently, the implementation of the first is limited to the cases where $A,B$ have finite order or where $n=2$. This limitation will be removed in future versions.

<a id="function-isglzconjugate-algmatelt-algmatelt"></a>
#### `IsGLZConjugate(A, B): AlgMatElt, AlgMatElt -> BoolElt, GrpMatElt`

<a id="function-isglzconjugate-grpmatelt-grpmatelt"></a>
#### `IsGLZConjugate(A, B): GrpMatElt, GrpMatElt -> BoolElt, GrpMatElt`

<a id="function-isslzconjugate-algmatelt-algmatelt"></a>
#### `IsSLZConjugate(A, B): AlgMatElt, AlgMatElt -> BoolElt, GrpMatElt`

<a id="function-isslzconjugate-grpmatelt-grpmatelt"></a>
#### `IsSLZConjugate(A, B): GrpMatElt, GrpMatElt -> BoolElt, GrpMatElt`

Tests whether two rational or integral matrices $A$ and $B$ are conjugate in ${\operatorname{GL}}_n({\mathbb{Z}})$ or ${\operatorname{SL}}_n({\mathbb{Z}})$. If so, a matrix $x$ such that $A^x = B$ is also returned.

<a id="function-centralizerglz-algmatelt"></a>
#### `CentralizerGLZ(A): AlgMatElt -> GrpMat`

<a id="function-centralizerglz-grpmatelt"></a>
#### `CentralizerGLZ(A): GrpMatElt -> GrpMat`

Given a rational or integral matrix $A$, this function returns its centralizer in ${\operatorname{GL}}_n({\mathbb{Z}})$. The current implementation is limited to the cases where either $A$ has finite order or $A$ is a $2\times 2$ matrix.

The second algorithm to decide conjugacy in ${\operatorname{GL}}_n({\mathbb{Z}})$ was developed by Eick, Hofmann, and O’Brien [[EHO19](https://docs.magma-maths.org/references.md#cite-eick-hofmann-obrien)] and it does *not* assume that the matrices have finite order. The implementation was prepared by the authors; it incorporates code prepared by David Husert [[Hus16](https://docs.magma-maths.org/references.md#cite-husert16)] for the special case where the matrices are either nilpotent or have irreducible characteristic polynomials. It also uses Sebastian Schönnenbeck’s implementation of an algorithm of Voronoi to compute unit groups of orders.

<a id="function-areglconjugate-algmatelt-algmatelt"></a>
#### `AreGLConjugate(A, B : parameters): AlgMatElt, AlgMatElt -> BoolElt, AlgMatElt`

<a id="function-areglconjugate-grpmatelt-grpmatelt"></a>
#### `AreGLConjugate(A, B : parameters): GrpMatElt, GrpMatElt -> BoolElt, GrpMatElt`

```magma
UseHusert: BoolElt                    Default: true
GRH      : BoolElt                    Default: true
```

Tests whether two integral or rational matrices $A$ and $B$ are conjugate in ${\operatorname{GL}}_n({\mathbb{Z}})$. If so, a matrix $x$ such that $A^x = B$ is also returned.

If `UseHusert` is `true` then use Husert’s algorithm for matrices that are either nilpotent or have irreducible characteristic polynomials.

If `GRH` is `true` then assume the generalised Riemann hypothesis holds. This impacts on the efficiency of the algorithm: a positive answer is always verifiable since the algorithm returns a conjugating element.

<a id="function-glcentraliser-algmatelt"></a>
#### `GLCentraliser(A : parameters): AlgMatElt -> GrpMat`

<a id="function-glcentraliser-grpmatelt"></a>
#### `GLCentraliser(A : parameters): GrpMatElt -> GrpMat`

```magma
GRH: BoolElt                    Default: true
```

Given an integral or rational matrix $A$, this function returns its centralizer in ${\operatorname{GL}}_n({\mathbb{Z}})$. The optional parameter is as defined for `AreGLConjugate`.

The verbose flag `SetVerbose ("GLConjugacy", n)` where $n = 0, 1, 2$ will provide information on the progress of the algorithms.

### Examples

<a id="example-ex-000ead"></a>
#### `Example: Integral Classes of a Dihedral Representation (ex-000ead)`

We split the ${\operatorname{GL}}_3({\mathbb{Q}})$-conjugacy class of the following faithful representation of the dihedral group with $12$ elements.

```magma
> G := MatrixGroup< 3, Integers() |
>  [ 1, -1, 0, 0, -1, 0, 0, 0, 1 ],
>  [ 1, -1, 0, 1, 0, 0, 0, 0, -1 ] >;
> Z, T:= ZClasses(G);
> #Z;
3
> < #t : t in T >;
<1, 2>
```

So there are 2 classes of homogeneously decomposable lattices represented by `T[1,1]` and `T[2,1]`. The third lattice `T[2,2]` belongs to `T[2,1]` as we check.

```magma
> Q := Rationals();
> GQ := ChangeRing(G, Q);
> Ids := CentralIdempotents(EndomorphismRing(GQ));
> L := VerticalJoin([ Matrix(Integers(), T[2,2] * i) : i in Ids]);
> Image(L) eq Image(Matrix(Integers(), T[2,1]));
true
```

Finally, we check that the $3$ ${\operatorname{GL}}_3({\mathbb{Z}})$-conjugacy classes stored in `Z` correspond to the $3$ lattices in `T`.

```magma
> TT := &cat T;
> [ GQ eq ChangeRing(Z[i], Q)^(GL(3, Q) ! TT[i]) : i in [1..#Z] ];
[ true, true, true ]
```

<a id="example-ex-0cc747"></a>
#### `Example: Rational but Not Integral Conjugacy (ex-0cc747)`

We test that the automorphism groups of the lattices $B_{8}$ and $D_{8}$ are conjugate in ${\operatorname{GL}}_{8}({\mathbb{Q}})$ but not in ${\operatorname{GL}}_{8}({\mathbb{Z}})$.

```magma
> G := AutomorphismGroup( Lattice("B", 8) );
> H := AutomorphismGroup( Lattice("D", 8) );
> ok, x := IsGLQConjugate(G, H); ok, x;
true
[ 1 -1  0  0  0  0  0  0]
[ 1 -1 -2  0  0  0  0  0]
[-1  1  2  2  2  2  2  2]
[ 1  1  0  0  0  0  0  0]
[-1  1  2  2  2  2  2  0]
[ 1 -1 -2 -2 -2  0  0  0]
[-1  1  2  2  2  2  0  0]
[-1  1  2  2  0  0  0  0]
> Determinant(x);
-128
> IsGLZConjugate(G,H);
false
```

<a id="example-ex-7ed711"></a>
#### `Example: Unimodular Conjugating Matrix (ex-7ed711)`

Let $C$ be the companion matrix of the fifth cyclotomic polynomial. We find a unimodular matrix that induces the automorphism $C -> C^2$.

```magma
> C:= CompanionMatrix(CyclotomicPolynomial(5));
> ok, h:= IsGLZConjugate(C, C^2); ok;
true
> C^2 eq h^-1 * C * h;
true
```

We now check by hand that this automorphism cannot be realized by a matrix of determinant $1$.

```magma
> Determinant(h);
-1
> G:= CentralizerGLZ(C);
> [ Determinant(g) : g in Generators(G) ];
[1, 1, 1]
```

Of course, we could also just ask:

```magma
> IsSLZConjugate(C, C^2);
false
```

<a id="example-ex-2c3b15"></a>
#### `Example: Integral Conjugacy and Centralisers (ex-2c3b15)`

We use the algorithm of Eick *et al.* [[EHO19](https://docs.magma-maths.org/references.md#cite-eick-hofmann-obrien)] to decide integral conjugacy and to construct integral centralisers.

```magma
> A := GL(4, Integers ())!
>  [ 1, 0, 0, -3, 1, 1, -4, -3,
>    0, 0, -1, 0, 5, 5, -21, -14 ];
> B := GL(4, Integers ())!
> [-104, -21, -8, -3, 7729, 1552, 253, 218,
>   0, 0, -1, 0, -51848, -10407, -1532, -1460 ];
> flag, C := AreGLConjugate (A, B);
> flag;
true
> assert C^-1 * A * C eq B;
> C := GLCentraliser (A);
> assert forall{c * A eq A * c: c in Generators (C)};
>
> // another example with rational entries
> Q := Rationals ();
> A := GL(3,Q)!
> [ -5/3, -13/3, 25/3,
>   -7/3, 19/3, -16/3,
>   -5/3, 5/3, -2/3 ];
> B := GL(3, Q) !
> [ -19/3, -21, -119/3,
>    -1, 1, -2,
>    5/3, 5, 28/3 ];
> f, C := AreGLConjugate (A, B);
> C;
[ 1  2  4]
[ 0 -1 -2]
[ 0  0 -1]
> C := GL(3, Q) ! C;
> assert A^C eq B;
> C := GLCentraliser (A);
> C := sub<GL(3, Q) | Generators (C)>;
> assert forall{c * A eq A * c: c in Generators (C)};
```

<a id="soluble"></a>
<a id="chapgrppc"></a>
## Finite Soluble Groups

- [Introduction](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/introduction.md)
  - [Power-Conjugate Presentations](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/introduction.md#power-conjugate-presentations)
- [Creation of a Group](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/definition.md)
  - [Construction Functions](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/definition.md#construction-functions)
    - [`CyclicGroup(GrpPC, n): Cat, RngIntElt → GrpPC`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/definition.md#function-cyclicgroup-cat-rngintelt)
    - [`AbelianGroup(GrpPC, Q): Cat, [RngIntElt] → GrpPC`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/definition.md#function-abeliangroup-cat-rngintelt)
    - [`DihedralGroup(GrpPC, n): Cat, RngIntElt → GrpPC`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/definition.md#function-dihedralgroup-cat-rngintelt)
    - [`ExtraSpecialGroup(GrpPC, p, n : parameters): Cat, RngIntElt, RngIntElt → GrpPC`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/definition.md#function-extraspecialgroup-cat-rngintelt-rngintelt)
    - [Example: Pc-Representation of a Cyclic Group](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/definition.md#example-ex-a851f0)
  - [Definition by Presentation](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/definition.md#definition-by-presentation)
    - [`PolycyclicGroup< x₁, ..., xₙ | R : parameters >: List(Identifiers), List(GrpFPRel) → GrpPC, Map`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/definition.md#constructor-constructor-polycyclicgroup-list-identifiers-list-grpfprel-grppc-map)
    - [`quo< GrpPC : F | R : parameters >: GrpFP, List(GrpFPRel) → GrpPC, Map`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/definition.md#constructor-constructor-quo-grpfp-list-grpfprel-grppc-map)
    - [Example: Group of Order 80 from a Presentation](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/definition.md#example-ex-a8ae01)
  - [Possibly Inconsistent Presentations](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/definition.md#possibly-inconsistent-presentations)
    - [`IsConsistent(G): GrpPC → BoolElt`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/definition.md#function-isconsistent-grppc)
    - [Example: Checking Consistency of Presentations](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/definition.md#example-ex-a62513)
- [Basic Group Properties](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/group-properties.md)
  - [Infrastructure](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/group-properties.md#infrastructure)
    - [`G . i: GrpPC, RngIntElt → GrpPCElt`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/group-properties.md#operation-operation-grppc-rngintelt-grppcelt)
    - [`Generators(G): GrpPC → SetEnum`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/group-properties.md#function-generators-grppc)
    - [`NumberOfGenerators(G): GrpPC → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/group-properties.md#function-numberofgenerators-grppc)
    - [`Ngens(G): GrpPC → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/group-properties.md#function-ngens-grppc)
    - [`PCGenerators(G): GrpPC → SetIndx`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/group-properties.md#function-pcgenerators-grppc)
    - [`NumberOfPCGenerators(G): GrpPC → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/group-properties.md#function-numberofpcgenerators-grppc)
    - [`NPCGenerators(G): GrpPC → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/group-properties.md#function-npcgenerators-grppc)
    - [`NPCgens(G): GrpPC → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/group-properties.md#function-npcgens-grppc)
    - [`PCPrimes(G): GrpPC → [RngIntElt]`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/group-properties.md#function-pcprimes-grppc)
  - [Numerical Invariants](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/group-properties.md#numerical-invariants)
    - [`Order(G): GrpPC → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/group-properties.md#function-order-grppc)
    - [`# G: GrpPC → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/group-properties.md#operation-operation-grppc-rngintelt)
    - [`FactoredOrder(G): GrpPC → [<RngIntElt, RngIntElt>]`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/group-properties.md#function-factoredorder-grppc)
    - [`Exponent(G): GrpPC → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/group-properties.md#function-exponent-grppc)
  - [Predicates](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/group-properties.md#predicates)
    - [`IsAbelian(G): GrpPC → BoolElt`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/group-properties.md#function-isabelian-grppc)
    - [`IsCyclic(G): GrpPC → BoolElt`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/group-properties.md#function-iscyclic-grppc)
    - [`IsElementaryAbelian(G): GrpPC → BoolElt`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/group-properties.md#function-iselementaryabelian-grppc)
    - [`IsNilpotent(G): GrpPC → BoolElt`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/group-properties.md#function-isnilpotent-grppc)
    - [`IsPerfect(G): GrpPC → BoolElt`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/group-properties.md#function-isperfect-grppc)
    - [`IsSimple(G): GrpPC → BoolElt`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/group-properties.md#function-issimple-grppc)
    - [`IsSoluble(G): GrpPC → BoolElt`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/group-properties.md#function-issoluble-grppc)
    - [`IsSolvable(G): GrpPC → BoolElt`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/group-properties.md#function-issolvable-grppc)
    - [`IsTrivial(G): GrpPC → BoolElt`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/group-properties.md#function-istrivial-grppc)
    - [`IsSpecial(G): GrpPC → BoolElt`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/group-properties.md#function-isspecial-grppc)
    - [`IsExtraSpecial(G): GrpPC → BoolElt`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/group-properties.md#function-isextraspecial-grppc)
    - [Example: Basic Properties of Pc-Groups](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/group-properties.md#example-ex-e86fe2)
- [Homomorphisms](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/homomorphisms.md)
  - [`hom< G -> H | L >: GrpPC, GrpPC, List → Map`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/homomorphisms.md#constructor-constructor-hom-grppc-grppc-list-map)
  - [`IsHomomorphism(G, H, L): GrpPC, GrpPC, SeqEnum → BoolElt, Map`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/homomorphisms.md#function-ishomomorphism-grppc-grppc-seqenum)
  - [`IsHomomorphism(G, H, L): GrpPC, GrpPC, SetEnum[Tup] → BoolElt, Map`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/homomorphisms.md#function-ishomomorphism-grppc-grppc-setenum-tup)
  - [`IdentityHomomorphism(G): GrpPC → Map`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/homomorphisms.md#function-identityhomomorphism-grppc)
  - [`Kernel(f): Map → GrpPC`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/homomorphisms.md#function-kernel-map)
  - [`Homomorphisms(G, H): GrpPC, GrpPC → SeqEnum`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/homomorphisms.md#function-homomorphisms-grppc-grppc)
  - [Example: Homomorphisms Between Pc-Groups](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/homomorphisms.md#example-ex-d63f2e)
- [New Groups from Existing](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/extension.md)
  - [`DirectProduct(G, H): GrpPC, GrpPC → GrpPC, [Map], [Map]`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/extension.md#function-directproduct-grppc-grppc)
  - [`DirectProduct(Q): [GrpPC] → GrpPC, [ Map ], [ Map ]`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/extension.md#function-directproduct-grppc)
  - [`Extension(G, H, f): GrpPC, GrpPC, [Map] → GrpPC`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/extension.md#function-extension-grppc-grppc-map)
  - [`Extension(M, H): ModGrp, GrpPC → GrpPC`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/extension.md#function-extension-modgrp-grppc)
  - [`Extension(G, H, f, t): GrpPC, GrpPC, [Map], [GrpPCElt] → GrpPC`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/extension.md#function-extension-grppc-grppc-map-grppcelt)
  - [`Extension(G, H, f, t): GrpPC, GrpPC, [Map], {Tup} → GrpPC`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/extension.md#function-extension-grppc-grppc-map-tup)
  - [`Extension(M, H, t): ModGrp, GrpPC, [ModGrpElt] → GrpPC`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/extension.md#function-extension-modgrp-grppc-modgrpelt)
  - [`IsExtension(G, H, f): GrpPC, GrpPC, [Map] → BoolElt, GrpPC`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/extension.md#function-isextension-grppc-grppc-map)
  - [`IsExtension(M, H): ModGrp, GrpPC → BoolElt, GrpPC`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/extension.md#function-isextension-modgrp-grppc)
  - [`IsExtension(G, H, f, t): GrpPC, GrpPC, [Map], [GrpPCElt] → BoolElt, GrpPC`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/extension.md#function-isextension-grppc-grppc-map-grppcelt)
  - [`IsExtension(G, H, f, t): GrpPC, GrpPC, [Map], {Tup} → BoolElt, GrpPC`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/extension.md#function-isextension-grppc-grppc-map-tup)
  - [`IsExtension(M, H, t): ModGrp, GrpPC, [ModGrpElt] → BoolElt, GrpPC`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/extension.md#function-isextension-modgrp-grppc-modgrpelt)
  - [`WreathProduct(G, H): GrpPC, GrpPC → GrpPC`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/extension.md#function-wreathproduct-grppc-grppc)
  - [`WreathProduct(G, H, f): GrpPC, GrpPC, Map → GrpPC`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/extension.md#function-wreathproduct-grppc-grppc-map)
  - [`WreathProduct(G, H, f): GrpPC, GrpPC, [GrpPermElt] → GrpPC`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/extension.md#function-wreathproduct-grppc-grppc-grppermelt)
  - [Example: Extensions of an Elementary Abelian Group](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/extension.md#example-ex-73458c)
  - [Example: Cossey-Hawkes Conjugacy Class Sizes](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/extension.md#example-ex-9a45eb)
- [Elements](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/elements.md)
  - [Definition of Elements](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/elements.md#definition-of-elements)
    - [`G ! Q: GrpPC, [RngIntElt] → GrpPCElt`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/elements.md#operation-op-grppc-rngintelt)
    - [`ElementToSequence(x): GrpPCElt → [RngIntElt]`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/elements.md#function-elementtosequence-grppcelt)
    - [`Eltseq(x): GrpPCElt → [RngIntElt]`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/elements.md#function-eltseq-grppcelt)
    - [`Identity(G): GrpPC → GrpPCElt`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/elements.md#function-identity-grppc)
    - [`Id(G): GrpPC → GrpPCElt`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/elements.md#function-id-grppc)
    - [`G ! 1: GrpPC, RngIntElt → GrpPCElt`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/elements.md#operation-op-grppc-rngintelt-2)
    - [Example: Defining Elements of a Pc-Group](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/elements.md#example-ex-027472)
  - [Arithmetic Operations on Elements](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/elements.md#arithmetic-operations-on-elements)
    - [`g * h: GrpPCElt, GrpPCElt → GrpPCElt`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/elements.md#operation-op-times-grppcelt-grppcelt)
    - [`g *:= h: GrpPCElt, GrpPCElt → GrpPCElt`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/elements.md#operation-operation-grppcelt-grppcelt-grppcelt)
    - [`g ^ n: GrpPCElt, RngIntElt → GrpPCElt`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/elements.md#operation-op-pow-grppcelt-rngintelt)
    - [`g ^:= n: GrpPCElt, RngIntElt → GrpPCElt`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/elements.md#operation-operation-grppcelt-rngintelt-grppcelt)
    - [`g / h: GrpPCElt, GrpPCElt → GrpPCElt`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/elements.md#operation-op-div-grppcelt-grppcelt)
    - [`g /:= h: GrpPCElt, GrpPCElt → GrpPCElt`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/elements.md#operation-operation-grppcelt-grppcelt-grppcelt-2)
    - [`g ^ h: GrpPCElt, GrpPCElt → GrpPCElt`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/elements.md#operation-op-pow-grppcelt-grppcelt)
    - [`g ^:= h: GrpPCElt, GrpPCElt → GrpPCElt`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/elements.md#operation-operation-grppcelt-grppcelt-grppcelt-3)
    - [`(g₁, ..., gₙ): List(GrpPCElt) → GrpPCElt`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/elements.md#literal-literal-g1-gn-list-grppcelt-grppcelt)
  - [Properties of Elements](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/elements.md#properties-of-elements)
    - [`Order(x): GrpPCElt → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/elements.md#function-order-grppcelt)
    - [`Parent(x): GrpPCElt → GrpPC`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/elements.md#function-parent-grppcelt)
  - [Predicates for Elements](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/elements.md#predicates-for-elements)
    - [`g eq h: GrpPCElt, GrpPCElt → BoolElt`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/elements.md#operation-op-eq-grppcelt-grppcelt)
    - [`g ne h: GrpPCElt, GrpPCElt → BoolElt`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/elements.md#operation-op-ne-grppcelt-grppcelt)
    - [`IsIdentity(g): GrpPCElt → BoolElt`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/elements.md#function-isidentity-grppcelt)
    - [`IsId(g): GrpPCElt → BoolElt`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/elements.md#function-isid-grppcelt)
    - [`IsConjugate(G, g, h): GrpPC, GrpPCElt, GrpPCElt → BoolElt, GrpPCElt`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/elements.md#function-isconjugate-grppc-grppcelt-grppcelt)
    - [Example: Testing Whether Elements Commute](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/elements.md#example-ex-7b7701)
  - [Set Operations](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/elements.md#set-operations)
    - [`NumberingMap(G): GrpPC → Map`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/elements.md#function-numberingmap-grppc)
    - [`Random(G): GrpPC → GrpPCElt`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/elements.md#function-random-grppc)
    - [`RandomProcess(G): GrpPC → Process`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/elements.md#function-randomprocess-grppc)
    - [`Random(P): Process → GrpPCElt`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/elements.md#function-random-process)
    - [`Representative(G): GrpPC → GrpPCElt`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/elements.md#function-representative-grppc)
    - [`Rep(G): GrpPC → GrpPCElt`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/elements.md#function-rep-grppc)
    - [Example: Numbering Group Elements](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/elements.md#example-ex-0f7a7b)
    - [Example: Set Product of Two Subgroups](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/elements.md#example-ex-91703e)
- [Conjugacy](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/elt-conjugacy.md)
  - [`Class(H, g): GrpPC, GrpPCElt → { GrpPCElt}`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/elt-conjugacy.md#function-class-grppc-grppcelt)
  - [`Conjugates(H, g): GrpPC, GrpPCElt → { GrpPCElt}`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/elt-conjugacy.md#function-conjugates-grppc-grppcelt)
  - [`g ^ H: GrpPCElt, GrpPC → { GrpPCElt}`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/elt-conjugacy.md#operation-op-pow-grppcelt-grppc)
  - [`ConjugacyClasses(G): GrpPC → [ <RngIntElt, RngIntElt, GrpPCElt> ]`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/elt-conjugacy.md#function-conjugacyclasses-grppc)
  - [`Classes(G): GrpPC → [ <RngIntElt, RngIntElt, GrpPCElt> ]`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/elt-conjugacy.md#function-classes-grppc)
  - [`ClassMap(G): GrpPC → Map`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/elt-conjugacy.md#function-classmap-grppc)
  - [`ClassRepresentative(G, x): GrpPC, GrpPCElt → GrpPCElt`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/elt-conjugacy.md#function-classrepresentative-grppc-grppcelt)
  - [`ClassRepresentative(G, i): GrpPC, RngIntElt → GrpPCElt`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/elt-conjugacy.md#function-classrepresentative-grppc-rngintelt)
  - [`ClassCentraliser(G, i): GrpPC, RngIntElt → GrpPCElt`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/elt-conjugacy.md#function-classcentraliser-grppc-rngintelt)
  - [`ClassCentralizer(G, i): GrpPC, RngIntElt → GrpPCElt`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/elt-conjugacy.md#function-classcentralizer-grppc-rngintelt)
  - [`IsConjugate(G, g, h): GrpPC, GrpPCElt, GrpPCElt → BoolElt, GrpPCElt`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/elt-conjugacy.md#function-isconjugate-grppc-grppcelt-grppcelt-2)
  - [`NumberOfClasses(G): GrpPC → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/elt-conjugacy.md#function-numberofclasses-grppc)
  - [`Nclasses(G): GrpPC → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/elt-conjugacy.md#function-nclasses-grppc)
  - [`PowerMap(G): GrpPC → Map`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/elt-conjugacy.md#function-powermap-grppc)
  - [Example: Conjugacy Classes of SL(2, 3)](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/elt-conjugacy.md#example-ex-bdfb19)
- [Subgroups](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/subgroups.md)
  - [Definition of Subgroups by Generators](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/subgroups.md#definition-of-subgroups-by-generators)
    - [`sub<G | L>: GrpPC, List → GrpPC, Map`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/subgroups.md#constructor-constructor-sub-grppc-list-grppc-map)
    - [`ncl<G | L>: GrpPC, List → GrpPC, Map`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/subgroups.md#constructor-constructor-ncl-grppc-list-grppc-map)
    - [Example: Creating Subgroups by Generators](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/subgroups.md#example-ex-9f724a)
  - [Membership and Coercion](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/subgroups.md#membership-and-coercion)
    - [`g in G: GrpPCElt, GrpPC → BoolElt`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/subgroups.md#operation-op-in-grppcelt-grppc)
    - [`g notin G: GrpPCElt, GrpPC → BoolElt`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/subgroups.md#operation-op-notin-grppcelt-grppc)
    - [`G ! g: GrpPC, GrpPCElt → GrpPCElt`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/subgroups.md#operation-op-grppc-grppcelt)
    - [`H ! g: GrpPC, GrpPCElt → GrpPCElt`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/subgroups.md#operation-op-grppc-grppcelt-2)
    - [`K ! g: GrpPC, GrpPCElt → GrpPCElt`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/subgroups.md#operation-op-grppc-grppcelt-3)
    - [Example: Membership and Coercion in Subgroups](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/subgroups.md#example-ex-ac7047)
  - [Inclusion and Equality](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/subgroups.md#inclusion-and-equality)
    - [`S subset G: { GrpPCElt}, GrpPC → BoolElt`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/subgroups.md#operation-op-subset-grppcelt-grppc)
    - [`S notsubset G: { GrpPCElt}, GrpPC → BoolElt`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/subgroups.md#operation-operation-notsubset-grppcelt-grppc-boolelt)
    - [`H subset G: GrpPC, GrpPC → BoolElt`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/subgroups.md#operation-op-subset-grppc-grppc)
    - [`IsSubgroup(H,G): GrpPC, GrpPC → BoolElt`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/subgroups.md#function-issubgroup-grppc-grppc)
    - [`H notsubset G: GrpPC, GrpPC → BoolElt`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/subgroups.md#operation-operation-notsubset-grppc-grppc-boolelt)
    - [`G eq H: GrpPC, GrpPC → BoolElt`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/subgroups.md#operation-op-eq-grppc-grppc)
    - [`G ne H: GrpPC, GrpPC → BoolElt`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/subgroups.md#operation-op-ne-grppc-grppc)
    - [`InclusionMap(G, H): GrpPC, GrpPC → Map`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/subgroups.md#function-inclusionmap-grppc-grppc)
  - [Standard Subgroup Constructions](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/subgroups.md#standard-subgroup-constructions)
    - [`H ^ g: GrpPC, GrpPCElt → GrpPC`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/subgroups.md#operation-op-pow-grppc-grppcelt)
    - [`Conjugate(H, g): GrpPC, GrpPCElt → GrpPC`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/subgroups.md#function-conjugate-grppc-grppcelt)
    - [`H meet K: GrpPC, GrpPC → GrpPC`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/subgroups.md#operation-op-meet-grppc-grppc)
    - [`H meet:= K: GrpPC, GrpPC → GrpPC`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/subgroups.md#operation-operation-meet-grppc-grppc-grppc)
    - [`CommutatorSubgroup(G, H, K): GrpPC, GrpPC, GrpPC → GrpPC`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/subgroups.md#function-commutatorsubgroup-grppc-grppc-grppc)
    - [`CommutatorSubgroup(H, K): GrpPC, GrpPC → GrpPC`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/subgroups.md#function-commutatorsubgroup-grppc-grppc)
    - [`Centralizer(G, g): GrpPC, GrpPCElt → GrpPC`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/subgroups.md#function-centralizer-grppc-grppcelt)
    - [`Centraliser(G, g): GrpPC, GrpPCElt → GrpPC`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/subgroups.md#function-centraliser-grppc-grppcelt)
    - [`Centralizer(G, H): GrpPC, GrpPC → GrpPC`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/subgroups.md#function-centralizer-grppc-grppc)
    - [`Centraliser(G, H): GrpPC, GrpPC → GrpPC`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/subgroups.md#function-centraliser-grppc-grppc)
    - [`Core(G, H): GrpPC, GrpPC → GrpPC`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/subgroups.md#function-core-grppc-grppc)
    - [`H ^ G: GrpPC, GrpPC → GrpPC`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/subgroups.md#operation-op-pow-grppc-grppc)
    - [`NormalClosure(G, H): GrpPC, GrpPC → GrpPC`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/subgroups.md#function-normalclosure-grppc-grppc)
    - [`Normalizer(G, H): GrpPC, GrpPC → GrpPC`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/subgroups.md#function-normalizer-grppc-grppc)
    - [`Normaliser(G, H): GrpPC, GrpPC → GrpPC`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/subgroups.md#function-normaliser-grppc-grppc)
    - [Example: Subgroup Constructions](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/subgroups.md#example-ex-38016c)
  - [Properties of Subgroups](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/subgroups.md#properties-of-subgroups)
    - [`Index(G, H): GrpPC, GrpPC → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/subgroups.md#function-index-grppc-grppc)
    - [`FactoredIndex(G, H): GrpPC, GrpPC → [<RngIntElt, RngIntElt>]`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/subgroups.md#function-factoredindex-grppc-grppc)
  - [Predicates for Subgroups](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/subgroups.md#predicates-for-subgroups)
    - [`IsCentral(G, H): GrpPC, GrpPC → BoolElt`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/subgroups.md#function-iscentral-grppc-grppc)
    - [`IsConjugate(G, H, K): GrpPC, GrpPC, GrpPC → BoolElt, GrpPCElt`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/subgroups.md#function-isconjugate-grppc-grppc-grppc)
    - [`IsMaximal(G, H): GrpPC, GrpPC → BoolElt`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/subgroups.md#function-ismaximal-grppc-grppc)
    - [`IsNormal(G, H): GrpPC, GrpPC → BoolElt`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/subgroups.md#function-isnormal-grppc-grppc)
    - [`IsSelfNormalizing(G, H): GrpPC, GrpPC → BoolElt`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/subgroups.md#function-isselfnormalizing-grppc-grppc)
    - [`IsSubnormal(G, H): GrpPC, GrpPC → BoolElt`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/subgroups.md#function-issubnormal-grppc-grppc)
    - [Example: Predicates for Subgroups](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/subgroups.md#example-ex-340cb9)
  - [Hall $\pi$-Subgroups and Sylow Systems](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/subgroups.md#hall-pi-subgroups-and-sylow-systems)
    - [`ComplementBasis(G): GrpPC → [GrpPC]`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/subgroups.md#function-complementbasis-grppc)
    - [`HallSubgroup(G, S): GrpPC, { RngIntElt} → GrpPC`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/subgroups.md#function-hallsubgroup-grppc-rngintelt)
    - [`HallSubgroup(G, S): GrpPC, RngIntElt → GrpPC`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/subgroups.md#function-hallsubgroup-grppc-rngintelt-2)
    - [`pCore(G, S): GrpPC, { RngIntElt} → GrpPC`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/subgroups.md#function-pcore-grppc-rngintelt)
    - [`pCore(G, S): GrpPC, RngIntElt → GrpPC`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/subgroups.md#function-pcore-grppc-rngintelt-2)
    - [`SylowBasis(G): GrpPC → [GrpPC]`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/subgroups.md#function-sylowbasis-grppc)
    - [`SylowSubgroup(G, p): GrpPC, RngIntElt → GrpPC`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/subgroups.md#function-sylowsubgroup-grppc-rngintelt)
    - [`Sylow(G, p): GrpPC, RngIntElt → GrpPC`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/subgroups.md#function-sylow-grppc-rngintelt)
    - [`SystemNormalizer(G): GrpPC → GrpPC`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/subgroups.md#function-systemnormalizer-grppc)
    - [`SystemNormaliser(G): GrpPC → GrpPC`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/subgroups.md#function-systemnormaliser-grppc)
    - [Example: Hall Subgroups of a Wreath Product](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/subgroups.md#example-ex-475f0f)
  - [Conjugacy Classes of Subgroups](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/subgroups.md#conjugacy-classes-of-subgroups)
    - [`SubgroupClasses(G): GrpPC → SeqEnum`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/subgroups.md#function-subgroupclasses-grppc)
    - [`Subgroups(G): GrpPC → SeqEnum`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/subgroups.md#function-subgroups-grppc)
    - [`AbelianSubgroups(G): GrpPC → SeqEnum`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/subgroups.md#function-abeliansubgroups-grppc)
    - [`CyclicSubgroups(G): GrpPC → SeqEnum`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/subgroups.md#function-cyclicsubgroups-grppc)
    - [`ElementaryAbelianSubgroups(G): GrpPC → SeqEnum`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/subgroups.md#function-elementaryabeliansubgroups-grppc)
    - [`NilpotentSubgroups(G): GrpPC → SeqEnum`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/subgroups.md#function-nilpotentsubgroups-grppc)
    - [`LowIndexSubgroups(G, n): GrpPC, RngIntElt → []`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/subgroups.md#function-lowindexsubgroups-grppc-rngintelt)
    - [`MaximalSubgroups(G): GrpPC → [GrpPC]`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/subgroups.md#function-maximalsubgroups-grppc)
    - [`SubgroupLattice(G): GrpPC → SubGrpLat`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/subgroups.md#function-subgrouplattice-grppc)
    - [`BurnsideMatrix(G): GrpPC → AlgMatElt`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/subgroups.md#function-burnsidematrix-grppc)
    - [`TableOfMarks(G): GrpPC → AlgMatElt`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/subgroups.md#function-tableofmarks-grppc)
    - [`DisplayBurnsideMatrix(G): GrpPC`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/subgroups.md#procedure-displayburnsidematrix-grppc)
    - [Example: Subgroup Classes](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/subgroups.md#example-ex-cf7628)
- [Quotient Groups](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/quotient.md)
  - [Construction of Quotient Groups](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/quotient.md#construction-of-quotient-groups)
    - [`quo<G | L>: GrpPC, List → GrpPC, Map`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/quotient.md#constructor-constructor-quo-grppc-list-grppc-map)
    - [`G / N: GrpPC, GrpPC → GrpPC`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/quotient.md#operation-op-div-grppc-grppc)
    - [Example: Quotient Groups of a Pc-Group](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/quotient.md#example-ex-934992)
  - [Abelian and $p$-Quotients](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/quotient.md#abelian-and-p-quotients)
    - [`AbelianQuotient(G): GrpPC → GrpAb, Map`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/quotient.md#function-abelianquotient-grppc)
    - [`AbelianQuotientInvariants(G): GrpPC → SeqEnum`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/quotient.md#function-abelianquotientinvariants-grppc)
    - [`AQInvariants(G): GrpPC → SeqEnum`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/quotient.md#function-aqinvariants-grppc)
    - [`ElementaryAbelianQuotient(G, p): GrpPC, RngIntElt → GrpAb, Map`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/quotient.md#function-elementaryabelianquotient-grppc-rngintelt)
    - [`pQuotient(G, p, c : parameters ): GrpPC, RngIntElt, RngIntElt → GrpPC, Map`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/quotient.md#function-pquotient-grppc-rngintelt-rngintelt)
- [Normal Subgroups and Subgroup Series](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/normal-series.md)
  - [Characteristic Subgroups](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/normal-series.md#characteristic-subgroups)
    - [`Centre(G): GrpPC → GrpPC`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/normal-series.md#function-centre-grppc)
    - [`Center(G): GrpPC → GrpPC`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/normal-series.md#function-center-grppc)
    - [`CommutatorSubgroup(G): GrpPC → GrpPC`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/normal-series.md#function-commutatorsubgroup-grppc)
    - [`DerivedSubgroup(G): GrpPC → GrpPC`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/normal-series.md#function-derivedsubgroup-grppc)
    - [`DerivedGroup(G): GrpPC → GrpPC`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/normal-series.md#function-derivedgroup-grppc)
    - [`FittingSubgroup(G): GrpPC → GrpPC`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/normal-series.md#function-fittingsubgroup-grppc)
    - [`FittingGroup(G): GrpPC → GrpPC`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/normal-series.md#function-fittinggroup-grppc)
    - [`FrattiniSubgroup(G): GrpPC → GrpPC`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/normal-series.md#function-frattinisubgroup-grppc)
    - [`PrefrattiniSubgroup(G): GrpPC → GrpPC`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/normal-series.md#function-prefrattinisubgroup-grppc)
    - [`FrattiniQuotientRank(G): GrpPC → GrpPC`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/normal-series.md#function-frattiniquotientrank-grppc)
    - [`Hypercentre(G): GrpPC → GrpPC`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/normal-series.md#function-hypercentre-grppc)
    - [`Hypercenter(G): GrpPC → GrpPC`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/normal-series.md#function-hypercenter-grppc)
    - [`MinimalNormalSubgroups(G): GrpPC → [GrpPC]`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/normal-series.md#function-minimalnormalsubgroups-grppc)
    - [`pCore(G, S): GrpPC, { RngIntElt} → GrpPC`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/normal-series.md#function-pcore-grppc-rngintelt-3)
    - [`pCore(G, S): GrpPC, RngIntElt → GrpPC`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/normal-series.md#function-pcore-grppc-rngintelt-4)
    - [`Socle(G): GrpPC → GrpPC`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/normal-series.md#function-socle-grppc)
  - [Subgroup Series](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/normal-series.md#subgroup-series)
    - [`PrimaryAbelianBasis(G): GrpPC → [ GrpPCElt ], [ RngIntElt ]`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/normal-series.md#function-primaryabelianbasis-grppc)
    - [`AbelianBasis(G): GrpPC → [ GrpPCElt ], [ RngIntElt ]`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/normal-series.md#function-abelianbasis-grppc)
    - [`PrimaryAbelianInvariants(G): GrpPC → [RngIntElt]`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/normal-series.md#function-primaryabelianinvariants-grppc)
    - [`AbelianInvariants(G): GrpPC → [RngIntElt]`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/normal-series.md#function-abelianinvariants-grppc)
    - [`ChiefSeries(G): GrpPC → [GrpPC]`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/normal-series.md#function-chiefseries-grppc)
    - [`CompositionSeries(G): GrpPC → [GrpPC]`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/normal-series.md#function-compositionseries-grppc)
    - [`CompositionFactors(G): GrpPC → SeqEnum`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/normal-series.md#function-compositionfactors-grppc)
    - [`CompositionSeries(G, i): GrpPC, RngIntElt → [GrpPC]`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/normal-series.md#function-compositionseries-grppc-rngintelt)
    - [`DerivedSeries(G): GrpPC → [GrpPC]`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/normal-series.md#function-derivedseries-grppc)
    - [`DerivedLength(G): GrpPC → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/normal-series.md#function-derivedlength-grppc)
    - [`ElementaryAbelianSeries(G): GrpPC → [GrpPC]`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/normal-series.md#function-elementaryabelianseries-grppc)
    - [`ElementaryAbelianSeriesCanonical(G): GrpPC → [GrpPC]`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/normal-series.md#function-elementaryabelianseriescanonical-grppc)
    - [`LowerCentralSeries(G): GrpPC → [GrpPC]`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/normal-series.md#function-lowercentralseries-grppc)
    - [`NilpotencyClass(G): GrpPC → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/normal-series.md#function-nilpotencyclass-grppc)
    - [`pCentralSeries(G, p): GrpPC, RngIntElt → [GrpPC]`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/normal-series.md#function-pcentralseries-grppc-rngintelt)
    - [`SubnormalSeries(G, H): GrpPC, GrpPC → [GrpPC]`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/normal-series.md#function-subnormalseries-grppc-grppc)
    - [`UpperCentralSeries(G): GrpPC → [GrpPC]`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/normal-series.md#function-uppercentralseries-grppc)
    - [Example: Elementary Abelian Series](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/normal-series.md#example-ex-54e655)
  - [Series for $p$-groups](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/normal-series.md#series-for-p-groups)
    - [`Agemo(G, i): GrpPC, RngIntElt → GrpPC`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/normal-series.md#function-agemo-grppc-rngintelt)
    - [`Omega(G, i): GrpPC, RngIntElt → GrpPC`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/normal-series.md#function-omega-grppc-rngintelt)
    - [`JenningsSeries(G): GrpPC → [GrpPC]`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/normal-series.md#function-jenningsseries-grppc)
    - [`pClass(G): GrpPC → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/normal-series.md#function-pclass-grppc)
    - [`pRanks(G): GrpPC → [ RngIntElt ]`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/normal-series.md#function-pranks-grppc)
  - [Normal Subgroups and Complements](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/normal-series.md#normal-subgroups-and-complements)
    - [`NormalSubgroups(G): GrpPC → SeqEnum`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/normal-series.md#function-normalsubgroups-grppc)
    - [`NormalLattice(G): GrpPC → SubGrpLat`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/normal-series.md#function-normallattice-grppc)
    - [`MinimalNormalSubgroup(G): GrpPC → GrpPC`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/normal-series.md#function-minimalnormalsubgroup-grppc)
    - [`MinimalNormalSubgroup(G, N): GrpPC → GrpPC`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/normal-series.md#function-minimalnormalsubgroup-grppc-2)
    - [`Complements(G, N): GrpPC, GrpPC → SeqEnum`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/normal-series.md#function-complements-grppc-grppc)
    - [`NormalComplements(G, N): GrpPC, GrpPC → SeqEnum`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/normal-series.md#function-normalcomplements-grppc-grppc)
    - [`NormalComplements(G, H, N): GrpPC, GrpPC, GrpPC → SeqEnum`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/normal-series.md#function-normalcomplements-grppc-grppc-grppc)
    - [Example: Normal Complements](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/normal-series.md#example-ex-12efb9)
- [Cosets](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/cosets.md)
  - [Coset Tables and Transversals](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/cosets.md#coset-tables-and-transversals)
    - [`Transversal(G, H): GrpPC, GrpPC → {@ GrpPCElt  @}, Map`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/cosets.md#function-transversal-grppc-grppc)
    - [`RightTransversal(G, H): GrpPC, GrpPC → {@ GrpPCElt  @}, Map`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/cosets.md#function-righttransversal-grppc-grppc)
    - [`CosetTable(G, H): GrpPC, GrpPC → Map`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/cosets.md#function-cosettable-grppc-grppc)
    - [`Transversal(G, H, K): GrpPC, GrpPC, GrpPC → {@ GrpPCElt  @}, Map`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/cosets.md#function-transversal-grppc-grppc-grppc)
    - [`ShortCosets(p, H, G): GrpPCElt, GrpPC, GrpPC → [GrpPCElt]`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/cosets.md#function-shortcosets-grppcelt-grppc-grppc)
  - [Action on a Coset Space](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/cosets.md#action-on-a-coset-space)
    - [`CosetAction(G, H): Grp, Grp → Hom(Grp), GrpPerm, GrpPC`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/cosets.md#function-cosetaction-grp-grp)
    - [`CosetImage(G, H): Grp, Grp → GrpPerm`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/cosets.md#function-cosetimage-grp-grp)
    - [`CosetKernel(G, H): Grp, Grp → Grp`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/cosets.md#function-cosetkernel-grp-grp)
- [Automorphism Group](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/automorphism-group.md)
  - [General Soluble Group](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/automorphism-group.md#general-soluble-group)
    - [Lifting Algorithm](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/automorphism-group.md#lifting-algorithm)
      - [`AutomorphismGroup(G): GrpPC → GrpAuto`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/automorphism-group.md#function-automorphismgroup-grppc)
      - [`HasAttribute(A, "GenWeights"): GrpAuto, MonStgElt → BoolElt, [ RngIntElt ]`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/automorphism-group.md#function-hasattribute-grpauto-monstgelt-genweights)
      - [`HasAttribute(A, "WeightSubgroupOrders"): GrpAuto, MonStgElt → BoolElt, [ RngIntElt ]`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/automorphism-group.md#function-hasattribute-grpauto-monstgelt-weightsubgrouporders)
      - [Example: Automorphism Group via Lifting](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/automorphism-group.md#example-ex-29a2d6)
    - [Lifting from the Automorphism Group of a Sylow $p$-subgroup](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/automorphism-group.md#lifting-from-the-automorphism-group-of-a-sylow-p-subgroup)
      - [`AutomorphismGroupSolubleGroup(G: parameters): GrpPC → GrpAuto`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/automorphism-group.md#function-automorphismgroupsolublegroup-grppc)
      - [`IsIsomorphicSolubleGroup(G, H: parameters): GrpPC, GrpPC → BoolElt, Map`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/automorphism-group.md#function-isisomorphicsolublegroup-grppc-grppc)
      - [Example: Automorphisms of a Soluble Group](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/automorphism-group.md#example-ex-249c9b)
  - [$p$-group](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/automorphism-group.md#p-group)
    - [`AutomorphismGroup(G: parameters): GrpPC → GrpAuto`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/automorphism-group.md#function-automorphismgroup-grppc-2)
    - [Example: Automorphism Group of a p-Group](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/automorphism-group.md#example-ex-f1bbe5)
    - [`OrderAutomorphismGroupAbelianPGroup(A): SeqEnum → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/automorphism-group.md#function-orderautomorphismgroupabelianpgroup-seqenum)
    - [Example: Subgroups of an Abelian p-Group](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/automorphism-group.md#example-ex-c99f0c)
  - [Isomorphism and Standard Presentations](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/automorphism-group.md#isomorphism-and-standard-presentations)
    - [`StandardPresentation(G): GrpPC → GrpPC, Map`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/automorphism-group.md#function-standardpresentation-grppc)
    - [`StandardPresentation(G: parameters): GrpPC → GrpAuto`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/automorphism-group.md#function-standardpresentation-grppc-2)
    - [`IsIdenticalPresentation(G, H): GrpPC, GrpPC → BoolElt`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/automorphism-group.md#function-isidenticalpresentation-grppc-grppc)
    - [`IsIsomorphic(G, H): GrpPC, GrpPC → BoolElt, Map, GrpPC`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/automorphism-group.md#function-isisomorphic-grppc-grppc)
    - [Example: Isomorphism of p-Quotients](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/automorphism-group.md#example-ex-75ee54)
- [Generating $p$-groups](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/p-groups.md)
  - [`GeneratepGroups(p, d, c : parameters): RngIntElt, RngIntElt, RngIntElt → [GrpPC], RngIntElt`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/p-groups.md#function-generatepgroups-rngintelt-rngintelt-rngintelt)
  - [`Descendants(G : parameters): GrpPC → [GrpPC], RngIntElt`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/p-groups.md#function-descendants-grppc)
  - [`Descendants(G, c : parameters): GrpPC, RngIntElt → [GrpPC], RngIntElt`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/p-groups.md#function-descendants-grppc-rngintelt)
  - [Example: Descendants of a 2-Group](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/p-groups.md#example-ex-3d4202)
  - [Example: 2-Generator Groups of Exponent 4](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/p-groups.md#example-ex-e130f7)
  - [Example: 2-Generator 3-Groups of Abundance Zero](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/p-groups.md#example-ex-4efc58)
  - [`ClassTwo(p, d : parameters): RngIntElt, RngIntElt → SeqEnum`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/p-groups.md#function-classtwo-rngintelt-rngintelt)
  - [`ClassTwo(p, d, Step : parameters): RngIntElt, RngIntElt, SeqEnum → SeqEnum`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/p-groups.md#function-classtwo-rngintelt-rngintelt-seqenum)
  - [`ClassTwo(p, d, s : parameters): RngIntElt, RngIntElt, RngIntElt → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/p-groups.md#function-classtwo-rngintelt-rngintelt-rngintelt)
  - [Example: Counting p-Class 2 Groups](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/p-groups.md#example-ex-6ce143)
- [Representation Theory](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/character-representation.md)
  - [`CharacterDegrees(G): GrpPC → [ Tup ]`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/character-representation.md#function-characterdegrees-grppc)
  - [`CharacterDegrees(G, z, p): GrpPC, GrpPCElt, RngIntElt → [ Tup ]`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/character-representation.md#function-characterdegrees-grppc-grppcelt-rngintelt)
  - [`CharacterDegrees(G): GrpFin → [ Tup ]`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/character-representation.md#function-characterdegrees-grpfin)
  - [`CharacterDegreesPGroup(G): GrpFin → [ RngIntElt ]`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/character-representation.md#function-characterdegreespgroup-grpfin)
  - [`CharacterTable(G: parameters): GrpPC → TabChtr`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/character-representation.md#function-charactertable-grppc)
  - [`CharacterTableConlon(G): GrpPC → [ AlgChtrElt ]`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/character-representation.md#function-charactertableconlon-grppc)
  - [`GModule(G, M): GrpPC, AlgMat → ModAlg`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/character-representation.md#function-gmodule-grppc-algmat)
  - [`GModule(G, A): GrpPC, GrpPC → ModAlg, Map`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/character-representation.md#function-gmodule-grppc-grppc)
  - [`GModule(G, A, B): GrpPC, GrpPC, GrpPC → ModAlg, Map`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/character-representation.md#function-gmodule-grppc-grppc-grppc)
  - [`AbsolutelyIrreducibleRepresentationsSchur(G, k: parameters): GrpPC, Rng → List[Map]`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/character-representation.md#function-absolutelyirreduciblerepresentationsschur-grppc-rng)
  - [`AbsolutelyIrreducibleModulesSchur(G, k: parameters): GrpPC, Rng → List[GModule]`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/character-representation.md#function-absolutelyirreduciblemodulesschur-grppc-rng)
  - [`AbsolutelyIrreducibleRepresentationsSchur(G, k, i: parameters): GrpPC, Rng, RngIntElt → List[Map]`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/character-representation.md#function-absolutelyirreduciblerepresentationsschur-grppc-rng-rngintelt)
  - [`AbsolutelyIrreducibleModulesSchur(G, k, i: parameters): GrpPC, Rng, RngIntElt → List[GModule]`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/character-representation.md#function-absolutelyirreduciblemodulesschur-grppc-rng-rngintelt)
  - [`AbsolutelyIrreducibleRepresentationsSchur(G, k, L: parameters): GrpPC, Rng, List[Map] → List[Map]`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/character-representation.md#function-absolutelyirreduciblerepresentationsschur-grppc-rng-list-map)
  - [`AbsolutelyIrreducibleModulesSchur(G, k, L: parameters): GrpPC, Rng, List[GModule] → List[GModule]`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/character-representation.md#function-absolutelyirreduciblemodulesschur-grppc-rng-list-gmodule)
  - [`AbsolutelyIrreducibleRepresentationsSchur(G, k, L, i: parameters): GrpPC, Rng, List[Map], RngIntElt → List[Map]`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/character-representation.md#function-absolutelyirreduciblerepresentationsschur-grppc-rng-list-map-rngintelt)
  - [`AbsolutelyIrreducibleModulesSchur(G, k, L, i: parameters): GrpPC, Rng, RngIntElt → List[GModule]`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/character-representation.md#function-absolutelyirreduciblemodulesschur-grppc-rng-rngintelt-2)
  - [`IrreducibleRepresentationsSchur(G, k: parameters): GrpPC, Rng → List[Map]`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/character-representation.md#function-irreduciblerepresentationsschur-grppc-rng)
  - [`IrreducibleModulesSchur(G, k: parameters): GrpPC, Rng → List[GModule]`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/character-representation.md#function-irreduciblemodulesschur-grppc-rng)
  - [`IrreducibleRepresentationsSchur(G, k, i: parameters): GrpPC, Rng, RngIntElt → List[Map]`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/character-representation.md#function-irreduciblerepresentationsschur-grppc-rng-rngintelt)
  - [`IrreducibleModulesSchur(G, k, i: parameters): GrpPC, Rng, RngIntElt → List[GModule]`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/character-representation.md#function-irreduciblemodulesschur-grppc-rng-rngintelt)
  - [`IrreducibleRepresentationsSchur(G, k, L: parameters): GrpPC, Rng, List[Map] → List[Map]`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/character-representation.md#function-irreduciblerepresentationsschur-grppc-rng-list-map)
  - [`IrreducibleModulesSchur(G, k, L: parameters): GrpPC, Rng, List[GModule] → List[GModule]`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/character-representation.md#function-irreduciblemodulesschur-grppc-rng-list-gmodule)
  - [`IrreducibleRepresentationsSchur(G, k, L, i: parameters): GrpPC, Rng, List[Map], RngIntElt → List[Map]`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/character-representation.md#function-irreduciblerepresentationsschur-grppc-rng-list-map-rngintelt)
  - [`IrreducibleModulesSchur(G, k, L, i: parameters): GrpPC, Rng, List[GModule], RngIntElt → List[GModule]`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/character-representation.md#function-irreduciblemodulesschur-grppc-rng-list-gmodule-rngintelt)
  - [Example: Representations of the Dihedral Group of Order 20](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/character-representation.md#example-ex-ca921e)
- [Central Extensions](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/central-extensions.md)
  - [`ExtGenerators(G, U): GrpPC, GrpPC → [<AlgMatElt, RngIntElt>]`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/central-extensions.md#function-extgenerators-grppc-grppc)
  - [`HomGenerators(G, U): GrpPC, GrpPC → [<AlgMatElt, RngIntElt>]`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/central-extensions.md#function-homgenerators-grppc-grppc)
  - [`ElementSequence(G): GrpPC → SeqEnum`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/central-extensions.md#function-elementsequence-grppc)
  - [`RepresentativeCocycles(G, U, Ext, Hom): GrpPC, GrpPC, [AlgMatElt], [AlgMatElt] → [AlgMatElt]`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/central-extensions.md#function-representativecocycles-grppc-grppc-algmatelt-algmatelt)
  - [`CentralExtension(G, U, A): GrpPC, GrpPC, AlgMatElt → GrpPC`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/central-extensions.md#function-centralextension-grppc-grppc-algmatelt)
  - [`CentralExtensions(G, U, Q): GrpPC, GrpPC, [AlgMatElt] → [GrpPC]`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/central-extensions.md#function-centralextensions-grppc-grppc-algmatelt)
  - [`CentralExtensionProcess(G, U): GrpPC, GrpPC → Proc`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/central-extensions.md#function-centralextensionprocess-grppc-grppc)
  - [`NextExtension(~P): Rec → GrpPC`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/central-extensions.md#function-nextextension-rec-ref)
  - [`IsEmpty(P): Rec → BoolElt`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/central-extensions.md#function-isempty-rec)
  - [Example: Central Extensions of a Dihedral Group](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/central-extensions.md#example-ex-b4d774)
- [Transfer Between Group Categories](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/transfer-functions.md)
  - [Transfer to GrpPC](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/transfer-functions.md#transfer-to-grppc)
    - [`PCGroup(G): GrpPerm → GrpPC, Map`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/transfer-functions.md#function-pcgroup-grpperm)
    - [`PCGroup(G): GrpMat → GrpPC, Map`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/transfer-functions.md#function-pcgroup-grpmat)
    - [`PCGroup(G): GrpFP → GrpPC`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/transfer-functions.md#function-pcgroup-grpfp)
    - [`pQuotient(F, p, c : parameters ): GrpFP, RngIntElt, RngIntElt → GrpPC, Map`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/transfer-functions.md#function-pquotient-grpfp-rngintelt-rngintelt)
    - [`SolubleQuotient(G): Grp → GrpPC, Map`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/transfer-functions.md#function-solublequotient-grp)
    - [`SolvableQuotient(G): Grp → GrpPC, Map`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/transfer-functions.md#function-solvablequotient-grp)
    - [Example: Pc-Presentation of a Matrix Group](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/transfer-functions.md#example-ex-84bae2)
  - [Transfer from GrpPC](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/transfer-functions.md#transfer-from-grppc)
    - [`AbelianGroup(G): GrpPC → GrpAb, Map`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/transfer-functions.md#function-abeliangroup-grppc)
    - [`FPGroup(G): GrpPC → GrpFP, Map`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/transfer-functions.md#function-fpgroup-grppc)
    - [`GPCGroup(G): GrpPC → GrpGPC, Map`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/transfer-functions.md#function-gpcgroup-grppc)
    - [Example: Pc-Group to Permutation Group](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/transfer-functions.md#example-ex-b68da2)
- [More About Presentations](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/more-presentations.md)
  - [Conditioned Presentations](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/more-presentations.md#conditioned-presentations)
    - [Structure Operations](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/more-presentations.md#structure-operations)
      - [`ConditionedGroup(G): GrpPC → GrpPC`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/more-presentations.md#function-conditionedgroup-grppc)
      - [`IsConditioned(G): GrpPC → BoolElt`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/more-presentations.md#function-isconditioned-grppc)
    - [Element Operations](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/more-presentations.md#element-operations)
      - [`LeadingTerm(x): GrpPCElt → GrpPCElt`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/more-presentations.md#function-leadingterm-grppcelt)
      - [`LeadingGenerator(x): GrpPCElt → GrpPCElt`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/more-presentations.md#function-leadinggenerator-grppcelt)
      - [`LeadingExponent(x): GrpPCElt → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/more-presentations.md#function-leadingexponent-grppcelt)
      - [`Depth(x): GrpPCElt → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/more-presentations.md#function-depth-grppcelt)
      - [`PCClass(x): GrpPCElt → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/more-presentations.md#function-pcclass-grppcelt)
      - [`WeightClass(x): GrpPCElt → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/more-presentations.md#function-weightclass-grppcelt)
  - [Special Presentations](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/more-presentations.md#special-presentations)
    - [`SpecialPresentation(G): GrpPC → GrpPC`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/more-presentations.md#function-specialpresentation-grppc)
    - [`SpecialWeights(G): GrpPC → [ <RngIntElt, RngIntElt, RngIntElt> ]`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/more-presentations.md#function-specialweights-grppc)
    - [`NilpotentLength(G): GrpPC → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/more-presentations.md#function-nilpotentlength-grppc)
    - [`NilpotentBoundary(G,i): GrpPC, RngIntElt → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/more-presentations.md#function-nilpotentboundary-grppc-rngintelt)
    - [`MinorLength(G,i): GrpPC, RngIntElt → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/more-presentations.md#function-minorlength-grppc-rngintelt)
    - [`MinorBoundary(G,i,j): GrpPC, RngIntElt, RngIntElt → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/more-presentations.md#function-minorboundary-grppc-rngintelt-rngintelt)
    - [`LayerLength(G,i,j): GrpPC, RngIntElt, RngIntElt → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/more-presentations.md#function-layerlength-grppc-rngintelt-rngintelt)
    - [`LayerBoundary(G,i,j,k): GrpPC, RngIntElt, RngIntElt, RngIntElt → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/more-presentations.md#function-layerboundary-grppc-rngintelt-rngintelt-rngintelt)
    - [Example: User and Special Presentations](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/more-presentations.md#example-ex-4806c3)
  - [CompactPresentation](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/more-presentations.md#compactpresentation)
    - [`CompactPresentation(G): GrpPC → [RngIntElt]`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/more-presentations.md#function-compactpresentation-grppc)
    - [`PCGroup(Q : parameters ): [RngIntElt] → GrpPC`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/more-presentations.md#function-pcgroup-rngintelt)
    - [Example: Compact Presentation for a Library](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/more-presentations.md#example-ex-73c5b4)
- [Optimizing Magma Code](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/optimization.md)
  - [PowerGroup](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/optimization.md#powergroup)
    - [Example: Optimising with a Power Group](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/optimization.md#example-ex-952208)
- [$p$-Groups of Tame Genus](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/tame.md)
  - [Verbose Printing](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/tame.md#verbose-printing)
    - [Example: Verbose Printing](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/tame.md#example-ex-e49bb4)
  - [Constructors](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/tame.md#constructors)
    - [`TGRandomGroup(q, n, g : parameters): RngIntElt, RngIntElt, RngIntElt → GrpPC`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/tame.md#function-tgrandomgroup-rngintelt-rngintelt-rngintelt)
    - [Example: Random Groups of Tame Genus](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/tame.md#example-ex-7e07d7)
    - [`RandomGenus2Group(q, d : parameters): RngIntElt, [RngIntElt] → GrpPC`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/tame.md#function-randomgenus2group-rngintelt-rngintelt)
    - [Example: Genus 2 Groups with Prescribed Blocks](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/tame.md#example-ex-3b8b51)
    - [`RandomGenus1Group(q, d, r : parameters): RngIntElt, RngIntElt, RngIntElt → GrpPC`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/tame.md#function-randomgenus1group-rngintelt-rngintelt-rngintelt)
    - [Example: Heisenberg Groups](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/tame.md#example-ex-3634bf)
    - [`Genus2Group(f): RngUPolElt → GrpPC`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/tame.md#function-genus2group-rngupolelt)
    - [`Genus2Group(f): RngMPolElt → GrpPC`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/tame.md#function-genus2group-rngmpolelt)
    - [Example: Genus 2 Group from a Pfaffian](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/tame.md#example-ex-ff5bc5)
  - [Direct Indecomposability](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/tame.md#direct-indecomposability)
    - [`IsIndecomposable(G): GrpPC → BoolElt`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/tame.md#function-isindecomposable-grppc)
    - [`IsIndecomposable(t): TenSpcElt → BoolElt`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/tame.md#function-isindecomposable-tenspcelt)
    - [Example: Decomposable Groups](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/tame.md#example-ex-3b99f7)
    - [Example: Indecomposable Central Products](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/tame.md#example-ex-f8f20b)
  - [Genus](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/tame.md#genus)
    - [`Genus(G): GrpPC → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/tame.md#function-genus-grppc)
    - [`Genus(t): TenSpcElt → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/tame.md#function-genus-tenspcelt)
    - [Example: Genus of Small Groups](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/tame.md#example-ex-40dc90)
    - [`IsTameGenusGroup(G): Group → BoolElt`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/tame.md#function-istamegenusgroup-group)
    - [`IsTameGenusTensor(t): TenSpcElt → BoolElt`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/tame.md#function-istamegenustensor-tenspcelt)
    - [Example: Group Not of Tame Genus](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/tame.md#example-ex-da6133)
    - [Example: Filtering Small Groups by Tame Genus](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/tame.md#example-ex-063b44)
  - [Isomorphism](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/tame.md#isomorphism)
    - [`TGIsIsomorphic(G, H : parameters): GrpPC, GrpPC → BoolElt`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/tame.md#function-tgisisomorphic-grppc-grppc)
    - [Example: Isomorphism Testing](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/tame.md#example-ex-13bda5)
    - [`TGIsPseudoIsometric(s, t : parameters): TenSpcElt, TenSpcElt → BoolElt, Hmtp`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/tame.md#function-tgispseudoisometric-tenspcelt-tenspcelt)
    - [Example: Pseudo-Isometric Tensors](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/tame.md#example-ex-e03ee8)
  - [Automorphism Groups](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/tame.md#automorphism-groups)
    - [`TGAutomorphismGroup(G : parameters): GrpPC → GrpAuto`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/tame.md#function-tgautomorphismgroup-grppc)
    - [Example: Automorphisms of a Flat Indecomposable Group](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/tame.md#example-ex-36d32b)
    - [`TGPseudoIsometryGroup(t : parameters): TenSpcElt → GrpMat`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/tame.md#function-tgpseudoisometrygroup-tenspcelt)
    - [Example: Tensors over an Extension Field](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/tame.md#example-ex-35a1af)
  - [Canonical Labelling](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/tame.md#canonical-labelling)
    - [`TGSignature(G): GrpPC → List`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/tame.md#function-tgsignature-grppc)
    - [`TGSignature(t): TenSpcElt → List`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/tame.md#function-tgsignature-tenspcelt)
    - [Example: Canonical Labels with Many Blocks](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/tame.md#example-ex-bbc04e)
    - [Example: Tame Genus Signatures of Small Groups](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/tame.md#example-ex-15bce1)
- [Bibliography](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/bibliography.md)

### Introduction

Any finite soluble group has a subnormal series with cyclic factors. Such a series gives rise to various polycyclic presentations. These polycyclic presentations are useful because the word problem in such presentations can be solved in an algorithmic fashion. In Magma, we use the specific form called a *power-conjugate presentation (pc-presentation)*, which is described below. The Magma category of groups represented by a power-conjugate presentation (pc-groups for short) is called `GrpPC`.

This chapter describes how to use polycyclic presentations to compute with $p$-groups and other finite soluble groups in Magma. While most functions apply to any soluble group, a small number of functions specific to $p$-groups are identified in the text.

Over the past two decades a considerable body of efficient algorithms has been developed for computing with soluble groups defined in terms of pc-presentations. It is recommended that the `GrpPC` representation of a soluble group be used whenever intensive calculation with that group is necessary.

#### Power-Conjugate Presentations

Let $G$ be a finite soluble group. A presentation for $G$ of the form

$$
< a_1, \ldots,a_n\ |\ a_j ^{p_j}= w_{jj}, \quad 1\leq j \leq n,
\quad a_j ^{a_i}= w_{ij},\quad  1 \leq i < j\leq n >
$$

where

**(i)**
$p_j$ is the least prime such that $a_j^{p_j} \in < a_{j+1}, \ldots,  a_n>$ for $j < n$, and $a_j^{p_j}$ is the identity for $j = n$, and

**(ii)**
$w_{ij}$ is a word in the generators $a_{i+1}, \ldots, a_n$,

will be called a *power-conjugate presentation (pc-presentation)* for $G$. The generators of $G$ corresponding to $a_1, \ldots, a_n$ in this presentation are known as a *power-conjugate generating sequence (pc-generators)* for $G$.

It is easy to show that every finite soluble group possesses a pc-presentation. If such a presentation satisfies a certain additional condition (the *consistency condition*) then every element $a$ of $G$ can be written uniquely in the *normal form*

$$
a_1^{\alpha_1}\ldots a_n^{\alpha_n}, 0 \leq \alpha_i < p_i
\quad\hbox{\rm for }
i = 1, \ldots, n.
$$

Given such a pc-presentation for $G$ there exists an algorithm (the *collection algorithm*), which given an arbitrary word in the pc-generators $a_1, \ldots, a_n$, will determine the corresponding normal word. In particular, collection can be used to compute the normal word which is equal to the product of two given normal words, thus implementing the group multiplication.

### Creation of a Group

A user can create a `GrpPC` representation of a finite soluble group in a variety of ways. There are several built-in construction functions for creating standard examples such as cyclic or dihedral groups. For greater flexibility, it is possible to define a group directly from a power-commutator presentation. One can also build new groups out of old groups using standard constructions such as direct product. Finally, there are several conversion functions which will automatically compute a pc-presentation for an existing soluble group in some other category (such as permutation group or matrix group). We will start with the first two styles of construction and describe the remaining two in later sections.

In each case, regardless of how the group was originally defined, Magma will store the group internally as a pc-presentation and will display the pc-presentation whenever the group is printed. Normally when printing a pc-presentation, trivial conjugate relations are omitted. In the case of a $p$-group, then trivial power relations (those indicating that a generator has order $p$) are also omitted. The one exception to this policy is in the case of elementary abelian $p$-groups (which would have no relations displayed under the above policies). In the elementary abelian case, Magma will display the power relations, even though they are trivial.

#### Construction Functions

The simplest method of producing a pc-presentation for a group is to use one of the built-in construction functions. By specifying the category `GrpPC` as the first parameter of each function, we produce the desired representation.

It is also possible to obtain a pc-presentation for many small soluble groups by using the function [`SmallGroup`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/smlgps-database.md#function-grpdata-smallgroup) described in Chapter [Databases of Groups](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/index-databases-of-groups.md#chapgrpdata).

<a id="function-cyclicgroup-cat-rngintelt"></a>
##### `CyclicGroup(GrpPC, n): Cat, RngIntElt -> GrpPC`

The cyclic group of order $n$ as a pc-group.

<a id="function-abeliangroup-cat-rngintelt"></a>
##### `AbelianGroup(GrpPC, Q): Cat, [RngIntElt] -> GrpPC`

Construct the abelian group defined by the sequence $Q = [n_1,\ldots,n_r]$ of positive integers as a pc-group. The function returns the abelian group which is the direct product of the cyclic groups $C_{n_1} \times C_{n_2} \times \cdots \times C_{n_r}$.

<a id="function-dihedralgroup-cat-rngintelt"></a>
##### `DihedralGroup(GrpPC, n): Cat, RngIntElt -> GrpPC`

The dihedral group of order $2*n$ as a pc-group.

<a id="function-extraspecialgroup-cat-rngintelt-rngintelt"></a>
##### `ExtraSpecialGroup(GrpPC, p, n : parameters): Cat, RngIntElt, RngIntElt -> GrpPC`

```magma
Type: MonStgElt                    Default: "+"
```

Given a small prime $p$ and a small positive integer $n$, construct an extra-special group $G$ of order $p^{2n+1}$ in the category `GrpPC`. The isomorphism type of $G$ may be selected using the parameter `Type`.

Possible values for this parameter are “$+$” (default) and “$-$“.

If `Type` is set to “$+$”, the function returns, for $p = 2$, the central product of $n$ copies of the dihedral group of order 8, and for $p > 2$ it returns the unique extra-special group of order $p^{2n+1}$ and exponent $p$.

If `Type` is set to “$-$”, the function returns for $p = 2$ the central product of a quaternion group of order 8 and $n-1$ copies of the dihedral group of order 8, and for $p > 2$ it returns the unique extra-special group of order $p^{2n+1}$ and exponent $p^2$.

<a id="example-ex-a851f0"></a>
##### `Example: Pc-Representation of a Cyclic Group (ex-a851f0)`

A pc-representation for the cyclic group $C_{12}$ can be computed as follows.

```magma
> G := CyclicGroup(GrpPC, 12);
```

We can then check various properties of $G$.

```magma
> Order(G);
12
> IsAbelian(G);
true
> IsSimple(G);
false
```

If we simply print $G$, we will see the presentation which Magma has generated for this group.

```magma
> G;
GrpPC : G of order 12 = 2^2 * 3
PC-Relations:
    G.1^2 = G.2,
    G.2^2 = G.3,
    G.3^3 = Id(G)
```

Or, we could build a slightly different group.

```magma
> H := AbelianGroup(GrpPC, [2,2,3]);
> Order(H);
12
> IsCyclic(H);
false
```

#### Definition by Presentation

While the standard construction functions are convenient, most groups cannot be defined in that way. Complete flexibility in defining a soluble group can be obtained by directly specifying the group’s pc-presentation.

One uses a power-conjugate presentation to define a soluble group by means of the `PolycyclicGroup` constructor, or the `quo` constructor for finitely presented groups.

<a id="constructor-constructor-polycyclicgroup-list-identifiers-list-grpfprel-grppc-map"></a>
##### `PolycyclicGroup< x₁, ..., xₙ | R : parameters >: List(Identifiers), List(GrpFPRel) -> GrpPC, Map`

```magma
Check        : BoolElt                      Default: true
ExponentLimit: RngIntElt                    Default: 20
Class        : MonStgElt                    Default: 
```

Construct the soluble group $G$ defined by the power-conjugate presentation $<~x_1,~\ldots,~x_n~|~R~>$.

The construct $x_1, \ldots, x_n$ defines names for the generators of $G$ that are local to the constructor, i.e. they are used when writing down the relations to the right of the bar. However, no assignment of *values* to these variables is made. If the user wants to refer to the generators by these (or other) names, then the *generators assignment* construct must be used on the left hand side of an assignment statement.

The construct $R$ denotes a list of pc-relations. Thus, an element of $R$ must be one of:

**(a)**
A *power relation* $a_j^{p_j} = w_{jj}$, $1 \leq j \leq n$, where $w_{jj}$ is $1$ or a word in generators $a_{j+1}, \ldots,a_n$ for $j < n$, and $w_{jj} = 1$ for $j = n$, and $p_j$ a prime.

**(b)**
A *conjugate relation* $a_j^{a_i} = w_{ij}$, $1 \leq i < j \leq n$, where $w_{ij}$ is a word in the generators $a_{i+1}, \ldots, a_n$.

**(c)**
A *power* $a_j^{p_j}$, $1 \leq j \leq n$ and $p_j$ a prime, which is treated as the *power relation* $a_j^{p_j} = Id(F)$.

**(d)**
A set of (a) – (c).

**(e)**
A sequence of (a) – (c).

Note the following points:

**(i)**
A power relation must be present for each generator $a_i$, $i = 1, \ldots, n$;

**(ii)**
Conjugate relations involving commuting generators (i.e. of the form $y^x=y$) may be omitted;

**(iii)**
The words $w_{ij}$ must be in normal form.

In addition, one can alternatively specify a power-commutator presentation using commutator relations rather than conjugate relations.

**(b’)**
A *commutator relation* $(a_j, a_i) = w_{ij}$, $1 \leq i < j \leq n$, where $w_{ij}$ is a word in the generators $a_{i+1}, \ldots, a_n$.

However, commutators and conjugates cannot be mixed in a single presentation.

A map $f$ from the free group of rank $n$ to $G$ is returned as well.

The parameters `Check` and `ExponentLimit` may be used. `Check` indicates whether or not the presentation is checked for consistency. Setting `Check` to `false` will reduce the overheads incurred in constructing the group, but should only be done when the user is sure the given presentation is consistent.

`ExponentLimit` determines the amount of space that will be used by the group to speed calculations. Given `ExponentLimit := e`, the group will precompute and store normal words for appropriate products $a^i * b^j$ where $a$ and $b$ are generators and $i$ and $j$ are in the range 1 to $e$.

If the construction of an object in the category `GrpPC` fails because $R$ is not a valid power-conjugate presentation, an attempt is made to construct a group in the category [`GrpGPC`](https://docs.magma-maths.org/FinitelyPresentedGroups/PolycyclicGroups/index-polycyclic-groups.md#chapgrpgpc) (cf. Chapter [Polycyclic Groups](https://docs.magma-maths.org/FinitelyPresentedGroups/PolycyclicGroups/index-polycyclic-groups.md#chapgrpgpc)). This feature can be turned off by setting the parameter `Class` to `"GrpPC"`; an invalid power-conjugate presentation then causes a runtime error. Since, by default, the constructor always returns a group in the category `GrpPC` if possible, this is the only effect of setting the parameter `Class` to `"GrpPC"`.

<a id="constructor-constructor-quo-grpfp-list-grpfprel-grppc-map"></a>
##### `quo< GrpPC : F | R : parameters >: GrpFP, List(GrpFPRel) -> GrpPC, Map`

```magma
Check        : BoolElt                      Default: true
ExponentLimit: RngIntElt                    Default: 20
```

Given a free group $F$ of rank $n$ with generating set $X$, and a collection $R$ of pc-relations on $X$, construct the soluble group $G$ defined by the power-conjugate presentation $< X | R >$.

The construct $R$ denotes a list of pc-relations. The syntax and semantics for the relations clause is identical to that appearing in the `PolycyclicGroup`-construct.

This constructor returns a pc-group because the category `GrpPC` is stated. If no category were stated, it would return an fp-group. The parameters `Check` and `ExponentLimit` may be used as described in the `PolycyclicGroup`-construct. The natural homomorphism, $F \rightarrow G$, is also returned.

<a id="example-ex-a8ae01"></a>
##### `Example: Group of Order 80 from a Presentation (ex-a8ae01)`

Consider the group of order 80 defined by the presentation

$$
\begin{aligned}< a, b, c, d, e\  |\ &a^2 = c, b^2, c^2 = e, d^5, e^2, b^a = b*e, c^a = c, c^b = c, \\
              &d^a = d^2, d^b = d, d^c = d^4, e^a = e, e^b = e, e^c = e, e^d = e >.\end{aligned}
$$

Giving the relations in the form of a list, this presentation would be specified as follows:

```magma
> G<a,b,c,d,e> := PolycyclicGroup<a, b, c, d, e |
> \indent\indent\indent a^2 = c, b^2, c^2 = e, d^5, e^2,
> \indent\indent\indent b^a = b*e, d^a = d^2, d^c = d^4 >;
```

Starting from a free group and giving the relations in the form of a set of relations, this presentation would be specified as follows:

```magma
> F<a,b,c,d,e> := FreeGroup(5);
> rels := { a^2 = c, b^2 = Id(F), c^2 = e, d^5 = Id(F), e^2 = Id(F),
> \indent b^a = b*e, d^a = d^2, d^c = d^4 };
> G<a,b,c,d,e> := quo< GrpPC : F | rels >;
```

Notice that here we have redefined the variables $a,\ldots ,e$ to be the pc-generators in $G$. Thus, when $G$ is printed, Magma displays the following presentation:

```magma
> G;
GrpPC : G of order 80 = 2^4 * 5
PC-Relations:
    a^2 = c,
    b^2 = Id(G),
    c^2 = e,
    d^5 = Id(G),
    e^2 = Id(G),
    b^a = b * e,
    d^a = d^2,
    d^c = d^4
> Order(G);
80
> IsAbelian(G);
false
```

#### Possibly Inconsistent Presentations

The `PolycyclicGroup` and `quo` constructors accept a parameter `Check` which enables the user to suppress the automatic consistency checking for input presentations. This is primarily intended to be used when it is certain that the input presentation is consistent, in order to save time. For instance, the presentation may have been generated from some other reliable program, or even from an earlier Magma session. This parameter should be used with care, since all of the Magma functions assume that every `GrpPC` group is consistent. The user will encounter numerous bizarre results if an attempt is made to compute with an inconsistent presentation.

On occasion, a user may wish to “try out” a series of pc-presentations, some of which may not be consistent. The `Check` parameter can be used, along with the function `IsConsistent`, to test a presentation for consistency.

<a id="function-isconsistent-grppc"></a>
##### `IsConsistent(G): GrpPC -> BoolElt`

Returns `true` if $G$ has a consistent presentation, `false` otherwise.

<a id="example-ex-a62513"></a>
##### `Example: Checking Consistency of Presentations (ex-a62513)`

The following example demonstrates generating a family of presentations, and then checking consistency. Of course, it is easy to predict the outcome in this simple example.

```magma
> F := FreeGroup(2);
> for p in [n: n in [3..10] | IsPrime(n)] do
>   r := [F.1^3=Id(F), F.2^p=Id(F), F.2^F.1=F.2^2];
>   G := quo<GrpPC: F | r: Check:=false>;
>   if IsConsistent(G) then
>     print "For p=",p," the group is consistent.";
>   else
>     print "For p=",p," the group is inconsistent.";
>   end if;
> end for;
For p= 3  the group is inconsistent.
For p= 5  the group is inconsistent.
For p= 7  the group is consistent.
```

### Basic Group Properties

#### Infrastructure

The functions described here provide access to basic information stored for a pc-group $G$.

<a id="operation-operation-grppc-rngintelt-grppcelt"></a>
##### `G . i: GrpPC, RngIntElt -> GrpPCElt`

The $i$-th pc-generator for $G$. A negative subscript indicates that the inverse of the generator is to be created. $G.0$ is `Identity(G)`.

<a id="function-generators-grppc"></a>
##### `Generators(G): GrpPC -> SetEnum`

A set containing the defining generators for $G$. If $G$ is a $p$-group, this is guaranteed to be a minimal set of generators. For non-$p$-groups, this will be the set of pc-generators.

<a id="function-numberofgenerators-grppc"></a>
##### `NumberOfGenerators(G): GrpPC -> RngIntElt`

<a id="function-ngens-grppc"></a>
##### `Ngens(G): GrpPC -> RngIntElt`

The number of defining generators for $G$.

<a id="function-pcgenerators-grppc"></a>
##### `PCGenerators(G): GrpPC -> SetIndx`

An indexed set containing the pc-generators for $G$.

<a id="function-numberofpcgenerators-grppc"></a>
##### `NumberOfPCGenerators(G): GrpPC -> RngIntElt`

<a id="function-npcgenerators-grppc"></a>
##### `NPCGenerators(G): GrpPC -> RngIntElt`

<a id="function-npcgens-grppc"></a>
##### `NPCgens(G): GrpPC -> RngIntElt`

The number of pc-generators for $G$.

<a id="function-pcprimes-grppc"></a>
##### `PCPrimes(G): GrpPC -> [RngIntElt]`

A sequence [$p_1,\ldots,p_n$] containing the primes associated with the pc-generators of $G$. The $i$-th term of the sequence contains the prime associated with generator $a_i$ of $G$ for $i = 1,\ldots,n$.

#### Numerical Invariants

Magma has built-in functions to compute the order and exponent of a group.

<a id="function-order-grppc"></a>
##### `Order(G): GrpPC -> RngIntElt`

<a id="operation-operation-grppc-rngintelt"></a>
##### `# G: GrpPC -> RngIntElt`

The order of the group $G$, returned as an ordinary integer.

<a id="function-factoredorder-grppc"></a>
##### `FactoredOrder(G): GrpPC -> [<RngIntElt, RngIntElt>]`

The factored order of the group $G$.

<a id="function-exponent-grppc"></a>
##### `Exponent(G): GrpPC -> RngIntElt`

The exponent of the group $G$.

#### Predicates

Magma has built-in functions to check standard group properties.

<a id="function-isabelian-grppc"></a>
##### `IsAbelian(G): GrpPC -> BoolElt`

Returns `true` if the group $G$ is abelian, `false` otherwise.

<a id="function-iscyclic-grppc"></a>
##### `IsCyclic(G): GrpPC -> BoolElt`

Returns `true` if the group $G$ is cyclic, `false` otherwise.

<a id="function-iselementaryabelian-grppc"></a>
##### `IsElementaryAbelian(G): GrpPC -> BoolElt`

Returns `true` if the group $G$ is elementary abelian, `false` otherwise.

<a id="function-isnilpotent-grppc"></a>
##### `IsNilpotent(G): GrpPC -> BoolElt`

Returns `true` if the group $G$ is nilpotent, `false` otherwise.

<a id="function-isperfect-grppc"></a>
##### `IsPerfect(G): GrpPC -> BoolElt`

Returns `true` if the group $G$ is perfect, `false` otherwise. A soluble group $G$ is perfect only if it is trivial.

<a id="function-issimple-grppc"></a>
##### `IsSimple(G): GrpPC -> BoolElt`

Returns `true` if the group $G$ is simple, `false` otherwise.

<a id="function-issoluble-grppc"></a>
##### `IsSoluble(G): GrpPC -> BoolElt`

<a id="function-issolvable-grppc"></a>
##### `IsSolvable(G): GrpPC -> BoolElt`

Returns `true` if the group $G$ is soluble, `false` otherwise. It always returns the value `true` for a pc-group.

<a id="function-istrivial-grppc"></a>
##### `IsTrivial(G): GrpPC -> BoolElt`

Returns `true` if the group $G$ has order 1, `false` otherwise.

<a id="function-isspecial-grppc"></a>
##### `IsSpecial(G): GrpPC -> BoolElt`

Given a $p$-group $G$, return `true` if $G$ is special, `false` otherwise.

<a id="function-isextraspecial-grppc"></a>
##### `IsExtraSpecial(G): GrpPC -> BoolElt`

Given a $p$-group $G$, return `true` if $G$ is extra-special, `false` otherwise.

<a id="example-ex-e86fe2"></a>
##### `Example: Basic Properties of Pc-Groups (ex-e86fe2)`

We use a presentation to define an extraspecial 3-group of exponent 9.

```magma
> E := PolycyclicGroup<a1,a2,b1,b2,z|a1^3,a2^3,b1^3=z,b2^3=z,
>   z^3,b1^a1=b1*z,b2^a2=b2*z>;
```

The sequence of base, exponent pairs from `FactoredOrder` shows us that the group has order $3^5$.

```magma
> FactoredOrder(E);
[ <3, 5> ]
> Exponent(E);
9
```

As well as with the `Order` function, one can get the size of a group by using the `#` shorthand.

```magma
> D3 := DihedralGroup(GrpPC, 3);
> #D3;
6
> IsNilpotent(D3);
false
```

### Homomorphisms

Arbitrary homomorphisms can be defined between pc-groups by using the `hom<>` constructor. For pc-groups, this constructor has features not generally available for user-defined homomorphisms. In addition to defining the map by giving images for the pc-generators, a homomorphism can be defined by giving images for any generating set of the domain. Magma will verify that the specified images define a homomorphism and will compute the kernel and inverse images for the defined map. Note that the value returned for an inverse image of an element is simply one element from the preimage, not the complete coset.

<a id="constructor-constructor-hom-grppc-grppc-list-map"></a>
#### `hom< G -> H | L >: GrpPC, GrpPC, List -> Map`

```magma
Check: BoolElt                    Default: true
```

Construct a homomorphism $\phi:G \rightarrow H$ defined by the images specified by the list $L$.

The list $L$ must be one of the following:

**(a)**
a list, set, or sequence of 2-tuples $<g_i,h_i>$ (order not important);

**(b)**
a list, set, or sequence of arrow pairs $g_i -> h_i$ (order not important);

**(c)**
a list or sequence of images $h_1,\dots,h_n$ (order is important).

The elements $g_i$ and $h_i$ must be elements of $G$ and $H$, respectively, in each case. For the cases (a) and (b), the elements $g_i$ must generate $G$ and the homomorphism will satisfy $\phi(g_i) = h_i$. For case (c), $n$ must be the number of pc-generators of $G$ and the $g_i$ are implicitly defined to be the pc-generators. However, if $G$ is a $p$-group which has $p$-Quotient definitions set (see [`HaspQuotientDefinitions`](https://docs.magma-maths.org/FinitelyPresentedGroups/FPGroups/quotient.md#function-haspquotientdefinitions)), then $n$ can be the number of generators of $G$ (the result of `Ngens(G)`) and the $g_i$ are implicitly defined to be the first $n$ pc-generators.

The parameter `Check` can be set to `false` in order to turn off the check that the map defined is a homomorphism. This should only be done when one is certain that the map is a homomorphism, since later results will most likely be incorrect if it is not.

<a id="function-ishomomorphism-grppc-grppc-seqenum"></a>
#### `IsHomomorphism(G, H, L): GrpPC, GrpPC, SeqEnum -> BoolElt, Map`

<a id="function-ishomomorphism-grppc-grppc-setenum-tup"></a>
#### `IsHomomorphism(G, H, L): GrpPC, GrpPC, SetEnum[Tup] -> BoolElt, Map`

This is a conditional form of the `hom`-constructor. The argument $L$ must be a set or sequence of pairs (as in case (a) of the `hom`-constructor), or a sequence of images in $H$ for the pc-generators of $G$ (as in case (c) of the `hom`-constructor). If the specified images define a homomorphism, the value true and the resulting map are returned. Otherwise, `false` is returned.

<a id="function-identityhomomorphism-grppc"></a>
#### `IdentityHomomorphism(G): GrpPC -> Map`

The identity map from $G$ to $G$.

<a id="function-kernel-map"></a>
#### `Kernel(f): Map -> GrpPC`

Given a homomorphism $f$ from one pc-group to another, return the kernel of $f$. This will be a pc-group which is a subgroup of the domain of $f$.

<a id="function-homomorphisms-grppc-grppc"></a>
#### `Homomorphisms(G, H): GrpPC, GrpPC -> SeqEnum`

Given finite *abelian* groups $G$ and $H$, return a sequence containing all elements of ${\rm Hom}(G, H)$. The elements are returned as actual (Magma map type) homomorphisms. Note that this function simply uses `Hom`, transferring each element of the returned group to the actual Magma map type homomorphism.

<a id="example-ex-d63f2e"></a>
#### `Example: Homomorphisms Between Pc-Groups (ex-d63f2e)`

Let $G$ be a pc-representation of the symmetric group $S_4$, and $N$ be $O_2(G)$.

```magma
> G := PCGroup(Sym(4));
> G;
GrpPC : G of order 24 = 2^3 * 3
PC-Relations:
    G.1^2 = Id(G),
    G.2^3 = Id(G),
    G.3^2 = Id(G),
    G.4^2 = Id(G),
    G.2^G.1 = G.2^2,
    G.3^G.1 = G.3 * G.4,
    G.3^G.2 = G.4,
    G.4^G.2 = G.3 * G.4
> N := pCore(G,2);
> Order(N);
4
```

Let us define $H$ to be a complement of $N$ in $G$.

```magma
> H := sub<G|G.1*G.4,G.2*G.4>;
> Order(H);
6
> H meet N;
GrpPC of order 1
PC-Relations:
```

We now wish to define the projection homomorphism from $G$ to $H$. This will map each element of $N$ to the identity and each element of $H$ to itself. We can define the map directly using these properties.

```magma
> pairs := [];
> for n in Generators(N) do
>   pairs cat:= [<G!n,Id(H)>];
> end for;
> for h in Generators(H) do
>   pairs cat:= [<G!h, h>];
> end for;
> proj := hom<G -> H|pairs>;
> proj;
Mapping from: GrpPC: G to GrpPC: H
> proj(G.1);
H.1
> proj(N);
GrpPC of order 1
PC-Relations:
```

We can also compute inverse images and can verify that $N$ is the kernel of the map. Note that the preimage of a single element is just one element from the preimage, not the complete coset. Of course, one can use the kernel to compute the full coset if desired.

```magma
> y := (H.1)@@proj;
> y;
G.1
> Kernel(proj) eq N;
true
> {y*k: k in Kernel(proj)};
{ G.1 * G.3 * G.4, G.1 * G.4, G.1, G.1 * G.3 }
```

### New Groups from Existing

<a id="function-directproduct-grppc-grppc"></a>
#### `DirectProduct(G, H): GrpPC, GrpPC -> GrpPC, [Map], [Map]`

The direct product $K$ of the pc-groups $G$ and $H$. The second argument returned is a sequence containing the inclusion maps $I_G\colon G \rightarrow K$ and $I_H\colon H \rightarrow K$. The third argument returned is a sequence containing the projection maps $P_G\colon K \rightarrow G$ and $P_H\colon K \rightarrow H$. Furthermore, the (user-) presentation of $K$ is arranged so that the first pc-generators correspond to those of $G$ and the remaining generators correspond to those of $H$.

<a id="function-directproduct-grppc"></a>
#### `DirectProduct(Q): [GrpPC] -> GrpPC, [ Map ], [ Map ]`

The direct product of pc-groups in the non-empty sequence $Q$, and the inclusion and projection maps.

<a id="function-extension-grppc-grppc-map"></a>
#### `Extension(G, H, f): GrpPC, GrpPC, [Map] -> GrpPC`

The split extension $K$ of the pc-group $G$ by the pc-group $H$, where the action of $H$ on $G$ is given by the homomorphism $\phi: H \rightarrow {\operatorname{Aut}}(G)$ specified by $f$. The extension $K$ will have a normal subgroup $G\mathord{\sim}$ isomorphic to $G$, while the quotient group $K/G\mathord{\sim}$ is isomorphic to $H$.

The homomorphism $\phi$ is given by the sequence of maps $f$. Suppose that the pc-generators for $H$ are $h_1, \ldots, h_s$. The $i$-th entry of $f$ defines the action of $h_i$ on $G$. That is, $f[i](x) = h_i^{-1}\cdot x\cdot h_i$, for $x \in G$.

<a id="function-extension-modgrp-grppc"></a>
#### `Extension(M, H): ModGrp, GrpPC -> GrpPC`

The split extension $K$ of the $G$-module $M$ by the pc-group $H$. We use the action of $H$ on $M$ to define the action of $H$ on an elementary abelian $p$-group of order $p^d$ where $M$ is a $d$-dimensional module over $GF(p)$, $p$ prime.

<a id="function-extension-grppc-grppc-map-grppcelt"></a>
#### `Extension(G, H, f, t): GrpPC, GrpPC, [Map], [GrpPCElt] -> GrpPC`

<a id="function-extension-grppc-grppc-map-tup"></a>
#### `Extension(G, H, f, t): GrpPC, GrpPC, [Map], {Tup} -> GrpPC`

The non-split extension $K$ of the pc-group $G$ by the pc-group $H$, where the action of $H$ on $G$ is given by the homomorphism $\phi: H \rightarrow {\operatorname{Aut}}(G)$ and the tails for $H$ are given as the set of tuples $t$. The extension $K$ will have a normal subgroup $G\mathord{\sim}$ isomorphic to $G$, while the quotient group $K/G\mathord{\sim}$ is isomorphic to $H$.

The homomorphism $\phi$ is given by the sequence of maps $f$. Suppose that the pc-generators for $H$ are $h_1, \ldots, h_s$. The $i$-th entry of $f$ defines the action of $h_i$ on $G$. That is, $f[i](x) = h_i^{-1}\cdot x\cdot h_i$, for $x \in G$.

The specification of $t$ involves giving the relations $h_j^{-1}h_ih_j$ $= w_{ij}$, where $w_{ij}$ is a word in $K$ for $1 \le j < i \le s$. For $i = j$, we need the relation ${h_i}^{p_i} = w_{ii}$, where $w_{ii}$ is a word in $K$ for $1 \le i \le s$. Each $w_{ij}$ is the RHS of the relation from $H$ with the tail $x_{ij}$. The tails are given by the sequence $t$ in the order $t = [x_{11}, x_{21}, x_{22}, x_{31}, \ldots , x_{ss} ]$. Alternatively, $t$ can be given as a set of tuples $< i, j, x_{ij} >$ for non-trivial $x_{ij}$.

Note that if $x_{ij} =$`Id(G)`, for $1\leq i\leq s$ and $1\leq  j\leq i$, then $K$ will just be the split extension of $G$ and $H$.

<a id="function-extension-modgrp-grppc-modgrpelt"></a>
#### `Extension(M, H, t): ModGrp, GrpPC, [ModGrpElt] -> GrpPC`

The non-split extension $K$ of the $G$-module $M$ by the pc-group $H$. We use the action of $H$ on $M$ to define the action of $H$ on an elementary abelian $p$-group of order $p^d$ where $M$ is a $d$-dimensional module over $GF(p)$, $p$ prime.

The specification of $t$ is similar to that for $t$ in the preceding description.

<a id="function-isextension-grppc-grppc-map"></a>
#### `IsExtension(G, H, f): GrpPC, GrpPC, [Map] -> BoolElt, GrpPC`

<a id="function-isextension-modgrp-grppc"></a>
#### `IsExtension(M, H): ModGrp, GrpPC -> BoolElt, GrpPC`

<a id="function-isextension-grppc-grppc-map-grppcelt"></a>
#### `IsExtension(G, H, f, t): GrpPC, GrpPC, [Map], [GrpPCElt] -> BoolElt, GrpPC`

<a id="function-isextension-grppc-grppc-map-tup"></a>
#### `IsExtension(G, H, f, t): GrpPC, GrpPC, [Map], {Tup} -> BoolElt, GrpPC`

<a id="function-isextension-modgrp-grppc-modgrpelt"></a>
#### `IsExtension(M, H, t): ModGrp, GrpPC, [ModGrpElt] -> BoolElt, GrpPC`

For each `Extension` variation, there is a corresponding function `IsExtension` which attempts to construct the specified group and returns a boolean value indicating whether or not the construction succeeded. If the construction succeeds, the extension group is also returned.

The `Extension` functions will generate a runtime error if the specified construction is not legal. The `IsExtension` function allows the user to detect this error condition and continue.

<a id="function-wreathproduct-grppc-grppc"></a>
#### `WreathProduct(G, H): GrpPC, GrpPC -> GrpPC`

The wreath product of the pc-groups $G$ and $H$, where the regular permutation representation of $H$ is used to define the action.

<a id="function-wreathproduct-grppc-grppc-map"></a>
#### `WreathProduct(G, H, f): GrpPC, GrpPC, Map -> GrpPC`

<a id="function-wreathproduct-grppc-grppc-grppermelt"></a>
#### `WreathProduct(G, H, f): GrpPC, GrpPC, [GrpPermElt] -> GrpPC`

The wreath product of the pc-groups $G$ and $H$ where the action of $H$ is given by $f$, which may be either a homomorphism from $H$ into a permutation group $P$ or a sequence of permutations defining a homomorphism from $H$ into $P$. If $f$ is a sequence, the homomorphism $\phi: H \rightarrow P$ is defined by $H.i \rightarrow f[i]$ for $i = 1, \ldots, s$.

<a id="example-ex-73458c"></a>
#### `Example: Extensions of an Elementary Abelian Group (ex-73458c)`

To demonstrate some of the versions of `Extension` we first build a split extension of a cyclic group of order 4 acting on an elementary abelian group of order 9.

```magma
> C4 := CyclicGroup(GrpPC,4);
> E9 := AbelianGroup(GrpPC,[3,3]);
> f1 := hom<E9->E9|[E9.1*E9.2^2, E9.1^2*E9.2^2]>;
> f2 := hom<E9->E9|[E9.1^2,E9.2^2]>;
> G := Extension(E9,C4,[f1,f2]);
> G;
GrpPC : G of order 36 = 2^2 * 3^2
PC-Relations:
    G.1^2 = G.2,
    G.2^2 = Id(G),
    G.3^3 = Id(G),
    G.4^3 = Id(G),
    G.3^G.1 = G.3 * G.4^2,
    G.3^G.2 = G.3^2,
    G.4^G.1 = G.3^2 * G.4^2,
    G.4^G.2 = G.4^2
```

Then, we define a module for this group and use it to build a nonsplit extension.

```magma
> MR := MatrixRing(GF(3),2);
> m1 := MR![1,1,1,2];
> m2 := MR![2,0,0,2];
> V := GModule(G,[m1,m2,Id(MR),Id(MR)]);
> IsIrreducible(V);
true
> v0 := V!0;
> tails := [v0,v0,v0,v0,V![1,0],V![2,0],V![1,2],V![0,2],v0,V![0,1]];
> H := Extension(V,G,tails);
> H;
GrpPC : H of order 324 = 2^2 * 3^4
PC-Relations:
    H.1^2 = H.2,
    H.2^2 = Id(H),
    H.3^3 = H.5^2,
    H.4^3 = H.6,
    H.5^3 = Id(H),
    H.6^3 = Id(H),
    H.3^H.1 = H.3 * H.4^2,
    H.3^H.2 = H.3^2 * H.5,
    H.4^H.1 = H.3^2 * H.4^2 * H.5 * H.6^2,
    H.4^H.2 = H.4^2 * H.6^2,
    H.5^H.1 = H.5 * H.6,
    H.5^H.2 = H.5^2,
    H.6^H.1 = H.5 * H.6^2,
    H.6^H.2 = H.6^2
```

Notice that the relations of $H$ involving the first four generators are those of $G$ with the specified tails appended. We are then ready to compute various properties of $H$.

```magma
> [N`order:N in NormalSubgroups(H)];
[ 1, 9, 81, 162, 324 ]
```

<a id="example-ex-9a45eb"></a>
#### `Example: Cossey-Hawkes Conjugacy Class Sizes (ex-9a45eb)`

In this example we verify an example of Cossey and Hawkes in [[CH00](https://docs.magma-maths.org/references.md#cite-ch-classes)]. The paper shows that the largest size of a conjugacy class in an abelian by nilpotent finite group is at least as large as the product of the largest class sizes for the Sylow subgroups. The example is a group having derived length 3 in which this fails.

We start with a dihedral group of order 10 acting on a cyclic group of order 8.

```magma
> E := DihedralGroup(GrpPC,5);
> A := CyclicGroup(GrpPC,8);
```

Define an action of E on A and create the split extension.

```magma
> f1 := hom<A->A|A.1->(A.1)^-1>;
> f2 := hom<A->A|A.1->A.1>;
> H := Extension(A, E, [f1, f2]);
```

Then construct a certain H-module…

```magma
> QH := SylowSubgroup(H,2);
> t := TrivialModule(QH, FiniteField(5));
> B := Induction(t, H);
```

…and form the split extension of H acting on that module.

```magma
> G := Extension(B, H);
> print G;
GrpPC : G of order 250000 = 2^4 * 5^6
PC-Relations:
    G.1^2 = Id(G),
    G.2^5 = Id(G),
    G.3^2 = G.4,
    G.4^2 = G.5,
    G.5^2 = Id(G),
    G.6^5 = Id(G),
    G.7^5 = Id(G),
    G.8^5 = Id(G),
    G.9^5 = Id(G),
    G.10^5 = Id(G),
    G.2^G.1 = G.2^4,
    G.3^G.1 = G.3 * G.4 * G.5,
    G.4^G.1 = G.4 * G.5,
    G.6^G.2 = G.10,
    G.7^G.1 = G.10,
    G.7^G.2 = G.6,
    G.8^G.1 = G.9,
    G.8^G.2 = G.7,
    G.9^G.1 = G.8,
    G.9^G.2 = G.8,
    G.10^G.1 = G.7,
    G.10^G.2 = G.9
> print DerivedLength(G);
3
```

Now check the relevant class sizes.

```magma
> P := SylowSubgroup(G,5);
> Q := SylowSubgroup(G,2);
> print  Maximum({x[2]:x in Classes(G)});
1250
> print  Maximum({x[2]:x in Classes(P)});
625
> print  Maximum({x[2]:x in Classes(Q)});
4
```

Note that 1250 is less than the product 625\*4.

### Elements

Elements of a pc-group are written in terms of the generators. The pc-generators of a group $G$ can always be written as `G.1`, `G.2`, … . Any variables naming the generators, either assigned during the definition of the group, or later using standard assignment statements, can also be used to express the generators. An arbitrary element can be written as a word in the generators using the various element operations.

#### Definition of Elements

A *word* is defined inductively as follows:

**(i)**
A generator is a word;

**(ii)**
The expression $(u)$ is a word, where $u$ is a word;

**(iii)**
The product $u*v$ of the words $u$ and $v$ is a word;

**(iv)**
The conjugate $u^v$ of the word $u$ by the word $v$ is a word ($u^v$ expands into the word $v^{-1}*u*v$);

**(v)**
The power of a word $u^n$, where $u$ is a word and $n$ is an integer, is a word;

**(vi)**
The commutator $(u, v)$ of the words $u$ and $v$ is a word ( $(u, v)$ expands into the word $u^{-1}*v^{-1}*u*v$).

A group element is always printed by Magma as a normal word in the pc-generators of its parent group.

It is also possible to create an element of a group $G$ from its exponent vector. That is, the sequence $[e_1, e_2, \ldots, e_n]$ corresponds to the element ${G.1}^{e_1} * {G.2}^{e_2} * \cdots * {G.n}^{e_n}$. The coercion operator `!` is used to convert the sequence to the element.

<a id="operation-op-grppc-rngintelt"></a>
##### `G ! Q: GrpPC, [RngIntElt] -> GrpPCElt`

Given the pc-group $G$ and a sequence $Q$ of length $n$, containing the distinct positive integers ${\alpha_i}$, $0\leq {\alpha_i} < p_{i}$ for $i = 1,\ldots,n$, construct the element $x$ of $G$ given by

$$
x = a_1^{\alpha_1}\ldots a_n^{\alpha_n}, \quad 0 \leq \alpha_i < p_i
   \quad\hbox{\rm for } i = 1, \ldots, n.
$$

<a id="function-elementtosequence-grppcelt"></a>
##### `ElementToSequence(x): GrpPCElt -> [RngIntElt]`

<a id="function-eltseq-grppcelt"></a>
##### `Eltseq(x): GrpPCElt -> [RngIntElt]`

Given an element $x$ belonging to the pc-group $G$, where

$$
x = a_1^{\alpha_1}\ldots a_n^{\alpha_n}, \quad 0 \leq \alpha_i < p_i
   \quad\hbox{\rm for } i = 1, \ldots, n,
$$

return the sequence $Q$ of $n$ integers defined by $Q[i] = {\alpha_i}$, for $i = 1,\ldots,n$.

<a id="function-identity-grppc"></a>
##### `Identity(G): GrpPC -> GrpPCElt`

<a id="function-id-grppc"></a>
##### `Id(G): GrpPC -> GrpPCElt`

<a id="operation-op-grppc-rngintelt-2"></a>
##### `G ! 1: GrpPC, RngIntElt -> GrpPCElt`

Construct the identity element of the pc-group $G$.

<a id="example-ex-027472"></a>
##### `Example: Defining Elements of a Pc-Group (ex-027472)`

Given a pc-group, we can define elements as words in the generators or as more general expressions.

```magma
> G := PolycyclicGroup<a,b,c|a^3,b^2,c^2,b^a=c,c^a=b*c>;
> G;
GrpPC : G of order 12 = 2^2 * 3
PC-Relations:
    G.1^3 = Id(G),
    G.2^2 = Id(G),
    G.3^2 = Id(G),
    G.2^G.1 = G.3,
    G.3^G.1 = G.2 * G.3
> x := G.1^2*G.3;
> x;
G.1^2 * G.3
> x^2;
G.1 * G.2 * G.3
> x^3;
Id(G)
```

Magma will print the element in normal form even if it is not entered that way.

```magma
> G.2*G.1;
G.1 * G.3
```

When coercing a sequence into a group element, the sequence is always interpreted as an exponent vector for a normal word.

```magma
> y := G![0,1,1];
> y;
G.2 * G.3
> x*y;
G.1^2 * G.2
> y*x;
G.1^2
> (x,y);
G.2
```

An element can also be converted into a sequence.

```magma
> x^y;
G.1^2 * G.2 * G.3
> Eltseq(x^y);
[ 2, 1, 1 ]
```

#### Arithmetic Operations on Elements

New elements can be computed from existing elements using standard operations.

<a id="operation-op-times-grppcelt-grppcelt"></a>
##### `g * h: GrpPCElt, GrpPCElt -> GrpPCElt`

Product of the element $g$ and the element $h$, where $g$ and $h$ belong to some common subgroup $G$ of a pc-group $U$. If $g$ and $h$ are given as elements belonging to the same proper subgroup $G$ of $U$, then the result will be returned as an element of $G$; if $g$ and $h$ are given as elements belonging to distinct subgroups $H$ and $K$ of $U$, then the product is returned as an element of $G$, where $G$ is the smallest subgroup of $U$ known to contain both elements.

<a id="operation-operation-grppcelt-grppcelt-grppcelt"></a>
##### `g *:= h: GrpPCElt, GrpPCElt -> GrpPCElt`

Replace $g$ with the product of element $g$ and element $h$.

<a id="operation-op-pow-grppcelt-rngintelt"></a>
##### `g ^ n: GrpPCElt, RngIntElt -> GrpPCElt`

The $n$-th power of the element $g$, where $n$ is a positive or negative integer.

<a id="operation-operation-grppcelt-rngintelt-grppcelt"></a>
##### `g ^:= n: GrpPCElt, RngIntElt -> GrpPCElt`

Replace $g$ with the $n$-th power of the element $g$.

<a id="operation-op-div-grppcelt-grppcelt"></a>
##### `g / h: GrpPCElt, GrpPCElt -> GrpPCElt`

Quotient of the element $g$ by the element $h$, i.e. the element $g*h^{-1}$. Here $g$ and $h$ must belong to some common subgroup $G$ of a pc-group $U$. The rules for determining the parent group of $g/h$ are the same as for $g*h$.

<a id="operation-operation-grppcelt-grppcelt-grppcelt-2"></a>
##### `g /:= h: GrpPCElt, GrpPCElt -> GrpPCElt`

Replace $g$ with the quotient of the element $g$ by the element $h$.

<a id="operation-op-pow-grppcelt-grppcelt"></a>
##### `g ^ h: GrpPCElt, GrpPCElt -> GrpPCElt`

Conjugate of the element $g$ by the element $h$, i.e. the element $h^{-1}*g*h$. Here $g$ and $h$ must belong to some common subgroup $G$ of a pc-group $U$. The rules for determining the parent group of $g^h$ are the same as for $g*h$.

<a id="operation-operation-grppcelt-grppcelt-grppcelt-3"></a>
##### `g ^:= h: GrpPCElt, GrpPCElt -> GrpPCElt`

Replace $g$ with the conjugate of the element $g$ by the element $h$.

<a id="literal-literal-g1-gn-list-grppcelt-grppcelt"></a>
##### `(g₁, ..., gₙ): List(GrpPCElt) -> GrpPCElt`

Given the $n$ words $g_1, \ldots, g_n$ belonging to some common subgroup $G$ of a pc-group $U$, return the commutator. If $g_1, \ldots, g_n$ are given as elements belonging to the same proper subgroup $G$ of $U$, then the result will be returned as an element of $G$; if $g_1, \ldots, g_n$ are given as elements belonging to distinct subgroups of $U$, then the product is returned as an element of $G$, where $G$ is the smallest subgroup of $U$ known to contain all elements. Commutators are *left-normed*, so that they are evaluated from left to right.

#### Properties of Elements

<a id="function-order-grppcelt"></a>
##### `Order(x): GrpPCElt -> RngIntElt`

Order of the element $x$.

<a id="function-parent-grppcelt"></a>
##### `Parent(x): GrpPCElt -> GrpPC`

The parent group $G$ of the element $x$.

#### Predicates for Elements

Elements in the same group can be compared using `eq` and `ne`.

<a id="operation-op-eq-grppcelt-grppcelt"></a>
##### `g eq h: GrpPCElt, GrpPCElt -> BoolElt`

Given elements $g$ and $h$ belonging to a common pc-group, return `true` if $g$ and $h$ are the same element, `false` otherwise.

<a id="operation-op-ne-grppcelt-grppcelt"></a>
##### `g ne h: GrpPCElt, GrpPCElt -> BoolElt`

Given elements $g$ and $h$ belonging to a common pc-group, return `true` if $g$ and $h$ are distinct elements, `false` otherwise.

<a id="function-isidentity-grppcelt"></a>
##### `IsIdentity(g): GrpPCElt -> BoolElt`

<a id="function-isid-grppcelt"></a>
##### `IsId(g): GrpPCElt -> BoolElt`

Returns `true` if $g$ is the identity element, `false` otherwise.

<a id="function-isconjugate-grppc-grppcelt-grppcelt"></a>
##### `IsConjugate(G, g, h): GrpPC, GrpPCElt, GrpPCElt -> BoolElt, GrpPCElt`

Given a group $G$ and elements $g$ and $h$ belonging to $G$, return the value `true` if $g$ and $h$ are conjugate in $G$. The function also returns a second value in the event that the elements are conjugate: an element $z$ such that $g^z=h$.

<a id="example-ex-7b7701"></a>
##### `Example: Testing Whether Elements Commute (ex-7b7701)`

We check if one element commutes with another.

```magma
> G<a,b,c> := PolycyclicGroup<a,b,c|a^3,b^2,c^2,b^a=c,c^a=b*c>;
> b^a eq b;
false
```

The same information can also be obtained by checking the commutator.

```magma
> IsIdentity((b,a));
false
```

If we assign the result of `IsConjugate` to a single variable, it will store the boolean result.

```magma
> r := IsConjugate(G, c, b);
> r;
true
```

If we simply print `IsConjugate`, the boolean value and the conjugating element (if any) are displayed. On the other hand, using the multiple assignment, we can capture both of those values.

```magma
> IsConjugate(G, c, b);
true a^2
> r, x := IsConjugate(G, c, b);
> x, r;
a^2 true
> c^x;
b
```

#### Set Operations

These functions allow one to work with the set of elements of $G$, possibly without much knowledge of the structure of $G$.

<a id="function-numberingmap-grppc"></a>
##### `NumberingMap(G): GrpPC -> Map`

A bijective mapping from the group $G$ onto the set of integers $\{1 ... |G|\}$. The actual mapping depends upon the current presentation for $G$.

<a id="function-random-grppc"></a>
##### `Random(G): GrpPC -> GrpPCElt`

An element, randomly chosen, from the group $G$. This function uses an entirely different procedure than that used by `RandomProcess` (see below). A group element is chosen with uniform probability by generating (pseudo-)random integers in the proper range to form a legal exponent vector for $G$. The corresponding element is returned. This is an extremely efficient process and is the recommended method for producing random elements of a pc-group.

<a id="function-randomprocess-grppc"></a>
##### `RandomProcess(G): GrpPC -> Process`

```magma
Slots   : RngIntElt                    Default: 10
Scramble: RngIntElt                    Default: 20
```

Create a process to generate randomly chosen elements from the group $G$. The process uses an ‘expansion’ procedure to construct a set of elements corresponding to fairly long words in the generators of $G$. At all times, $N$ elements are stored where $N$ is the maximum of the specified value for `Slots` and `Ngens`$(G) + 1$. Initially, these are simply the generators of $G$ and products of pairs of generators of $G$. Random elements are now produced by successive calls to `Random(P)`, where $P$ is the process created by this function. Each such call chooses an element $x$ stored by the process and returns it, replacing $x$ with the product of $x$ and another random element (multiplied on the left or the right). Setting `Scramble := m` causes $m$ such operations to be performed initially.

<a id="function-random-process"></a>
##### `Random(P): Process -> GrpPCElt`

Given a random element process $P$ created by the function `RandomProcess(G)` for the finite group $G$, construct a random element of $G$ by forming a random product over the expanded generating set constructed when the process was created.

<a id="function-representative-grppc"></a>
##### `Representative(G): GrpPC -> GrpPCElt`

<a id="function-rep-grppc"></a>
##### `Rep(G): GrpPC -> GrpPCElt`

A representative element of $G$. For a pc-group, this always returns the identity element.

<a id="example-ex-0f7a7b"></a>
##### `Example: Numbering Group Elements (ex-0f7a7b)`

The `NumberingMap` function assigns a number to each group element.

```magma
> G := DihedralGroup(GrpPC,4);
> num_map := NumberingMap(G);
> for x in G do
>   print x,"->",num_map(x);
> end for;
Id(G) -> 1
G.3 -> 2
G.2 -> 3
G.2 * G.3 -> 4
G.1 -> 5
G.1 * G.3 -> 6
G.1 * G.2 -> 7
G.1 * G.2 * G.3 -> 8
```

The inverse map can be used to obtain the group element corresponding to a particular number.

```magma
> 6 @@ num_map;
G.1 * G.3
```

The `Random` function is sometimes useful to create a statistical profile of a group. To demonstrate, we take two groups of order $3^6$ from the `SmallGroup` database.

```magma
> G1 := SmallGroup(3^6, 60);
> G2 := SmallGroup(3^6, 392);
```

We want to build a histogram of element orders for each group. Since these are 3-groups, each order will be a power of 3 and we use `Ilog` to get the exponent of the order. First, we define a short function to compute the histogram.

```magma
> function hist(G, trials)
>   // Given a 3-group G, of exponent <= 3^5,
>   // return a sequence whose ith term is the
>   // number of elements of order p^(i-1) out
>   // of trials randomly chosen elements.
>   table := [0,0,0,0,0,0];
>   for i := 1 to trials do
>     x := Random(G);
>     n := Ilog(3, Order(x));
>     table[n+1] +:= 1;
>   end for;
>   return table;
> end function;
```

Now, we use this function to compute order distributions for 100 elements in each group.

```magma
> t1 := hist(G1,100);
> t1;
[ 0, 0, 5, 28, 67, 0 ]
> t2 := hist(G2,100);
> t2;
[ 0, 5, 5, 25, 65, 0 ]
```

We can even display them with simple character graphics.

```magma
> for e in t1 do print ":","@"^e; end for;
:
:
: @@@@@
: @@@@@@@@@@@@@@@@@@@@@@@@@@@@
: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
:
> for e in t1 do print ":","@"^e; end for;
:
: @@@@@
: @@@@@
: @@@@@@@@@@@@@@@@@@@@@@@@@
: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
:
```

<a id="example-ex-91703e"></a>
##### `Example: Set Product of Two Subgroups (ex-91703e)`

Given the subgroups $H$ and $K$ of $G$, construct the set product of the groups $H$ and $K$.

```magma
> set_product := func<G, H, K | { G | x * y : x in H, y in K }>;
```

Given a subgroup $H$ of the pc-group $G$, construct $H$ as a set of elements of $G$.

```magma
> elements := func<G, H | { G | x : x in H }>;
```

### Conjugacy

<a id="function-class-grppc-grppcelt"></a>
#### `Class(H, g): GrpPC, GrpPCElt -> { GrpPCElt}`

<a id="function-conjugates-grppc-grppcelt"></a>
#### `Conjugates(H, g): GrpPC, GrpPCElt -> { GrpPCElt}`

<a id="operation-op-pow-grppcelt-grppc"></a>
#### `g ^ H: GrpPCElt, GrpPC -> { GrpPCElt}`

Given a group $H$ and an element $g$ belonging to a group $K$ such that $H$ and $K$ are subgroups of some covering group, this function returns the set of conjugates of $g$ under the action of $H$. If $H = K$, the function returns the conjugacy class of $g$ in $H$.

<a id="function-conjugacyclasses-grppc"></a>
#### `ConjugacyClasses(G): GrpPC -> [ <RngIntElt, RngIntElt, GrpPCElt> ]`

<a id="function-classes-grppc"></a>
#### `Classes(G): GrpPC -> [ <RngIntElt, RngIntElt, GrpPCElt> ]`

Construct a set of representatives for the conjugacy classes of $G$. The classes are returned as a sequence of tuples containing the order of the elements in the class, the class length, and a representative element for the class. For non-$p$-groups, the classes are computed using the homomorphism principle down a series with elementary abelian factors and orbit-stabilizer in each quotient. See [[MN89](https://docs.magma-maths.org/references.md#cite-mecky-neubuser)] for details. For $p$-groups an algorithm based on linear algebra developed by Charles Leedham-Green is used.

<a id="function-classmap-grppc"></a>
#### `ClassMap(G): GrpPC -> Map`

The class map $M\colon G \rightarrow \{1, \ldots, n\}$ for the group $G$, where $n$ is the number of conjugacy classes of $G$.

<a id="function-classrepresentative-grppc-grppcelt"></a>
#### `ClassRepresentative(G, x): GrpPC, GrpPCElt -> GrpPCElt`

<a id="function-classrepresentative-grppc-rngintelt"></a>
#### `ClassRepresentative(G, i): GrpPC, RngIntElt -> GrpPCElt`

The designated representative for the conjugacy class of $G$ containing the element $x$ (relative to existing conjugacy classes) or the stored representative for conjugacy class $i$.

<a id="function-classcentraliser-grppc-rngintelt"></a>
#### `ClassCentraliser(G, i): GrpPC, RngIntElt -> GrpPCElt`

<a id="function-classcentralizer-grppc-rngintelt"></a>
#### `ClassCentralizer(G, i): GrpPC, RngIntElt -> GrpPCElt`

The centralizer in $G$ of the designated representative for conjugacy class $i$ of $G$.

<a id="function-isconjugate-grppc-grppcelt-grppcelt-2"></a>
#### `IsConjugate(G, g, h): GrpPC, GrpPCElt, GrpPCElt -> BoolElt, GrpPCElt`

Given a group $G$ and elements $g$ and $h$ belonging to $G$, return the value true if $g$ and $h$ are conjugate in $G$. The function also returns a second value in the event that the elements are conjugate: an element $z$ which conjugates $g$ into $h$.

<a id="function-numberofclasses-grppc"></a>
#### `NumberOfClasses(G): GrpPC -> RngIntElt`

<a id="function-nclasses-grppc"></a>
#### `Nclasses(G): GrpPC -> RngIntElt`

The number of conjugacy classes of elements of the group $G$.

<a id="function-powermap-grppc"></a>
#### `PowerMap(G): GrpPC -> Map`

The power map $M\colon \{1 \ldots n\}\times {\mathbb{Z}}\rightarrow \{1 \ldots n\}$ associated with the conjugacy classes of $G$. The map $M$ describes where the elements of the conjugacy classes of $G$ move under powers. That is, $<c$, $n>$@$M$ returns the class number where class $c$ moves under the power $n$. The value of $c$ must be in the range [$1\ldots$`Nclasses(G)`].

<a id="example-ex-bdfb19"></a>
#### `Example: Conjugacy Classes of SL(2, 3) (ex-bdfb19)`

Let $G$ be a pc-representation of SL(2,3). We can compute the conjugacy classes of $G$. Notice that the conjugacy class object has a special printing routine, but you can still access individual entries.

```magma
> G := PCGroup(SpecialLinearGroup(2,GF(3)));
> G;
GrpPC : G of order 24 = 2^3 * 3
PC-Relations:
    G.1^3 = Id(G),
    G.2^2 = G.4,
    G.3^2 = G.4,
    G.4^2 = Id(G),
    G.2^G.1 = G.3 * G.4,
    G.3^G.1 = G.2 * G.3 * G.4,
    G.3^G.2 = G.3 * G.4
> Nclasses(G);
7
> cc := Classes(G);
> cc;
Conjugacy Classes of group G
----------------------------
[1]     Order 1       Length 1
        Rep Id(G)

[2]     Order 2       Length 1
        Rep G.4

[3]     Order 3       Length 4
        Rep G.1

[4]     Order 3       Length 4
        Rep G.1^2

[5]     Order 4       Length 6
        Rep G.2

[6]     Order 6       Length 4
        Rep G.1 * G.4

[7]     Order 6       Length 4
        Rep G.1^2 * G.4


> cc[3];
<3, 4, G.1>
> x := cc[3][3];
> Class(G,x);
{ G.1 * G.2 * G.3 * G.4, G.1 * G.2 * G.4, G.1, G.1 * G.3 }
7
>
```

We can use the `ClassMap` function to compute class multiplication constants (structure constants for the center of the group algebra). For example, we compute the decomposition of class 3 times class 5.

```magma
> cm := ClassMap(G);
> cm(G.1);
3
> i := 3; j := 5;
> t := [0: c in cc];
> for x in Class(G,cc[i][3]), y in Class(G,cc[j][3]) do
>   t[cm(x*y)] +:= 1;
> end for;
> t;
[ 0, 0, 12, 0, 0, 12, 0 ]
```

To get the actual structure constants, we need to divide each entry in `t` by the corresponding class size.

```magma
> [ t[i]/cc[i][2]: i in [1..#t] ];
[ 0, 0, 3, 0, 0, 3, 0 ]
```

### Subgroups

Subgroups of pc-groups are treated as independent pc-groups in their own right, with the subgroup relationship maintained in internal data structures. Thus, a subgroup has generators and a pc-presentation and one can apply any of the functions described earlier for groups. Furthermore, there are a variety of functions and operations specifically involving subgroups.

#### Definition of Subgroups by Generators

The most flexible method of defining a subgroup is to list generators or normal generators for the subgroup.

<a id="constructor-constructor-sub-grppc-list-grppc-map"></a>
##### `sub<G | L>: GrpPC, List -> GrpPC, Map`

Construct the subgroup $H$ of the pc-group $G$ generated by the elements specified by the terms of the *generator list* $L$.

A term $L[i]$ of the generator list may consist of any of the following objects:

**(a)**
An element liftable to $G$ (in particular, any element of $G$);

**(b)**
A subgroup of $G$;

**(c)**
A set or sequence of (a), or (b).

The collection of words and groups specified by the list must all belong to the group $G$ and $H$ will be constructed as a subgroup of $G$.

The subgroup $H$ is defined to be generated by the words specified directly by terms $L[i]$ together with the stored generating words for any groups specified by terms of $L[i]$. Magma will compute a set of pc-generators for $H$ and, if $H$ is a $p$-group, a minimal generating set.

The inclusion map from $H$ to $G$ is returned as well.

<a id="constructor-constructor-ncl-grppc-list-grppc-map"></a>
##### `ncl<G | L>: GrpPC, List -> GrpPC, Map`

Construct the subgroup $N$ of the pc-group $G$ as the normal closure of the subgroup generated by the elements specified by the terms of the *generator list* $L$.

The possible forms of a term $L[i]$ of the generator list are the same as for the `sub`-constructor.

The inclusion map from $N$ to $G$ is returned as well.

<a id="example-ex-9f724a"></a>
##### `Example: Creating Subgroups by Generators (ex-9f724a)`

We define $G$ to be $Z_5$ wr $Z_3$ and then create two subgroups. Notice that the `ncl`-constructor builds a larger subgroup in this case.

```magma
> G<a,b,c,d> := PolycyclicGroup<a,b,c,d| a^3, b^5, c^5, d^5,
>   b^a = c, c^a = d, d^a = b>;
> H := sub<G| b,c>;
> Order(H);
25
> IsAbelian(H);
true
> IsNormal(G, H);
false
> N := ncl<G| b,c>;
> IsNormal(G, N);
true
> Order(N);
125
```

#### Membership and Coercion

There are several functions and operators which allow one to take advantage of the subgroup relationship to rewrite elements from one presentation to another. That is, if $x$ is an element of $H$ which is a subgroup of $G$, then $x$ has a representation as a normal word in the pc-generators of $H$, but also has a representation as a (different) normal word in the pc-generators of $G$. The coercion operator and inclusion map allow one to compute one of these words based on the other, thus shifting where we view the element in question.

Magma keeps track of the various relationships between subgroups in a group. Thus, if $H$ is a subgroup of $K$ which is a subgroup of $G$, then $H$ can also be considered a subgroup $G$. Similarly, in situations involving elements of two groups, $A$ and $B$, Magma will often try to find a *covering group* $C$ which contains both of $A$ and $B$. In this case, the elements may be automatically coerced into the covering group.

<a id="operation-op-in-grppcelt-grppc"></a>
##### `g in G: GrpPCElt, GrpPC -> BoolElt`

Given an element $g$ and a group $G$, return `true` if $g$ is an element of $G$, `false` otherwise. In order for this comparison to make sense, both $g$ and $G$ must be contained in some covering group.

<a id="operation-op-notin-grppcelt-grppc"></a>
##### `g notin G: GrpPCElt, GrpPC -> BoolElt`

Given an element $g$ and a group $G$, return `true` if $g$ is not an element of $G$, `false` otherwise. In order for this comparison to make sense, both $g$ and $G$ must be contained in some covering group.

<a id="operation-op-grppc-grppcelt"></a>
##### `G ! g: GrpPC, GrpPCElt -> GrpPCElt`

Given an element $g$ belonging to some subgroup $H$ of the group $G$, rewrite $g$ as an element of $G$.

<a id="operation-op-grppc-grppcelt-2"></a>
##### `H ! g: GrpPC, GrpPCElt -> GrpPCElt`

Given an element $g$ belonging to the group $G$, and given a subgroup $H$ of $G$ containing $g$, rewrite $g$ as an element of $H$.

<a id="operation-op-grppc-grppcelt-3"></a>
##### `K ! g: GrpPC, GrpPCElt -> GrpPCElt`

Given an element $g$ belonging to the group $H$, and a group $K$, such that $H$ and $K$ are subgroups of a covering group $G$, and both $H$ and $K$ contain $g$, rewrite $g$ as an element of $K$.

<a id="example-ex-ac7047"></a>
##### `Example: Membership and Coercion in Subgroups (ex-ac7047)`

We create two subgroups of a dihedral group.

```magma
> G := DihedralGroup(GrpPC, 10);
> C := sub<G| G.2>;
> H := sub<G| G.1, G.3>;
> H.1 in C;
false
> H.2 in C;
true
> Parent(H.1);
GrpPC : H of order 10 = 2 * 5
PC-Relations:
    H.1^2 = Id(H),
    H.2^5 = Id(H),
    H.2^H.1 = H.2^4
> G!(H.1);
G.1
```

Magma will compute appropriate covering groups as needed.

```magma
> H.1*C.1;
G.1 * G.2 * G.3^2
> x := (H.1, C.2);
> x;
G.3^2
> H!x;
H.2^2
> C!x;
C.2^2
> C!(H.2);
C.2
```

#### Inclusion and Equality

<a id="operation-op-subset-grppcelt-grppc"></a>
##### `S subset G: { GrpPCElt}, GrpPC -> BoolElt`

Given a group $G$ and a set $S$ of elements belonging to a group $H$, where $G$ and $H$ have some covering group, return `true` if $S$ is a subset of $G$, `false` otherwise.

<a id="operation-operation-notsubset-grppcelt-grppc-boolelt"></a>
##### `S notsubset G: { GrpPCElt}, GrpPC -> BoolElt`

Given a group $G$ and a set $S$ of elements belonging to a group $H$, where $G$ and $H$ have some covering group, return `true` if $S$ is not a subset of $G$, `false` otherwise.

<a id="operation-op-subset-grppc-grppc"></a>
##### `H subset G: GrpPC, GrpPC -> BoolElt`

<a id="function-issubgroup-grppc-grppc"></a>
##### `IsSubgroup(H, G): GrpPC, GrpPC -> BoolElt`

Given groups $G$ and $H$, subgroups of some covering group, return `true` if $H$ is a subgroup of $G$, `false` otherwise.

<a id="operation-operation-notsubset-grppc-grppc-boolelt"></a>
##### `H notsubset G: GrpPC, GrpPC -> BoolElt`

Given groups $G$ and $H$, subgroups of some covering group, return `true` if $H$ is not a subgroup of $G$, `false` otherwise.

<a id="operation-op-eq-grppc-grppc"></a>
##### `G eq H: GrpPC, GrpPC -> BoolElt`

Given groups $G$ and $H$, subgroups of some covering group, return `true` if $G$ and $H$ are the same group, `false` otherwise.

<a id="operation-op-ne-grppc-grppc"></a>
##### `G ne H: GrpPC, GrpPC -> BoolElt`

Given groups $G$ and $H$, subgroups of some covering group, return `true` if $G$ and $H$ are distinct groups, `false` otherwise.

<a id="function-inclusionmap-grppc-grppc"></a>
##### `InclusionMap(G, H): GrpPC, GrpPC -> Map`

The map from the subgroup $H$ of $G$ to $G$.

#### Standard Subgroup Constructions

The operators and functions which construct a subgroup of a pc-group always return the subgroup as a pc-group.

<a id="operation-op-pow-grppc-grppcelt"></a>
##### `H ^ g: GrpPC, GrpPCElt -> GrpPC`

<a id="function-conjugate-grppc-grppcelt"></a>
##### `Conjugate(H, g): GrpPC, GrpPCElt -> GrpPC`

Construct the conjugate $g^{-1}*H*g$ of the group $H$ under the action of the element $g$. The group $H$ and the element $g$ must belong to a common group.

<a id="operation-op-meet-grppc-grppc"></a>
##### `H meet K: GrpPC, GrpPC -> GrpPC`

The intersection of groups $H$ and $K$. The algorithm used for non-$p$-groups is described in [[GS90](https://docs.magma-maths.org/references.md#cite-gs-intnorm)].

<a id="operation-operation-meet-grppc-grppc-grppc"></a>
##### `H meet:= K: GrpPC, GrpPC -> GrpPC`

Replace $H$ with the intersection of groups $H$ and $K$.

<a id="function-commutatorsubgroup-grppc-grppc-grppc"></a>
##### `CommutatorSubgroup(G, H, K): GrpPC, GrpPC, GrpPC -> GrpPC`

<a id="function-commutatorsubgroup-grppc-grppc"></a>
##### `CommutatorSubgroup(H, K): GrpPC, GrpPC -> GrpPC`

Construct the commutator subgroup of groups $H$ and $K$, where $H$ and $K$ are subgroups of a common group $G$.

<a id="function-centralizer-grppc-grppcelt"></a>
##### `Centralizer(G, g): GrpPC, GrpPCElt -> GrpPC`

<a id="function-centraliser-grppc-grppcelt"></a>
##### `Centraliser(G, g): GrpPC, GrpPCElt -> GrpPC`

The centralizer of the element $g$ in the group $G$.

<a id="function-centralizer-grppc-grppc"></a>
##### `Centralizer(G, H): GrpPC, GrpPC -> GrpPC`

<a id="function-centraliser-grppc-grppc"></a>
##### `Centraliser(G, H): GrpPC, GrpPC -> GrpPC`

The centralizer of the subgroup $H$ in the group $G$.

<a id="function-core-grppc-grppc"></a>
##### `Core(G, H): GrpPC, GrpPC -> GrpPC`

The maximal normal subgroup of $G$ that is contained in the subgroup $H$ of $G$.

<a id="operation-op-pow-grppc-grppc"></a>
##### `H ^ G: GrpPC, GrpPC -> GrpPC`

<a id="function-normalclosure-grppc-grppc"></a>
##### `NormalClosure(G, H): GrpPC, GrpPC -> GrpPC`

The normal closure of the subgroup $H$ in the group $G$.

<a id="function-normalizer-grppc-grppc"></a>
##### `Normalizer(G, H): GrpPC, GrpPC -> GrpPC`

<a id="function-normaliser-grppc-grppc"></a>
##### `Normaliser(G, H): GrpPC, GrpPC -> GrpPC`

The normalizer of the subgroup $H$ of the group $G$. The algorithm used for non-$p$-groups is described in [[GS90](https://docs.magma-maths.org/references.md#cite-gs-intnorm)].

<a id="example-ex-38016c"></a>
##### `Example: Subgroup Constructions (ex-38016c)`

We’ll consider various subgroups of a direct product of a cyclic group of order 6 and dihedral group of order 10.

```magma
> G := DirectProduct(CyclicGroup(GrpPC,6), DihedralGroup(GrpPC,5));
> x := G.3;
> C := Centralizer(G,x);
> C;
GrpPC : C of order 12 = 2^2 * 3
PC-Relations:
    C.1^2 = Id(C),
    C.2^2 = Id(C),
    C.3^3 = Id(C)
> H := sub<G|G.2,G.4>;
> Order(H);
15
```

We can compute the intersection using the `meet` operator.

```magma
> K := H meet C;
> K;
GrpPC : K of order 3
PC-Relations:
    K.1^3 = Id(K)
```

To get the join of two subgroups, we simply use the `sub`-constructor.

```magma
> J := sub<G|H, C>;
> J eq G;
true
```

#### Properties of Subgroups

<a id="function-index-grppc-grppc"></a>
##### `Index(G, H): GrpPC, GrpPC -> RngIntElt`

The index of the subgroup $H$ in the group $G$, returned as an ordinary integer.

<a id="function-factoredindex-grppc-grppc"></a>
##### `FactoredIndex(G, H): GrpPC, GrpPC -> [<RngIntElt, RngIntElt>]`

The factored index of the subgroup $H$ in the group $G$.

#### Predicates for Subgroups

<a id="function-iscentral-grppc-grppc"></a>
##### `IsCentral(G, H): GrpPC, GrpPC -> BoolElt`

Returns `true` if the subgroup $H$ of the group $G$ lies in the centre of $G$, `false` otherwise.

<a id="function-isconjugate-grppc-grppc-grppc"></a>
##### `IsConjugate(G, H, K): GrpPC, GrpPC, GrpPC -> BoolElt, GrpPCElt`

Given a group $G$ and subgroups $H$ and $K$ belonging to $G$, return the value `true` if $H$ and $K$ are conjugate in $G$. The function returns a second value in the event that the subgroups are conjugate: an element $z$ which conjugates $H$ into $K$.

<a id="function-ismaximal-grppc-grppc"></a>
##### `IsMaximal(G, H): GrpPC, GrpPC -> BoolElt`

Returns `true` if the subgroup $H$ of the group $G$ is a maximal subgroup of $G$, `false` otherwise.

<a id="function-isnormal-grppc-grppc"></a>
##### `IsNormal(G, H): GrpPC, GrpPC -> BoolElt`

Returns `true` if the subgroup $H$ of the group $G$ is a normal subgroup of $G$, `false` otherwise.

<a id="function-isselfnormalizing-grppc-grppc"></a>
##### `IsSelfNormalizing(G, H): GrpPC, GrpPC -> BoolElt`

Returns `true` if the subgroup $H$ of the group $G$ is self-normalizing in $G$, `false` otherwise.

<a id="function-issubnormal-grppc-grppc"></a>
##### `IsSubnormal(G, H): GrpPC, GrpPC -> BoolElt`

Returns `true` if the subgroup $H$ of the group $G$ is subnormal in $G$, `false` otherwise.

<a id="example-ex-340cb9"></a>
##### `Example: Predicates for Subgroups (ex-340cb9)`

```magma
> G := PCGroup(Sym(4));
> G;
GrpPC : G of order 24 = 2^3 * 3
PC-Relations:
    G.1^2 = Id(G),
    G.2^3 = Id(G),
    G.3^2 = Id(G),
    G.4^2 = Id(G),
    G.2^G.1 = G.2^2,
    G.3^G.1 = G.3 * G.4,
    G.3^G.2 = G.4,
    G.4^G.2 = G.3 * G.4
> U := sub<G|G.4>;
> IsNormal(G,U);
false
> IsSubnormal(G,U);
true
```

Now, we try to construct a subnormal chain by taking normalizers.

```magma
> N1 := Normalizer(G,U);
> Index(G,N1);
3
> N2 := Normalizer(G,N1);
> Index(G,N2);
3
> N1 eq N2;
true
```

We’re stuck. However, we can work our way down with `NormalClosure`.

```magma
> M1 := NormalClosure(G,U);
> U subset M1;
true
> M1 subset U;
false
> M2 := NormalClosure(M1,U);
> M2 eq U;
true
```

Now, we work inside the Sylow 2-subgroup and look for complements of the cyclic group of order 4 by brute force.

```magma
> S := Sylow(G,2);
> S;
GrpPC : S of order 8 = 2^3
PC-Relations:
    S.2^S.1 = S.2 * S.3
> T := sub<S|S.1*S.2>;
> list := [];
> for x in S do
>   if (Order(x) ne 2) or (x in T) then
>     continue;
>   end if;
>   Append(~list, sub<S|x>);
> end for;
> #list;
4
> for i in [1..3], j in [i+1..4] do
>   print i,j,IsConjugate(S,list[i],list[j]);
> end for;
1 2 true S.1
1 3 false
1 4 false
2 3 false
2 4 false
3 4 true S.2
```

We see that $T$ has two conjugacy classes of complements.

#### Hall $\pi$-Subgroups and Sylow Systems

The functions given here all assume that $G$ is a soluble group having order $p_{1}^{e_1}p_{2}^{e_2} \cdots p_{k}^{e_k}$.

<a id="function-complementbasis-grppc"></a>
##### `ComplementBasis(G): GrpPC -> [GrpPC]`

A complement basis of the soluble group $G$. This is a sequence of $k$ subgroups of $G$, where the $i$-th subgroup has order $p_{1}^{e_{1}} \ldots p_{i - 1}^ {e_{i - 1}} p_{i + 1}^{e_{i + 1}} \ldots p_{k}^{e_{k}}$, i.e. the complements of the $k$ Sylow subgroups of $G$.

<a id="function-hallsubgroup-grppc-rngintelt"></a>
##### `HallSubgroup(G, S): GrpPC, { RngIntElt} -> GrpPC`

<a id="function-hallsubgroup-grppc-rngintelt-2"></a>
##### `HallSubgroup(G, S): GrpPC, RngIntElt -> GrpPC`

The Hall $\pi$-subgroup of $G$, where $\pi$ is defined by $S$. The argument $S$ may be a set of primes, a single prime, or the negation of a single prime. If $S = -p$, then the Hall $p'$-subgroup of $G$ is returned.

<a id="function-pcore-grppc-rngintelt"></a>
##### `pCore(G, S): GrpPC, { RngIntElt} -> GrpPC`

<a id="function-pcore-grppc-rngintelt-2"></a>
##### `pCore(G, S): GrpPC, RngIntElt -> GrpPC`

The core of the Hall $\pi$-subgroup, where $\pi$ is defined by the argument $S$, which has the same interpretation as for `HallSubgroup`.

<a id="function-sylowbasis-grppc"></a>
##### `SylowBasis(G): GrpPC -> [GrpPC]`

A Sylow basis for the soluble group $G$. This is a sequence of $k$ subgroups of $G$, having orders $p_{1}^{e_{1}}, \ldots, p_{k}^{e_{k}}$, i.e. the $k$ Sylow subgroups of $G$.

<a id="function-sylowsubgroup-grppc-rngintelt"></a>
##### `SylowSubgroup(G, p): GrpPC, RngIntElt -> GrpPC`

<a id="function-sylow-grppc-rngintelt"></a>
##### `Sylow(G, p): GrpPC, RngIntElt -> GrpPC`

A Sylow $p$-subgroup for the group $G$.

<a id="function-systemnormalizer-grppc"></a>
##### `SystemNormalizer(G): GrpPC -> GrpPC`

<a id="function-systemnormaliser-grppc"></a>
##### `SystemNormaliser(G): GrpPC -> GrpPC`

The system normalizer for the group $G$. The system normalizer of the complement basis $\Sigma = \lbrace H_1,...,H_k\rbrace$ is defined to be the intersection of the normalizers in G of each $H_i$, ie. $N(\Sigma) = \cap_{i=1}^{k} N_G(H_i)$. The algorithm used is derived directly from the definition.

<a id="example-ex-475f0f"></a>
##### `Example: Hall Subgroups of a Wreath Product (ex-475f0f)`

Given the group $D_3 \wr D_5$, we can construct the Hall 2-subgroup as follows:

```magma
> H := DihedralGroup(GrpPerm, 5);
> G := WreathProduct(DihedralGroup(GrpPC, 3), DihedralGroup(GrpPC, 5),
>         [H.2, H.1]);
> H2 := HallSubgroup(G, 2);
> Order(H2);
64
```

The Hall $2'$-subgroup of the same group is constructed as follows:

```magma
> H35 := HallSubgroup(G, -2);
> Order(H35);
1215
```

#### Conjugacy Classes of Subgroups

Magma has functions for computing the subgroups of a group that return the subgroups either as a list of conjugacy class representatives as or as a poset. Details of these functions may be found in Chapter [Groups](https://docs.magma-maths.org/FiniteGroups/Groups/index-groups.md#chapgrp). Here we mention the basic functions for convenience.

<a id="function-subgroupclasses-grppc"></a>
##### `SubgroupClasses(G): GrpPC -> SeqEnum`

<a id="function-subgroups-grppc"></a>
##### `Subgroups(G): GrpPC -> SeqEnum`

Conjugacy class representatives for all subgroups of $G$. The algorithm was developed by M. Slattery and is essentially that of [[Hul99](https://docs.magma-maths.org/references.md#cite-hulpke-subs)] without the action of automorphisms.

<a id="function-abeliansubgroups-grppc"></a>
##### `AbelianSubgroups(G): GrpPC -> SeqEnum`

<a id="function-cyclicsubgroups-grppc"></a>
##### `CyclicSubgroups(G): GrpPC -> SeqEnum`

<a id="function-elementaryabeliansubgroups-grppc"></a>
##### `ElementaryAbelianSubgroups(G): GrpPC -> SeqEnum`

<a id="function-nilpotentsubgroups-grppc"></a>
##### `NilpotentSubgroups(G): GrpPC -> SeqEnum`

Conjugacy class representatives for all subgroups of the indicated type in $G$. The algorithm used is essentially that of [[Hul99](https://docs.magma-maths.org/references.md#cite-hulpke-subs)] without the action of automorphisms. Appropriate filters are applied to select the desired groups at each successive quotient in the computation.

<a id="function-lowindexsubgroups-grppc-rngintelt"></a>
##### `LowIndexSubgroups(G, n): GrpPC, RngIntElt -> []`

Conjugacy class representatives for all subgroups of $G$ having index $\le n$ in $G$.

<a id="function-maximalsubgroups-grppc"></a>
##### `MaximalSubgroups(G): GrpPC -> [GrpPC]`

A sequence of conjugacy class representatives for the maximal subgroups of $G$. The algorithm, developed by Charles Leedham-Green, relies on computing a special presentation for $G$.

<a id="function-subgrouplattice-grppc"></a>
##### `SubgroupLattice(G): GrpPC -> SubGrpLat`

The lattice of conjugacy classes of subgroups of $G$.

<a id="function-burnsidematrix-grppc"></a>
##### `BurnsideMatrix(G): GrpPC -> AlgMatElt`

The Burnside matrix corresponding to the lattice of subgroups of $G$. The $(i,j)$th entry of the matrix is the number of subgroups in class $i$ contained in a single subgroup of class $j$ when $i\le j$, and is the number of subgroups of class $i$ containing a given subgroup in class $j$ when $i\ge j$.

<a id="function-tableofmarks-grppc"></a>
##### `TableOfMarks(G): GrpPC -> AlgMatElt`

Burnside’s table of marks corresponding to the lattice of subgroups of $G$. Rows correspond to marks for transitive permutation representations of $G$, while the entries in column $j$ are the number of fixed points of subgroup class $j$ in each transitive representation.

<a id="procedure-displayburnsidematrix-grppc"></a>
##### `DisplayBurnsideMatrix(G): GrpPC`

Pretty-print the Burnside matrix corresponding to the lattice of subgroups of $G$.

<a id="example-ex-cf7628"></a>
##### `Example: Subgroup Classes (ex-cf7628)`

To show a bit about subgroup classes, we look at the direct product of $C_3$ and $D_3$. First we list out the normal subgroups of $G$.

```magma
> G := DirectProduct(CyclicGroup(GrpPC,3),
>                      DihedralGroup(GrpPC,3));
> ns := NormalSubgroups(G);
> ns;
Conjugacy classes of subgroups
------------------------------

[1]     Order 1            Length 1
        GrpPC of order 1
        PC-Relations:
[2]     Order 3            Length 1
        GrpPC of order 3
        PC-Relations:
            $.1^3 = Id($)
[3]     Order 3            Length 1
        GrpPC of order 3
        PC-Relations:
            $.1^3 = Id($)
[4]     Order 6            Length 1
        GrpPC of order 6 = 2 * 3
        PC-Relations:
            $.1^2 = Id($),
            $.2^3 = Id($),
            $.2^$.1 = $.2^2
[5]     Order 9            Length 1
        GrpPC of order 9 = 3^2
        PC-Relations:
            $.1^3 = Id($),
            $.2^3 = Id($)
[6]     Order 18           Length 1
        GrpPC of order 18 = 2 * 3^2
        PC-Relations:
            $.1^2 = Id($),
            $.2^3 = Id($),
            $.3^3 = Id($),
            $.3^$.1 = $.3^2
```

The normal subgroups sequence has a special printing routine. Each entry in the sequence is actually a record.

```magma
> ns[2];
rec<recformat<order, length, subgroup, presentation> |
 order := 3, length := 1, subgroup := GrpPC of order 3
PC-Relations:
    $.1^3 = Id($)>
```

We extract the two normal subgroups of order 3. Each of them turn out to have one conjugacy class of complements in $G$. However, one of the complements is normal and the other is not.

```magma
> N1 := ns[2]`subgroup;
> N2 := ns[3]`subgroup;
> c1 := Complements(G,N1);
> c1;
[
    GrpPC of order 6 = 2 * 3
    PC-Relations:
        $.1^2 = Id($),
        $.2^3 = Id($),
        $.2^$.1 = $.2^2
]
> c2 := Complements(G,N2);
> c2;
[
    GrpPC of order 6 = 2 * 3
    PC-Relations:
        $.1^2 = Id($),
        $.2^3 = Id($)
]
> Index(G,Normalizer(G,c1[1]));
1
> Index(G,Normalizer(G,c2[1]));
3
```

We can look at the full list of classes of subgroups of $G$ to see that there are three classes of non-normal subgroups as well as the normal subgroups. There are two non-normal subgroups of order 3 in addition to $N1$ and $N2$.

```magma
> Subgroups(G);
Conjugacy classes of subgroups
------------------------------

[ 1]    Order 1            Length 1
        GrpPC of order 1
        PC-Relations:
[ 2]    Order 2            Length 3
        GrpPC of order 2
        PC-Relations:
            $.1^2 = Id($)
[ 3]    Order 3            Length 1
        GrpPC of order 3
        PC-Relations:
            $.1^3 = Id($)
[ 4]    Order 3            Length 1
        GrpPC of order 3
        PC-Relations:
            $.1^3 = Id($)
[ 5]    Order 3            Length 2
        GrpPC of order 3
        PC-Relations:
            $.1^3 = Id($)
[ 6]    Order 6            Length 1
        GrpPC of order 6 = 2 * 3
        PC-Relations:
            $.1^2 = Id($),
            $.2^3 = Id($),
            $.2^$.1 = $.2^2
[ 7]    Order 6            Length 3
        GrpPC of order 6 = 2 * 3
        PC-Relations:
            $.1^2 = Id($),
            $.2^3 = Id($)
[ 8]    Order 9            Length 1
        GrpPC of order 9 = 3^2
        PC-Relations:
            $.1^3 = Id($),
            $.2^3 = Id($)
[ 9]    Order 18           Length 1
        GrpPC of order 18 = 2 * 3^2
        PC-Relations:
            $.1^2 = Id($),
            $.2^3 = Id($),
            $.3^3 = Id($),
            $.3^$.1 = $.3^2
```

### Quotient Groups

#### Construction of Quotient Groups

One of the strengths of representing groups with polycyclic or power-conjugate presentations is that arbitrary quotient groups can be computed. Given (generators for) a normal subgroup of a pc-group, Magma will compute a pc-presentation for the quotient and the corresponding canonical homomorphism.

The `pQuotient` function, which can be used to find a prime-power quotient of a finitely-presented group, can also be used to compute quotients of pc-groups.

<a id="constructor-constructor-quo-grppc-list-grppc-map"></a>
##### `quo<G | L>: GrpPC, List -> GrpPC, Map`

Construct the quotient $Q$ of the pc-group $G$ by the normal subgroup $N$, where $N$ is the smallest normal subgroup of $G$ containing the elements specified by the terms of the *generator list* $L$.

The possible forms of a term $L[i]$ of the generator list are the same as for the `sub`-constructor.

The quotient group $Q$ and the corresponding natural homomorphism $f : G \rightarrow Q$ are returned.

<a id="operation-op-div-grppc-grppc"></a>
##### `G / N: GrpPC, GrpPC -> GrpPC`

Given a normal subgroup $N$ of the pc-group $G$, construct the quotient of $G$ by $N$.

<a id="example-ex-934992"></a>
##### `Example: Quotient Groups of a Pc-Group (ex-934992)`

We will compute $O_{3',3}(G)$, where $G$ is a pc-representation of the symmetric group $S_4$. The subgroup is defined by $O_{3',3}(G)/O_{3'}(G) = O_3(G/O_{3'}(G))$.

```magma
> G := PCGroup(Sym(4));
> N := pCore(G,-3);
> Q,f := quo<G|N>;
> Q;
GrpPC : Q of order 6 = 2 * 3
PC-Relations:
    Q.1^2 = Id(Q),
    Q.2^3 = Id(Q),
    Q.2^Q.1 = Q.2^2
> S := pCore(Q,3);
> H := S @@ f;
> H;
GrpPC : H of order 12 = 2^2 * 3
PC-Relations:
    H.1^3 = Id(H),
    H.2^2 = Id(H),
    H.3^2 = Id(H),
    H.2^H.1 = H.2 * H.3,
    H.3^H.1 = H.2
```

#### Abelian and $p$-Quotients

A number of standard quotients may be constructed.

<a id="function-abelianquotient-grppc"></a>
##### `AbelianQuotient(G): GrpPC -> GrpAb, Map`

The maximal abelian quotient $G/G^\prime$ of the group $G$ as [`GrpAb`](https://docs.magma-maths.org/FinitelyPresentedGroups/AbelianGroups/index-abelian-groups.md#chapgrpab) (cf. Chapter [Abelian Groups](https://docs.magma-maths.org/FinitelyPresentedGroups/AbelianGroups/index-abelian-groups.md#chapgrpab)). The natural epimorphism $\pi:G\ar G/G^\prime$ is returned as second value.

<a id="function-abelianquotientinvariants-grppc"></a>
##### `AbelianQuotientInvariants(G): GrpPC -> SeqEnum`

<a id="function-aqinvariants-grppc"></a>
##### `AQInvariants(G): GrpPC -> SeqEnum`

A sequence of integers giving the abelian invariants of the maximal abelian quotient of $G$.

<a id="function-elementaryabelianquotient-grppc-rngintelt"></a>
##### `ElementaryAbelianQuotient(G, p): GrpPC, RngIntElt -> GrpAb, Map`

The maximal $p$-elementary abelian quotient $Q$ of the group $G$ as [`GrpAb`](https://docs.magma-maths.org/FinitelyPresentedGroups/AbelianGroups/index-abelian-groups.md#chapgrpab) (cf. Chapter [Abelian Groups](https://docs.magma-maths.org/FinitelyPresentedGroups/AbelianGroups/index-abelian-groups.md#chapgrpab)). The natural epimorphism $\pi:G\ar Q$ is returned as second value.

<a id="function-pquotient-grppc-rngintelt-rngintelt"></a>
##### `pQuotient(G, p, c : parameters): GrpPC, RngIntElt, RngIntElt -> GrpPC, Map`

```magma
Workspace : RngIntElt                    Default: 5000000
Metabelian: BoolElt                      Default: false
Exponent  : RngIntElt                    Default: 0
Print     : RngIntElt                    Default: 0
```

Given a pc-group $G$, a prime $p$, and a positive integer $c$, this function constructs a consistent power-conjugate presentation for the largest $p$-quotient $P$ of $G$ having lower exponent-$p$ class at most $c$. If $c$ is given as zero, then the limit 127 is placed on the class. The prime $p$ must be less than $65536$.

The function also returns the natural homomorphism $\pi$ from $G$ to $P$, a sequence $S$ describing the definitions of the pc-generators of $P$ and a flag indicating whether $P$ is the maximal $p$-quotient of $G$.

The $k$-th element of $S$ is a sequence of two integers, describing the definition of the $k$-th pc-generator $P.k$ of $P$ as follows.

- If $S[k] = [0,r]$, then $P.k$ is defined via the image of $G.r$ under $\pi$.
- If $S[k] = [r,0]$, then $P.k$ is defined via the power relation for $P.r$.
- If $S[k] = [r,s]$, then $P.k$ is defined via the conjugate relation involving $P.r^{P.s}$.

### Normal Subgroups and Subgroup Series

#### Characteristic Subgroups

<a id="function-centre-grppc"></a>
##### `Centre(G): GrpPC -> GrpPC`

<a id="function-center-grppc"></a>
##### `Center(G): GrpPC -> GrpPC`

The centre of the group $G$.

<a id="function-commutatorsubgroup-grppc"></a>
##### `CommutatorSubgroup(G): GrpPC -> GrpPC`

<a id="function-derivedsubgroup-grppc"></a>
##### `DerivedSubgroup(G): GrpPC -> GrpPC`

<a id="function-derivedgroup-grppc"></a>
##### `DerivedGroup(G): GrpPC -> GrpPC`

The derived subgroup of the group $G$.

<a id="function-fittingsubgroup-grppc"></a>
##### `FittingSubgroup(G): GrpPC -> GrpPC`

<a id="function-fittinggroup-grppc"></a>
##### `FittingGroup(G): GrpPC -> GrpPC`

The Fitting subgroup of the group $G$.

<a id="function-frattinisubgroup-grppc"></a>
##### `FrattiniSubgroup(G): GrpPC -> GrpPC`

The Frattini subgroup of the group $G$.

<a id="function-prefrattinisubgroup-grppc"></a>
##### `PrefrattiniSubgroup(G): GrpPC -> GrpPC`

A prefrattini subgroup of the group $G$.

<a id="function-frattiniquotientrank-grppc"></a>
##### `FrattiniQuotientRank(G): GrpPC -> GrpPC`

The rank of the Frattini quotient of the $p$-group $G$.

<a id="function-hypercentre-grppc"></a>
##### `Hypercentre(G): GrpPC -> GrpPC`

<a id="function-hypercenter-grppc"></a>
##### `Hypercenter(G): GrpPC -> GrpPC`

The hypercentre of the group $G$, i.e. the stationary term in the upper central series for $G$.

<a id="function-minimalnormalsubgroups-grppc"></a>
##### `MinimalNormalSubgroups(G): GrpPC -> [GrpPC]`

A sequence containing all minimal normal subgroups of $G$.

<a id="function-pcore-grppc-rngintelt-3"></a>
##### `pCore(G, S): GrpPC, { RngIntElt} -> GrpPC`

<a id="function-pcore-grppc-rngintelt-4"></a>
##### `pCore(G, S): GrpPC, RngIntElt -> GrpPC`

The maximal normal $\pi$-subgroup of $G$, $O_{\pi}(G)$, where $\pi$ is defined by $S$. The argument $S$ may be a set of primes, a single prime, or the negation of a single prime. If $S = -p$, then $O_{p'}(G)$ is returned.

<a id="function-socle-grppc"></a>
##### `Socle(G): GrpPC -> GrpPC`

The socle of $G$.

#### Subgroup Series

<a id="function-primaryabelianbasis-grppc"></a>
##### `PrimaryAbelianBasis(G): GrpPC -> [ GrpPCElt ], [ RngIntElt ]`

<a id="function-abelianbasis-grppc"></a>
##### `AbelianBasis(G): GrpPC -> [ GrpPCElt ], [ RngIntElt ]`

Given an abelian group $G$, return sequences $B$ and $I$ such that ${\rm order}(B[i]) = I[i]$ and $\langle B\rangle = G$ and the terms of $I$ give the types of each $p$-primary component of $G$. The non-primary form uses the Smith form invariants, i.e. each element of the sequence divides the next.

<a id="function-primaryabelianinvariants-grppc"></a>
##### `PrimaryAbelianInvariants(G): GrpPC -> [RngIntElt]`

<a id="function-abelianinvariants-grppc"></a>
##### `AbelianInvariants(G): GrpPC -> [RngIntElt]`

Given an abelian group $G$, return a sequence $Q$ containing the types of each $p$-primary component of $G$. The non-primary form gives the Smith form invariants, i.e. each element of the sequence divides the next.

<a id="function-chiefseries-grppc"></a>
##### `ChiefSeries(G): GrpPC -> [GrpPC]`

A chief series for the group $G$. The series is returned as a sequence of subgroups of $G$.

<a id="function-compositionseries-grppc"></a>
##### `CompositionSeries(G): GrpPC -> [GrpPC]`

A composition series for the group $G$. The series is returned as a sequence of subgroups of $G$. The $i$-th term of the composition series has a presentation given by the generators `G.i` through `G.NPCgens(G)` and relations involving those generators only.

<a id="function-compositionfactors-grppc"></a>
##### `CompositionFactors(G): GrpPC -> SeqEnum`

A sequence of integer tuples that describe the composition factors, ordered according to some composition series for the group $G$. Since each factor will be a cyclic group of prime order, the tuples will each be of the form $<19,0,q>$ representing the cyclic group of order $q$. The sequence has a custom print routine.

<a id="function-compositionseries-grppc-rngintelt"></a>
##### `CompositionSeries(G, i): GrpPC, RngIntElt -> [GrpPC]`

The $i+1$-th entry of the composition series for the group $G$. Its presentation is given by the generators `G.(i+1)` through `G.m`, where $m$ is the number of pc-generators of $G$ and relations involving these generators only.

<a id="function-derivedseries-grppc"></a>
##### `DerivedSeries(G): GrpPC -> [GrpPC]`

The derived series of the group $G$. The series is returned as a sequence of subgroups.

<a id="function-derivedlength-grppc"></a>
##### `DerivedLength(G): GrpPC -> RngIntElt`

The derived length of the group $G$.

<a id="function-elementaryabelianseries-grppc"></a>
##### `ElementaryAbelianSeries(G): GrpPC -> [GrpPC]`

An elementary abelian series is a chain of normal subgroups with the property that the quotient of each pair of successive terms in the series is elementary abelian. The elementary abelian series for the group $G$ is returned as a sequence of subgroups.

<a id="function-elementaryabelianseriescanonical-grppc"></a>
##### `ElementaryAbelianSeriesCanonical(G): GrpPC -> [GrpPC]`

Gives a similar result to using `ElementaryAbelianSeries`, except the series returned depends only on the isomorphism type of the group, and consists of characteristic subgroups. This function may be slower than `ElementaryAbelianSeries`.

<a id="function-lowercentralseries-grppc"></a>
##### `LowerCentralSeries(G): GrpPC -> [GrpPC]`

The lower central series for the group $G$. The series is returned as a sequence of subgroups.

<a id="function-nilpotencyclass-grppc"></a>
##### `NilpotencyClass(G): GrpPC -> RngIntElt`

If $G$ is nilpotent, return the nilpotence class of $G$. Otherwise, -1 is returned.

<a id="function-pcentralseries-grppc-rngintelt"></a>
##### `pCentralSeries(G, p): GrpPC, RngIntElt -> [GrpPC]`

The $p$-central series for $G$, where $p$ is a prime dividing $|G|$. The series is returned as a sequence of subgroups. The $p$-central series $P_1 \triangleright P_2  \triangleright \cdots \triangleright  P_i$ of a soluble group $G$ is defined inductively as follows:

**•**
$P_1 = G$,

**•**
$P_{i+1} = (G, P_i)P_i^p$, for $i > 0$.

<a id="function-subnormalseries-grppc-grppc"></a>
##### `SubnormalSeries(G, H): GrpPC, GrpPC -> [GrpPC]`

Given a group $G$ and a subgroup $H$ of $G$, return a sequence of subgroups commencing with $G$ and terminating with $H$, such that each subgroup is normal in the previous one. If $H$ is not subnormal in $G$, the empty sequence is returned.

<a id="function-uppercentralseries-grppc"></a>
##### `UpperCentralSeries(G): GrpPC -> [GrpPC]`

The upper central series of $G$. The series is returned as a sequence of subgroups.

<a id="example-ex-54e655"></a>
##### `Example: Elementary Abelian Series (ex-54e655)`

The elementary abelian series of the group $D_3 \wr D_5$ has terms of the following orders:

```magma
> H := DihedralGroup(GrpPerm, 5);
> G := WreathProduct(DihedralGroup(GrpPC, 3), DihedralGroup(GrpPC, 5),
>       [H.2, H.1]);
> EAS := ElementaryAbelianSeries(G);
> for i := 1 to #EAS do
>    print FactoredOrder(EAS[i]);
> end for;
    [ <2, 6>, <3, 5>, <5, 1> ]
    [ <2, 4>, <3, 5>, <5, 1> ]
    [ <2, 4>, <3, 5> ]
    [ <3, 5> ]
    []
```

Hence the elementary abelian factors can be seen to have sizes $2^2$, $5$, $2^4$, and $3^5$, reading from top to bottom.

#### Series for $p$-groups

The following functions are only defined for a pc-group which is a $p$-group.

<a id="function-agemo-grppc-rngintelt"></a>
##### `Agemo(G, i): GrpPC, RngIntElt -> GrpPC`

Given a $p$-group $G$, return the characteristic subgroup of $G$ generated by the elements $x^{p^i}$, $x \in G$, where $i$ is a positive integer.

<a id="function-omega-grppc-rngintelt"></a>
##### `Omega(G, i): GrpPC, RngIntElt -> GrpPC`

Given a $p$-group $G$, return the characteristic subgroup of $G$ generated by the elements of order dividing $p^i$, where $i$ is a positive integer.

<a id="function-jenningsseries-grppc"></a>
##### `JenningsSeries(G): GrpPC -> [GrpPC]`

Given a $p$-group $G$, return the Jennings series for $G$. The series is returned as a sequence of subgroups. The Jennings series $J_1 \triangleright J_2 \triangleright \cdots \triangleright J_i \cdots$ of a $p$-group $G$ is defined inductively as follows:

**•**
$J_1 = G$,

**•**
$J_{i+1} = <(J_i, G), J_k^p>$, with $k = \lceil (i+1)/p\rceil$, $i > 0$.

<a id="function-pclass-grppc"></a>
##### `pClass(G): GrpPC -> RngIntElt`

The lower exponent-$p$ class of the $p$-group $G$.

<a id="function-pranks-grppc"></a>
##### `pRanks(G): GrpPC -> [ RngIntElt ]`

A sequence whose $i$-th entry is the number of pc-generators for the lower exponent-$p$ class $i$ quotient of the $p$-group $G$.

#### Normal Subgroups and Complements

<a id="function-normalsubgroups-grppc"></a>
##### `NormalSubgroups(G): GrpPC -> SeqEnum`

The collection of all normal subgroups of $G$ returned as a sequence.

<a id="function-normallattice-grppc"></a>
##### `NormalLattice(G): GrpPC -> SubGrpLat`

The lattice of normal subgroups of $G$.

<a id="function-minimalnormalsubgroup-grppc"></a>
##### `MinimalNormalSubgroup(G): GrpPC -> GrpPC`

An elementary abelian minimal normal subgroup of the soluble group $G$.

<a id="function-minimalnormalsubgroup-grppc-2"></a>
##### `MinimalNormalSubgroup(G, N): GrpPC -> GrpPC`

Given a non-trivial, normal subgroup $N$ of $G$, return an elementary abelian minimal normal subgroup of $G$ contained in $N$.

<a id="function-complements-grppc-grppc"></a>
##### `Complements(G, N): GrpPC, GrpPC -> SeqEnum`

Given a normal subgroup $N$ of $G$, return conjugacy class representatives of all complements of $N$ in $G$. This function implements the first cohomology computation described in [[CNW90](https://docs.magma-maths.org/references.md#cite-cnw-compls)].

<a id="function-normalcomplements-grppc-grppc"></a>
##### `NormalComplements(G, N): GrpPC, GrpPC -> SeqEnum`

Given a normal subgroup $N$ of $G$, return all normal complements of $N$ in $G$. This function implements the first cohomology computation described in [[CNW90](https://docs.magma-maths.org/references.md#cite-cnw-compls)].

<a id="function-normalcomplements-grppc-grppc-grppc"></a>
##### `NormalComplements(G, H, N): GrpPC, GrpPC, GrpPC -> SeqEnum`

Given a normal subgroup $N$ of $G$, and a normal subgroup $H$ of $G$ containing $N$, return all complements of $N$ in $H$ which are normal in $G$. This function implements the first cohomology computation described in [[CNW90](https://docs.magma-maths.org/references.md#cite-cnw-compls)].

<a id="example-ex-12efb9"></a>
##### `Example: Normal Complements (ex-12efb9)`

We define the direct product of an extraspecial group of order $3^3$ and $D_3$ and let $N$ be the first factor of this product. Inside the Sylow 3-subgroup, we see that $N$ has 11 classes of complements, three of which are normal.

```magma
> A := ExtraSpecialGroup(GrpPC,3,1);
> B := DihedralGroup(GrpPC,3);
> G,f,p := DirectProduct(A,B);
> N := f[1](A);
> S3 := Sylow(G,3);
> cS := Complements(S3,N);
> [Index(S3,Normalizer(S3,t)):t in cS];
[ 1, 1, 1, 3, 3, 3, 3, 3, 3, 3, 3 ]
```

We can compute only the normal complements by using `NormalComplements`.

```magma
> ncS := NormalComplements(S3,N);
> #ncS;
3
```

We can check that precisely one of these three complements is actually normal in $G$.

```magma
> [IsNormal(G,t):t in ncS];
[ true, false, false ]
```

Since $N$ has a $G$-normal complement in $S3$, we must have $S3$ normal in $G$. We can verify this. Using the three-parameter version of `NormalComplements` we can directly compute the $G$-normal complements of $N$ in $S3$.

```magma
> IsNormal(G,S3);
true
> ncG := NormalComplements(G,S3,N);
> #ncG;
1
> #NormalComplements(G,N);
1
```

### Cosets

#### Coset Tables and Transversals

<a id="function-transversal-grppc-grppc"></a>
##### `Transversal(G, H): GrpPC, GrpPC -> {@ GrpPCElt @}, Map`

<a id="function-righttransversal-grppc-grppc"></a>
##### `RightTransversal(G, H): GrpPC, GrpPC -> {@ GrpPCElt @}, Map`

Given a group $G$ and a subgroup $H$ of $G$, this function returns

**(a)**
An indexed set of elements $T$ of $G$ forming a right transversal for $G$ over $H$; and

**(b)**
The corresponding transversal mapping $\phi: G \rightarrow T$. If $T = [t_1, \ldots, t_r]$ and $g$ in $G$, $\phi$ is defined by $\phi(g) = t_i$, where $g\in H*t_i$.

<a id="function-cosettable-grppc-grppc"></a>
##### `CosetTable(G, H): GrpPC, GrpPC -> Map`

Given a group $G$ and a subgroup $H$ of $G$ of index $r$, return a mapping $M:\langle\{1..r\},G\rangle\rightarrow\{1..r\}$ describing the action of $G$ on the (right) cosets of $H$.

<a id="function-transversal-grppc-grppc-grppc"></a>
##### `Transversal(G, H, K): GrpPC, GrpPC, GrpPC -> {@ GrpPCElt @}, Map`

An indexed set of representatives for the double cosets $HuK$ in $G$, and the corresponding transversal mapping. The algorithm used is described in [[Sla01](https://docs.magma-maths.org/references.md#cite-slat-cosets)].

<a id="function-shortcosets-grppcelt-grppc-grppc"></a>
##### `ShortCosets(p, H, G): GrpPCElt, GrpPC, GrpPC -> [GrpPCElt]`

Computes a set of representatives for the transversal of $G$ modulo $H$ of all cosets that contain $p$. This computation does not do a full transversal of $G$ modulo $H$ and may therefore be used even if the index of $(G:H)$ is very large.

#### Action on a Coset Space

<a id="function-cosetaction-grp-grp"></a>
##### `CosetAction(G, H): Grp, Grp -> Hom(Grp), GrpPerm, GrpPC`

Given a subgroup $H$ of the group $G$, construct the permutation representation of $G$ given by the action of $G$ on the set of (right) cosets of $H$ in $G$. The function returns:

**(a)**
The natural homomorphism $f: G \rightarrow  L$;

**(b)**
The induced group $L$;

**(c)**
The kernel $K$ of the action (a subgroup of $G$).

<a id="function-cosetimage-grp-grp"></a>
##### `CosetImage(G, H): Grp, Grp -> GrpPerm`

Given a subgroup $H$ of the group $G$, construct the image $L$ of $G$ given by the action of $G$ on the set of (right) cosets of $H$ in $G$. $L$ is returned as a permutation group.

<a id="function-cosetkernel-grp-grp"></a>
##### `CosetKernel(G, H): Grp, Grp -> Grp`

Given a subgroup $H$ of the group $G$, construct the kernel of the action of $G$ on the set of (right) cosets of $H$ in $G$.

<a id="solgrp-auto"></a>
<a id="id1"></a>
### Automorphism Group

#### General Soluble Group

In the case of a soluble non-$p$-group there are two algorithms available. By default, a lifting-based algorithm developed by M. Smith [[Smi94](https://docs.magma-maths.org/references.md#cite-smith-thesis)] and extended by Smith and Slattery to use second cohomology is used. Alternatively, there is also an algorithm developed by D. Howden [[How12](https://docs.magma-maths.org/references.md#cite-howden-thesis)], which uses the automorphism group of a Sylow $p$-subgroup of $G$ to construct the automorphism group of $G$.

##### Lifting Algorithm

The automorphism group is computed step-by-step considering a series of factors of $G$ by terms of a characteristic series

$$
G = G_1 > G_2 > \cdots > G_k > 1
$$

such that $G_i/G_{i+1}$ is elementary abelian for each $i$. We compute the automorphism group ${\operatorname{Aut}}(G/G_2)\cong{\operatorname{GL}}(d,p)$ for some integer $d$ and prime $p$, and then lift through each of the elementary abelian layers $G/G_3,\dots, G/G_{k-1}$, finally arriving at ${\operatorname{Aut}}(G/G_k) = {\operatorname{Aut}}(G)$. A group of type `GrpAuto` is returned. Details of the computation can be seen by setting the verbose flag `AutomorphismGroup` to `true`, and the characteristic series is available as the attribute `CharacteristicSeries` on the returned group. In addition to the usual properties of `GrpAuto` (such as `Order`, `Ngens`, etc.), two special fields, `GenWeights` and `WeightSubgroupOrders`, are provided for automorphism groups of (non $p$-group) pc-groups. These each relate to weight subgroups of the automorphism group. Let $i$ be the largest subscript such that the automorphism acts trivially on $G/G_i$. Then the automorphism is said to have weight $2i+1$ if it acts non-trivially on $G_i/G_{i+1}$, and weight $2i+2$ if it acts trivially on $G_i/G_{i+1}$. Note that there are no automorphisms of weight 2. The automorphisms of weight greater than or equal to a given value form a normal subgroup of $A$.

<a id="function-automorphismgroup-grppc"></a>
###### `AutomorphismGroup(G): GrpPC -> GrpAuto`

Given a soluble group $G$ presented by a pc-presentation, this function returns the automorphism group of $G$ as a group of type `GrpAuto`.

<a id="function-hasattribute-grpauto-monstgelt-genweights"></a>
###### `HasAttribute(A, "GenWeights"): GrpAuto, MonStgElt -> BoolElt, [ RngIntElt ]`

If the attribute `GenWeights` is defined for $A$ then the function returns `true`, and a sequence of integers. This integer sequence indicates where each generator lies in the normal series of $A$ corresponding to the action of the group on $G$ (as described at the beginning of the section). If the attribute is not set then the sequence is unassigned. The function call `AutomorphismGroup(G)`, where $G$ has type `GrpPC`, always returns an automorphism group with this attribute set. In this case the sequence may also be obtained by the short form ``A`GenWeights``.

<a id="function-hasattribute-grpauto-monstgelt-weightsubgrouporders"></a>
###### `HasAttribute(A, "WeightSubgroupOrders"): GrpAuto, MonStgElt -> BoolElt, [ RngIntElt ]`

If the attribute `WeightSubgroupOrders` is defined for $A$ then the function returns `true`, and a sequence of integers. This sequence of integers gives the orders for the normal series of weight subgroups described at the beginning of the section. If the attribute is not set then the sequence is unassigned. The function call `AutomorphismGroup(G)`, where $G$ has type `GrpPC`, always returns an automorphism group with this attribute set. In this case the sequence may also be obtained by the short form ``A`WeightSubgroupOrders``.

<a id="example-ex-29a2d6"></a>
###### `Example: Automorphism Group via Lifting (ex-29a2d6)`

An example using `AutomorphismGroup` and some related features. We build a group based on the structure of a finite field (multiplicative group acting on the additive group) and then compute its automorphism group. First, we set up the field.

```magma
> E := GF(2);
> F := GF(8);
> V,phi := VectorSpace(F,E);
> d := Dimension(V);
> x := PrimitiveElement(F);
```

Then, define a pc-group to act and define the action based on the multiplication in the field. Compute the matrix by mapping the vectors back to the field, multiplying by x, and then recording the result.

```magma
> C := CyclicGroup(GrpPC,Order(x));
> MR := MatrixRing(E, d);
> s := [];
> for i := 1 to d do
>  y := ((V.i)@@phi)*x;
>  s cat:= Eltseq(y);
> end for;
```

Turn the sequence of image components into a matrix and use the matrix to create a C-module. Then use that module to create the split extension.

```magma
> t := MR!s;
> M := GModule(C,[t]);
> G := Extension(M,C);
> G;
GrpPC : G of order 56 = 2^3 * 7
PC-Relations:
    G.1^7 = Id(G),
    G.2^2 = Id(G),
    G.3^2 = Id(G),
    G.4^2 = Id(G),
    G.2^G.1 = G.3,
    G.3^G.1 = G.4,
    G.4^G.1 = G.2 * G.3
```

Then we can compute the automorphism group of $G$.

```magma
> A := AutomorphismGroup(G: Algorithm := "Default");
> A;
A group of automorphisms of GrpPC : G
Generators:
    Automorphism of GrpPC : G which maps:
        G.1 |--> G.1^2
        G.2 |--> G.3 * G.4
        G.3 |--> G.2 * G.4
        G.4 |--> G.3
    Automorphism of GrpPC : G which maps:
        G.1 |--> G.1
        G.2 |--> G.2 * G.3
        G.3 |--> G.3 * G.4
        G.4 |--> G.2 * G.3 * G.4
    Automorphism of GrpPC : G which maps:
        G.1 |--> G.1 * G.2 * G.3
        G.2 |--> G.2
        G.3 |--> G.3
        G.4 |--> G.4
    Automorphism of GrpPC : G which maps:
        G.1 |--> G.1 * G.3 * G.4
        G.2 |--> G.2
        G.3 |--> G.3
        G.4 |--> G.4
    Automorphism of GrpPC : G which maps:
        G.1 |--> G.1 * G.4
        G.2 |--> G.2
        G.3 |--> G.3
        G.4 |--> G.4
> [Order(x):x in Generators(A)];
[ 3, 2, 7, 2, 2 ]
```

Next, we can use the automorphisms to create an extension of $G$.

```magma
> b := A.1;
> Order(b);
3
> tau := hom<G->G|[b(G.i):i in [1..NPCgens(G)]]>;
> D := CyclicGroup(GrpPC,Order(b));
> K := Extension(G,D,[tau]);
> K;
GrpPC : K of order 168 = 2^3 * 3 * 7
PC-Relations:
    K.1^3 = Id(K),
    K.2^7 = Id(K),
    K.3^2 = Id(K),
    K.4^2 = Id(K),
    K.5^2 = Id(K),
    K.2^K.1 = K.2^2,
    K.3^K.1 = K.4 * K.5,
    K.3^K.2 = K.4,
    K.4^K.1 = K.3 * K.5,
    K.4^K.2 = K.5,
    K.5^K.1 = K.4,
    K.5^K.2 = K.3 * K.4
> #Classes(K);
8
```

Finally, we examine information about the weight subgroups. We list only the orders of the terms of the characteristic series in $G$ in order to save space.

```magma
> [Order(H): H in A`CharacteristicSeries];
[ 56, 8, 1 ]
> A`GenWeights;
[ 1, 3, 4, 4, 4 ]
> A`WeightSubgroupOrders;
[ 168, 56, 56, 8 ]
```

##### Lifting from the Automorphism Group of a Sylow $p$-subgroup

The algorithm developed by D. Howden [[How12](https://docs.magma-maths.org/references.md#cite-howden-thesis)] follows a different strategy to the Smith-Slattery lifting approach. Given a soluble group $G$, the algorithm determines a suitable Sylow $p$-subgroup $P$ of $G$, and uses the automorphism group of $P$ (using the algorithm for $p$-groups detailed below) to construct the automorphism group of $G$. In cases where the automorphism group is soluble, the algorithm automatically constructs a pc-representation for it. Solubility of the returned group can then be tested via the `IsSoluble` intrinsic. The pc-representation obtained using the `PCGroup` intrinsic, and pc-generators (as automorphism maps) via the `PCGenerators` intrinsic. In some cases where the automorphism group is not soluble, the algorithm will construct a permutation representation during its construction. A group of type `GrpAuto` is returned. Details of the computation can be seen by setting the verbose flag `AutomorphismGroupSolubleGroup` to 1. A variation of this algorithm can be used for isomorphism testing.

<a id="function-automorphismgroupsolublegroup-grppc"></a>
###### `AutomorphismGroupSolubleGroup(G: parameters): GrpPC -> GrpAuto`

```magma
p: [RngIntElt]                    Default: 1
```

Given a soluble group $G$ presented by a pc-presentation, this function returns the automorphism group of $G$ as a group of type GrpAuto.

A prime $p$ dividing the order of $G$. The automorphism group of the Sylow $p$-subgroup is then used to construct the automorphism group of $G$. If the $p$-core of $G$ is trivial then an error is given. The default value of $p = 1$ indicates that the algorithm should take $p$ to be the prime giving the largest Sylow $p$-subgroup of $G$.

<a id="function-isisomorphicsolublegroup-grppc-grppc"></a>
###### `IsIsomorphicSolubleGroup(G, H: parameters): GrpPC, GrpPC -> BoolElt, Map`

```magma
p: [RngIntElt]                    Default: 1
```

Returns `true` if the soluble groups $G$, $H$ presented by pc-presentations, are isomorphic, and `false` otherwise. Where the groups are isomorphic, a mapping $G\to H$ is also returned.

A prime $p$ dividing the order of $G$ (assuming that the orders of $G$ and $H$ are the same). The algorithm then tests Sylow $p$-subgroups of $G$ and $H$ for isomorphism and attempts to extend these isomorphisms to an isomorphism $G\to H$. If the $p$-cores of $G$ and $H$ are trivial then an error is given. The default value of $p = 1$ indicates that the algorithm should take $p$ to be the prime giving the largest Sylow $p$-subgroup of $G$.

<a id="example-ex-249c9b"></a>
###### `Example: Automorphisms of a Soluble Group (ex-249c9b)`

An example using `AutomorphismGroupSolubleGroup` and some related features. We use a group from the `solgps` library.

```magma
> load solgps;
> G := G10();
> FactoredOrder(G);
[ <2, 18>, <7, 4> ]
> time A := AutomorphismGroupSolubleGroup(G);
Time: 18.220
> time R_A, phi_A := PCGroup(A);
Time: 0.000
> FactoredOrder(R_A);
[ <2, 20>, <3, 2>, <7, 6> ]
```

<a id="auto-p-group"></a>
<a id="pgrp-auto"></a>
#### $p$-group

For a description of the algorithm used to construct the automorphism group of a $p$-group, see [[ELGO02](https://docs.magma-maths.org/references.md#cite-elo-auts)].

While it is difficult to state very firm guidelines for the performance of the algorithm, our experience suggests that it has most difficulty in constructing automorphism groups of $p$-groups of “large” Frattini rank (say rank larger than about 6) and $p$-class 2. If the group has larger $p$-class, then it usually has more characteristic structure and the algorithm exploits this. The *order* of a group is *not* a useful guide to the difficulty of the computation.

`SetVerbose ("AutomorphismGroup", 1)` provides information on the progress of the algorithm.

<a id="function-automorphismgroup-grppc-2"></a>
##### `AutomorphismGroup(G: parameters): GrpPC -> GrpAuto`

```magma
CharacteristicSubgroups: [GrpPC]                    Default: []
```

The group $G$ is a $p$-group described by a pc-presentation. The function returns the automorphism group of $G$ as a group of type `GrpAuto`.

A list of known characteristic subgroups of $G$; these may improve the efficiency of the construction. Note that the algorithm simply accepts that the supplied subgroups are fixed under the action of the automorphism group; it does *not* verify that they are in fact characteristic.

<a id="example-ex-f1bbe5"></a>
##### `Example: Automorphism Group of a p-Group (ex-f1bbe5)`

```magma
> G := SmallGroup (64, 78);
> A := AutomorphismGroup (G);
> #A;
1024
> A.1;
    Automorphism of GrpPC : G which maps:
        G.1 |--> G.1
        G.2 |--> G.2
        G.3 |--> G.1 * G.3
        G.4 |--> G.4
        G.5 |--> G.5
        G.6 |--> G.4 * G.6
> Order (A.1);
4
> a := A.1^2; [a (G.i): i in [1..6]];
[ G.1, G.2, G.3 * G.5, G.4, G.5, G.6 ]
```

<a id="function-orderautomorphismgroupabelianpgroup-seqenum"></a>
##### `OrderAutomorphismGroupAbelianPGroup(A): SeqEnum -> RngIntElt`

Order of automorphism group of abelian $p$-group $G$ where $A = [a_1, a_2,  \ldots]$ and $G = C_{a_1} \times C_{a_2} \times  \ldots$.

<a id="example-ex-c99f0c"></a>
##### `Example: Subgroups of an Abelian p-Group (ex-c99f0c)`

Subgroups of $C_4 \times C_8 \times C_{64}$.

```magma
> NumberOfSubgroupsAbelianPGroup ([4, 8, 64]);
[ 7, 35, 91, 139, 171, 171, 139, 91, 35, 7, 1 ]
```

Hence, for example, there are 7 subgroups of order 2 and 139 subgroups of order $2^4$.

```magma
> OrderAutomorphismGroupAbelianPGroup ([4, 8, 64]);
4194304
```

#### Isomorphism and Standard Presentations

The `pQuotient` command returns a power-conjugate presentation for a given $p$-group but this presentation depends on the user-supplied description of the group. The Standard Presentation algorithm computes a “canonical” presentation for the $p$-group, which is independent of the user-supplied description. For a description of this algorithm, see [[OBr94](https://docs.magma-maths.org/references.md#cite-obrien-isom)]. The canonical or *standard* presentation of a given $p$-group is the power-conjugate presentation obtained when a description of the group is computed using the default implementation of the $p$-group generation algorithm. Hence, two groups in the same isomorphism class have identical standard presentations. Given two $p$-groups, if their standard presentations are identical, then the groups are isomorphic, otherwise they are not. Hence to decide whether two groups are isomorphic, we can first construct the standard presentation of each using the `StandardPresentation` function and then compare these presentations using the `IsIdenticalPresentation` function.

While it is difficult to state very firm guidelines for the performance of the algorithm, our experience suggests that the difficulty of deciding isomorphism between $p$-groups is governed by their Frattini rank and is most practical for $p$-groups of rank at most 5. The *order* of a group is *not* a useful guide to the difficulty of the computation.

`SetVerbose ("Standard", 1)` will provide information on the progress of the algorithm.

<a id="function-standardpresentation-grppc"></a>
##### `StandardPresentation(G): GrpPC -> GrpPC, Map`

<a id="function-standardpresentation-grppc-2"></a>
##### `StandardPresentation(G: parameters): GrpPC -> GrpAuto`

```magma
StartClass: RngIntElt                    Default: 1
```

The group $G$ is a $p$-group presented by an arbitrary pc-presentation. The group $H$ defined by its standard presentation is returned together with a map from $G$ to $H$.

If `StartClass` is $k$, then use `pQuotient` to construct the class $k - 1$ $p$-quotient of $G$ and standardize the presentation only from class $k$ onwards.

<a id="function-isidenticalpresentation-grppc-grppc"></a>
##### `IsIdenticalPresentation(G, H): GrpPC, GrpPC -> BoolElt`

Returns `true` if $G$ and $H$ have identical presentations, `false` otherwise.

<a id="function-isisomorphic-grppc-grppc"></a>
##### `IsIsomorphic(G, H): GrpPC, GrpPC -> BoolElt, Map, GrpPC`

The function returns `true` if the $p$-groups $G$ and $H$ are isomorphic, `false` otherwise. It constructs their standard presentations class by class, and checks for equality. If they are isomorphic, it also returns an isomorphism from $G$ to $H$ and the isomorphism class representative.

<a id="example-ex-75ee54"></a>
##### `Example: Isomorphism of p-Quotients (ex-75ee54)`

In the next two examples, we investigate whether particular $p$-quotients of fp-groups are isomorphic.

```magma
> F<x, y, t> := FreeGroup(3);
> G := quo< F | x*y^2*x^-1=y^-2, y*x^2*y^-1=x^-2, x^2=t^2, y^2=(t^-1*x)^2,
>                      t*(x*y)^2=(x*y)^2*t >;
> Q1 := pQuotient(G, 2, 3: Print := 1);
Lower exponent-2 central series for G
Group: G to lower exponent-2 central class 1 has order 2^3
Group: G to lower exponent-2 central class 2 has order 2^7
Group: G to lower exponent-2 central class 3 has order 2^11
> H := quo< F | x*y^2*x^-1=y^-2, y*x^2*y^-1=x^-2, x^2=t^2*(x*y)^2,
>                      y^2=(t^-1*x)^2, t*(x*y)^2=(x*y)^2*t >;
> Q2 := pQuotient(H, 2, 3: Print := 1);
Lower exponent-2 central series for H
Group: H to lower exponent-2 central class 1 has order 2^3
Group: H to lower exponent-2 central class 2 has order 2^7
Group: H to lower exponent-2 central class 3 has order 2^11
```

Now check whether the class 3 2-quotients are isomorphic.

```magma
> IsIsomorphic(Q1, Q2);
false
```

In the next example, we construct an explicit isomorphism between two 5-groups.

```magma
> F<a, b> := Group<a, b | a^5, b^5, (a * b * a)^5 = (b, a, b) >;
> G := pQuotient (F, 5, 6 : Print := 1);
Lower exponent-5 central series for F
Group: F to lower exponent-5 central class 1 has order 5^2
Group: F to lower exponent-5 central class 2 has order 5^3
Group: F to lower exponent-5 central class 3 has order 5^4
Group: F to lower exponent-5 central class 4 has order 5^5
Group: F to lower exponent-5 central class 5 has order 5^7
Group: F to lower exponent-5 central class 6 has order 5^8
> G;
GrpPC : G of order 390625 = 5^8
PC-Relations:
G.2^G.1 = G.2 * G.3,
G.3^G.1 = G.3 * G.4,
G.3^G.2 = G.3 * G.6 * G.7^4 * G.8^4,
G.4^G.1 = G.4 * G.5,
G.4^G.2 = G.4 * G.7 * G.8,
G.4^G.3 = G.4 * G.7^4 * G.8,
G.5^G.1 = G.5 * G.6,
G.5^G.2 = G.5 * G.7,
G.5^G.3 = G.5 * G.8^2,
G.6^G.2 = G.6 * G.8,
G.7^G.1 = G.7 * G.8^3
> K<a, b> := Group<a, b | a^5, b^5, (b * a * b)^5 = (b, a, b) >;
> H := pQuotient (K, 5, 6 : Print := 1);
Lower exponent-5 central series for K
Group: K to lower exponent-5 central class 1 has order 5^2
Group: K to lower exponent-5 central class 2 has order 5^3
Group: K to lower exponent-5 central class 3 has order 5^4
Group: K to lower exponent-5 central class 4 has order 5^5
Group: K to lower exponent-5 central class 5 has order 5^7
Group: K to lower exponent-5 central class 6 has order 5^8
> H;
GrpPC : H of order 390625 = 5^8
PC-Relations:
H.2^H.1 = H.2 * H.3,
H.3^H.1 = H.3 * H.4,
H.3^H.2 = H.3 * H.6^2 * H.7^2 * H.8^2,
H.4^H.1 = H.4 * H.5,
H.4^H.2 = H.4 * H.7,
H.4^H.3 = H.4 * H.7^4 * H.8,
H.5^H.1 = H.5 * H.6,
H.5^H.2 = H.5 * H.7,
H.5^H.3 = H.5 * H.8^2,
H.6^H.2 = H.6 * H.8,
H.7^H.1 = H.7 * H.8^3
> flag, phi := IsIsomorphic (G, H);
> flag;
true
> for g in PCGenerators (G) do print g, "--->", phi (g); end for;
G.1 ---> H.1
G.2 ---> H.2^3 * H.4^3 * H.5^3 * H.6^2 * H.7^4 * H.8^3
G.3 ---> H.3^3 * H.5^3 * H.6^4 * H.8^3
G.4 ---> H.4^3 * H.6^3 * H.7^2 * H.8^3
G.5 ---> H.5^3 * H.8
G.6 ---> H.6^3
G.7 ---> H.7^4
G.8 ---> H.8^4
```

The functions `IsIsomorphic` and `StandardPresentation` are expensive. Here we have a list of groups and we want to find any isomorphisms among the collection. Rather than repeatedly applying `IsIsomorphic`, we first construct and store standard presentations for each group in the sequence, and then quickly compare these using `IsIdenticalPresentation`.

```magma
> F<a, b> := FreeGroup (2);
> p := 7;
> Q := [];
> for k := 1 to p - 1 do
>       G := quo< F | a^p = (b, a, a), b^p = a^(k*p), (b, a, b)>;
>       H := pQuotient (G, p, 10);
>       Q[k] := StandardPresentation (H);
> end for;
```

Now run over the list of standard presentations and check for equality.

```magma
> for i in [2..p - 1] do
>    for j in [1.. i - 1] do
>       if IsIdenticalPresentation (Q[i], Q[j]) then
>          print "Standard Presentations  ", i, " and ", j, " are identical";
>       end if;
>    end for;
> end for;
Standard Presentations   2  and  1  are identical
Standard Presentations   4  and  1  are identical
Standard Presentations   4  and  2  are identical
Standard Presentations   5  and  3  are identical
Standard Presentations   6  and  3  are identical
Standard Presentations   6  and  5  are identical
```

### Generating $p$-groups

The $p$-central series of a group $G$ is the descending sequence of subgroups

$$
G= P_{0}(G) \geq \ldots \geq  P_{i-1}(G) \geq P_i(G) \geq \ldots \geq
$$

where $P_i(G)=[P_{i-1}(G),G]P_{i-1}(G)^p$ for $i\geq 1$.

If $P_c(G)=1$ and $c$ is the smallest such integer then $G$ has $p$*-class* $c$. A group with $p$-class $c$ is nilpotent and has nilpotency class at most $c$.

Let $G$ be a finite $p$-group with Frattini rank $d$ and class $c$. A group $H$ is a *descendant* of $G$ if $H$ has Frattini rank $d$ and the quotient $H/P_c(H)$ is isomorphic to $G$. A group is an *immediate descendant* of $G$ if it is a descendant of $G$ and has class $c+1$.

The $p$-group generation algorithm allows the construction of (immediate) descendants of a $p$-group. For a description of this algorithm, see [[New77](https://docs.magma-maths.org/references.md#cite-newman-pgrp-gen), [OBr90](https://docs.magma-maths.org/references.md#cite-obrien-pgroup)].

`SetVerbose ("GeneratepGroups", 1)` will provide information on the progress of the algorithm.

<a id="function-generatepgroups-rngintelt-rngintelt-rngintelt"></a>
#### `GeneratepGroups(p, d, c : parameters): RngIntElt, RngIntElt, RngIntElt -> [GrpPC], RngIntElt`

```magma
Exponent  : RngIntElt                      Default: 0
OrderBound: RngIntElt                      Default: 0
StepSizes : [RngIntElt]                    Default: []
All       : BoolElt                        Default: true
```

Generate all $d$-generator $p$-class at most $c$ $p$-groups.

All groups constructed satisfy the supplied exponent.

Given `OrderBound := n`, all groups constructed have order at most $p^n$.

Construct descendants of order $p^{(n + s)}$ of a group of order $p^n$ only for $s$ in `StepSizes`.

If `true`, return all groups. Otherwise, return only the capable groups (those which have descendants).

<a id="function-descendants-grppc"></a>
#### `Descendants(G : parameters): GrpPC -> [GrpPC], RngIntElt`

<a id="function-descendants-grppc-rngintelt"></a>
#### `Descendants(G, c : parameters): GrpPC, RngIntElt -> [GrpPC], RngIntElt`

Construct descendants of $G$ having $p$-class at most $c$; if $c$ is not supplied, it is assumed to be one larger than the $p$-class of $G$. This function supports the same variable arguments as `GeneratepGroups`.

<a id="example-ex-3d4202"></a>
#### `Example: Descendants of a 2-Group (ex-3d4202)`

```magma
> G := DihedralGroup(GrpPC, 16);
> T := Descendants (G, 8);
> #T;
12
> H := T[5];
> H;
GrpPC : H of order 128 = 2^7
PC-Relations:
    H.1^2 = H.7,
    H.2^2 = H.3 * H.4,
    H.3^2 = H.4 * H.5,
    H.4^2 = H.5 * H.6,
    H.5^2 = H.6 * H.7,
    H.6^2 = H.7,
    H.2^H.1 = H.2 * H.3,
    H.3^H.1 = H.3 * H.4,
    H.4^H.1 = H.4 * H.5,
    H.5^H.1 = H.5 * H.6,
    H.6^H.1 = H.6 * H.7
```

<a id="example-ex-e130f7"></a>
#### `Example: 2-Generator Groups of Exponent 4 (ex-e130f7)`

What is the soluble length of a 2-generator group of exponent 4? We construct the 2-generator 2-groups having exponent 4.

```magma
> T := GeneratepGroups(2, 2, 10: Exponent := 4);
> "The number of 2-generator exponent 4 groups is ", # T;
The number of 2-generator exponent 4 groups is  26
```

What are their soluble lengths?

```magma
> for i := 1 to #T do
>       "Group ", i, " has soluble length ", DerivedLength (T[i]);
> end for;
Group  1  has soluble length  1
Group  2  has soluble length  2
Group  3  has soluble length  2
Group  4  has soluble length  1
Group  5  has soluble length  2
Group  6  has soluble length  2
Group  7  has soluble length  2
Group  8  has soluble length  2
Group  9  has soluble length  2
Group  10  has soluble length  2
Group  11  has soluble length  2
Group  12  has soluble length  2
Group  13  has soluble length  2
Group  14  has soluble length  2
Group  15  has soluble length  2
Group  16  has soluble length  2
Group  17  has soluble length  2
Group  18  has soluble length  2
Group  19  has soluble length  2
Group  20  has soluble length  2
Group  21  has soluble length  3
Group  22  has soluble length  3
Group  23  has soluble length  3
Group  24  has soluble length  3
Group  25  has soluble length  3
Group  26  has soluble length  3
```

<a id="example-ex-4efc58"></a>
#### `Example: 2-Generator 3-Groups of Abundance Zero (ex-4efc58)`

Can we find all 2-generator 3-groups of abundance zero? Such groups have order at most $3^5$. First, we define a function which checks the number of conjugacy classes of a group (to determine abundance).

```magma
> IsGoodGroup := function(G, k)
>
>    ncl := # Classes(G);
>
>    O := FactoredOrder(G);
>    p := O[1][1];
>    m := O[1][2];
>    n := Floor(m / 2);
>    e := m - n * 2;
>    Desired := n * (p^2 - 1) + p^e + k * (p - 1) * (p^2 - 1);
>
>    return (Desired eq ncl);
>
> end function;
```

Then, we generate the potential candidates and check each.

```magma
> a := GeneratepGroups (3, 2, 4 : OrderBound := 5);
> #a;
42
>
> for i := 1 to #a do
>        G := a[i];
>        if IsGoodGroup(G, 0) then
>           "Group ", i, " of order ", Order(G), " has abundance 0";
>        end if;
> end for;
Group  1  of order  9  has abundance 0
Group  3  of order  27  has abundance 0
Group  4  of order  27  has abundance 0
Group  11  of order  81  has abundance 0
Group  12  of order  81  has abundance 0
Group  13  of order  81  has abundance 0
Group  14  of order  81  has abundance 0
Group  40  of order  243  has abundance 0
Group  41  of order  243  has abundance 0
Group  42  of order  243  has abundance 0
```

<a id="function-classtwo-rngintelt-rngintelt"></a>
#### `ClassTwo(p, d : parameters): RngIntElt, RngIntElt -> SeqEnum`

<a id="function-classtwo-rngintelt-rngintelt-seqenum"></a>
#### `ClassTwo(p, d, Step : parameters): RngIntElt, RngIntElt, SeqEnum -> SeqEnum`

<a id="function-classtwo-rngintelt-rngintelt-rngintelt"></a>
#### `ClassTwo(p, d, s : parameters): RngIntElt, RngIntElt, RngIntElt -> RngIntElt`

```magma
Exponent: RngIntElt                    Default: 0
```

Count the $d$-generator $p$-groups of $p$-class 2. If $s$ or $Step$ is supplied, then count only those of order $p^{(d + s)}$ or $p^{(d + m)}$ for $m \in Step$. In the first two invocations, the sequence returns a sequence of length $d \choose 2$, whose $m$-th entry is the number of groups of $p^{(d + m)}$. (Some additional entries may be deduced on the basis of duality.) The last invocation returns the number of groups of $p^{(d + s)}$. For details of the algorithm used see [[EO99](https://docs.magma-maths.org/references.md#cite-eo-enum)].

If `Exponent` is `true`, count those groups which have exponent $p$. The directive `SetVerbose ("ClassTwo", 1)` will provide information on the progress of the algorithm.

<a id="example-ex-6ce143"></a>
#### `Example: Counting p-Class 2 Groups (ex-6ce143)`

Count the number of 3-generator p-class 2 5-groups.

```magma
> ClassTwo(5, 3);
[ 4, 19, 42, 19, 4, 1 ]
```

For example, the number of 3-generator 5-groups of order $5^6$ and $p$-class 2 is precisely 42.

Count the number of 4-generator $p$-class 2 5-groups of order $5^7$.

```magma
> ClassTwo(5, 4, 3);
6598
```

### Representation Theory

Chapter [Characters of Finite Groups](https://docs.magma-maths.org/RepresentationTheory/CharactersOfFiniteGroups/index-characters-of-finite-groups.md#chapchtr) on characters describes many functions for computing with partial character tables or individual characters.

<a id="function-characterdegrees-grppc"></a>
#### `CharacterDegrees(G): GrpPC -> [ Tup ]`

<a id="function-characterdegrees-grppc-grppcelt-rngintelt"></a>
#### `CharacterDegrees(G, z, p): GrpPC, GrpPCElt, RngIntElt -> [ Tup ]`

Given a finite pc-group $G$, return the sequence $[\langle d_1,c_1\rangle, \langle d_2,c_2\rangle, \ldots]$, where $c_i$ is the number of irreducible characters of $G$ having degree $d_i$. For details of the algorithm see Conlon [[Con90b](https://docs.magma-maths.org/references.md#cite-conlon-degrees)].

The second form requires $z$ to be a central element of $G$ and $p$ to be a prime or zero. The sequence returned enumerates the number of absolutely irreducible characters of $G$ in characteristic $p$, lying over some faithful linear character of $\langle z\rangle$.

<a id="function-characterdegrees-grpfin"></a>
#### `CharacterDegrees(G): GrpFin -> [ Tup ]`

Given a finite $p$-group $G$, return the sequence $[\langle d_1,c_1\rangle, \langle d_2,c_2\rangle, \ldots]$, where $c_i$ is the number of irreducible characters of $G$ having degree $d_i$. For details of the algorithm see [[Sla86](https://docs.magma-maths.org/references.md#cite-slat-degs)].

<a id="function-characterdegreespgroup-grpfin"></a>
#### `CharacterDegreesPGroup(G): GrpFin -> [ RngIntElt ]`

Given a finite $p$-group $G$, return the sequence $[C_0, C_1, \ldots]$, where $C_i$ is the number of irreducible characters of $G$ having degree $p^i$. For details of the algorithm see [[Sla86](https://docs.magma-maths.org/references.md#cite-slat-degs)].

<a id="function-charactertable-grppc"></a>
#### `CharacterTable(G: parameters): GrpPC -> TabChtr`

```magma
Al         : MonStgElt                    Default: "Default"
DSSizeLimit: RngIntElt                    Default: 10^4
```

Construct the table of ordinary irreducible characters for the group $G$.

This parameter controls the algorithm used. The string `"DS"` forces use of the Dixon-Schneider algorithm. The string `"IR"` forces the use of Unger’s induction/reduction algorithm [[Ung06a](https://docs.magma-maths.org/references.md#cite-chtr-table-unger)]. The `"Default"` algorithm is to use Dixon-Schneider for groups of order $\le 5000$ and Unger’s algorithm for larger groups. This may change in future.

When the default algorithm is selected, a positive value $n$ for `DSSizeLimit` means that before using Unger’s algorithm, the full character space is split by some passes of Dixon-Schneider, restricted to using class matrices corresponding to conjugacy classes with size at most $n$.

<a id="function-charactertableconlon-grppc"></a>
#### `CharacterTableConlon(G): GrpPC -> [ AlgChtrElt ]`

Given a finite $p$-group $G$, return the character table of $G$. The algorithm is due to Conlon, as described in [[Con90a](https://docs.magma-maths.org/references.md#cite-conlon-chtrs)].

<a id="function-gmodule-grppc-algmat"></a>
#### `GModule(G, M): GrpPC, AlgMat -> ModAlg`

The $G$-module for the action of $G$ on the vector space defined by the matrix ring $M$.

<a id="function-gmodule-grppc-grppc"></a>
#### `GModule(G, A): GrpPC, GrpPC -> ModAlg, Map`

A $KG$-module $M$ corresponding to the action of the group $G$ on the elementary abelian subgroup $A$ of $G$ is constructed. The map from $A$ to the vector space underlying $M$ is also returned.

<a id="function-gmodule-grppc-grppc-grppc"></a>
#### `GModule(G, A, B): GrpPC, GrpPC, GrpPC -> ModAlg, Map`

A $KG$-module $M$ corresponding to the action of the group $G$ on the elementary abelian section $A/B$ of $G$ is constructed. The map from $A$ to the vector space underlying $M$ is also returned.

<a id="function-absolutelyirreduciblerepresentationsschur-grppc-rng"></a>
#### `AbsolutelyIrreducibleRepresentationsSchur(G, k: parameters): GrpPC, Rng -> List[Map]`

<a id="function-absolutelyirreduciblemodulesschur-grppc-rng"></a>
#### `AbsolutelyIrreducibleModulesSchur(G, k: parameters): GrpPC, Rng -> List[GModule]`

<a id="function-absolutelyirreduciblerepresentationsschur-grppc-rng-rngintelt"></a>
#### `AbsolutelyIrreducibleRepresentationsSchur(G, k, i: parameters): GrpPC, Rng, RngIntElt -> List[Map]`

<a id="function-absolutelyirreduciblemodulesschur-grppc-rng-rngintelt"></a>
#### `AbsolutelyIrreducibleModulesSchur(G, k, i: parameters): GrpPC, Rng, RngIntElt -> List[GModule]`

<a id="function-absolutelyirreduciblerepresentationsschur-grppc-rng-list-map"></a>
#### `AbsolutelyIrreducibleRepresentationsSchur(G, k, L: parameters): GrpPC, Rng, List[Map] -> List[Map]`

<a id="function-absolutelyirreduciblemodulesschur-grppc-rng-list-gmodule"></a>
#### `AbsolutelyIrreducibleModulesSchur(G, k, L: parameters): GrpPC, Rng, List[GModule] -> List[GModule]`

<a id="function-absolutelyirreduciblerepresentationsschur-grppc-rng-list-map-rngintelt"></a>
#### `AbsolutelyIrreducibleRepresentationsSchur(G, k, L, i: parameters): GrpPC, Rng, List[Map], RngIntElt -> List[Map]`

<a id="function-absolutelyirreduciblemodulesschur-grppc-rng-rngintelt-2"></a>
#### `AbsolutelyIrreducibleModulesSchur(G, k, L, i: parameters): GrpPC, Rng, RngIntElt -> List[GModule]`

```magma
Process       : BoolElt                      Default: true
GaloisAction  : MonStgElt                    Default: "Yes"
MaxDimension  : RngIntElt                    Default: 
ExactDimension: SetEnum                      Default: 
```

Compute the absolutely irreducible representations of the group $G$ over appropriate extensions or sub-fields of the given field $k$. The representations returned are inequivalent and consist of all distinct representations, subject to the conditions imposed. The field $k$ may be a finite field, the rationals, or a cyclotomic field. In the case when $k$ is a finite field, the Glasby-Howlett algorithm is used to determine the minimal field over which a representation may be realised. If $k$ has characteristic 0, the field over which a representation is realised may not be minimal.

The representations are found using Schur’s method of climbing the composition series for $G$ defined by the pc-presentation. If the argument $i$ is given then the algorithm will calculate only representations of the $i$th subgroup of the composition series.

The “Representations” function returns a list of homomorphisms $\rho : G \to GL(n, K)$, where $K$ is a field compatible with $k$. The “Modules” version returns an equivalent list of $G$-modules.

If the parameter `Process` is set true then the list is a list of pairs comprising an integer and a representation. This list or any sublist of it is a suitable value for the argument $L$ in the last versions of the function, and in this case only the representations in $L$ will be extended up the series. This allows the user to inspect the representations produced along the way and cull any that are uninteresting.

Possible values are `"Yes"`, `"No"`, and `"Relative"`. The default is `"Yes"` for intermediate levels and `"No"` for the whole group. The value `"Yes"` means that it only lists one representation from each orbit of the action of the absolute Galois group $Gal(K/\text{primefield(}K\text{)})$. Setting this parameter to `"No"` turns this reduction off (thus listing all inequivalent representations), while setting it to `"Relative"` uses the group $Gal(K/k)$.

Restrict the representations to those of dimension $\le$ `MaxDimension`. The default is no restriction.

If `ExactDimension` is assigned a set $S$ of positive integers, attention is restricted to representations having dimensions lying in the set $S$. The default is equivalent to taking the set of all positive integers.

If both `MaxDimension` and `ExactDimension` are assigned values, then representations having dimensions that are either bounded by `MaxDimension` or contained in `ExactDimension` are produced.

<a id="function-irreduciblerepresentationsschur-grppc-rng"></a>
#### `IrreducibleRepresentationsSchur(G, k: parameters): GrpPC, Rng -> List[Map]`

<a id="function-irreduciblemodulesschur-grppc-rng"></a>
#### `IrreducibleModulesSchur(G, k: parameters): GrpPC, Rng -> List[GModule]`

<a id="function-irreduciblerepresentationsschur-grppc-rng-rngintelt"></a>
#### `IrreducibleRepresentationsSchur(G, k, i: parameters): GrpPC, Rng, RngIntElt -> List[Map]`

<a id="function-irreduciblemodulesschur-grppc-rng-rngintelt"></a>
#### `IrreducibleModulesSchur(G, k, i: parameters): GrpPC, Rng, RngIntElt -> List[GModule]`

<a id="function-irreduciblerepresentationsschur-grppc-rng-list-map"></a>
#### `IrreducibleRepresentationsSchur(G, k, L: parameters): GrpPC, Rng, List[Map] -> List[Map]`

<a id="function-irreduciblemodulesschur-grppc-rng-list-gmodule"></a>
#### `IrreducibleModulesSchur(G, k, L: parameters): GrpPC, Rng, List[GModule] -> List[GModule]`

<a id="function-irreduciblerepresentationsschur-grppc-rng-list-map-rngintelt"></a>
#### `IrreducibleRepresentationsSchur(G, k, L, i: parameters): GrpPC, Rng, List[Map], RngIntElt -> List[Map]`

<a id="function-irreduciblemodulesschur-grppc-rng-list-gmodule-rngintelt"></a>
#### `IrreducibleModulesSchur(G, k, L, i: parameters): GrpPC, Rng, List[GModule], RngIntElt -> List[GModule]`

Compute irreducible representations of $G$ over the given field $k$. All arguments and parameters are as for the absolutely irreducible case.

The computation proceeds by first computing the absolutely irreducible representations subject to the given parameters, then rewriting over the field $k$, with a consequent change of dimension of the representation.

<a id="example-ex-ca921e"></a>
#### `Example: Representations of the Dihedral Group of Order 20 (ex-ca921e)`

We compute representations of the dihedral group of order 20.

```magma
> G := DihedralGroup(GrpPC, 10);
> FactoredOrder(G);
[ <2, 2>, <5, 1> ]
```

First some modular representations with characteristic 2.

```magma
> r := IrreducibleModulesSchur(G, GF(2));
> r;
[*
    GModule of dimension 1 over GF(2),
    GModule of dimension 4 over GF(2)
*]
> r := AbsolutelyIrreducibleModulesSchur(G, GF(2));
> r;
[*
    GModule of dimension 1 over GF(2),
    GModule of dimension 2 over GF(2^2),
    GModule of dimension 2 over GF(2^2)
*]
> r := AbsolutelyIrreducibleModulesSchur(G, GF(2) : GaloisAction:="Yes");
> r;
[*
    GModule of dimension 1 over GF(2),
    GModule of dimension 2 over GF(2^2)
*]
```

The irreducible representation of dimension 4 is not absolutely irreducible, as over $GF(4)$ it splits into two Galois-equivalent representations.

Getting irreducible representations over the complex field presents no problem, despite not being able to use the complex field as an argument to the function call. We could specify the field to be the cyclotomic field with degree equal to Exponent(G), but it is preferable to ask for absolutely irreducible representations over the rationals.

```magma
> r := AbsolutelyIrreducibleRepresentationsSchur(G, Rationals());
> r;
[*
    Mapping from: GrpPC: G to GL(1, RationalField()),
    Mapping from: GrpPC: G to GL(1, RationalField()),
    Mapping from: GrpPC: G to GL(1, RationalField()),
    Mapping from: GrpPC: G to GL(1, RationalField()),
    Mapping from: GrpPC: G to GL(2, CyclotomicField(5)),
    Mapping from: GrpPC: G to GL(2, CyclotomicField(5)),
    Mapping from: GrpPC: G to GL(2, CyclotomicField(5)),
    Mapping from: GrpPC: G to GL(2, CyclotomicField(5))
*]
> r[6](G.2);
[zeta_5^3        0]
[       0 zeta_5^2]
```

### Central Extensions

We now describe functions to construct $H^2(G,U)$ for a finite soluble group $G$ and finite abelian group $U$ (a trivial $G$-module). We also present functions to construct central extensions of $U$ by $G$.

Denote by $Z^2(G,U)$ the abelian group of all cocycles from $G$ to $U$, under pointwise multiplication. The values $\psi(g,h)$ of $\psi \in Z^2(G, U)$ may be represented as a “cocyclic matrix” with entries in $U$.

If $\phi \from G \ar U$ is a set map with $\phi (1_G) = 1_U$, then there is a coboundary $\partial \phi \in Z^2(G,U)$ defined by $\partial \phi(g,h) = \phi(g) \phi (h) \phi(gh)^{-1}$. The group of all coboundaries from $G$ to $U$ is denoted $B^2(G,U)$, and we have $H^2(G,U) = Z^2(G,U)/B^2(G,U)$. Then $H^2(G,U)=I\times T$, where $I$ is the (faithful) image of $\operatorname{Ext}(G/G', U) \leq H^2(G/G', U)$ under inflation, and $T$ is the (faithful) image of $\Hom(H_2(G), U)$ under a certain transgression homomorphism. Here we provide functions which construct representatives for the elements in a generating set for each of these two factors.

For details of the theory and the algorithm used, see [[FO00](https://docs.magma-maths.org/references.md#cite-fo-centex)].

`SetVerbose ("Cocycle", 1)` will provide additional information on the calculations in the functions.

<a id="function-extgenerators-grppc-grppc"></a>
#### `ExtGenerators(G, U): GrpPC, GrpPC -> [<AlgMatElt, RngIntElt>]`

Given a soluble group $G$ and an abelian group $U$ (both defined by pc-presentations) the function returns a sequence of tuples describing generators for $\operatorname{Ext}(G/G', U)$ as cocyclic matrices; the first entry in each tuple is a representative of a generator, the second is the order of the coset of the representative in $H^2(G, U)$.

<a id="function-homgenerators-grppc-grppc"></a>
#### `HomGenerators(G, U): GrpPC, GrpPC -> [<AlgMatElt, RngIntElt>]`

Given a soluble group $G$ and an abelian group $U$ (both defined by pc-presentations) the function returns a sequence of tuples describing generators for $\Hom(H_2 (G), U)$ as cocyclic matrices; the first entry in each tuple is a representative of a generator, the second is the order of the coset of the representative in $H^2(G, U)$.

<a id="function-elementsequence-grppc"></a>
#### `ElementSequence(G): GrpPC -> SeqEnum`

For a soluble group $G$, the function returns an indexed set of elements of $G$ listed in the order used by `ExtGenerators` and `HomGenerators`.

<a id="function-representativecocycles-grppc-grppc-algmatelt-algmatelt"></a>
#### `RepresentativeCocycles(G, U, Ext, Hom): GrpPC, GrpPC, [AlgMatElt], [AlgMatElt] -> [AlgMatElt]`

Let $G$ be a soluble group $G$ and $U$ be an abelian group both defined by pc-presentations. Let $Ext$ and $Hom$ be the values returned by calling `ExtGenerators` and `HomGenerators` respectively. The function `RepresentativeCocycles` returns a complete and irredundant set of representatives for the elements of $H^2(G,U)$ as cocyclic matrices.

<a id="function-centralextension-grppc-grppc-algmatelt"></a>
#### `CentralExtension(G, U, A): GrpPC, GrpPC, AlgMatElt -> GrpPC`

Let $G$ be a soluble group $G$ and $U$ be an abelian group, both defined by pc-presentations. Further, let $A$ be a cocyclic matrix (as determined by the function `RepresentativeCocycles`). Then, this function returns the central extension of $U$ by $G$ determined by the cocyclic matrix $A$.

<a id="function-centralextensions-grppc-grppc-algmatelt"></a>
#### `CentralExtensions(G, U, Q): GrpPC, GrpPC, [AlgMatElt] -> [GrpPC]`

If $G$ is a soluble group $G$ and $U$ is an abelian group, both defined by pc-presentations, and $Q$ is a sequence of cocyclic matrices (as determined by the function `RepresentativeCocycles`), this function returns the corresponding sequence of central extension of $U$ by $G$ determined by the sequence of cocyclic matrices $A$. Note that the central extensions thereby constructed need not be mutually non-isomorphic.

<a id="function-centralextensionprocess-grppc-grppc"></a>
#### `CentralExtensionProcess(G, U): GrpPC, GrpPC -> Proc`

Given a soluble group $G$ and an abelian group $U$ (both defined by pc-presentations) the function creates a process $P$ for central extensions of $U$ by $G$. Note that the list of central extensions constructed by this process will contain all isomorphism types but the extensions need not be mutually non-isomorphic.

<a id="function-nextextension-rec-ref"></a>
#### `NextExtension(~P): Rec -> GrpPC`

Given a central extension process $P$, construct the next central extension determined by $P$.

<a id="function-isempty-rec"></a>
#### `IsEmpty(P): Rec -> BoolElt`

Return `true` if all central extensions determined by the process $P$ have been constructed; otherwise return `false`.

<a id="example-ex-b4d774"></a>
#### `Example: Central Extensions of a Dihedral Group (ex-b4d774)`

We compute the abelian invariants of $H^2 (D_4, C_2)$.

```magma
> G := DihedralGroup(GrpPC, 4);
> U := AbelianGroup(GrpPC, [2]);
>
> Ext := ExtGenerators(G, U);
> Ext[1];
    <[Id(U) Id(U) Id(U) Id(U) Id(U) Id(U) Id(U) Id(U)]
    [Id(U) Id(U) Id(U) Id(U) Id(U) Id(U) Id(U) Id(U)]
    [Id(U) Id(U) Id(U) Id(U) Id(U) Id(U) Id(U) Id(U)]
    [Id(U) Id(U) Id(U) Id(U) Id(U) Id(U) Id(U) Id(U)]
    [Id(U) Id(U) Id(U) Id(U) U.1 U.1 U.1 U.1]
    [Id(U) Id(U) Id(U) Id(U) U.1 U.1 U.1 U.1]
    [Id(U) Id(U) Id(U) Id(U) U.1 U.1 U.1 U.1]
    [Id(U) Id(U) Id(U) Id(U) U.1 U.1 U.1 U.1], 2>,
>
> Hom := HomGenerators(G, U);
> Hom;
[
    <[Id(U) Id(U) Id(U) Id(U) Id(U) Id(U) Id(U) Id(U)]
    [Id(U) U.1 U.1 Id(U) Id(U) U.1 U.1 Id(U)]
    [Id(U) Id(U) Id(U) Id(U) Id(U) Id(U) Id(U) Id(U)]
    [Id(U) U.1 U.1 Id(U) Id(U) U.1 U.1 Id(U)]
    [Id(U) Id(U) Id(U) U.1 Id(U) U.1 U.1 U.1]
    [Id(U) U.1 Id(U) Id(U) U.1 U.1 Id(U) U.1]
    [Id(U) Id(U) Id(U) U.1 Id(U) U.1 U.1 U.1]
    [Id(U) U.1 Id(U) Id(U) U.1 U.1 Id(U) U.1], 2>
]
>
> AbelianInvariants(Ext, Hom);
[ 2, 2, 2 ]
```

We now compute the central extension of U by G determined by a single cocyclic matrix.

```magma
> A := RepresentativeCocycles(G, U, Ext, Hom);
> E := CentralExtension(G, U, A[2]);
> E;
GrpPC : E of order 16 = 2^4
PC-Relations:
    E.1^2 = E.4,
    E.2^2 = E.3 * E.4,
    E.2^E.1 = E.2 * E.3
```

Alternatively we can build all central extensions of U by G.

```magma
> E := CentralExtensions(G, U, A);
> "Number of extensions is ", #E;
Number of extensions is  8
```

Next, we provide an example of using the central extension process. Firstly, we create the groups and initialize the process.

```magma
> G := SmallGroup(12, 5);
> U := AbelianGroup(GrpPC, [2, 3]);
> P := CentralExtensionProcess(G, U);
```

Now we run over the central extensions and count conjugacy classes.

```magma
> C := [];
> while IsEmpty(P) eq false do
>    NextExtension(~P, ~E);
>    Append(~C, #Classes (E));
> end while;
> "# conjugacy classes is ", C;
# conjugacy classes is  [ 45, 72, 45, 72, 45, 72, 45, 72, 45, 72, 45,
72, 45, 72, 45, 72, 45, 72, 45, 72, 45, 72, 45, 72 ]
```

### Transfer Between Group Categories

#### Transfer to GrpPC

The `PolycyclicGroup`-constructor allows complete flexibility in defining a pc-group. However, it is often more convenient to have Magma compute a pc-presentation based on some other description of the group. The `PCGroup` function will produce a pc-presentation for a finite group in various categories such as [`GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/index-permutation-groups.md#chapgrpperm) and [`GrpMat`](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/index-matrix-groups-over-general-rings.md#chapgrpmat). Converting from a [`GrpFP`](https://docs.magma-maths.org/FinitelyPresentedGroups/FPGroups/index-fpgroups.md#chapgrpfp) group is trickier, since the original group need not be finite. There are two functions provided to produce pc-presentations for certain quotients of finitely-presented groups. The `pQuotient` function constructs a pc-presentation for the largest $p$-group quotient having specified lower exponent-$p$ class. Similarly, `SolubleQuotient` will compute the largest soluble quotient subject to certain restrictions. Each of these functions also provides a homomorphism (isomorphism in the case of `PCGroup`) from the original group to the new pc-group. More information on each of the two quotient functions can be found in Chapter [Finitely Presented Groups](https://docs.magma-maths.org/FinitelyPresentedGroups/FPGroups/index-fpgroups.md#chapgrpfp).

<a id="function-pcgroup-grpperm"></a>
##### `PCGroup(G): GrpPerm -> GrpPC, Map`

<a id="function-pcgroup-grpmat"></a>
##### `PCGroup(G): GrpMat -> GrpPC, Map`

<a id="function-pcgroup-grpfp"></a>
##### `PCGroup(G): GrpFP -> GrpPC`

A `GrpPC` representation of the group $G$ and the isomorphism.

<a id="function-pquotient-grpfp-rngintelt-rngintelt"></a>
##### `pQuotient(F, p, c : parameters): GrpFP, RngIntElt, RngIntElt -> GrpPC, Map`

```magma
Workspace : RngIntElt                    Default: 1000000
Metabelian: BoolElt                      Default: false
Exponent  : RngIntElt                    Default: 0
Print     : RngIntElt                    Default: 0
```

Given a finitely presented group $F$, a prime $p$, and a positive integer $c$, this function constructs a consistent power-conjugate presentation for the largest $p$-quotient $H$ of $F$ having lower exponent-$p$ class at most $c$. If $c$ is given as zero, then the limit 127 is placed on the class. The prime $p$ must be less than $65536$. The function returns both the $p$-quotient $H$ defined by a pc-presentation and the homomorphism from $F$ to $H$.

<a id="function-solublequotient-grp"></a>
##### `SolubleQuotient(G): Grp -> GrpPC, Map`

<a id="function-solvablequotient-grp"></a>
##### `SolvableQuotient(G): Grp -> GrpPC, Map`

A `GrpPC` representation $P$ of the largest solvable quotient of $G$ and the homomorphism $\phi: G\rightarrow P$.

<a id="example-ex-84bae2"></a>
##### `Example: Pc-Presentation of a Matrix Group (ex-84bae2)`

We use `PCGroup` to produce a pc-presentation for a matrix group.

```magma
> GL := GeneralLinearGroup(4,GF(3));
> S3 := Sylow(GL,3);
> P := PCGroup(S3);
> P;
GrpPC : P of order 729 = 3^6
PC-Relations:
    P.2^P.1 = P.2 * P.4^2,
    P.3^P.1 = P.3 * P.5^2,
    P.3^P.2 = P.3 * P.6^2,
    P.5^P.2 = P.4 * P.5,
    P.6^P.1 = P.4 * P.6
```

#### Transfer from GrpPC

Given a pc-group, it is straight-forward to convert it to a [`GrpFP`](https://docs.magma-maths.org/FinitelyPresentedGroups/FPGroups/index-fpgroups.md#chapgrpfp) or [`GrpGPC`](https://docs.magma-maths.org/FinitelyPresentedGroups/PolycyclicGroups/index-polycyclic-groups.md#chapgrpgpc) representation by using the appropriate transfer function. If one wishes to have a permutation representation of the group, this requires more cleverness. The `CosetAction` function can be used to compute the permutation representation of a group on a subgroup. If the subgroup is chosen to have trivial core, then the permutation group obtained will be isomorphic to the original group.

<a id="function-abeliangroup-grppc"></a>
##### `AbelianGroup(G): GrpPC -> GrpAb, Map`

Given an abelian pc-group $G$, return a `GrpAb` group $H$ isomorphic to $G$ and an isomorphism $\phi: G \rightarrow H$.

<a id="function-fpgroup-grppc"></a>
##### `FPGroup(G): GrpPC -> GrpFP, Map`

A [`GrpFP`](https://docs.magma-maths.org/FinitelyPresentedGroups/FPGroups/index-fpgroups.md#chapgrpfp) representation $F$ of $G$ and the isomorphism from $G$ to $F$.

<a id="function-gpcgroup-grppc"></a>
##### `GPCGroup(G): GrpPC -> GrpGPC, Map`

A [`GrpGPC`](https://docs.magma-maths.org/FinitelyPresentedGroups/PolycyclicGroups/index-polycyclic-groups.md#chapgrpgpc) representation $F$ of $G$ and the isomorphism from $G$ to $F$.

<a id="example-ex-b68da2"></a>
##### `Example: Pc-Group to Permutation Group (ex-b68da2)`

Take one of the groups of order $2^6 * 3^2$.

```magma
> G := SmallGroup(576, 4123);
> G;
GrpPC : G of order 576 = 2^6 * 3^2
PC-Relations:
    G.1^2 = Id(G),
    G.2^2 = Id(G),
    G.3^2 = G.5,
    G.4^3 = Id(G),
    G.5^2 = G.7,
    G.6^2 = G.7,
    G.7^2 = Id(G),
    G.8^3 = Id(G),
    G.2^G.1 = G.2 * G.6,
    G.6^G.1 = G.6 * G.7,
    G.6^G.2 = G.6 * G.7,
    G.8^G.1 = G.8^2
```

Since $G$ is small, we can search for a minimum degree permutation presentation by brute force. First we build a set containing all the subgroups.

```magma
> SL := Subgroups(G);
> T := {X`subgroup: X in SL};
> #T;
243
```

Then, we select those subgroups with trivial core, and find one with the smallest index.

```magma
> TrivCore := {H:H in T| #Core(G,H) eq 1};
> mdeg := Min({Index(G,H):H in TrivCore});
> Good := {H: H in TrivCore| Index(G,H) eq mdeg};
> #Good;
3
> H := Rep(Good);
```

We then use CosetAction to construct the permutation representation on the cosets of $H$.

```magma
> f,P,K := CosetAction(G,H);
> #K;
1
> IsPrimitive(P);
false
```

### More About Presentations

Each pc-group can have up to three pc-presentations associated with it. If the user specifies a consistent presentation in the `PolycyclicGroup`-constructor, then this presentation (the “user” presentation) will be used for all printing and interpretation of element input. If the specified presentation is inconsistent, a runtime error is generated.

Internally, Magma uses a “conditioned” presentation for computation. The composition series associated with this presentation is guaranteed to refine a normal series with elementary abelian factors. If $G$ is a $p$-group, then the composition series is guaranteed to be a central series and the first $d$ pc-generators are a minimal set of generators for the group. Hence, their images generate the Frattini factor group. If the user presentation satisfies these conditions, then it is used as the conditioned presentation. Otherwise, a separate presentation is computed automatically.

Several algorithms rely on a “special” presentation for the group. This presentation exhibits Hall $\pi$-subgroups and a characteristic series with elementary abelian factors. When needed, such a presentation is computed and elements are automatically translated between presentations.

The “compact” presentation is not a presentation used in computation. Rather it provides an efficient means to input and output large pc-groups. This is especially useful for stored collections of groups (libraries or databases).

#### Conditioned Presentations

Magma will compute a pc-presentation which will be used for internal computation, but the user’s presentation will be used for all input and output. The recommended way to access the conditioned internal presentation is via the intrinsic `ConditionedGroup`.

##### Structure Operations

<a id="function-conditionedgroup-grppc"></a>
###### `ConditionedGroup(G): GrpPC -> GrpPC`

The internally used, conditioned presentation of the pc-group $G$. The returned group is recorded as a subgroup of $G$ in the relationship tables, so coercion can be used to move between presentations.

<a id="function-isconditioned-grppc"></a>
###### `IsConditioned(G): GrpPC -> BoolElt`

Returns `true` if $G$ uses the user presentation as the internal presentation, `false` otherwise.

##### Element Operations

<a id="function-leadingterm-grppcelt"></a>
###### `LeadingTerm(x): GrpPCElt -> GrpPCElt`

Given an element $x$ of a pc-group $G$ with $n$ pc-generators and a conditioned presentation, where $x$ is of the form $a_1^{\alpha_1}\ldots a_n^{\alpha_n}$, return $a_i^{\alpha_i}$ for the smallest $i$ such that $\alpha_i > 0$. If $x$ is the identity of $G$, then the identity is returned.

<a id="function-leadinggenerator-grppcelt"></a>
###### `LeadingGenerator(x): GrpPCElt -> GrpPCElt`

Given an element $x$ of a pc-group $G$ with $n$ pc-generators and a conditioned presentation, where $x$ is of the form $a_1^{\alpha_1}\ldots a_n^{\alpha_n}$, return $a_i$ for the smallest $i$ such that $\alpha_i > 0$. If $x$ is the identity of $G$, then the identity is returned.

<a id="function-leadingexponent-grppcelt"></a>
###### `LeadingExponent(x): GrpPCElt -> RngIntElt`

Given an element $x$ of a pc-group $G$ with $n$ pc-generators and a conditioned presentation, where $x$ is of the form $a_1^{\alpha_1}\ldots a_n^{\alpha_n}$, return $\alpha_i$ for the smallest $i$ such that $\alpha_i > 0$. If $x$ is the identity of $G$, then $0$ is returned.

<a id="function-depth-grppcelt"></a>
###### `Depth(x): GrpPCElt -> RngIntElt`

Given an element $x$ of a pc-group $G$ with $n$ pc-generators and a conditioned presentation, where $x$ is of the form $a_1^{\alpha_1}\ldots a_n^{\alpha_n}$, return the smallest $i$ such that $\alpha_i > 0$. If $x$ is the identity of $G$, then $0$ is returned.

<a id="function-pcclass-grppcelt"></a>
###### `PCClass(x): GrpPCElt -> RngIntElt`

<a id="function-weightclass-grppcelt"></a>
###### `WeightClass(x): GrpPCElt -> RngIntElt`

The weight class of the element $x$. The `WeightClass` of an arbitrary element of a pc-group $G$ is defined to be $k$ if $x\in G_{\delta_{k-1}}$ and $x\notin G_{\delta_{k}}$. If $x$ is the identity of $G$, then `WeightClass` returns $n + 1$.

#### Special Presentations

A special presentation is one which has several properties described by C.R. Leedham-Green:

**(1)**
The composition series defined by the pc-generators refines the LG-series. The LG-series is a characteristic series which refines the nilpotent series. Within each nilpotent section, it refines the series of successive Frattini factors. Factors of successive terms in the LG-series are elementary abelian $p$-groups, with $p$ increasing through each Frattini factor.

**(2)**
The presentation exhibits a Sylow system. By this we mean that if $\pi$ is a set of primes, then the pc-generators whose corresponding prime lies in $\pi$ will generate a Hall $\pi$-subgroup.

**(3)**
The presentation exhibits “head splittings”. These are certain complements in factors of the group as follows: If $N$ is a term of the nilpotent series of $G$, $M$ the next term (so $N/M$ is a maximal nilpotent factor of $N$), and $F/M$ is the Frattini subgroup of $N/M$, then it is possible to show that $N/F$ has a complement in $G/F$. We say the presentation exhibits this complement (or “splitting”) if the pc-generators of $G$ which are not in $N$ generate a complement for $N$ mod $F$.

Several algorithms rely on having a special presentation for the given group. In these cases, Magma will automatically compute a special presentation. However, if the user wishes to have a special presentation as the user presentation for a group, the function `SpecialPresentation` can be used. This is typically used when implementing new algorithms which rely on the properties of a special presentation. The other functions allow one to identify specific characteristics of a special presentation. They are not defined for arbitrary presentations.

<a id="function-specialpresentation-grppc"></a>
##### `SpecialPresentation(G): GrpPC -> GrpPC`

Returns a new group $H$ which is defined by a special presentation. $H$ is in fact a subgroup of $G$ (equal to $G$) and so one can use the coercion operator (!) to translate elements between the two presentations. Furthermore, any subgroup of $H$ is automatically a subgroup of $G$. For instance, if one computed the center $Z$ of $H$ (using some algorithm relying on the special presentation), $Z$ would be a subgroup of $G$, and would be the center of $G$.

<a id="function-specialweights-grppc"></a>
##### `SpecialWeights(G): GrpPC -> [ <RngIntElt, RngIntElt, RngIntElt> ]`

A sequence of triples of integers is returned, with one triple corresponding to each pc-generator. The first integer in a triple gives the number of the nilpotent section containing the generator, the second gives the number of the square-free exponent abelian section of that nilpotent section containing it, and the third gives the number of the elementary abelian $p$-group layer that contains the generator. The prime for the generator is not included in the triple (see `PCPrimes`).

<a id="function-nilpotentlength-grppc"></a>
##### `NilpotentLength(G): GrpPC -> RngIntElt`

The number of nilpotent factors in the nilpotent series.

<a id="function-nilpotentboundary-grppc-rngintelt"></a>
##### `NilpotentBoundary(G, i): GrpPC, RngIntElt -> RngIntElt`

The subscript of the last generator in the $i$th nilpotent section, where $i$ lies between $1$ and `NilpotentLength(G)`.

<a id="function-minorlength-grppc-rngintelt"></a>
##### `MinorLength(G, i): GrpPC, RngIntElt -> RngIntElt`

The number of minor sections (Frattini factors) in the $i$th nilpotent section of $G$.

<a id="function-minorboundary-grppc-rngintelt-rngintelt"></a>
##### `MinorBoundary(G, i, j): GrpPC, RngIntElt, RngIntElt -> RngIntElt`

The subscript of the last generator in the $j$th minor section of the $i$th nilpotent section, where $j$ lies between 1 and `MinorLength(G,i)`.

<a id="function-layerlength-grppc-rngintelt-rngintelt"></a>
##### `LayerLength(G, i, j): GrpPC, RngIntElt, RngIntElt -> RngIntElt`

The number of elementary abelian $p$-group layers in the $j$th minor section of the $i$th nilpotent section of $G$.

<a id="function-layerboundary-grppc-rngintelt-rngintelt-rngintelt"></a>
##### `LayerBoundary(G, i, j, k): GrpPC, RngIntElt, RngIntElt, RngIntElt -> RngIntElt`

The subscript of the last generator in the $k$th elementary abelian $p$-group layer of the $j$th minor section of the $i$th nilpotent section, where $k$ lies between 1 and `LayerLength(G,i,j)`.

<a id="example-ex-4806c3"></a>
##### `Example: User and Special Presentations (ex-4806c3)`

We show how user presentations and special presentations can differ. If we define a wreath product using `PolycyclicGroup`, the given presentation becomes the user presentation, but this is not a special presentation for the group.

```magma
> T := PolycyclicGroup<a,b,c,d|a^3,b^3,c^3,d^3,
>                          b^a=c, c^a=d, d^a=b>;
> T;
GrpPC : T of order 81 = 3^4
PC-Relations:
    T.2^T.1 = T.3,
    T.3^T.1 = T.4,
    T.4^T.1 = T.2
> S := SpecialPresentation(T);
> S;
GrpPC : S of order 81 = 3^4
PC-Relations:
    S.2^S.1 = S.2 * S.3^2 * S.4,
    S.3^S.1 = S.3 * S.4^2
```

Here we build another wreath product and construct a special presentation.

```magma
> C6 := CyclicGroup(GrpPC,6);
> C2 := CyclicGroup(GrpPC,2);
> G := WreathProduct(C2,C6);
> G;
GrpPC : G of order 384 = 2^7 * 3
PC-Relations:
    G.1^2 = G.2,
    G.2^3 = Id(G),
    G.3^2 = Id(G),
    G.4^2 = Id(G),
    G.5^2 = Id(G),
    G.6^2 = Id(G),
    G.7^2 = Id(G),
    G.8^2 = Id(G),
    G.3^G.1 = G.8,
    G.3^G.2 = G.5,
    G.4^G.1 = G.6,
    G.4^G.2 = G.3,
    G.5^G.1 = G.7,
    G.5^G.2 = G.4,
    G.6^G.1 = G.3,
    G.6^G.2 = G.8,
    G.7^G.1 = G.4,
    G.7^G.2 = G.6,
    G.8^G.1 = G.5,
    G.8^G.2 = G.7
> H := SpecialPresentation(G);
> H;
GrpPC : H of order 384 = 2^7 * 3
PC-Relations:
    H.1^2 = Id(H),
    H.2^2 = Id(H),
    H.3^3 = Id(H),
    H.4^2 = Id(H),
    H.5^2 = Id(H),
    H.6^2 = Id(H),
    H.7^2 = Id(H),
    H.8^2 = Id(H),
    H.2^H.1 = H.2 * H.4,
    H.5^H.3 = H.6,
    H.6^H.3 = H.5 * H.6,
    H.7^H.1 = H.6 * H.7,
    H.7^H.3 = H.8,
    H.8^H.1 = H.5 * H.6 * H.8,
    H.8^H.3 = H.7 * H.8
```

We can coerce between the presentations.

```magma
> G!(H.2), H!(G.2);
G.6 * G.7 * G.8 H.3
```

Look at some specific features of the presentation.

```magma
> SpecialWeights(H);
[ <1, 1, 1>, <1, 1, 1>, <1, 1, 2>, <1, 2, 1>, <2, 1, 1>, <2, 1, 1>, <2, 1, 1>,
<2, 1, 1> ]
> MinorLength(H,1);
2
> MinorBoundary(H,1,1);
3
```

#### CompactPresentation

When the Magma parser reads in large group presentations of the form

```
S4 := PolycyclicGroup< a, b, c, d | a^2 = 1, b^3 = 1, c^2 = 1,
       d^2 = 1, b^a = b^2, c^a = c * d, c^b = c * d, d^b = c >;
```

a large amount of memory and time is used to build all of the expressions involved in the statement. This time is most noticeable when loading in large libraries of Magma code containing many large presentations. The following intrinsics provide a way to avoid this overhead.

<a id="function-compactpresentation-grppc"></a>
##### `CompactPresentation(G): GrpPC -> [RngIntElt]`

Given a pc-group $G$, return a sequence of integers that contains the information needed to define the group’s presentation.

<a id="function-pcgroup-rngintelt"></a>
##### `PCGroup(Q : parameters): [RngIntElt] -> GrpPC`

```magma
Check        : BoolElt                      Default: false
ExponentLimit: RngIntElt                    Default: 20
```

Return a group $G$ in category `GrpPC`, whose presentation is provided by the integer sequence $Q$. Constructing the group from the integer sequence has very low overhead in the parser. The time taken to construct the group is less when the presentation is conditioned. The parameter `Check` indicates whether or not the presentation is checked for consistency. Leaving the `Check` parameter set to `false` speeds the construction of the group, but will be disastrous if the sequence $Q$ does not represent a consistent pc-presentation. Parameter `ExponentLimit` determines the amount of space that will be used by the group to speed calculations. Given `ExponentLimit := e`, the group will store the products $a^i * b^j$ where $a$ and $b$ are generators and $i$ and $j$ are in the range $1$ to $e$.

<a id="example-ex-73c5b4"></a>
##### `Example: Compact Presentation for a Library (ex-73c5b4)`

If the user wants to store the definition of a group in a library, the following may be done.

```magma
> S4 := PolycyclicGroup< a, b, c, d | a^2 = 1, b^3 = 1, c^2 = 1, d^2 = 1,
> \indent\indent\indent b^a = b^2, c^a = c * d, c^b = c * d, d^b = c >;
> Q := CompactPresentation( S4 );
> Q;
[ 4, -2, -3, -2, 2, 33, 218, 114, 55 ]
```

The library code would then be

```magma
> Make:=func< | PCGroup(\\[4, 2, 3, 2, 2, 33, 218, 114, 55] : Check := false) >;
```

Note the use of a literal sequence here — see Chapter [Sequences](https://docs.magma-maths.org/SetsSequencesMappings/Sequences/index-sequences.md#chapseq).

### Optimizing Magma Code

#### PowerGroup

If the user is working with enumerated sets of pc-groups that are all subgroups of a common over-group $G$, then the following optimization is strongly recommended. Define the set to have the universe `PowerGroup(G)`. For any subgroup $H$ of $G$, we can find a canonical form for the generators of $H$. This allows us to have a very good hashing function for the subgroups.

<a id="example-ex-952208"></a>
##### `Example: Optimising with a Power Group (ex-952208)`

The following example illustrates the optimization.

```magma
> G := ExtraSpecialGroup( GrpPC, 3, 3 );
> P := PowerGroup(G);
> time s1 := {  P | sub< G | Random(G), Random(G) > : x in { 1..500}  };
Time: 1.140
> time s2 := { Parent(G) | sub< G | Random(G), Random(G) > : x in { 1..500}  };
Time: 9.769
```

<a id="tame"></a>
<a id="chaptamegenus"></a>
### $p$-Groups of Tame Genus

The `TameGenus` package contains polynomial-time algorithms to decide isomorphism, construct automorphism groups, and build canonical labels of a class of $p$-groups of nilpotency class $2$ and exponent $p$. We say such groups have *tame genus*, and we provide a function called `IsTameGenusGroup` to check whether the functions in `TameGenus` can be applied to the given group. This class includes $d$-generated groups of order $p^{d + 2}$, exponent $p$, and class $2$.For definitions, theorems, and descriptions of algorithms, see [[BMW17](https://docs.magma-maths.org/references.md#cite-bmw-genus2)]. When appropriate, intrinsics for groups also work for bilinear maps (`TenSpcElt`).

#### Verbose Printing

We have included intrinsics to allow for verbose printing. The string `"TameGenus"` is now accepted by `SetVerbose` with print levels between $0$ and $2$. Level 0 turns off all printing. Level 1 will print out the steps in the algorithms, and level 2 will print timings and extra structural information along the way.

<a id="example-ex-e49bb4"></a>
##### `Example: Verbose Printing (ex-e49bb4)`

We demonstrate the verbose printing by constructing a random genus 2 group of order $3^{20 + 2}$.

```magma
> G := RandomGenus2Group(3, [4, 6, 10]);
> #G eq 3^(4 + 6 + 10 + 2);
true
> Genus(G);
2
```

With the verbose printing, we can see steps of the algorithm.

```magma
> SetVerbose("TameGenus", 1);
> A := TGAutomorphismGroup(G);
Extracting the p-central tensor and computing pseudo-isometries.
Checking the radicals.
        dim(Rad_V) = 0
        dim(Rad_W) = 0
Writing tensor over its centroid.
Tensor has genus 2.
Computing the adjoint algebra.
        dim(Adj) = 40
Decomposing tensor into flat and sloped subtensors.
        Block dims = [ 4, 6, 10 ]
Number of sloped blocks to lift: 3.
Field is small enough, applying Pfaffian method.
Number of flat blocks to lift: 0.
Constructing the isometry group.
   G
   |   Sp ( 2 , 3 ^ 2 )
   *
   |   Sp ( 2 , 3 ^ 3 )
   *
   |   Sp ( 2 , 3 ^ 5 )
   *
   |   3 ^ 0    (unipotent radical)
   1
Constructing automorphism group from pseudo-isometries.
```

#### Constructors

We introduce functions to construct groups of genus $\leq 2$.

<a id="function-tgrandomgroup-rngintelt-rngintelt-rngintelt"></a>
##### `TGRandomGroup(q, n, g : parameters): RngIntElt, RngIntElt, RngIntElt -> GrpPC`

```magma
Exponentp: BoolElt                    Default: true
```

Given $q=p^m$, $n>0$, and $g>0$, returns a $p$-group $G$ with genus $\leq g$ and order $q^{n+g}$. The algorithm is based on the Universal Coefficients Theorem, see [[LGM02a](https://docs.magma-maths.org/references.md#cite-lgm-book), Chapter 9] for the statement and proof. There is one optional parameter: `Exponentp`.

**(\*)**
`Exponentp`: Set to `false` if the constructor should not force exponent $p$.

<a id="example-ex-7e07d7"></a>
##### `Example: Random Groups of Tame Genus (ex-7e07d7)`

We construct a random group using the `TGRandomGroup` constructor. Specifically, we create a group $G$ with exponent $5$ such that the commutator tensor $[,]$ has centroid containing $K={\bf F}_{5^7}$ with genus at most $2$ and where $\rm{dim}_K (G/\Phi(G)) = 8$. First, we create the group.

```magma
> G := TGRandomGroup(5^7, 8, 2);
> #G eq 5^(7*(8 + 2));
true
```

We check that the genus of our group $G$ is at most 2.

```magma
> Genus(G);
2
```

We verify that the commutator tensor has a centroid containing the field of order $5^7$.

```magma
> t := pCentralTensor(G, 1, 1);
> t;
Tensor of valence 3, U2 x U1 >-> U0
U2 : Full Vector space of degree 56 over GF(5)
U1 : Full Vector space of degree 56 over GF(5)
U0 : Full Vector space of degree 28 over GF(5)
> C := Centroid(t);
> Dimension(C);
7
> IsSimple(C);
true
```

<a id="function-randomgenus2group-rngintelt-rngintelt"></a>
##### `RandomGenus2Group(q, d : parameters): RngIntElt, [RngIntElt] -> GrpPC`

```magma
Exponentp: BoolElt                    Default: true
```

Given $q=p^m$ and $d=[d_1, \dots, d_k]$, where $d_i>0$, return a genus 2 group $G$ whose commutator tensor $[,] : V\times V\rightarrowtail W$ which is ${\bf F}_{q}$-bilinear and whose $\perp$-decomposition has blocks of the prescribed dimensions $d_1,\dots,d_k$ over ${\bf F}_{q}$. Each $d_i=1$ increases the dimension of the radical of $[,]$ by 1 over ${\bf F}_{q}$. There is one optional parameter: `Exponentp`.

**(\*)**
`Exponentp`: Set to `false` if the constructor should not force exponent $p$.

<a id="example-ex-3b8b51"></a>
##### `Example: Genus 2 Groups with Prescribed Blocks (ex-3b8b51)`

Unlike the `TGRandomGroup` constructor, if we want to construct a genus 2 group with prescribed block dimensions, we can do this with `RandomGenus2Group`. If we want an elementary abelian direct factor, we can append a sequence of $1$s whose sum is the rank of such a factor. We construct a genus 2 group $G$ with an indecomposable blocks of dimensions $10$, $7$, $4$, $4$, and $1$. Therefore, $G\cong H\times {\mathbb{Z}}/(p)$, where $H$ is directly indecomposable and of order $7^{25+2}$.

```magma
> G := RandomGenus2Group(7, [10, 7, 4, 4, 1]);
> #G eq 7^(10 + 7 + 4 + 4 + 1 + 2);
true
```

We can see these blocks with the genus 2 signature of the group. See `TGSignature` for a description of the output.

```magma
> S := TGSignature(G);
> S;
[* <7, 25, 2>, <1, 0>,
    [ 7 ],
    [*
        [ 1, 0, 1 ],
        [ 1, 4, 5 ],
        [ 1, 3, 3, 2, 6, 3 ]
    *]
*]
```

<a id="function-randomgenus1group-rngintelt-rngintelt-rngintelt"></a>
##### `RandomGenus1Group(q, d, r : parameters): RngIntElt, RngIntElt, RngIntElt -> GrpPC`

```magma
Exponentp: BoolElt                    Default: true
```

Given $q=p^m$, $d>0$, and $r\geq 0$, return a group $G$ with genus 1 and of order $q^{2d+r+1}$. The center of $G$ has order $q^{r+1}$, and $G$ is $m(2d+r)$-generated. There is one optional parameter: `Exponentp`.

**(\*)**
`Exponentp`: Set to `false` if the constructor should not force exponent $p$.

<a id="example-ex-3634bf"></a>
##### `Example: Heisenberg Groups (ex-3634bf)`

The classic Heisenberg group over a field is an example of a genus 1 group, and one can generalize this construction in a number of ways. We will create a matrix group, over ${\bf F}_{81}$, as a polycyclic group.

```magma
> G := RandomGenus1Group(81, 2, 0);
> #G eq 81^(2*2 + 1);
true
```

We verify that $G$ has genus 1 and that the derived subgroup is isomorphic to $({\mathbb{Z}}/(3))^4$.

```magma
> D := DerivedSubgroup(G);
> IsElementaryAbelian(D);
true
> #D eq 3^4;
true
```

Although the underlying field ${\bf F}_{81}$ is hidden within the relations of the polycyclic presentation, we can still construct it and compute the genus over this larger field.

```magma
> Genus(G);
1
```

<a id="function-genus2group-rngupolelt"></a>
##### `Genus2Group(f): RngUPolElt -> GrpPC`

<a id="function-genus2group-rngmpolelt"></a>
##### `Genus2Group(f): RngMPolElt -> GrpPC`

Given either a univariate or homogeneous multivariate polynomial in two variables over ${\bf F}_{q}$, return a group $G$ whose commutator ${\bf F}_{q}$-tensor has a Pfaffian in the same $\Gamma\rm{L}(2,q)$-orbit as $f$.

<a id="example-ex-ff5bc5"></a>
##### `Example: Genus 2 Group from a Pfaffian (ex-ff5bc5)`

We construct the genus 2 group $G$ whose (univariate) Pfaffian is equivalent to $f(x) = x^3(x-1)^2(x-2)$ in ${\bf F}_{9}[x]$. Therefore, we expect $|G|=9^{2\cdot 6 + 2}$.

```magma
> P<x> := PolynomialRing(GF(9));
> f := x^3*(x-1)^2*(x-2);
> G := Genus2Group(f);
> #G eq 9^(2*6 + 2);
true
```

The genus 2 signature reveals the block structure. All six $\perp$-indecomposable subspaces are $2$-dimensional.

```magma
> S := TGSignature(G);
> S;
[* <9, 12, 2>, <0, 0>,
    [],
    [*
        [ 1, 1 ],
        [ 1, 0, 0 ],
        [ 0, 0, 0, 1 ]
    *]
*]
```

The output shows that the homogenization of $f$ is equivalent to the polynomial $g(x,y) = x^2y^3(x+y)$ in ${\bf F}_{q}[x,y]$.

#### Direct Indecomposability

Determining the genus of a group $G$ requires knowing the direct indecomposable factors of $G$, so there are functions to decide if $G$ is indecomposable.

<a id="function-isindecomposable-grppc"></a>
##### `IsIndecomposable(G): GrpPC -> BoolElt`

Given a group $G$, decide if $G$ is directly indecomposable. This algorithm is based on algorithms by Wilson in [[Wil12](https://docs.magma-maths.org/references.md#cite-wilson-decomposable)].

<a id="function-isindecomposable-tenspcelt"></a>
##### `IsIndecomposable(t): TenSpcElt -> BoolElt`

Given a tensor $t$, decide if $t$ is directly indecomposable. This algorithm is based on algorithms by Wilson in [[Wil12](https://docs.magma-maths.org/references.md#cite-wilson-decomposable)].

<a id="example-ex-3b99f7"></a>
##### `Example: Decomposable Groups (ex-3b99f7)`

We create a decomposable genus 2 group from the `TameGenus` constructors. For example, the group $G$ with a Pfaffian equivalent to $xy$ is decomposable.

```magma
> P<x, y> := PolynomialRing(GF(7), 2);
> f := x*y;
> G := Genus2Group(f);
> G;
GrpPC : G of order 117649 = 7^6
PC-Relations:
G.3^G.1 = G.3 * G.5,
G.4^G.2 = G.4 * G.6
> IsIndecomposable(G);
false
```

This example also shows that `TGRandomGroup` may return a group that is directly decomposable.

<a id="example-ex-f8f20b"></a>
##### `Example: Indecomposable Central Products (ex-f8f20b)`

We create a directly indecomposable group $G$ that is a central product of two genus 2 groups.

```magma
> G := RandomGenus2Group(5, [3, 4]);
> #G eq 5^(3 + 4 + 2);
true
> IsIndecomposable(G);
true
```

We observe the central factors from the genus 2 signature of $G$. We see that $G$ is a central product of genus 2 groups of order $5^5$ and $5^6$.

```magma
> TGSignature(G);
[* <5, 7, 2>, <0, 0>,
    [ 3 ],
    [*
        [ 1, 0, 2 ]
    *]
*]
```

#### Genus

<a id="function-genus-grppc"></a>
##### `Genus(G): GrpPC -> RngIntElt`

Given a directly indecomposable $p$-group $G$, return the genus of $G$ as defined in [[BMW17](https://docs.magma-maths.org/references.md#cite-bmw-genus2)].

<a id="function-genus-tenspcelt"></a>
##### `Genus(t): TenSpcElt -> RngIntElt`

Given a directly indecomposable tensor $t: V\times V\rightarrowtail W$, return the rank of $W$ as a $C$-module. Only implemented for algebras $C$ such that $C/J(C)$ is simple, where $J(C)$ is the Jacobson radical.

<a id="example-ex-40dc90"></a>
##### `Example: Genus of Small Groups (ex-40dc90)`

We determine the genus of some groups in the Small Group library. Let $G$ be the group of order $3^6$ with ID number 440. Its derived subgroup is isomorphic to $({\mathbb{Z}}/(3))^2$, and $G$ is genus 2.

```magma
> G := SmallGroup(3^6, 440);
> #DerivedSubgroup(G) eq 3^2;
true
> IsElementaryAbelian(DerivedSubgroup(G));
true
> Genus(G);
2
```

Let $H$ be the group of order $3^6$ with ID number 469. Its derived subgroup is isomorphic to $({\mathbb{Z}}/(3))^2$ also, but $H$ is genus 1.

```magma
> H := SmallGroup(3^6, 469);
> #DerivedSubgroup(H) eq 3^2;
true
> IsElementaryAbelian(DerivedSubgroup(H));
true
> Genus(H);
1
```

We can see this difference in genus in multiple ways. If we extract the commutator tensor from both groups, one is bilinear over a quadratic field extension where the other tensor is not. The algebra that records this is the centroid of a tensor, see `Centroid`.

```magma
> s := pCentralTensor(G, 1, 1);
> t := pCentralTensor(H, 1, 1);
> C_G := Centroid(s);
> C_H := Centroid(t);
> C_G;
Matrix Algebra of degree 6 with 2 generators over GF(3)
> C_H;
Matrix Algebra of degree 6 with 2 generators over GF(3)
```

The centroid associated to the tensor $s$ is $2$-dimensional but with a nontrivial Jacobson radical. The centroid associated to the tensor $t$ is $2$-dimensional and a simple ${\bf F}_{3}$-algebra.

```magma
> Dimension(C_G);
2
> Dimension(C_H);
2
> WedderburnDecomposition(C_G);
Matrix Algebra of degree 6 with 1 generator over GF(3)
Matrix Algebra of degree 6 with 1 generator over GF(3)
> IsSimple(C_H);
true
```

<a id="function-istamegenusgroup-group"></a>
##### `IsTameGenusGroup(G): Group -> BoolElt`

Decides if the functions in the `TameGenus` package (prefixed with `TG`) can be applied to the given group $G$.

<a id="function-istamegenustensor-tenspcelt"></a>
##### `IsTameGenusTensor(t): TenSpcElt -> BoolElt`

Decides if the functions in the `TameGenus` package (prefixed with `TG`) can be applied to the given tensor $t$.

<a id="example-ex-da6133"></a>
##### `Example: Group Not of Tame Genus (ex-da6133)`

We create a group that is not covered by the `TameGenus` package. The small groups of order $3^6$ with IDs 440 and 469 both have tame genus: 2 and 1 respectively. The direct product of the two groups has genus 2, but because the group is not directly indecomposable, the current implementation of `TameGenus` cannot handle it.

```magma
> H1 := SmallGroup(3^6, 440);
> H2 := SmallGroup(3^6, 469);
> G := DirectProduct(H1, H2);
> G;
GrpPC : G of order 531441 = 3^12
PC-Relations:
    G.2^G.1 = G.2 * G.5,
    G.3^G.1 = G.3 * G.6,
    G.3^G.2 = G.3 * G.5,
    G.4^G.1 = G.4 * G.5,
    G.8^G.7 = G.8 * G.11,
    G.9^G.7 = G.9 * G.12,
    G.9^G.8 = G.9 * G.11^2 * G.12,
    G.10^G.7 = G.10 * G.11 * G.12,
    G.10^G.8 = G.10 * G.11
> IsTameGenusGroup(G);
false
```

<a id="example-ex-063b44"></a>
##### `Example: Filtering Small Groups by Tame Genus (ex-063b44)`

We use the `IsTameGenusGroup` to filter large databases down to the ones covered by `TameGenus`. We do that with the Small Group library for groups of order $3^6$, and we find there are seven such groups. Recall, that these groups must have prime exponent.

```magma
> G2_SG := [*G : G in SmallGroups(3^6) | IsTameGenusGroup(G)*];
> #G2_SG;
7
```

We further filter these groups based on their genus, and we find that there are six groups of positive genus and one abelian group.

```magma
> G1 := [*G : G in G2_SG | Genus(G) eq 1*];
> G2 := [*G : G in G2_SG | Genus(G) eq 2*];
> #G1;
3
> #G2;
3
```

We determine the tame genus signatures to show that all these groups yield different signatures. We first consider the genus 1 groups.

```magma
> for G in G1 do
>     TGSignature(G);
> end for;
[* <9, 2, 1>, <0, 0>, [* *], [* *] *]
[* <3, 2, 1>, <3, 0>, [* *], [* *] *]
[* <3, 4, 1>, <1, 0>, [* *], [* *] *]
```

The genus 2 groups have the following signatures.

```magma
> for G in G2 do
>     TGSignature(G);
> end for;
[* <3, 3, 2>, <1, 0>,
    [ 3 ],
    [* *]
*]
[* <3, 4, 2>, <0, 0>,
    [],
    [*
        [ 0, 0, 1 ]
    *]
*]
[* <3, 4, 2>, <0, 0>,
    [],
    [*
        [ 1, 0 ],
        [ 0, 1 ]
    *]
*]
```

#### Isomorphism

<a id="function-tgisisomorphic-grppc-grppc"></a>
##### `TGIsIsomorphic(G, H : parameters): GrpPC, GrpPC -> BoolElt`

```magma
Cent        : BoolElt                      Default: true
Constructive: BoolElt                      Default: true
Method      : RngIntElt                    Default: 0
```

Given class $\leq 2$, exponent $p$, directly indecomposable odd-ordered $p$-groups $G$ and $H$ of genus $\leq 2$, decide if $G\cong H$. This will accept groups $G$ of the form $G\cong A\times K$, where $A$ is abelian and $K$ is directly indecomposable. There are three optional parameters: `Cent`, `Constructive`, and `Method`.

**(\*)**
`Cent`: If $G$ and $H$ are known to have genus $\leq 2$ over the prime field, then set to `false` to save some time.

**(\*)**
`Constructive`: Set to `false` if an explicit isomorphism is not needed.

**(\*)**
`Method`: Input from $\{ 0,1,2\}$ is acceptable. This determines the method for handling the sloped part of the tensor. If the adjoint-tensor method should be used, set to $1$. If the Pfaffian method should be used, set to $2$. The default will try to find the optimal method based on the input; see [[BMW17](https://docs.magma-maths.org/references.md#cite-bmw-genus2)] for details.

<a id="example-ex-13bda5"></a>
##### `Example: Isomorphism Testing (ex-13bda5)`

We create an isomorphic pair of groups in two different ways, and then we construct an isomorphism between the two. This example can be seen as verifying Theorem 1.1 of [[LM18](https://docs.magma-maths.org/references.md#cite-lm-semi-extraspecial)]. We construct groups $G$ and $H$ from two random irreducible cubic polynomials in ${\bf F}_{67}[x]$.

```magma
> f := RandomIrreduciblePolynomial(GF(67), 3);
> g := RandomIrreduciblePolynomial(GF(67), 3);
> f, g;
$.1^3 + 36*$.1^2 + 26*$.1 + 33
$.1^3 + 57*$.1^2 + 24*$.1 + 65
> G := Genus2Group(f);
> H := Genus2Group(g);
```

In this case, the default method will run the adjoint-tensor method. We can see this if we turn on verbose printing.

```magma
> SetVerbose("TameGenus", 1);
> isomorphic, phi := TGIsIsomorphic(G, H);
Extracting p-central tensors and deciding pseudo-isometry.
Checking the radicals.
        dim(Rad_V) = 0
        dim(Rad_W) = 0
Checking the radicals.
        dim(Rad_V) = 0
        dim(Rad_W) = 0
Writing tensor over its centroid.
Writing tensor over its centroid.
Computing the adjoint algebra.
        dim(Adj_s) = 12
        dim(Adj_t) = 12
Computing the adjoint algebra.
Genus 2 case.
Decomposing tensors into flat and sloped subtensors.
        Block dims = [ 6 ]
PGammaL is larger than symmetric group, applying adjoint-tensor method.
```

We see that the two groups are isomorphic, and $\phi$ is such an isomorphism.

```magma
> isomorphic;
true
> phi;
Homomorphism of GrpPC : G into GrpPC : H induced by
    G.1 |--> H.1 * H.2^41 * H.3^30 * H.4^58 * H.5^43 * H.6^30
    G.2 |--> H.1^53 * H.2^4 * H.3^34 * H.4^54 * H.5^6 * H.6^25
    G.3 |--> H.1^5 * H.2^7 * H.3^49 * H.4^52 * H.5^21 * H.6^7
    G.4 |--> H.1^30 * H.2^4 * H.3^17 * H.4^53 * H.5^40 * H.6^9
    G.5 |--> H.1^14 * H.2^21 * H.3^30 * H.4^24 * H.5^38 * H.6^34
    G.6 |--> H.1^47 * H.2^46 * H.3^66 * H.4^65 * H.5^30 * H.6^30
    G.7 |--> H.7^10 * H.8^18
    G.8 |--> H.7^54 * H.8^12
```

To run the Pfaffian test, set the `Method` to 2. This method is noticeably slower for these groups and should not be used for very large primes.

```magma
> isomorphic, phi2 := TGIsIsomorphic(G, H : Method := 2);
Extracting p-central tensors and deciding pseudo-isometry.
Checking the radicals.
        dim(Rad_V) = 0
        dim(Rad_W) = 0
Checking the radicals.
        dim(Rad_V) = 0
        dim(Rad_W) = 0
Writing tensor over its centroid.
Writing tensor over its centroid.
Computing the adjoint algebra.
        dim(Adj_s) = 12
        dim(Adj_t) = 12
Computing the adjoint algebra.
Genus 2 case.
Decomposing tensors into flat and sloped subtensors.
        Block dims = [ 6 ]
Method set to Pfaffian.
> phi2;
Homomorphism of GrpPC : G into GrpPC : H induced by
    G.1 |--> H.1^47 * H.2^54 * H.3^54
    G.2 |--> H.1^63 * H.2^33 * H.3^15
    G.3 |--> H.1^26 * H.2^3 * H.3^60
    G.4 |--> H.4^44 * H.5^61 * H.6^16
    G.5 |--> H.4^66 * H.5^26 * H.6^36
    G.6 |--> H.4^57 * H.5^6 * H.6^30
    G.7 |--> H.7^62 * H.8^42
    G.8 |--> H.7^18 * H.8^58
```

<a id="function-tgispseudoisometric-tenspcelt-tenspcelt"></a>
##### `TGIsPseudoIsometric(s, t : parameters): TenSpcElt, TenSpcElt -> BoolElt, Hmtp`

```magma
Cent        : BoolElt                      Default: true
Constructive: BoolElt                      Default: true
Method      : RngIntElt                    Default: 0
```

Given directly indecomposable, alternating tensors $s, t : V\times V \rightarrowtail W$, where $V$ and $W$ are ${\bf F}_{q}$-vector spaces of odd order, decide if $s$ is pseudo-isometric to $t$. This will accept tensors with nontrivial radicals and coradicals. There are three optional parameters: `Cent`, `Constructive`, and `Method`.

**(\*)**
`Cent`: If $G$ and $H$ are known to have genus $\leq 2$ over the prime field, then set to `false` to save some time.

**(\*)**
`Constructive`: Set to `false` if an explicit isomorphism is not needed.

**(\*)**
`Method`: Input from $\{ 0,1,2\}$ is acceptable. This determines the method for handling the sloped part of the tensor. If the adjoint-tensor method should be used, set to $1$. If the Pfaffian method should be used, set to $2$. The default will try to find the optimal method based on the input; see [[BMW17](https://docs.magma-maths.org/references.md#cite-bmw-genus2)] for details.

<a id="example-ex-e03ee8"></a>
##### `Example: Pseudo-Isometric Tensors (ex-e03ee8)`

A pair of alternating matrices determines a tensor of tame genus. We construct a pair of pseudo-isometric tensors by applying a change of bases map. This is essentially how Experiment A from [[BMW17](https://docs.magma-maths.org/references.md#cite-bmw-genus2)] was conducted. Generating random $50\times 50$ matrices over ${\bf F}_{3}$, we construct two tensors $s,t : {\bf F}_{3}^{50} \times {\bf F}_{3}^{50}\rightarrowtail{\bf F}_{3}^2$.

```magma
> M := RandomMatrix(GF(3), 50, 50);
> N := RandomMatrix(GF(3), 50, 50);
> Forms1 := [M - Transpose(M), N - Transpose(N)];
> s := Tensor(Forms1, 2, 1);
> s;
Tensor of valence 3, U2 x U1 >-> U0
U2 : Full Vector space of degree 50 over GF(3)
U1 : Full Vector space of degree 50 over GF(3)
U0 : Full Vector space of degree 2 over GF(3)
> IsAlternating(s);
true
```

We construct a random invertible co-homotopism $\varphi = (\varphi_1, \varphi_0)$ such that $\varphi_1\in {\operatorname{GL}}(50, 3)$ and $\varphi_0\in{\operatorname{GL}}(2, 3)$. We define a new and pseudo-isometric tensor $t=s^{\varphi}$ in this way.

```magma
> X := Random(GL(50, 3));
> Y := Random(GL(2, 3));
> Maps := [*X, X, Y*];
> H := Homotopism(Maps, CohomotopismCategory(3));
> t := s @ H;
> t;
Tensor of valence 3, U2 x U1 >-> U0
U2 : Full Vector space of degree 50 over GF(3)
U1 : Full Vector space of degree 50 over GF(3)
U0 : Full Vector space of degree 2 over GF(3)
> s eq t;
false
```

We verify that both $s$ and $t$ are pseudo-isometric, and since we do not need to write these tensors over their centroid, we avoid that step by setting `Cent` to `false`.

```magma
> pisometric, Phi := TGIsPseudoIsometric(s, t : Cent :=false);
> pisometric;
true
> Phi.0;
[0 1]
[2 2]
```

#### Automorphism Groups

<a id="function-tgautomorphismgroup-grppc"></a>
##### `TGAutomorphismGroup(G : parameters): GrpPC -> GrpAuto`

```magma
Cent  : BoolElt                      Default: true
Method: RngIntElt                    Default: 0
Mat   : BoolElt                      Default: false
```

Given a directly indecomposable odd-ordered $p$-group $G$, of class $\leq 2$, exponent $p$, and genus $\leq 2$, return ${\operatorname{Aut}}(G)$. This will accept groups $G$ of the form $G\cong A\times K$, where $A$ is abelian and $K$ is directly indecomposable. This intrinsic provides three optional parameters: `Cent`, `Method`, and `Mat`.

**(\*)**
`Cent`: If $G$ and $H$ are known to have genus $\leq 2$ over the prime field, then set to `false` to save some time.

**(\*)**
`Method`: Input from $\{ 0,1,2\}$ is acceptable. This determines the method for handling the sloped part of the tensor. If the adjoint-tensor method should be used, set to $1$. If the Pfaffian method should be used, set to $2$. The default will try to find the optimal method based on the input; see [[BMW17](https://docs.magma-maths.org/references.md#cite-bmw-genus2)] for details.

**(\*)**
`Mat`: Set to `true` for a linear representation of the automorphism group. The row vectors of the matrix correspond to the given polycyclic vectors from the polycyclic presentation.

<a id="example-ex-36d32b"></a>
##### `Example: Automorphisms of a Flat Indecomposable Group (ex-36d32b)`

We build a flat indecomposable genus 2, $p$-group $G$ and construct its automorphism group. We know that ${\operatorname{Aut}}(G)$ maps surjectivity onto ${\operatorname{GL}}(2, p)$, so we verify that $|{\operatorname{Aut}}(G)|$ is divisible by $|{\operatorname{GL}}(2, p)| = (p^2-1)(p^2-p)$. This corresponds to the quotient of the pseudo-isometry group by the isometry group.

```magma
> p := 541;
> G := RandomGenus2Group(p, [29]);
> #G eq p^(29 + 2);
true
> A := TGAutomorphismGroup(G);
> IsDivisibleBy(#A, #GL(2, p));
true
```

The isometry group of the corresponding commutator tensor has an elementary abelian unipotent radical of rank $28$, and so is isomorphic to an extension of ${\operatorname{GL}}(1, p)$ by $({\mathbb{Z}}/(p))^{28}$, as seen in [[BW12b](https://docs.magma-maths.org/references.md#cite-bw-isometry)]. Therefore, we verify that we have constructed all automorphisms as

$$
|{\operatorname{Aut}}(G)| = (p - 1)p^{28} \cdot (p^2-1)(p^2-p) \cdot p^{29\cdot 2}.
$$

```magma
> #A eq (p - 1)*p^28 * (p^2 - 1)*(p^2 - p) * p^(29*2);
true
```

<a id="function-tgpseudoisometrygroup-tenspcelt"></a>
##### `TGPseudoIsometryGroup(t : parameters): TenSpcElt -> GrpMat`

```magma
Cent  : BoolElt                      Default: true
Method: RngIntElt                    Default: 0
```

Given a directly indecomposable, alternating tensor $t : V \times V \rightarrowtail W$, where $V$ and $W$ are ${\bf F}_{q}$-vector spaces for odd $q$, return the pseudo-isometry group of $t$ as a subgroup of ${\operatorname{GL}}(V)\times {\operatorname{GL}}(W)$. This accepts tensors with nontrivial radicals and coradicals. This intrinsic provides two optional parameters: `Cent` and `Method`.

**(\*)**
`Cent`: If $G$ and $H$ are known to have genus $\leq 2$ over the prime field, then set to `false` to save some time.

**(\*)**
`Method`: Input from $\{ 0,1,2\}$ is acceptable. This determines the method for handling the sloped part of the tensor. If the adjoint-tensor method should be used, set to $1$. If the Pfaffian method should be used, set to $2$. The default will try to find the optimal method based on the input; see [[BMW17](https://docs.magma-maths.org/references.md#cite-bmw-genus2)] for details.

<a id="example-ex-35a1af"></a>
##### `Example: Tensors over an Extension Field (ex-35a1af)`

For $K$-vector spaces $V$ and $W$, we create a genus 2 alternating tensor $t: V \times V\rightarrowtail W$ such that $t$ is bilinear over an extension field $E/K$ and $\rm{dim}_E(W)=2$. One way to do this is with the constructors `RandomGenus2Group` and `pCentralTensor`.

```magma
> G := RandomGenus2Group(3^2, [6]);
> t := pCentralTensor(G, 1, 1);
> t;
Tensor of valence 3, U2 x U1 >-> U0
U2 : Full Vector space of degree 12 over GF(3)
U1 : Full Vector space of degree 12 over GF(3)
U0 : Full Vector space of degree 4 over GF(3)
> Genus(t);
2
```

The Pfaffian of $t$ is an irreducible cubic over ${\bf F}_{9}$, so computing its pseudo-isometry group may contain elements of $\rm{Gal}({\bf F}_{9})$.

```magma
> PI := TGPseudoIsometryGroup(t);
> Random(PI);
[0 1 0 0 0 2 1 1 0 2 1 0 0 0 0 0]
[2 0 0 0 1 0 0 2 1 0 1 2 0 0 0 0]
[1 1 0 0 0 1 1 1 0 0 2 1 0 0 0 0]
[0 2 0 0 2 0 0 2 0 0 1 1 0 0 0 0]
[1 2 2 0 0 2 2 2 1 0 0 0 0 0 0 0]
[2 2 2 1 1 0 0 1 1 2 0 0 0 0 0 0]
[2 2 2 0 1 0 1 0 2 2 1 2 0 0 0 0]
[0 1 2 1 1 2 1 2 0 1 2 2 0 0 0 0]
[2 0 1 0 2 2 2 1 1 1 0 0 0 0 0 0]
[2 1 1 2 0 1 1 1 0 2 0 0 0 0 0 0]
[0 2 0 1 2 2 1 1 0 1 1 0 0 0 0 0]
[1 0 2 0 0 1 0 2 2 0 1 2 0 0 0 0]
[0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0]
[0 0 0 0 0 0 0 0 0 0 0 0 2 0 1 2]
[0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0]
[0 0 0 0 0 0 0 0 0 0 0 0 0 2 0 0]
> Factorization(#PI);
[ <2, 8>, <3, 7>, <5, 1>, <7, 1>, <13, 1>, <73, 1> ]
```

Indeed, the pseudo-isometry group may not be linear over the centroid but semi-linear. To see the discrepancy, we rewrite $t$ over its centroid and determine its pseudo-isometry group as a subgroup of ${\operatorname{GL}}_E(V)\times {\operatorname{GL}}_E(W)$. Note that this group is smaller by a factor of $2$. We see that the pseudo-isometry group of $t$ is strictly semi-linear over ${\bf F}_{9}$, as there exists a Galois involution.

```magma
> s := TensorOverCentroid(t);
> s;
Tensor of valence 3, U2 x U1 >-> U0
U2 : Full Vector space of degree 6 over GF(3^2)
U1 : Full Vector space of degree 6 over GF(3^2)
U0 : Full Vector space of degree 2 over GF(3^2)
> PI_C := TGPseudoIsometryGroup(s);
> Random(PI_C);
[    1 $.1^7     1 $.1^2 $.1^2 $.1^5     0     0]
[  $.1     2 $.1^7 $.1^3 $.1^6 $.1^5     0     0]
[$.1^7 $.1^2 $.1^7     1 $.1^6 $.1^2     0     0]
[$.1^7 $.1^7 $.1^7 $.1^3 $.1^7     1     0     0]
[    2 $.1^6 $.1^3 $.1^2 $.1^3     0     0     0]
[$.1^7   $.1 $.1^7 $.1^6 $.1^6 $.1^7     0     0]
[    0     0     0     0     0     0     2 $.1^7]
[    0     0     0     0     0     0 $.1^3 $.1^5]
> Factorization(#PI_C);
[ <2, 7>, <3, 7>, <5, 1>, <7, 1>, <13, 1>, <73, 1> ]
```

#### Canonical Labelling

<a id="function-tgsignature-grppc"></a>
##### `TGSignature(G): GrpPC -> List`

Given an odd-ordered $p$-group $G\cong A \times H$ of genus $\leq 2$, class $\leq 2$, and exponent $p$, return the canonical tame genus signature as a list with four entries. For groups with genus $\leq 1$, the last two entries will be empty. We describe the entries.

**(1)**
The first is a triple of three integers $(q, d, e)$ such that associated fully nondegenerate commutator tensor of $H$ has the form ${\bf F}_{q}^d\times {\bf F}_{q}^d\rightarrowtail {\bf F}_{q}^e$. Here, ${\bf F}_{q}$ is the largest field $F$ which the commutator tensor is $F$-bilinear.

**(2)**
The second entry is a pair of integers $(r, c)$, where $A \cong ({\mathbb{Z}}/(p))^r$ and $c=0$.

**(3)**
The third entry is a sequence of odd integers corresponding to the dimensions of the flat indecomposable spaces.

**(4)**
The fourth and last entry is a list sequences in ${\bf F}_{q}$ of possibly different lengths. A sequence $[c_1,\dots, c_{d+1}]$ in the second entry corresponds to the coefficients of the homogeneous polynomial in $x$ and $y$ in degree $d$:

$$
c_1x^d + c_2 x^{d-1}y + c_3 x^{d-2}y^2 + \cdots + c_{d+1}y^d.
$$

Because this is a canonical label, two groups are isomorphic if, and only if, their tame genus signatures are equal. See [[BMW17](https://docs.magma-maths.org/references.md#cite-bmw-genus2)] for details on how the last two entries describe a genus 2 group.

<a id="function-tgsignature-tenspcelt"></a>
##### `TGSignature(t): TenSpcElt -> List`

Given an alternating, directly indecomposable tensor $t:V\times V\rightarrowtail W$ of genus $\leq 2$, where $V$ and $W$ are ${\bf F}_{q}$-vector spaces for odd $q$, return the canonical tame genus signature as a list with four entries. For tensors with genus $\leq 1$, the last two entries will be empty. We describe the entries.

**(1)**
The first is a triple of three integers $(q^f, d, e)$ such that associated fully nondegenerate tensor of $t$ has the form ${\bf F}_{q^f}^d\times {\bf F}_{q^f}^d\rightarrowtail {\bf F}_{q^f}^e$. Here, ${\bf F}_{q^f}$ is the largest field $F$ which the associated fully nondegenerate tensor is $F$-bilinear.

**(2)**
The second entry is a pair of integers $(r, c)$, where the radical of $t$ is $r$-dimensional and the codimension of the image of $t$ in $W$ is $c$, both are determined over ${\bf F}_{q}$.

**(3)**
The third entry is a sequence of odd integers corresponding to the dimensions of the flat indecomposable spaces.

**(4)**
The fourth and last entry is a list sequences in ${\bf F}_{q}$ of possibly different lengths. A sequence $[c_1,\dots, c_{d+1}]$ in the second entry corresponds to the coefficients of the homogeneous polynomial in $x$ and $y$ in degree $d$:

$$
c_1x^d + c_2 x^{d-1}y + c_3 x^{d-2}y^2 + \cdots + c_{d+1}y^d.
$$

Because this is a canonical label, two tensors are pseudo-isometric if, and only if, their tame genus signatures are equal. See [[BMW17](https://docs.magma-maths.org/references.md#cite-bmw-genus2)] for details on how the last two entries describe a genus 2 tensor.

<a id="example-ex-bbc04e"></a>
##### `Example: Canonical Labels with Many Blocks (ex-bbc04e)`

We construct a genus 2 group $G\cong A \times H$, where $A$ is abelian and $H$ is directly indecomposable but is the central product of many smaller genus 2 groups.

```magma
> blocks := [1, 1, 1, 2, 2, 3, 3, 5, 6];
> G := RandomGenus2Group(9, blocks);
> #G eq 9^(&+blocks + 2);
true
```

Because $G$ was created with the field ${\bf F}_{9}$ and since there are three $1$-dimensional blocks, we expect $|A| = 9^3 = 3^6$.

```magma
> TGSignature(G);
[* <9, 21, 2>, <6, 0>,
    [ 3, 3, 5 ],
    [*
        [ 0, 1 ],
        [ 1, 1 ],
        [ 1, 2, 2, 2 ]
    *]
*]
```

The first entry of this list tells us that the group $H$ has order $9^{21 + 2}$ and that the commutator tensor of $H$ is ${\bf F}_{9}$-bilinear. The second entry reports that $A\cong ({\mathbb{Z}}/(3))^6$. The third and fourth entries show that $H$ is a central product of six indecomposable groups: three flats of orders $9^{3+2}$, $9^{3+2}$, and $9^{5+2}$, and three sloped with Pfaffians in ${\bf F}_{9}[x,y]$ equivalent to

$$
y, x + y, x^3 + 2x^2y + 2xy^2 + 2y^3.
$$

<a id="example-ex-15bce1"></a>
##### `Example: Tame Genus Signatures of Small Groups (ex-15bce1)`

We run through all the small groups of order $3^7$ and determine their tame genus signatures. There are $9310$ such groups, and $10$ of them are covered by `TameGenus`.

```magma
> TG_SG := SmallGroupProcess(3^7, IsTameGenusGroup);
>
> repeat
>     G := Current(TG_SG);
>     _, ID := CurrentLabel(TG_SG);
>     print "Small group ID:", ID;
>     TGSignature(G);
>     Advance(~TG_SG);
> until IsEmpty(TG_SG);
```

The loop yields the following output.

```magma
Small group ID: 9106
[* <3, 3, 2>, <2, 0>,
    [ 3 ],
    [* *]
*]
Small group ID: 9107
[* <3, 4, 2>, <1, 0>,
    [],
    [*
        [ 1, 0 ],
        [ 0, 1 ]
    *]
*]
Small group ID: 9108
[* <3, 4, 2>, <1, 0>,
    [],
    [*
        [ 0, 0, 1 ]
    *]
*]
Small group ID: 9109
[* <9, 2, 1>, <1, 0>, [* *], [* *] *]
Small group ID: 9110
[* <3, 5, 2>, <0, 0>,
    [ 3 ],
    [*
        [ 0, 1 ]
    *]
*]
Small group ID: 9111
[* <3, 5, 2>, <0, 0>,
    [ 5 ],
    [* *]
*]
Small group ID: 9302
[* <3, 2, 1>, <4, 0>, [* *], [* *] *]
Small group ID: 9305
[* <3, 4, 1>, <2, 0>, [* *], [* *] *]
Small group ID: 9308
[* <3, 6, 1>, <0, 0>, [* *], [* *] *]
Small group ID: 9310
[* <3, 7, 0>, <7, 0>, [* *], [* *] *]
```

<a id="blackbox"></a>
<a id="chapgrpbb"></a>
## Black-Box Groups

- [Introduction](https://docs.magma-maths.org/FiniteGroups/BlackBoxGroups/introduction.md)
- [Construction of an SLP-Group and its Elements](https://docs.magma-maths.org/FiniteGroups/BlackBoxGroups/creation.md)
  - [Structure Constructors](https://docs.magma-maths.org/FiniteGroups/BlackBoxGroups/creation.md#structure-constructors)
    - [`NaturalBlackBoxGroup(H): Grp → GrpBB`](https://docs.magma-maths.org/FiniteGroups/BlackBoxGroups/creation.md#function-naturalblackboxgroup-grp)
  - [Construction of an Element](https://docs.magma-maths.org/FiniteGroups/BlackBoxGroups/creation.md#construction-of-an-element)
    - [`Identity(G): GrpBB → GrpBBElt`](https://docs.magma-maths.org/FiniteGroups/BlackBoxGroups/creation.md#function-identity-grpbb)
    - [`Id(G): GrpBB → GrpBBElt`](https://docs.magma-maths.org/FiniteGroups/BlackBoxGroups/creation.md#function-id-grpbb)
    - [`G ! 1: GrpBB, RngIntElt → GrpBBElt`](https://docs.magma-maths.org/FiniteGroups/BlackBoxGroups/creation.md#operation-op-grpbb-rngintelt)
- [Arithmetic with Elements](https://docs.magma-maths.org/FiniteGroups/BlackBoxGroups/operation.md)
  - [`u * v: GrpBBElt, GrpBBElt → GrpBBElt`](https://docs.magma-maths.org/FiniteGroups/BlackBoxGroups/operation.md#operation-op-times-grpbbelt-grpbbelt)
  - [`u ^ m: GrpBBElt, RngIntElt → GrpBBElt`](https://docs.magma-maths.org/FiniteGroups/BlackBoxGroups/operation.md#operation-op-pow-grpbbelt-rngintelt)
  - [`u ^ v: GrpBBElt, GrpBBElt → GrpBBElt`](https://docs.magma-maths.org/FiniteGroups/BlackBoxGroups/operation.md#operation-op-pow-grpbbelt-grpbbelt)
  - [`(u, v): GrpBBElt, GrpBBElt → GrpBBElt`](https://docs.magma-maths.org/FiniteGroups/BlackBoxGroups/operation.md#literal-literal-u-v-grpbbelt-grpbbelt-grpbbelt)
  - [Accessing the Defining Generators](https://docs.magma-maths.org/FiniteGroups/BlackBoxGroups/operation.md#accessing-the-defining-generators)
    - [`G . i: GrpBB, RngIntElt → GrpBBElt`](https://docs.magma-maths.org/FiniteGroups/BlackBoxGroups/operation.md#operation-operation-grpbb-rngintelt-grpbbelt)
    - [`Generators(G): GrpBB → { GrpBBElt}`](https://docs.magma-maths.org/FiniteGroups/BlackBoxGroups/operation.md#function-generators-grpbb)
    - [`NumberOfGenerators(G): GrpBB → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/BlackBoxGroups/operation.md#function-numberofgenerators-grpbb)
    - [`Ngens(G): GrpBB → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/BlackBoxGroups/operation.md#function-ngens-grpbb)
- [Operations on Elements](https://docs.magma-maths.org/FiniteGroups/BlackBoxGroups/operation-element.md)
  - [Equality and Comparison](https://docs.magma-maths.org/FiniteGroups/BlackBoxGroups/operation-element.md#equality-and-comparison)
    - [`u eq v: GrpBBElt, GrpBBElt → BoolElt`](https://docs.magma-maths.org/FiniteGroups/BlackBoxGroups/operation-element.md#operation-op-eq-grpbbelt-grpbbelt)
    - [`u ne v: GrpBBElt, GrpBBElt → BoolElt`](https://docs.magma-maths.org/FiniteGroups/BlackBoxGroups/operation-element.md#operation-op-ne-grpbbelt-grpbbelt)
  - [Attributes of Elements](https://docs.magma-maths.org/FiniteGroups/BlackBoxGroups/operation-element.md#attributes-of-elements)
    - [`Parent(u): GrpBBElt → GrpBB`](https://docs.magma-maths.org/FiniteGroups/BlackBoxGroups/operation-element.md#function-parent-grpbbelt)
    - [`UnderlyingElement(u): GrpBBElt → GrpElt`](https://docs.magma-maths.org/FiniteGroups/BlackBoxGroups/operation-element.md#function-underlyingelement-grpbbelt)
    - [`Order(u): GrpBBElt → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/BlackBoxGroups/operation-element.md#function-order-grpbbelt)
    - [Example: Standard Generators of M24](https://docs.magma-maths.org/FiniteGroups/BlackBoxGroups/operation-element.md#example-ex-124120)
- [Set-Theoretic Operations](https://docs.magma-maths.org/FiniteGroups/BlackBoxGroups/set.md)
  - [Membership and Equality](https://docs.magma-maths.org/FiniteGroups/BlackBoxGroups/set.md#membership-and-equality)
    - [`g in G: GrpBBElt, GrpBB → BoolElt`](https://docs.magma-maths.org/FiniteGroups/BlackBoxGroups/set.md#operation-op-in-grpbbelt-grpbb)
  - [Set Operations](https://docs.magma-maths.org/FiniteGroups/BlackBoxGroups/set.md#set-operations)
    - [`PseudoRandom(G): GrpBB → GrpBBElt`](https://docs.magma-maths.org/FiniteGroups/BlackBoxGroups/set.md#function-pseudorandom-grpbb)
    - [`Rep(G): GrpBB → GrpBBElt`](https://docs.magma-maths.org/FiniteGroups/BlackBoxGroups/set.md#function-rep-grpbb)
  - [Coercions Between Related Groups](https://docs.magma-maths.org/FiniteGroups/BlackBoxGroups/set.md#coercions-between-related-groups)
    - [`G ! g: GrpBB, GrpBBElt → GrpBBElt`](https://docs.magma-maths.org/FiniteGroups/BlackBoxGroups/set.md#operation-op-grpbb-grpbbelt)

### Introduction

This Chapter describes the category of black-box groups (BB-groups). The name in Magma for the category of BB-groups is `GrpBB`.

### Construction of an SLP-Group and its Elements

#### Structure Constructors

Magma’s black-box groups are built on Magma’s other group types. The basic constructor takes a group and returns a corresponding black-box group. The element set of the black-box group is essentially the same as the element set of the original group, and the group operations are inherited from the original group.

<a id="function-naturalblackboxgroup-grp"></a>
##### `NaturalBlackBoxGroup(H): Grp -> GrpBB`

Construct the natural black-box group from the concrete group $H$.

#### Construction of an Element

<a id="function-identity-grpbb"></a>
##### `Identity(G): GrpBB -> GrpBBElt`

<a id="function-id-grpbb"></a>
##### `Id(G): GrpBB -> GrpBBElt`

<a id="operation-op-grpbb-rngintelt"></a>
##### `G ! 1: GrpBB, RngIntElt -> GrpBBElt`

Construct the identity element for the BB-group $G$.

### Arithmetic with Elements

<a id="operation-op-times-grpbbelt-grpbbelt"></a>
#### `u * v: GrpBBElt, GrpBBElt -> GrpBBElt`

Construct the product of elements $u$ and $v$ of the BB-group $G$.

<a id="operation-op-pow-grpbbelt-rngintelt"></a>
#### `u ^ m: GrpBBElt, RngIntElt -> GrpBBElt`

Given an integer $m$ and $u$, an element of BB-group $G$, return the element of $G$ corresponding to the $m$-th power of $u$.

<a id="operation-op-pow-grpbbelt-grpbbelt"></a>
#### `u ^ v: GrpBBElt, GrpBBElt -> GrpBBElt`

Given $u$ and $v$, elements of BB-group $G$, return the element of $G$ corresponding to the conjugate of $u$ by $v$, i.e. $v^{-1}*u*v$.

<a id="literal-literal-u-v-grpbbelt-grpbbelt-grpbbelt"></a>
#### `(u, v): GrpBBElt, GrpBBElt -> GrpBBElt`

Commutator of the elements $u$ and $v$, i.e. the element $u^{-1}*v^{-1}*u*v$. Here $u$ and $v$ must belong to the same BB-group $G$.

#### Accessing the Defining Generators

The functions described here provide access to basic information stored for a BB-group $G$.

<a id="operation-operation-grpbb-rngintelt-grpbbelt"></a>
##### `G . i: GrpBB, RngIntElt -> GrpBBElt`

The $i$-th generator for $G$.

<a id="function-generators-grpbb"></a>
##### `Generators(G): GrpBB -> { GrpBBElt}`

A set containing the generators for $G$.

<a id="function-numberofgenerators-grpbb"></a>
##### `NumberOfGenerators(G): GrpBB -> RngIntElt`

<a id="function-ngens-grpbb"></a>
##### `Ngens(G): GrpBB -> RngIntElt`

The number of generators for $B$.

### Operations on Elements

#### Equality and Comparison

<a id="operation-op-eq-grpbbelt-grpbbelt"></a>
##### `u eq v: GrpBBElt, GrpBBElt -> BoolElt`

Returns `true` if and only if the underlying concrete group elements for $u$ and $v$ are equal.

<a id="operation-op-ne-grpbbelt-grpbbelt"></a>
##### `u ne v: GrpBBElt, GrpBBElt -> BoolElt`

Returns `true` if and only if the underlying concrete group elements for $u$ and $v$ are not equal.

#### Attributes of Elements

<a id="function-parent-grpbbelt"></a>
##### `Parent(u): GrpBBElt -> GrpBB`

The parent group $G$ of the element $u$.

<a id="function-underlyingelement-grpbbelt"></a>
##### `UnderlyingElement(u): GrpBBElt -> GrpElt`

The concrete group element corresponding to the BB-group element $u$.

<a id="function-order-grpbbelt"></a>
##### `Order(u): GrpBBElt -> RngIntElt`

The order of the underlying concrete group element of $u$.

<a id="example-ex-124120"></a>
##### `Example: Standard Generators of M24 (ex-124120)`

The following function takes a black box group isomorphic to $M_{24}$ and finds standard generators. It is taken from the ATLAS of Finite Group Representations page on $M_{24}$.

```magma
> m24_standard := function(B)
> repeat a := PseudoRandom(B); until Order(a) eq 10;
> a := a ^ 5;
> repeat b := PseudoRandom(B); until Order(b) eq 15;
> b := b ^ 5;
> repeat b := b ^ PseudoRandom(B); ab := a*b;
> until Order(ab) eq 23;
> x := ab*(ab^2*b)^2*ab*b;
> if Order(x) eq 5 then b := b^-1; end if;
> return a,b;
> end function;
```

We take a group which must be $M_{24}$ and find these generators.

```magma
> G := PermutationGroup<24 |
> [ 20, 4, 10, 3, 15, 9, 7, 1, 11, 22, 21, 19, 8, 2, 24, 5,
> 12, 18, 13, 16, 14, 23, 6, 17 ],
> [ 12, 18, 3, 2, 7, 11, 5, 21, 19, 22, 23, 1, 14, 17, 10,
> 8, 4, 13, 24, 20, 9, 15, 6, 16 ]>;
> #G;
244823040
> Transitivity(G);
5
> B := NaturalBlackBoxGroup(G);
> a,b := m24_standard(B); a,b;
GrpBBElt (1, 16)(2, 22)(3, 14)(4, 15)(5, 11)(6, 24)(7,
10)(8, 18)(9, 19)(12, 17)(13, 20)(21, 23)
GrpBBElt (1, 14, 17)(2, 18, 13)(5, 16, 20)(7, 22, 9)(8, 24,
15)(19, 23, 21)
```

The printing of the GrpBBElts shows the underlying concrete group elements. These may be extracted using the `UnderlyingElement` intrinsic for use within $G$.

### Set-Theoretic Operations

#### Membership and Equality

<a id="operation-op-in-grpbbelt-grpbb"></a>
##### `g in G: GrpBBElt, GrpBB -> BoolElt`

Return `true` if and only if $G$ is the parent group of $g$ or the parent group of $g$ is a subgroup of $G$.

#### Set Operations

<a id="function-pseudorandom-grpbb"></a>
##### `PseudoRandom(G): GrpBB -> GrpBBElt`

Return a pseudo-random element of the BB-group $G$. The method used is product-replacement with accumulator.

<a id="function-rep-grpbb"></a>
##### `Rep(G): GrpBB -> GrpBBElt`

A representative element of $G$.

#### Coercions Between Related Groups

<a id="operation-op-grpbb-grpbbelt"></a>
##### `G ! g: GrpBB, GrpBBElt -> GrpBBElt`

Given an element $g$ belonging to a subgroup of the BB-group $G$, rewrite $g$ as an element of $G$.

<a id="group-simple"></a>
<a id="chapgrpasim"></a>
## Almost Simple Groups

- [Introduction](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/introduction.md)
  - [Overview](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/introduction.md#overview)
- [Double Covers of the Alternating and Symmetric Groups](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/double-covers-alt-sym.md)
  - [`DoubleCoverSymmetricGroup(n: parameters): RngIntElt → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/double-covers-alt-sym.md#function-doublecoversymmetricgroup-rngintelt)
  - [`DoubleCoverAlternatingGroup(n: parameters): RngIntElt → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/double-covers-alt-sym.md#function-doublecoveralternatinggroup-rngintelt)
- [Creating Finite Groups of Lie Type](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md)
  - [Generic Creation Function](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#generic-creation-function)
    - [`ChevalleyGroup(X, n, K: parameters): MonStgElt, RngIntElt, FldFin → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-chevalleygroup-monstgelt-rngintelt-fldfin)
    - [`ChevalleyGroup(X, n, q: parameters): MonStgElt, RngIntElt, RngIntElt → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-chevalleygroup-monstgelt-rngintelt-rngintelt)
  - [The Orders of the Chevalley Groups](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#the-orders-of-the-chevalley-groups)
    - [`ChevalleyOrderPolynomial(type, n: parameters): MonStgElt, RngIntElt → RngUPolElt`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-chevalleyorderpolynomial-monstgelt-rngintelt)
    - [`FactoredChevalleyGroupOrder(type, n, F: parameters): MonStgElt, RngIntElt, FldFin → RngIntEltFact`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-factoredchevalleygrouporder-monstgelt-rngintelt-fldfin)
    - [`FactoredChevalleyGroupOrder(type, n, q: parameters): MonStgElt, RngIntElt, RngIntElt → RngIntEltFact`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-factoredchevalleygrouporder-monstgelt-rngintelt-rngintelt)
    - [`ChevalleyGroupOrder(type, n, F: parameters): MonStgElt, RngIntElt, FldFin → RngIntEltFact`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-chevalleygrouporder-monstgelt-rngintelt-fldfin)
    - [`ChevalleyGroupOrder(type, n, q: parameters): MonStgElt, RngIntElt, RngIntElt → RngIntEltFact`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-chevalleygrouporder-monstgelt-rngintelt-rngintelt)
  - [Classical Groups](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#classical-groups)
    - [Linear Groups](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#linear-groups)
      - [`GeneralLinearGroup(n, q): RngIntElt, RngIntElt → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-generallineargroup)
      - [`GeneralLinearGroup(n, K): RngIntElt, FldFin → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-generallineargroup-rngintelt-fldfin)
      - [`GeneralLinearGroup(V): ModTupRng → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-generallineargroup-modtuprng)
      - [`GL(n, q): RngIntElt, RngIntElt → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-gl-rngintelt-rngintelt)
      - [`GL(n, K): RngIntElt, FldFin → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-gl-rngintelt-fldfin)
      - [`GL(V): ModTupRng → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-gl-modtuprng)
      - [`SpecialLinearGroup(n, q): RngIntElt, RngIntElt → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-speciallineargroup-rngintelt-rngintelt)
      - [`SpecialLinearGroup(n, K): RngIntElt, FldFin → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-speciallineargroup-rngintelt-fldfin)
      - [`SpecialLinearGroup(V): ModTupRng → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-speciallineargroup-modtuprng)
      - [`SL(n, q): RngIntElt, RngIntElt → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-sl-rngintelt-rngintelt)
      - [`SL(n, K): RngIntElt, FldFin → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-sl-rngintelt-fldfin)
      - [`SL(V): ModTupRng → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-sl-modtuprng)
      - [`AffineGeneralLinearGroup(GrpMat, n, q): Cat, RngIntElt, RngIntElt → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-affinegenerallineargroup-cat-rngintelt-rngintelt)
      - [`AffineGeneralLinearGroup(GrpMat, n, K): Cat, RngIntElt, FldFin → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-affinegenerallineargroup-cat-rngintelt-fldfin)
      - [`AffineGeneralLinearGroup(GrpMat, V): Cat, ModTupRng → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-affinegenerallineargroup-cat-modtuprng)
      - [`AffineGeneralLinearGroup(E): GrpPerm → GrpPerm`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-affinegenerallineargroup-grpperm)
      - [`AGL(GrpMat, n, q): Cat, RngIntElt, RngIntElt → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-agl-cat-rngintelt-rngintelt)
      - [`AGL(GrpMat, n, K): Cat, RngIntElt, FldFin → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-agl-cat-rngintelt-fldfin)
      - [`AGL(GrpMat, V): Cat, ModTupRng → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-agl-cat-modtuprng)
      - [`AGL(E): GrpPerm → GrpPerm`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-agl-grpperm)
      - [`AffineSpecialLinearGroup(GrpMat, n, q): Cat, RngIntElt, RngIntElt → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-affinespeciallineargroup-cat-rngintelt-rngintelt)
      - [`AffineSpecialLinearGroup(GrpMat, n, K): Cat, RngIntElt, FldFin → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-affinespeciallineargroup-cat-rngintelt-fldfin)
      - [`AffineSpecialLinearGroup(GrpMat, V): Cat, ModTupRng → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-affinespeciallineargroup-cat-modtuprng)
      - [`ASL(GrpMat, n, q): Cat, RngIntElt, RngIntElt → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-asl-cat-rngintelt-rngintelt)
      - [`ASL(GrpMat, n, K): Cat, RngIntElt, FldFin → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-asl-cat-rngintelt-fldfin)
      - [`ASL(GrpMat, V): Cat, ModTupRng → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-asl-cat-modtuprng)
    - [Unitary Groups](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#unitary-groups)
      - [`ConformalUnitaryGroup(n, q): RngIntElt, RngIntElt → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-conformalunitarygroup)
      - [`ConformalUnitaryGroup(n, K): RngIntElt, FldFin → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-conformalunitarygroup-rngintelt-fldfin)
      - [`ConformalUnitaryGroup(V): ModTupRng → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-conformalunitarygroup-modtuprng)
      - [`CU(n, q): RngIntElt, RngIntElt → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-cu-rngintelt-rngintelt)
      - [`CU(n, K): RngIntElt, FldFin → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-cu-rngintelt-fldfin)
      - [`CU(V): ModTupRng → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-cu-modtuprng)
      - [`GeneralUnitaryGroup(n, q): RngIntElt, RngIntElt → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-generalunitarygroup-rngintelt-rngintelt)
      - [`GeneralUnitaryGroup(n, K): RngIntElt, FldFin → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-generalunitarygroup-rngintelt-fldfin)
      - [`GeneralUnitaryGroup(V): ModTupRng → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-generalunitarygroup-modtuprng)
      - [`GU(n, q): RngIntElt, RngIntElt → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-gu-rngintelt-rngintelt)
      - [`GU(n, K): RngIntElt, FldFin → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-gu-rngintelt-fldfin)
      - [`GU(V): ModTupRng → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-gu-modtuprng)
      - [`SpecialUnitaryGroup(n, q): RngIntElt, RngIntElt → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-specialunitarygroup-rngintelt-rngintelt)
      - [`SpecialUnitaryGroup(n, K): RngIntElt, FldFin → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-specialunitarygroup-rngintelt-fldfin)
      - [`SpecialUnitaryGroup(V): ModTupRng → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-specialunitarygroup-modtuprng)
      - [`SU(n, q): RngIntElt, RngIntElt → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-su-rngintelt-rngintelt)
      - [`SU(n, K): RngIntElt, FldFin → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-su-rngintelt-fldfin)
      - [`SU(V): ModTupRng → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-su-modtuprng)
      - [`ConformalSpecialUnitaryGroup(n, q): RngIntElt, RngIntElt → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-conformalspecialunitarygroup-rngintelt-rngintelt)
      - [`CSU(n, q): RngIntElt, RngIntElt → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-csu-rngintelt-rngintelt)
    - [Symplectic Groups](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#symplectic-groups)
      - [`ConformalSymplecticGroup(n, q): RngIntElt, RngIntElt → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-conformalsymplecticgroup-rngintelt-rngintelt)
      - [`ConformalSymplecticGroup(n, K): RngIntElt, FldFin → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-conformalsymplecticgroup-rngintelt-fldfin)
      - [`ConformalSymplecticGroup(V): ModTupRng → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-conformalsymplecticgroup-modtuprng)
      - [`CSp(n, q): RngIntElt, RngIntElt → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-csp-rngintelt-rngintelt)
      - [`CSp(n, K): RngIntElt, FldFin → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-csp-rngintelt-fldfin)
      - [`CSp(V): ModTupRng → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-csp-modtuprng)
      - [`SymplecticGroup(n, q): RngIntElt, RngIntElt → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-symplecticgroup-rngintelt-rngintelt)
      - [`SymplecticGroup(n, K): RngIntElt, FldFin → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-symplecticgroup-rngintelt-fldfin)
      - [`SymplecticGroup(V): ModTupRng → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-symplecticgroup-modtuprng)
      - [`Sp(n, q): RngIntElt, RngIntElt → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-sp-rngintelt-rngintelt)
      - [`Sp(n, K): RngIntElt, FldFin → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-sp-rngintelt-fldfin)
      - [`Sp(V): ModTupRng → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-sp-modtuprng)
    - [Orthogonal and Spin Groups](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#orthogonal-and-spin-groups)
      - [`ConformalOrthogonalGroup(n, q): RngIntElt, RngIntElt → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-conformalorthogonalgroup-rngintelt-rngintelt)
      - [`ConformalOrthogonalGroup(n, K): RngIntElt, FldFin → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-conformalorthogonalgroup-rngintelt-fldfin)
      - [`ConformalOrthogonalGroup(V): ModTupRng → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-conformalorthogonalgroup-modtuprng)
      - [`CO(n, q): RngIntElt, RngIntElt → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-co-rngintelt-rngintelt)
      - [`CO(n, K): RngIntElt, FldFin → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-co-rngintelt-fldfin)
      - [`CO(V): ModTupRng → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-co-modtuprng)
      - [`GeneralOrthogonalGroup(n, q): RngIntElt, RngIntElt → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-generalorthogonalgroup-rngintelt-rngintelt)
      - [`GeneralOrthogonalGroup(n, K): RngIntElt, FldFin → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-generalorthogonalgroup-rngintelt-fldfin)
      - [`GeneralOrthogonalGroup(V): ModTupRng → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-generalorthogonalgroup-modtuprng)
      - [`GO(n, q): RngIntElt, RngIntElt → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-go-rngintelt-rngintelt)
      - [`GO(n, K): RngIntElt, FldFin → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-go-rngintelt-fldfin)
      - [`GO(V): ModTupRng → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-go-modtuprng)
      - [Example: Orthogonal Group in Odd Dimension](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#example-ex-681a40)
      - [`SpecialOrthogonalGroup(n, q): RngIntElt, RngIntElt → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-specialorthogonalgroup-rngintelt-rngintelt)
      - [`SpecialOrthogonalGroup(n, K): RngIntElt, FldFin → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-specialorthogonalgroup-rngintelt-fldfin)
      - [`SpecialOrthogonalGroup(V): ModTupRng → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-specialorthogonalgroup-modtuprng)
      - [`SO(n, q): RngIntElt, RngIntElt → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-so-rngintelt-rngintelt)
      - [`SO(n, K): RngIntElt, FldFin → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-so-rngintelt-fldfin)
      - [`SO(V): ModTupRng → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-so-modtuprng)
      - [`ConformalSpecialOrthogonalGroup(n, q): RngIntElt, RngIntElt → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-conformalspecialorthogonalgroup-rngintelt-rngintelt)
      - [`CSO(n, q): RngIntElt, RngIntElt → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-cso-rngintelt-rngintelt)
      - [`ConformalOrthogonalGroupPlus(n, q): RngIntElt, RngIntElt → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-conformalorthogonalgroupplus-rngintelt-rngintelt)
      - [`ConformalOrthogonalGroupPlus(n, K): RngIntElt, FldFin → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-conformalorthogonalgroupplus-rngintelt-fldfin)
      - [`ConformalOrthogonalGroupPlus(V): ModTupRng → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-conformalorthogonalgroupplus-modtuprng)
      - [`COPlus(n, q): RngIntElt, RngIntElt → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-coplus-rngintelt-rngintelt)
      - [`COPlus(n, K): RngIntElt, FldFin → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-coplus-rngintelt-fldfin)
      - [`COPlus(V): ModTupRng → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-coplus-modtuprng)
      - [`GeneralOrthogonalGroupPlus(n, q): RngIntElt, RngIntElt → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-generalorthogonalgroupplus-rngintelt-rngintelt)
      - [`GeneralOrthogonalGroupPlus(n, K): RngIntElt, FldFin → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-generalorthogonalgroupplus-rngintelt-fldfin)
      - [`GeneralOrthogonalGroupPlus(V): ModTupRng → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-generalorthogonalgroupplus-modtuprng)
      - [`GOPlus(n, q): RngIntElt, RngIntElt → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-goplus-rngintelt-rngintelt)
      - [`GOPlus(n, K): RngIntElt, FldFin → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-goplus-rngintelt-fldfin)
      - [`GOPlus(V): ModTupRng → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-goplus-modtuprng)
      - [`SpecialOrthogonalGroupPlus(n, q): RngIntElt, RngIntElt → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-specialorthogonalgroupplus-rngintelt-rngintelt)
      - [`SpecialOrthogonalGroupPlus(n, K): RngIntElt, FldFin → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-specialorthogonalgroupplus-rngintelt-fldfin)
      - [`SpecialOrthogonalGroupPlus(V): ModTupRng → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-specialorthogonalgroupplus-modtuprng)
      - [`SOPlus(n, q): RngIntElt, RngIntElt → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-soplus-rngintelt-rngintelt)
      - [`SOPlus(n, K): RngIntElt, FldFin → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-soplus-rngintelt-fldfin)
      - [`SOPlus(V): ModTupRng → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-soplus-modtuprng)
      - [`ConformalSpecialOrthogonalGroupPlus(n, q): RngIntElt, RngIntElt → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-conformalspecialorthogonalgroupplus-rngintelt-rngintelt)
      - [`CSOPlus(n, q): RngIntElt, RngIntElt → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-csoplus-rngintelt-rngintelt)
      - [`ConformalOrthogonalGroupMinus(n, q): RngIntElt, RngIntElt → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-conformalorthogonalgroupminus-rngintelt-rngintelt)
      - [`ConformalOrthogonalGroupMinus(n, K): RngIntElt, FldFin → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-conformalorthogonalgroupminus-rngintelt-fldfin)
      - [`ConformalOrthogonalGroupMinus(V): ModTupRng → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-conformalorthogonalgroupminus-modtuprng)
      - [`COMinus(n, q): RngIntElt, RngIntElt → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-cominus-rngintelt-rngintelt)
      - [`COMinus(n, K): RngIntElt, FldFin → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-cominus-rngintelt-fldfin)
      - [`COMinus(V): ModTupRng → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-cominus-modtuprng)
      - [`GeneralOrthogonalGroupMinus(n, q): RngIntElt, RngIntElt → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-generalorthogonalgroupminus-rngintelt-rngintelt)
      - [`GeneralOrthogonalGroupMinus(n, K): RngIntElt, FldFin → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-generalorthogonalgroupminus-rngintelt-fldfin)
      - [`GeneralOrthogonalGroupMinus(V): ModTupRng → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-generalorthogonalgroupminus-modtuprng)
      - [`GOMinus(n, q): RngIntElt, RngIntElt → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-gominus-rngintelt-rngintelt)
      - [`GOMinus(n, K): RngIntElt, FldFin → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-gominus-rngintelt-fldfin)
      - [`GOMinus(V): ModTupRng → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-gominus-modtuprng)
      - [`SpecialOrthogonalGroupMinus(n, q): RngIntElt, RngIntElt → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-specialorthogonalgroupminus-rngintelt-rngintelt)
      - [`SpecialOrthogonalGroupMinus(n, K): RngIntElt, FldFin → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-specialorthogonalgroupminus-rngintelt-fldfin)
      - [`SpecialOrthogonalGroupMinus(V): ModTupRng → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-specialorthogonalgroupminus-modtuprng)
      - [`SOMinus(n, q): RngIntElt, RngIntElt → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-sominus-rngintelt-rngintelt)
      - [`SOMinus(n, K): RngIntElt, FldFin → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-sominus-rngintelt-fldfin)
      - [`SOMinus(V): ModTupRng → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-sominus-modtuprng)
      - [`ConformalSpecialOrthogonalGroupMinus(n, q): RngIntElt, RngIntElt → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-conformalspecialorthogonalgroupminus-rngintelt-rngintelt)
      - [`CSOMinus(n, q): RngIntElt, RngIntElt → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-csominus-rngintelt-rngintelt)
      - [`Omega(n, q): RngIntElt, RngIntElt → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-omega-rngintelt-rngintelt)
      - [`Omega(n, K): RngIntElt, FldFin → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-omega-rngintelt-fldfin)
      - [`Omega(V): ModTupRng → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-omega-modtuprng)
      - [`OmegaPlus(n, q): RngIntElt, RngIntElt → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-omegaplus-rngintelt-rngintelt)
      - [`OmegaPlus(n, K): RngIntElt, FldFin → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-omegaplus-rngintelt-fldfin)
      - [`OmegaPlus(V): ModTupRng → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-omegaplus-modtuprng)
      - [`OmegaMinus(n, q): RngIntElt, RngIntElt → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-omegaminus-rngintelt-rngintelt)
      - [`OmegaMinus(n, K): RngIntElt, FldFin → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-omegaminus-rngintelt-fldfin)
      - [`OmegaMinus(V): ModTupRng → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-omegaminus-modtuprng)
      - [`Spin(n, q): RngIntElt, RngIntElt → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-spin-rngintelt-rngintelt)
      - [`Spin(n, K): RngIntElt, FldFin → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-spin-rngintelt-fldfin)
      - [`Spin(V): ModTupRng → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-spin-modtuprng)
      - [`SpinPlus(n, q): RngIntElt, RngIntElt → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-spinplus-rngintelt-rngintelt)
      - [`SpinPlus(n, K): RngIntElt, FldFin → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-spinplus-rngintelt-fldfin)
      - [`SpinPlus(V): ModTupRng → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-spinplus-modtuprng)
      - [`SpinMinus(n, q): RngIntElt, RngIntElt → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-spinminus-rngintelt-rngintelt)
      - [`SpinMinus(n, K): RngIntElt, FldFin → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-spinminus-rngintelt-fldfin)
      - [`SpinMinus(V): ModTupRng → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-spinminus-modtuprng)
  - [Exceptional Groups](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#exceptional-groups)
    - [Suzuki Groups](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#suzuki-groups)
      - [`SuzukiGroup(q): RngIntElt → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-suzukigroup-rngintelt)
      - [`SuzukiGroup(K): FldFin → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-suzukigroup-fldfin)
      - [`SuzukiGroup(V): ModTupRng → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-suzukigroup-modtuprng)
      - [Example: Symplectic Group of Dimension 10](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#example-ex-df72cd)
      - [Example: Creating a Suzuki Group](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#example-ex-58f4ed)
    - [Small Ree Groups](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#small-ree-groups)
      - [`ReeGroup(q): RngIntElt → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-reegroup-rngintelt)
      - [`ReeGroup(K): FldFin → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-reegroup-fldfin)
      - [`ReeGroup(V): ModTupRng → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-reegroup-modtuprng)
    - [Large Ree Groups](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#large-ree-groups)
      - [`LargeReeGroup(q): RngIntElt → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-largereegroup-rngintelt)
      - [`LargeReeGroup(K): FldFin → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-largereegroup-fldfin)
      - [`LargeReeGroup(V): ModTupRng → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/standard.md#function-largereegroup-modtuprng)
- [Group Recognition](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/group-recognition.md)
  - [Constructive Recognition of Alternating Groups](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/group-recognition.md#constructive-recognition-of-alternating-groups)
    - [`RecogniseAlternatingOrSymmetric(G : parameters): Grp, RngIntElt → BoolElt, Map, Map, Map, Map, BoolElt`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/group-recognition.md#function-recognisealternatingorsymmetric-grp-rngintelt)
    - [`AlternatingOrSymmetricElementToWord(G, g): Grp, GrpElt → BoolElt, GrpSLPElt`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/group-recognition.md#function-alternatingorsymmetricelementtoword-grp-grpelt)
    - [Example: Recognising a Representation of A13](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/group-recognition.md#example-ex-98afe7)
    - [`RecogniseSymmetric(G, n: parameters): Grp, RngIntElt → BoolElt, Map, Map, Map, Map, BoolElt`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/group-recognition.md#function-recognisesymmetric-grp-rngintelt)
    - [`SymmetricElementToWord(G, g): Grp, GrpElt → BoolElt, GrpSLPElt`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/group-recognition.md#function-symmetricelementtoword-grp-grpelt)
    - [`RecogniseAlternating(G, n: parameters): Grp, RngIntElt → BoolElt, Map, Map, Map, Map, BoolElt`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/group-recognition.md#function-recognisealternating-grp-rngintelt)
    - [`AlternatingElementToWord(G, g): Grp, GrpElt → BoolElt, GrpSLPElt`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/group-recognition.md#function-alternatingelementtoword-grp-grpelt)
    - [`GuessAltsymDegree(G: parameters): Grp → BoolElt, MonStgElt, RngIntElt`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/group-recognition.md#function-guessaltsymdegree-grp)
    - [Example: Guessing the Degree of an Alternating Group](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/group-recognition.md#example-ex-785664)
  - [Determining the Type of a Finite Group of Lie Type](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/group-recognition.md#determining-the-type-of-a-finite-group-of-lie-type)
    - [`LieCharacteristic(G : parameters): Grp → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/group-recognition.md#function-liecharacteristic-grp)
    - [Example: Characteristic of a Group of Lie Type](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/group-recognition.md#example-ex-337eef)
    - [`LieType(G, p : parameters): GrpMat, RngIntElt → BoolElt, Tup`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/group-recognition.md#function-grpmatff-lietype)
    - [`LieType(G, p : parameters): GrpMat, RngIntElt → BoolElt, Tup`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/group-recognition.md#function-grpperm-lietype)
    - [`SimpleGroupName(G : parameters): GrpMat → BoolElt, List`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/group-recognition.md#function-simplegroupname-grpmat)
    - [`SimpleGroupName(G : parameters): GrpPerm → BoolElt, List`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/group-recognition.md#function-simplegroupname-grpperm)
    - [Example: Naming a Simple Group](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/group-recognition.md#example-ex-ffaa04)
  - [Classical Forms](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/group-recognition.md#classical-forms)
    - [`ClassicalForms(G: parameters): GrpMat → Rec`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/group-recognition.md#function-grpmat-classicalforms)
    - [`SymplecticForm(G: parameters): GrpMat → BoolElt, AlgMatElt [,SeqEnum]`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/group-recognition.md#function-symplecticform-grpmat)
    - [`SymmetricBilinearForm(G: parameters): GrpMat → BoolElt, AlgMatElt, MonStgElt [,SeqEnum]`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/group-recognition.md#function-symmetricbilinearform-grpmat)
    - [`QuadraticForm(G): GrpMat → BoolElt, AlgMatElt, MonStgElt [,SeqEnum]`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/group-recognition.md#function-quadraticform-grpmat)
    - [`UnitaryForm(G): GrpMat → BoolElt, AlgMatElt [,SeqEnum]`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/group-recognition.md#function-unitaryform-grpmat)
    - [`FormType(G): GrpMat → MonStgElt`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/group-recognition.md#function-formtype-grpmat)
    - [Example: Classical Forms of an Orthogonal Group](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/group-recognition.md#example-ex-9382cf)
    - [`TransformForm(form, type): AlgMatElt, MonStgElt → GrpMatElt`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/group-recognition.md#function-transformform-algmatelt-monstgelt)
    - [`TransformForm(G): GrpMat → GrpMatElt`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/group-recognition.md#function-transformform-grpmat)
    - [`SpinorNorm(g, form): GrpMatElt, AlgMatElt → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/group-recognition.md#function-spinornorm-grpmatelt-algmatelt)
    - [Example: Spinor Norm in an Orthogonal Group](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/group-recognition.md#example-ex-b5d734)
  - [Recognizing Classical Groups in their Natural Representation](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/group-recognition.md#recognizing-classical-groups-in-their-natural-representation)
    - [`RecognizeClassical(G : parameters): GrpMat → BoolElt`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/group-recognition.md#function-recognizeclassical-grpmat)
    - [`RecogniseClassical(G : parameters): GrpMat → BoolElt`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/group-recognition.md#function-recogniseclassical-grpmat)
    - [`IsLinearGroup(G): GrpMat → BoolElt`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/group-recognition.md#function-islineargroup)
    - [`IsSymplecticGroup(G): GrpMat → BoolElt`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/group-recognition.md#function-issymplecticgroup-grpmat)
    - [`IsOrthogonalGroup(G): GrpMat → BoolElt`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/group-recognition.md#function-isorthogonalgroup-grpmat)
    - [`IsUnitaryGroup(G): GrpMat → BoolElt`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/group-recognition.md#function-isunitarygroup-grpmat)
    - [`ClassicalType(G): GrpMat → MonStgElt`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/group-recognition.md#function-classicaltype-grpmat)
    - [`ClassicalGroupType(G): GrpMat → BoolElt, MonStgElt`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/group-recognition.md#function-classicalgrouptype-grpmat)
    - [Example: Recognising a Unitary Group](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/group-recognition.md#example-ex-9f3ea6)
  - [Constructive Recognition of Linear Groups](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/group-recognition.md#constructive-recognition-of-linear-groups)
    - [`RecognizeSL2(G): GrpMat → BoolElt, Map, Map, Map, Map`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/group-recognition.md#function-recognizesl2-grpmat)
    - [`RecogniseSL2(G): GrpMat → BoolElt, Map, Map, Map, Map`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/group-recognition.md#function-recognisesl2-grpmat)
    - [`RecognizeSL2(G): GrpPerm → BoolElt, Map, Map, Map, Map`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/group-recognition.md#function-recognizesl2-grpperm)
    - [`RecogniseSL2(G): GrpPerm → BoolElt, Map, Map, Map, Map`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/group-recognition.md#function-recognisesl2-grpperm)
    - [`RecognizeSL2(G, q): GrpMat, RngIntElt → BoolElt, Map, Map, Map, Map`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/group-recognition.md#function-recognizesl2-grpmat-rngintelt)
    - [`RecogniseSL2(G, q): GrpMat, RngIntElt → BoolElt, Map, Map, Map, Map`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/group-recognition.md#function-recognisesl2-grpmat-rngintelt)
    - [`RecognizeSL2(G, q): GrpPerm, RngIntElt → BoolElt, Map, Map, Map, Map`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/group-recognition.md#function-recognizesl2-grpperm-rngintelt)
    - [`RecogniseSL2(G, q): GrpPerm, RngIntElt → BoolElt, Map, Map, Map, Map`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/group-recognition.md#function-recognisesl2-grpperm-rngintelt)
    - [`SL2ElementToWord(G, g): GrpMat, GrpMatElt → BoolElt, GrpSLPElt`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/group-recognition.md#function-sl2elementtoword-grpmat-grpmatelt)
    - [`SL2ElementToWord(G, g): GrpPerm, GrpPermElt → BoolElt, GrpSLPElt`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/group-recognition.md#function-sl2elementtoword-grpperm-grppermelt)
    - [`SL2Characteristic(G : parameters): GrpMat → RngIntElt, RngIntElt`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/group-recognition.md#function-sl2characteristic-grpmat)
    - [`SL2Characteristic(G : parameters): GrpPerm → RngIntElt, RngIntElt`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/group-recognition.md#function-sl2characteristic-grpperm)
    - [Example: Recognising SL2 in Its Natural Representation](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/group-recognition.md#example-ex-6829cc)
    - [Example: Recognising SL2 in Dimension 6](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/group-recognition.md#example-ex-82f78a)
    - [`RecogniseSL3(G): GrpMat → BoolElt, Map, Map, Map, Map`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/group-recognition.md#function-recognisesl3-grpmat)
    - [`RecogniseSL3(G, q : parameters): GrpMat, RngIntElt → BoolElt, Map, Map, Map, Map`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/group-recognition.md#function-recognisesl3-grpmat-rngintelt)
    - [`SL3ElementToWord(G, g): GrpMat, GrpMatElt → BoolElt, GrpSLPElt`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/group-recognition.md#function-sl3elementtoword-grpmat-grpmatelt)
    - [Example: Recognising SL3 and Its Symmetric Square](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/group-recognition.md#example-ex-46bbe9)
    - [`RecogniseSL(G, d, q): Grp, RngIntElt, RngIntElt → BoolElt, Map, Map`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/group-recognition.md#function-recognisesl-grp-rngintelt-rngintelt)
    - [`RecognizeSL(G, d, q): Grp, RngIntElt, RngIntElt → BoolElt, Map, Map`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/group-recognition.md#function-recognizesl-grp-rngintelt-rngintelt)
  - [Constructive Recognition of Symplectic Groups](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/group-recognition.md#constructive-recognition-of-symplectic-groups)
    - [`RecogniseSpOdd(G, d, q): Grp, RngIntElt, RngIntElt → BoolElt, Map, Map`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/group-recognition.md#function-recognisespodd-grp-rngintelt-rngintelt)
    - [`RecognizeSpOdd(G, d, q): Grp, RngIntElt, RngIntElt → BoolElt, Map, Map`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/group-recognition.md#function-recognizespodd-grp-rngintelt-rngintelt)
    - [`RecogniseSp4(G, q): Grp, RngIntElt, RngIntElt → BoolElt, Map, Map, Map, Map, SeqEnum, SeqEnum`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/group-recognition.md#function-recognisesp4-grp-rngintelt-rngintelt)
    - [`RecognizeSp4(G, q): Grp, RngIntElt, RngIntElt → BoolElt, Map, Map, Map, Map, SeqEnum, SeqEnum`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/group-recognition.md#function-recognizesp4-grp-rngintelt-rngintelt)
  - [Constructive Recognition of Unitary Groups](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/group-recognition.md#constructive-recognition-of-unitary-groups)
    - [`RecogniseSU3(G, d, q): Grp, RngIntElt, RngIntElt → BoolElt, Map, Map`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/group-recognition.md#function-recognisesu3-grp-rngintelt-rngintelt)
    - [`RecognizeSU3(G, d, q): Grp, RngIntElt, RngIntElt → BoolElt, Map, Map`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/group-recognition.md#function-recognizesu3-grp-rngintelt-rngintelt)
    - [`RecogniseSU4(G, d, q): Grp, RngIntElt, RngIntElt → BoolElt, Map, Map`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/group-recognition.md#function-recognisesu4-grp-rngintelt-rngintelt)
    - [`RecognizeSU4(G, d, q): Grp, RngIntElt, RngIntElt → BoolElt, Map, Map`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/group-recognition.md#function-recognizesu4-grp-rngintelt-rngintelt)
  - [Recognition Of Classical Groups in Low Degree](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/group-recognition.md#recognition-of-classical-groups-in-low-degree)
    - [`RecogniseSmallDegree(G): GrpMat → BoolElt, GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/group-recognition.md#function-recognisesmalldegree-grpmat)
    - [`RecogniseSmallDegree(G, type, d, q): GrpMat, MonStgElt, RngIntElt, RngIntElt → BoolElt, GrpMat, Map, Map`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/group-recognition.md#function-recognisesmalldegree-grpmat-monstgelt-rngintelt-rngintelt)
    - [`SmallDegreePreimage(G, g): GrpMat, GrpMatElt → GrpMatElt`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/group-recognition.md#function-smalldegreepreimage-grpmat-grpmatelt)
    - [`SmallDegreeImage(G, h): GrpMat, GrpMatElt → GrpMatElt`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/group-recognition.md#function-smalldegreeimage-grpmat-grpmatelt)
    - [Example: Recognising SL4 in a Symmetric Square](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/group-recognition.md#example-ex-5df193)
  - [Constructive Recognition of Suzuki Groups](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/group-recognition.md#constructive-recognition-of-suzuki-groups)
    - [Introduction](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/group-recognition.md#introduction)
    - [Recognition Functions](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/group-recognition.md#recognition-functions)
      - [`IsSuzukiGroup(G): GrpMat → BoolElt, RngIntElt`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/group-recognition.md#function-issuzukigroup-grpmat)
      - [`RecogniseSz(G : parameters): GrpMat → BoolElt, Map, Map, Map, Map`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/group-recognition.md#function-recognisesz-grpmat)
      - [`RecognizeSz(G : parameters): GrpMat → BoolElt, Map, Map, Map, Map`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/group-recognition.md#function-recognizesz-grpmat)
      - [`SzElementToWord(G, g): GrpMat, GrpMatElt → BoolElt, GrpSLPElt`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/group-recognition.md#function-szelementtoword-grpmat-grpmatelt)
      - [`SzPresentation(q): RngIntElt → GrpFP, HomGrp`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/group-recognition.md#function-szpresentation-rngintelt)
      - [`SatisfiesSzPresentation(G): GrpMat → BoolElt`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/group-recognition.md#function-satisfiesszpresentation-grpmat)
      - [`SuzukiIrreducibleRepresentation(F, twists : parameters): FldFin, SeqEnum[RngIntElt] → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/group-recognition.md#function-suzukiirreduciblerepresentation-fldfin-seqenum-rngintelt)
      - [Example: Recognising the Suzuki Group Sz(32)](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/group-recognition.md#example-ex-9d33f6)
      - [Example: Constructive Membership in 2.Sz(8)](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/group-recognition.md#example-ex-d3b056)
      - [Example: Suzuki Group in Dimension 64](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/group-recognition.md#example-ex-f8d565)
      - [Example: Suzuki Group in Cross Characteristic](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/group-recognition.md#example-ex-183108)
  - [Constructive Recognition of Small Ree Groups](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/group-recognition.md#constructive-recognition-of-small-ree-groups)
    - [Introduction](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/group-recognition.md#id29)
    - [Recognition Functions](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/group-recognition.md#id30)
      - [`RecogniseRee(G : parameters): GrpMat → BoolElt, Map, Map, Map, Map`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/group-recognition.md#function-recogniseree-grpmat)
      - [`RecognizeRee(G : parameters): GrpMat → BoolElt, Map, Map, Map, Map`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/group-recognition.md#function-recognizeree-grpmat)
      - [`ReeElementToWord(G, g): GrpMat, GrpMatElt → BoolElt, GrpSLPElt`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/group-recognition.md#function-reeelementtoword-grpmat-grpmatelt)
      - [`IsReeGroup(G): GrpMat → BoolElt, RngIntElt`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/group-recognition.md#function-isreegroup-grpmat)
      - [`ReeIrreducibleRepresentation(F, twists : parameters): FldFin, SeqEnum[RngIntElt] → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/group-recognition.md#function-reeirreduciblerepresentation-fldfin-seqenum-rngintelt)
      - [Example: Recognising a Ree Group](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/group-recognition.md#example-ex-79d9a3)
  - [Constructive Recognition of Large Ree Groups](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/group-recognition.md#constructive-recognition-of-large-ree-groups)
    - [Introduction](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/group-recognition.md#id32)
    - [Recognition Functions](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/group-recognition.md#id33)
      - [`RecogniseLargeRee(G : parameters): GrpMat → BoolElt, Map, Map, Map, Map`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/group-recognition.md#function-recogniselargeree-grpmat)
      - [`RecognizeLargeRee(G : parameters): GrpMat → BoolElt, Map, Map, Map, Map`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/group-recognition.md#function-recognizelargeree-grpmat)
      - [`LargeReeElementToWord(G, g): GrpMat, GrpMatElt → BoolElt, GrpSLPElt`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/group-recognition.md#function-largereeelementtoword-grpmat-grpmatelt)
      - [`IsLargeReeGroup(G): GrpMat → BoolElt, RngIntElt`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/group-recognition.md#function-islargereegroup-grpmat)
- [Properties of Finite Groups Of Lie Type](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/properties-lie-groups.md)
  - [Maximal Subgroups of the Classical Groups](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/properties-lie-groups.md#maximal-subgroups-of-the-classical-groups)
    - [`ClassicalMaximals(type, d, q : parameters): MonStgElt, RngIntElt, RngIntElt → SeqEnum`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/properties-lie-groups.md#function-classicalmaximals-monstgelt-rngintelt-rngintelt)
  - [Maximal Subgroups of the Exceptional Groups](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/properties-lie-groups.md#maximal-subgroups-of-the-exceptional-groups)
    - [`SuzukiMaximalSubgroups(G): GrpMat → SeqEnum, SeqEnum`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/properties-lie-groups.md#function-suzukimaximalsubgroups-grpmat)
    - [`SuzukiMaximalSubgroupsConjugacy(G, R, S): GrpMat, GrpMat, GrpMat → GrpMatElt, GrpSLPElt`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/properties-lie-groups.md#function-suzukimaximalsubgroupsconjugacy-grpmat-grpmat-grpmat)
    - [`ReeMaximalSubgroups(G): GrpMat → SeqEnum, SeqEnum`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/properties-lie-groups.md#function-reemaximalsubgroups-grpmat)
    - [`ReeMaximalSubgroupsConjugacy(G, R, S): GrpMat, GrpMat, GrpMat → GrpMatElt, GrpSLPElt`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/properties-lie-groups.md#function-reemaximalsubgroupsconjugacy-grpmat-grpmat-grpmat)
    - [`SzMaximals(q): RngIntElt → SeqEnum`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/properties-lie-groups.md#function-szmaximals-rngintelt)
    - [`ReeMaximals(q): RngIntElt → SeqEnum`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/properties-lie-groups.md#function-reemaximals-rngintelt)
    - [`G2Maximals(q): RngIntElt → SeqEnum`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/properties-lie-groups.md#function-g2maximals-rngintelt)
  - [Sylow Subgroups of the Classical Groups](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/properties-lie-groups.md#sylow-subgroups-of-the-classical-groups)
    - [`ClassicalSylow(G,p): GrpMat, RngIntElt → GrpMat`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/properties-lie-groups.md#function-classicalsylow-grpmat-rngintelt)
    - [`ClassicalSylowConjugation(G,P,S): GrpMat, GrpMat, GrpMat → GrpMatElt`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/properties-lie-groups.md#function-classicalsylowconjugation-grpmat-grpmat-grpmat)
    - [`ClassicalSylowNormaliser(G,P): GrpMat, GrpMat → GrpMatElt`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/properties-lie-groups.md#function-classicalsylownormaliser-grpmat-grpmat)
    - [`ClassicalSylowToPC(G,P): GrpMat, GrpMat → GrpPC, UserProgram, Map`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/properties-lie-groups.md#function-classicalsylowtopc-grpmat-grpmat)
    - [Example: Sylow Subgroups of a Symplectic Group](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/properties-lie-groups.md#example-ex-464f7f)
  - [Sylow Subgroups of Exceptional Groups](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/properties-lie-groups.md#sylow-subgroups-of-exceptional-groups)
    - [`SuzukiSylow(G, p): GrpMat, RngIntElt → GrpMat, SeqEnum`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/properties-lie-groups.md#function-suzukisylow-grpmat-rngintelt)
    - [`SuzukiSylowConjugacy(G, R, S, p): GrpMat, GrpMat, GrpMat, RngIntElt → GrpMatElt, GrpSLPElt`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/properties-lie-groups.md#function-suzukisylowconjugacy-grpmat-grpmat-grpmat-rngintelt)
    - [Example: Sylow Subgroups of a Large Suzuki Group](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/properties-lie-groups.md#example-ex-c86d0c)
    - [`ReeSylow(G, p): GrpMat, RngIntElt → GrpMat, SeqEnum`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/properties-lie-groups.md#function-reesylow-grpmat-rngintelt)
    - [`ReeSylowConjugacy(G, R, S, p): GrpMat, GrpMat, GrpMat, RngIntElt → GrpMatElt, GrpSLPElt`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/properties-lie-groups.md#function-reesylowconjugacy-grpmat-grpmat-grpmat-rngintelt)
    - [`LargeReeSylow(G, p): GrpMat, RngIntElt → GrpMat, SeqEnum`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/properties-lie-groups.md#function-largereesylow-grpmat-rngintelt)
    - [Example: Sylow Subgroups of a Ree Group](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/properties-lie-groups.md#example-ex-026da0)
  - [Conjugacy of Subgroups of the Classical Groups](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/properties-lie-groups.md#conjugacy-of-subgroups-of-the-classical-groups)
    - [`IsGLConjugate(H, K): GrpMat, GrpMat → BoolElt, GrpMatElt | Unass`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/properties-lie-groups.md#function-isglconjugate-grpmat-grpmat)
  - [Conjugacy of Elements of the Exceptional Groups](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/properties-lie-groups.md#conjugacy-of-elements-of-the-exceptional-groups)
    - [`SzConjugacyClasses(G): GrpMat → SeqEnum`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/properties-lie-groups.md#function-szconjugacyclasses-grpmat)
    - [`SzClassRepresentative(G, g): GrpMat, GrpMatElt → GrpMatElt, GrpMatElt`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/properties-lie-groups.md#function-szclassrepresentative-grpmat-grpmatelt)
    - [`SzIsConjugate(G, g, h): GrpMat, GrpMatElt, GrpMatElt → BoolElt, GrpMatElt`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/properties-lie-groups.md#function-szisconjugate-grpmat-grpmatelt-grpmatelt)
    - [`SzClassMap(G): GrpMat → Map`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/properties-lie-groups.md#function-szclassmap-grpmat)
    - [`ReeConjugacyClasses(G): GrpMat → SeqEnum`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/properties-lie-groups.md#function-reeconjugacyclasses-grpmat)
  - [Irreducible Subgroups of the General Linear Group](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/properties-lie-groups.md#irreducible-subgroups-of-the-general-linear-group)
    - [`IrreducibleSubgroups(n, q): RngIntElt, RngIntElt → SeqEnum`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/properties-lie-groups.md#function-irreduciblesubgroups-rngintelt-rngintelt)
    - [Example: Counting Irreducible Matrix Groups](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/properties-lie-groups.md#example-ex-4bbc80)
- [Atlas Data for the Sporadic Groups](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/related.md)
  - [`StandardGenerators(G, str : parameters): Grp, MonStgElt → BoolElt, SeqEnum, SeqEnum`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/related.md#function-standardgenerators-grp-monstgelt)
  - [`StandardGeneratorsGroupNames() → SetIndx`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/related.md#function-standardgeneratorsgroupnames)
  - [`StandardCopy(str): MonStgElt → Grp, BoolElt`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/related.md#function-standardcopy-monstgelt)
  - [`IsomorphismToStandardCopy(G, str : parameters): Grp, MonStgElt → BoolElt, Map`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/related.md#function-isomorphismtostandardcopy-grp-monstgelt)
  - [`StandardPresentation(G, str : parameters): Grp, MonStgElt → BoolElt, SeqEnum, SeqEnum`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/related.md#function-standardpresentation-grp-monstgelt)
  - [`MaximalSubgroups(G, str : parameters): Grp, MonStgElt → BoolElt, SeqEnum, SeqEnum`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/related.md#function-maximalsubgroups-grp-monstgelt)
  - [`Subgroups(G, str : parameters): Grp, MonStgElt → BoolElt, SeqEnum`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/related.md#function-subgroups-grp-monstgelt)
  - [`GoodBasePoints(G, str : parameters): Grp, MonStgElt → BoolElt, SeqEnum`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/related.md#function-goodbasepoints-grp-monstgelt)
  - [`SubgroupsData(str): MonStgElt → SeqEnum`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/related.md#function-subgroupsdata-monstgelt)
  - [`MaximalSubgroupsData(str : parameters): MonStgElt → SeqEnum`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/related.md#function-maximalsubgroupsdata-monstgelt)
  - [Example: Atlas Data for the Janko Group J1](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/related.md#example-ex-328794)
- [Automorphism Groups of Finite Simple Groups](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/autgpsimgpss.md)
  - [`AutomorphismGroupSimpleGroup(type, d, q): MonStgElt, RngIntElt, RngIntElt → GrpPerm`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/autgpsimgpss.md#function-automorphismgroupsimplegroup-monstgelt-rngintelt-rngintelt)
  - [`AutomorphismGroupSimpleGroup(type, q): MonStgElt, RngIntElt → GrpPerm`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/autgpsimgpss.md#function-automorphismgroupsimplegroup-monstgelt-rngintelt)
  - [`AutomorphismGroupSimpleGroup(name): MonStgElt → GrpPerm`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/autgpsimgpss.md#function-automorphismgroupsimplegroup-monstgelt)
  - [`AutomorphismGroupSimpleGroup(triple): Tup → GrpPerm`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/autgpsimgpss.md#function-automorphismgroupsimplegroup-tup)
- [Bibliography](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/bibliography.md)

### Introduction

#### Overview

This chapter describes a set of tools for working with finite almost-simple groups (AS-groups). In the program for computing with non-soluble finite groups, the goal is to reduce the solution of many problems concerning a non-soluble group $G$ to that of solving the same problem for the non-abelian simple composition factors of $G$. We are concerned with very specific types of computation with AS-groups.

The techniques described in this chapter are under development and are very incomplete in their coverage. The material falls roughly into two main categories.

**(a)**
Functions which try to identify a particular group $S$ known to be almost simple with a standard copy $T$ of that AS-group. In addition, if such an isomorphism is found, it is often desirable to explicitly construct it so that questions concerning $S$ can be answered by mapping them into the “standard” group $T$. Hence the recognition functions are divided into those which perform *non-constructive recognition* (they assert the existence of an isomorphism between $S$ and $T$) and those that perform *constructive recognition* (an explicit isomorphism between $S$ and $T$ is returned).

**(b)**
Functions which allow the user to determine information about an AS-group. These functions are usually implemented separately for each family of simple groups. Thus, for each family of simple groups our goal is to provide machinery for constructing key properties of any group $T$ in that family in the context of a standard representation of the group. Using the isomorphism constructed in (a), this information can then be transferred back to the user’s group $S$. Examples of such information include, information about element conjugacy, maximal subgroups, and Sylow $p$-subgroups.

The functions described in this chapter do not assume that a BSGS-representation can be constructed available. Thus, the techniques described here apply to groups possibly having both much larger order and/or much larger dimension than those that can be handled with the techniques of Chapters [Permutation Groups](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/index-permutation-groups.md#chapgrpperm) and [Matrix Groups over General Rings](https://docs.magma-maths.org/FiniteGroups/MatrixGroupsOverGeneralRings/index-matrix-groups-over-general-rings.md#chapgrpmat).

### Double Covers of the Alternating and Symmetric Groups

These functions construct representations of the groups $2A_n$ and $2S_n$ as matrix groups over a field ${\bf F}_{p}$ or (usually) ${\bf F}_{p^2}$ for an odd prime $p$. Their dimension is $2^d$ with $d = (n-1)/2,\, (n-2)/2$, or $(n-3)/2$ depending on $n \bmod 6$. The method used is described in [[Maa09](https://docs.magma-maths.org/references.md#cite-maas)].

<a id="function-doublecoversymmetricgroup-rngintelt"></a>
#### `DoubleCoverSymmetricGroup(n: parameters): RngIntElt -> GrpMat`

```magma
Sign          : MonStgElt                    Default: "-"
Characteristic: RngIntElt                    Default: 3
```

The double cover $2S_n$ of the symmetric groups $S_n$ of degree $n$ for $n \ge 4$ represented as a matrix group over the field ${\bf F}_{p}$ or (usually) ${\bf F}_{p^2}$, where $p$, which defaults to $3$, can be specified as `Characteristic`.

There are two isomorphism classes of groups with this structure, which are distinguished by the optional parameter `Sign`, which can be positive, (`Sign` = “+” or “plus”), or (default) negative (`Sign` = “-” or “minus”). The inverse images of the Coxeter generators of $S_n$ have order $2$ when `Sign` is “+” and $4$ when `Sign` is “-“.

<a id="function-doublecoveralternatinggroup-rngintelt"></a>
#### `DoubleCoverAlternatingGroup(n: parameters): RngIntElt -> GrpMat`

```magma
Characteristic: RngIntElt                    Default: 3
```

The double cover $2A_n$ of the symmetric groups $A_n$ of degree $n$ for $n \ge 4$ represented as a matrix group over the field ${\bf F}_{p}$ or (usually) ${\bf F}_{p^2}$, where $p$, which defaults to $3$, can be specified as `Characteristic`.

### Creating Finite Groups of Lie Type

Several functions are provided which construct various classical groups and other groups of Lie type. The effect of these functions is to define the group in terms of a set of generating matrices.

As shown by Chevalley, for each simple Lie algebra $L$ over the complex field and for each finite field ${\bf F}_{q}$ there is an associated matrix group $L(q)$. In general, these groups are perfect but not simple. To obtain the simple group, it is necessary to form the quotient by the centre. Similarly, as Steinberg, Ree, and others have shown, if the associated Coxeter graph has an automorphism, of order $t$ say, then there will be a ‘twisted’ version ${}^tL(q)$ of $L(q)$.

Generators for the series A, C, ${}^2$A, and ${}^2$B are described in [[Tay87](https://docs.magma-maths.org/references.md#cite-taylor)]. Generators for the series B, D, and ${}^2$D are as given by Rylands and Taylor [[RT98](https://docs.magma-maths.org/references.md#cite-rylands-taylor)]. Generators for the exceptional groups of Lie type are described by Howlett, Rylands, and Taylor in [[HRT01](https://docs.magma-maths.org/references.md#cite-howlett-rylands-taylor)].

#### Generic Creation Function

<a id="function-chevalleygroup-monstgelt-rngintelt-fldfin"></a>
##### `ChevalleyGroup(X, n, K: parameters): MonStgElt, RngIntElt, FldFin -> GrpMat`

<a id="function-chevalleygroup-monstgelt-rngintelt-rngintelt"></a>
##### `ChevalleyGroup(X, n, q: parameters): MonStgElt, RngIntElt, RngIntElt -> GrpMat`

```magma
Irreducible: BoolElt                    Default: false
```

Construct a matrix group over the field $K$ (or over ${\bf F}_{q}$) which has the adjoint Chevalley group of Lie series `X` and Lie rank $n$ as the quotient modulo scalar matrices. In most cases the group returned is the universal Chevalley group $X_n(q)$; however, for series `B`, `D`, and `2D` the universal group is the spin group and the matrix group returned by `ChevalleyGroup` is $\Omega(2n+1,q)$, $\Omega^+(2n,q)$, or $\Omega^-(2n,q)$.

For the twisted groups the meaning of the parameter $q$ is consistent with the (abbreviated) notation in the ‘Atlas of Finite Groups’ and in the monograph series ‘The Classification of the Finite Simple Groups’ by Gorenstein, Lyons, and Solomon. For a Chevalley group of rank $n$ and type $X$ with an automorphism of order $t$ the Atlas defines the *twisted Chevalley group* ${}^tX_n(q,q^t)$ to be the set of elements of $X_n(q^t)$ fixed by the quotient of the twisting automorphism and the field automorphism induced by $x \mapsto x^q$ of ${\bf F}_{q^t}$. In the Atlas the abbreviated notation for the twisted group is ${}^tX_n(q)$ but in Carter [[Car72a](https://docs.magma-maths.org/references.md#cite-car72)] it is ${}^tX_n(q^t)$. The first signature of the intrinsic expects the field ${\bf F}_{q^t}$ but the second signature expects the parameter $q$.

For example, for the series `"2A"`, the group ${}^2A_n(q)$ is ${\operatorname{SU}}(n + 1, q)$ but, in the first form of the signature, $K$ must be the field ${\bf F}_{q^2}$. Similarly the first form of the signature for the groups ${}^3D_4(q)$ and ${}^2E_6(q)$ requires the fields ${\bf F}_{q^3}$ and ${\bf F}_{q^2}$, respectively.

The possible series and the groups returned are:

**`"A"`**
$n\geq 0$, $A_n(q)$, the special linear group ${\operatorname{SL}}(n + 1, q)$.

**`"B"`**
$n\geq 1$, $B_n(q)$, the orthogonal group $\Omega(2n + 1, q)$.

**`"C"`**
$n\geq 1$, $C_n(q)$, the symplectic group ${\operatorname{Sp}}(2n, q)$.

**`"D"`**
$n\geq 1$, $D_n(q)$, the orthogonal group $\Omega^+(2n, q)$.

**`"E"`**
$n\in\lbrace6,7,8\rbrace$, the exceptional groups $E_n(q)$. $E_6(q)$ is represented as a matrix group of degree 27. It is simple unless $q\equiv 1\bmod 3$, in which case its centre has order 3. $E_7(q)$ is represented as a matrix group of degree 56. It is simple unless $q\equiv 1\bmod 2$, in which case its centre has order 2. $E_8(q)$ is represented as a matrix group of degree $248$.

**`"F"`**
$n = 4$, the exceptional group $F_4(q)$ represented as a matrix group of degree 26. If $q = 3^k$ then this representation is reducible. An irreducible representation is not yet available.

**`"G"`**
$n = 2$, the exceptional group $G_2(q)$ represented as a matrix group of degree 7. If $q = 2^k$ then this representation is reducible. An irreducible representation of degree 6 can be obtained by setting the parameter `Irreducible := true`.

**`"2A"`**
$n\geq 1$, $K = {\bf F}_{q^2}$, the special unitary group ${}^2A_n(q) = {\operatorname{SU}}(n + 1, q)$.

**`"2B"`**
$n = 2$, $K = {\bf F}_{q}$, $q = 2^{2k+1}$, the Suzuki group ${}^2B_2(q) = {\operatorname{Sz}}(q)$.

**`"2D"`**
$n\geq 1$, $K ={\bf F}_{q}$, ${}^2D_n(q)$, the orthogonal group $\Omega^-(2n, q)$.

**`"3D"`**
$n = 4$, $K = {\bf F}_{q^3}$, the exceptional group ${}^3D_4(q)$.

**`"2E"`**
$n = 6$, $K = {\bf F}_{q^2}$, the exceptional group ${}^2E_6(q)$.

**`"2F"`**
$n = 4$, $K={\bf F}_{q}$, $q = 2^{2k+1}$, the Ree group ${}^2F_4(q)$, simple except when $q = 2$ when the derived group is simple and is returned by the function `TitsGroup`.

**`"2G"`**
$n = 2$, $K = {\bf F}_{q}$, $q = 3^{2k+1}$, the Ree group ${}^2G_2(q)$, simple except when $q = 3$.

#### The Orders of the Chevalley Groups

<a id="function-chevalleyorderpolynomial-monstgelt-rngintelt"></a>
##### `ChevalleyOrderPolynomial(type, n: parameters): MonStgElt, RngIntElt -> RngUPolElt`

The orders of the universal Chevalley groups $X_n(q)$ and ${}^tX_n(q)$ are polynomials in $q$. For the twisted groups of types ${}^2A_n$, ${}^3D_4$, and ${}^2E_6$ the parameter $q$ is the order of the fixed field of the Frobenius automorphism.

Other versions of Chevalley groups are quotients of universal Chevalley groups modulo a subgroup of the centre.

<a id="function-factoredchevalleygrouporder-monstgelt-rngintelt-fldfin"></a>
##### `FactoredChevalleyGroupOrder(type, n, F: parameters): MonStgElt, RngIntElt, FldFin -> RngIntEltFact`

<a id="function-factoredchevalleygrouporder-monstgelt-rngintelt-rngintelt"></a>
##### `FactoredChevalleyGroupOrder(type, n, q: parameters): MonStgElt, RngIntElt, RngIntElt -> RngIntEltFact`

```magma
Proof  : BoolElt                      Default: true
Version: MonStgElt                    Default: "Default"
```

<a id="function-chevalleygrouporder-monstgelt-rngintelt-fldfin"></a>
##### `ChevalleyGroupOrder(type, n, F: parameters): MonStgElt, RngIntElt, FldFin -> RngIntEltFact`

<a id="function-chevalleygrouporder-monstgelt-rngintelt-rngintelt"></a>
##### `ChevalleyGroupOrder(type, n, q: parameters): MonStgElt, RngIntElt, RngIntElt -> RngIntEltFact`

```magma
Version: MonStgElt                    Default: "Default"
```

The (factored) order of the Chevalley group of a given type and rank over the field $F$ (or ${\bf F}_{q}$). The default is the order of the group returned by `ChevalleyGroup`, which except for types $B_n$, $D_n$, and ${}^2D_n$ is the universal group. The orders of the universal and adjoint Chevalley group can be obtained by setting the parameter `Version` to `Universal` or `Adjoint`. In the factored version the value of `Proof` is passed to the Magma’s factorisation function (q.v.).

#### Classical Groups

Magma offers several functions to construct the classical groups. For most of these functions, it is possible to specify the particular group by giving one of the following combinations of arguments:

**(i)**
The degree $n$ and the coefficient field $K$ of the desired matrix group;

**(ii)**
The degree $n$ of the desired matrix group and a prime power $q$ which relates the group to the appropriate Lie algebra. With the exception of the unitary groups (which will be defined over ${\bf F}_{q^2}$), the resulting group will be defined over ${\bf F}_{q}$; or,

**(iii)**
A full vector space $V = K^n$ on which the desired matrix group should act naturally.

##### Linear Groups

<a id="function-generallineargroup"></a>
###### `GeneralLinearGroup(n, q): RngIntElt, RngIntElt -> GrpMat`

<a id="function-generallineargroup-rngintelt-fldfin"></a>
###### `GeneralLinearGroup(n, K): RngIntElt, FldFin -> GrpMat`

<a id="function-generallineargroup-modtuprng"></a>
###### `GeneralLinearGroup(V): ModTupRng -> GrpMat`

<a id="function-gl-rngintelt-rngintelt"></a>
###### `GL(n, q): RngIntElt, RngIntElt -> GrpMat`

<a id="function-gl-rngintelt-fldfin"></a>
###### `GL(n, K): RngIntElt, FldFin -> GrpMat`

<a id="function-gl-modtuprng"></a>
###### `GL(V): ModTupRng -> GrpMat`

Here $n$ is a positive integer, $q$ is the power of a prime, $K$ is a finite field ${\bf F}_{q}$, and $V$ is an $n$-dimensional vector space over $K$. This function constructs the general linear group ${\operatorname{GL}}(n, q)$ (resp. ${\operatorname{GL}}(n, K)$, ${\operatorname{GL}}(V)$) in terms of generating matrices. The intrinsic name may be abbreviated to `GL`.

<a id="function-speciallineargroup-rngintelt-rngintelt"></a>
###### `SpecialLinearGroup(n, q): RngIntElt, RngIntElt -> GrpMat`

<a id="function-speciallineargroup-rngintelt-fldfin"></a>
###### `SpecialLinearGroup(n, K): RngIntElt, FldFin -> GrpMat`

<a id="function-speciallineargroup-modtuprng"></a>
###### `SpecialLinearGroup(V): ModTupRng -> GrpMat`

<a id="function-sl-rngintelt-rngintelt"></a>
###### `SL(n, q): RngIntElt, RngIntElt -> GrpMat`

<a id="function-sl-rngintelt-fldfin"></a>
###### `SL(n, K): RngIntElt, FldFin -> GrpMat`

<a id="function-sl-modtuprng"></a>
###### `SL(V): ModTupRng -> GrpMat`

Here $n$ is a positive integer, $q$ is the power of a prime, $K$ is a finite field ${\bf F}_{q}$, and $V$ is an $n$-dimensional vector space over $K$. This function constructs the special linear group ${\operatorname{SL}}(n, q)$ (resp. ${\operatorname{SL}}(n, K)$, ${\operatorname{SL}}(V)$), namely the group of $n\times n$ matrices of determinant 1, in terms of generating matrices. The intrinsic name may be abbreviated to `SL`.

<a id="function-affinegenerallineargroup-cat-rngintelt-rngintelt"></a>
###### `AffineGeneralLinearGroup(GrpMat, n, q): Cat, RngIntElt, RngIntElt -> GrpMat`

<a id="function-affinegenerallineargroup-cat-rngintelt-fldfin"></a>
###### `AffineGeneralLinearGroup(GrpMat, n, K): Cat, RngIntElt, FldFin -> GrpMat`

<a id="function-affinegenerallineargroup-cat-modtuprng"></a>
###### `AffineGeneralLinearGroup(GrpMat, V): Cat, ModTupRng -> GrpMat`

<a id="function-affinegenerallineargroup-grpperm"></a>
###### `AffineGeneralLinearGroup(E): GrpPerm -> GrpPerm`

<a id="function-agl-cat-rngintelt-rngintelt"></a>
###### `AGL(GrpMat, n, q): Cat, RngIntElt, RngIntElt -> GrpMat`

<a id="function-agl-cat-rngintelt-fldfin"></a>
###### `AGL(GrpMat, n, K): Cat, RngIntElt, FldFin -> GrpMat`

<a id="function-agl-cat-modtuprng"></a>
###### `AGL(GrpMat, V): Cat, ModTupRng -> GrpMat`

<a id="function-agl-grpperm"></a>
###### `AGL(E): GrpPerm -> GrpPerm`

Here $n$ is a positive integer greater than or equal to $2$, $q$ is the power of a prime, $K$ is a finite field ${\bf F}_{q}$, and $V$ is an $n$-dimensional vector space over $K$. This function constructs the affine general linear group ${\operatorname{AGL}}(n, q)$ (resp. ${\operatorname{AGL}}(n, K)$, ${\operatorname{AGL}}(V)$) as a subgroup of ${\operatorname{GL}}(n+1, K)$. If the category name `GrpMat` is omitted the affine group will be returned as a permutation group. The intrinsic name may be abbreviated to `AGL`.

If $E$ is a regular elementary abelian permutation group the function constructs the affine general linear group of $E$, regarded as a vector space over the field ${\bf F}_{p}$, where $p$ is the exponent of $E$.

<a id="function-affinespeciallineargroup-cat-rngintelt-rngintelt"></a>
###### `AffineSpecialLinearGroup(GrpMat, n, q): Cat, RngIntElt, RngIntElt -> GrpMat`

<a id="function-affinespeciallineargroup-cat-rngintelt-fldfin"></a>
###### `AffineSpecialLinearGroup(GrpMat, n, K): Cat, RngIntElt, FldFin -> GrpMat`

<a id="function-affinespeciallineargroup-cat-modtuprng"></a>
###### `AffineSpecialLinearGroup(GrpMat, V): Cat, ModTupRng -> GrpMat`

<a id="function-asl-cat-rngintelt-rngintelt"></a>
###### `ASL(GrpMat, n, q): Cat, RngIntElt, RngIntElt -> GrpMat`

<a id="function-asl-cat-rngintelt-fldfin"></a>
###### `ASL(GrpMat, n, K): Cat, RngIntElt, FldFin -> GrpMat`

<a id="function-asl-cat-modtuprng"></a>
###### `ASL(GrpMat, V): Cat, ModTupRng -> GrpMat`

Here $n$ is a positive integer greater than or equal to $2$, $q$ is the power of a prime, $K$ is a finite field ${\bf F}_{q}$, and $V$ is an $n$-dimensional vector space over $K$. This function constructs the affine special linear group ${\operatorname{ASL}}(n, q)$ (resp. ${\operatorname{ASL}}(n, K)$, ${\operatorname{ASL}}(V)$) as a subgroup of ${\operatorname{SL}}(n+1, K)$. If the category name `GrpMat` is omitted, the affine group will be returned as a permutation group. The intrinsic name may be abbreviated to `ASL`.

##### Unitary Groups

<a id="function-conformalunitarygroup"></a>
###### `ConformalUnitaryGroup(n, q): RngIntElt, RngIntElt -> GrpMat`

<a id="function-conformalunitarygroup-rngintelt-fldfin"></a>
###### `ConformalUnitaryGroup(n, K): RngIntElt, FldFin -> GrpMat`

<a id="function-conformalunitarygroup-modtuprng"></a>
###### `ConformalUnitaryGroup(V): ModTupRng -> GrpMat`

<a id="function-cu-rngintelt-rngintelt"></a>
###### `CU(n, q): RngIntElt, RngIntElt -> GrpMat`

<a id="function-cu-rngintelt-fldfin"></a>
###### `CU(n, K): RngIntElt, FldFin -> GrpMat`

<a id="function-cu-modtuprng"></a>
###### `CU(V): ModTupRng -> GrpMat`

Here $n \geq 2$ is a positive integer, $q$ is the power of a prime, $K$ is the finite field ${\bf F}_{q^2}$, and $V$ is the $n$-dimensional vector space over $K$. This function constructs the conformal unitary group ${\operatorname{CU}}(n, q)$ (resp. ${\operatorname{CU}}(n, K)$, ${\operatorname{CU}}(V)$) in terms of generating matrices. It preserves the standard hermitian form up to a non-zero scalar multiple. The intrinsic name may be abbreviated to `CU`.

<a id="function-generalunitarygroup-rngintelt-rngintelt"></a>
###### `GeneralUnitaryGroup(n, q): RngIntElt, RngIntElt -> GrpMat`

<a id="function-generalunitarygroup-rngintelt-fldfin"></a>
###### `GeneralUnitaryGroup(n, K): RngIntElt, FldFin -> GrpMat`

<a id="function-generalunitarygroup-modtuprng"></a>
###### `GeneralUnitaryGroup(V): ModTupRng -> GrpMat`

<a id="function-gu-rngintelt-rngintelt"></a>
###### `GU(n, q): RngIntElt, RngIntElt -> GrpMat`

<a id="function-gu-rngintelt-fldfin"></a>
###### `GU(n, K): RngIntElt, FldFin -> GrpMat`

<a id="function-gu-modtuprng"></a>
###### `GU(V): ModTupRng -> GrpMat`

Here $n \geq 2$ is a positive integer, $q$ is the power of a prime, $K$ is the finite field ${\bf F}_{q^2}$, and $V$ is the $n$-dimensional vector space over $K$. This function constructs the general unitary group ${\operatorname{GU}}(n, q)$ (resp. ${\operatorname{GU}}(n, K)$, ${\operatorname{GU}}(V)$) in terms of generating matrices. It preserves the standard hermitian form. The intrinsic name may be abbreviated to `GU`.

<a id="function-specialunitarygroup-rngintelt-rngintelt"></a>
###### `SpecialUnitaryGroup(n, q): RngIntElt, RngIntElt -> GrpMat`

<a id="function-specialunitarygroup-rngintelt-fldfin"></a>
###### `SpecialUnitaryGroup(n, K): RngIntElt, FldFin -> GrpMat`

<a id="function-specialunitarygroup-modtuprng"></a>
###### `SpecialUnitaryGroup(V): ModTupRng -> GrpMat`

<a id="function-su-rngintelt-rngintelt"></a>
###### `SU(n, q): RngIntElt, RngIntElt -> GrpMat`

<a id="function-su-rngintelt-fldfin"></a>
###### `SU(n, K): RngIntElt, FldFin -> GrpMat`

<a id="function-su-modtuprng"></a>
###### `SU(V): ModTupRng -> GrpMat`

Here $n$ is an integer greater than or equal to 2, $q$ is the power of a prime, $K$ is the finite field ${\bf F}_{q^2}$, and $V$ is the $n$-dimensional vector space over $K$. This function constructs the special unitary group ${\operatorname{SU}}(n, q)$ (resp. ${\operatorname{SU}}(n, K)$, ${\operatorname{SU}}(V)$) in terms of generating matrices. The intrinsic name may be abbreviated to `SU`.

<a id="function-conformalspecialunitarygroup-rngintelt-rngintelt"></a>
###### `ConformalSpecialUnitaryGroup(n, q): RngIntElt, RngIntElt -> GrpMat`

<a id="function-csu-rngintelt-rngintelt"></a>
###### `CSU(n, q): RngIntElt, RngIntElt -> GrpMat`

For an integer $n\ge 2$ and a prime power $q$, this function constructs the normaliser of the special unitary group ${\operatorname{SU}}(n,q)$ in ${\operatorname{SL}}(n,q^2)$. The intrinsic name may be abbreviated to `CSU`.

##### Symplectic Groups

<a id="function-conformalsymplecticgroup-rngintelt-rngintelt"></a>
###### `ConformalSymplecticGroup(n, q): RngIntElt, RngIntElt -> GrpMat`

<a id="function-conformalsymplecticgroup-rngintelt-fldfin"></a>
###### `ConformalSymplecticGroup(n, K): RngIntElt, FldFin -> GrpMat`

<a id="function-conformalsymplecticgroup-modtuprng"></a>
###### `ConformalSymplecticGroup(V): ModTupRng -> GrpMat`

<a id="function-csp-rngintelt-rngintelt"></a>
###### `CSp(n, q): RngIntElt, RngIntElt -> GrpMat`

<a id="function-csp-rngintelt-fldfin"></a>
###### `CSp(n, K): RngIntElt, FldFin -> GrpMat`

<a id="function-csp-modtuprng"></a>
###### `CSp(V): ModTupRng -> GrpMat`

Here $n$ is an even integer greater than or equal to $4$, $q$ is the power of a prime, $K$ is the finite field ${\bf F}_{q}$, and $V$ is the $n$-dimensional vector space over $K$. This function constructs the conformal symplectic group ${\operatorname{CSp}}(n, q)$ (resp. ${\operatorname{CSp}}(n, K)$, ${\operatorname{CSp}}(V)$) in terms of generating matrices. It preserves the standard alternating form up to a non-zero scalar multiple. The intrinsic name may be abbreviated to `CSp`.

<a id="function-symplecticgroup-rngintelt-rngintelt"></a>
###### `SymplecticGroup(n, q): RngIntElt, RngIntElt -> GrpMat`

<a id="function-symplecticgroup-rngintelt-fldfin"></a>
###### `SymplecticGroup(n, K): RngIntElt, FldFin -> GrpMat`

<a id="function-symplecticgroup-modtuprng"></a>
###### `SymplecticGroup(V): ModTupRng -> GrpMat`

<a id="function-sp-rngintelt-rngintelt"></a>
###### `Sp(n, q): RngIntElt, RngIntElt -> GrpMat`

<a id="function-sp-rngintelt-fldfin"></a>
###### `Sp(n, K): RngIntElt, FldFin -> GrpMat`

<a id="function-sp-modtuprng"></a>
###### `Sp(V): ModTupRng -> GrpMat`

Here $n$ is an even integer greater than or equal to $4$, $q$ is the power of a prime, $K$ is the finite field ${\bf F}_{q}$, and $V$ is the $n$-dimensional vector space over $K$. This function constructs the symplectic group ${\operatorname{Sp}}(n, q)$ (resp. ${\operatorname{Sp}}(n, K)$, ${\operatorname{Sp}}(V)$) in terms of generating matrices. It preserves the standard alternating form. The intrinsic name may be abbreviated to `Sp`.

##### Orthogonal and Spin Groups

<a id="function-conformalorthogonalgroup-rngintelt-rngintelt"></a>
###### `ConformalOrthogonalGroup(n, q): RngIntElt, RngIntElt -> GrpMat`

<a id="function-conformalorthogonalgroup-rngintelt-fldfin"></a>
###### `ConformalOrthogonalGroup(n, K): RngIntElt, FldFin -> GrpMat`

<a id="function-conformalorthogonalgroup-modtuprng"></a>
###### `ConformalOrthogonalGroup(V): ModTupRng -> GrpMat`

<a id="function-co-rngintelt-rngintelt"></a>
###### `CO(n, q): RngIntElt, RngIntElt -> GrpMat`

<a id="function-co-rngintelt-fldfin"></a>
###### `CO(n, K): RngIntElt, FldFin -> GrpMat`

<a id="function-co-modtuprng"></a>
###### `CO(V): ModTupRng -> GrpMat`

Here $n$ is an odd integer greater than or equal to $3$, $q$ is the power of a prime, $K$ is the finite field ${\bf F}_{q}$, and $V$ is the $n$-dimensional vector space over $K$. This function constructs the conformal orthogonal group ${\operatorname{CO}}(n, q)$ (resp. ${\operatorname{CO}}(n, K)$, ${\operatorname{CO}}(V)$) in terms of generating matrices. It preserves the standard quadratic form up to a non-zero scalar multiple. The intrinsic name may be abbreviated to `CO`.

<a id="function-generalorthogonalgroup-rngintelt-rngintelt"></a>
###### `GeneralOrthogonalGroup(n, q): RngIntElt, RngIntElt -> GrpMat`

<a id="function-generalorthogonalgroup-rngintelt-fldfin"></a>
###### `GeneralOrthogonalGroup(n, K): RngIntElt, FldFin -> GrpMat`

<a id="function-generalorthogonalgroup-modtuprng"></a>
###### `GeneralOrthogonalGroup(V): ModTupRng -> GrpMat`

<a id="function-go-rngintelt-rngintelt"></a>
###### `GO(n, q): RngIntElt, RngIntElt -> GrpMat`

<a id="function-go-rngintelt-fldfin"></a>
###### `GO(n, K): RngIntElt, FldFin -> GrpMat`

<a id="function-go-modtuprng"></a>
###### `GO(V): ModTupRng -> GrpMat`

Here $n$ is an odd integer greater than or equal to $3$, $q$ is the power of a prime, $K$ is the finite field ${\bf F}_{q}$, and $V$ is the $n$-dimensional vector space over $K$. This function constructs the general orthogonal group ${\operatorname{GO}}(n, q)$ (resp. ${\operatorname{GO}}(n, K)$, ${\operatorname{GO}}(V)$) in terms of generating matrices. It preserves the standard quadratic form. The intrinsic name may be abbreviated to `GO`.

<a id="example-ex-681a40"></a>
###### `Example: Orthogonal Group in Odd Dimension (ex-681a40)`

We create the $5$-dimensional orthogonal group $G$ over ${\bf F}_{4}$. Note that $G$ is defined by a standard non-degenerate quadratic form $Q$ and it preserves the polar form of $Q$. Since the characteristic is 2 this is a symplectic form. In addition, the dimension is odd and so the symplectic form has a non-trivial radical, which is invariant under the action of $G$. We check that $Q$ is non-degenerate; that is, there are no singular elements in the radical.

```magma
> G := GO(5,4);
> qq := InvariantQuadraticForms(G);
> qq;
[
    [    0     0     0     0     1]
    [    0     0     0     1     0]
    [    0     0     1     0     0]
    [    0     0     0     0     0]
    [    0     0     0     0     0]
]
> Q := qq[1];
> Q eq StandardQuadraticForm(5,4);
true
> V := QuadraticSpace(Q);
> R := Radical(V);
> Dimension(R);
1
> S := SingularRadical(V);
> Dimension(S);
0;
> QuadraticNorm(R.1);
1
> R.1;
(    0     0     1     0     0)
> forall{ g : g in Generators(G) | R.1 * g eq R.1 };
true
```

<a id="function-specialorthogonalgroup-rngintelt-rngintelt"></a>
###### `SpecialOrthogonalGroup(n, q): RngIntElt, RngIntElt -> GrpMat`

<a id="function-specialorthogonalgroup-rngintelt-fldfin"></a>
###### `SpecialOrthogonalGroup(n, K): RngIntElt, FldFin -> GrpMat`

<a id="function-specialorthogonalgroup-modtuprng"></a>
###### `SpecialOrthogonalGroup(V): ModTupRng -> GrpMat`

<a id="function-so-rngintelt-rngintelt"></a>
###### `SO(n, q): RngIntElt, RngIntElt -> GrpMat`

<a id="function-so-rngintelt-fldfin"></a>
###### `SO(n, K): RngIntElt, FldFin -> GrpMat`

<a id="function-so-modtuprng"></a>
###### `SO(V): ModTupRng -> GrpMat`

Here $n$ is an odd integer greater than or equal to $3$, $q$ is the power of a prime, $K$ is the finite field ${\bf F}_{q}$, and $V$ is the $n$-dimensional vector space over $K$. This function constructs the special orthogonal group ${\operatorname{SO}}(n, q)$ (resp. ${\operatorname{SO}}(n, K)$, ${\operatorname{SO}}(V)$) in terms of generating matrices. The intrinsic name may be abbreviated to `SO`. In characteristic 2 the group coincides with the general orthogonal group.

<a id="function-conformalspecialorthogonalgroup-rngintelt-rngintelt"></a>
###### `ConformalSpecialOrthogonalGroup(n, q): RngIntElt, RngIntElt -> GrpMat`

<a id="function-cso-rngintelt-rngintelt"></a>
###### `CSO(n, q): RngIntElt, RngIntElt -> GrpMat`

For an odd integer $n\ge 3$ and a prime power $q$, this function constructs the normaliser of the special orthogonal group ${\operatorname{SO}}(n,q)$ in ${\operatorname{SL}}(n,q)$. The intrinsic name may be abbreviated to `CSO`.

<a id="function-conformalorthogonalgroupplus-rngintelt-rngintelt"></a>
###### `ConformalOrthogonalGroupPlus(n, q): RngIntElt, RngIntElt -> GrpMat`

<a id="function-conformalorthogonalgroupplus-rngintelt-fldfin"></a>
###### `ConformalOrthogonalGroupPlus(n, K): RngIntElt, FldFin -> GrpMat`

<a id="function-conformalorthogonalgroupplus-modtuprng"></a>
###### `ConformalOrthogonalGroupPlus(V): ModTupRng -> GrpMat`

<a id="function-coplus-rngintelt-rngintelt"></a>
###### `COPlus(n, q): RngIntElt, RngIntElt -> GrpMat`

<a id="function-coplus-rngintelt-fldfin"></a>
###### `COPlus(n, K): RngIntElt, FldFin -> GrpMat`

<a id="function-coplus-modtuprng"></a>
###### `COPlus(V): ModTupRng -> GrpMat`

Here $n$ is an even integer greater than or equal to $2$, $q$ is the power of a prime, $K$ is the finite field ${\bf F}_{q}$, and $V$ is the $n$-dimensional vector space over $K$. This function constructs the conformal orthogonal group ${\operatorname{CO}}^+(n, q)$ (resp. ${\operatorname{CO}}^+(n, K)$, ${\operatorname{CO}}^+(V)$) in terms of generating matrices. It preserves the standard quadratic form up to a non-zero scalar multiple. The intrinsic name may be abbreviated to `COPlus`.

<a id="function-generalorthogonalgroupplus-rngintelt-rngintelt"></a>
###### `GeneralOrthogonalGroupPlus(n, q): RngIntElt, RngIntElt -> GrpMat`

<a id="function-generalorthogonalgroupplus-rngintelt-fldfin"></a>
###### `GeneralOrthogonalGroupPlus(n, K): RngIntElt, FldFin -> GrpMat`

<a id="function-generalorthogonalgroupplus-modtuprng"></a>
###### `GeneralOrthogonalGroupPlus(V): ModTupRng -> GrpMat`

<a id="function-goplus-rngintelt-rngintelt"></a>
###### `GOPlus(n, q): RngIntElt, RngIntElt -> GrpMat`

<a id="function-goplus-rngintelt-fldfin"></a>
###### `GOPlus(n, K): RngIntElt, FldFin -> GrpMat`

<a id="function-goplus-modtuprng"></a>
###### `GOPlus(V): ModTupRng -> GrpMat`

Here $n$ is an even integer greater than or equal to $2$, $q$ is the power of a prime, $K$ is the finite field ${\bf F}_{q}$, and $V$ is the $n$-dimensional vector space over $K$. This function constructs the general orthogonal group ${\operatorname{GO}}^+(n, q)$ (resp. ${\operatorname{GO}}^+(n, K)$, ${\operatorname{GO}}^+(V)$) in terms of generating matrices. It preserves the standard quadratic form. The intrinsic name may be abbreviated to `GOPlus`.

<a id="function-specialorthogonalgroupplus-rngintelt-rngintelt"></a>
###### `SpecialOrthogonalGroupPlus(n, q): RngIntElt, RngIntElt -> GrpMat`

<a id="function-specialorthogonalgroupplus-rngintelt-fldfin"></a>
###### `SpecialOrthogonalGroupPlus(n, K): RngIntElt, FldFin -> GrpMat`

<a id="function-specialorthogonalgroupplus-modtuprng"></a>
###### `SpecialOrthogonalGroupPlus(V): ModTupRng -> GrpMat`

<a id="function-soplus-rngintelt-rngintelt"></a>
###### `SOPlus(n, q): RngIntElt, RngIntElt -> GrpMat`

<a id="function-soplus-rngintelt-fldfin"></a>
###### `SOPlus(n, K): RngIntElt, FldFin -> GrpMat`

<a id="function-soplus-modtuprng"></a>
###### `SOPlus(V): ModTupRng -> GrpMat`

Here $n$ is an even integer greater than or equal to $2$, $q$ is the power of a prime, $K$ is the finite field ${\bf F}_{q}$, and $V$ is the $n$-dimensional vector space over $K$. This function constructs the special orthogonal group ${\operatorname{SO}}^+(n, q)$ (resp. ${\operatorname{SO}}^+(n, K)$, ${\operatorname{SO}}^+(V)$) in terms of generating matrices. The intrinsic name may be abbreviated to `SOPlus`. In characteristic 2 the group coincides with `GOPlus` and is *not* the kernel of the Dickson invariant.

<a id="function-conformalspecialorthogonalgroupplus-rngintelt-rngintelt"></a>
###### `ConformalSpecialOrthogonalGroupPlus(n, q): RngIntElt, RngIntElt -> GrpMat`

<a id="function-csoplus-rngintelt-rngintelt"></a>
###### `CSOPlus(n, q): RngIntElt, RngIntElt -> GrpMat`

For an odd integer $n\ge 3$ and a prime power $q$, this function constructs the normaliser of the special orthogonal group ${\operatorname{SO}}^+(n,q)$ in ${\operatorname{SL}}(n,q)$. The intrinsic name may be abbreviated to `CSOPlus`.

<a id="function-conformalorthogonalgroupminus-rngintelt-rngintelt"></a>
###### `ConformalOrthogonalGroupMinus(n, q): RngIntElt, RngIntElt -> GrpMat`

<a id="function-conformalorthogonalgroupminus-rngintelt-fldfin"></a>
###### `ConformalOrthogonalGroupMinus(n, K): RngIntElt, FldFin -> GrpMat`

<a id="function-conformalorthogonalgroupminus-modtuprng"></a>
###### `ConformalOrthogonalGroupMinus(V): ModTupRng -> GrpMat`

<a id="function-cominus-rngintelt-rngintelt"></a>
###### `COMinus(n, q): RngIntElt, RngIntElt -> GrpMat`

<a id="function-cominus-rngintelt-fldfin"></a>
###### `COMinus(n, K): RngIntElt, FldFin -> GrpMat`

<a id="function-cominus-modtuprng"></a>
###### `COMinus(V): ModTupRng -> GrpMat`

Here $n$ is an even integer greater than or equal to $2$, $q$ is the power of a prime, $K$ is the finite field ${\bf F}_{q}$, and $V$ is the $n$-dimensional vector space over $K$. This function constructs the conformal orthogonal group ${\operatorname{CO}}^-(n, q)$ (resp. ${\operatorname{CO}}^-(n, K)$, ${\operatorname{CO}}^-(V)$) in terms of generating matrices. It preserves the standard quadratic form (of Minus type) up to a non-zero scalar multiple. The intrinsic name may be abbreviated to `COMinus`.

<a id="function-generalorthogonalgroupminus-rngintelt-rngintelt"></a>
###### `GeneralOrthogonalGroupMinus(n, q): RngIntElt, RngIntElt -> GrpMat`

<a id="function-generalorthogonalgroupminus-rngintelt-fldfin"></a>
###### `GeneralOrthogonalGroupMinus(n, K): RngIntElt, FldFin -> GrpMat`

<a id="function-generalorthogonalgroupminus-modtuprng"></a>
###### `GeneralOrthogonalGroupMinus(V): ModTupRng -> GrpMat`

<a id="function-gominus-rngintelt-rngintelt"></a>
###### `GOMinus(n, q): RngIntElt, RngIntElt -> GrpMat`

<a id="function-gominus-rngintelt-fldfin"></a>
###### `GOMinus(n, K): RngIntElt, FldFin -> GrpMat`

<a id="function-gominus-modtuprng"></a>
###### `GOMinus(V): ModTupRng -> GrpMat`

Here $n$ is an even integer greater than or equal to $2$, $q$ is the power of a prime, $K$ is the finite field ${\bf F}_{q}$, and $V$ is the $n$-dimensional vector space over $K$. This function constructs the general orthogonal group ${\operatorname{GO}}^-(n, q)$ (resp. ${\operatorname{GO}}^-(n, K)$, ${\operatorname{GO}}^-(V)$) in terms of generating matrices. It preserves the standard quadratic form (of Minus type). The intrinsic name may be abbreviated to `GOMinus`.

<a id="function-specialorthogonalgroupminus-rngintelt-rngintelt"></a>
###### `SpecialOrthogonalGroupMinus(n, q): RngIntElt, RngIntElt -> GrpMat`

<a id="function-specialorthogonalgroupminus-rngintelt-fldfin"></a>
###### `SpecialOrthogonalGroupMinus(n, K): RngIntElt, FldFin -> GrpMat`

<a id="function-specialorthogonalgroupminus-modtuprng"></a>
###### `SpecialOrthogonalGroupMinus(V): ModTupRng -> GrpMat`

<a id="function-sominus-rngintelt-rngintelt"></a>
###### `SOMinus(n, q): RngIntElt, RngIntElt -> GrpMat`

<a id="function-sominus-rngintelt-fldfin"></a>
###### `SOMinus(n, K): RngIntElt, FldFin -> GrpMat`

<a id="function-sominus-modtuprng"></a>
###### `SOMinus(V): ModTupRng -> GrpMat`

Here $n$ is an even integer greater than or equal to $2$, $q$ is the power of a prime, $K$ is the finite field ${\bf F}_{q}$, and $V$ is the $n$-dimensional vector space over $K$. This function constructs the special orthogonal group ${\operatorname{SO}}^-(n, q)$ (resp. ${\operatorname{SO}}^-(n, K)$, ${\operatorname{SO}}^-(V)$) in terms of generating matrices. The intrinsic name may be abbreviated to `SOMinus`. In characteristic 2 the group coincides with `GOMinus` and is *not* the kernel of the Dickson invariant.

<a id="function-conformalspecialorthogonalgroupminus-rngintelt-rngintelt"></a>
###### `ConformalSpecialOrthogonalGroupMinus(n, q): RngIntElt, RngIntElt -> GrpMat`

<a id="function-csominus-rngintelt-rngintelt"></a>
###### `CSOMinus(n, q): RngIntElt, RngIntElt -> GrpMat`

For an odd integer $n\ge 3$ and a prime power $q$, this function constructs the normaliser of the special orthogonal group ${\operatorname{SO}}^-(n,q)$ in ${\operatorname{SL}}(n,q)$. The intrinsic name may be abbreviated to `CSOMinus`.

<a id="function-omega-rngintelt-rngintelt"></a>
###### `Omega(n, q): RngIntElt, RngIntElt -> GrpMat`

<a id="function-omega-rngintelt-fldfin"></a>
###### `Omega(n, K): RngIntElt, FldFin -> GrpMat`

<a id="function-omega-modtuprng"></a>
###### `Omega(V): ModTupRng -> GrpMat`

Here $n$ is an odd integer greater than or equal to $3$, $q$ is a power of a prime, $K$ is the finite field ${\bf F}_{q}$, and $V$ is the $n$-dimensional vector space over $K$. This function constructs the orthogonal group $\Omega(n, K)$ (resp. $\Omega(n, K)$, $\Omega(V)$) in terms of two generating matrices. If $q$ is odd, the group $\Omega(n, K)$ is the kernel of the spinor norm map on ${\operatorname{SO}}(n, K)$); if $q$ is even, it is the kernel of the Dickson invariant.

<a id="function-omegaplus-rngintelt-rngintelt"></a>
###### `OmegaPlus(n, q): RngIntElt, RngIntElt -> GrpMat`

<a id="function-omegaplus-rngintelt-fldfin"></a>
###### `OmegaPlus(n, K): RngIntElt, FldFin -> GrpMat`

<a id="function-omegaplus-modtuprng"></a>
###### `OmegaPlus(V): ModTupRng -> GrpMat`

Here $n$ is an even integer greater than or equal to $2$, $q$ is a power of a prime, $K$ is the finite field ${\bf F}_{q}$, and $V$ is the $n$-dimensional vector space over $K$. This function constructs the orthogonal group $\Omega^+(n, q)$ (resp. $\Omega^+(n, K)$, $\Omega^+(V)$) in terms of two generating matrices. If $q$ is odd, the group $\Omega^+(n, K)$ is the kernel of the spinor norm map on ${\operatorname{SO}}^+(n, K)$. If $q$ is even, it is the kernel of the Dickson invariant.

<a id="function-omegaminus-rngintelt-rngintelt"></a>
###### `OmegaMinus(n, q): RngIntElt, RngIntElt -> GrpMat`

<a id="function-omegaminus-rngintelt-fldfin"></a>
###### `OmegaMinus(n, K): RngIntElt, FldFin -> GrpMat`

<a id="function-omegaminus-modtuprng"></a>
###### `OmegaMinus(V): ModTupRng -> GrpMat`

Here $n$ is an even integer greater than or equal to $2$, $q$ is a power of a prime, $K$ is the finite field ${\bf F}_{q}$, and $V$ is the $n$-dimensional vector space over $K$. This function constructs the orthogonal group $\Omega^-(n, q)$ (resp. $\Omega^-(n, K)$, $\Omega^-(V)$) in terms of two generating matrices. If $q$ is odd, the group $\Omega^-(n, K)$ is the kernel of the spinor norm map on ${\operatorname{SO}}^-(n, K)$. If $q$ is even, it is the kernel of the Dickson invariant.

<a id="function-spin-rngintelt-rngintelt"></a>
###### `Spin(n, q): RngIntElt, RngIntElt -> GrpMat`

<a id="function-spin-rngintelt-fldfin"></a>
###### `Spin(n, K): RngIntElt, FldFin -> GrpMat`

<a id="function-spin-modtuprng"></a>
###### `Spin(V): ModTupRng -> GrpMat`

Here $n$ is an odd integer greater than or equal to $1$, $q$ is the power of a prime, $K$ is the finite field ${\bf F}_{q}$, and $V$ is the $n$-dimensional vector space over $K$. This function constructs the spin group ${\operatorname{Spin}}(n, K)$ (resp. ${\operatorname{Spin}}(n, K)$, ${\operatorname{Spin}}(V)$).

<a id="function-spinplus-rngintelt-rngintelt"></a>
###### `SpinPlus(n, q): RngIntElt, RngIntElt -> GrpMat`

<a id="function-spinplus-rngintelt-fldfin"></a>
###### `SpinPlus(n, K): RngIntElt, FldFin -> GrpMat`

<a id="function-spinplus-modtuprng"></a>
###### `SpinPlus(V): ModTupRng -> GrpMat`

Here $n$ is an even integer greater than or equal to $2$, $q$ is the power of a prime, $K$ is the finite field ${\bf F}_{q}$, and $V$ is the $n$-dimensional vector space over $K$. This function constructs the spin group ${\operatorname{Spin}}^+(n, K)$ (resp. ${\operatorname{Spin}}^+(n, K)$, ${\operatorname{Spin}}^+(V)$).

<a id="function-spinminus-rngintelt-rngintelt"></a>
###### `SpinMinus(n, q): RngIntElt, RngIntElt -> GrpMat`

<a id="function-spinminus-rngintelt-fldfin"></a>
###### `SpinMinus(n, K): RngIntElt, FldFin -> GrpMat`

<a id="function-spinminus-modtuprng"></a>
###### `SpinMinus(V): ModTupRng -> GrpMat`

Here $n$ is an even integer greater than or equal to $4$, $q$ is the power of a prime, $K$ is the finite field ${\bf F}_{q}$, and $V$ is the $n$-dimensional vector space over $K$. This function constructs the spin group ${\operatorname{Spin}}^-(n, K)$ (resp. ${\operatorname{Spin}}^-(n, K)$, ${\operatorname{Spin}}^-(V)$).

#### Exceptional Groups

##### Suzuki Groups

The Suzuki groups are specified slightly differently, as the degree of the group is always four. Thus for this family of groups, the possible combinations of arguments are:

**(i)**
A finite field $K = {\bf F}_{2^{2m+1}}$, over which the resulting matrix group is defined;

**(ii)**
An integer $q = 2^{2m+1}$, corresponding to the field $K = {\bf F}_{q}$ over which the resulting matrix group is defined; or,

**(iii)**
A vector space $V = K^4$ where $K = {\bf F}_{2^{2m+1}}$ on which the resulting matrix group acts naturally. which the resulting

<a id="function-suzukigroup-rngintelt"></a>
###### `SuzukiGroup(q): RngIntElt -> GrpMat`

<a id="function-suzukigroup-fldfin"></a>
###### `SuzukiGroup(K): FldFin -> GrpMat`

<a id="function-suzukigroup-modtuprng"></a>
###### `SuzukiGroup(V): ModTupRng -> GrpMat`

Here $q$ is a prime power of the form $2^{2n+1}$, $K$ is the finite field ${\bf F}_{q}$, and $V$ is the $4$-dimensional vector space over $K$. This function constructs the Suzuki simple group ${\operatorname{Sz}}(q)$ (resp. ${\operatorname{Sz}}(K)$, ${\operatorname{Sz}}(V)$) in terms of two generating matrices. The intrinsic name may be abbreviated to `Sz`.

<a id="example-ex-df72cd"></a>
###### `Example: Symplectic Group of Dimension 10 (ex-df72cd)`

We create the $10$-dimensional symplectic group over ${\bf F}_{8}$:

```magma
> F<u> := FiniteField(8);
> G := SymplecticGroup(10, F);
> G;
MatrixGroup(10, GF(2, 3))
Generators:
[  u   0   0   0   0   0   0   0   0   0]
[  0   1   0   0   0   0   0   0   0   0]
[  0   0   1   0   0   0   0   0   0   0]
[  0   0   0   1   0   0   0   0   0   0]
[  0   0   0   0   u   0   0   0   0   0]
[  0   0   0   0   0   u   0   0   0   0]
[  0   0   0   0   0   0   1   0   0   0]
[  0   0   0   0   0   0   0   1   0   0]
[  0   0   0   0   0   0   0   0   1   0]
[  0   0   0   0   0   0   0   0   0 u^6]

[0 0 0 1 1 1 0 0 0 0]
[1 0 0 0 0 0 0 0 0 0]
[0 1 0 0 0 0 0 0 0 0]
[0 0 1 0 0 0 0 0 0 0]
[0 0 0 1 0 0 0 0 0 0]
[0 0 0 0 1 0 1 0 0 0]
[0 0 0 0 0 0 0 1 0 0]
[0 0 0 0 0 0 0 0 1 0]
[0 0 0 0 0 0 0 0 0 1]
[0 0 0 0 1 0 0 0 0 0]
```

<a id="example-ex-58f4ed"></a>
###### `Example: Creating a Suzuki Group (ex-58f4ed)`

We create the Suzuki group over ${\bf F}_{128}$:

```magma
> F<w> := FiniteField(128);
> V := VectorSpace(F, 4);
> S := SuzukiGroup(V);
> S;
MatrixGroup(4, GF(2, 7))
Generators:
[0 0 0 1]
[0 0 1 0]
[0 1 0 0]
[1 0 0 0]

[  w^8     0     0     0]
[    0 w^120     0     0]
[    0     0   w^7     0]
[    0     0     0 w^119]

[   1    0    0    0]
[ w^8    1    0    0]
[   0    w    1    0]
[w^17  w^9  w^8    1]
> Order(S);
34093383680
> FactoredOrder(S);
[ <2, 14>, <5, 1>, <29, 1>, <113, 1>, <127, 1> ]
```

##### Small Ree Groups

The Ree groups (${^2}G_2(q)$) are given in an irreducible matrix representation of degree seven. The possible combinations of arguments are:

**(i)**
A finite field $K = {\bf F}_{3^{2m+1}}$ with $m > 0$, over which the matrix group is defined.

**(ii)**
An integer $q = 3^{2m+1}$ with $m > 0$, corresponding to the field $K = {\bf F}_{q}$ over which the group is defined; or,

**(iii)**
A vector space $V = K^7$ where $K = {\bf F}_{3^{2m+1}}$ with $m > 0$, on which the matrix group acts naturally.

<a id="function-reegroup-rngintelt"></a>
###### `ReeGroup(q): RngIntElt -> GrpMat`

<a id="function-reegroup-fldfin"></a>
###### `ReeGroup(K): FldFin -> GrpMat`

<a id="function-reegroup-modtuprng"></a>
###### `ReeGroup(V): ModTupRng -> GrpMat`

Here $q$ is a prime power of the form $q = 3^{2m+1}$ with $m > 0$, $K$ is the finite field ${\bf F}_{q}$, and $V$ is the $7$-dimensional vector space over $K$. This function constructs the Ree group ${^2}G_2(q)$ (resp. ${^2}G_2(K)$, ${^2}G_2(V)$) in terms of standard generating matrices. The intrinsic name may be abbreviated to `Ree`.

##### Large Ree Groups

The Ree groups (${^2}F_4(q)$) are given in an irreducible matrix representation of degree twenty-six. The possible combinations of arguments are:

**(i)**
A finite field $K = {\bf F}_{2^{2m+1}}$ with $m > 0$, over which the matrix group is defined.

**(ii)**
An integer $q = 2^{2m+1}$ with $m > 0$, corresponding to the field $K = {\bf F}_{q}$ over which the group is defined; or,

**(iii)**
A vector space $V = K^{26}$ where $K = {\bf F}_{2^{2m+1}}$ with $m > 0$, on which the matrix group acts naturally.

<a id="function-largereegroup-rngintelt"></a>
###### `LargeReeGroup(q): RngIntElt -> GrpMat`

<a id="function-largereegroup-fldfin"></a>
###### `LargeReeGroup(K): FldFin -> GrpMat`

<a id="function-largereegroup-modtuprng"></a>
###### `LargeReeGroup(V): ModTupRng -> GrpMat`

Here $q$ is a prime power of the form $q = 2^{2m+1}$ with $m > 0$, $K$ is the finite field ${\bf F}_{q}$, and $V$ is the $26$-dimensional vector space over $K$. This function constructs the Ree group ${^2}F_4(q)$ (resp. ${^2}F_4(K)$, ${^2}F_4(V)$) in terms of standard generating matrices. The intrinsic name may be abbreviated to `LargeRee`.

<a id="secgrprec"></a>
<a id="id1"></a>
### Group Recognition

#### Constructive Recognition of Alternating Groups

<a id="function-recognisealternatingorsymmetric-grp-rngintelt"></a>
##### `RecogniseAlternatingOrSymmetric(G : parameters): Grp, RngIntElt -> BoolElt, Map, Map, Map, Map, BoolElt`

```magma
N         : RngIntElt                    Default: 0
Extension : BoolElt                      Default: false
Epsilon   : FldRElt                      Default: 0.01
Asymptotic: BoolElt                      Default: false
```

The input group $G$ is isomorphic to $H$, the alternating or symmetric group for some $n \geq 5$. Note that $G$ can be either a matrix or permutation representation of $H$.

The algorithm used is that of [[JLNP13](https://docs.magma-maths.org/references.md#cite-altsymrecogn)]. Since this is Las Vegas, there is a small probability controlled by the optional parameter `Epsilon` that it returns `false` incorrectly.

If the algorithm succeeds, then it returns `true`, an isomorphism from $G$ to $H$, an isomorphism from $H$ to $G$, the map from $G$ to its word group, and the map from the word group to $G$. The sixth value returned is `true` if $H$ is the symmetric group, otherwise false.

The optional parameter `N` is an upper bound for the degree of $H$. If `N` is 0, then the maximal theoretically possible bound for the degree is assumed; this is the degree of $G$ if $G$ is a permutation group, and $\max(9, d + 2)$ or $\max(9, d+1)$ if $G$ is a matrix group of degree $d$, depending on the characteristic of the field. If the optional parameter `Extension` is `true`, then $G$ is isomorphic to a central extension of $H$ for some $n \geq 5$. Now the first two maps returned are an epimorphism from $G$ onto $H$ with kernel $Z(G)$ and a map from $H$ to $G$ that induces an isomorphism from $H$ onto $G/Z(G)$.

If the optional parameter `Asymptotic` is `true`, then the map from $H$ to $G$ implements the asymptotically efficient algorithm of Beals et al. [[BLGN+03b](https://docs.magma-maths.org/references.md#cite-altsymrecog1)]. Otherwise, the algorithm employed for this map is that of [[BP00](https://docs.magma-maths.org/references.md#cite-bratus-pak)], which is usually faster for moderate degrees.

If the algorithm is not successful, then `false` is returned.

The algorithm consists of two parts. The first part finds the degree of the alternating group and constructs standard generators, cf. [[JLNP13](https://docs.magma-maths.org/references.md#cite-altsymrecogn)]. The second part verifies that these elements generate $G$, and constructs isomorphisms between $G$ and $H$, cf. [[BLGN+03b](https://docs.magma-maths.org/references.md#cite-altsymrecog1)]. The implementation of the first part was developed by Sebastian Jambor. The implementation of the second part was developed by Jonathan Conder; he also extended the algorithm to work for both $n \in \{5,\ldots,10\}$ and central extensions.

<a id="function-alternatingorsymmetricelementtoword-grp-grpelt"></a>
##### `AlternatingOrSymmetricElementToWord(G, g): Grp, GrpElt -> BoolElt, GrpSLPElt`

If $g \in G$ and $G$ has been recognised by `RecogniseAlternatingOrSymmetric`, this function returns `true` and an element of the word group for $G$ which evaluates to $g$. Otherwise, it returns `false`. This facilitates membership testing in $G$.

The implementation was developed by Jonathan Conder.

<a id="example-ex-98afe7"></a>
##### `Example: Recognising a Representation of A13 (ex-98afe7)`

We illustrate the use of these functions for a representation of $A_{13}$.

```magma
> A:= AlternatingGroup (13);
> H:= Stabiliser(A, {1,2});
> G := CosetImage (A, H);
> Degree (G);
78
> success, bb_to_perm, perm_to_bb, bb_to_wg, wg_to_bb, is_sym :=
> RecogniseAlternatingOrSymmetric (G);
>
> success;
true
> is_sym;
false
>
>  x:= Sym(78)!(1, 35, 16, 28, 14, 26, 69, 5, 74)(2, 54,
>  67, 18, 51, 63, 6, 50, 77)(3, 33, 78, 12, 34, 29, 19, 15, 73)
>  (4, 52, 61, 24, 49, 60, 68, 38, 64)(7, 20, 71, 17,
>  32, 11, 72, 8, 36)(9, 76, 47, 31, 56, 62, 13, 53, 59)
>  (10, 70, 57, 23, 37, 22, 21, 27, 25)(30, 45, 46, 43, 42,
>  44, 40, 41, 75)(39, 55, 65)(48, 66, 58);
>
> flag, w := AlternatingOrSymmetricElementToWord (G, x);
> "Is x in G?", flag;
Is x in G? true
> Evaluate (w, [G.i: i in [1..Ngens (G)]]) eq x;
true
>
> perm_image:= bb_to_perm(x);
> perm_image;
(1, 4, 9)(2, 6, 3, 5, 10, 7, 8, 11, 12)
>
> y := Random (G);
> w := bb_to_wg (y);
> Evaluate (w, [G.i: i in [1..Ngens (G)]]) eq y;
true
```

<a id="function-recognisesymmetric-grp-rngintelt"></a>
##### `RecogniseSymmetric(G, n: parameters): Grp, RngIntElt -> BoolElt, Map, Map, Map, Map, BoolElt`

```magma
maxtries : RngIntElt                    Default: 100n + 5000
Extension: BoolElt                      Default: false
```

The group $G$ should be known to be isomorphic to the symmetric group $S_n$ for some $n \ge 8$. The Bratus-Pak algorithm [[BP00](https://docs.magma-maths.org/references.md#cite-bratus-pak)] (implemented by Derek Holt) is used to define an isomorphism between $G$ and $S_n$. If successful, return `true`, homomorphism from $G$ to $S_n$, homomorphism from $S_n$ to $G$, the map from $G$ to its word group and the map from the word group to $G$.

If the optional parameter `Extension` is set, then the group $G$ should be known to be isomorphic either to $S_n$ or to a perfect central extension $2.S_n$. In that case, the first two maps returned will be a homomorphism from $G$ to $S_n$ and a map from $S_n$ to $G$ that induces a homomorphism onto $G/Z(G)$. The sixth value returned will be `true`, if $G \cong 2.S_n$ and `false`, if $G \cong 2.A_n$.

If unsuccessful, `false` is returned. This will always occur if the input group is not isomorphic to $S_n$ (or $2.S_n$ when `Extension` is set) with $n \ge 8$, and may occur occasionally even when $G$ is isomorphic to $S_n$. The optional parameter `maxtries` (default $100n + 5000$) can be used to control the number of random elements chosen before giving up.

<a id="function-symmetricelementtoword-grp-grpelt"></a>
##### `SymmetricElementToWord(G, g): Grp, GrpElt -> BoolElt, GrpSLPElt`

If $g$ is an element of $G$ which has been constructively recognised to be isomorphic to $S_n$ (or $2.S_n$), then return `true` and element of word group for $G$ which evaluates to $g$. Otherwise return `false`. This facilitates membership testing in $G$.

<a id="function-recognisealternating-grp-rngintelt"></a>
##### `RecogniseAlternating(G, n: parameters): Grp, RngIntElt -> BoolElt, Map, Map, Map, Map, BoolElt`

```magma
maxtries : RngIntElt                    Default: 100n + 5000
Extension: BoolElt                      Default: false
```

The group $G$ should be known to be isomorphic to the alternating group $A_n$ for some $n \ge 9$. The Bratus-Pak algorithm [[BP00](https://docs.magma-maths.org/references.md#cite-bratus-pak)] (implemented by Derek Holt) is used to define an isomorphism between $G$ and $A_n$. If successful, return `true`, homomorphism from $G$ to $A_n$, homomorphism from $A_n$ to $G$, the map from $G$ to its word group and the map from the word group to $G$.

If the optional parameter `Extension` is set, then the group $G$ should be known to be isomorphic either to $A_n$ or to a perfect central extension $2.A_n$. In that case, the first two maps returned will be a homomorphism from $G$ to $A_n$ and a map from $A_n$ to $G$ that induces a homomorphism onto $G/Z(G)$. The sixth value returned will be `true`, if $G \cong 2.A_n$ and `false` otherwise.

If unsuccessful, `false` is returned. This will always occur if the input group is not isomorphic to $A_n$ (or $2.A_n$ when `Extension` is set) with $n \ge 9$, and may occur occasionally even when $G$ is isomorphic to $A_n$. The optional parameter `maxtries` (default $100n + 5000$) can be used to control the number of random elements chosen before giving up.

<a id="function-alternatingelementtoword-grp-grpelt"></a>
##### `AlternatingElementToWord(G, g): Grp, GrpElt -> BoolElt, GrpSLPElt`

If $g$ is an element of $G$ which has been constructively recognised to be isomorphic to $A_n$ (or $2.A_n$), then return `true` and element of word group for $G$ which evaluates to $g$. Otherwise return `false`. This facilitates membership testing in $G$.

<a id="function-guessaltsymdegree-grp"></a>
##### `GuessAltsymDegree(G: parameters): Grp -> BoolElt, MonStgElt, RngIntElt`

```magma
maxtries : RngIntElt                    Default: 5000
Extension: BoolElt                      Default: false
```

The group $G$ should be believed to be isomorphic to $S_n$ or $A_n$ for some $n > 6$, or to $2.S_n$ or $2.A_n$ if the optional parameter `Extension` is set. This function attempts to determine $n$ and whether $G$ is symmetric or alternating. It does this by sampling orders of elements. It returns either `false`, if it is unable to make a decision after sampling `maxtries` elements (default $5000$), or `true`, *type*, and $n$, where *type* is “Symmetric” or “Alternating”, and $n$ is the degree. If $G$ is not isomorphic to $S_n$ or $A_n$ (or $2.S_n$ or $2.A_n$ when `Extension` is set) for $n > 6$, then the output is meaningless - there is no guarantee that `false` will be returned. There is also a small probability of a wrong result or `false` being returned even when $G$ is $S_n$ or $A_n$ with $n > 6$. This function was written by Derek Holt.

<a id="example-ex-785664"></a>
##### `Example: Guessing the Degree of an Alternating Group (ex-785664)`

For a group $G$ which is believed to be isomorphic to $S_n$ or $A_n$ for some unknown value of $n > 6$, the function `GuessAltsymDegree` can be used to try to guess $n$, and then `RecogniseSymmetric` or `RecogniseAlternating` can be used to confirm the guess.

```magma
> G:= sub< GL(10,5) |
> PermutationMatrix(GF(5),Sym(10)![2,3,4,5,6,7,8,9,1,10]),
> PermutationMatrix(GF(5),Sym(10)![1,3,4,5,6,7,8,9,10,2]) >;
> GuessAltsymDegree(G);
true Alternating 10
> flag, m1, m2, m3, m4  := RecogniseAlternating(G,10);
> flag;
true
> x:=Random(G); Order(x);
8
> m1(x);
(1, 2, 4, 9, 10, 8, 6, 3)(5, 7)
> m2(m1(x)) eq x;
true
> m4(m3(x)) eq x;
true
> flag, w := AlternatingElementToWord(G,x);
> flag;
true
> m4(w) eq x;
true
> y := Random(Generic(G));
> flag, w := AlternatingElementToWord(G,y);
> flag;
false
> flag, m1, m2, m3, m4 := RecogniseAlternating(G,11);
> flag;
false
> flag, m1, m2, m3, m4 := RecogniseSymmetric(G,10);
> flag;
false
```

The nature of the `GuessAltsymDegree` function is that it assumes that its input is either an alternating or symmetric group and then tries to guess which one and the degree. As such, it is almost always correct when the input is an alternating or symmetric group, but will often return a bad guess when the input group is not of this form, as in the following example.

```magma
> GuessAltsymDegree(Sym(50));
true Symmetric 50
> GuessAltsymDegree(Alt(73));
true Alternating 73
> GuessAltsymDegree(PSL(5,5));
true Alternating 82
```

#### Determining the Type of a Finite Group of Lie Type

Given a finite quasisimple group of Lie type in any representation, the functions in this section apply probabilistic algorithms to determine its defining characteristic and type as a Lie group.

<a id="function-liecharacteristic-grp"></a>
##### `LieCharacteristic(G : parameters): Grp -> RngIntElt`

```magma
NumberRandom: RngIntElt                    Default: 100
Verify      : BoolElt                      Default: true
```

Given a finite quasisimple permutation or matrix group $G$ which is of Lie type, determine its defining characteristic. The Monte Carlo algorithm implemented by this function is that of Liebeck and O’Brien [[LO07](https://docs.magma-maths.org/references.md#cite-liebeck-obrien)]. Since it is Monte Carlo, there is a small probability of error. The number of random elements considered is `NumberRandom`. If `Verify` is `true`, then we first verify that $G$ is perfect by applying `IsProbablyPerfect`.

<a id="example-ex-337eef"></a>
##### `Example: Characteristic of a Group of Lie Type (ex-337eef)`

```magma
> F := GF (4);
> w := PrimitiveElement (F);
> a := [
> 0,w^3,0,0,0,
> w^3,0,0,0,0,
> 0,0,0,w^3,0,
> 0,0,w^3,0,0,
> w^2,w^2,w^3,w^3,w^3];
> b := [
> 0,0,w^3,0,0,
> w^1,w^2,w^2,0,0,
> w^2,w^1,w^2,0,0,
> 0,0,0,0,w^3,
> w^2,w^2,w^2,w^3,w^3];
> G := sub <GL(5, F) | a, b>;
> LieCharacteristic(G);
11
```

<a id="function-grpmatff-lietype"></a>
##### `LieType(G, p : parameters): GrpMat, RngIntElt -> BoolElt, Tup`

<a id="function-grpperm-lietype"></a>
##### `LieType(G, p : parameters): GrpMat, RngIntElt -> BoolElt, Tup`

```magma
NumberRandom: RngIntElt                    Default: 100
```

If the matrix or permutation group $G$ is nearly simple, and its non-abelian composition factor is isomorphic to a group of Lie type in characteristic $p$, then this function returns `true` and its standard Chevalley name. Otherwise it returns `false`.

The algorithm is that of Babai, Kantor, Pálfy, and Seress [[BKPS02](https://docs.magma-maths.org/references.md#cite-bkps)]; this implementation was developed by Malle and O’Brien. Since it is Monte Carlo, there is a small probability of error. The number of random elements considered is `NumberRandom`.

The standard name is a tuple that defines the isomorphism type of the composition factor. It is similar to that employed by `CompositionFactors`, described in the Permutation Groups chapter.

If the composition factor is a group of Lie type, then the tuple is $<s, n, q>$ and it defines the adjoint Chevalley group of Lie series $s$ and Lie rank $n$ over $GF (q)$. The tuple entries are valid arguments for `ChevalleyGroup`.

If the composition factor is an alternating group, and so lies in family 17, then the tuple is $<17, n, 0>$ and it defines the alternating group of degree $n$.

If the composition factor is a sporadic group and so lies in family 18, then the tuple is $<18, n, s>$; the string $s$ is its standard Atlas name and $n$ is the number of the group in family 18.

<a id="function-simplegroupname-grpmat"></a>
##### `SimpleGroupName(G : parameters): GrpMat -> BoolElt, List`

<a id="function-simplegroupname-grpperm"></a>
##### `SimpleGroupName(G : parameters): GrpPerm -> BoolElt, List`

```magma
NumberRandom: RngIntElt                    Default: 100
```

If the matrix or permutation group $G$ is nearly simple, this function returns `true` and a list of possible names for its non-abelian simple composition factor; otherwise it returns `false`. Since it is Monte Carlo, there is a small probability of error. The number of random elements considered is `NumberRandom`. The list of standard names follows the convention described above.

The algorithm and implementation were developed by Malle and O’Brien; it uses `LieType` and `LieCharacteristic`.

<a id="example-ex-ffaa04"></a>
##### `Example: Naming a Simple Group (ex-ffaa04)`

We create the classical group $\Omega(7, 5)$ in its natural representation and apply `SimpleGroupName` to it.

```magma
> SetSeed(1);
> G := Omega(7, 5);
> flag, name := SimpleGroupName(G);
> name;
[* <B, 3, 5> *]
```

We create a certain $5$-dimensional matrix group over $GF(3)$ and determine which simple group it is.

```magma
> F := GF(3);
> P := GL(5,F);
> gens := [
> P![2,1,2,1,2,2,0,0,0,2,0,2,0,0,0,0,1,2,0,1,1,0,2,2,1],
> P![2,1,0,2,1,1,2,0,2,2,1,1,2,1,1,0,2,0,1,1,1,1,2,2,2]];
> G := sub <P | gens>;
> flag, name := SimpleGroupName(G);
> flag;
true
> name;
[* <18, 1, M11> *]

> /* naming an alternating group */

> G := MatrixGroup<4, GF(2) |
>    [ 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0 ],
>    [ 0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 0, 1, 0 ] >;
> flag, name := SimpleGroupName(G);
> flag;
true
> /* this is A5 */
> name;
[* <17, 5, 0> *]
> /* naming a classical group */
> F := GF(7^2);
> P := GL (6,F);
> w := PrimitiveElement (F);
> gens := [
> P![w^12,w^36,  0,  5,  2,  0,w^44,w^36,  0,  6,  2,  0,
> w^42,w^42,w^28,w^22,w^22,  3,  4,  3,  0,w^36,w^12,  0,
> 2,  3,  0,w^20,w^12,  0,w^14,w^14,  1,w^18,w^18, w^4],
>
> P![w^38,w^26,w^25,w^21, w^9,  3,w^21,w^45,w^33, w^4,w^28,
> 2,  6,  4, w^1, w^7,w^15,  4,  1,w^36,w^35, w^5,w^41,  5,
> w^31, w^7,w^43,w^36,w^12,  1,w^34,w^42,w^11,w^39,w^47,  2]
> ];
> G := sub <P | gens>;
> flag, name := LieType(G, 5);
> flag;
true
> name;
<A, 1, 5>
> /* so this is SL(2, 5) */
```

#### Classical Forms

Let $G$ be an absolutely irreducible subgroup of $\GL(d,q)$. The following functions compute symplectic, unitary, and orthogonal forms of the underlying vector space $V$ left invariant by the action of $G$.

A *bilinear* form is a bilinear function $\kappa$ from $V\times V \rightarrow F$. It is $G$-invariant modulo scalars if for each $g \in G$ there is a $\mu_g    \in F$ such that $\kappa(vg,wg)  = \mu_g \kappa(v,w)$ for all $v, w \in V$.

Now suppose that $a\mapsto \bar{a}$ is an automorphism of $F$ of order 2. A *sesquilinear* form is a biadditive function $\kappa$ from $V\times V \rightarrow F$ such that $\kappa(  au, bv) =  a\bar{b} \kappa(u,v)$ for all $u,v \in  V$ and $a,b\in  F$. It is $G$-invariant modulo scalars if for each $g  \in G$ there is a $\mu_g \in F$ such that $\kappa(vg,wg) = \mu_g  \kappa(v,w)$ for all $v, w  \in V$.

A quadratic form is a function $\chi  : V  \rightarrow  F$ such that

**(1)**
$\chi(av) =  a^2 \chi(v)$ for all $a\in F$, $v\in V$; and

**(2)**
the form $\kappa$, defined by $\kappa(u,v)  = \chi( u +  v ) - \chi(u)  - \chi(v)$ for all $u,v \in V$, is bilinear.

It is $G$-invariant if for each $g \in G$, $\chi(vg) = \chi(v)$ for all $v \in V$. It is $G$-invariant modulo scalars if for each $g \in G$ there is a $\mu_g \in F$ such that $\chi(vg) = \mu_g \chi(v)$ for all $v \in V$.

A bilinear form which is $G$-invariant (modulo scalars) is represented by a matrix $B$ such that $g * B*{g}^{tr} = \mu_g B$ for all $g\in G$ and is unique up to multiplication by an element of $F$. Assume $F$ has an automorphism $a \mapsto \bar{a}$ of order $2;$ a sesquilinear form is a matrix $B$ such that $g   * B*\bar{g}^{tr} = \mu_g  B$ for all $g\in   G$ and is unique up to multiplication by an element of $F$ (where $\bar{g}$ denotes the matrix obtained from $g$ by replacing each entry $g_{ij}$ by $\bar{g_{ij}}$). A quadratic form is represented by an upper triangular matrix $Q$ such that the matrix $g *   Q * g^{tr}$, normalized into an upper triangular matrix, equals $\mu_g Q$.

The functions below will exit with an error message if the input group $G$ is reducible. They may also exit with error if $G$ is not absolutely irreducible, or if `Scalars` is `true` and the derived subgroup $[G,G]$ of $G$ is not absolutely irreducible. They may however sometimes succeed in finding a fixed form when $G$ is irreducible but not absolutely irreducible.

<a id="function-grpmat-classicalforms"></a>
##### `ClassicalForms(G: parameters): GrpMat -> Rec`

```magma
Scalars: BoolElt                    Default: false
```

Given as input a matrix group $G$ acting absolutely irreducibly on the underlying vector space $V$ over the field $F$, `ClassicalForms` will try to find a classical form which is $G$-invariant or prove that no such form exists. If the optional argument `Scalars` is `true` then it will look for a form which is $G$-invariant modulo scalars. When `Scalars` is `true`, it is only guaranteed to succeed when $[G,G]$ acts absolutely irreducibly on $V$. If it finds a fixed form, then it will stop and will not look for alternative fixed forms of different types.

The classical forms are: *symplectic* (non-degenerate, alternating bilinear), *unitary* (non-degenerate sesquilinear) or *orthogonal* (a *symmetric bilinear form* and a *quadratic* form).

The function `ClassicalForms` returns a record `forms` which contains the components `formType`, `sign`, `bilinearForm`, `sesquilinearForm`, `quadraticForm`, and `scalars`. Depending on the entry `formType` the record components are set to indicate:

**`"unknown"`**
it is not known whether $G$ fixes a classical form.

**`"linear"`**
it is known that $G$ does not fix a classical form modulo scalars.

**`"symplectic"`**
$G$ fixes a symplectic form modulo scalars. The matrix of the form is stored in `bilinearForm` and the scalars for each generator of $G$ are stored in `scalars`. In characteristic two this also implies that no quadratic form is fixed.

**`"unitary"`**
$G$ fixes a unitary form (modulo scalars). The matrix of the form is stored in `sesquilinearForm`. The scalars for each generator of $G$ are stored in `scalars`.

**`"orthogonalcircle"`, `"orthogonalplus"`, `"orthogonalminus"`**
$G$ fixes an orthogonal form modulo scalars. The matrix of the bilinear form is stored in `bilinearForm` and the corresponding quadratic form in `quadraticForm`. The scalars for each generator of $G$ are stored in `scalars`. In the orthogonal case, `sign` is set to 0, 1, or -1 when `formType` is `"orthogonalcircle"`, `"orthogonalplus"`, or `"orthogonalminus"`, respectively.

<a id="function-symplecticform-grpmat"></a>
##### `SymplecticForm(G: parameters): GrpMat -> BoolElt, AlgMatElt [,SeqEnum]`

```magma
Scalars: BoolElt                    Default: false
```

If the absolutely irreducible group $G$ preserves a symplectic form (modulo scalars if the optional argument `Scalars` is `true`), this function returns `true` and the matrix of the form. If it is known that $G$ does not preserve such a form it returns `false`. If it cannot decide (perhaps because the group does not act absolutely irreducibly), then it exits with an error message. If `Scalars` is `true`, then the list of scalars for the generators of $G$ is also returned.

<a id="function-symmetricbilinearform-grpmat"></a>
##### `SymmetricBilinearForm(G: parameters): GrpMat -> BoolElt, AlgMatElt, MonStgElt [,SeqEnum]`

```magma
Scalars: BoolElt                    Default: false
```

If the absolutely irreducible group $G$ preserves an orthogonal form (modulo scalars if the optional argument `Scalars` is `true`), then this function returns `true`, the matrix of the symmetric bilinear form, and the type of the form (as in [`ClassicalForms`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/group-recognition.md#function-grpmat-classicalforms)). If it is known that $G$ does not preserve such a form, it returns `false`. If it cannot decide, then it exits with an error message. If `Scalars` is `true`, then the list of scalars for the generators of $G$ is also returned.

<a id="function-quadraticform-grpmat"></a>
##### `QuadraticForm(G): GrpMat -> BoolElt, AlgMatElt, MonStgElt [,SeqEnum]`

```magma
Scalars: BoolElt                    Default: false
```

If the absolutely irreducible group $G$ preserves a quadratic form (modulo scalars if the optional argument `Scalars` is `true`), this function returns `true`, the matrix of the form in upper triangular form, and the type of the form (as in [`ClassicalForms`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/group-recognition.md#function-grpmat-classicalforms)). If it is known that $G$ does not preserve such a form it returns `false`. If it cannot decide, then it exits with an error message. If `Scalars` is `true`, then the list of scalars for the generators of $G$ is also returned.

<a id="function-unitaryform-grpmat"></a>
##### `UnitaryForm(G): GrpMat -> BoolElt, AlgMatElt [,SeqEnum]`

```magma
Scalars: BoolElt                    Default: false
```

If the absolutely irreducible group $G$ preserves a unitary form (non-degenerate sesquilinear) (modulo scalars if the optional argument `Scalars` is `true`), then this function returns `true` and the matrix of the form. If it is known that $G$ does not preserve such a form, it returns false. If it cannot decide, then it exits with an error message. If `Scalars` is `true`, then the list of scalars for the generators of $G$ is also returned.

<a id="function-formtype-grpmat"></a>
##### `FormType(G): GrpMat -> MonStgElt`

```magma
Scalars: BoolElt                    Default: false
```

If the absolutely irreducible group $G$ preserves a classical form (modulo scalars if the optional argument `Scalars` is `true`), this function returns its type (see [`ClassicalForms`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/group-recognition.md#function-grpmat-classicalforms)). Otherwise it returns `"unknown"`.

<a id="example-ex-9382cf"></a>
##### `Example: Classical Forms of an Orthogonal Group (ex-9382cf)`

```magma
> G := Omega( 9, 11 );
> ClassicalForms( G );
rec<recformat<bilinearForm, quadraticForm, sesquilinearForm, bilinFlag,
sesquiFlag, scalars, formType, bc, n> | bilinearForm :=
[ 0  0  0  0  0  0  0  0  1]
[ 0  0  0  0  0  0  0  1  0]
[ 0  0  0  0  0  0  1  0  0]
[ 0  0  0  0  0  1  0  0  0]
[ 0  0  0  0  6  0  0  0  0]
[ 0  0  0  1  0  0  0  0  0]
[ 0  0  1  0  0  0  0  0  0]
[ 0  1  0  0  0  0  0  0  0]
[ 1  0  0  0  0  0  0  0  0],
quadraticForm :=
[ 0  0  0  0  0  0  0  0  1]
[ 0  0  0  0  0  0  0  1  0]
[ 0  0  0  0  0  0  1  0  0]
[ 0  0  0  0  0  1  0  0  0]
[ 0  0  0  0  3  0  0  0  0]
[ 0  0  0  0  0  0  0  0  0]
[ 0  0  0  0  0  0  0  0  0]
[ 0  0  0  0  0  0  0  0  0]
[ 0  0  0  0  0  0  0  0  0],
sesquilinearForm := false, bilinFlag := true,  sesquiFlag := false,
scalars := [ 1, 1 ], formType := orthogonalcircle, sign := 0>
> FormType( G );
orthogonalcircle
> SymplecticForm( G );
false
```

<a id="function-transformform-algmatelt-monstgelt"></a>
##### `TransformForm(form, type): AlgMatElt, MonStgElt -> GrpMatElt`

Return a matrix $m$ such that $G^m$ lies in the classical group returned by the Magma function `GU`, `Sp`, or `GO(Plus/Minus)`. The argument `form` should be a classical form of type `type` fixed by an absolutely irreducible subgroup $G$ of $GL(d,q)$. It should be the bilinear or sesquilinear form fixed by $G$, except when $G$ is orthogonal in characteristic 2, in which case it should be the quadratic form. The argument `type` should be as in the `formType` component of the record returned by [`ClassicalForms`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/group-recognition.md#function-grpmat-classicalforms); i.e. one of `"symplectic"`, `"unitary"`, `"orthogonalcircle"`, `"orthogonalplus"`, or `"orthogonalminus"`.

The code for this function for all cases other than orthogonal in characteristic $2$ was written by Giovanni de Franceschi and James Wilson.

<a id="function-transformform-grpmat"></a>
##### `TransformForm(G): GrpMat -> GrpMatElt`

```magma
Scalars: BoolElt                    Default: false
```

This function calls [`ClassicalForms`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/group-recognition.md#function-grpmat-classicalforms) to find a form fixed by the absolutely irreducible subgroup $G$ of $GL(d,q)$. If `Scalars` is `true`, then [`ClassicalForms`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/group-recognition.md#function-grpmat-classicalforms) is called with `Scalars` set to `true`, so that a form fixed module scalars is found. If a form `form` of type `type` is fixed, then it returns `TransformForm(form, type)`. Otherwise it returns `false`.

<a id="function-spinornorm-grpmatelt-algmatelt"></a>
##### `SpinorNorm(g, form): GrpMatElt, AlgMatElt -> RngIntElt`

The group element $g$ should be an element of the finite orthogonal group that preserves the given symmetric bilinear form with matrix `form`. If the characteristic is odd, this function returns the spinor norm of $g$. If the characteristic is even it returns the Dickson invariant of $g$; namely the rank modulo 2 of $g - I$. Thus for an element $g$ of the special orthogonal group the return value is 0 if $g$ belongs to the `Omega(Plus/Minus)` subgroup of index 2; otherwise the return value is 1. However, as illustrated in the following example, the spinor norm alone cannot be used to check whether an element of the orthogonal group is in $\Omega$.

<a id="example-ex-b5d734"></a>
##### `Example: Spinor Norm in an Orthogonal Group (ex-b5d734)`

This function can be used to check whether an element of the orthogonal group, say ${\operatorname{GO}}^+(d,q)$, belongs to $\Omega^+(d,q)$. First check that the element belongs to ${\operatorname{SO}}^+(d,q)$.

```magma
> isInOmega := func< g,form |
>    Determinant(g) eq 1 and SpinorNorm(g,form) eq 0 >;
> G := GOPlus(6,3);
> g := G![
>   [ 1, 0, 0, 0, 0, 0],
>   [ 0, 0, 0, 0, 2, 0],
>   [ 0, 0, 1, 0, 0, 0],
>   [ 0, 0, 0, 1, 0, 0],
>   [ 0, 2, 0, 0, 0, 0],
>   [ 0, 0, 0, 0, 0, 1] ];
> _, form := SymmetricBilinearForm(G);
> SpinorNorm(g,form);
0
> isInOmega(g,form);
false
```

#### Recognizing Classical Groups in their Natural Representation

Let $G$ be an irreducible subgroup of ${\operatorname{GL}}(d,q)$. The following algorithm is designed to test whether $G$ contains the corresponding classical group $\Omega$ and is contained in $\Delta$. Here $\Omega$ and $\Delta$ are defined as follows:

**•**
Case “linear”: $\Delta = {\operatorname{GL}}(d,q),$ $\Omega = {\operatorname{SL}}( d, q)$

**•**
Case “symplectic”: $\Delta = {\operatorname{CSp}}(d,q),$ $\Omega = {\operatorname{Sp}}( d, q)$

**•**
Case “orthogonalplus”: $\Delta = {\operatorname{CO}}^+(d,q),$ $\Omega = \Omega^+(d,q)$

**•**
Case “orthogonalminus”: $\Delta = {\operatorname{CO}}^-(d,q),$ $\Omega = \Omega^-(d,q)$

**•**
Case “orthogonalcircle”:$\Delta = {\operatorname{CO}}^\circ(d,q),$ $\Omega = \Omega^\circ(d,q)$

**•**
Case “unitary”: $\Delta = {\operatorname{CU}}(d,q),$ $\Omega = {\operatorname{SU}}(d,q)$

<a id="function-recognizeclassical-grpmat"></a>
##### `RecognizeClassical(G : parameters): GrpMat -> BoolElt`

<a id="function-recogniseclassical-grpmat"></a>
##### `RecogniseClassical(G : parameters): GrpMat -> BoolElt`

```magma
Case            : MonStgElt                    Default: "unknown"
NumberOfElements: RngIntElt                    Default: 25
Classical       : Verbose                      Default: 3
```

`RecognizeClassical` takes as input a group $G$, which is a subgroup of $\GL(d,q)$. The parameter `Case` is one of `"linear"`, `"symplectic"`, `"orthogonalplus"`, `"orthogonalminus"`, `"orthogonalcircle"`, `"unitary"`, or `"unknown"`; if `Case` is supplied, then the algorithm seeks to decide for this case only. The parameter `NumberOfElements` is the number of random elements selected from $G$ during the execution of the algorithm.

The output of `RecognizeClassical` is either `true`, `false`, or `"Does not apply"`. If the algorithm returns `true`, then we know with certainty that $G$ contains $\Omega$ and is contained in $\Delta$. Note that the proof of correctness of the algorithm depends on the finite simple group classification. If it returns `false` then either $G$ does not contain $\Omega$, or $G$ is not contained in $\Delta$, or $G$ is not irreducible, or there is a small chance that $G$ is contained in $\Delta$ and contains $\Omega$. More precisely, if the irreducible group $G$ is contained in $\Delta$ and really does contain $\Omega$ then the probability with which the algorithm returns `false` is less than $\eps$, where $\eps$ is a real number between 0 and 1. The smaller the value of $\eps$, the larger `NumberOfElements` must be. If the algorithm returns `"Does not apply"` then it is not applicable to the given group.

If `"Classical"` is set to verbose then, where `RecognizeClassical` returns `true`, it also prints the statement “Proved that the group contains a classical group of type *case* in $n$ random selections”, where $n$ is the number of selections needed. If it returns `false`, it prints a statement giving some indication of why the algorithm reached this conclusion.

Theoretical details of the algorithms used may be found in Niemeyer & Praeger [[NP97](https://docs.magma-maths.org/references.md#cite-niemeyer-praeger-97)][[NP98](https://docs.magma-maths.org/references.md#cite-niemeyer-praeger-98)][[NP99](https://docs.magma-maths.org/references.md#cite-niemeyer-praeger-99)] and Praeger [[Pra99](https://docs.magma-maths.org/references.md#cite-praeger-prim)]. Its approach is based on the ${\operatorname{SL}}$-recognition algorithm (Neumann & Praeger, [[NP92](https://docs.magma-maths.org/references.md#cite-neumann-praeger-92)]).This implementation also uses algorithms described in Celler & Leedham-Green [[CLG97b](https://docs.magma-maths.org/references.md#cite-clg-order)][[CLG97a](https://docs.magma-maths.org/references.md#cite-clg-recog)] and Celler et al. [[CLGM+95](https://docs.magma-maths.org/references.md#cite-randomelements)].

For small fields $(q < 2^{16}),$ the cost of this implementation for a given value of `NumberOfElements` is $O( d^3 \log d )$ bit operations.

<a id="function-islineargroup"></a>
##### `IsLinearGroup(G): GrpMat -> BoolElt`

This function tests whether the subgroup $G$ of ${\operatorname{GL}}(d,q)$ contains ${\operatorname{SL}}(d,q)$. If the function can establish this fact, it returns `true` and otherwise `false`. Hence, if `IsLinearGroup` returns `false`, there is a small chance that $G$ nevertheless contains ${\operatorname{SL}}(d,q)$. See `RecognizeClassical` for more details.

<a id="function-issymplecticgroup-grpmat"></a>
##### `IsSymplecticGroup(G): GrpMat -> BoolElt`

This function tests whether the subgroup $G$ of ${\operatorname{CSp}}(d,q)$ contains ${\operatorname{Sp}}(d,q)$. If the function can establish this fact, it returns `true` and otherwise `false`. Hence, if `IsSymplecticGroup` returns `false`, there is a small chance that $G$ nevertheless contains ${\operatorname{Sp}}(d,q)$. See `RecognizeClassical` for more details.

<a id="function-isorthogonalgroup-grpmat"></a>
##### `IsOrthogonalGroup(G): GrpMat -> BoolElt`

This function tests whether the subgroup $G$ of ${\operatorname{CO}}^\epsilon(d,q)$ contains $\Omega^\epsilon(d,q)$. If the function can establish this fact, it returns `true` and otherwise `false`. Hence, if `IsOrthogonalGroup` returns `false`, there is a small chance that $G$ nevertheless contains $\Omega^\epsilon(d,q)$. See `RecognizeClassical` for more details.

<a id="function-isunitarygroup-grpmat"></a>
##### `IsUnitaryGroup(G): GrpMat -> BoolElt`

This function tests whether the subgroup $G$ of ${\operatorname{CU}}(d,q)$ contains ${\operatorname{SU}}(d,q)$. If the function can establish this fact, it returns `true` and otherwise `false`.

<a id="function-classicaltype-grpmat"></a>
##### `ClassicalType(G): GrpMat -> MonStgElt`

If $G$ is known to be a classical subgroup of ${\operatorname{GL}}(d,q)$ this function returns the appropriate classical type as a string. i.e., One of `"linear"`, `"symplectic"`, `"orthogonalplus"`, `"orthogonalminus"`, `"orthogonalcircle"`, or `"unitary"`. Otherwise the function returns `false`.

<a id="function-classicalgrouptype-grpmat"></a>
##### `ClassicalGroupType(G): GrpMat -> BoolElt, MonStgElt`

This is a refinement of `ClassicalType` developed by O’Brien and Taylor. If $G$ can be identified as a natural classical group in its natural representation, return `true` and the type of the group – one of the strings listed under ‘subtype’; otherwise return `false`.

```
      type              subtype
      ---------------------------------------------------
      linear            GL,   SL
      symplectic        CSp,  Sp,  ExtSp
      orthogonalplus    CGO+, GO+, SO+,  Omega+, ExtOmega+
      orthogonalminus   CGO-, GO-, SO-,  Omega-, ExtOmega-
      orthogonalcircle  CGO,  GO,  SO,   Omega,  ExtOmega
      unitary           CGU,  GU,  SU,   ExtSU,  AltSU
      ---------------------------------------------------
```

A group of type `"ExtSp"` is properly contained between the symplectic group and the conformal symplectic group. A group of type `"ExtSU"` is properly contained between the special unitary group and the general unitary group whereas a group of type `"AltSU"` is a subgroup of the conformal unitary group which contains the special unitary group but is not contained in the general unitary group. A group of type `"ExtOmega"` is a subgroup of the conformal orthogonal group not of type `"CGO", "GO", "SO"` or `"Omega"`. (Similarly for types `"ExtOmega+"` and `"ExtOmega-"`.)

<a id="example-ex-9f3ea6"></a>
##### `Example: Recognising a Unitary Group (ex-9f3ea6)`

```magma
> G := SU (60, 9);
> G := RandomConjugate (G);
> RecognizeClassical (G);
true
> IsLinearGroup (G);
false
> IsUnitaryGroup (G);
true
> IsSymplecticGroup (G);
false
> IsOrthogonalGroup (G);
false
> ClassicalType (G);
unitary
> G := Sp (462, 3);
> RecognizeClassical (G);
true
> ClassicalType (G);
symplectic
> ClassicalGroupType (G);
true Sp
> G := CGOPlus (14, 8);
> G := RandomConjugate (G);
> ClassicalGroupType (G);
true CGO+
```

#### Constructive Recognition of Linear Groups

The functions in this section recognise whether or not a given group $G$ is a specified linear group $T$. If it is, then an isomorphism between $G$ and $T$ is returned.

The function `ClassicalConstructiveRecognition` performs constructive recognition for all classical groups, and incorporates the recognition functions listed below for specific classical groups. See also `ExceptionalConstructiveRecognition` which deals with most finite exceptional groups of Lie type; the remaining cases – Suzuki groups, large and small Ree groups – are discussed here.

<a id="function-recognizesl2-grpmat"></a>
##### `RecognizeSL2(G): GrpMat -> BoolElt, Map, Map, Map, Map`

<a id="function-recognisesl2-grpmat"></a>
##### `RecogniseSL2(G): GrpMat -> BoolElt, Map, Map, Map, Map`

<a id="function-recognizesl2-grpperm"></a>
##### `RecognizeSL2(G): GrpPerm -> BoolElt, Map, Map, Map, Map`

<a id="function-recognisesl2-grpperm"></a>
##### `RecogniseSL2(G): GrpPerm -> BoolElt, Map, Map, Map, Map`

<a id="function-recognizesl2-grpmat-rngintelt"></a>
##### `RecognizeSL2(G, q): GrpMat, RngIntElt -> BoolElt, Map, Map, Map, Map`

<a id="function-recognisesl2-grpmat-rngintelt"></a>
##### `RecogniseSL2(G, q): GrpMat, RngIntElt -> BoolElt, Map, Map, Map, Map`

<a id="function-recognizesl2-grpperm-rngintelt"></a>
##### `RecognizeSL2(G, q): GrpPerm, RngIntElt -> BoolElt, Map, Map, Map, Map`

<a id="function-recognisesl2-grpperm-rngintelt"></a>
##### `RecogniseSL2(G, q): GrpPerm, RngIntElt -> BoolElt, Map, Map, Map, Map`

If $G$, a matrix or permutation group, is isomorphic, possibly modulo scalars, to $(P)SL(2, q)$, then homomorphisms between $G$ and $(P)SL(2, q)$ are constructed. The function returns a homomorphism from $G$ to $(P)SL(2, q)$, a homomorphism from $(P)SL(2, q)$ to $G$, the map from $G$ to its word group, and the map from the word group to $G$.

If $q$, the cardinality of the defining field for $G$, is known, it *should* be supplied. Otherwise, the function `SL2Characteristic` is used to determine $q$; if $q$ is large, this calculation may be **expensive**.

<a id="function-sl2elementtoword-grpmat-grpmatelt"></a>
##### `SL2ElementToWord(G, g): GrpMat, GrpMatElt -> BoolElt, GrpSLPElt`

<a id="function-sl2elementtoword-grpperm-grppermelt"></a>
##### `SL2ElementToWord(G, g): GrpPerm, GrpPermElt -> BoolElt, GrpSLPElt`

If $g$ is an element of the matrix or permutation group $G$ which has been constructively recognised to have central quotient isomorphic to $PSL(2, q)$, then return `true` and element of word group for $G$ which evaluates to $g$, else `false`. This facilitates membership testing in $G$.

<a id="function-sl2characteristic-grpmat"></a>
##### `SL2Characteristic(G : parameters): GrpMat -> RngIntElt, RngIntElt`

<a id="function-sl2characteristic-grpperm"></a>
##### `SL2Characteristic(G : parameters): GrpPerm -> RngIntElt, RngIntElt`

```magma
NumberRandom: RngIntElt                    Default: 100
Verify      : BoolElt                      Default: true
```

Subject to the *assumption* that the group $G$ has central quotient $(P)SL(2, q)$, determine its characteristic and field size. The Monte Carlo algorithm implemented by this function is that of Liebeck and O’Brien [[LO07](https://docs.magma-maths.org/references.md#cite-liebeck-obrien)]. Since it is Monte Carlo, there is a small probability of error. The number of random elements considered is `NumberRandom`. If `Verify` is `true`, then we first verify that $G$ is perfect by applying `IsProbablyPerfect`.

The constructive recognition algorithms for $SL(2, q)$ were developed by Conder, Leedham-Green, and O’Brien [[CLGO06](https://docs.magma-maths.org/references.md#cite-conder-lg-obrien)]. The algorithm used for other representations was developed by Brooksbank and O’Brien.

<a id="example-ex-6829cc"></a>
##### `Example: Recognising SL2 in Its Natural Representation (ex-6829cc)`

Our first example uses $G = {\operatorname{SL}}(2, 3^2)$ in its natural representation. We first recognise the group and then express a random matrix of $G$ as a word in the generators of $G$.

```magma
> G := SL(2, 3^2);
> flag, phi, tau, gamma, delta := RecogniseSL2(G, 3^2);
> g := G![1, 2, 0, 1];
> w := gamma(g);
> delta(w) eq g;
true
```

<a id="example-ex-82f78a"></a>
##### `Example: Recognising SL2 in Dimension 6 (ex-82f78a)`

We now consider a representation of a $2$-dimensional linear group inside $GL(6, {\bf F}_{5^7} )$.

```magma
> K<w> := GF(5, 7);
> G :=
> MatrixGroup<6, GF(5, 7) |
> [w^19035, w^14713, w^50617, w^14957, w^51504, w^48397, w^16317, w^3829,
>  w^35189, w^2473, w^19497, w^77192, w^46480, w^6772, w^29577, w^61815,
>  w^54313, w^16757, w^43765, w^64406, w^58788, w^30789, w^13579, w^66728,
>  w^7733, w^45434, w^42411, w^61613, w^12905, w^6889, w^50116, w^16117,
>  w^56717, w^25226, w^49940, w^36836 ],
> [w^63955, w^40568, w^45004, w^11642, w^39536, w^11836, w^52594, w^71166,
>  w^47015, w^74450, w^32373, w^37021, w^76381, w^18155, w^57943, w^31194,
>  w^62524, w^65864, w^11868, w^76867, w^26483, w^41335, w^64856, w^41125,
>  w^43990, w^40104, w^24842, w^3153, w^23777, w^60024, w^14454, w^68648,
>  w^43403, w^26710, w^39779, w^22074 ] >;
>
> flag, phi, tau, gamma, delta := RecogniseSL2(G, 5^7);
> phi;
Mapping from: GrpMat: G to SL(2, GF(5, 7)) given by a rule [no inverse]
> g := Random(G);
> h := phi (g);
> h;
[w^40430   w^970]
[ w^5607 w^11606]
> k := tau(h);
> w := gamma(k);
> m := delta(w);
```

Recall that we are working modulo scalars.

```magma
> IsScalar(m * g^-1);
true
> H := SL(2, 5^7);
> h := H![1,1,0,1];
> g := tau(h);
> Order(g);
5
```

We now test a random element of $GL(6, {\bf F}_{5^7} )$ for membership of our group.

```magma
> g := Random(GL(6, 5^7));
> SL2ElementToWord(G, g);
false
```

<a id="function-recognisesl3-grpmat"></a>
##### `RecogniseSL3(G): GrpMat -> BoolElt, Map, Map, Map, Map`

<a id="function-recognisesl3-grpmat-rngintelt"></a>
##### `RecogniseSL3(G, q : parameters): GrpMat, RngIntElt -> BoolElt, Map, Map, Map, Map`

```magma
Verify: BoolElt                    Default: true
```

If $G \leq GL(d, F)$, is isomorphic, possibly modulo scalars, to $(P)SL(3, q)$, then construct homomorphisms between $G$ and $(P)SL(3, q)$. Return homomorphism from $G$ to $(P)SL(3, q)$, homomorphism from $(P)SL(3, q)$ to $G$, the map from $G$ to its word group and the map from the word group to $G$.

If $q$, the cardinality of the defining field for $G$, is known, it *should* be supplied. Otherwise, it is computed using the functions `LieCharacteristic` and `LieType`.

If `Verify` is `false`, then assume $G$ is isomorphic, possibly modulo scalars, to $(P)SL(3, q)$.

<a id="function-sl3elementtoword-grpmat-grpmatelt"></a>
##### `SL3ElementToWord(G, g): GrpMat, GrpMatElt -> BoolElt, GrpSLPElt`

If $g$ is an element of $G$ which has been constructively recognised to have central quotient isomorphic to $PSL(3, q)$, then return `true` and element of word group for $G$ which evaluates to $g$, else `false`. This facilitates membership testing in $G$.

The constructive recognition algorithms for $SL(3, q)$ were developed by Lübeck, Magaard, and O’Brien [[LMO07](https://docs.magma-maths.org/references.md#cite-lubeck-magaard-obrien)]. Its current implementation, which is part of the `CompositionTree` package, was developed by Bäärnhielm and O’Brien.

<a id="example-ex-46bbe9"></a>
##### `Example: Recognising SL3 and Its Symmetric Square (ex-46bbe9)`

We create $SL(3, 5^4)$ in its natural representation and recognise it. We then form its symmetric square and apply the recognition machinery to that.

```magma
> G := SL(3, 5^4);
> flag, phi, tau, gamma, delta := RecogniseSL3(G);
> w := PrimitiveElement (GF(5^4));
> g := GL(3, 5^4)! [1,2,1,0,w,1,0,0,w^-1];
> w := gamma (g);
> delta (w) eq g;
true
> G := ActionGroup(SymmetricSquare(GModule(G)));
> flag, phi, tau, gamma, delta := RecogniseSL3(G);
> phi;
Mapping from: GL(6, GF(5, 4)) to SL(3, GF(5, 4)) given by a rule [no inverse]
> g := Random(G);
> h := phi(g);
> h;
[$.1^40430   $.1^970]
[ $.1^5607 $.1^11606]
> k := tau(h);
> w := gamma(k);
> m := delta(w);
```

Recall that we are working modulo scalars. We conclude by testing whether a random element of $GL(6, 5^4)$ is contained in our group.

```magma
> IsScalar(m * g^-1);
true
> g := Random(GL(6, 5^4));
> SL3ElementToWord(G, g);
false
```

<a id="function-recognisesl-grp-rngintelt-rngintelt"></a>
##### `RecogniseSL(G, d, q): Grp, RngIntElt, RngIntElt -> BoolElt, Map, Map`

<a id="function-recognizesl-grp-rngintelt-rngintelt"></a>
##### `RecognizeSL(G, d, q): Grp, RngIntElt, RngIntElt -> BoolElt, Map, Map`

Use the Kantor-Seress algorithm to try to find an isomorphism between the finite group $G$ (regarded as a black-box group) and $\SL(d,q)$ or $\PSL(d,q)$. The first return value indicates whether the attempt was successful. If so, then the second and third return values are mutually inverse homomorphisms (modulo scalars if $G \cong \PSL(d,q)$) from $G$ to $\SL(d,q)$ and from $\SL(d,q)$ to $G$.

*Warning*: This function often returns `false` even when $G$ is isomorphic to $\SL(d,q)$ or $\PSL(d,q)$, so it should be called repeatedly until it returns `true`!

#### Constructive Recognition of Symplectic Groups

<a id="function-recognisespodd-grp-rngintelt-rngintelt"></a>
##### `RecogniseSpOdd(G, d, q): Grp, RngIntElt, RngIntElt -> BoolElt, Map, Map`

<a id="function-recognizespodd-grp-rngintelt-rngintelt"></a>
##### `RecognizeSpOdd(G, d, q): Grp, RngIntElt, RngIntElt -> BoolElt, Map, Map`

Use the Kantor-Seress algorithm to try to find an isomorphism between the finite group $G$ (regarded as a black-box group) and $\Sp(d,q)$ or $\PSp(d,q)$ for odd $q$. The first return value indicates whether the attempt was successful. If so, then the second and third return values are mutually inverse homomorphisms (modulo scalars if $G \cong \PSp(d,q)$) from $G$ to $\Sp(d,q)$ and from $\Sp(d,q)$ to $G$.

*Warning*: This function often returns `false` even when $G$ is isomorphic to $\Sp(d,q)$ or $\PSp(d,q)$, so it should be called repeatedly until it returns `true`!

<a id="function-recognisesp4-grp-rngintelt-rngintelt"></a>
##### `RecogniseSp4(G, q): Grp, RngIntElt, RngIntElt -> BoolElt, Map, Map, Map, Map, SeqEnum, SeqEnum`

<a id="function-recognizesp4-grp-rngintelt-rngintelt"></a>
##### `RecognizeSp4(G, q): Grp, RngIntElt, RngIntElt -> BoolElt, Map, Map, Map, Map, SeqEnum, SeqEnum`

Use an algorithm of Peter Brooksbank to try to find an isomorphism between the finite group $G$ (regarded as a black-box group) and $\Sp(4,q)$. The first return value indicates whether the attempt was successful. If so, then the second and third return values are mutually inverse homomorphisms from $G$ to (P)$\Sp(d,q)$ and from (P)$\Sp(d,q)$ to $G$. The fourth and fifth return values are mutually inverse homomorphisms from $G$ to the word group $W$ of $G$ and from $W$ to $G$. The sixth and seventh return values are standard generators for $G$ and straight-line programs for these generators in the generators of $G$.

#### Constructive Recognition of Unitary Groups

<a id="function-recognisesu3-grp-rngintelt-rngintelt"></a>
##### `RecogniseSU3(G, d, q): Grp, RngIntElt, RngIntElt -> BoolElt, Map, Map`

<a id="function-recognizesu3-grp-rngintelt-rngintelt"></a>
##### `RecognizeSU3(G, d, q): Grp, RngIntElt, RngIntElt -> BoolElt, Map, Map`

Use an algorithm of Peter Brooksbank to try to find an isomorphism between the finite group $G$ (regarded as a black-box group) and $\SU(3,q)$ or $\PSU(3,q)$ for $q>2$. The first return value indicates whether the attempt was successful. If so, then the second and third return values are mutually inverse homomorphisms (modulo scalars if $G \cong \PSU(3,q)$) from $G$ to $\SU(3,q)$ and from $\SU(3,q)$ to $G$. The third and fourth return values are mutually inverse homomorphisms from $G$ to the word group $W$ of $G$ and from $W$ to $G$.

<a id="function-recognisesu4-grp-rngintelt-rngintelt"></a>
##### `RecogniseSU4(G, d, q): Grp, RngIntElt, RngIntElt -> BoolElt, Map, Map`

<a id="function-recognizesu4-grp-rngintelt-rngintelt"></a>
##### `RecognizeSU4(G, d, q): Grp, RngIntElt, RngIntElt -> BoolElt, Map, Map`

Use an algorithm of Peter Brooksbank to try to find an isomorphism between the finite group $G$ (regarded as a black-box group) and $\SU(4,q)$ or $\PSU(4,q)$. The first return value indicates whether the attempt was successful. If so, then the second and third return values are mutually inverse homomorphisms (modulo scalars if $G \cong \PSU(4,q)$) from $G$ to $\SU(4,q)$ and from $\SU(4,q)$ to $G$. The third and fourth return values are mutually inverse homomorphisms from $G$ to the word group $W$ of $G$ and from $W$ to $G$.

#### Recognition Of Classical Groups in Low Degree

Let $H$ be a perfect classical group of degree $d$, and let $H$ act absolutely irreducibly on a defining characteristic module $W$ of dimension at most $d^2$.

Magaard, O’Brien & Seress [[MOAS08](https://docs.magma-maths.org/references.md#cite-small-deg-reps)] and Brian Corr [[Cor13](https://docs.magma-maths.org/references.md#cite-corr-phd)] and Csaba Schneider (in preparation) describe algorithms which, given as input the representation of $H$ on $W$, construct a $d$-dimensional projective representation of $H$.

Schneider’s algorithms, and his implementations, are used for the exterior and symmetric square representations of $H$; those of [[MOAS08](https://docs.magma-maths.org/references.md#cite-small-deg-reps)], [[Cor13](https://docs.magma-maths.org/references.md#cite-corr-phd)], and their implementation prepared by Brian Corr and Eamonn O’Brien, are used for the other cases.

Note that the algorithms have various limitations in terms of type of group, degree $d$, and defining field size; if an algorithm does not apply to the input case, it returns `false`.

<a id="function-recognisesmalldegree-grpmat"></a>
##### `RecogniseSmallDegree(G): GrpMat -> BoolElt, GrpMat`

<a id="function-recognisesmalldegree-grpmat-monstgelt-rngintelt-rngintelt"></a>
##### `RecogniseSmallDegree(G, type, d, q): GrpMat, MonStgElt, RngIntElt, RngIntElt -> BoolElt, GrpMat, Map, Map`

If $G$ is a perfect defining characteristic absolutely irreducible representation of a classical group $H$ of degree $d$ and $G$ has degree in $[d + 1, \ldots, d^2]$, then return `true`, $H$, map from $H$ to $G$, and map from $G$ to $H$; otherwise return `false`.

In the second signature, we supply the information that $H$ has degree $d$, defining field ${\bf F}_{q}$, and its type is one of `SL, Sp, SU, Omega, Omega+, Omega-`.

<a id="function-smalldegreepreimage-grpmat-grpmatelt"></a>
##### `SmallDegreePreimage(G, g): GrpMat, GrpMatElt -> GrpMatElt`

The group $G$ is a perfect defining characteristic absolutely irreducible representation of a classical group $H$ of small degree, to which `RecogniseSmallDegree` has been successfully applied; if $g$ is in $G$, return `true` and a preimage of $g$ in $H$, otherwise `false`.

<a id="function-smalldegreeimage-grpmat-grpmatelt"></a>
##### `SmallDegreeImage(G, h): GrpMat, GrpMatElt -> GrpMatElt`

The group $G$ is a perfect defining characteristic absolutely irreducible representation of a classical group $H$ of small degree, to which `RecogniseSmallDegree` has been successfully applied; if $h$ is in $H$, return `true` and the image of $h$ in $G$, otherwise `false`. Note that `SmallDegreePreimage` and this function are inverses only up to a choice of scalars.

<a id="example-ex-5df193"></a>
##### `Example: Recognising SL4 in a Symmetric Square (ex-5df193)`

```magma
> G := SL(4, 9);
> M := GModule (G);
> M := SymmetricPower (M, 2);
> G := MatrixGroup (M);
> G := RandomConjugate (G);
> flag, H := RecogniseSmallDegree (G, "SL", 4, 9);
> flag;
true
> H;
MatrixGroup(4, GF(3^2))
Generators:
    [    0     1     0     0]
    [    0     0     0     1]
    [$.1^6     2     2   $.1]
    [    2   $.1     0   $.1]


    [    0     0     1     0]
    [$.1^2 $.1^7     1 $.1^6]
    [    1     2 $.1^6 $.1^6]
    [  $.1     0 $.1^7     0]
> g := Random (G);
>  flag, h := SmallDegreePreimage (G, g);
> h;
[$.1^6     0     0 $.1^2]
[$.1^6     0 $.1^3     0]
[$.1^2 $.1^5     2   $.1]
[    0 $.1^3 $.1^5   $.1]
> flag, gbar := SmallDegreeImage (G, h);
> flag;
true
> IsScalar (g * gbar^-1);
true
```

#### Constructive Recognition of Suzuki Groups

##### Introduction

A description of the functionality for constructive recognition and constructive membership testing of the Suzuki groups ${\rm Sz}(q)$, with $q = 2^{2m + 1}$ for some $m > 0$ follows.

The main intrinsics of the package are `RecogniseSz(G)` which performs constructive recognition of $G \cong {\rm Sz}(q)$, `SzElementToWord(G, g)` which returns a `GrpSLPElt` for $g$ in the generators of $G$, and `IsSuzukiGroup(G)` which is a non-constructive test for isomorphism between $G$ and ${\rm Sz}(q)$.

Informative printing can be obtained using one of a number of verbose flags:

**•**
$\quad$ `SuzukiGeneral`, for the general routines.

**•**
$\quad$ `SuzukiStandard`, for the routines related to the standard copy.

**•**
$\quad$ `SuzukiConjugate`, for the routines related to conjugation.

**•**
$\quad$ `SuzukiTensor`, for the routines related to tensor decomposition.

**•**
$\quad$ `SuzukiMembership`, for the routines related to membership testing.

**•**
$\quad$ `SuzukiCrossChar`, for the routines related to cross-characteristic representations.

**•**
$\quad$ `SuzukiTrick`, for the routines related to the double coset trick.

**•**
$\quad$ `SuzukiNewTrick`, for the routines related to the stabiliser trick.

For each of the flags, the verbose level takes any value up to $10$, with higher values resulting in more output.

##### Recognition Functions

<a id="function-issuzukigroup-grpmat"></a>
###### `IsSuzukiGroup(G): GrpMat -> BoolElt, RngIntElt`

Given a matrix group $G$, this function determines (non-constructively) whether or not $G$ is isomorphic to ${\rm Sz}(q)$. The corresponding finite field cardinality $q$ is also returned.

If the group $G$ is defined over a field of odd characteristic or has degree greater than $4$, the Monte Carlo algorithm of [`LieType`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/group-recognition.md#function-grpmatff-lietype) is used. If $G$ has degree $4$ and is over a field of characteristic $2$, then a fast Las Vegas algorithm is used, described in [[Baa06a](https://docs.magma-maths.org/references.md#cite-baarnhielm05)].

<a id="function-recognisesz-grpmat"></a>
###### `RecogniseSz(G : parameters): GrpMat -> BoolElt, Map, Map, Map, Map`

<a id="function-recognizesz-grpmat"></a>
###### `RecognizeSz(G : parameters): GrpMat -> BoolElt, Map, Map, Map, Map`

```magma
Verify   : BoolElt                      Default: true
FieldSize: RngIntElt                    Default: 
Optimise : BoolElt                      Default: false
```

Let $G$ be a group that is absolutely irreducible and is defined over a minimal field. This function constructively recognises $G$ as a Suzuki group. If $G$ is isomorphic to ${\rm Sz}(q)$, where $q$ is the size of the defining field of $G$, then return:

**•**
Isomorphism from $G$ to ${\rm Sz}(q)$.

**•**
Isomorphism from ${\rm Sz}(q)$ to $G$.

**•**
Map from $G$ to the word group of $G$.

**•**
Map from the word group of $G$ to $G$.

The isomorphisms are composed of maps that are defined by rules, so `Function` should be used on each component to avoid unnecessary built-in membership testing. The word group is the `GrpSLP` group which is the parent of the elements returned by `SzElementToWord`. In general this is not the same as `WordGroup(G)`, but is created from it using `AddRedundantGenerators`.

If `Verify` is true, then it is checked if $G$ is isomorphic to ${\rm Sz}(q)$, using `IsSuzukiGroup`. In that case, `FieldSize` must be set to the correct value of $q$. Constructive recognition of $2.{\rm Sz}(8)$ is also handled.

If `Optimise` is true, then the third map returns element in an optimised word group (using `AddRedundantGenerators`). Then each invocation of the map will be faster, but the initialisation will take longer.

The algorithms used for constructive recognition are described in [[Baa06a](https://docs.magma-maths.org/references.md#cite-baarnhielm05)] and [[Baa05](https://docs.magma-maths.org/references.md#cite-sz-tensor-decompose)].

<a id="function-szelementtoword-grpmat-grpmatelt"></a>
###### `SzElementToWord(G, g): GrpMat, GrpMatElt -> BoolElt, GrpSLPElt`

If $G$ has been constructively recognised as a Suzuki group, and if $g$ is an element of $G$, then return `true` and a `GrpSLPElt` from the word group of $G$ which evaluates to $g$, else return `false`.

This facilitates membership testing in $G$.

<a id="function-szpresentation-rngintelt"></a>
###### `SzPresentation(q): RngIntElt -> GrpFP, HomGrp`

If $q = 2^{2m + 1}$ for some $m > 0$, return a short presentation of ${\rm Sz}(q)$ on the Magma standard generators, i.e. the generators returned by the `Sz` intrinsic.

<a id="function-satisfiesszpresentation-grpmat"></a>
###### `SatisfiesSzPresentation(G): GrpMat -> BoolElt`

$G$ is constructively recognised as ${\rm Sz}(q)$ for some $q$. Verify that it satisfies a presentation for this group.

<a id="function-suzukiirreduciblerepresentation-fldfin-seqenum-rngintelt"></a>
###### `SuzukiIrreducibleRepresentation(F, twists : parameters): FldFin, SeqEnum[RngIntElt] -> GrpMat`

```magma
CheckInput: BoolElt                    Default: true
```

Let $F$ be a finite field of cardinality $q = 2^{2m + 1}$ for some $m > 0$, and let *twists* be a sequence of $n$ distinct integers in the range $[0 \ldots 2m]$. The function returns an absolutely irreducible representation of ${\rm Sz}(q)$ having dimension $4^n$, being a tensor product of twisted powers of the copy returned by the `Sz` intrinsic, where the twists are given by the input sequence.

If `CheckInput` is true, then it is verified that $F$ and *twists* satisfy the above requirements. Otherwise this is not checked.

<a id="example-ex-9d33f6"></a>
###### `Example: Recognising the Suzuki Group Sz(32) (ex-9d33f6)`

We illustrate the basic facilities starting with a random conjugate of the standard version of the Suzuki group $Sz(32)$. We first perform non-constructive recognition.

```magma
> G := Sz(32);
> G ^:= Random(Generic(G));
> flag, q := SuzukiRecognition(G);
> flag, q eq 32;
true true
```

The next step is to perform constructive recognition. The explicit isomorphisms will be the values of `iso` and `inv`.

```magma
> flag, iso, inv, g2slp, slp2g := RecognizeSz(G);
> flag;
true
> iso, inv;
Mapping from: GrpMat: G to MatrixGroup(4, GF(2^5)) given by a rule [no inverse]
Mapping from: MatrixGroup(4, GF(2^5)) to GrpMat: G given by a rule [no inverse]
```

We now experiment with membership testing. We use Function to avoid Magma’s built-in membership testing but in doing so, we may not obtain the shortest possible SLP.

```magma
> w := Function(g2slp)(G.1);
> #w;
284
```

The algorithm is probabilistic, so different executions will most likely give different results.

```magma
> ww := Function(g2slp)(G.1);
> w eq ww;
false
```

Note that the resulting SLPs are from a word group that is not the word group $W$ corresponding to the defining generators of $G$. However, they can be coerced into $W$.

```magma
> W := WordGroup(G);
> NumberOfGenerators(Parent(w)), NumberOfGenerators(W);
7 3
> flag, ww := IsCoercible(W, w);
> flag;
true
> slp2g(w) eq Evaluate(ww, UserGenerators(G));
true
```

So there are two ways to get the element back. An alternative is to use the intrinsic `SzElementToWord`, which is better if the elements are not known to lie in the group.

```magma
> flag, ww := SzElementToWord(G, G.1);
> flag, slp2g(w) eq slp2g(ww);
true true
```

We take an element just outside the group.

```magma
> H := Sp(4, 32);
> flag, ww := SzElementToWord(G, H.1);
> flag;
false
> // in this case we will not get an SLP
> ww := Function(g2slp)(H.1);
> ww;
false
> SatisfiesSzPresentation(G);
true
```

<a id="example-ex-d3b056"></a>
###### `Example: Constructive Membership in 2.Sz(8) (ex-d3b056)`

As a variation we apply the machinery to $2.Sz(8)$. We demonstrate constructive recognition and constructive membership testing.

```magma
> A := ATLASGroup("2Sz8");
> reps := MatRepKeys(A);
> G := MatrixGroup(reps[3]);
> Degree(G), CoefficientRing(G);
40 Finite field of size 7
> flag, iso, inv, g2slp, slp2g := RecognizeSz(G);
> flag;
true
> R := RandomProcess(G);
> g := Random(R);
> w := Function(g2slp)(g);
> slp2g(w) eq g;
true
```

<a id="example-ex-f8d565"></a>
###### `Example: Suzuki Group in Dimension 64 (ex-f8d565)`

For the next example we consider a case where the dimension is large. We construct the Suzuki group in a 64-dimensional matrix representation and then take a random conjugate and also rewrite is over a smaller field.

```magma
> F := GF(2, 9);
> twists := [0, 3, 6];
> G := SuzukiIrreducibleRepresentation(F, twists);
> Degree(G), IsAbsolutelyIrreducible(G);
64 true
> G ^:= Random(Generic(G));
> flag, GG := IsOverSmallerField(G);
> flag, CoefficientRing(GG);
true Finite field of size 2^3
```

Non-constructive recognition is harder in this case and will give us the defining field size. Constructive recognition will decompose the tensor product.

```magma
> time SuzukiRecognition(GG);
true 512
Time: 2.330
> time flag, iso, inv, g2slp, slp2g := RecogniseSz(GG);
Time: 4.800
> iso;
Mapping from: GrpMat: GG to MatrixGroup(4, GF(2^9)) given by a rule [no inverse]
```

Constructive membership is again easy

```magma
> R := RandomProcess(GG);
> g := Random(R);
> time w := Function(g2slp)(g);
Time: 0.020
> // but SLP evaluation is harder in large dimensions
> time slp2g(w) eq g;
true
Time: 0.370
> time SatisfiesSzPresentation(GG);
true
Time: 10.930
```

<a id="example-ex-183108"></a>
###### `Example: Suzuki Group in Cross Characteristic (ex-183108)`

The final example will be in cross characteristic. We build a representation of $Sz(8)$ in cross characteristic.

```magma
> G := Sz(8);
> _, P := SuzukiPermutationRepresentation(G);
> // for example over GF(9)
> M := PermutationModule(P, GF(3, 2));
> factors := CompositionFactors(M);
> exists(m64){f : f in factors | Dimension(f) eq 64};
true
> m64;
GModule m64 of dimension 64 over GF(3^2)
> H := ActionGroup(m64);
> IsAbsolutelyIrreducible(H);
true
> flag, G := IsOverSmallerField(H);
> Degree(G), CoefficientRing(G);
64 Finite field of size 3
```

We actually end up with a group in characteristic $3$.

```magma
> time flag, iso, inv, g2slp, slp2g := RecogniseSz(G);
Time: 3.490
> iso;
Mapping from: GrpMat: G to MatrixGroup(4, GF(2^3)) given by a rule [no inverse]
> R := RandomProcess(G);
> g := Random(R);
> time w := Function(g2slp)(g);
Time: 0.010
> time slp2g(w) eq g;
true
Time: 0.110
> time SatisfiesSzPresentation(G);
true
Time: 0.330
```

#### Constructive Recognition of Small Ree Groups

<a id="id29"></a>
##### Introduction

This machinery provides functionality for constructive recognition and constructive membership testing of the small Ree groups ${\rm {^2}G_2}(q) = {\rm Ree}(q)$, with $q = 3^{2m + 1}$ for some $m > 0$.

The important intrinsics are `RecogniseRee` which performs constructive recognition of $G \cong {\rm Ree}(q)$, `ReeElementToWord` which returns a `GrpSLPElt` for $g$ in the generators of $G$, and `IsReeGroup` which is a non-constructive test for isomorphism between $G$ and ${\rm Ree}(q)$.

There are a few verbose flags used in the package.

**•**
$\quad$ `ReeGeneral`, for the general routines.

**•**
$\quad$ `ReeStandard`, for the routines related to the standard copy.

**•**
$\quad$ `ReeConjugate`, for the routines related to conjugation.

**•**
$\quad$ `ReeTensor`, for the routines related to tensor decomposition.

**•**
$\quad$ `ReeMembership`, for the routines related to membership testing.

**•**
$\quad$ `ReeCrossChar`, for the routines related to cross-characteristic representations.

**•**
$\quad$ `ReeTrick`, for the routines related to the stabiliser trick.

**•**
$\quad$ `ReeInvolution`, for the routines related to involution centralisers.

**•**
$\quad$ `ReeSymSquare`, for the routines related to symmetric square decomposition.

All the flags can be set to values up to $10$, with higher values resulting in more output.

<a id="id30"></a>
##### Recognition Functions

<a id="function-recogniseree-grpmat"></a>
###### `RecogniseRee(G : parameters): GrpMat -> BoolElt, Map, Map, Map, Map`

<a id="function-recognizeree-grpmat"></a>
###### `RecognizeRee(G : parameters): GrpMat -> BoolElt, Map, Map, Map, Map`

```magma
Verify   : BoolElt                      Default: true
FieldSize: RngIntElt                    Default: 
Optimise : BoolElt                      Default: false
```

The matrix group $G$ is absolutely irreducible and defined over minimal field. Constructively recognise $G$ as a Ree group. If $G$ is isomorphic to ${\rm Ree}(q)$ where $q$ is the size of the defining field of $G$, then return:

**•**
Isomorphism from $G$ to ${\rm Ree}(q)$.

**•**
Isomorphism from ${\rm Ree}(q)$ to $G$.

**•**
Map from $G$ to the word group of $G$.

**•**
Map from the word group of $G$ to $G$.

The isomorphisms are composed of maps that are defined by rules, so `Function` should be used on each component to avoid unnecessary built-in membership testing.

The word group is the `GrpSLP` which is the parent of the elements returned by `ReeElementToWord`. In general this is not the same as `WordGroup(G)`, but is created from it using `AddRedundantGenerators`.

If `Verify` is true, then it is checked that $G$ is isomorphic to ${\rm Ree}(q)$, using `IsReeGroup`, otherwise this is not checked. In that case, `FieldSize` must be set to the correct value of $q$.

If `Optimise` is true, then the third map returns element in an optimised word group (using `AddRedundantGenerators`). Then each invocation of the map will be faster, but the initialisation will take longer.

The algorithm for constructive recognition is described in [[Baa14](https://docs.magma-maths.org/references.md#cite-baarnhielm14)].

<a id="function-reeelementtoword-grpmat-grpmatelt"></a>
###### `ReeElementToWord(G, g): GrpMat, GrpMatElt -> BoolElt, GrpSLPElt`

If $G$ has been constructively recognised as a Ree group, and if $g$ is an element of $G$, then return `true` and a `GrpSLPElt` from the word group of $G$ which evaluates to $g$, else return `false`.

This facilitates membership testing in $G$.

<a id="function-isreegroup-grpmat"></a>
###### `IsReeGroup(G): GrpMat -> BoolElt, RngIntElt`

Determine (non-constructively) if $G$ is isomorphic to ${\rm Ree}(q)$. The corresponding $q$ is also returned.

If $G$ is over a field of characteristic not $3$ or has degree greater than $7$, the Monte Carlo algorithm of [`LieType`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/group-recognition.md#function-grpmatff-lietype) is used. If $G$ has degree $7$ and is over a field of characteristic $3$, then a fast Las Vegas algorithm is used.

<a id="function-reeirreduciblerepresentation-fldfin-seqenum-rngintelt"></a>
###### `ReeIrreducibleRepresentation(F, twists : parameters): FldFin, SeqEnum[RngIntElt] -> GrpMat`

```magma
CheckInput: BoolElt                    Default: true
```

The finite field $F$ must have size $q = 3^{2m + 1}$ for some $m > 0$, and *twists* should be a sequence of $n$ distinct pairs of integers $(i, j)$ where $i$ is $7$ or $27$ and $j$ in the range $[0 \ldots 2m]$.

Return an absolutely irreducible representation of ${\rm Ree}(q)$, a tensor product of twisted powers of the representation of dimension $7$ or $27$, where the twists are given by the input sequence.

If `CheckInput` is `true`, then it is verified that $F$ and *twists* satisfy the above requirements. Otherwise this is not checked.

<a id="example-ex-79d9a3"></a>
###### `Example: Recognising a Ree Group (ex-79d9a3)`

Our first example shows off the recognition machinery for the Ree group defined over ${\bf F}_{27}$.

```magma
> SetSeed(1);
> F := GF(3, 3);
> G := ReeGroup(F);
> G ^:= Random(Generic(G));
> flag, q := ReeRecognition(G);
> flag, q eq #F;
true true
> flag, iso, inv, g2slp, slp2g := RecognizeRee(G);
> flag;
true
> iso, inv;
Mapping from: GrpMat: G to MatrixGroup(7, GF(3^3)) given by a rule [no inverse]
Mapping from: MatrixGroup(7, GF(3^3)) to GrpMat: G given by a rule [no inverse]
```

We now experiment with membership testing. As the algorithm is probabilistic, different executions will most likely give different results.

```magma
> w := Function(g2slp)(G.1);
> #w;
342
> ww := Function(g2slp)(G.1);
> w eq ww;
false
```

The resulting SLPs are from another word group but can be coerced into $W$.

```magma
> W := WordGroup(G);
> NumberOfGenerators(Parent(w)), NumberOfGenerators(W);
7 3
> flag, ww := IsCoercible(W, w);
> flag;
true
> // so there are two ways to get the element back
> slp2g(w) eq Evaluate(ww, UserGenerators(G));
true
```

If the elements are not known to lie in the group, a better alternative is to use the intrinsic `ReeElementToWord`. We take a generator of $\Omega(7, F)$ as an example of an element not lying in $G_2(27)$.

```magma
> flag, ww := ReeElementToWord(G, G.1);
> flag, slp2g(w) eq slp2g(ww);
true true
> H := Omega(7, #F);
> flag, ww := ReeElementToWord(G, H.1);
> flag;
false
> ww := Function(g2slp)(H.1);
> ww;
false
```

#### Constructive Recognition of Large Ree Groups

<a id="id32"></a>
##### Introduction

This machinery provides functionality for constructive recognition and constructive membership testing of the large Ree groups ${\rm {^2}F_4}(q) = {\rm LargeRee}(q)$, with $q = 2^{2m + 1}$ for some $m > 0$.

The important intrinsics are `RecogniseLargeRee` which performs constructive recognition of $G \cong {\rm LargeRee}(q)$, `LargeReeElementToWord` which returns a `GrpSLPElt` for $g$ in the generators of $G$, and `IsLargeReeGroup` which is a non-constructive test for isomorphism between $G$ and ${\rm LargeRee}(q)$.

There are a few verbose flags used in the package.

**•**
$\quad$ `LargeReeGeneral`, for the general routines.

**•**
$\quad$ `LargeReeStandard`, for the routines related to the standard copy.

**•**
$\quad$ `LargeReeConjugate`, for the routines related to conjugation.

**•**
$\quad$ `LargeReeRyba`, for the routines related to membership testing.

**•**
$\quad$ `LargeReeTrick`, for the routines related to the stabiliser trick.

**•**
$\quad$ `LargeReeInvolution`, for the routines related to involution centralisers.

**•**
$\quad$

All the flags can be set to values up to $10$, with higher values resulting in more output.

<a id="id33"></a>
##### Recognition Functions

<a id="function-recogniselargeree-grpmat"></a>
###### `RecogniseLargeRee(G : parameters): GrpMat -> BoolElt, Map, Map, Map, Map`

<a id="function-recognizelargeree-grpmat"></a>
###### `RecognizeLargeRee(G : parameters): GrpMat -> BoolElt, Map, Map, Map, Map`

```magma
Verify   : BoolElt                      Default: true
FieldSize: RngIntElt                    Default: 
Optimise : BoolElt                      Default: false
```

The matrix group $G$ is absolutely irreducible and defined over minimal field. Constructively recognise $G$ as a Large Ree group. If $G$ is isomorphic to ${\rm LargeRee}(q)$ where $q$ is the size of the defining field of $G$, then return:

**•**
Isomorphism from $G$ to ${\rm LargeRee}(q)$.

**•**
Isomorphism from ${\rm LargeRee}(q)$ to $G$.

**•**
Map from $G$ to the word group of $G$.

**•**
Map from the word group of $G$ to $G$.

The isomorphisms are composed of maps that are defined by rules, so `Function` should be used on each component to avoid unnecessary built-in membership testing.

The word group is the `GrpSLP` which is the parent of the elements returned by `LargeReeElementToWord`. In general this is not the same as `WordGroup(G)`, but is created from it using `AddRedundantGenerators`.

If `Verify` is true, then it is checked that $G$ is isomorphic to ${\rm LargeRee}(q)$, using `IsLargeRee`, otherwise this is not checked. In that case, `FieldSize` must be set to the correct value of $q$.

If `Optimise` is true, then the third map returns element in an optimised word group (using `AddRedundantGenerators`). Then each invocation of the map will be faster, but the initialisation will take longer.

<a id="function-largereeelementtoword-grpmat-grpmatelt"></a>
###### `LargeReeElementToWord(G, g): GrpMat, GrpMatElt -> BoolElt, GrpSLPElt`

If $G$ has been constructively recognised as a Large Ree group, and if $g$ is an element of $G$, then return `true` and a `GrpSLPElt` from the word group of $G$ which evaluates to $g$, else return `false`.

This facilitates membership testing in $G$.

<a id="function-islargereegroup-grpmat"></a>
###### `IsLargeReeGroup(G): GrpMat -> BoolElt, RngIntElt`

Determine (non-constructively) if $G$ is isomorphic to ${\rm LargeRee}(q)$. The corresponding $q$ is also returned.

If $G$ is over a field of characteristic not $2$ or has degree greater than $26$, the Monte Carlo algorithm of [`LieType`](https://docs.magma-maths.org/FiniteGroups/AlmostSimpleGroups/group-recognition.md#function-grpmatff-lietype) is used. If $G$ has degree $26$ and is over a field of characteristic $2$, then a fast Las Vegas algorithm is used.

### Properties of Finite Groups Of Lie Type

#### Maximal Subgroups of the Classical Groups

The `ClassicalMaximals` function, written by Derek Holt and Colva Roney-Dougal, returns a list of the maximal subgroups of the classical quasisimple groups in their natural representations, as returned by the Magma functions `SL, Sp, SU, Omega, OmegaPlus, OmegaMinus`. The list should be complete for dimensions up to 17. For larger dimensions, all maximal subgroups of geometric type are returned, but not those of Type S (sometimes known as Class C9).

There are also options to return the normalisers of these subgroups in various groups, such as ${\rm GL}(n,q)$, ${\rm CU}(n,q)$, that lie between the quasisimple group and its normaliser in the general linear group. These should be sufficient to enable the skilled user to determine the maximal subgroups of any group lying between the quasisimple groups and its normaliser.

Alternatively, the `type` parameter can now be one of `SL, GL, Sp, SU, GU, Omega+, Omega-, Omega, SO+, SO-, SO, GO+, GO-` (as in the intrinsic `ClassicalClasses`), in which case representatives of the conjugacy classes of the maximal subgroups of the corresponding classical group are returned. For these cases all the optional parameters are ignored.

According to the theorem of Aschbacher [[Asc84](https://docs.magma-maths.org/references.md#cite-asch-maximal-subgps)] discussed earlier in this chapter, the maximal subgroups of a quasisimple classical group over a finite field lie in (at least) one of nine categories, which were listed in the Aschbacher Reduction section.

The subgroups in the first eight of these categories are said to be of *geometric type* and can be described in a uniform fashion. This description is the topic of the book [[KL90](https://docs.magma-maths.org/references.md#cite-kl90)]. They are returned in all dimensions by `ClassicalMaximals`. There is no such uniform description of the subgroups in the ninth class, which have to be classified separately in each dimension. The lists in the papers [[HM01](https://docs.magma-maths.org/references.md#cite-hiss-malle)], [[HM02](https://docs.magma-maths.org/references.md#cite-hiss-malle-c)], and [[Lub01](https://docs.magma-maths.org/references.md#cite-luebeck)] contain sufficient information in theory to compute these subgroups up to dimension 250, but currently this has been carried out only up to dimension 17.

<a id="function-classicalmaximals-monstgelt-rngintelt-rngintelt"></a>
##### `ClassicalMaximals(type, d, q : parameters): MonStgElt, RngIntElt, RngIntElt -> SeqEnum`

```magma
classes   : SetEnum                    Default: {1 ... 9}
all       : BoolElt                    Default: true
special   : BoolElt                    Default: false
general   : BoolElt                    Default: false
normaliser: BoolElt                    Default: false
novelties : BoolElt                    Default: false
```

Return a list of representatives of the conjugacy classes of maximal subgroups of the quasisimple group of the specified type in dimension $d$ over the field of order $q$. The string *type* must either be one of `L, S, U, O, O+, O-`, or one of `SL, GL, Sp, SU, GU, Omega+, Omega-, Omega, SO+, SO-, SO, GO+, GO-`. For this second set of possible types, the optional paramaters described below are ignored. For example `ClassicalMaximals("GU",d,q)` simply returns a list of representatives of the conjugacy classes of the maximal subgroups of $\GU(d,q)$ (which may be incomplete when $d>17$).

If the optional parameter `classes` is set to a proper subset of $\{1 \ldots 9\}$, then only the subgroups lying in the corresponding Aschbacher categories will be returned.

If the option `all` is set `false`, then representatives of the conjugacy classes under the action of the full automorphism group of the simple classical group will be returned: so this option will usually result in fewer subgroups in the returned list!

The option `special` only has effect for types `O, O+, O-`. When this is set to `true`, the normalisers of the subgroups in the appropriate group ${\rm SO}(d,q)$, ${\rm SO}^+(d,q)$, or ${\rm SO}^-(d,q)$ will be returned.

If the option `general` is set to `true`, then the normalisers of the subgroups in the appropriate group ${\rm GL}(d,q)$, ${\rm GU}(d,q)$, ${\rm GO}(d,q)$, ${\rm GO}^+(d,q)$, or ${\rm GO}^-(d,q)$ will be returned. (This option has no effect for type `S`.)

If the option `normaliser` is set to `true`, then the normalisers of the subgroups in the full normaliser of the quasisimple group in the general linear group (i.e. the group preserving the relevant form modulo scalars) will be returned. (For type `L` this has the same effect as setting *general* to `true`.)

If the option `novelties` is set `true`, then the intersections with the quasisimple group of any novelty maximal subgroups of any groups lying between the simple group and its full automorphism group will be returned. Use this option with caution, because the results are not guaranteed to be reliable!

#### Maximal Subgroups of the Exceptional Groups

Here are some intrinsics for creating and conjugating maximal subgroups of Suzuki and Ree groups. The flags `SuzukiMaximals` and `ReeMaximals` may be used to produce verbose output.

<a id="function-suzukimaximalsubgroups-grpmat"></a>
##### `SuzukiMaximalSubgroups(G): GrpMat -> SeqEnum, SeqEnum`

If $G$ has been constructively recognised as a Suzuki group, return a sequence of representatives of the maximal subgroups of $G$. Also returns sequences of `GrpSLPElt` of the generators of the subgroups, from the word group of $G$.

<a id="function-suzukimaximalsubgroupsconjugacy-grpmat-grpmat-grpmat"></a>
##### `SuzukiMaximalSubgroupsConjugacy(G, R, S): GrpMat, GrpMat, GrpMat -> GrpMatElt, GrpSLPElt`

If $G$ has been constructively recognised as a Suzuki group and if $R$ and $S$ are conjugate maximal subgroups of $G$, then return an element $g$ of $G$ that conjugates $R$ to $S$. A `GrpSLPElt` from the word group of $G$, that evaluates to $g$, is also returned.

<a id="function-reemaximalsubgroups-grpmat"></a>
##### `ReeMaximalSubgroups(G): GrpMat -> SeqEnum, SeqEnum`

If $G$ has been constructively recognised as a Ree group, return a sequence of representatives of the maximal subgroups of $G$. Also returns sequences of `GrpSLPElt` of the generators of the subgroups, from the word group of $G$.

<a id="function-reemaximalsubgroupsconjugacy-grpmat-grpmat-grpmat"></a>
##### `ReeMaximalSubgroupsConjugacy(G, R, S): GrpMat, GrpMat, GrpMat -> GrpMatElt, GrpSLPElt`

If $G$ has been constructively recognised as a Ree group and if $R$ and $S$ are conjugate maximal subgroups of $G$, then return an element $g$ of $G$ that conjugates $R$ to $S$. A `GrpSLPElt` from the word group of $G$, that evaluates to $g$, is also returned. This is not implemented if $R, S$ are Frobenius groups.

<a id="function-szmaximals-rngintelt"></a>
##### `SzMaximals(q): RngIntElt -> SeqEnum`

Representatives of the conjugacy classes of maximal subgroups of the Suzuki groups ${\rm Sz}(q)$ (where $q>2$ is an odd power of $2$) are returned. They are subgroups of the subgroup of ${\rm GL}(4,q)$ returned by the Magma function `Sz(q)`.

<a id="function-reemaximals-rngintelt"></a>
##### `ReeMaximals(q): RngIntElt -> SeqEnum`

Representatives of the conjugacy classes of maximal subgroups of the small Ree groups ${\rm Ree}(q)$ (where $q>3$ is an odd power of $3$) are returned. They are subgroups of the subgroup of ${\rm GL}(7,q)$ returned by the Magma function `Ree(q)`.

<a id="function-g2maximals-rngintelt"></a>
##### `G2Maximals(q): RngIntElt -> SeqEnum`

Representatives of the conjugacy classes of maximal subgroups of the groups $G_2(q)$ (where $q$ is prime power) are returned. They are subgroups of the subgroup of ${\rm GL}(7,q)$ returned by the Magma function `G2(q)`.

#### Sylow Subgroups of the Classical Groups

The Magma ClassicalSylow package written by Mark Stather provides functionality for constructing and conjugating the Sylow $p$-subgroups of the classical groups over finite fields in their natural representation, for any prime $p$. The classical groups may be created in Magma using the `GL, SL, Sp, GO, GOPlus, GOMinus, SO, SOPlus, SOMinus, Omega, OmegaPlus, OmegaMinus, GU, SU` intrinsics.

This package makes use of code to compute the classical form fixed by a group written by Derek Holt, and code to conjugate classical forms written by Colva Roney-Dougal.

The algorithms in this package are described in [[Sta](https://docs.magma-maths.org/references.md#cite-stather)], which in turn makes use of the descriptions of the Sylow subgroups of the classical groups given in [[Wei55](https://docs.magma-maths.org/references.md#cite-we55)], [[CF64](https://docs.magma-maths.org/references.md#cite-caf64)], [[RRe57](https://docs.magma-maths.org/references.md#cite-ree57)], and [[Car72a](https://docs.magma-maths.org/references.md#cite-car72)]. The conjugation algorithms make use of only the Meataxe, Smash, basic linear algebra, and the solution of norm equations over finite fields.

<a id="function-classicalsylow-grpmat-rngintelt"></a>
##### `ClassicalSylow(G, p): GrpMat, RngIntElt -> GrpMat`

The argument $G$ must be a classical group in its natural representation, up to conjugation, with the exception of $GO(2m+1,2^e)$. More precisely, it must be a conjugate of a group returned by one of the intrinsics `GL, SL, Sp, GO, GOPlus, GOMinus, SO, SOPlus, SOMinus, Omega, OmegaPlus, OmegaMinus, GU, SU` and $p$ must be a prime number. The intrinsic returns a Sylow $p$-subgroup of $G$ as a matrix group.

<a id="function-classicalsylowconjugation-grpmat-grpmat-grpmat"></a>
##### `ClassicalSylowConjugation(G, P, S): GrpMat, GrpMat, GrpMat -> GrpMatElt`

The argument $G$ must be a classical group in its natural representation, up to conjugation, with the exception of $GO(2m+1,2^e)$. More precisely, it must be a conjugate of a group returned by one of the intrinsics `GL, SL, Sp, GO, GOPlus, GOMinus, SO, SOPlus, SOMinus, Omega, OmegaPlus, OmegaMinus, GU, SU`. The groups $P$ and $S$ must be Sylow $p$-subgroups of $G$. The intrinsic returns an element $g \in G$ with $P^g = S$.

<a id="function-classicalsylownormaliser-grpmat-grpmat"></a>
##### `ClassicalSylowNormaliser(G, P): GrpMat, GrpMat -> GrpMatElt`

In this case $G$ must the full classical group in its natural representation, up to conjugation, with the exception of $GO(2m+1,2^e)$. More precisely, it must be a conjugate of a group returned by one of the intrinsics `GL, Sp, GO, GOPlus, GOMinus, GU`. The subgroup $P$ must be a Sylow $p$-subgroup of $G$. The intrinsic returns the normaliser of $P$ in $G$.

<a id="function-classicalsylowtopc-grpmat-grpmat"></a>
##### `ClassicalSylowToPC(G, P): GrpMat, GrpMat -> GrpPC, UserProgram, Map`

The argument $G$ must be a classical group in its natural representation, up to conjugation, with the exception of $GO(2m+1,2^e)$. More precisely, it must be a conjugate of a group returned by one of the intrinsics `GL, SL, Sp, GO, GOPlus, GOMinus, SO, SOPlus, SOMinus, Omega, OmegaPlus, OmegaMinus, GU, SU`. The group $P$ must be a Sylow $p$-subgroup of $G$. The intrinsic returns a PC group $Q$ isomorphic to $P$, and also an isomorphism from $P$ to $Q$ and an isomorphism from $Q$ to $P$.

<a id="example-ex-464f7f"></a>
##### `Example: Sylow Subgroups of a Symplectic Group (ex-464f7f)`

We construct a Sylow $7$-subgroup $P$ of $G = Sp(28,17^2)$, take a random conjugate $S$ of $P$ and then find a conjugating element $g$ that takes $P$ to $S$.

```magma
> SetSeed(1);
> G := Sp(28,17^2);
> time P := ClassicalSylow(G,7);
Time: 0.080
> S := P^Random(G);
> time g := ClassicalSylowConjugation(G,P,S);
Time: 0.400
```

We next compute the normaliser of $P$ in $G$.

```magma
> time N := ClassicalSylowNormaliser(G,P);
Time: 0.310
> // and a PC presentation of P
> time Pc, PtoPc, PctoP := ClassicalSylowToPC(G,P);
Time: 0.200
> Pc;
GrpPC : Pc of order 2401 = 7^4
PC-Relations:
    Pc.1^7 = Id(Pc),
    Pc.2^7 = Id(Pc),
    Pc.3^7 = Id(Pc),
    Pc.4^7 = Id(Pc)
> // We get inverse isomorphisms PtoPc and PctoP
> g := Random(P);
> PctoP(PtoPc(g)) eq g;
true
> x := Random(Pc);
> PtoPc(PctoP(x)) eq x;
true
```

#### Sylow Subgroups of Exceptional Groups

The flags `SuzukiSylow` and `ReeSylow` may be used to produce verbose output.

<a id="function-suzukisylow-grpmat-rngintelt"></a>
##### `SuzukiSylow(G, p): GrpMat, RngIntElt -> GrpMat, SeqEnum`

If $G$ has been constructively recognised as a Suzuki group, and if $p$ is a prime number, return a random Sylow $p$-subgroup $S$ of $G$.

Also returns a list of `GrpSLPElt` from the word group of $G$, of the generators of $S$. If $p$ does not divide $\left| G \right|$, then the trivial subgroup is returned.

<a id="function-suzukisylowconjugacy-grpmat-grpmat-grpmat-rngintelt"></a>
##### `SuzukiSylowConjugacy(G, R, S, p): GrpMat, GrpMat, GrpMat, RngIntElt -> GrpMatElt, GrpSLPElt`

If $G$ has been constructively recognised as a Suzuki group, if $p$ is a prime number, and if $R$ and $S$ are Sylow $p$-subgroups of $G$, then return an element $g$ of $G$ that conjugates $R$ to $S$. A `GrpSLPElt` from the word group of $G$, that evaluates to $g$, is also returned.

<a id="example-ex-c86d0c"></a>
##### `Example: Sylow Subgroups of a Large Suzuki Group (ex-c86d0c)`

We demonstrate finding a conjugating element for Sylow subgroup in an example over a large field.

```magma
> q := 2^121;
> G := Sz(q);
> G ^:= Random(Generic(G));
> G := DerivedGroupMonteCarlo(G);
> NumberOfGenerators(G);
19
```

Non-constructive recognition is now a bit harder.

```magma
> time SuzukiRecognition(G);
true 2658455991569831745807614120560689152
Time: 0.190
> time flag, iso, inv, g2slp, slp2g := RecogniseSz(G);
Time: 22.810
```

However, after this, each call to constructive membership testing is then easy.

```magma
> R := RandomProcess(G);
> g := Random(R);
> time w := Function(g2slp)(g);
Time: 0.060
> // evaluating SLPs always takes some time
> time slp2g(w) eq g;
true
Time: 1.250
```

We now create some Sylow subgroups and find conjugating elements.

```magma
> p := Random([x[1] : x in Factorization(q - 1)]);
> time R := SuzukiSylow(G, p);
Time: 1.370
> time S := SuzukiSylow(G, p);
Time: 1.310
> // that was easy, as is conjugating them
> time g, slp := SuzukiSylowConjugacy(G, R, S, p);
Time: 1.340
> slp2g(slp) eq g;
true
> #R, NumberOfGenerators(R);
23 1
> time R := SuzukiSylow(G, 2);
Time: 164.020
> time S := SuzukiSylow(G, 2);
Time: 171.740
> NumberOfGenerators(R), #R;
121 7067388259113537318333190002971674063309935587502475832486424805170479104
> time g, slp := SuzukiSylowConjugacy(G, R, S, 2);
Time: 1.650
```

Creating the Sylow $2$-subgroup is hard since they have so many generators. One the other hand, finding a conjugating element is relatively easy.

<a id="function-reesylow-grpmat-rngintelt"></a>
##### `ReeSylow(G, p): GrpMat, RngIntElt -> GrpMat, SeqEnum`

If $G$ has been constructively recognised as a Ree group, and if $p$ is a prime number, return a random Sylow $p$-subgroup $S$ of $G$.

Also returns a list of `GrpSLPElt` from the word group of $G$, of the generators of $S$. If $p$ does not divide $\left| G \right|$, then the trivial subgroup is returned.

<a id="function-reesylowconjugacy-grpmat-grpmat-grpmat-rngintelt"></a>
##### `ReeSylowConjugacy(G, R, S, p): GrpMat, GrpMat, GrpMat, RngIntElt -> GrpMatElt, GrpSLPElt`

If $G$ has been constructively recognised as ${\rm Ree}(q)$, if $p$ is a prime number, and if $R$ and $S$ are Sylow $p$-subgroups of $G$, then return an element $g$ of $G$ that conjugates $R$ to $S$, and a `GrpSLPElt` from the word group of $G$, that evaluates to $g$, is also returned.

Currently, this is not implemented for odd $p$ that divide $q^3 + 1$.

<a id="function-largereesylow-grpmat-rngintelt"></a>
##### `LargeReeSylow(G, p): GrpMat, RngIntElt -> GrpMat, SeqEnum`

If $G$ has been constructively recognised as a Large Ree group, and if $p$ is a prime number, return a random Sylow $p$-subgroup $S$ of $G$.

Also returns a list of `GrpSLPElt` from the word group of $G$, of the generators of $S$. If $p$ does not divide $\left| G \right|$, then the trivial subgroup is returned.

Currently, this is not implemented for $p$ that divide $q + 1$.

<a id="example-ex-026da0"></a>
##### `Example: Sylow Subgroups of a Ree Group (ex-026da0)`

Starting with the Ree group over the field ${\bf F}_{3^31}$, we construct Sylow $p$-subgroups for different primes $p$.

```magma
> m := 7;
> F := GF(3, 2 * m + 1);
> q := #F;
> q;
14348907
> G := ReeGroup(F);
> G ^:= Random(Generic(G));
> G := DerivedGroupMonteCarlo(G);
> NumberOfGenerators(G);
19
> ReeRecognition(G);
true 14348907
> flag, iso, inv, g2slp, slp2g := RecogniseRee(G);
> R := RandomProcess(G);
> g := Random(R);
> w := Function(g2slp)(g);
> slp2g(w) eq g;
true
```

We first create two Sylow $p$-subgroups of prime order and find a conjugating element. Note that $4561$ divides the order of $G$ exactly once and also divides $q - 1$.

```magma
> p := 4561;
> R := ReeSylow(G, p);
> S := ReeSylow(G, p);
> g, slp := ReeSylowConjugacy(G, R, S, p);
```

Thus $R^g = S$. In this case we also automatically get an SLP for the conjugating element.

```magma
> slp2g(slp) eq g;
true
> #R, NumberOfGenerators(R);
4561 1
```

Sylow $3$-subgroups are harder: they have order $3^{45}$ and hence a considerable number of generators.

```magma
> time R := ReeSylow(G, 3);
Time: 3.730
> S := ReeSylow(G, 3);
> NumberOfGenerators(R), #R;
15 2954312706550833698643
> time g, slp := ReeSylowConjugacy(G, R, S, 3);
Time: 0.300
```

#### Conjugacy of Subgroups of the Classical Groups

<a id="function-isglconjugate-grpmat-grpmat"></a>
##### `IsGLConjugate(H, K): GrpMat, GrpMat -> BoolElt, GrpMatElt | Unass`

Given $H$ and $K$, both subgroups of the same general linear group $G = GL(n, q)$, return the value `true` if $H$ and $K$ are conjugate in $G$. The function returns a second value in the event that the subgroups are conjugate: an element $z$ which conjugates $H$ into $K$. The algorithm is described in Roney-Dougal [[RD04](https://docs.magma-maths.org/references.md#cite-isglconjugate)].

#### Conjugacy of Elements of the Exceptional Groups

The flags `SuzukiElements` and `ReeElements` may be used to produce verbose output.

<a id="function-szconjugacyclasses-grpmat"></a>
##### `SzConjugacyClasses(G): GrpMat -> SeqEnum`

If $G$ has been constructively recognised as a Suzuki group, return a list of conjugacy classes, using the same format as the `ConjugacyClasses` intrinsic.

<a id="function-szclassrepresentative-grpmat-grpmatelt"></a>
##### `SzClassRepresentative(G, g): GrpMat, GrpMatElt -> GrpMatElt, GrpMatElt`

If $G$ has been constructively recognised as a Suzuki group, and $g$ is an element of $G$, return the conjugacy class representative $h$ of $g$, such that $h$ is in the list returned by `SzConjugacyClasses`. Also returns $c$ in $G$ such that $g^c = h$.

<a id="function-szisconjugate-grpmat-grpmatelt-grpmatelt"></a>
##### `SzIsConjugate(G, g, h): GrpMat, GrpMatElt, GrpMatElt -> BoolElt, GrpMatElt`

If $G$ has been constructively recognised as a Suzuki group, and $g$ and $h$ are elements of $G$, determine if $g$ is conjugate to $h$. If so, return `true` and an element $c$ such that $g^c = h$, otherwise return `false`.

<a id="function-szclassmap-grpmat"></a>
##### `SzClassMap(G): GrpMat -> Map`

If $G$ has been constructively recognised as a Suzuki group, return its class map, as in the `ClassMap` intrinsic.

<a id="function-reeconjugacyclasses-grpmat"></a>
##### `ReeConjugacyClasses(G): GrpMat -> SeqEnum`

If $G$ has been constructively recognised as a Ree group, return a list of conjugacy classes, using the same format as the `ConjugacyClasses` intrinsic.

#### Irreducible Subgroups of the General Linear Group

<a id="function-irreduciblesubgroups-rngintelt-rngintelt"></a>
##### `IrreducibleSubgroups(n, q): RngIntElt, RngIntElt -> SeqEnum`

```magma
Soluble  : BoolElt                    Default: true
Insoluble: BoolElt                    Default: true
```

Return the list of conjugacy classes of irreducible subgroups of $GL(n, q)$ where $n \in \{2, 3\}$ and $q$ is a prime power. The list is complete for characteristic *at least* 5. The insoluble groups of degree 3 were listed by Hurley [[Hur13](https://docs.magma-maths.org/references.md#cite-hurley-phd)]; the remainder by Flannery and O’Brien [[FO05](https://docs.magma-maths.org/references.md#cite-flannery-obrien)]. Respective implementations were developed by Hurley and O’Brien.

If either `Soluble` or `Insoluble` is `false`, then the corresponding groups are omitted; default for both is `true`.

<a id="example-ex-4bbc80"></a>
##### `Example: Counting Irreducible Matrix Groups (ex-4bbc80)`

```magma
> L := IrreducibleSubgroups(2, 19^5);
> #[x : x in L | IsAbelian (x)];
552
> L := IrreducibleSubgroups(3, 97^2: Insoluble := false);
> #L;
10620
> L[7];
MatrixGroup(3, GF(97^2))
Generators:
    [$.1^2314  $.1^942 $.1^2314]
    [$.1^2345  $.1^942 $.1^2314]
    [$.1^2345  $.1^617 $.1^2314]
> L := IrreducibleSubgroups(3, 11: Soluble := false);
> #L;
22
```

### Atlas Data for the Sporadic Groups

Most of the functions described here use data derived from the Web Atlas. The data has been prepared for inclusion in Magma by Michael Downward and Eamonn O’Brien. It maintains Atlas names, conventions, and orderings.

All of these functions, except `GoodBasePoints`, accept as input matrix or permutation groups. The algorithm underpinning `GoodBasePoints` due to O’Brien & Wilson [[OW05](https://docs.magma-maths.org/references.md#cite-obrien-wilson)].

<a id="function-standardgenerators-grp-monstgelt"></a>
#### `StandardGenerators(G, str : parameters): Grp, MonStgElt -> BoolElt, SeqEnum, SeqEnum`

```magma
Projective       : BoolElt                    Default: false
AutomorphismGroup: BoolElt                    Default: false
```

Construct standard generators for small quasisimple or sporadic group $G$ having name *str*; words in SLP group defined on the defining generators of $G$ are also obtained for the standard generators.

If $G$ is sporadic and `AutomorphismGroup` is `true`, assume $G$ is automorphism group of group having name *str*.

If standard generators found, return `true` and sequences of generators and corresponding words, else `false`.

**Note:** A return value of `false` only means that the algorithm’s random search for standard generators did not succeed within the number of tries allowed. If the user is sure the group $G$ matches the name *str*, then they should try the function again.

If $G$ is absolutely irreducible matrix group and `Projective` is `true`, then construct standard generators possibly modulo centre of $G$.

This function currently works for all sporadic simple groups and all quasisimple groups for which the simple quotient has order at most $2 \times 10^8$. If you call it with an invalid value of *str*, then it will print out a list of all valid values.

<a id="function-standardgeneratorsgroupnames"></a>
#### `StandardGeneratorsGroupNames() -> SetIndx`

A list of valid strings for the second argument of `StandardGenerators`.

<a id="function-standardcopy-monstgelt"></a>
#### `StandardCopy(str): MonStgElt -> Grp, BoolElt`

The standard copy of the group $G$ having the name `str`. If the second return value is `true`, then the group $H$ returned is a matrix group with nontrivial scalar subgroup $Z$, and it is $H/Z$ rather than $H$ that is isomorphic to $G$.

<a id="function-isomorphismtostandardcopy-grp-monstgelt"></a>
#### `IsomorphismToStandardCopy(G, str : parameters): Grp, MonStgElt -> BoolElt, Map`

```magma
Projective       : BoolElt                    Default: false
AutomorphismGroup: BoolElt                    Default: false
```

Use the `StandardGenerators` function to construct a (possibly projective) isomorphism from $G$ to a standard copy of $G$. Options as for `StandardGenerators`. The first returned value indicates whether the call of `StandardGenerators` was successful.

<a id="function-standardpresentation-grp-monstgelt"></a>
#### `StandardPresentation(G, str : parameters): Grp, MonStgElt -> BoolElt, SeqEnum, SeqEnum`

```magma
Projective       : BoolElt                    Default: false
Generators       : SeqEnum                    Default: []
AutomorphismGroup: BoolElt                    Default: false
```

Return `true` if standard presentation is satisfied by generators of sporadic group $G$ having name *str*, else `false`.

If `AutomorphismGroup` is `true`, assume $G$ is automorphism group of sporadic group having name *str*.

Standard generators may be supplied as `Generators`, otherwise defining generators are assumed to be standard.

If $G$ is absolutely irreducible matrix group and `Projective` is `true`, then verify presentation modulo centre of $G$.

<a id="function-maximalsubgroups-grp-monstgelt"></a>
#### `MaximalSubgroups(G, str : parameters): Grp, MonStgElt -> BoolElt, SeqEnum, SeqEnum`

```magma
Projective       : BoolElt                    Default: false
Generators       : SeqEnum                    Default: []
AutomorphismGroup: BoolElt                    Default: false
```

Construct **some** maximal subgroups for sporadic group $G$ having name *str*. If `AutomorphismGroup` is `true`, assume $G$ is automorphism group of sporadic group having name *str* and construct **some** of its maximal subgroups.

If standard generators supplied as `Generators` or found for $G$ then return `true` and list of subgroups, else return `false`.

If $G$ is absolutely irreducible matrix group and `Projective` is `true`, then construct standard generators and so subgroups possibly modulo centre of G.

<a id="function-subgroups-grp-monstgelt"></a>
#### `Subgroups(G, str : parameters): Grp, MonStgElt -> BoolElt, SeqEnum`

```magma
Projective: BoolElt                    Default: false
Generators: SeqEnum                    Default: []
```

Construct certain subgroups for sporadic group $G$ having name *str*. If standard generators supplied as `Generators` or found for $G$ then return `true` and list of subgroups, else return `false`.

If $G$ is absolutely irreducible matrix group and `Projective` is `true`, then construct standard generators possibly modulo centre of $G$.

<a id="function-goodbasepoints-grp-monstgelt"></a>
#### `GoodBasePoints(G, str : parameters): Grp, MonStgElt -> BoolElt, SeqEnum`

```magma
Projective: BoolElt                    Default: false
Generators: SeqEnum                    Default: []
```

If standard generators supplied as `Generators` or found for sporadic group $G$ having name *str*, then return `true` and list of base points for $G$, else return `false`.

If $G$ is absolutely irreducible and `Projective` is `true`, then standard generators are possibly modulo centre of $G$, and base points are correspondingly adjusted.

<a id="function-subgroupsdata-monstgelt"></a>
#### `SubgroupsData(str): MonStgElt -> SeqEnum`

Display stored subgroup data for sporadic group having name *str*.

<a id="function-maximalsubgroupsdata-monstgelt"></a>
#### `MaximalSubgroupsData(str : parameters): MonStgElt -> SeqEnum`

```magma
AutomorphismGroup: BoolElt                    Default: false
```

Display stored data for some maximal subgroups of sporadic group having name *str*. If `AutomorphismGroup` is `true`, then display stored data for some maximal subgroups of automorphism group of sporadic group.

<a id="example-ex-328794"></a>
#### `Example: Atlas Data for the Janko Group J1 (ex-328794)`

The machinery is illustrated in the case of the sporadic Janko group $J_1$.

```magma
> G :=
> MatrixGroup<7, GF(11) |
> [ 9, 1, 1, 3, 1, 3, 3, 1, 1, 3, 1, 3, 3, 9, 1, 3, 1, 3, 3, 9, 1, 3, 1, 3,
>  3, 9, 1, 1, 1, 3, 3, 9, 1, 1, 3, 3, 3, 9, 1, 1, 3, 1, 3, 9, 1, 1, 3, 1, 3 ],
> [ 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0,
> 0, 1, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 10, 10, 0, 0, 0, 0, 0,0] >;
> flag, S := StandardGenerators (G, "J1");
> flag;
true
> StandardPresentation (G, "J1": Generators := S);
true
> flag, M:= MaximalSubgroups (G, "J1": Generators := S);
> #M;
7
> M[4];
rec<recformat<name: MonStgElt, parent: MonStgElt, generators: SeqEnum,
 group: Grp, order: RngIntElt, index: RngIntElt> |
     name := 19:6,
     parent := J1,
     group := MatrixGroup(7, GF(11))
     Generators:
         [ 0  1  4  3  3  4  7]
         [ 1  2  8  3  6  2  9]
         [ 4  8 10  1  6  0  9]
         [ 3  3  1  8  9  1 10]
         [ 3  6  6  9  1  3  7]
         [ 4  2  0  1  3  0  9]
         [ 7  9  9 10  7  9  0]

         [ 4  6  2  3  8  1  6]
         [ 8  1  3 10  2  7  4]
         [ 3  6  1  0  6  9  6]
         [ 2  3  6  9  0  3  7]
         [ 7  8  5  2  4  6  4]
         [10  4  5  2  8  6  8]
         [10  9  0  1  9  8  9],
     order := 114,
     index := 1540
     >
```

### Automorphism Groups of Finite Simple Groups

<a id="function-automorphismgroupsimplegroup-monstgelt-rngintelt-rngintelt"></a>
#### `AutomorphismGroupSimpleGroup(type, d, q): MonStgElt, RngIntElt, RngIntElt -> GrpPerm`

<a id="function-automorphismgroupsimplegroup-monstgelt-rngintelt"></a>
#### `AutomorphismGroupSimpleGroup(type, q): MonStgElt, RngIntElt -> GrpPerm`

<a id="function-automorphismgroupsimplegroup-monstgelt"></a>
#### `AutomorphismGroupSimpleGroup(name): MonStgElt -> GrpPerm`

<a id="function-automorphismgroupsimplegroup-tup"></a>
#### `AutomorphismGroupSimpleGroup(triple): Tup -> GrpPerm`

Compute and return a permutation group isomorphic to the full automorphism group of the finite simple group specified by the input parameters.

The first form is for classical groups. `type` can be “L”, “U”, “S”, “O” (for odd dimensions), “O+”, or “O-”, `d` is the dimension, and `q` is the order of the field of definition.

The second form is for alternating or cyclic groups, or exceptional groups of Lie type. `type` can be “A” (for alternating), “C” (for cyclic), “G2”, “Sz” (“Suz”), “2B2” (“TB2”), “Ree” (“R”), “2G2” (“TG2”), “3D4” (“TD4”), “F4”, “E6”, or “2F4” (“TF4”). The types in brackets are alternatives. For the missing types “2E6”, “E7”, and “E8”, there are no permutation representations of sufficiently small degree. The second input parameter `q` is the order of the field of definitions except for types “A” or “C”, when it is the degree.

The third form is for sporadic groups. `type` can be “M11”, “M12”, “M22”, “M23”, “M24”, “J1”, “HS”, “J2”, “HJ”, “McL”, “Suz”, “J3”, “Co1”, “Co2”, “Co3”, “He”, “Fi22” (“F22”), “Fi23” (“F23”), “Fi24” (“F24”),”Ru”, “ON”, or “HN”.

In the fourth form, the input is the triple of integers $<i,j,k>$, which is used by Magma to specify a finite simple group. Such a triple is returned as the second return value of `IsSimpleOrder` for example.

<a id="databases-overview"></a>
<a id="chapgrpdata"></a>
## Databases of Groups

- [Introduction](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/introduction.md)
- [Database of Simple Groups](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/simgps-database.md)
  - [`SimpleGroup(N): RngIntElt → Grp`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/simgps-database.md#function-simplegroup-rngintelt)
  - [`SimpleGroup(S): MonStgElt → Grp`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/simgps-database.md#function-simplegroup-monstgelt)
  - [`SimpleGroup(T): Tup → Grp`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/simgps-database.md#function-simplegroup-tup)
  - [`SimpleGroupOfOrder(M): RngIntElt → Grp`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/simgps-database.md#function-simplegroupoforder-rngintelt)
  - [`SimpleGroup(F): RngIntEltFac → Grp`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/simgps-database.md#function-simplegroup-rnginteltfac)
  - [`NumberOfSimpleGroups() → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/simgps-database.md#function-numberofsimplegroups)
  - [`SimpleGroupName(N): RngIntElt → MonStgElt`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/simgps-database.md#function-simplegroupname-rngintelt)
  - [`SimpleGroupNameToNumber(S): MonStgElt → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/simgps-database.md#function-simplegroupnametonumber-monstgelt)
  - [`SimpleGroupIDToNumber(T): Tup → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/simgps-database.md#function-simplegroupidtonumber-tup)
  - [`SimpleGroupID(N): RngIntElt → Tup`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/simgps-database.md#function-simplegroupid-rngintelt)
- [Database of Small Groups](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/smlgps-database.md)
  - [Basic Small Group Functions](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/smlgps-database.md#basic-small-group-functions)
    - [`SmallGroupDatabase() → DB`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/smlgps-database.md#function-grpdata-smallgroupdatabase)
    - [`OpenSmallGroupDatabase() → DB`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/smlgps-database.md#function-opensmallgroupdatabase)
    - [`delete D: DB`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/smlgps-database.md#operation-grpdata-delete)
    - [`SmallGroupDatabaseLimit() → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/smlgps-database.md#function-smallgroupdatabaselimit)
    - [`SmallGroupDatabaseLimit(D): DB → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/smlgps-database.md#function-smallgroupdatabaselimit-db)
    - [`IsInSmallGroupDatabase(o): RngIntElt → BoolElt`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/smlgps-database.md#function-grpdata-isinsmallgroupdatabase)
    - [`IsInSmallGroupDatabase(D, o): DB, RngIntElt → BoolElt`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/smlgps-database.md#function-isinsmallgroupdatabase-db-rngintelt)
    - [`NumberOfSmallGroups(o): RngIntElt → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/smlgps-database.md#function-grpdata-numberofsmallgroups)
    - [`NumberOfSmallGroups(D, o): DB, RngIntElt → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/smlgps-database.md#function-numberofsmallgroups-db-rngintelt)
    - [`SmallGroup(o, n): RngIntElt, RngIntElt → Grp`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/smlgps-database.md#function-grpdata-smallgroup)
    - [`SmallGroup(D, o, n): DB, RngIntElt, RngIntElt → Grp`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/smlgps-database.md#function-smallgroup-db-rngintelt-rngintelt)
    - [`Group(D, o, n): DB, RngIntElt, RngIntElt → Grp`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/smlgps-database.md#function-group-db-rngintelt-rngintelt)
    - [`SmallGroup(o: parameters): RngIntElt → Grp`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/smlgps-database.md#function-smallgroup-rngintelt)
    - [`SmallGroup(D, o: parameters): DB, RngIntElt → Grp`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/smlgps-database.md#function-smallgroup-db-rngintelt)
    - [`SmallGroup(o, f: parameters): RngIntElt, Program → Grp`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/smlgps-database.md#function-smallgroup-rngintelt-program)
    - [`SmallGroup(D, o, f: parameters): RngIntElt, Program → Grp`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/smlgps-database.md#function-smallgroup-rngintelt-program-2)
    - [`IsSoluble(D, o, n): DB, RngIntElt, RngIntElt → Grp`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/smlgps-database.md#function-issoluble-db-rngintelt-rngintelt)
    - [`IsSolvable(D, o, n): DB, RngIntElt, RngIntElt → Grp`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/smlgps-database.md#function-issolvable-db-rngintelt-rngintelt)
    - [`SmallGroupIsSoluble(o, n): RngIntElt, RngIntElt → Grp`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/smlgps-database.md#function-smallgroupissoluble-rngintelt-rngintelt)
    - [`SmallGroupIsSoluble(D, o, n): DB, RngIntElt, RngIntElt → Grp`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/smlgps-database.md#function-smallgroupissoluble-db-rngintelt-rngintelt)
    - [`SmallGroupIsSolvable(o, n): RngIntElt, RngIntElt → Grp`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/smlgps-database.md#function-smallgroupissolvable-rngintelt-rngintelt)
    - [`SmallGroupIsSolvable(D, o, n): DB, RngIntElt, RngIntElt → Grp`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/smlgps-database.md#function-smallgroupissolvable-db-rngintelt-rngintelt)
    - [`SmallGroupIsInsoluble(o, n): RngIntElt, RngIntElt → Grp`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/smlgps-database.md#function-smallgroupisinsoluble-rngintelt-rngintelt)
    - [`SmallGroupIsInsoluble(D, o, n): DB, RngIntElt, RngIntElt → Grp`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/smlgps-database.md#function-smallgroupisinsoluble-db-rngintelt-rngintelt)
    - [`SmallGroupIsInsolvable(o, n): RngIntElt, RngIntElt → Grp`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/smlgps-database.md#function-smallgroupisinsolvable-rngintelt-rngintelt)
    - [`SmallGroupIsInsolvable(D, o, n): DB, RngIntElt, RngIntElt → Grp`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/smlgps-database.md#function-smallgroupisinsolvable-db-rngintelt-rngintelt)
    - [`SmallGroup(o, f: parameters): RngIntElt, Program → Grp`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/smlgps-database.md#function-smallgroup-rngintelt-program-3)
    - [`SmallGroup(S, f: parameters): [RngIntElt], Program → Grp`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/smlgps-database.md#function-smallgroup-rngintelt-program-4)
    - [`SmallGroup(D, o, f: parameters): DB, RngIntElt, Program → Grp`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/smlgps-database.md#function-smallgroup-db-rngintelt-program)
    - [`SmallGroup(D, S, f: parameters): DB, [RngIntElt], Program → Grp`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/smlgps-database.md#function-smallgroup-db-rngintelt-program-2)
    - [`SmallGroups(o: parameters): RngIntElt → [* Grp *]`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/smlgps-database.md#function-smallgroups-rngintelt)
    - [`SmallGroups(D, o: parameters): DB, RngIntElt → [* Grp *]`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/smlgps-database.md#function-smallgroups-db-rngintelt)
    - [`SmallGroups(S: parameters): [RngIntElt] → [* Grp *]`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/smlgps-database.md#function-smallgroups-rngintelt-2)
    - [`SmallGroups(D, S: parameters): DB, [RngIntElt] → [* Grp *]`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/smlgps-database.md#function-smallgroups-db-rngintelt-2)
    - [`SmallGroups(o, f: parameters): RngIntElt, Program → [* Grp *]`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/smlgps-database.md#function-smallgroups-rngintelt-program)
    - [`SmallGroups(D, o, f: parameters): DB, RngIntElt, Program → [* Grp *]`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/smlgps-database.md#function-smallgroups-db-rngintelt-program)
    - [`SmallGroups(S, f: parameters): [RngIntElt], Program → [* Grp *]`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/smlgps-database.md#function-smallgroups-rngintelt-program-2)
    - [`SmallGroups(D, S, f: parameters): DB, [RngIntElt], Program → [* Grp *]`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/smlgps-database.md#function-smallgroups-db-rngintelt-program-2)
    - [Example: Non-Abelian Groups of Order 27](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/smlgps-database.md#example-ex-dd4fa3)
  - [Processes](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/smlgps-database.md#processes)
    - [`SmallGroupProcess(o: parameters): RngIntElt → Process`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/smlgps-database.md#function-smallgroupprocess-rngintelt)
    - [`SmallGroupProcess(S: parameters): [RngIntElt] → Process`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/smlgps-database.md#function-smallgroupprocess-rngintelt-2)
    - [`SmallGroupProcess(o, f: parameters): RngIntElt, Program → Process`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/smlgps-database.md#function-smallgroupprocess-rngintelt-program)
    - [`SmallGroupProcess(S, f: parameters): [RngIntElt], Program → Process`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/smlgps-database.md#function-smallgroupprocess-rngintelt-program-2)
    - [`IsEmpty(p): Process → BoolElt`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/smlgps-database.md#function-isempty-process)
    - [`Current(p): Process → Grp`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/smlgps-database.md#function-current-process)
    - [`CurrentLabel(p): Process → RngIntElt, RngIntElt`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/smlgps-database.md#function-currentlabel-process)
    - [`Advance(~p): Process`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/smlgps-database.md#procedure-advance-process-ref)
    - [Example: Nilpotency Classes of Groups of Order 128](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/smlgps-database.md#example-ex-091a11)
  - [Small Group Identification](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/smlgps-database.md#small-group-identification)
    - [`IdentifyGroup(G): Grp → Tup`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/smlgps-database.md#function-grpdata-identifygroup)
    - [`IdentifyGroup(D, G): DB, Grp → Tup`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/smlgps-database.md#function-identifygroup-db-grp)
    - [`CanIdentifyGroup(o): RngIntElt → BoolElt`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/smlgps-database.md#function-grpdata-canidentifygroup)
    - [`CanIdentifyGroup(D, o): DB, RngIntElt → BoolElt`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/smlgps-database.md#function-canidentifygroup-db-rngintelt)
    - [`IdentifyGroupBySearch(G): Grp → Tup`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/smlgps-database.md#function-grpdata-identifygroupbysearch)
    - [Example: Identifying a Small Group](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/smlgps-database.md#example-ex-718e51)
    - [Example: Identifying a Group by Search](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/smlgps-database.md#example-ex-10803c)
    - [Example: Identifying a Finitely Presented Group](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/smlgps-database.md#example-ex-0670f9)
  - [Accessing Internal Data](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/smlgps-database.md#accessing-internal-data)
    - [`Data(D, o, n): DB, RngIntElt, RngIntElt → List`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/smlgps-database.md#function-data-db-rngintelt-rngintelt)
    - [`SmallGroupEncoding(G): GrpPC → RngIntElt, RngIntElt`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/smlgps-database.md#function-smallgroupencoding-grppc)
    - [`SmallGroupDecoding(c, o): RngIntElt, RngIntElt → GrpPC`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/smlgps-database.md#function-smallgroupdecoding-rngintelt-rngintelt)
    - [Example: Internal Data of the Small Groups Database](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/smlgps-database.md#example-ex-c39570)
  - [Groups with Order Divisible by Only 4 Primes](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/smlgps-database.md#groups-with-order-divisible-by-only-4-primes)
    - [`Group4P(o, i): RngIntElt, RngIntElt → Grp`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/smlgps-database.md#function-group4p-rngintelt-rngintelt)
    - [`Groups4P(o): RngIntElt → List`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/smlgps-database.md#function-groups4p-rngintelt)
    - [`NumberOfGroups4P(o): RngIntElt → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/smlgps-database.md#function-numberofgroups4p-rngintelt)
    - [`IdentifyGroup4P(G): GrpPC → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/smlgps-database.md#function-identifygroup4p-grppc)
    - [`IdentifyGroup4P(G): GrpPerm → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/smlgps-database.md#function-identifygroup4p-grpperm)
    - [`IdentifyGroup4P(G): GrpMat → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/smlgps-database.md#function-identifygroup4p-grpmat)
- [The $p$-groups of Order Dividing $p^7$](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/p-groups.md)
  - [`SearchPGroups(p, n: parameters): RngIntElt, RngIntElt → SeqEnum`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/p-groups.md#function-searchpgroups-rngintelt-rngintelt)
  - [`CountPGroups(p, n: parameters): RngIntElt, RngIntElt → SeqEnum`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/p-groups.md#function-countpgroups-rngintelt-rngintelt)
  - [Example: Searching Groups of Order 19^7](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/p-groups.md#example-ex-1addd3)
- [Metacyclic $p$-groups](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/search.md)
  - [`MetacyclicPGroups(p, n: parameters): RngIntElt, RngIntElt → SeqEnum`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/search.md#function-metacyclicpgroups-rngintelt-rngintelt)
  - [`IsMetacyclicPGroup(P): Grp → BoolElt`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/search.md#function-ismetacyclicpgroup-grp)
  - [`InvariantsMetacyclicPGroup(P): Grp → Tup`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/search.md#function-invariantsmetacyclicpgroup-grp)
  - [`StandardMetacyclicPGroup(P): Grp → GrpPC`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/search.md#function-standardmetacyclicpgroup-grp)
  - [`NumberOfMetacyclicPGroups(p, n): RngIntElt, RngIntElt → SeqEnum`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/search.md#function-numberofmetacyclicpgroups-rngintelt-rngintelt)
  - [`HasAllPQuotientsMetacyclic(G): GrpFP → BoolElt, SeqEnum`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/search.md#function-hasallpquotientsmetacyclic-grpfp)
  - [`HasAllPQuotientsMetacyclic(G, p): GrpFP → BoolElt`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/search.md#function-hasallpquotientsmetacyclic-grpfp-2)
  - [Example: Metacyclic 3-Groups of Order 729](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/search.md#example-ex-0140ea)
- [Database of Perfect Groups](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/pfgps.md)
  - [Specifying an Entry of the Database](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/pfgps.md#specifying-an-entry-of-the-database)
  - [Creating the Database](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/pfgps.md#creating-the-database)
    - [`PerfectGroupDatabase() → DB`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/pfgps.md#function-perfectgroupdatabase)
  - [Accessing the Database](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/pfgps.md#accessing-the-database)
    - [`Group(D, i): DB, RngIntElt → GrpFP, SeqEnum`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/pfgps.md#function-group-db-rngintelt)
    - [`Group(D, o, i): DB, RngIntElt, RngIntElt → GrpFP, SeqEnum`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/pfgps.md#function-group-db-rngintelt-rngintelt-2)
    - [`Group(D, Q): DB, MonStgElt → GrpFP, SeqEnum`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/pfgps.md#function-group-db-monstgelt)
    - [`Group(D, Q, p, r, n: parameters): DB, MonStgElt, RngIntElt, RngIntElt, RngIntElt, RngIntElt → GrpFP, SeqEnum`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/pfgps.md#function-group-db-monstgelt-rngintelt-rngintelt-rngintelt-rngintelt)
    - [`IdentificationNumber(D, i): DB, RngIntElt → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/pfgps.md#function-identificationnumber-db-rngintelt)
    - [`IdentificationNumber(D, o, i): DB, RngIntElt, RngIntElt → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/pfgps.md#function-identificationnumber-db-rngintelt-rngintelt)
    - [`IdentificationNumber(D, Q): DB, MonStgElt → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/pfgps.md#function-identificationnumber-db-monstgelt)
    - [`IdentificationNumber(D, Q, p, r, n: parameters): DB, MonStgElt, RngIntElt, RngIntElt, RngIntElt, RngIntElt → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/pfgps.md#function-identificationnumber-db-monstgelt-rngintelt-rngintelt-rngintelt-rngintelt)
    - [`NumberOfRepresentations(D, i): DB, RngIntElt → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/pfgps.md#function-numberofrepresentations-db-rngintelt)
    - [`NumberOfRepresentations(D, o, i): DB, RngIntElt, RngIntElt → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/pfgps.md#function-numberofrepresentations-db-rngintelt-rngintelt)
    - [`NumberOfRepresentations(D, Q): DB, MonStgElt → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/pfgps.md#function-numberofrepresentations-db-monstgelt)
    - [`NumberOfRepresentations(D, Q, p, r, n: parameters): DB, MonStgElt, RngIntElt, RngIntElt, RngIntElt, RngIntElt → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/pfgps.md#function-numberofrepresentations-db-monstgelt-rngintelt-rngintelt-rngintelt-rngintelt)
    - [`PermutationRepresentation(D, i: parameters): DB, RngIntElt → Hom(Grp), GrpFP, GrpPerm`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/pfgps.md#function-permutationrepresentation-db-rngintelt)
    - [`PermutationRepresentation(D, o, i: parameters): DB, RngIntElt, RngIntElt → Hom(Grp), GrpFP, GrpPerm`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/pfgps.md#function-permutationrepresentation-db-rngintelt-rngintelt)
    - [`PermutationRepresentation(D, Q: parameters): DB, MonStgElt → Hom(Grp), GrpFP, GrpPerm`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/pfgps.md#function-permutationrepresentation-db-monstgelt)
    - [`PermutationRepresentation(D, Q, p, r, n: parameters): DB, MonStgElt, RngIntElt, RngIntElt, RngIntElt, RngIntElt → Hom(Grp), GrpFP, GrpPerm`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/pfgps.md#function-permutationrepresentation-db-monstgelt-rngintelt-rngintelt-rngintelt-rngintelt)
    - [`PermutationGroup(D, i: parameters): DB, RngIntElt → GrpPerm`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/pfgps.md#function-permutationgroup-db-rngintelt)
    - [`PermutationGroup(D, o, i: parameters): DB, RngIntElt, RngIntElt → GrpPerm`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/pfgps.md#function-permutationgroup-db-rngintelt-rngintelt)
    - [`PermutationGroup(D, Q: parameters): DB, MonStgElt → GrpPerm`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/pfgps.md#function-permutationgroup-db-monstgelt)
    - [`PermutationGroup(D, Q, p, r, n: parameters): DB, MonStgElt, RngIntElt, RngIntElt, RngIntElt, RngIntElt → GrpPerm`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/pfgps.md#function-permutationgroup-db-monstgelt-rngintelt-rngintelt-rngintelt-rngintelt)
  - [Finding Legal Keys](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/pfgps.md#finding-legal-keys)
    - [`# D: DB → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/pfgps.md#operation-operation-db-rngintelt)
    - [`NumberOfGroups(D): DB → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/pfgps.md#function-numberofgroups-db)
    - [`NumberOfGroups(D, o): DB, RngIntElt → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/pfgps.md#function-numberofgroups-db-rngintelt)
    - [`TopQuotients(D): DB → SetIndx`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/pfgps.md#function-topquotients-db)
    - [`ExtensionPrimes(D, Q): DB, MonStgElt → SetEnum`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/pfgps.md#function-extensionprimes-db-monstgelt)
    - [`ExtensionExponents(D, Q, p): DB, MonStgElt, RngIntElt → SetEnum`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/pfgps.md#function-extensionexponents-db-monstgelt-rngintelt)
    - [`ExtensionNumbers(D, Q, p, r): DB, MonStgElt, RngIntElt, RngIntElt → SetEnum`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/pfgps.md#function-extensionnumbers-db-monstgelt-rngintelt-rngintelt)
    - [`ExtensionClasses(D, Q): DB, MonStgElt → SetEnum`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/pfgps.md#function-extensionclasses-db-monstgelt)
    - [Example: Finding an Extension of L(3, 4)](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/pfgps.md#example-ex-aa434a)
- [Database of Almost-Simple Groups](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/sgdb.md)
  - [The Record Fields](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/sgdb.md#the-record-fields)
  - [Creating the Database](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/sgdb.md#creating-the-database)
    - [`AlmostSimpleGroupDatabase() → DB`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/sgdb.md#function-almostsimplegroupdatabase)
  - [Accessing the Database](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/sgdb.md#accessing-the-database)
    - [`# D: DB → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/sgdb.md#operation-operation-db-rngintelt)
    - [`GroupData(D, i): DB, RngIntElt → Rec`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/sgdb.md#function-groupdata-db-rngintelt)
    - [`GroupData(D, o1, o2, k): DB, RngIntElt, RngIntElt, RngIntElt → Rec`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/sgdb.md#function-groupdata-db-rngintelt-rngintelt-rngintelt)
    - [`ExistsGroupData(D, o1, o2): DB, RngIntElt, RngIntElt → BoolElt`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/sgdb.md#function-existsgroupdata-db-rngintelt-rngintelt)
    - [`ExistsGroupData(D, o1, o2, i): DB, RngIntElt, RngIntElt, RngIntElt → BoolElt, Rec`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/sgdb.md#function-existsgroupdata-db-rngintelt-rngintelt-rngintelt)
    - [`NumberOfGroups(D, o1, o2): DB, RngIntElt, RngIntElt → RngIntElt, RngIntElt`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/sgdb.md#function-numberofgroups-db-rngintelt-rngintelt)
    - [`IdentifyAlmostSimpleGroup(G): GrpPerm → Map, GrpPerm`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/sgdb.md#function-identifyalmostsimplegroup-grpperm)
    - [`IdentifyAlmostSimpleGroup(G): GrpMat → Map, GrpPerm`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/sgdb.md#function-identifyalmostsimplegroup-grpmat)
    - [Example: Querying an Almost Simple Group of Order 720](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/sgdb.md#example-ex-6b4019)
- [Database of Transitive Groups](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/transgp-data.md)
  - [Accessing the Databases](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/transgp-data.md#accessing-the-databases)
    - [`TransitiveGroupDatabaseLimit() → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/transgp-data.md#function-transitivegroupdatabaselimit)
    - [`NumberOfTransitiveGroups(d): RngIntElt → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/transgp-data.md#function-numberoftransitivegroups-rngintelt)
    - [`TransitiveGroup(d, n): RngIntElt, RngIntElt → GrpPerm, MonStgElt`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/transgp-data.md#function-transitivegroup-rngintelt-rngintelt)
    - [`TransitiveGroupDescription(d, n): RngIntElt, RngIntElt → MonStgElt`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/transgp-data.md#function-transitivegroupdescription-rngintelt-rngintelt)
    - [`TransitiveGroupDescription(G): GrpPerm → MonStgElt`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/transgp-data.md#function-transitivegroupdescription-grpperm)
    - [`TransitiveGroup(d): RngIntElt → GrpPerm, MonStgElt`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/transgp-data.md#function-transitivegroup-rngintelt)
    - [`TransitiveGroup(d, f): RngIntElt, Program → GrpPerm, MonStgElt`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/transgp-data.md#function-transitivegroup-rngintelt-program)
    - [`TransitiveGroup(S, f): [RngIntElt], Program → GrpPerm, MonStgElt`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/transgp-data.md#function-transitivegroup-rngintelt-program-2)
    - [`TransitiveGroups(d: parameters): RngIntElt → [GrpPerm]`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/transgp-data.md#function-transitivegroups-rngintelt)
    - [`TransitiveGroups(S: parameters): [RngIntElt] → [GrpPerm]`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/transgp-data.md#function-transitivegroups-rngintelt-2)
    - [`TransitiveGroups(d, f): RngIntElt, Program → [GrpPerm]`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/transgp-data.md#function-transitivegroups-rngintelt-program)
    - [`TransitiveGroups(S, f): [RngIntElt], Program → [GrpPerm]`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/transgp-data.md#function-transitivegroups-rngintelt-program-2)
    - [Example: Transitive Groups of Degree 8](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/transgp-data.md#example-ex-95bf5a)
    - [Example: Isomorphic Non-Conjugate Transitive Groups](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/transgp-data.md#example-ex-974219)
  - [Processes](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/transgp-data.md#processes)
    - [`TransitiveGroupProcess(d): RngIntElt → Process`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/transgp-data.md#function-transitivegroupprocess-rngintelt)
    - [`TransitiveGroupProcess(S): [RngIntElt] → Process`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/transgp-data.md#function-transitivegroupprocess-rngintelt-2)
    - [`TransitiveGroupProcess(d, f): RngIntElt, Program → Process`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/transgp-data.md#function-transitivegroupprocess-rngintelt-program)
    - [`TransitiveGroupProcess(S, f): [RngIntElt], Program → Process`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/transgp-data.md#function-transitivegroupprocess-rngintelt-program-2)
    - [`IsEmpty(p): Process → BoolElt`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/transgp-data.md#function-isempty-process-2)
    - [`Current(p): Process → GrpPerm, MonStgElt`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/transgp-data.md#function-current-process-2)
    - [`CurrentLabel(p): Process → RngIntElt, RngIntElt`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/transgp-data.md#function-currentlabel-process-2)
    - [`Advance(~p): Process`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/transgp-data.md#procedure-advance-process-ref-2)
    - [Example: Processing Transitive Groups of Degree 5](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/transgp-data.md#example-ex-851721)
  - [Transitive Group Identification](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/transgp-data.md#transitive-group-identification)
    - [`TransitiveGroupIdentification(G): GrpPerm → RngIntElt, RngIntElt`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/transgp-data.md#function-transitivegroupidentification-grpperm)
    - [Example: Identifying a Transitive Group](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/transgp-data.md#example-ex-026a1e)
- [Database of Primitive Groups](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/primgp-data.md)
  - [Accessing the Databases](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/primgp-data.md#accessing-the-databases)
    - [`PrimitiveGroupDatabaseLimit() → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/primgp-data.md#function-primitivegroupdatabaselimit)
    - [`NumberOfPrimitiveGroups(d): RngIntElt → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/primgp-data.md#function-numberofprimitivegroups-rngintelt)
    - [`NumberOfPrimitiveSolubleGroups(d): RngIntElt → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/primgp-data.md#function-numberofprimitivesolublegroups-rngintelt)
    - [`NumberOfPrimitiveAffineGroups(d): RngIntElt → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/primgp-data.md#function-numberofprimitiveaffinegroups-rngintelt)
    - [`NumberOfPrimitiveDiagonalGroups(d): RngIntElt → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/primgp-data.md#function-numberofprimitivediagonalgroups-rngintelt)
    - [`NumberOfPrimitiveProductGroups(d): RngIntElt → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/primgp-data.md#function-numberofprimitiveproductgroups-rngintelt)
    - [`NumberOfPrimitiveAlmostSimpleGroups(d): RngIntElt → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/primgp-data.md#function-numberofprimitivealmostsimplegroups-rngintelt)
    - [`PrimitiveGroup(d, n): RngIntElt, RngIntElt → GrpPerm, MonStgElt, MonStgElt`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/primgp-data.md#function-primitivegroup-rngintelt-rngintelt)
    - [`PrimitiveGroupDescription(d, n): RngIntElt, RngIntElt → MonStgElt`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/primgp-data.md#function-primitivegroupdescription-rngintelt-rngintelt)
    - [`PrimitiveGroup(d): RngIntElt → GrpPerm, MonStgElt, MonStgElt`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/primgp-data.md#function-primitivegroup-rngintelt)
    - [`PrimitiveGroup(d, f): RngIntElt, Program → GrpPerm, MonStgElt`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/primgp-data.md#function-primitivegroup-rngintelt-program)
    - [`PrimitiveGroup(S, f): [RngIntElt], Program → GrpPerm, MonStgElt`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/primgp-data.md#function-primitivegroup-rngintelt-program-2)
    - [`PrimitiveGroups(d: parameters): RngIntElt → [GrpPerm]`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/primgp-data.md#function-primitivegroups-rngintelt)
    - [`PrimitiveGroups(S: parameters): [RngIntElt] → [GrpPerm]`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/primgp-data.md#function-primitivegroups-rngintelt-2)
    - [`PrimitiveGroups( : parameters) → [GrpPerm]`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/primgp-data.md#function-primitivegroups)
    - [`PrimitiveGroups(d, f: parameters): RngIntElt, Program → [GrpPerm]`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/primgp-data.md#function-primitivegroups-rngintelt-program)
    - [`PrimitiveGroups(S, f): [RngIntElt], Program → [GrpPerm]`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/primgp-data.md#function-primitivegroups-rngintelt-program-2)
    - [`PrimitiveGroups(f): Program → [GrpPerm]`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/primgp-data.md#function-primitivegroups-program)
    - [Example: Primitive Groups of Degree 625](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/primgp-data.md#example-ex-d6ff61)
  - [Processes](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/primgp-data.md#processes)
    - [`PrimitiveGroupProcess(d: parameters): RngIntElt → Process`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/primgp-data.md#function-primitivegroupprocess-rngintelt)
    - [`PrimitiveGroupProcess(S: parameters): [RngIntElt] → Process`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/primgp-data.md#function-primitivegroupprocess-rngintelt-2)
    - [`PrimitiveGroupProcess(: parameters) → Process`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/primgp-data.md#function-primitivegroupprocess)
    - [`PrimitiveGroupProcess(d, f: parameters): RngIntElt, Program → Process`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/primgp-data.md#function-primitivegroupprocess-rngintelt-program)
    - [`PrimitiveGroupProcess(S, f: parameters): [RngIntElt], Program → Process`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/primgp-data.md#function-primitivegroupprocess-rngintelt-program-2)
    - [`PrimitiveGroupProcess(f: parameters): Program → Process`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/primgp-data.md#function-primitivegroupprocess-program)
    - [`IsEmpty(p): Process → BoolElt`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/primgp-data.md#function-isempty-process-3)
    - [`Current(p): Process → GrpPerm, MonStgElt`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/primgp-data.md#function-current-process-3)
    - [`CurrentLabel(p): Process → RngIntElt, RngIntElt`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/primgp-data.md#function-currentlabel-process-3)
    - [`Advance(~p): Process`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/primgp-data.md#procedure-advance-process-ref-3)
    - [Example: Processing Primitive Groups of Degree 60](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/primgp-data.md#example-ex-932032)
  - [Primitive Group Identification](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/primgp-data.md#primitive-group-identification)
    - [`PrimitiveGroupIdentification(G): GrpPerm → RngIntElt, RngIntElt`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/primgp-data.md#function-primitivegroupidentification-grpperm)
    - [Example: Identifying a Primitive Group](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/primgp-data.md#example-ex-2ae1d1)
- [Database of Rational Maximal Finite Matrix Groups](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/ratgps.md)
  - [`RationalMatrixGroupDatabase() → DB`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/ratgps.md#function-rationalmatrixgroupdatabase)
  - [`LargestDimension(D): DB → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/ratgps.md#function-largestdimension-db)
  - [`# D: DB → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/ratgps.md#operation-operation-db-rngintelt)
  - [`NumberOfGroups(D): DB → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/ratgps.md#function-numberofgroups-db-2)
  - [`NumberOfLattices(D): DB → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/ratgps.md#function-numberoflattices-db)
  - [`NumberOfGroups(D, d): DB, RngIntElt → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/ratgps.md#function-numberofgroups-db-rngintelt-2)
  - [`NumberOfLattices(D, d): DB, RngIntElt → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/ratgps.md#function-numberoflattices-db-rngintelt)
  - [`Group(D, i): DB, RngIntElt → GrpMat`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/ratgps.md#function-group-db-rngintelt-2)
  - [`Lattice(D, i): DB, RngIntElt → Lat`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/ratgps.md#function-lattice-db-rngintelt)
  - [`Group(D, d, i): DB, RngIntElt, RngIntElt → GrpMat`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/ratgps.md#function-group-db-rngintelt-rngintelt-3)
  - [`Lattice(D, d, i): DB, RngIntElt, RngIntElt → Lat`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/ratgps.md#function-lattice-db-rngintelt-rngintelt)
  - [Example: Counting Rational Matrix Groups](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/ratgps.md#example-ex-34d380)
- [Database of Integral Maximal Finite Matrix Groups](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/intgps.md)
  - [`IntegralMatrixGroupDatabase() → DB`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/intgps.md#function-integralmatrixgroupdatabase)
  - [`LargestDimension(D): DB → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/intgps.md#function-largestdimension-db-2)
  - [`# D: DB → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/intgps.md#operation-operation-db-rngintelt)
  - [`NumberOfGroups(D): DB → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/intgps.md#function-numberofgroups-db-3)
  - [`NumberOfLattices(D): DB → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/intgps.md#function-numberoflattices-db-2)
  - [`NumberOfGroups(D, d): DB, RngIntElt → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/intgps.md#function-numberofgroups-db-rngintelt-3)
  - [`NumberOfLattices(D, d): DB, RngIntElt → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/intgps.md#function-numberoflattices-db-rngintelt-2)
  - [`Group(D, i): DB, RngIntElt → GrpMat`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/intgps.md#function-group-db-rngintelt-3)
  - [`Lattice(D, i): DB, RngIntElt → Lat, SeqEnum`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/intgps.md#function-lattice-db-rngintelt-2)
  - [`Construction(D, i): DB, RngIntElt → MonStgElt, SeqEnum`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/intgps.md#function-construction-db-rngintelt)
  - [`Group(D, d, i): DB, RngIntElt, RngIntElt → GrpMat`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/intgps.md#function-group-db-rngintelt-rngintelt-4)
  - [`Lattice(D, d, i): DB, RngIntElt, RngIntElt → Lat, SeqEnum`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/intgps.md#function-lattice-db-rngintelt-rngintelt-2)
  - [`Construction(D, d, i): DB, RngIntElt, RngIntElt → MonStgElt, SeqEnum`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/intgps.md#function-construction-db-rngintelt-rngintelt)
  - [Example: Accessing Integral Matrix Groups](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/intgps.md#example-ex-2e0f58)
- [Database of Finite Quaternionic Matrix Groups](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/quatgps.md)
  - [`QuaternionicMatrixGroupDatabase() → DB`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/quatgps.md#function-quaternionicmatrixgroupdatabase)
  - [`LargestDimension(D): DB → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/quatgps.md#function-largestdimension-db-3)
  - [`# D: DB → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/quatgps.md#operation-operation-db-rngintelt)
  - [`NumberOfGroups(D): DB → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/quatgps.md#function-numberofgroups-db-4)
  - [`NumberOfLattices(D): DB → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/quatgps.md#function-numberoflattices-db-3)
  - [`NumberOfGroups(D, d): DB, RngIntElt → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/quatgps.md#function-numberofgroups-db-rngintelt-4)
  - [`NumberOfLattices(D, d): DB, RngIntElt → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/quatgps.md#function-numberoflattices-db-rngintelt-3)
  - [`Group(D, i): DB, RngIntElt → GrpMat`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/quatgps.md#function-group-db-rngintelt-4)
  - [`Lattice(D, i): DB, RngIntElt → Lat, SeqEnum`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/quatgps.md#function-lattice-db-rngintelt-3)
  - [`Construction(D, i): DB, RngIntElt → MonStgElt, RngIntElt`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/quatgps.md#function-construction-db-rngintelt-2)
  - [`Group(D, d, i): DB, RngIntElt, RngIntElt → GrpMat`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/quatgps.md#function-group-db-rngintelt-rngintelt-5)
  - [`Lattice(D, d, i): DB, RngIntElt, RngIntElt → Lat, SeqEnum`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/quatgps.md#function-lattice-db-rngintelt-rngintelt-3)
  - [`Construction(D, d, i): DB, RngIntElt, RngIntElt → MonStgElt, RngIntElt`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/quatgps.md#function-construction-db-rngintelt-rngintelt-2)
  - [Example: Quaternionic Matrix Groups of Dimension 36](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/quatgps.md#example-ex-00c791)
- [Database of Finite Symplectic Matrix Groups](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/symplgps.md)
  - [`SymplecticMatrixGroupDatabase() → DB`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/symplgps.md#function-symplecticmatrixgroupdatabase)
  - [`LargestDimension(D): DB → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/symplgps.md#function-largestdimension-db-4)
  - [`# D: DB → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/symplgps.md#operation-operation-db-rngintelt)
  - [`NumberOfGroups(D): DB → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/symplgps.md#function-numberofgroups-db-5)
  - [`NumberOfLattices(D): DB → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/symplgps.md#function-numberoflattices-db-4)
  - [`NumberOfGroups(D, d): DB, RngIntElt → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/symplgps.md#function-numberofgroups-db-rngintelt-5)
  - [`NumberOfLattices(D, d): DB, RngIntElt → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/symplgps.md#function-numberoflattices-db-rngintelt-4)
  - [`Group(D, i): DB, RngIntElt → GrpMat`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/symplgps.md#function-group-db-rngintelt-5)
  - [`Lattice(D, i): DB, RngIntElt → Lat, SeqEnum`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/symplgps.md#function-lattice-db-rngintelt-4)
  - [`Construction(D, i): DB, RngIntElt → MonStgElt`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/symplgps.md#function-construction-db-rngintelt-3)
  - [`Group(D, d, i): DB, RngIntElt, RngIntElt → GrpMat`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/symplgps.md#function-group-db-rngintelt-rngintelt-6)
  - [`Lattice(D, d, i): DB, RngIntElt, RngIntElt → Lat, SeqEnum`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/symplgps.md#function-lattice-db-rngintelt-rngintelt-4)
  - [`Construction(D, d, i): DB, RngIntElt, RngIntElt → MonStgElt`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/symplgps.md#function-construction-db-rngintelt-rngintelt-3)
  - [Example: Symplectic Matrix Groups of Dimension 16](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/symplgps.md#example-ex-c0dcaf)
- [Database of Irreducible Matrix Groups](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/irrgp-data.md)
  - [Accessing the Database](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/irrgp-data.md#accessing-the-database)
    - [`NumberOfIrreducibleMatrixGroups(k, p): RngIntElt, RngIntElt → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/irrgp-data.md#function-numberofirreduciblematrixgroups-rngintelt-rngintelt)
    - [`NumberOfSolubleIrreducibleMatrixGroups(k, p): RngIntElt, RngIntElt → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/irrgp-data.md#function-numberofsolubleirreduciblematrixgroups-rngintelt-rngintelt)
    - [`IrreducibleMatrixGroup(k, p, n): RngIntElt, RngIntElt, RngIntElt → GrpMat`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/irrgp-data.md#function-irreduciblematrixgroup-rngintelt-rngintelt-rngintelt)
    - [Example: Irreducible Matrix Groups in GL(4, 5)](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/irrgp-data.md#example-ex-462c7c)
- [Database of Quasisimple Matrix Groups](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/quasisimplematgp-data.md)
  - [`QuasisimpleMatrixGroup(N, d, p : parameters): MonStgElt, RngIntElt, RngIntElt → GrpMat`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/quasisimplematgp-data.md#function-quasisimplematrixgroup-monstgelt-rngintelt-rngintelt)
  - [`QuasisimpleMatrixGroups() → SeqEnum`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/quasisimplematgp-data.md#function-quasisimplematrixgroups)
- [Database of Soluble Irreducible Groups](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/isolgps-database.md)
  - [Basic Functions](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/isolgps-database.md#basic-functions)
    - [`IsolGroupDatabase() → DB`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/isolgps-database.md#function-isolgroupdatabase)
    - [`IsolGroup(n, p, i): RngIntElt, RngIntElt, RngIntElt → GrpMat`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/isolgps-database.md#function-grpdata-isolgroup)
    - [`Group(D, n, p, i): DB, RngIntElt, RngIntElt, RngIntElt → GrpMat`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/isolgps-database.md#function-group-db-rngintelt-rngintelt-rngintelt)
    - [`IsolNumberOfDegreeField(n, p): RngIntElt, RngIntElt → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/isolgps-database.md#function-isolnumberofdegreefield-rngintelt-rngintelt)
    - [`IsolInfo(n, p, i): RngIntElt, RngIntElt, RngIntElt → MonStgElt`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/isolgps-database.md#function-isolinfo-rngintelt-rngintelt-rngintelt)
    - [`IsolOrder(n, p, i): RngIntElt, RngIntElt, RngIntElt → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/isolgps-database.md#function-isolorder-rngintelt-rngintelt-rngintelt)
    - [`IsolMinBlockSize(n, p, i): RngIntElt, RngIntElt, RngIntElt → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/isolgps-database.md#function-isolminblocksize-rngintelt-rngintelt-rngintelt)
    - [`IsolIsPrimitive(n, p, i): RngIntElt, RngIntElt, RngIntElt → BoolElt`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/isolgps-database.md#function-isolisprimitive-rngintelt-rngintelt-rngintelt)
    - [`IsolGuardian(n, p, i): RngIntElt, RngIntElt, RngIntElt → GrpMat`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/isolgps-database.md#function-isolguardian-rngintelt-rngintelt-rngintelt)
    - [Example: Group of Degree 3 and Its Guardian](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/isolgps-database.md#example-ex-f88165)
  - [Searching with Predicates](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/isolgps-database.md#searching-with-predicates)
    - [`IsolGroupSatisfying(f): Any → GrpMat`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/isolgps-database.md#function-isolgroupsatisfying-any)
    - [`IsolGroupOfDegreeSatisfying(d, f): RngIntElt, Any → GrpMat`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/isolgps-database.md#function-isolgroupofdegreesatisfying-rngintelt-any)
    - [`IsolGroupOfDegreeFieldSatisfying(d, p, f): RngIntElt, RngIntElt, Any → GrpMat`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/isolgps-database.md#function-isolgroupofdegreefieldsatisfying-rngintelt-rngintelt-any)
    - [`IsolGroupsSatisfying(f): Any → SeqEnum`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/isolgps-database.md#function-isolgroupssatisfying-any)
    - [`IsolGroupsOfDegreeSatisfying(d, f): RngIntElt, Any → SeqEnum`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/isolgps-database.md#function-isolgroupsofdegreesatisfying-rngintelt-any)
    - [`IsolGroupsOfDegreeFieldSatisfying(d, p, f): RngIntElt, RngIntElt, Any → SeqEnum`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/isolgps-database.md#function-isolgroupsofdegreefieldsatisfying-rngintelt-rngintelt-any)
  - [Associated Functions](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/isolgps-database.md#associated-functions)
    - [`Getvecs(G): GrpMat → SeqEnum`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/isolgps-database.md#function-getvecs-grpmat)
    - [`Semidir(G, Q): GrpMat, SeqEnum → GrpPerm`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/isolgps-database.md#function-semidir-grpmat-seqenum)
  - [Processes](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/isolgps-database.md#processes)
    - [`IsolProcess() → Process`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/isolgps-database.md#function-isolprocess)
    - [`IsolProcessOfDegree(d): . → Process`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/isolgps-database.md#function-isolprocessofdegree)
    - [`IsolProcessOfField(p): . → Process`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/isolgps-database.md#function-isolprocessoffield)
    - [`IsolProcessOfDegreeField(d, p): ., . → Process`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/isolgps-database.md#function-isolprocessofdegreefield)
    - [`IsEmpty(p): Process → BoolElt`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/isolgps-database.md#function-isempty-process-4)
    - [`Current(p): Process → GrpMat`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/isolgps-database.md#function-current-process-4)
    - [`CurrentLabel(p): Process → RngIntElt, RngIntElt, RngIntElt`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/isolgps-database.md#function-currentlabel-process-4)
    - [`Advance(~p): Process`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/isolgps-database.md#procedure-advance-process-ref-4)
    - [Example: Processing All Groups of Degree 3](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/isolgps-database.md#example-ex-4ef256)
- [Database of ATLAS Groups](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/ATLAS-database.md)
  - [Example: Listing ATLAS Group Names](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/ATLAS-database.md#example-ex-7bb063)
  - [Accessing the Database](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/ATLAS-database.md#accessing-the-database)
    - [`ATLASGroupNames() → SetIndx[MonStgElt]`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/ATLAS-database.md#function-atlasgroupnames)
    - [`ATLASGroup(N): MonStgElt → GrpAtlas`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/ATLAS-database.md#function-atlasgroup)
  - [Accessing the ATLAS Groups](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/ATLAS-database.md#accessing-the-atlas-groups)
    - [`Order(A): GrpAtlas → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/ATLAS-database.md#function-order-grpatlas)
    - [`# G: GrpAtlas → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/ATLAS-database.md#operation-operation-grpatlas-rngintelt)
    - [`Multiplier(A): GrpAtlas → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/ATLAS-database.md#function-multiplier-grpatlas)
    - [`MatRepKeys(A): GrpAtlas → SeqEnum[DBAtlasKeyMatRep]`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/ATLAS-database.md#function-matrepkeys-grpatlas)
    - [`MatRepDegrees(A): GrpAtlas → SetEnum[RngIntElt]`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/ATLAS-database.md#function-matrepdegrees-grpatlas)
    - [`Degree(K): DBAtlasKeyMatRep → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/ATLAS-database.md#function-degree-dbatlaskeymatrep)
    - [`MatRepFieldSizes(A): GrpAtlas → SetEnum[RngIntElt]`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/ATLAS-database.md#function-matrepfieldsizes-grpatlas)
    - [`MatRepCharacteristics(A): GrpAtlas → SetEnum[RngIntElt]`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/ATLAS-database.md#function-matrepcharacteristics-grpatlas)
    - [`Field(K): DBAtlasKeyMatRep → FldFin`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/ATLAS-database.md#function-field-dbatlaskeymatrep)
    - [`PermRepKeys(A): GrpAtlas → SeqEnum[DBAtlasKeyPermRep]`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/ATLAS-database.md#function-permrepkeys-grpatlas)
    - [`PermRepDegrees(A): GrpAtlas → SetEnum[RngIntElt]`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/ATLAS-database.md#function-permrepdegrees-grpatlas)
    - [`Degree(K): DBAtlasKeyPermRep → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/ATLAS-database.md#function-degree-dbatlaskeypermrep)
  - [Representations of the ATLAS Groups](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/ATLAS-database.md#representations-of-the-atlas-groups)
    - [`MatrixGroup(K): DBAtlasKeyMatRep → GrpMat`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/ATLAS-database.md#function-matrixgroup-dbatlaskeymatrep)
    - [`MatRep(K): DBAtlasKeyMatRep → SeqEnum[GrpMatElt]`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/ATLAS-database.md#function-matrep-dbatlaskeymatrep)
    - [`PermutationGroup(K): DBAtlasKeyPermRep → GrpPerm`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/ATLAS-database.md#function-permutationgroup-dbatlaskeypermrep)
    - [`PermRep(K): DBAtlasKeyPermRep → SeqEnum[GrpPermElt]`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/ATLAS-database.md#function-permrep-dbatlaskeypermrep)
    - [Example: Representations of 2.J2.2](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/ATLAS-database.md#example-ex-d60e34)
- [Fundamental Groups of 3-Manifolds](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/3-manifolds-database.md)
  - [Basic Functions](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/3-manifolds-database.md#basic-functions)
    - [`ManifoldDatabase() → DB`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/3-manifolds-database.md#function-manifolddatabase)
    - [`Manifold(D, i): DB, RngIntElt → Rec`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/3-manifolds-database.md#function-manifold-db-rngintelt)
    - [`Manifold(D, name): DB, MonStgElt → Rec`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/3-manifolds-database.md#function-manifold-db-monstgelt)
  - [Accessing the Data](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/3-manifolds-database.md#accessing-the-data)
    - [Example: Records from the 3-Manifolds Database](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/3-manifolds-database.md#example-ex-f8e221)
- [Automatic Groups of 3-Manifolds](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/automatic-group-database.md)
  - [`AutomaticGroup(i): RngIntElt → GrpAtc`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/automatic-group-database.md#function-automaticgroup-rngintelt)
  - [`AutomaticGroup(name): MonStgElt → GrpAtc`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/automatic-group-database.md#function-automaticgroup-monstgelt)
  - [`AutomaticGroup(r): Rec → GrpAtc`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/automatic-group-database.md#function-automaticgroup-rec)
  - [`AutomaticGroupIndices() → [RngIntElt]`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/automatic-group-database.md#function-automaticgroupindices)
  - [`AutomaticGroupNames() → [MonStgElt]`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/automatic-group-database.md#function-automaticgroupnames)
- [Bibliography](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/bibliography.md)

### Introduction

This chapter describes the use of the various databases of groups that form part of Magma. The available databases are as follows:

*Simple Groups*: This database contains all the simple groups of order less than $10^{20}$. While Magma contains tools that allow the user to construct any finite simple group the purpose of this facility is to make it easier to access a simple group and to run through the simple groups in order of increasing group order.

*Small Groups*: This database is constructed by Hans Ulrich Besche, Heiko Dietrich, Bettina Eick, Eamonn O’Brien, and Eileen Pan [[BE99a](https://docs.magma-maths.org/references.md#cite-besche-eick-constr), [BE99b](https://docs.magma-maths.org/references.md#cite-besche-eick-1000), [BE01](https://docs.magma-maths.org/references.md#cite-besche-eick-order-qnp), [BEO01](https://docs.magma-maths.org/references.md#cite-besche-eick-obrien-order-2000), [DE05](https://docs.magma-maths.org/references.md#cite-dietrich-eick), [DEP22](https://docs.magma-maths.org/references.md#cite-dep4primes), [MNVL04](https://docs.magma-maths.org/references.md#cite-newman-ob-vl-04), [OBr90](https://docs.magma-maths.org/references.md#cite-obrien-pgroup), [OBr91](https://docs.magma-maths.org/references.md#cite-obrien-groups-256), [OVL05](https://docs.magma-maths.org/references.md#cite-ob-vl-05)], and contains the following groups:

- All groups of order up to 2000, excluding the groups of order 1024.
- The groups whose order is the product of at most 4 primes.
- The groups of order dividing $p^7$ for $p$ a prime.
- The groups of order $3^8$.
- The groups of order $q^n p$, where $q^n$ is a prime-power dividing $2^8$, $3^6$, $5^5$ or $7^4$ and $p$ is a prime different to $q$.
- The groups of square-free order.

For a different mechanism for accessing the $p$-groups in this collection, see Section [The $p$-groups of Order Dividing $p^7$](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/p-groups.md#chapgrppgp), specifically the functions `SearchPGroups` and `CountPGroups`. These functions also access groups of order $p^7$.

$p$*-groups*: Magma contains the means to construct all $p$-groups of order $p^n$ where $n\le 7$. The data used in the constructions was supplied by Hans Ulrich Besche, Bettina Eick, Eamonn O’Brien, Mike Newman, and Michael Vaughan-Lee [[BE99a](https://docs.magma-maths.org/references.md#cite-besche-eick-constr), [BE99b](https://docs.magma-maths.org/references.md#cite-besche-eick-1000), [BE01](https://docs.magma-maths.org/references.md#cite-besche-eick-order-qnp), [BEO01](https://docs.magma-maths.org/references.md#cite-besche-eick-obrien-order-2000), [MNVL04](https://docs.magma-maths.org/references.md#cite-newman-ob-vl-04), [OBr90](https://docs.magma-maths.org/references.md#cite-obrien-pgroup), [OBr91](https://docs.magma-maths.org/references.md#cite-obrien-groups-256), [OVL05](https://docs.magma-maths.org/references.md#cite-ob-vl-05)].

*Metacyclic* $p$*-groups*: Magma is able to construct all metacyclic groups of order $p^n$. This machinery was developed by Mike Newman, Eamonn O’Brien, and Michael Vaughan-Lee.

*Perfect Groups*: This database contains all perfect groups up to order 50000, and many classes of perfect groups up to order one million. Each group is defined by means of a finite presentation. Further information is also provided which allows the construction of permutation representations. This database was constructed by Derek Holt and Willem Plesken [[HP89](https://docs.magma-maths.org/references.md#cite-holt-plesken)].

*Almost Simple Groups:* This database contains information about every group $G$, where $S \leq G \leq \Aut(S)$ and $S$ is a simple group of order less than 16000000, or $S$ is one of $M_{24}$, $HS$, $J_3$, $McL$, $Sz(32)$, or $L_6(2)$.

*Transitive Permutation Groups*: This database is a Magma version of the database of transitive permutation groups constructed by A. Hulpke [[Hul05](https://docs.magma-maths.org/references.md#cite-hulpketrans)] (for degree up to 30), J. Cannon and D. Holt [[CH08](https://docs.magma-maths.org/references.md#cite-trans32)] (degree 32), D. Holt and G. Royle [[HR19](https://docs.magma-maths.org/references.md#cite-holtroyle)] (degrees 33 to 47), and D. Holt (degree 48). It contains all transitive permutation groups, up to conjugacy in the ambient symmetric group, having degree up to 48.

*Primitive Permutation Groups*: This is a database containing all primitive permutation groups having degree up to 8191 as determined by Sims (for degree $\le 50$), Roney-Dougal and Unger [[RDU03](https://docs.magma-maths.org/references.md#cite-prim1000)] (for degree $< 1000$), Roney-Dougal [[RD05](https://docs.magma-maths.org/references.md#cite-prim2500)] (for degree $< 2500$), Coutts, Quick, and Roney-Dougal [[CQRD11](https://docs.magma-maths.org/references.md#cite-prim4096)] (for degree $< 4096$), and Stratford (for degree $< 8192$).

*Rational Maximal Matrix Groups*: This contains the rational maximal finite matrix groups and their invariant forms, for small dimensions (up to 31) as determined by Gabi Nebe and Willem Plesken [[Neb96](https://docs.magma-maths.org/references.md#cite-nebe-ratgps-31), [NP95](https://docs.magma-maths.org/references.md#cite-nebe-plesken-ratgps)]. Each entry can be accessed either as a matrix group or as a lattice.

*Quaternionic Matrix Groups*: A database of the finite absolutely irreducible subgroups of ${\operatorname{GL}}_n({\cal D})$ where ${\cal D}$ is a definite quaternion algebra whose centre has degree $d$ over ${\mathbb{Q}}$ and $nd\leq10$. Each entry can be accessed either as a matrix group or as a lattice. The database was constructed by Gabi Nebe [[Neb98](https://docs.magma-maths.org/references.md#cite-nebe-quaternionic)].

*Irreducible Matrix Groups*: A database of the irreducible subgroups of $\GL_n(p)$, $p$ prime, $n \ge 1$, and $p^n < 2500$. The groups were determined by Colva Roney-Dougal and William Unger [[RDU03](https://docs.magma-maths.org/references.md#cite-prim1000)] (for $p^n < 1000$) and Roney-Dougal [[RD05](https://docs.magma-maths.org/references.md#cite-prim2500)].

*Soluble Irreducible Groups*: This database contains one representative of each conjugacy class of irreducible soluble subgroups of ${\rm GL}(n,p)$, $p$ prime, for $n > 1$ and $p^n < 256$. It was constructed by Mark Short [[Sho92](https://docs.magma-maths.org/references.md#cite-short)].

*ATLAS Groups*: This database contains representations of nearly simple groups, as in the Birmingham ATLAS of Finite Group Representations. The data was supplied by Rob Wilson.

*Fundamental Groups of 3-Manifolds*: This database consists of the fundamental groups of the 10,986 small-volume closed hyperbolic manifolds in the Hodgson–Weeks census.

*Automatic Groups of 3-Manifolds*: This database contains automatic groups for 5,389 of the 10,986 small-volume closed hyperbolic manifolds in the Hodgson–Weeks census.

<a id="simgps-database"></a>
<a id="sectsimplegroups"></a>
### Database of Simple Groups

The database of simple groups of order less than $10^{20}$ is intended to make it easy for a user to access any of the small simple groups. There are 403,874 simple groups in the database. The groups are arranged in order of increasing cardinality which makes it trivial to scan the simple groups of small order.

<a id="function-simplegroup-rngintelt"></a>
#### `SimpleGroup(N): RngIntElt -> Grp`

<a id="function-simplegroup-monstgelt"></a>
#### `SimpleGroup(S): MonStgElt -> Grp`

<a id="function-simplegroup-tup"></a>
#### `SimpleGroup(T): Tup -> Grp`

This intrinsic returns a group isomorphic to the simple group specified in the argument. The simple group can be specified by any one of the following:-

- An integer $N$ that is the number of the requested simple group in the database.
- A string $S$ giving the standard name of the simple group.
- A tuple $T$ containing three integers that give the internal designation of the simple group.

The group returned is generally a permutation group of smallest degree that is isomorphic to the simple group, but there are cases where a matrix group is returned.

<a id="function-simplegroupoforder-rngintelt"></a>
#### `SimpleGroupOfOrder(M): RngIntElt -> Grp`

<a id="function-simplegroup-rnginteltfac"></a>
#### `SimpleGroup(F): RngIntEltFac -> Grp`

A group isomorphic to a simple group whose order is given by the argument. The order may be an integer $M$ or a factored integer $F$.

<a id="function-numberofsimplegroups"></a>
#### `NumberOfSimpleGroups() -> RngIntElt`

The number of groups in the simple groups database.

<a id="function-simplegroupname-rngintelt"></a>
#### `SimpleGroupName(N): RngIntElt -> MonStgElt`

This intrinsic returns a standard name of the simple group which has database number $N$.

<a id="function-simplegroupnametonumber-monstgelt"></a>
#### `SimpleGroupNameToNumber(S): MonStgElt -> RngIntElt`

This intrinsic returns the database number of the simple group which has standard name $S$.

<a id="function-simplegroupidtonumber-tup"></a>
#### `SimpleGroupIDToNumber(T): Tup -> RngIntElt`

This intrinsic returns the database number of the simple group whose internal designation is $T$.

<a id="function-simplegroupid-rngintelt"></a>
#### `SimpleGroupID(N): RngIntElt -> Tup`

This intrinsic returns the tuple identifying the simple group with database number $N$.

<a id="smlgps-database"></a>
<a id="sectsmallgroups"></a>
### Database of Small Groups

Magma includes the Small Groups Library prepared by Besche, Eick, and O’Brien. For a description of the algorithms used to generate these groups, details on the data structures used, and applications we refer to [[BE99a](https://docs.magma-maths.org/references.md#cite-besche-eick-constr), [BE99b](https://docs.magma-maths.org/references.md#cite-besche-eick-1000), [BE01](https://docs.magma-maths.org/references.md#cite-besche-eick-order-qnp), [BEO01](https://docs.magma-maths.org/references.md#cite-besche-eick-obrien-order-2000), [DEP22](https://docs.magma-maths.org/references.md#cite-dep4primes), [MNVL04](https://docs.magma-maths.org/references.md#cite-newman-ob-vl-04), [OBr90](https://docs.magma-maths.org/references.md#cite-obrien-pgroup), [OBr91](https://docs.magma-maths.org/references.md#cite-obrien-groups-256)] and the references therein.

The Small Groups Library contains the following groups.

- All groups of order up to 2000, excluding the groups of order 1024.
- The groups whose order is a product of at most 4 (not necessarily distinct) primes.
- The groups of order dividing $p^7$ for $p$ a prime.
- The groups of order $3^8$.
- The groups of order $q^n p$, where $q^n$ is a prime-power dividing $2^8$, $3^6$, $5^5$ or $7^4$ and $p$ is a prime different to $q$.
- The groups of square-free order.

The descriptions of the groups of order $p^4, p^5, p^6$ for $p>3$ were contributed by Boris Girnat, Robert McKibbin, M.F. Newman, E.A. O’Brien, and M.R. Vaughan-Lee.

The Magma version of this library uses the same internal data format as the implementation available in GAP. In particular, the numbering of the groups of a given order in both packages is the same.

For a different mechanism for accessing the $p$-groups in this collection, see the [The $p$-groups of Order Dividing $p^7$](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/p-groups.md#chapgrppgp) section, specifically the functions `SearchPGroups` and `CountPGroups`. These functions also access the groups of order $p^7$ (contributed by O’Brien and Vaughan-Lee).

The groups of order $3^8$ (also contributed by O’Brien and Vaughan-Lee) form an optional database that must be downloaded separately.

#### Basic Small Group Functions

Many of the functions in this section have an optional parameter `Search`. It can be used to limit the small group search to soluble (`Search := "Soluble"`) or insoluble (`Search := "Insoluble"`) groups. The default is `Search := "All"`, which allows all groups to be considered.

When a group is extracted from the database, it is returned as a [`GrpPC`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/index-finite-soluble-groups.md#chapgrppc) if it is soluble, or as a [`GrpPerm`](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/index-permutation-groups.md#chapgrpperm) if it is insoluble.

When using the small groups database for an extended search, it is advisable to open the database using the function [`SmallGroupDatabase`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/smlgps-database.md#function-grpdata-smallgroupdatabase), which opens the database and returns a reference to it. This reference can then be passed as first argument to most of the functions described below, and will save that function from opening and closing the database for itself. Doing so will reduce the number of file operations when a lot of use is made of the database. When the database is no longer needed, it can be closed using the [`delete D`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/smlgps-database.md#operation-grpdata-delete) statement.

<a id="function-grpdata-smallgroupdatabase"></a>
##### `SmallGroupDatabase() -> DB`

<a id="function-opensmallgroupdatabase"></a>
##### `OpenSmallGroupDatabase() -> DB`

Open the small groups database (for extended search) and return a reference to it. This reference may be passed to other functions so that they do fewer file operations.

<a id="operation-grpdata-delete"></a>
##### `delete D: DB`

Close the small groups database `D` and free the resources associated with its use.

<a id="function-smallgroupdatabaselimit"></a>
##### `SmallGroupDatabaseLimit() -> RngIntElt`

<a id="function-smallgroupdatabaselimit-db"></a>
##### `SmallGroupDatabaseLimit(D): DB -> RngIntElt`

The limiting order up to which all groups (except those of order 1024) are stored in the database of small groups, that is, currently 2000.

<a id="function-grpdata-isinsmallgroupdatabase"></a>
##### `IsInSmallGroupDatabase(o): RngIntElt -> BoolElt`

<a id="function-isinsmallgroupdatabase-db-rngintelt"></a>
##### `IsInSmallGroupDatabase(D, o): DB, RngIntElt -> BoolElt`

Return `true` if the groups of order $o$ are contained in the database and `false` otherwise. This function can be used to check whether $o$ is a legitimate argument for other functions described in this section, avoiding runtime errors in user written loops or functions.

<a id="function-grpdata-numberofsmallgroups"></a>
##### `NumberOfSmallGroups(o): RngIntElt -> RngIntElt`

<a id="function-numberofsmallgroups-db-rngintelt"></a>
##### `NumberOfSmallGroups(D, o): DB, RngIntElt -> RngIntElt`

Given a positive integer $o$, return the number of groups of order $o$ in the database. If the groups of order $o$ are not contained in the database, 0 is returned. This function can be used to check whether a pair $o$, $n$ defines a group contained in the small groups database, that is, whether it is a legitimate argument for other functions described in this section, avoiding runtime errors in user written loops or functions.

<a id="function-grpdata-smallgroup"></a>
##### `SmallGroup(o, n): RngIntElt, RngIntElt -> Grp`

<a id="function-smallgroup-db-rngintelt-rngintelt"></a>
##### `SmallGroup(D, o, n): DB, RngIntElt, RngIntElt -> Grp`

<a id="function-group-db-rngintelt-rngintelt"></a>
##### `Group(D, o, n): DB, RngIntElt, RngIntElt -> Grp`

Given a positive integer $o$, such that the groups of order $o$ are contained in the small groups library, and a positive integer $n$, return the $n$-th group of order $o$ in the database. If the groups of order $o$ are not contained in the database or if $n$ exceeds the number of groups of order $o$ in the database, an error is reported. The function [`NumberOfSmallGroups`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/smlgps-database.md#function-grpdata-numberofsmallgroups) can be used to check whether the arguments are valid.

<a id="function-smallgroup-rngintelt"></a>
##### `SmallGroup(o: parameters): RngIntElt -> Grp`

<a id="function-smallgroup-db-rngintelt"></a>
##### `SmallGroup(D, o: parameters): DB, RngIntElt -> Grp`

```magma
Search: MonStgElt                    Default: "All"
```

Given a positive integer $o$, such that the groups of order $o$ are contained in the small groups library, return the first group of order $o$ in the database meeting the search criterion set by the parameter `Search`. If the groups of order $o$ are not contained in the database, an error is reported. The function [`IsInSmallGroupDatabase`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/smlgps-database.md#function-grpdata-isinsmallgroupdatabase) can be used to check whether $o$ is a valid argument for this function.

<a id="function-smallgroup-rngintelt-program"></a>
##### `SmallGroup(o, f: parameters): RngIntElt, Program -> Grp`

<a id="function-smallgroup-rngintelt-program-2"></a>
##### `SmallGroup(D, o, f: parameters): RngIntElt, Program -> Grp`

```magma
Search: MonStgElt                    Default: "All"
```

Given a positive integer $o$ such that the groups of order $o$ are contained in the small groups library and a predicate $f$ (as a function or intrinsic), return the first group of order $o$ in the database meeting the search criterion set by the parameter `Search`, which satisfies $f$.

<a id="function-issoluble-db-rngintelt-rngintelt"></a>
##### `IsSoluble(D, o, n): DB, RngIntElt, RngIntElt -> Grp`

<a id="function-issolvable-db-rngintelt-rngintelt"></a>
##### `IsSolvable(D, o, n): DB, RngIntElt, RngIntElt -> Grp`

<a id="function-smallgroupissoluble-rngintelt-rngintelt"></a>
##### `SmallGroupIsSoluble(o, n): RngIntElt, RngIntElt -> Grp`

<a id="function-smallgroupissoluble-db-rngintelt-rngintelt"></a>
##### `SmallGroupIsSoluble(D, o, n): DB, RngIntElt, RngIntElt -> Grp`

<a id="function-smallgroupissolvable-rngintelt-rngintelt"></a>
##### `SmallGroupIsSolvable(o, n): RngIntElt, RngIntElt -> Grp`

<a id="function-smallgroupissolvable-db-rngintelt-rngintelt"></a>
##### `SmallGroupIsSolvable(D, o, n): DB, RngIntElt, RngIntElt -> Grp`

Return `true` iff `SmallGroup(o, n)` is soluble. This function does not load the group. If the group specified by the arguments does not exist in the database, an error is reported. The function [`NumberOfSmallGroups`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/smlgps-database.md#function-grpdata-numberofsmallgroups) can be used to check whether the arguments are valid.

<a id="function-smallgroupisinsoluble-rngintelt-rngintelt"></a>
##### `SmallGroupIsInsoluble(o, n): RngIntElt, RngIntElt -> Grp`

<a id="function-smallgroupisinsoluble-db-rngintelt-rngintelt"></a>
##### `SmallGroupIsInsoluble(D, o, n): DB, RngIntElt, RngIntElt -> Grp`

<a id="function-smallgroupisinsolvable-rngintelt-rngintelt"></a>
##### `SmallGroupIsInsolvable(o, n): RngIntElt, RngIntElt -> Grp`

<a id="function-smallgroupisinsolvable-db-rngintelt-rngintelt"></a>
##### `SmallGroupIsInsolvable(D, o, n): DB, RngIntElt, RngIntElt -> Grp`

Return `true` iff `SmallGroup(o, n)` is insoluble. This function does not load the group. If the group specified by the arguments does not exist in the database, an error is reported. The function [`NumberOfSmallGroups`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/smlgps-database.md#function-grpdata-numberofsmallgroups) can be used to check whether the arguments are valid.

<a id="function-smallgroup-rngintelt-program-3"></a>
##### `SmallGroup(o, f: parameters): RngIntElt, Program -> Grp`

<a id="function-smallgroup-rngintelt-program-4"></a>
##### `SmallGroup(S, f: parameters): [RngIntElt], Program -> Grp`

<a id="function-smallgroup-db-rngintelt-program"></a>
##### `SmallGroup(D, o, f: parameters): DB, RngIntElt, Program -> Grp`

<a id="function-smallgroup-db-rngintelt-program-2"></a>
##### `SmallGroup(D, S, f: parameters): DB, [RngIntElt], Program -> Grp`

```magma
Search: MonStgElt                    Default: "All"
```

Given a sequence $S$ of orders or a single order $o$ contained in the database and a predicate $f$ (as a function or intrinsic), return the first group with order in $S$ or equal to $o$, respectively, which meets the search criterion set by the parameter `Search` and satisfies $f$.

<a id="function-smallgroups-rngintelt"></a>
##### `SmallGroups(o: parameters): RngIntElt -> [* Grp *]`

<a id="function-smallgroups-db-rngintelt"></a>
##### `SmallGroups(D, o: parameters): DB, RngIntElt -> [* Grp *]`

```magma
Search : MonStgElt                    Default: "All"
Warning: BoolElt                      Default: true
```

Given an order $o$ contained in the database, return a list of all groups of order $o$, meeting the search criterion set by the parameter `Search`. Some orders will produce a very large sequence of groups – in such cases a warning will be printed unless the user specifies `Warning := false`.

<a id="function-smallgroups-rngintelt-2"></a>
##### `SmallGroups(S: parameters): [RngIntElt] -> [* Grp *]`

<a id="function-smallgroups-db-rngintelt-2"></a>
##### `SmallGroups(D, S: parameters): DB, [RngIntElt] -> [* Grp *]`

```magma
Search : MonStgElt                    Default: "All"
Warning: BoolElt                      Default: true
```

Given a sequence $S$ of orders contained in the database, return a list of all groups with order in $S$, meeting the search criterion set by the parameter `Search`. The resulting sequence may be very long – in such cases a warning will be printed unless the user specifies `Warning := false`.

<a id="function-smallgroups-rngintelt-program"></a>
##### `SmallGroups(o, f: parameters): RngIntElt, Program -> [* Grp *]`

<a id="function-smallgroups-db-rngintelt-program"></a>
##### `SmallGroups(D, o, f: parameters): DB, RngIntElt, Program -> [* Grp *]`

```magma
Search: MonStgElt                    Default: "All"
```

Given an order $o$ contained in the database and a predicate (function or intrinsic) $f$, return a list containing all groups $G$ of order $o$, meeting the search criterion set by the parameter `Search` and satisfying `f(G) eq true`.

<a id="function-smallgroups-rngintelt-program-2"></a>
##### `SmallGroups(S, f: parameters): [RngIntElt], Program -> [* Grp *]`

<a id="function-smallgroups-db-rngintelt-program-2"></a>
##### `SmallGroups(D, S, f: parameters): DB, [RngIntElt], Program -> [* Grp *]`

```magma
Search: MonStgElt                    Default: "All"
```

Given a sequence $S$ of orders contained in the database and a predicate (function or intrinsic) $f$, return a list containing all groups $G$ with order in $S$, meeting the search criterion set by the parameter `Search` and satisfying `f(G) eq true`.

<a id="example-ex-dd4fa3"></a>
##### `Example: Non-Abelian Groups of Order 27 (ex-dd4fa3)`

**(1)**
We find the non-abelian groups of order 27.

```magma
> list := SmallGroups(27, func<x|not IsAbelian(x)> );
> list;
[*
GrpPC of order 27 = 3^3
PC-Relations:
  $.2^$.1 = $.2 * $.3,

GrpPC of order 27 = 3^3
PC-Relations:
  $.1^3 = $.3,
  $.2^$.1 = $.2 * $.3
*]
```

**(2)**
We get the first group in the database with derived length greater than 2.

```magma
> G := SmallGroup([1..100], func<x|DerivedLength(x) gt 2>);
> G;
GrpPC of order 24 = 2^3 * 3
PC-Relations:
  G.1^3 = Id(G),
  G.2^2 = G.4,
  G.3^2 = G.4,
  G.4^2 = Id(G),
  G.2^G.1 = G.3,
  G.3^G.1 = G.2 * G.3,
  G.3^G.2 = G.3 * G.4
```

**(3)**
Now for a list of the insoluble groups of order 240. The insoluble groups in the database are returned as permutation groups.

```magma
> list := SmallGroups(240:Search:="Insoluble");
> #list;
8
> list[7];
Permutation group acting on a set of cardinality 7
  (1, 2, 3, 4)
  (1, 5, 2, 4, 3)(6, 7)
```

**(4)**
The groups of order $2432 = 2^7\cdot 19$ should be contained in the small groups database. We check this using the function [`IsInSmallGroupDatabase`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/smlgps-database.md#function-grpdata-isinsmallgroupdatabase)…

```magma
> IsInSmallGroupDatabase(2432);
true
```

…and determine the number of groups of order $2432$.

```magma
> NumberOfSmallGroups(2432);
19324
```

**(5)**
We find all groups of order $7^6$ with cyclic centre of order $7^2$.

```magma
> f := function (G)
>   Z := Centre (G);
>   return IsCyclic (Z) and #Z eq 7^2;
> end function;
> P := SmallGroups(7^6, f);
> #P;
30
> NumberOfSmallGroups(7^6);
860
```

#### Processes

A small group process makes it possible to iterate over all groups of specified orders satisfying a given predicate, without having to create and store all such groups in a list. A small group process is created via the function `SmallGroupProcess` (in various forms). The standard process functions `IsEmpty`, `Current`, `CurrentLabel`, and `Advance` can then be applied to the process. The functions used to create a small group process all have a parameter `Search` attached to them. This can be used to limit the small group search to soluble (`Search := "Soluble"`) or insoluble (`Search := "Insoluble"`) groups. The default is `Search := "All"`, which allows all groups to be considered. The `Process` functions described below do not have a variant with the database as first argument, as each process opens the database for an extended search automatically.

<a id="function-smallgroupprocess-rngintelt"></a>
##### `SmallGroupProcess(o: parameters): RngIntElt -> Process`

```magma
Search: MonStgElt                    Default: "All"
```

Given an order $o$ contained in the small groups database, return a small group process which will iterate though all groups of order $o$ meeting the search criterion set by the parameter `Search`.

<a id="function-smallgroupprocess-rngintelt-2"></a>
##### `SmallGroupProcess(S: parameters): [RngIntElt] -> Process`

```magma
Search: MonStgElt                    Default: "All"
```

Given a sequence $S$ of orders contained in the small groups database, return a small group process which will iterate though all groups with order in the sequence $S$ meeting the search criterion set by the parameter `Search`.

<a id="function-smallgroupprocess-rngintelt-program"></a>
##### `SmallGroupProcess(o, f: parameters): RngIntElt, Program -> Process`

```magma
Search: MonStgElt                    Default: "All"
```

Given an order $o$ contained in the small groups database and a predicate f (as function or intrinsic), return a small group process which will iterate though all groups of order $o$, which meet the search criterion set by the parameter `Search` and satisfy the predicate $f$.

<a id="function-smallgroupprocess-rngintelt-program-2"></a>
##### `SmallGroupProcess(S, f: parameters): [RngIntElt], Program -> Process`

```magma
Search: MonStgElt                    Default: "All"
```

Given a sequence $S$ of orders contained in the small groups database and a predicate f (as function or intrinsic), return a small group process which will iterate though all groups with order in the sequence $S$, which meet the search criterion set by the parameter `Search` and satisfy the predicate $f$.

<a id="function-isempty-process"></a>
##### `IsEmpty(p): Process -> BoolElt`

Returns `true` if the process $p$ has passed its last group.

<a id="function-current-process"></a>
##### `Current(p): Process -> Grp`

Return the current group of the process $p$.

<a id="function-currentlabel-process"></a>
##### `CurrentLabel(p): Process -> RngIntElt, RngIntElt`

Return the label of the current group of the process $p$. That is, return $o$ and $n$ such that the current group is `SmallGroup(o, n)`.

<a id="procedure-advance-process-ref"></a>
##### `Advance(~p): Process`

Move the process $p$ to its next group.

<a id="example-ex-091a11"></a>
##### `Example: Nilpotency Classes of Groups of Order 128 (ex-091a11)`

We employ a small group process to examine all the groups of order 128 and determine the nilpotency class of each of them.

```magma
> P := SmallGroupProcess(128);
> count := {* *};
> repeat
>   G := Current(P);
>   Include(~count, NilpotencyClass(G));
>   Advance(~P);
> until IsEmpty(P);
> count;
{* 1^^15, 2^^947, 3^^1137, 4^^197, 5^^29, 6^^3 *}
```

#### Small Group Identification

Intrinsics are provided that allow the user to find the database group that is isomorphic to a given group. Given a group $G$ such that the database includes a group isomorphic to $G$ and assuming that identification of groups of order $|G|$ is supported, the identification functions return a pair $\langle o, n \rangle$ so that `SmallGroup(o, n)` is isomorphic to $G$.

<a id="function-grpdata-identifygroup"></a>
##### `IdentifyGroup(G): Grp -> Tup`

<a id="function-identifygroup-db-grp"></a>
##### `IdentifyGroup(D, G): DB, Grp -> Tup`

Locate the pair of integers $\langle o, n \rangle$ so that `SmallGroup(o, n)` is isomorphic to $G$. If there is no such group in the database or if identification of groups of order $|G|$ is not supported, then an error will result. The function [`CanIdentifyGroup`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/smlgps-database.md#function-grpdata-canidentifygroup) can be used to test whether groups of a certain order can be identified; this may be useful for avoiding runtime errors in user written loops or functions.

<a id="function-grpdata-canidentifygroup"></a>
##### `CanIdentifyGroup(o): RngIntElt -> BoolElt`

<a id="function-canidentifygroup-db-rngintelt"></a>
##### `CanIdentifyGroup(D, o): DB, RngIntElt -> BoolElt`

Return `true` if identification of groups of order $o$ in the database is supported. This function can be used to check whether a group is a legitimate argument for the functions [`IdentifyGroup`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/smlgps-database.md#function-grpdata-identifygroup) described above, avoiding runtime errors in user written loops or functions. For orders where this returns `false` but [`IsInSmallGroupDatabase`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/smlgps-database.md#function-grpdata-isinsmallgroupdatabase) returns `true` (notably 1152 and 1536), the slower fallback [`IdentifyGroupBySearch`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/smlgps-database.md#function-grpdata-identifygroupbysearch) can be used.

<a id="function-grpdata-identifygroupbysearch"></a>
##### `IdentifyGroupBySearch(G): Grp -> Tup`

Locate the pair of integers $\langle o, n \rangle$ so that `SmallGroup(o, n)` is isomorphic to $G$, by iterating the small groups database directly. Use this fallback for orders such as 1152 and 1536 where `CanIdentifyGroup(|G|)` returns `false` but the groups of order $|G|$ are present in the database (that is, [`IsInSmallGroupDatabase`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/smlgps-database.md#function-grpdata-isinsmallgroupdatabase) returns `true`). The group $G$ must be of type `GrpPerm`, `GrpMat`, `GrpPC`, or `GrpAb`.

The implementation pre-filters by solubility of $G$ and walks candidates with cheap structural invariants (derived subgroup order, exponent, centre order, and, when applicable, the `IdentifyGroup` label of the derived subgroup) before falling back to `IsIsomorphic`. Performance depends on how many groups of order $|G|$ share these invariants with $G$; at order 1152 the search typically completes within a few seconds to a couple of minutes.

<a id="example-ex-718e51"></a>
##### `Example: Identifying a Small Group (ex-718e51)`

We identify a permutation group in the small group database, and get an isomorphic group from the database.

```magma
> G := DihedralGroup(10);
> G;
Permutation group G acting on a set of cardinality 10
Order = 20 = 2^2 * 5
  (1, 2, 3, 4, 5, 6, 7, 8, 9, 10)
  (1, 10)(2, 9)(3, 8)(4, 7)(5, 6)
> IdentifyGroup(G);
<20, 4>
> H := SmallGroup(20, 4);
> H;
GrpPC : H of order 20 = 2^2 * 5
PC-Relations:
    H.1^2 = Id(H),
    H.2^2 = Id(H),
    H.3^5 = Id(H),
    H.3^H.1 = H.3^4
```

<a id="example-ex-10803c"></a>
##### `Example: Identifying a Group by Search (ex-10803c)`

The transitive group $8T47$ has order 1152. Identification of groups of order 1152 is not supported directly:

```magma
> CanIdentifyGroup(1152);
false
> NumberOfSmallGroups(1152);
157877
```

The fallback [`IdentifyGroupBySearch`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/smlgps-database.md#function-grpdata-identifygroupbysearch) recovers the label by walking the database with cheap invariants and confirming with `IsIsomorphic`:

```magma
> G := TransitiveGroup(8, 47);
> IdentifyGroupBySearch(G);
<1152, 157849>
```

The same recipe can be written by hand using [`SmallGroupProcess`](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/smlgps-database.md#function-smallgroupprocess-rngintelt) when a more specific filter is appropriate. For example, restricting to groups whose derived subgroup has order 288 and whose 2-core has order 16:

```magma
> G := TransitiveGroup(8, 47);
> assert IsSoluble(G);
> #pCore(G, 2);
16
> #DerivedGroup(G);
288
> f := func< H | #DerivedGroup(H) eq 288 and #pCore(H, 2) eq 16 >;
> P := SmallGroupProcess(1152 : Search := "Soluble");
> repeat
>   M := Current(P);
>   if f(M) and IsIsomorphic(G, M) then
>     CurrentLabel(P);
>     break;
>   end if;
>   Advance(~P);
> until IsEmpty(P);
1152 157849
```

Identifying a finitely presented group $G$ involves constructing a permutation representation $G$ which may fail. The identification process tries to construct a permutation representation of $G$ by enumerating the cosets of the trivial subgroup in $G$. Assuming that a group isomorphic to $G$ is contained in the database, the resulting coset table will be fairly small. Hence for performance reasons, a coset limit of $100\cdot N$ is imposed, where $N$ is the largest order of groups in the database. If the order of $G$ is *known* to be less or equal to $N$, the implicitly invoked coset enumeration can be given a more appropriate value for the maximum number of cosets that can be defined. This is done by means of the intrinsic [`SetGlobalTCParameters`](https://docs.magma-maths.org/FinitelyPresentedGroups/FPGroups/subgroup-general.md#procedure-grpfp-setglobaltcparameters).

If the coset enumeration for $G$ fails with the coset limit set to $100\cdot N$, this can be seen as a reasonable indication that $G$ is probably too large to be includes in the database of small groups.

To deal with cases where the coset enumeration fails when $G$ is known or suspected to be included in the database, the user should attempt to compute the order of $G$ using the intrinsic [`Order`](https://docs.magma-maths.org/FinitelyPresentedGroups/FPGroups/fp-group-properties.md#function-grpfp-1-order) prior to the actual group identification. If this shows $G$ is small enough to be included in the database, the intrinsic [`SetGlobalTCParameters`](https://docs.magma-maths.org/FinitelyPresentedGroups/FPGroups/subgroup-general.md#procedure-grpfp-setglobaltcparameters) can be used to set a larger limit on maximum number of cosets that can be defined by the Todd-Coxeter procedure in a subsequent call to `IdentifyGroup`. This is illustrated in the following example.

<a id="example-ex-0670f9"></a>
##### `Example: Identifying a Finitely Presented Group (ex-0670f9)`

Consider the group defined by the presentation

$$
\langle\, a,b\, |\, (ba^{-1})^3,\, (ba^{-1}b)^2,\,
         a^{12}b^2a^7b^2ab^2 \, \rangle.
$$

```magma
> G := Group<a,b | (b*a^-1)^3, (b*a^-1*b)^2,
>                  a^12*b^2*a^7*b^2*a*b^2 >;
```

We suspect (for some reason) that $G$ is a small group and want to identify its isomorphism type in the database of small groups.

```magma
> IdentifyGroup(G);
IdentifyGroup(
    G: GrpFP: G
)
In file "/home/magma/package/Group/Grp/smallgps2.m", line 220,
column 25:
>>     res := IdentifyGroup(db, G);
                           ^
Runtime error in 'IdentifyGroup': Coset enumeration failed; group
may be too large (see handbook entry for details)
```

The group couldn’t be identified, because it was not possible to construct a permutation representation with the default value of the coset limit. Since we still believe the group is small, we try to prove this using the function [`Order`](https://docs.magma-maths.org/FinitelyPresentedGroups/FPGroups/fp-group-properties.md#function-grpfp-1-order).

```magma
> Order(G : Print := true);
INDEX = 6 (a=6 r=66709 h=999999 n=999999; l=1247 c=1.56; m=969169 t=999998)
6
```

The output line beginning with “INDEX” gives information about the coset enumeration: in particular 999,998 cosets had to be designed in order to construct the coset table. We were correct; the group has order $6$. However, we can see from the verbose output of the `Order` intrinsic that this wasn’t easy to do: almost one million cosets were used in the coset enumeration. Since the order of $G$ is now known to Magma, a subsequent call to `IdentifyGroup` will use 100\*6 as the coset limit. We tell the system to be prepared to work a little harder using the intrinsic [`SetGlobalTCParameters`](https://docs.magma-maths.org/FinitelyPresentedGroups/FPGroups/subgroup-general.md#procedure-grpfp-setglobaltcparameters) and again try to identify $G$:-

```magma
> SetGlobalTCParameters( : Strategy := "Hard");
>
> IdentifyGroup(G);
<6, 1>
```

So $G$ has now been identified!

#### Accessing Internal Data

The following functions provide access to data used internally by the Small Groups Library for representing groups. They are included just for completeness and are intended to be used by experts only. In particular, we do not give a detailed explanation of the (complicated) data format in this manual.

<a id="function-data-db-rngintelt-rngintelt"></a>
##### `Data(D, o, n): DB, RngIntElt, RngIntElt -> List`

Returns the data from which the group number $n$ of order $o$ in $D$ is constructed. The format and the meaning of the items in the returned list depends on the group indicated by the pair $(o,n)$.

<a id="function-smallgroupencoding-grppc"></a>
##### `SmallGroupEncoding(G): GrpPC -> RngIntElt, RngIntElt`

Given a finite solvable group $G$ in the category [`GrpPC`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/index-finite-soluble-groups.md#chapgrppc), return two integers $c$ and $o$ encoding the power conjugate presentation of $G$.

The second return value is the order of $G$. The first return value is an integer specifying the power conjugate relations in the presentation of $G$.

<a id="function-smallgroupdecoding-rngintelt-rngintelt"></a>
##### `SmallGroupDecoding(c, o): RngIntElt, RngIntElt -> GrpPC`

Given two integers $c$ and $o$ encoding a power conjugate presentation $G$, return $G$ as a group in the category [`GrpPC`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/index-finite-soluble-groups.md#chapgrppc).

The second argument is the order of $G$. The first return value is an integer specifying the power conjugate relations in the presentation $G$.

<a id="example-ex-c39570"></a>
##### `Example: Internal Data of the Small Groups Database (ex-c39570)`

**(1)**
We extract a power conjugate presentation from the database and compute its encoding.

```magma
> D := SmallGroupDatabase();
> G := SmallGroup(D,1053,51);
> Category(G);
GrpPC
> SmallGroupEncoding(G);
100286712487397165939678173 1053
```

**(2)**
The second group of order 525 in the small groups database is stored as encoded power conjugate presentation.

```magma
> Data(D,525,2);
[* code, 666501 *]
```

We can create the corresponding group by decoding this information.

```magma
> G := SmallGroupDecoding(666501, 525);
> G;
GrpPC : G of order 525 = 3 * 5^2 * 7
PC-Relations:
    G.1^3 = Id(G),
    G.2^5 = G.4,
    G.3^7 = Id(G),
    G.4^5 = Id(G)
```

This gives the same presentation as accessing the database in the “usual” way.

```magma
> SmallGroup(D,525,2);
GrpPC of order 525 = 3 * 5^2 * 7
PC-Relations:
    $.1^3 = Id($),
    $.2^5 = $.4,
    $.3^7 = Id($),
    $.4^5 = Id($)
```

#### Groups with Order Divisible by Only 4 Primes

The following functions provide access to functions used internally by the Small Groups Library for constructing groups of order divisible by four primes. These functions are based on the paper [[DEP22](https://docs.magma-maths.org/references.md#cite-dep4primes)] by Dietrich, Eick, and Pan. This article gives constructions for all groups of orders $p^2q$, $p^3q$, $p^2q^2$, and $p^2qr$, where $p,q,r$ are distinct primes. These constructions have been implemented in Magma and are available as follows. This includes a function to identify such a group in the lists. In all the functions here, the primes $p,q,r$ must be $< 2^{30}$. The functions here are used by the Small Groups Library when the group order is as above, except when the order is less than 2000, or has the form $p^2q$, or the form $p^3q$ with $p\le 7$ (which were in the small groups library before these functions were written). In these exceptional cases the numbering of the groups within each order usually differs between the Small Groups Library and the functions here. The groups are constructed as pc-groups, except in one case: order 60, group number 13 is the only insoluble group within these orders (it is $A_5$), and this group is returned as a permutation group.

<a id="function-group4p-rngintelt-rngintelt"></a>
##### `Group4P(o, i): RngIntElt, RngIntElt -> Grp`

Returns the $i$th group in the list of groups of order $o$ given by [[DEP22](https://docs.magma-maths.org/references.md#cite-dep4primes)]. The order $o$ must have the form $p^2q$, $p^3q$, $p^2q^2$, or $p^2qr$, where $p,q,r$ are distinct primes.

<a id="function-groups4p-rngintelt"></a>
##### `Groups4P(o): RngIntElt -> List`

Returns the list of groups of order $o$ given by [[DEP22](https://docs.magma-maths.org/references.md#cite-dep4primes)]. The order $o$ must have the form $p^2q$, $p^3q$, $p^2q^2$, or $p^2qr$, where $p,q,r$ are distinct primes.

<a id="function-numberofgroups4p-rngintelt"></a>
##### `NumberOfGroups4P(o): RngIntElt -> RngIntElt`

Returns the length of the list of groups of order $o$ given by [[DEP22](https://docs.magma-maths.org/references.md#cite-dep4primes)]. The order $o$ must have the form $p^2q$, $p^3q$, $p^2q^2$, or $p^2qr$, where $p,q,r$ are distinct primes.

<a id="function-identifygroup4p-grppc"></a>
##### `IdentifyGroup4P(G): GrpPC -> RngIntElt`

<a id="function-identifygroup4p-grpperm"></a>
##### `IdentifyGroup4P(G): GrpPerm -> RngIntElt`

<a id="function-identifygroup4p-grpmat"></a>
##### `IdentifyGroup4P(G): GrpMat -> RngIntElt`

Returns the number of the group isomorphic to $G$ in the list of groups of order $o=|G|$ given by [[DEP22](https://docs.magma-maths.org/references.md#cite-dep4primes)]. The order $o$ must have the form $p^2q$, $p^3q$, $p^2q^2$, or $p^2qr$, where $p,q,r$ are distinct primes. Note that this number may not agree with the number returned by `IdentifyGroup` (see above).

<a id="the-p-groups-of-order-dividing-p-7"></a>
<a id="p-groups"></a>
<a id="chapgrppgp"></a>
### The $p$-groups of Order Dividing $p^7$

Magma contains the means to construct all $p$-groups of order $p^n$ where $n\le 7$. This section describes the functions for accessing these constructions. The data used in the constructions was supplied by Hans Ulrich Besche, Bettina Eick, Eamonn O’Brien, Mike Newman, and Michael Vaughan-Lee [[BE99a](https://docs.magma-maths.org/references.md#cite-besche-eick-constr), [BE99b](https://docs.magma-maths.org/references.md#cite-besche-eick-1000), [BE01](https://docs.magma-maths.org/references.md#cite-besche-eick-order-qnp), [BEO01](https://docs.magma-maths.org/references.md#cite-besche-eick-obrien-order-2000), [MNVL04](https://docs.magma-maths.org/references.md#cite-newman-ob-vl-04), [OBr90](https://docs.magma-maths.org/references.md#cite-obrien-pgroup), [OBr91](https://docs.magma-maths.org/references.md#cite-obrien-groups-256), [OVL05](https://docs.magma-maths.org/references.md#cite-ob-vl-05)].

<a id="function-searchpgroups-rngintelt-rngintelt"></a>
#### `SearchPGroups(p, n: parameters): RngIntElt, RngIntElt -> SeqEnum`

```magma
Rank  : SetEnum                      Default: {1,... n}
Class : SetEnum                      Default: {1,... n}
Select: Program                      Default: true
Limit : RngIntElt                    Default: 0
```

Produce a sequence of groups of order $p^n$ satisfying the conditions specified by the following parameters. The restrictions on the order are $n \le 7$ or $p=2$ and $n\le 9$.

All groups returned will have Frattini quotient rank in `Rank`. This parameter may also be set to a single integer.

All groups returned will have $p$-class in `Class`. This parameter may also be set to a single integer.

The parameter must be set to a program returning either `true` or `false` when given a $p$-group satisfying the above conditions. All groups $G$ returned will then satisfy `Select(G) eq true`.

If `Limit` is set to a positive number $n$, then the program may end its search and return when there are at least $n$ groups found.

<a id="function-countpgroups-rngintelt-rngintelt"></a>
#### `CountPGroups(p, n: parameters): RngIntElt, RngIntElt -> SeqEnum`

Count the number of groups of order $p^n$ satisfying the conditions specified by the parameters. The parameters are the same as for `SearchPGroups`, except that the `Limit` parameter is ignored.

<a id="example-ex-1addd3"></a>
#### `Example: Searching Groups of Order 19^7 (ex-1addd3)`

We search the groups of order $19^7$ for specific examples. There are, in total, 9380741 groups with this order. We start with a search for those of rank 5, class 3, and exponent 19. Since we do not set the `Limit` parameter, we will get a sequence containing all the examples.

```magma
> time Q := SearchPGroups(19, 7:Rank := 5, Class := 3,
>    Select := func<G|IsPrime(Exponent(G))> );
Time: 0.050
> #Q;
4
> Q[1];
GrpPC of order 893871739 = 19^7
PC-Relations:
  $.2^$.1 = $.2 * $.6,
  $.6^$.1 = $.6 * $.7
```

This time we limit the number returned.

```magma
> time    Q := SearchPGroups(19, 7:Rank := 4, Class := {3,4},
>    Select := func<G|IsPrime(Exponent(G))>, Limit := 5);
Time: 13.090
> #Q;
5
> [pClass(G):G in Q];
[ 3, 3, 3, 3, 3 ]
> time    Q4 := SearchPGroups(19, 7:Rank := 4, Class := 4,
>   Select := func<G|IsPrime(Exponent(G))>, Limit := 5);
Time: 0.150
> #Q4;
6
```

Note that the limit is not always adhered to exactly. We can also count the number of groups with our property.

```magma
> time CountPGroups(19, 7:Rank := 4, Class := {3,4},
>   Select := func<G|IsPrime(Exponent(G))>);
Time: 334.720
43
> time CountPGroups(19, 7:Rank := 4, Class := 4,
>    Select := func<G|IsPrime(Exponent(G))>);
10
Time: 0.310
```

### Metacyclic $p$-groups

Magma contains functions for constructing all metacyclic groups of order $p^n$. It can also decide if a given $p$-group is metacyclic, construct invariants which distinguish this metacyclic group from all others of this order, and construct a standard presentation for the group.

This section describes the functions for accessing these algorithms. The functions were developed by Mike Newman, Eamonn O’Brien, and Michael Vaughan-Lee.

<a id="function-metacyclicpgroups-rngintelt-rngintelt"></a>
#### `MetacyclicPGroups(p, n: parameters): RngIntElt, RngIntElt -> SeqEnum`

```magma
PCGroups: BoolElt                    Default: true
```

Return a list of the metacyclic groups of order $p^m$, where $p$ is a prime and $n$ is a positive integer.

If `true`, the groups returned are in category GrpPC, otherwise they are in category GrpFP – this will be faster if the groups have large class.

<a id="function-ismetacyclicpgroup-grp"></a>
#### `IsMetacyclicPGroup(P): Grp -> BoolElt`

The group $P$ is a $p$-group, either pc- or matrix or permutation group; if $P$ is metacyclic, then return `true`, else `false`.

<a id="function-invariantsmetacyclicpgroup-grp"></a>
#### `InvariantsMetacyclicPGroup(P): Grp -> Tup`

The group $P$ is a metacyclic $p$-group, either pc- or matrix or permutation group; return tuple of invariants which uniquely identify metacyclic $p$-group $P$. This tuple which contains at least four terms, $\langle r, s, t, n \rangle$ has the following meaning: $P$ has order $p^{n + s}$; its derived quotient is $C_{p^r} \times C_{p^s}$; its derived group is cyclic of order $p^{n - r}$; it has exponent $p^{n +s - t}$.

If $p = 2$, then additional invariants are needed to distinguish among the groups. We record the abelian invariants of the centre of $P$. If $s = 1$ and the centre of $P$ has order $2$, then the 2-group is maximal class and we record whether it is dihedral, quaternion, or semidihedral. If $s > 1$ then the group has two cyclic central normal subgroups of order $2^{s - 1}$ whose central quotients are both semidihedral, or dihedral and quaternion. The invariant tuple has length at most 6.

<a id="function-standardmetacyclicpgroup-grp"></a>
#### `StandardMetacyclicPGroup(P): Grp -> GrpPC`

The group $P$ is a metacyclic $p$-group, either pc- or matrix or permutation group; return metacyclic $p$-group having a canonical pc-presentation which is isomorphic to $P$. If two metacyclic $p$-groups have the same canonical presentation, then they are isomorphic.

<a id="function-numberofmetacyclicpgroups-rngintelt-rngintelt"></a>
#### `NumberOfMetacyclicPGroups(p, n): RngIntElt, RngIntElt -> SeqEnum`

Return number of metacyclic groups of order $p^n$.

<a id="function-hasallpquotientsmetacyclic-grpfp"></a>
#### `HasAllPQuotientsMetacyclic(G): GrpFP -> BoolElt, SeqEnum`

<a id="function-hasallpquotientsmetacyclic-grpfp-2"></a>
#### `HasAllPQuotientsMetacyclic(G, p): GrpFP -> BoolElt`

Return `true` if for all primes $p$ all $p$-quotients of the finitely-presented group $G$ are metacyclic; otherwise return `false` and a description of the set of primes for which $G$ has non-metacyclic $p$-quotient.

If a prime $p$ is supplied as a second argument, then the function returns `true` if all $p$-quotients of $G$ are metacyclic; otherwise it returns `false`.

<a id="example-ex-0140ea"></a>
#### `Example: Metacyclic 3-Groups of Order 729 (ex-0140ea)`

```magma
> X := MetacyclicPGroups (3, 6);
> #X;
11
> X[4];
GrpPC of order 729 = 3^6
PC-Relations:
    $.1^3 = $.3,
    $.2^3 = $.4,
    $.3^3 = $.6,
    $.4^3 = $.5,
    $.5^3 = $.6,
    $.2^$.1 = $.2 * $.6^2
> H := SmallGroup (729, 59);
> IsMetacyclicPGroup (H);
true
> I := InvariantsMetacyclicPGroup(H);
> I;
<2, 2, 2, 4, [], , >
> S := StandardMetacyclicPGroup (H);
GrpPC : S of order 729 = 3^6
PC-Relations:
    S.1^3 = S.3,
    S.2^3 = S.4,
    S.3^3 = S.6,
    S.4^3 = S.5,
    S.5^3 = S.6,
    S.2^S.1 = S.2 * S.6^2
> /* find this group in list */
> [IsIdenticalPresentation (S, X[i]): i in [1..#X]];
[ false, false, false, true, false, false, false, false, false, false, false ]
> /* so this group is #4 in list */
> NumberOfMetacyclicPGroups (19, 7);
14
> Q := FreeGroup (4);
> G := quo < Q |  Q.2^2, Q.4^3, Q.2 * Q.3 * Q.2 * Q.3^-1, Q.1^9>;
> /* are all p-quotients of G metacyclic? */
> HasAllPQuotientsMetacyclic (G);
false [ 3 ]
> /* the 3-quotient is not metacyclic */
```

### Database of Perfect Groups

Magma includes a database of finite perfect groups. This database includes all perfect groups up to order 50000, and many classes of perfect groups up to order one million. Each group is defined by means of a finite presentation. Further information is also provided which allows the construction of permutation representations.

<a id="entry-keys"></a>
<a id="grpdata-sed"></a>
#### Specifying an Entry of the Database

There are three ways to key a particular entry of the database. Firstly, a single integer $i$ simply denotes the $i$-th entry of the database. There is no particular ordering in the correspondence.

Secondly, the database stores information to quickly locate perfect groups of a particular order; thus the pair $o, i$ represents the $i$-th entry of order $o$.

The third method corresponds to the notation used in Chapter 5.3 of [[HP89](https://docs.magma-maths.org/references.md#cite-holt-plesken)]. In this book, the expression $Q\#p$ denotes the class of groups that are isomorphic to perfect extensions of p-groups by $Q$, where $p$ is a prime and $Q$ is a fixed finite perfect group in which the largest normal p-subgroup is assumed to be trivial. Within a class $Q\#p$, an isomorphism type of groups is denoted by an ordered pair of integers $\langle r, n\rangle$, where $r\geq 0$ and $n\geq 0$.

To specify a particular group $Q$ without extension, a (somewhat descriptive) string is given. The set of possible values can be accessed using the function `TopQuotients`. Among these strings, full or partial covering groups of $G$ are named `GCn` where $n$ is the index of $G$ in `GCn`. Also, there are five classes of 3-extensions of groups which are also defined in the database. The names of these base groups are `A5#2<r, n>` where $(r, n)$ are $(4, 2), (5, 5), (5, 6), (5, 7)$ or $(6, 7)$. Furthermore, there are some extensions of direct products: these have names of the form `GxH`. The remainder are names of simple groups. The convention with these names is that if they are elements of a family of simple groups with two parameters then the name will be `fam(p_1, p_2)`, while one parameter families will just be the concatenation of the family name and the parameter.

To illustrate the naming conventions, here are some examples: `A5`, `A5C2`, `A5#2<5, 5>`, `L(2, 59)C2`, `A5xL(2, 11)`. Notice that there is never a space before the `C` denoting a covering group or on either side of the `x` denoting direct product. However, there is always a space after a comma.

To specify a particular group $Q{\#}p\langle r, n\rangle$ the four values $Q$, $p$, $r$, and $n$ should be given. However, it should be noted that in three cases (`A5#2<5, 1>`, `L(3, 2)#2<3, 1>`, `L(3, 2)#2<3, 2>`), there are *two* versions of `Q#p<r, n>` stored in the database. Strictly speaking, then, there is a fifth key value $v$ required in this third method. However, it can be specified by an optional parameter `Variant := v` (if necessary), and can normally be ignored. The variant forms are isomorphic to the original forms, and are included for compatibility with Holt & Plesken’s tables.

#### Creating the Database

<a id="function-perfectgroupdatabase"></a>
##### `PerfectGroupDatabase() -> DB`

This function returns a database object which contains information about the database. It is required as first argument to the other access functions.

#### Accessing the Database

<a id="function-group-db-rngintelt"></a>
##### `Group(D, i): DB, RngIntElt -> GrpFP, SeqEnum`

<a id="function-group-db-rngintelt-rngintelt-2"></a>
##### `Group(D, o, i): DB, RngIntElt, RngIntElt -> GrpFP, SeqEnum`

<a id="function-group-db-monstgelt"></a>
##### `Group(D, Q): DB, MonStgElt -> GrpFP, SeqEnum`

<a id="function-group-db-monstgelt-rngintelt-rngintelt-rngintelt-rngintelt"></a>
##### `Group(D, Q, p, r, n: parameters): DB, MonStgElt, RngIntElt, RngIntElt, RngIntElt, RngIntElt -> GrpFP, SeqEnum`

```magma
Variant: RngIntElt                    Default: 1
```

Returns the specified entry from the database $D$ as a finitely presented group. In addition, it returns a sequence of pairs $\langle [i_1, \dots, i_n], [H_1, \dots, H_n]\rangle$, each of which affords an isomorphism onto a permutation group of degree $\sum_{j=1}^n i_j$. The subgroup $H_j$ has index $i_j$ in the defined group, and the sum of the permutation representations of the group on the cosets of the $H_j$’s is faithful. For the meanings of the arguments, see Subsection [Specifying an Entry of the Database](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/pfgps.md#grpdata-sed) above.

<a id="function-identificationnumber-db-rngintelt"></a>
##### `IdentificationNumber(D, i): DB, RngIntElt -> RngIntElt`

<a id="function-identificationnumber-db-rngintelt-rngintelt"></a>
##### `IdentificationNumber(D, o, i): DB, RngIntElt, RngIntElt -> RngIntElt`

<a id="function-identificationnumber-db-monstgelt"></a>
##### `IdentificationNumber(D, Q): DB, MonStgElt -> RngIntElt`

<a id="function-identificationnumber-db-monstgelt-rngintelt-rngintelt-rngintelt-rngintelt"></a>
##### `IdentificationNumber(D, Q, p, r, n: parameters): DB, MonStgElt, RngIntElt, RngIntElt, RngIntElt, RngIntElt -> RngIntElt`

```magma
Variant: RngIntElt                    Default: 1
```

Returns a number which can be used to access the specified entry from the database $D$ using method one. (See Subsection [Specifying an Entry of the Database](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/pfgps.md#grpdata-sed) above).

<a id="function-numberofrepresentations-db-rngintelt"></a>
##### `NumberOfRepresentations(D, i): DB, RngIntElt -> RngIntElt`

<a id="function-numberofrepresentations-db-rngintelt-rngintelt"></a>
##### `NumberOfRepresentations(D, o, i): DB, RngIntElt, RngIntElt -> RngIntElt`

<a id="function-numberofrepresentations-db-monstgelt"></a>
##### `NumberOfRepresentations(D, Q): DB, MonStgElt -> RngIntElt`

<a id="function-numberofrepresentations-db-monstgelt-rngintelt-rngintelt-rngintelt-rngintelt"></a>
##### `NumberOfRepresentations(D, Q, p, r, n: parameters): DB, MonStgElt, RngIntElt, RngIntElt, RngIntElt, RngIntElt -> RngIntElt`

```magma
Variant: RngIntElt                    Default: 1
```

Returns the number of ways stored in the database for building a permutation group representation of the specified entry. (See Subsection [Specifying an Entry of the Database](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/pfgps.md#grpdata-sed) above).

<a id="function-permutationrepresentation-db-rngintelt"></a>
##### `PermutationRepresentation(D, i: parameters): DB, RngIntElt -> Hom(Grp), GrpFP, GrpPerm`

<a id="function-permutationrepresentation-db-rngintelt-rngintelt"></a>
##### `PermutationRepresentation(D, o, i: parameters): DB, RngIntElt, RngIntElt -> Hom(Grp), GrpFP, GrpPerm`

<a id="function-permutationrepresentation-db-monstgelt"></a>
##### `PermutationRepresentation(D, Q: parameters): DB, MonStgElt -> Hom(Grp), GrpFP, GrpPerm`

<a id="function-permutationrepresentation-db-monstgelt-rngintelt-rngintelt-rngintelt-rngintelt"></a>
##### `PermutationRepresentation(D, Q, p, r, n: parameters): DB, MonStgElt, RngIntElt, RngIntElt, RngIntElt, RngIntElt -> Hom(Grp), GrpFP, GrpPerm`

```magma
Variant       : RngIntElt                    Default: 1
Representation: RngIntElt                    Default: 1
```

Returns the isomorphism from the finitely presented group $G$ specified to a permutation group representation $H$ as well as the groups $G$ and $H$. (See Subsection [Specifying an Entry of the Database](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/pfgps.md#grpdata-sed) above).

Selects which of the stored methods of constructing the permutation representation should be used.

<a id="function-permutationgroup-db-rngintelt"></a>
##### `PermutationGroup(D, i: parameters): DB, RngIntElt -> GrpPerm`

<a id="function-permutationgroup-db-rngintelt-rngintelt"></a>
##### `PermutationGroup(D, o, i: parameters): DB, RngIntElt, RngIntElt -> GrpPerm`

<a id="function-permutationgroup-db-monstgelt"></a>
##### `PermutationGroup(D, Q: parameters): DB, MonStgElt -> GrpPerm`

<a id="function-permutationgroup-db-monstgelt-rngintelt-rngintelt-rngintelt-rngintelt"></a>
##### `PermutationGroup(D, Q, p, r, n: parameters): DB, MonStgElt, RngIntElt, RngIntElt, RngIntElt, RngIntElt -> GrpPerm`

```magma
Variant       : RngIntElt                    Default: 1
Representation: RngIntElt                    Default: 1
```

Returns the specified entry from the database $D$ as a permutation group. (See Subsection [Specifying an Entry of the Database](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/pfgps.md#grpdata-sed) above).

Selects which of the stored methods of constructing the permutation representation should be used.

#### Finding Legal Keys

<a id="operation-operation-db-rngintelt"></a>
##### `# D: DB -> RngIntElt`

<a id="function-numberofgroups-db"></a>
##### `NumberOfGroups(D): DB -> RngIntElt`

Returns the number of entries stored in the database. (See Subsection [Specifying an Entry of the Database](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/pfgps.md#grpdata-sed), method 1, above).

<a id="function-numberofgroups-db-rngintelt"></a>
##### `NumberOfGroups(D, o): DB, RngIntElt -> RngIntElt`

Returns the number of entries stored in the database of order $o$. (See Subsection [Specifying an Entry of the Database](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/pfgps.md#grpdata-sed), method 2, above).

<a id="function-topquotients-db"></a>
##### `TopQuotients(D): DB -> SetIndx`

Returns the set of strings denoting the fixed perfect groups $Q$. (See Subsection [Specifying an Entry of the Database](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/pfgps.md#grpdata-sed), method 3, above).

<a id="function-extensionprimes-db-monstgelt"></a>
##### `ExtensionPrimes(D, Q): DB, MonStgElt -> SetEnum`

Returns the set of primes $p$ for which a non-trivial $p$-extension of the group denoted by $Q$ lies in the database. (See Subsection [Specifying an Entry of the Database](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/pfgps.md#grpdata-sed), method 3, above).

<a id="function-extensionexponents-db-monstgelt-rngintelt"></a>
##### `ExtensionExponents(D, Q, p): DB, MonStgElt, RngIntElt -> SetEnum`

Returns the set of exponents $r$ such that a non-trivial extension of the group denoted by $Q$ by $p^r$ lies in the database. (See Subsection [Specifying an Entry of the Database](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/pfgps.md#grpdata-sed), method 3, above).

<a id="function-extensionnumbers-db-monstgelt-rngintelt-rngintelt"></a>
##### `ExtensionNumbers(D, Q, p, r): DB, MonStgElt, RngIntElt, RngIntElt -> SetEnum`

Returns the set of numbers $n$ such that there is a group $Q\#p\langle r, n\rangle$ in the database. (See Subsection [Specifying an Entry of the Database](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/pfgps.md#grpdata-sed), method 3, above).

<a id="function-extensionclasses-db-monstgelt"></a>
##### `ExtensionClasses(D, Q): DB, MonStgElt -> SetEnum`

Returns the set of triples $\langle p, r, n\rangle$ such that there is a group $Q\#p\langle r, n\rangle$ in the database. (See Subsection [Specifying an Entry of the Database](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/pfgps.md#grpdata-sed), method 3, above).

<a id="example-ex-aa434a"></a>
##### `Example: Finding an Extension of L(3, 4) (ex-aa434a)`

We hunt through the various levels of key-finding functions available to find an extension of L(3,4) in the database.

```magma
> DB := PerfectGroupDatabase();
> "L(3, 4)" in TopQuotients(DB);
true
> ExtensionPrimes(DB, "L(3, 4)");
{ 2 }
> ExtensionExponents(DB, "L(3, 4)", 2);
{ 1, 2, 3, 4 }
> ExtensionNumbers(DB, "L(3, 4)", 2, 2);
{ 1, 2, 3 }
```

The database contains extensions of L(3,4) by groups of order $2^1$, $2^2$, $2^3$, and $2^4$. We will look at one of the 3 extensions by a group of order 4.

```magma
> G := Group(DB, "L(3, 4)", 2, 2, 3);
> G;
Finitely presented group G on 3 generators
Relations
  a^2 = Id(G)
  b^4 * e^-2 = Id(G)
  a * b * a * b * a * b * a * b * a * b * a * b * a * b * e
  = Id(G)
  a * b^2 * a * b^2 * a * b^2 * a * b^2 * a * b^2 * e^-1 =
  Id(G)
  a^-1 * b^-1 * a * b * a^-1 * b^-1 * a * b * a^-1 * b^-1 *
  a * b * a^-1 * b^-1 * a * b * a^-1 * b^-1 * a * b * e^-2 =
  Id(G)
  a * b * a * b * a * b^3 * a * b * a * b * a * b^3 * a * b
  * a * b * a * b^3 * a * b * a * b * a * b^3 * a * b * a *
  b * a * b^3 * e^-2 = Id(G)
  (a * b * a * b * a * b^2 * a * b^-1)^5 = Id(G)
  (a, e^-1) = Id(G)
  (b, e^-1) = Id(G)
> P := PermutationGroup(DB, "L(3, 4)", 2, 2, 3);
> P;
Permutation group P acting on a set of cardinality 224
Order = 80640 = 2^8 * 3^2 * 5 * 7
> ChiefFactors(P);
    G
    |  A(2, 4)                = L(3, 4)
    *
    |  Cyclic(2)
    *
    |  Cyclic(2)
    1
> #Radical(P);
4
> IsCyclic(Radical(P));
true
> IsCentral(P, Radical(P));
true
```

### Database of Almost-Simple Groups

Magma includes a database containing information about almost simple groups $G$, where $S \leq G \leq \Aut(S)$ and $S$ is a simple group of small order. The $G$ that are included in the database are those associated with $S$ such that $|S|$ is less than 16000000, as well as $M_{24}$, $HS$, $J_3$, $McL$, $Sz(32)$, and $L_6(2)$.

The information stored here is primarily for use in computing maximal subgroups and automorphism groups. The database was originally conceived by Derek Holt, with a major extension by Volker Gebhardt and sporadic additions by Bill Unger. The implementation is by Bruce Cox.

It is possible to request the $i$-th entry of the database. Alternatively, and more usefully, one can supply three integers: the order $o1$ of $S$, the order $o2$ of $G$, and the sum $k$ of the orders of the class representatives of $G$. The last of these can be expensive to compute; however, knowledge of the classes is helpful to benefit from the information stored in the entry. Of course, if the entry is beyond the range of the database, then it is a wasted computation—the intrinsics `ExistsGroupData` and `NumberOfGroups` are provided to determine from the orders whether this is the case.

#### The Record Fields

The result returned by the `GroupData` function is a record with a number of fields containing information about the almost simple group and its socle. This information includes information used to compute automorphisms and maximal subgroups of the almost simple group by these Magma functions. The following describes these fields. The groups $G$ and $S$ are as above the almost simple group $G$ and its socle, the simple group $S$. Let $A$ be the full automorphism group of $S$, and let $F\langle x,y\rangle$ be a free group on two generators, called $x$ and $y$.

First comes information about $S$. Each $S$ is two generated, by $x$ and $y$ as above, say.

Field `resname`: A string giving a name to the simple group $S$. ($S$ is the soluble residual of $G$).

Field `resorder`: The order of $S$ as an integer.

Field `geninfo`: Information on where to find $x$ and $y$ in $S$. This is a sequence of two tuples, each with 3 entries. The first gives a generator order, the second the length of its conjugacy class, and the third the probability of picking the right generator given the previous information. The first tuple’s order/length information always uniquely defines one conjugacy class of the group $S$ and has probability 1, so $x$ is easy to find.

Field `rels`: A sequence of words in $F$ which, taken together with the generator orders from `geninfo`, form a presentation for $S$ on $x$ and $y$.

Field `permrep`: A permutation representation of the full automorphism group of $S$. The first two generators are $x$ and $y$, followed by outer generators. In what follows the outer generators are called $t$, $u$, $v$.

Field `outimages` A sequence of sequences of words in $F$. These give the images of $x$ and $y$ under the generators of the outer automorphism group of $S$.

Field `order`: An integer, the order of $G$.

Field `inv`: The invariant used to separate non-isomorphic $\langle |S|,|G|\rangle$ possibilities. An integer, it is the sum over the classes of $G$ of the order of the elements in each class.

Field `name`: A name for $G$ as a string.

Field `conjelts`: If $G$ is not normal in the automorphism group, these words are coset representatives of the normaliser of $G$ in $A$ as words in $t$, $u$, $v$.

Field `subgens`: Words in $t$, $u$, $v$ that, together with $x$ and $y$, generate $G$.

Field `subpres`: A presentation of $G/S$ on `subgens`. Note: If $G=S$ then `subgens` will be the empty sequence, but `subpres` will be the trivial FP-group with one generator.

Field `normgens`: Words in $t$, $u$, $v$ that generate the outer automorphism group of $G$.

Field `normpres`: A presentation of the outer automorphism group of $G$ on `normgens`. Again, if $A=G$ then `normgens` will be the empty sequence, but `normpres` will be the trivial FP-group with one generator.

Field `maxsubints`: A sequence of records describing the intersections of the maximal subgroups of $G$ that do not contain $S$ with $S$. Each record gives the order of the intersection, its class length in $S$, generators as words in $x$ and $y$, and a presentation on these generators.

#### Creating the Database

<a id="function-almostsimplegroupdatabase"></a>
##### `AlmostSimpleGroupDatabase() -> DB`

This function returns a database object which contains information about the database.

#### Accessing the Database

<a id="operation-operation-db-rngintelt"></a>
##### `# D: DB -> RngIntElt`

Returns the number of entries stored in the database.

<a id="function-groupdata-db-rngintelt"></a>
##### `GroupData(D, i): DB, RngIntElt -> Rec`

<a id="function-groupdata-db-rngintelt-rngintelt-rngintelt"></a>
##### `GroupData(D, o1, o2, k): DB, RngIntElt, RngIntElt, RngIntElt -> Rec`

Returns the specified entry from the database $D$ as a record. The first form gives the $i$th entry of the database. The second form gives information on an almost simple group of order $o2$, with socle of order $o1$. The value of $k$ should be as explained in `inv` above.

<a id="function-existsgroupdata-db-rngintelt-rngintelt"></a>
##### `ExistsGroupData(D, o1, o2): DB, RngIntElt, RngIntElt -> BoolElt`

<a id="function-existsgroupdata-db-rngintelt-rngintelt-rngintelt"></a>
##### `ExistsGroupData(D, o1, o2, i): DB, RngIntElt, RngIntElt, RngIntElt -> BoolElt, Rec`

Returns whether any record exists for a simple group of order $o1$ and a supergroup $G$ of order $o2$ lying within its automorphism group. In the second form an invariant, $i$ as described above, is also supplied, and the result is true if there is a record in the database with the given orders and invariant, and false otherwise. When the result is true, the corresponding record is also returned.

<a id="function-numberofgroups-db-rngintelt-rngintelt"></a>
##### `NumberOfGroups(D, o1, o2): DB, RngIntElt, RngIntElt -> RngIntElt, RngIntElt`

Returns the number of records in the database $D$ corresponding to a simple group of order $o1$ and a supergroup $G$ of order $o2$ lying within its automorphism group. The second return value gives the index of the first such record, if there is one. (This is most useful when the first return value is 1.) If the return values are $d$ and $f$, with $d>0$, then the corresponding database entries are numbered $f, f+1, \dots, f+d-1$.

<a id="function-identifyalmostsimplegroup-grpperm"></a>
##### `IdentifyAlmostSimpleGroup(G): GrpPerm -> Map, GrpPerm`

<a id="function-identifyalmostsimplegroup-grpmat"></a>
##### `IdentifyAlmostSimpleGroup(G): GrpMat -> Map, GrpPerm`

Use the information in the database to construct a monomorphism $f$ from the almost simple group $G$ into $A$, the permutation representation of the full automorphism group of its socle stored in the database. This function will also cope with groups isomorphic to the alternating and symmetric groups of degree up to 50, which are not actually in the database. Note that the conjugacy class of the image of $f$ in $A$ determines $G$ up to isomorphism. The algorithms used to deal with the alternating and symmetric groups not in the database are by Derek Holt, starting from the paper of Bratus & Pak [[BP00](https://docs.magma-maths.org/references.md#cite-bratus-pak)].

<a id="example-ex-6b4019"></a>
##### `Example: Querying an Almost Simple Group of Order 720 (ex-6b4019)`

We query the database on about an almost simple group of order 720.

```magma
> G := PermutationGroup<10 |
>  [ 7, 9, 5, 2, 1, 8, 10, 4, 6, 3 ],
>  [ 6, 3, 10, 7, 2, 4, 1, 8, 9, 5 ]>;
> #G;
720
> CompositionFactors(G);
    G
    |  Cyclic(2)
    *
    |  Alternating(6)
    1
> #Radical(G);
1
```

There are 3 such groups, so we really do need $k$ to tell them apart.

```magma
> S := SolubleResidual(G);
> k := &+[c[1]: c in Classes(G)];
> D := AlmostSimpleGroupDatabase();
> R := GroupData(D, #S, #G, k);
> R`name;
M_10
```

The group is identified. Let’s see some of the other information in $R$.

```magma
> P := R`permrep;
> P;
Permutation group P acting on a set of cardinality 10
  (1, 6)(2, 9)(3, 10)(4, 8)
  (1, 7, 9, 4)(2, 8, 5, 10)
  (3, 5, 9, 6, 7, 4, 8, 10)
  (3, 7)(4, 6)(5, 10)
> #P;
1440
> R`subgens;
[ t * u ]
> SS := sub<P|P.1, P.2>;
> #SS;
360
> GG := sub<P|SS, P.3*P.4>;
> #GG;
720
> R`normgens;
[ t ]
```

The full automorphism group of $S$ has order 1440. The group $P$ is a representation of this automorphism group with first two generators generating a faithful image of $S$. The image of $S$, together with the product of `P.3` and `P.4`, generate a faithful image of $G$. The outer automorphism group of $G$ is generated by `P.3` modulo `GG`. We can also get a constructive identification as follows.

```magma
> f, A := IdentifyAlmostSimpleGroup(G);
> f;
Homomorphism of GrpPerm: $, Degree 10, Order 2^4 * 3^2 * 5
into GrpPerm: A, Degree 10 induced by
  (1, 10)(3, 8)(5, 9)(6, 7) |--> (1, 6)(2, 9)(3, 10)(4, 8)
  (1, 7, 2, 8)(3, 10, 4, 5) |--> (1, 7, 9, 4)(2, 8, 5, 10)
  (1, 10, 4, 8)(2, 6, 9, 5) |--> (3, 10, 7, 6)(4, 8, 5, 9)
> A;
Permutation group A acting on a set of cardinality 10
  (1, 6)(2, 9)(3, 10)(4, 8)
  (1, 7, 9, 4)(2, 8, 5, 10)
  (3, 5, 9, 6, 7, 4, 8, 10)
  (3, 7)(4, 6)(5, 10)
```

### Database of Transitive Groups

Magma has a database containing all transitive permutation groups, up to conjugacy in the ambient symmetric group, having degree up to 48, and one containing all primitive permutation groups with degree less than 4096.

The transitive groups up to degree 15 were determined by Greg Butler and John McKay, the groups having degree in the range 16 to 30 were determined by Alexander Hulpke [[Hul05](https://docs.magma-maths.org/references.md#cite-hulpketrans)]. John Cannon and Derek Holt [[CH08](https://docs.magma-maths.org/references.md#cite-trans32)] have determined the transitive groups of degree 32. Derek Holt and Gordon Royle have determined the transitive groups with degrees 33 to 47 [[HR19](https://docs.magma-maths.org/references.md#cite-holtroyle)], and Derek Holt has determined the transitive groups of degree 48.

#### Accessing the Databases

<a id="function-transitivegroupdatabaselimit"></a>
##### `TransitiveGroupDatabaseLimit() -> RngIntElt`

The limiting degree of the database of transitive groups.

<a id="function-numberoftransitivegroups-rngintelt"></a>
##### `NumberOfTransitiveGroups(d): RngIntElt -> RngIntElt`

Given a degree $d$ in the required range, return the number of transitive groups of degree $d$.

<a id="function-transitivegroup-rngintelt-rngintelt"></a>
##### `TransitiveGroup(d, n): RngIntElt, RngIntElt -> GrpPerm, MonStgElt`

Given a degree $d$ in the required range and a positive integer $n$, return the $n$-th transitive group of degree $d$. Also returns a string giving a description of the group.

<a id="function-transitivegroupdescription-rngintelt-rngintelt"></a>
##### `TransitiveGroupDescription(d, n): RngIntElt, RngIntElt -> MonStgElt`

A string giving a description of the $n$-th transitive group of degree $d$.

<a id="function-transitivegroupdescription-grpperm"></a>
##### `TransitiveGroupDescription(G): GrpPerm -> MonStgElt`

A string giving a description of the transitive group $G$.

<a id="function-transitivegroup-rngintelt"></a>
##### `TransitiveGroup(d): RngIntElt -> GrpPerm, MonStgElt`

Given a degree $d$ in the required range, return the first transitive group of degree $d$. Also returns a string giving a description of the group.

<a id="function-transitivegroup-rngintelt-program"></a>
##### `TransitiveGroup(d, f): RngIntElt, Program -> GrpPerm, MonStgElt`

Given a degree $d$ in the required range and a predicate $f$ (as a function or intrinsic), return the first transitive group of degree $d$ which satisfies $f$. Also returns a string giving a description of the group.

<a id="function-transitivegroup-rngintelt-program-2"></a>
##### `TransitiveGroup(S, f): [RngIntElt], Program -> GrpPerm, MonStgElt`

Given a sequence $S$ of degrees and a predicate $f$ (as a function or intrinsic), return the first transitive group with degree in $S$ which satisfies $f$. Also returns a string giving a description of the group.

<a id="function-transitivegroups-rngintelt"></a>
##### `TransitiveGroups(d: parameters): RngIntElt -> [GrpPerm]`

```magma
Warning: BoolElt                    Default: true
```

Return a sequence of all transitive groups of degree $d$ up to conjugacy in the symmetric group $S_d$. Some degrees will produce a very large sequence of groups – in such cases a warning will be printed unless the user specifies `Warning := false`.

<a id="function-transitivegroups-rngintelt-2"></a>
##### `TransitiveGroups(S: parameters): [RngIntElt] -> [GrpPerm]`

```magma
Warning: BoolElt                    Default: true
```

Given a sequence $S$ of degrees, return a sequence of all transitive groups with degree in $S$. The resulting sequence may be very long – in such cases a warning will be printed unless the user specifies `Warning := false`.

<a id="function-transitivegroups-rngintelt-program"></a>
##### `TransitiveGroups(d, f): RngIntElt, Program -> [GrpPerm]`

Given an integer $d$ and a predicate (function or intrinsic) $f$, return a sequence containing all transitive groups $G$ of degree $d$ satisfying `f(G) eq true`.

<a id="function-transitivegroups-rngintelt-program-2"></a>
##### `TransitiveGroups(S, f): [RngIntElt], Program -> [GrpPerm]`

Given a sequence $S$ of degrees and a predicate (function or intrinsic) $f$, return a sequence containing all transitive groups $G$ with degree in $S$ satisfying `f(G) eq true`.

<a id="example-ex-95bf5a"></a>
##### `Example: Transitive Groups of Degree 8 (ex-95bf5a)`

We apply some of these functions to the degree $8$ case.

```magma
> NumberOfTransitiveGroups(8);
50
> TransitiveGroup(8, 3);
Permutation group acting on a set of cardinality 8
    (1, 2)(3, 4)(5, 6)(7, 8)
    (1, 4)(2, 3)(5, 8)(6, 7)
    (1, 8)(2, 7)(3, 6)(4, 5)
E(8) = 2[x]2[x]2
> S := TransitiveGroups(8, IsPrimitive);
> #S;
7
> S;
[
    Permutation group acting on a set of cardinality 8
        (1, 8)(2, 3)(4, 5)(6, 7)
        (1, 3)(2, 8)(4, 6)(5, 7)
        (1, 5)(2, 6)(3, 7)(4, 8)
        (1, 2, 6, 3, 4, 5, 7),
    Permutation group acting on a set of cardinality 8
        (1, 8)(2, 3)(4, 5)(6, 7)
        (1, 3)(2, 8)(4, 6)(5, 7)
        (1, 5)(2, 6)(3, 7)(4, 8)
        (1, 2, 6, 3, 4, 5, 7)
        (1, 2, 3)(4, 6, 5),
    Permutation group acting on a set of cardinality 8
        (1, 2, 3, 4, 5, 6, 8)
        (1, 2, 4)(3, 6, 5)
        (1, 6)(2, 3)(4, 5)(7, 8),
    Permutation group acting on a set of cardinality 8
        (1, 2, 3, 4, 5, 6, 8)
        (1, 3, 2, 6, 4, 5)
        (1, 6)(2, 3)(4, 5)(7, 8),
    Permutation group acting on a set of cardinality 8
        (1, 8)(2, 3)(4, 5)(6, 7)
        (1, 3)(2, 8)(4, 6)(5, 7)
        (1, 5)(2, 6)(3, 7)(4, 8)
        (1, 2, 6, 3, 4, 5, 7)
        (1, 2, 3)(4, 6, 5)
        (1, 2)(5, 6),
    Permutation group acting on a set of cardinality 8
        (1, 2)(3, 4, 5, 6, 7, 8)
        (1, 2, 3),
    Permutation group acting on a set of cardinality 8
        (1, 2, 3, 4, 5, 6, 7, 8)
        (1, 2)
]
```

<a id="example-ex-974219"></a>
##### `Example: Isomorphic Non-Conjugate Transitive Groups (ex-974219)`

An example of isomorphic, non-conjugate transitive groups.

```magma
> G := TransitiveGroup(22, 26);
> H := TransitiveGroup(22, 27);
> b, _ := IsIsomorphic(G, H); b;
true
> S := SymmetricGroup(22);
> IsConjugate(S, G, H);
false
```

#### Processes

A transitive group process enables iteration over all transitive groups of specified degrees satisfying a given predicate, without having to create and store all such groups together. The intrinsic function `TransitiveGroupProcess` may be used to create a transitive group process in Magma. The standard process functions `IsEmpty`, `Current`, `CurrentLabel`, and `Advance` can then be applied to the process.

<a id="function-transitivegroupprocess-rngintelt"></a>
##### `TransitiveGroupProcess(d): RngIntElt -> Process`

Return a group process which will iterate though all transitive groups of degree $d$.

<a id="function-transitivegroupprocess-rngintelt-2"></a>
##### `TransitiveGroupProcess(S): [RngIntElt] -> Process`

Return a process which will iterate though all transitive groups with degree in the sequence $S$.

<a id="function-transitivegroupprocess-rngintelt-program"></a>
##### `TransitiveGroupProcess(d, f): RngIntElt, Program -> Process`

Return a process which will iterate though all transitive groups with degree $d$ which satisfy the predicate $f$.

<a id="function-transitivegroupprocess-rngintelt-program-2"></a>
##### `TransitiveGroupProcess(S, f): [RngIntElt], Program -> Process`

Return a process which will iterate though all transitive groups with degree in the sequence $S$ which satisfy the predicate $f$.

<a id="function-isempty-process-2"></a>
##### `IsEmpty(p): Process -> BoolElt`

Returns `true` if the process $p$ has passed its last group.

<a id="function-current-process-2"></a>
##### `Current(p): Process -> GrpPerm, MonStgElt`

Return the current group of the process $p$, as well as a description of the group.

<a id="function-currentlabel-process-2"></a>
##### `CurrentLabel(p): Process -> RngIntElt, RngIntElt`

Return the label of the current group of the process $p$. That is, return $d$ and $n$ such that the current group is `TransitiveGroup(d, n)`.

<a id="procedure-advance-process-ref-2"></a>
##### `Advance(~p): Process`

Move the process $p$ to its next group.

<a id="example-ex-851721"></a>
##### `Example: Processing Transitive Groups of Degree 5 (ex-851721)`

The use of processes is illustrated by the following code, in which the orders of all transitive groups of degree $5$ are listed.

```magma
> p := TransitiveGroupProcess(5);
> while not IsEmpty(p) do
>     CurrentLabel(p), #Current(p);
>     Advance(~p);
> end while;
5 1 5
5 2 10
5 3 20
5 4 60
5 5 120
```

#### Transitive Group Identification

Given a transitive group $G$ whose degree is at most 30, it is possible to obtain the number of the group in the transitive groups database which is isomorphic to $G$.

<a id="function-transitivegroupidentification-grpperm"></a>
##### `TransitiveGroupIdentification(G): GrpPerm -> RngIntElt, RngIntElt`

```magma
Raw: BoolElt                    Default: true
```

The number (and degree) of the group in the transitive groups database which is isomorphic to the transitive group $G$.

If the optional parameter `Raw` is set to $\texttt{false}$, a third value is returned. In this case, the third value is a permutation conjugating the given group to the copy in the library.

<a id="example-ex-026a1e"></a>
##### `Example: Identifying a Transitive Group (ex-026a1e)`

We get a transitive permutation group from the small groups database and identify it as a transitive group.

```magma
> G := SmallGroup(336, IsTransitive: Search:="Insoluble");
> G;
Permutation group G acting on a set of cardinality 16
  (1, 14, 6, 2, 12, 8, 13, 7)(3, 15, 10, 5, 16, 9, 4, 11)
  (2, 5, 6)(3, 10, 9)(4, 15, 16)(7, 11, 13)
> TransitiveGroupIdentification(G : Raw := false);
715 16 (1, 16, 3, 4, 2, 11, 5, 6, 9, 8, 13, 10)(7, 12, 15)
> n, d, p := $1;
> G^p eq TransitiveGroup(d, n);
true
```

We found it to be group 715 of degree 16.

### Database of Primitive Groups

Magma has a database containing all primitive permutation groups with degree less than 8192.

The list of primitive groups up to degree 50 was prepared by C. C. Sims (see [[Sim70](https://docs.magma-maths.org/references.md#cite-sims-methods)] for the early part of the list). The list up to degree 999 was determined by Roney-Dougal and Unger. See [[RDU03](https://docs.magma-maths.org/references.md#cite-prim1000)] for details of the methods used. The list was extended to degree 2499 by Roney-Dougal, as described in [[RD05](https://docs.magma-maths.org/references.md#cite-prim2500)], and was further extended to degree 4095 by Coutts, Quick, and Roney-Dougal [[CQRD11](https://docs.magma-maths.org/references.md#cite-prim4096)]. The groups of degrees 4096 to 8191 were provided by Ben Stratford.

Within the database the groups are stored by degree. Within each degree they are stored by O’Nan–Scott class in the order soluble affine, insoluble affine, diagonal action, product action, almost simple. Within each class groups are ordered by increasing size. (It follows that the alternating and symmetric groups come last at each degree.)

The basic access function takes two parameters, degree and number, and returns the corresponding primitive group. Functions with name prefixed by `NumberOfPrimitive` tell how many groups of each class there are stored. We recommend the use of the `PrimitiveGroupProcess` or `PrimitiveGroups` functions, with appropriate `Filter` value, to access all primitive groups in a specific class.

#### Accessing the Databases

<a id="function-primitivegroupdatabaselimit"></a>
##### `PrimitiveGroupDatabaseLimit() -> RngIntElt`

The limiting degree of the database of primitive groups.

<a id="function-numberofprimitivegroups-rngintelt"></a>
##### `NumberOfPrimitiveGroups(d): RngIntElt -> RngIntElt`

<a id="function-numberofprimitivesolublegroups-rngintelt"></a>
##### `NumberOfPrimitiveSolubleGroups(d): RngIntElt -> RngIntElt`

<a id="function-numberofprimitiveaffinegroups-rngintelt"></a>
##### `NumberOfPrimitiveAffineGroups(d): RngIntElt -> RngIntElt`

<a id="function-numberofprimitivediagonalgroups-rngintelt"></a>
##### `NumberOfPrimitiveDiagonalGroups(d): RngIntElt -> RngIntElt`

<a id="function-numberofprimitiveproductgroups-rngintelt"></a>
##### `NumberOfPrimitiveProductGroups(d): RngIntElt -> RngIntElt`

<a id="function-numberofprimitivealmostsimplegroups-rngintelt"></a>
##### `NumberOfPrimitiveAlmostSimpleGroups(d): RngIntElt -> RngIntElt`

Given a degree $d$ in the required range, `NumberOfPrimitiveGroups` returns the number of primitive groups of degree $d$. The other functions return the number of groups of each class at that degree.

<a id="function-primitivegroup-rngintelt-rngintelt"></a>
##### `PrimitiveGroup(d, n): RngIntElt, RngIntElt -> GrpPerm, MonStgElt, MonStgElt`

Given a degree $d$ in the required range and a positive integer $n$, return the $n$-th primitive group of degree $d$. Also returns a string (possibly empty) giving a description of the group and a string giving the group’s O’Nan–Scott type.

<a id="function-primitivegroupdescription-rngintelt-rngintelt"></a>
##### `PrimitiveGroupDescription(d, n): RngIntElt, RngIntElt -> MonStgElt`

A string giving a description of the $n$-th primitive group of degree $d$.

<a id="function-primitivegroup-rngintelt"></a>
##### `PrimitiveGroup(d): RngIntElt -> GrpPerm, MonStgElt, MonStgElt`

Given a degree $d$ in the required range, return the first primitive group of degree $d$. Also returns a string giving a description of the group and a string giving the group’s O’Nan–Scott type.

<a id="function-primitivegroup-rngintelt-program"></a>
##### `PrimitiveGroup(d, f): RngIntElt, Program -> GrpPerm, MonStgElt`

Given a degree $d$ in the required range and a predicate $f$ (as a function or intrinsic), return the first transitive (primitive) group of degree $d$ which satisfies $f$.

<a id="function-primitivegroup-rngintelt-program-2"></a>
##### `PrimitiveGroup(S, f): [RngIntElt], Program -> GrpPerm, MonStgElt`

Given a sequence $S$ of degrees and a predicate $f$ (as a function or intrinsic), return the first transitive (primitive) group with degree in $S$ which satisfies $f$.

<a id="function-primitivegroups-rngintelt"></a>
##### `PrimitiveGroups(d: parameters): RngIntElt -> [GrpPerm]`

```magma
Filter: MonStgElt                    Default: "All"
```

Return a sequence of all primitive groups of degree $d$, modified by the value assigned to `Filter`. The possible values for the parameter are the strings `All`, `Soluble`, `Affine`, `Diagonal`, `Product`, `AlmostSimple`, `Simple`, and `SimpleNA`. Generally these values restrict the list to groups in the appropriate O’Nan–Scott type, with the exceptions being `All` giving no restriction, `Simple` restricting to a lsit of all simple groups in the database, and `SimpleNA` being as for `Simple` but omitting all alternating groups in their natural representations.

<a id="function-primitivegroups-rngintelt-2"></a>
##### `PrimitiveGroups(S: parameters): [RngIntElt] -> [GrpPerm]`

<a id="function-primitivegroups"></a>
##### `PrimitiveGroups(: parameters) -> [GrpPerm]`

```magma
Filter: MonStgElt                    Default: "All"
```

Given a sequence $S$ of degrees, return a sequence of all primitive groups with degree in $S$. The result is modified by `Filter` with values as above. Omitting the sequence of degrees gives the same result as specifying all legal degrees.

<a id="function-primitivegroups-rngintelt-program"></a>
##### `PrimitiveGroups(d, f: parameters): RngIntElt, Program -> [GrpPerm]`

<a id="function-primitivegroups-rngintelt-program-2"></a>
##### `PrimitiveGroups(S, f): [RngIntElt], Program -> [GrpPerm]`

<a id="function-primitivegroups-program"></a>
##### `PrimitiveGroups(f): Program -> [GrpPerm]`

```magma
Filter: MonStgElt                    Default: "All"
```

Given an integer $d$ and a predicate (function or intrinsic) $f$, return a sequence containing all primitive groups $G$ of degree $d$ passing the filter satisfying `f(G) eq true`. Note that the filter will be generally much quicker in rejecting candidates than the predicate will be, and only groups passing the filter have `f(G)` evaluated.

Instead of giving a single degree, a sequence of degrees may be given. Omitting the degree is the same as specifying the sequence of all legal degrees.

<a id="example-ex-d6ff61"></a>
##### `Example: Primitive Groups of Degree 625 (ex-d6ff61)`

We apply some of these functions to the degree $625$ case.

```magma
> NumberOfPrimitiveGroups(625);
698
> NumberOfPrimitiveAffineGroups(625);
647
> NumberOfPrimitiveSolubleGroups(625);
509
> NumberOfPrimitiveDiagonalGroups(625);
0
> NumberOfPrimitiveProductGroups(625);
49
> NumberOfPrimitiveAlmostSimpleGroups(625);
2
> PrimitiveGroup(625, 511);
Permutation group acting on a set of cardinality 625
Order = 150000 = 2^4 * 3 * 5^5
5^4:SL(2, 5).2 Affine
> PrimitiveGroup(625,690);
Permutation group acting on a set of cardinality 625
Order = 2^14 * 3^5 * 5^4
Alt(5)^4:Q_8:Sym(4) ProductAction
> Q := PrimitiveGroups(625, func<G|#G eq 3*10^4>
>    : Filter := "Affine");
> #Q;
26
```

#### Processes

A primitive group process enables iteration over all primitive groups of specified degrees satisfying a given predicate, without having to create and store a list of all such groups. The intrinsic function `PrimitiveGroupProcess` may be used to create a primitive group process. The standard process functions `IsEmpty`, `Current`, `CurrentLabel`, and `Advance` can then be applied to the process.

<a id="function-primitivegroupprocess-rngintelt"></a>
##### `PrimitiveGroupProcess(d: parameters): RngIntElt -> Process`

<a id="function-primitivegroupprocess-rngintelt-2"></a>
##### `PrimitiveGroupProcess(S: parameters): [RngIntElt] -> Process`

<a id="function-primitivegroupprocess"></a>
##### `PrimitiveGroupProcess(: parameters) -> Process`

```magma
Filter: MonStgElt                    Default: "All"
```

Return a group process which will iterate though all primitive groups of degree $d$ that pass the filter as described above. A sequence of degrees may be given instead of a single degree. In this case the process will iterate though the groups of all the degrees in $S$. Omitting any degree information is the same as specifying the sequence of all legal degrees.

<a id="function-primitivegroupprocess-rngintelt-program"></a>
##### `PrimitiveGroupProcess(d, f: parameters): RngIntElt, Program -> Process`

<a id="function-primitivegroupprocess-rngintelt-program-2"></a>
##### `PrimitiveGroupProcess(S, f: parameters): [RngIntElt], Program -> Process`

<a id="function-primitivegroupprocess-program"></a>
##### `PrimitiveGroupProcess(f: parameters): Program -> Process`

```magma
Filter: MonStgElt                    Default: "All"
```

Return a process which will iterate though all primitive groups with degree $d$ which pass the filter and satisfy the predicate $f$. A sequence of degrees may be given instead of a single degree. In this case the process will iterate though the groups of all the degrees in $S$. Omitting any degree information is the same as specifying the sequence of all legal degrees.

<a id="function-isempty-process-3"></a>
##### `IsEmpty(p): Process -> BoolElt`

Returns `true` if the process $p$ has passed its last group.

<a id="function-current-process-3"></a>
##### `Current(p): Process -> GrpPerm, MonStgElt`

Return the current group of the process $p$, as well as a description of the group.

<a id="function-currentlabel-process-3"></a>
##### `CurrentLabel(p): Process -> RngIntElt, RngIntElt`

Return the label of the current group of the process $p$. That is, return $d$ and $n$ such that the current group is `TransitiveGroup(d, n)` (or `PrimitiveGroup(d, n)`).

<a id="procedure-advance-process-ref-3"></a>
##### `Advance(~p): Process`

Move the process $p$ to its next group.

<a id="example-ex-932032"></a>
##### `Example: Processing Primitive Groups of Degree 60 (ex-932032)`

The use of processes is illustrated by the following code, in which the orders of all primitive groups with degree $60$ of diagonal type are listed. We also compute the orbit structures of their Sylow 2-subgroups, which demonstrates that they are non-conjugate.

```magma
> p := PrimitiveGroupProcess(60:Filter:="Diagonal");
> while not IsEmpty(p) do
>     G := Current(p);
>     CurrentLabel(p), #G,
>     [t[1]:t in OrbitRepresentatives(Sylow(G,2))];
>     Advance(~p);
> end while;
60 1 3600 [ 4, 4, 4, 16, 16, 16 ]
60 2 7200 [ 4, 4, 4, 16, 32 ]
60 3 7200 [ 4, 8, 16, 32 ]
60 4 7200 [ 4, 8, 16, 16, 16 ]
60 5 14400 [ 4, 8, 16, 32 ]
```

#### Primitive Group Identification

Given a primitive group $G$ whose degree is at most 2499, it is possible to obtain the number of the group in the primitive groups database which is permutation isomorphic to $G$.

<a id="function-primitivegroupidentification-grpperm"></a>
##### `PrimitiveGroupIdentification(G): GrpPerm -> RngIntElt, RngIntElt`

The number (and degree) of the group in the primitive groups database which is permutation isomorphic to the primitive group $G$.

<a id="example-ex-2ae1d1"></a>
##### `Example: Identifying a Primitive Group (ex-2ae1d1)`

We construct a permutation group of affine type and identify it as a primitive group.

```magma
> M := WreathProduct(SL(2,5), Sym(2));
> Q := Getvecs(M);
> G := Semidir(M, Q);
> G;
Permutation group G acting on a set of cardinality 625
> PrimitiveGroupIdentification(G);
595 625
```

We found it to be group 595 of degree 625.

### Database of Rational Maximal Finite Matrix Groups

Magma includes a database of rational maximal finite matrix groups and their invariant forms, for small dimensions (up to 31 at V2.8 and above). This section defines the interface to that database. See the articles of Nebe & Plesken [[NP95](https://docs.magma-maths.org/references.md#cite-nebe-plesken-ratgps)] and Nebe [[Neb96](https://docs.magma-maths.org/references.md#cite-nebe-ratgps-31)].

A particular entry of the database can be specified in one of two ways. Firstly, a number in the range 1 to the size of the database can be given. Alternatively, the desired dimension can be provided, together with a number in the range 1 to the number of entries of that dimension.

Each entry can be accessed either as a matrix group or as a lattice. If accessed as a matrix group, the order and base are set on return. If as a lattice, the automorphism group is set.

<a id="function-rationalmatrixgroupdatabase"></a>
#### `RationalMatrixGroupDatabase() -> DB`

This function returns a database object which contains information about the database.

<a id="function-largestdimension-db"></a>
#### `LargestDimension(D): DB -> RngIntElt`

Returns the largest dimension of any entry stored in the database. It is an error to refer to larger dimensions in the database.

<a id="operation-operation-db-rngintelt"></a>
#### `# D: DB -> RngIntElt`

<a id="function-numberofgroups-db-2"></a>
#### `NumberOfGroups(D): DB -> RngIntElt`

<a id="function-numberoflattices-db"></a>
#### `NumberOfLattices(D): DB -> RngIntElt`

Returns the number of entries stored in the database.

<a id="function-numberofgroups-db-rngintelt-2"></a>
#### `NumberOfGroups(D, d): DB, RngIntElt -> RngIntElt`

<a id="function-numberoflattices-db-rngintelt"></a>
#### `NumberOfLattices(D, d): DB, RngIntElt -> RngIntElt`

Returns the number of entries stored in the database of dimension $d$.

<a id="function-group-db-rngintelt-2"></a>
#### `Group(D, i): DB, RngIntElt -> GrpMat`

Returns the $i$-th entry from the database $D$ as a matrix group.

<a id="function-lattice-db-rngintelt"></a>
#### `Lattice(D, i): DB, RngIntElt -> Lat`

Returns the $i$-th entry from the database $D$ as a lattice.

<a id="function-group-db-rngintelt-rngintelt-3"></a>
#### `Group(D, d, i): DB, RngIntElt, RngIntElt -> GrpMat`

Returns the $i$-th entry of dimension $d$ from the database $D$ as a matrix group.

<a id="function-lattice-db-rngintelt-rngintelt"></a>
#### `Lattice(D, d, i): DB, RngIntElt, RngIntElt -> Lat`

Returns the $i$-th entry of dimension $d$ from the database $D$ as a lattice.

<a id="example-ex-34d380"></a>
#### `Example: Counting Rational Matrix Groups (ex-34d380)`

```magma
> D := RationalMatrixGroupDatabase();
> #D;
354
> maxdim := LargestDimension(D);
> maxdim;
31
> &+[ NumberOfGroups(D, d) : d in [ 1 .. maxdim ] ];
354
```

These numbers agree (which is nice). The dimension in that range with the most curves is 24.

```magma
> S := [ NumberOfGroups(D, d) : d in [ 1 .. maxdim ] ];
> Max(S);
65 24
```

The groups have known order, so it is easy to find the group with smallest order and dimension 24.

```magma
> time orders := [#Group(D, 24, i): i in [1 .. NumberOfGroups(D, 24)]];
Time: 0.480
> Min(orders);
1872 53
```

### Database of Integral Maximal Finite Matrix Groups

Magma includes a database of representatives of the ${\operatorname{GL}}(n, {\mathbb{Z}})$-conjugacy classes of irreducible maximal finite subgroups of ${\operatorname{GL}}(n, {\mathbb{Z}})$ for $n<=11$ and $n \in \{13,17,19,23\}$. This section defines the interface to that database.

For $n < 10$ the groups have been described in [[PP77](https://docs.magma-maths.org/references.md#cite-pleskenpohst-glnz-i-ii), [PP80](https://docs.magma-maths.org/references.md#cite-pleskenpohst-glnz-iii-v)]. The groups of dimension $10$ can be found in [[Sou94](https://docs.magma-maths.org/references.md#cite-souvignier-gl8z-gl10z)]. In the cases $n>10$ prime, the representatives have been constructed using the descriptions given in [[Ple85](https://docs.magma-maths.org/references.md#cite-plesken-circulants)].

A particular entry of the database can be specified in one of two ways. Firstly, a number in the range 1 to the size of the database can be given. Alternatively, the desired dimension can be provided, together with a number in the range 1 to the number of entries of that dimension.

Each entry can be accessed either as a matrix group or as a lattice. If accessed as a matrix group, the order and base are set on return. If as a lattice, the automorphism group is set.

<a id="function-integralmatrixgroupdatabase"></a>
#### `IntegralMatrixGroupDatabase() -> DB`

This function returns a database object which contains information about the database.

<a id="function-largestdimension-db-2"></a>
#### `LargestDimension(D): DB -> RngIntElt`

Returns the largest dimension of any entry stored in the database. It is an error to refer to larger dimensions in the database.

<a id="operation-operation-db-rngintelt"></a>
#### `# D: DB -> RngIntElt`

<a id="function-numberofgroups-db-3"></a>
#### `NumberOfGroups(D): DB -> RngIntElt`

<a id="function-numberoflattices-db-2"></a>
#### `NumberOfLattices(D): DB -> RngIntElt`

Returns the number of entries stored in the database.

<a id="function-numberofgroups-db-rngintelt-3"></a>
#### `NumberOfGroups(D, d): DB, RngIntElt -> RngIntElt`

<a id="function-numberoflattices-db-rngintelt-2"></a>
#### `NumberOfLattices(D, d): DB, RngIntElt -> RngIntElt`

Returns the number of entries stored in the database of dimension $d$.

<a id="function-group-db-rngintelt-3"></a>
#### `Group(D, i): DB, RngIntElt -> GrpMat`

Returns the $i$-th entry from the database $D$ as a matrix group.

<a id="function-lattice-db-rngintelt-2"></a>
#### `Lattice(D, i): DB, RngIntElt -> Lat, SeqEnum`

Returns a lattice $L$ and sequence of additional forms $F$ fixed by the $i$-th group in the database $D$.

<a id="function-construction-db-rngintelt"></a>
#### `Construction(D, i): DB, RngIntElt -> MonStgElt, SeqEnum`

Returns a string $S$ which describes the construction of the $i$-th group $G$ in the database $D$.

If the $G$-invariant lattice is well known, $S$ equals the name of this lattice. If the Degree $d$ of $G$ is a prime, $G$ usually can be chosen to fix the form $a_0 I_d + a_1 (z+z^{-1}) + ... + a_k (z^k+z^{-1})$ with $k = (d-1)/2$ and some $a_i \in {\mathbb{Z}}$ where $z$ denotes the permutation matrix of some $d$-cycle in ${\mathbb{Z}}^{d \times d}$ (see [[Ple85](https://docs.magma-maths.org/references.md#cite-plesken-circulants)]). In this case, $S$ equals $[a_0, a_1, a_2, ...]$. In all other cases, $S$ describes the isomorphism type of $G$.

The second return value gives the numbers of all groups of degree $d$ in the `Rational Matrix Group Database` which contain a ${\operatorname{GL}}(d, {\mathbb{Q}})$-conjugate copy of $G$.

<a id="function-group-db-rngintelt-rngintelt-4"></a>
#### `Group(D, d, i): DB, RngIntElt, RngIntElt -> GrpMat`

Returns the $i$-th entry of dimension $d$ in the database $D$ as a matrix group.

<a id="function-lattice-db-rngintelt-rngintelt-2"></a>
#### `Lattice(D, d, i): DB, RngIntElt, RngIntElt -> Lat, SeqEnum`

Returns a lattice $L$ and sequence of additional forms $F$ fixed by the $i$-th group of dimension $d$ in the database $D$.

<a id="function-construction-db-rngintelt-rngintelt"></a>
#### `Construction(D, d, i): DB, RngIntElt, RngIntElt -> MonStgElt, SeqEnum`

Returns a string and integer which describe the construction of the $i$-th entry of dimension $d$ in the database $D$.

<a id="example-ex-2e0f58"></a>
#### `Example: Accessing Integral Matrix Groups (ex-2e0f58)`

```magma
> D:= IntegralMatrixGroupDatabase();
> #D;
222
> G:= Group(D, 8, 7); Construction(D, 8, 7);
A8* [ 3 ]
```

So $G$ is the automorphism group of the dual of the root lattice $A_8$ and it is conjugate to a subgroup of the third entry of dimension $8$ in the `RationalMatrixgroupDatabase`. We find an explicit embedding $T$ of $G$ into that group.

```magma
> DQ:= RationalMatrixGroupDatabase();
> H:= Group(DQ, 8, 3); L:= Lattice(DQ, 8, 3);
> F:= PositiveDefiniteForm(G);
> for s in Sublattices(G) do
>   B:= BasisMatrix(s);
>   FF:= B * F * Transpose(B);
>   ok, T:= IsIsometric(LatticeWithGram(FF div GCD(Eltseq(FF))), L);
>   if ok then break; end if;
> end for;
> assert ok;
> T:= Matrix(Rationals(), T*B);
> [Matrix(Integers(), T*Matrix(G.i)*T^-1) in H : i in [1..Ngens(G)]];
[ true, true ]
```

### Database of Finite Quaternionic Matrix Groups

Magma includes a database of the finite absolutely irreducible subgroups of ${\operatorname{GL}}_n({\cal D})$ where ${\cal D}$ is a definite quaternion algebra whose centre has degree $d$ over ${\mathbb{Q}}$ and $nd\leq10$. This collection is due to Gabriele Nebe [[Neb98](https://docs.magma-maths.org/references.md#cite-nebe-quaternionic)]. This section defines the interface to that database.

A particular entry of the database can be specified in one of two ways. Firstly, a number in the range 1 to the size of the database can be given. Alternatively, the desired dimension can be provided, together with a number in the range 1 to the number of entries of that dimension.

Each entry can be accessed either as a matrix group or as a lattice. If accessed as a matrix group, the order and base are set on return.

<a id="function-quaternionicmatrixgroupdatabase"></a>
#### `QuaternionicMatrixGroupDatabase() -> DB`

This function returns a database object which contains information about the database.

<a id="function-largestdimension-db-3"></a>
#### `LargestDimension(D): DB -> RngIntElt`

Returns the largest dimension of any entry stored in the database. It is an error to refer to larger dimensions in the database.

<a id="operation-operation-db-rngintelt"></a>
#### `# D: DB -> RngIntElt`

<a id="function-numberofgroups-db-4"></a>
#### `NumberOfGroups(D): DB -> RngIntElt`

<a id="function-numberoflattices-db-3"></a>
#### `NumberOfLattices(D): DB -> RngIntElt`

Returns the number of entries stored in the database.

<a id="function-numberofgroups-db-rngintelt-4"></a>
#### `NumberOfGroups(D, d): DB, RngIntElt -> RngIntElt`

<a id="function-numberoflattices-db-rngintelt-3"></a>
#### `NumberOfLattices(D, d): DB, RngIntElt -> RngIntElt`

Returns the number of entries stored in the database of dimension $d$.

<a id="function-group-db-rngintelt-4"></a>
#### `Group(D, i): DB, RngIntElt -> GrpMat`

Returns the $i$-th entry from the database $D$ as a matrix group.

<a id="function-lattice-db-rngintelt-3"></a>
#### `Lattice(D, i): DB, RngIntElt -> Lat, SeqEnum`

Returns a lattice $L$ and sequence of forms $F$ corresponding to the $i$-th entry of the database $D$.

<a id="function-construction-db-rngintelt-2"></a>
#### `Construction(D, i): DB, RngIntElt -> MonStgElt, RngIntElt`

Returns a string and integer which describe the construction of the $i$-th entry of the database $D$.

<a id="function-group-db-rngintelt-rngintelt-5"></a>
#### `Group(D, d, i): DB, RngIntElt, RngIntElt -> GrpMat`

Returns the $i$-th entry of dimension $d$ in the database $D$ as a matrix group.

<a id="function-lattice-db-rngintelt-rngintelt-3"></a>
#### `Lattice(D, d, i): DB, RngIntElt, RngIntElt -> Lat, SeqEnum`

Returns a lattice $L$ and sequence of forms $F$ corresponding to the $i$-th entry of dimension $d$ in the database $D$.

<a id="function-construction-db-rngintelt-rngintelt-2"></a>
#### `Construction(D, d, i): DB, RngIntElt, RngIntElt -> MonStgElt, RngIntElt`

Returns a string and integer which describe the construction of the $i$-th entry of dimension $d$ in the database $D$.

<a id="example-ex-00c791"></a>
#### `Example: Quaternionic Matrix Groups of Dimension 36 (ex-00c791)`

We illustrate accessing the quaternionic matrix groups database with a group and lattice of dimension 36.

```magma
> DB := QuaternionicMatrixGroupDatabase();
> LargestDimension(DB);
40
> NumberOfGroups(DB, 36);
10
> G := Group(DB, 36, 8);
> G : Minimal;
MatrixGroup(36, Integer Ring) of order 43545600 = 2^10 * 3^5
* 5^2 * 7
> #pCore(G, 2);
2
> L, forms := Lattice(DB, 36, 8);
> Determinant(L);
3874204890000
> IsSquare($1);
true 1968300
```

### Database of Finite Symplectic Matrix Groups

Magma includes a database of the maximal finite irreducible subgroups of ${\operatorname{Sp}}_{2n}({\mathbb{Q}})$ for $1\le i \le 11$ up to conjugacy in ${\operatorname{GL}}_{2n}({\mathbb{Q}})$. This collection is due to Markus Kirschmer [[Kir09](https://docs.magma-maths.org/references.md#cite-kirschmer-symplectic)]. This section defines the interface to that database.

To avoid non-integral entries, the stored matrix groups do not fix the standard skewsymmetric form but some other nondegenerate skewsymmetric form. The example below illustrates how to construct a conjugate matrix group which fixes the standard skewsymmetric form.

A particular entry of the database can be specified in one of two ways. Firstly, a number in the range 1 to the size of the database can be given. Alternatively, the desired dimension can be provided, together with a number in the range 1 to the number of entries of that dimension.

Each entry can be accessed either as a matrix group or as a lattice with a pair of forms. If accessed as a matrix group, the order and base are set on return.

<a id="function-symplecticmatrixgroupdatabase"></a>
#### `SymplecticMatrixGroupDatabase() -> DB`

This function returns a database object which contains information about the database.

<a id="function-largestdimension-db-4"></a>
#### `LargestDimension(D): DB -> RngIntElt`

Returns the largest dimension of any entry stored in the database. It is an error to refer to larger dimensions in the database.

<a id="operation-operation-db-rngintelt"></a>
#### `# D: DB -> RngIntElt`

<a id="function-numberofgroups-db-5"></a>
#### `NumberOfGroups(D): DB -> RngIntElt`

<a id="function-numberoflattices-db-4"></a>
#### `NumberOfLattices(D): DB -> RngIntElt`

Returns the number of entries stored in the database.

<a id="function-numberofgroups-db-rngintelt-5"></a>
#### `NumberOfGroups(D, d): DB, RngIntElt -> RngIntElt`

<a id="function-numberoflattices-db-rngintelt-4"></a>
#### `NumberOfLattices(D, d): DB, RngIntElt -> RngIntElt`

Returns the number of entries stored in the database of dimension $d$.

<a id="function-group-db-rngintelt-5"></a>
#### `Group(D, i): DB, RngIntElt -> GrpMat`

Returns the $i$-th entry from the database $D$ as a matrix group.

<a id="function-lattice-db-rngintelt-4"></a>
#### `Lattice(D, i): DB, RngIntElt -> Lat, SeqEnum`

Returns a lattice $L$ and a sequence $S$ of two integral forms such that the automorphism group of $L$ with respect to $S$ equals `Group(DB, i)`. The first form in $S$ is the gram matrix of $L$ and the second form is skewsymmetric. The sequence $S$ is normalized as described in the appendix of [[Kir09](https://docs.magma-maths.org/references.md#cite-kirschmer-symplectic)] to simplify the recognition of the matrix group.

<a id="function-construction-db-rngintelt-3"></a>
#### `Construction(D, i): DB, RngIntElt -> MonStgElt`

Returns a string which describes the construction of the $i$-th entry of the database $D$.

<a id="function-group-db-rngintelt-rngintelt-6"></a>
#### `Group(D, d, i): DB, RngIntElt, RngIntElt -> GrpMat`

Returns the $i$-th entry of dimension $d$ in the database $D$ as a matrix group.

<a id="function-lattice-db-rngintelt-rngintelt-4"></a>
#### `Lattice(D, d, i): DB, RngIntElt, RngIntElt -> Lat, SeqEnum`

Returns a lattice $L$ and a sequence $S$ of forms corresponding to the $i$-th entry of dimension $d$ in the database $D$.

<a id="function-construction-db-rngintelt-rngintelt-3"></a>
#### `Construction(D, d, i): DB, RngIntElt, RngIntElt -> MonStgElt`

Returns a string which describes the construction of the $i$-th entry of dimension $d$ in the database $D$.

<a id="example-ex-c0dcaf"></a>
#### `Example: Symplectic Matrix Groups of Dimension 16 (ex-c0dcaf)`

We illustrate accessing the symplectic matrix group database with a group of dimension 16.

```magma
> DB := SymplecticMatrixGroupDatabase();
> NumberOfGroups(DB, 16);
91
> G := Group(DB, 16, 1);
> G : Minimal;
MatrixGroup(16, Integer Ring) of order 2^21 * 3^4 * 5^2
```

The group G does not fix the standard skewsymmetic form. But it can be conjugated to do so.

```magma
> _, S := Lattice(DB, 16, 1);
> T := TransformForm(Matrix(Rationals(), S[2]), "symplectic");
> H := ChangeRing(G, Rationals())^(GL(16,Rationals()) ! T);
> J := SymplecticForm(16, Rationals());
> forall{h: h in Generators(H) | h * J * Transpose(h) eq J};
true
```

### Database of Irreducible Matrix Groups

Magma has a database containing all irreducible subgroups of $\GL_k(p)$, for $p$ prime, $k \ge1$, and $p^k < 2500$. One representative of each conjugacy class of subgroups is stored.

The data used is the same as that used to store the affine primitive permutation groups. See the Primitive Groups Database section for the provenance of the data.

Within the database the groups are stored according to $p^k$. First are the soluble groups, followed by the insoluble. Within each subdivision, the groups are stored by increasing order. (It follows that ${\operatorname{GL}}_k(p)$ is the last in each list.)

The basic access function takes three parameters, $k$, $p$, and number, and returns the corresponding group. Functions with name prefixed by `NumberOf` tell how many groups of each class there are stored.

#### Accessing the Database

<a id="function-numberofirreduciblematrixgroups-rngintelt-rngintelt"></a>
##### `NumberOfIrreducibleMatrixGroups(k, p): RngIntElt, RngIntElt -> RngIntElt`

<a id="function-numberofsolubleirreduciblematrixgroups-rngintelt-rngintelt"></a>
##### `NumberOfSolubleIrreducibleMatrixGroups(k, p): RngIntElt, RngIntElt -> RngIntElt`

Given $k$ and $p$, $p$ prime, $k \ge1$, and $p^k < 2500$, `NumberOfIrreducibleMatrixGroups` returns the number of subgroups of $\GL_k(p)$ stored. The other function returns the number of soluble subgroups stored.

<a id="function-irreduciblematrixgroup-rngintelt-rngintelt-rngintelt"></a>
##### `IrreducibleMatrixGroup(k, p, n): RngIntElt, RngIntElt, RngIntElt -> GrpMat`

Given $k$ and $p$ $p$ prime, $k \ge1$, and $p^k < 2500$, and a positive integer $n$, return the $n$-th subgroup of $\GL_k(p)$ stored.

<a id="example-ex-462c7c"></a>
##### `Example: Irreducible Matrix Groups in GL(4, 5) (ex-462c7c)`

We apply some of these functions to the ${\operatorname{GL}}_4(5)$ case.

```magma
> NumberOfIrreducibleMatrixGroups(4, 5);
647
> NumberOfSolubleIrreducibleMatrixGroups(4, 5);
509
> G := IrreducibleMatrixGroup(4, 5, 511);
> ChiefFactors(G);
    G
    |  Cyclic(2)
    *
    |  Alternating(5)
    *
    |  Cyclic(2)
    1
> IsIrreducible(G);
true
> IsAbsolutelyIrreducible(G);
false
```

### Database of Quasisimple Matrix Groups

Magma has a database containing characteristic 0 representations of some finite quasisimple groups.

<a id="function-quasisimplematrixgroup-monstgelt-rngintelt-rngintelt"></a>
#### `QuasisimpleMatrixGroup(N, d, p : parameters): MonStgElt, RngIntElt, RngIntElt -> GrpMat`

```magma
OverZ        : BoolElt                      Default: true if p is not 0
Automorphisms: BoolElt                      Default: false
RepNo        : RngIntElt                    Default: 1
```

Return an absolutely irreducible matrix group in characteristic $p$, which may be a prime number or 0, derived from the reduction modulo $p$ of an absolutely irreducible representation in characteristic 0 and dimension $d$ of the quasisimple group $G$ with name $N$. The generators of $G$ used are its standard generators. For those quasisimple groups in the ATLAS-database (Section [Database of ATLAS Groups](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/ATLAS-database.md#sectatlasgroups)), the same names are used as there. Other quasisimple groups are named according to the same conventions.

If there is more than one representation of $G$ in dimension $d$ in the database, then the first such is used by default, and the others can be accessed by using the `RepNo` option.

If the reduction modulo $p$ of the representation is not irreducible, then a random non-trivial irreducible constituent is used. (This behaviour may change in the future.)

For those representations that are not realisable over **Z** in dimension $d$, a representation in dimension $d$ over a minimal extension of the rationals and also an irreducible representation in a higher dimension over **Z** are both stored in the database. The representation used is the one over **Z** if the parameter `OverZ` is `true`, and the one over the number field otherwise. Reduction modulo $p$ is generally faster using the integral representation, so that is the default when $p>0$.

If the parameter `Automorphisms` is set, then extra generators inducing those outer automorphisms of $G$ that stabilise the representation are included in the group returned. This may result in extra scalars being present in the group returned, and when $p=0$ this scalar subgroup can sometimes be infinite.

<a id="function-quasisimplematrixgroups"></a>
#### `QuasisimpleMatrixGroups() -> SeqEnum`

Returns a list of tuples specifying the names of the groups in the quasisimple matrix group database, together with the dimension and the number of stored representations of the group in that dimension.

### Database of Soluble Irreducible Groups

This database contains one representative of each conjugacy class of irreducible soluble subgroups of ${\rm GL}(n,p)$, $p$ prime, They may be accessed through specifying a group by its label in the database, as described in the section on basic functions, or through searching using predicates, or through a process. The database was constructed by Mark Short [[Sho92](https://docs.magma-maths.org/references.md#cite-short)].

#### Basic Functions

The basic access functions for the database are described in this section. The label of a group in the database is three integers, $d$, $p$, $i$. The first, $d \ge 2$, is the degree of the matrix group. The second, a prime $p$, specifies the base field of the group. The third is the number of the group in this degree/field set.

<a id="function-isolgroupdatabase"></a>
##### `IsolGroupDatabase() -> DB`

Open the database and return a reference to it. This reference may be passed to other functions so that they do fewer file operations.

<a id="function-grpdata-isolgroup"></a>
##### `IsolGroup(n, p, i): RngIntElt, RngIntElt, RngIntElt -> GrpMat`

<a id="function-group-db-rngintelt-rngintelt-rngintelt"></a>
##### `Group(D, n, p, i): DB, RngIntElt, RngIntElt, RngIntElt -> GrpMat`

Given a positive integer $o \leq 1000$ (with $o \neq 512$ or $768$) and a positive integer $n$, return the $n$-th group of order $o$.

<a id="function-isolnumberofdegreefield-rngintelt-rngintelt"></a>
##### `IsolNumberOfDegreeField(n, p): RngIntElt, RngIntElt -> RngIntElt`

The number of groups in the database of degree $n$ over ${\bf F}_{p}$.

<a id="function-isolinfo-rngintelt-rngintelt-rngintelt"></a>
##### `IsolInfo(n, p, i): RngIntElt, RngIntElt, RngIntElt -> MonStgElt`

This function returns a string which gives some information about a group in the database given its label. In particular, it contains the order and primitivity information about the group.

<a id="function-isolorder-rngintelt-rngintelt-rngintelt"></a>
##### `IsolOrder(n, p, i): RngIntElt, RngIntElt, RngIntElt -> RngIntElt`

This function returns the order of a group given its label.

<a id="function-isolminblocksize-rngintelt-rngintelt-rngintelt"></a>
##### `IsolMinBlockSize(n, p, i): RngIntElt, RngIntElt, RngIntElt -> RngIntElt`

This function returns the minimal block size of a group given its label. If it is primitive, it returns 0.

<a id="function-isolisprimitive-rngintelt-rngintelt-rngintelt"></a>
##### `IsolIsPrimitive(n, p, i): RngIntElt, RngIntElt, RngIntElt -> BoolElt`

This function returns whether a group is primitive given its label.

<a id="function-isolguardian-rngintelt-rngintelt-rngintelt"></a>
##### `IsolGuardian(n, p, i): RngIntElt, RngIntElt, RngIntElt -> GrpMat`

This function returns the “guardian” of a group given its label, i.e., the maximal subgroup of ${\operatorname{GL}}(n, p)$ of which the group is a subgroup.

<a id="example-ex-f88165"></a>
##### `Example: Group of Degree 3 and Its Guardian (ex-f88165)`

We find a group of degree 3 and its guardian.

```magma
> IsolNumberOfDegreeField(3, 5);
22
> G := IsolGroup(3, 5, 10);
> #G;
62
> GG := IsolGuardian(3, 5, 10);
> #GG;
372
> G;
MatrixGroup(3, GF(5)) of order 62 = 2 * 31
Generators:
  [0 0 1]
  [3 0 4]
  [2 3 1]
> GG;
MatrixGroup(3, GF(5)) of order 372 = 2^2 * 3 * 31
Generators:
  [1 0 0]
  [3 2 2]
  [1 4 2]

  [0 1 0]
  [0 0 1]
  [3 0 4]
```

#### Searching with Predicates

We may search the database for a group satisfying some predicate. A predicate for a group in this database is one of the following:

- A function $f$ (which may either be an intrinsic function or a user defined function) which takes a matrix group and returns a boolean value.
- A tuple of one function $\langle g\rangle$, where $g$ takes a label and returns a boolean value. Again $g$ is either intrinsic or user defined.
- A tuple of two functions $\langle g, f\rangle$ where $g, f$ are as above. In this case, the tested predicate will be $g$ first, then $f$. This form is introduced to avoid expanding the group from its label until absolutely necessary.

<a id="function-isolgroupsatisfying-any"></a>
##### `IsolGroupSatisfying(f): Any -> GrpMat`

Given a predicate $f$, return a group satisfying it. This function runs through all the stored groups and applies the predicate until it finds a suitable one. If no group is found, an error message is printed.

<a id="function-isolgroupofdegreesatisfying-rngintelt-any"></a>
##### `IsolGroupOfDegreeSatisfying(d, f): RngIntElt, Any -> GrpMat`

As `IsolGroupSatisfying(f)`, except it only runs through the groups of degree $d$.

<a id="function-isolgroupofdegreefieldsatisfying-rngintelt-rngintelt-any"></a>
##### `IsolGroupOfDegreeFieldSatisfying(d, p, f): RngIntElt, RngIntElt, Any -> GrpMat`

As `IsolGroupSatisfying(f)`, except it only runs through the groups of degree $d$ and defined over ${\bf F}_{p}$.

<a id="function-isolgroupssatisfying-any"></a>
##### `IsolGroupsSatisfying(f): Any -> SeqEnum`

As `IsolGroupSatisfying(f)`, except a sequence of all such groups is returned.

<a id="function-isolgroupsofdegreesatisfying-rngintelt-any"></a>
##### `IsolGroupsOfDegreeSatisfying(d, f): RngIntElt, Any -> SeqEnum`

As `IsolGroupOfDegreeSatisfying(d, f)`, except a sequence of all such groups is returned.

<a id="function-isolgroupsofdegreefieldsatisfying-rngintelt-rngintelt-any"></a>
##### `IsolGroupsOfDegreeFieldSatisfying(d, p, f): RngIntElt, RngIntElt, Any -> SeqEnum`

As `IsolGroupOfDegreeFieldSatisfying(d, p, f)`, except a sequence of all such groups is returned.

#### Associated Functions

Associated with this database are two functions which can be used for constructing the semidirect product of a finite vector space and an irreducible matrix group. In particular, they are useful for constructing soluble affine permutation groups.

<a id="function-getvecs-grpmat"></a>
##### `Getvecs(G): GrpMat -> SeqEnum`

The function takes a matrix group $G$ over a finite prime field and returns a sequence, $Q$ say, containing all the vectors of the natural module for $G$. The ordering of $Q$ does *not* depend on $G$, but only on its natural module.

<a id="function-semidir-grpmat-seqenum"></a>
##### `Semidir(G, Q): GrpMat, SeqEnum -> GrpPerm`

Given an irreducible matrix group $G$ of degree $n$ defined over a finite prime field of cardinality $p$ and the sequence $Q$ obtained from `Getvecs`, this function returns the permutation group $H$ of degree $p^n$, that is, the semidirect product of $G$ with its natural module. The group $H$ acts on the set $\{1\dots p^n\}$ and $G$ is isomorphic to each of the point stabilizers. It is well known that $H$ is primitive, and that every primitive permutation group with soluble socle arises in this way. Note that if `Semidir` is to be called more than once for subgroups of the same general linear group, then `Getvecs` need only be called on the first occasion, since the ordering of $Q$ depends only on $n$ and $p$. This is why the call to `Getvecs` is not made by `Semidir` itself.

#### Processes

A small group process enables iteration over all groups with specified degrees and fields, without having to create and store all such groups together. A process is created via the function `IsolProcess` and its variants. The standard process functions `IsEmpty`, `Current`, `CurrentLabel`, and `Advance` can then be applied to the process. A specifier for degree or field is one of a valid degree (field size), or a tuple $\langle l, h\rangle$, of valid degrees (field sizes) which is interpreted to mean all degrees (prime field sizes) in $[l, h]$.

<a id="function-isolprocess"></a>
##### `IsolProcess() -> Process`

Return a process which will iterate though all groups in the database.

<a id="function-isolprocessofdegree"></a>
##### `IsolProcessOfDegree(d): . -> Process`

Return a process which will iterate though all groups in the database of degree $d$.

<a id="function-isolprocessoffield"></a>
##### `IsolProcessOfField(p): . -> Process`

Return a process which will iterate though all groups in the database over the specified field.

<a id="function-isolprocessofdegreefield"></a>
##### `IsolProcessOfDegreeField(d, p): ., . -> Process`

Return a process for iterating over all the stored groups with degree specifier $d$ and field specifier $p$. Initially it points to the first such group (the principal key is the degree).

<a id="function-isempty-process-4"></a>
##### `IsEmpty(p): Process -> BoolElt`

Returns `true` if the process $p$ has passed its last group.

<a id="function-current-process-4"></a>
##### `Current(p): Process -> GrpMat`

Return the current group of the process $p$.

<a id="function-currentlabel-process-4"></a>
##### `CurrentLabel(p): Process -> RngIntElt, RngIntElt, RngIntElt`

Return the label of the current group of the process $p$. That is, return $d$, $n$, and $i$ such that the current group is `IsolGroup(d, n, i)`.

<a id="procedure-advance-process-ref-4"></a>
##### `Advance(~p): Process`

Move the process $p$ to its next group.

<a id="example-ex-4ef256"></a>
##### `Example: Processing All Groups of Degree 3 (ex-4ef256)`

We use a small group process to look at all the groups of degree 3.

```magma
> P := IsolProcessOfDegree(3);
> ords := {* *};
> repeat
>   Include(~ords, #Current(P));
>   Advance(~P);
> until IsEmpty(P);
> ords;
{* 31, 62, 93, 7, 124, 96^^4, 39, 12^^2, 186, 13, 192^^2, 48^^4,
21, 24^^6, 26 *}
```

<a id="atlas-database"></a>
<a id="sectatlasgroups"></a>
### Database of ATLAS Groups

Magma includes representations of nearly simple groups from the ATLAS of Finite Group Representations `https://brauer.maths.qmul.ac.uk/Atlas/v3/`. The data was supplied by Robert Wilson.

Groups in the database are accessed by name. The intrinsic `ATLASGroupNames` gives a list of the names that may currently be used to access the database. The names are based on ATLAS names for simple groups, with some exceptions (usually caused by an aversion to subscripting automorphisms). Classical group names take precedence over their Lie-type names. Within a name, the letter “T” denotes a twisted group of Lie type. (The two sorts of twisting of $D_4$ are distinguished by one being “O8m” and the other “TD4”.) An initial number on the name denotes a central element, a “d” is used to separate the simple group name from an automorphism (when there is no other letter there), and an “i” denotes an isoclinic variant.

<a id="example-ex-7bb063"></a>
#### `Example: Listing ATLAS Group Names (ex-7bb063)`

The list of names in V2.11 is printed as follows.

```magma
> ATLASGroupNames();
{@ A5, 2A5, 2S5, 2S5i, S5, A6, 2A6, 2S6, 3A6, 3S6, 6A6,
6S6, A6V4, M10, PGL29, S6, A7, A8, 2A8, S8, A9, 2A9,
S9, A10, 2A10, S10, A11, 2A11, 2S11, S11, A12, 2A12,
S12, A13, 2A13, S13, A14, 2A14, 2S14, 2S14i, S14, O93,
2O93, 2O93d2, O93d2, O10m2, O10m2d2, O73, 2O73, 2O73d2,
3O73, 3O73d2, O73d2, O8m2, O8m2d2, O8m3, 2O8m3,
2O8m3d2a, O8m3D8, O8m3V4, O8m3d2a, O8p2, S102, S44,
S44d2, S44d4, S45, 2S45, S45d2, S47, 2S47, 2S47d2,
S47d2, S62, 2S62, S63, 2S63, 2S63d2, S63d2, S82, U311,
3U311, 3U311d2, U311d2, U33, U33d2, U42, 2U42, 2U42d2,
U42d2, U43, U52, U52d2, U53, U62, 12U62, 2U62, 3U62,
4U62, 6U62, U62S3, U62d2, U72, E74, E85, E82, E72, E62,
TF42, TF42d2, G25, TE62, 2TE62, 2TE62d2, 3TE62,
3TE62S3, 3TE62d2, 3TE62d3, 4TE62, TE62S3, TE62d2,
TE62d3, E64, 3E64, 3E64d2, TD42, TD42d3, G23, 3G23,
3G23d2, G23d2, G24, 2G24, 2G24d2, 2G24d2i, G24d2, F42,
2F42, 2F42d2, 2F42d4i, F42d2, R27, R27d3, Sz8, 2Sz8,
4Sz8d3, Sz8d3, Sz32, Sz32d5, TD43, L27, L28, L28d3,
L211, 2L211, L211d2, L213, 2L213, 2L213d2, L213d2,
L216, L216d2, L216d4, L217, 2L217, 2L217d2, L217d2,
L219, 2L219, 2L219d2i, L219d2, L223, 2L223, 2L223d2i,
L223d2, L227, L229, 2L229, L231, 2L231, L231d2, L232,
L232d5, L249, 2L249, L33, L33d2, L34, 12aL34, 12bL34,
2L34, 3L34, 4aL34, 4bL34, 6L34, L35, L35d2, L37, 3L37,
3L37d2, L37d2, L311, L52, L52d2, L62, L62d2, L72,
L72d2, B, Co1, 2Co1, Co2, Co3, F22, 2F22, 2F22d2, 3F22,
3F22d2, F22d2, F23, F24, 3F24, 3F24d2, F24d2, HN, HNd2,
HS, 2HS, 2HSd2, HSd2, He, Hed2, J1, J2, 2J2, 2J2d2,
J2d2, J3, 3J3, 3J3d2, J3d2, J4, Ly, ON, 3ON, 3ONd2,
ONd2, ONd4, Ru, 2Ru, Suz, 2Suz, 2Suzd2, 3Suz, 3Suzd2,
6Suz, 6Suzd2, Suzd2, Th, M, M11, M12, 2M12, 2M12d2,
M12d2, M22, 12M22, 2M22, 2M22d2, 3M22, 3M22d2, 4M22,
4M22d2, 6M22, 6M22d2, M22d2, M23, M24, McL, 3McL,
3McLd2, McLd2, S7 @}
```

The basic access function takes a name and returns a special type of group, an ATLAS group, with Magma type `GrpAtlas`. Access to the information stored about the named group are then done through this ATLAS group.

#### Accessing the Database

<a id="function-atlasgroupnames"></a>
##### `ATLASGroupNames() -> SetIndx[MonStgElt]`

The names of the groups that have representations stored in the database.

<a id="function-atlasgroup"></a>
##### `ATLASGroup(N): MonStgElt -> GrpAtlas`

The ATLAS group stored in the database that has name $N$.

#### Accessing the ATLAS Groups

Once an ATLAS group has been extracted from the database, the following intrinsics give access to the information stored with it.

<a id="function-order-grpatlas"></a>
##### `Order(A): GrpAtlas -> RngIntElt`

<a id="operation-operation-grpatlas-rngintelt"></a>
##### `# G: GrpAtlas -> RngIntElt`

The order of $A$.

<a id="function-multiplier-grpatlas"></a>
##### `Multiplier(A): GrpAtlas -> RngIntElt`

The order of the multiplier of $A$, when $A$ is simple.

<a id="function-matrepkeys-grpatlas"></a>
##### `MatRepKeys(A): GrpAtlas -> SeqEnum[DBAtlasKeyMatRep]`

The sequence of keys to the matrix representations of $A$ stored in the database. This will be the empty sequence if no matrix representations are stored.

<a id="function-matrepdegrees-grpatlas"></a>
##### `MatRepDegrees(A): GrpAtlas -> SetEnum[RngIntElt]`

The set of degrees of the matrix representations stored for $A$.

<a id="function-degree-dbatlaskeymatrep"></a>
##### `Degree(K): DBAtlasKeyMatRep -> RngIntElt`

The degree of the matrix representation associated with key $K$.

<a id="function-matrepfieldsizes-grpatlas"></a>
##### `MatRepFieldSizes(A): GrpAtlas -> SetEnum[RngIntElt]`

The set of sizes of the fields for which a matrix representation of $A$ is available.

<a id="function-matrepcharacteristics-grpatlas"></a>
##### `MatRepCharacteristics(A): GrpAtlas -> SetEnum[RngIntElt]`

The set of characteristics of the fields for which a matrix representation of $A$ is available.

<a id="function-field-dbatlaskeymatrep"></a>
##### `Field(K): DBAtlasKeyMatRep -> FldFin`

The base field of the matrix representation associated with key $K$.

<a id="function-permrepkeys-grpatlas"></a>
##### `PermRepKeys(A): GrpAtlas -> SeqEnum[DBAtlasKeyPermRep]`

The sequence of keys to the permutation representations of $A$ stored in the database. This will be the empty sequence if no permutation representations are stored.

<a id="function-permrepdegrees-grpatlas"></a>
##### `PermRepDegrees(A): GrpAtlas -> SetEnum[RngIntElt]`

The set of degrees of the permutation representations stored for $A$.

<a id="function-degree-dbatlaskeypermrep"></a>
##### `Degree(K): DBAtlasKeyPermRep -> RngIntElt`

The degree of the permutation representation associated with key $K$.

#### Representations of the ATLAS Groups

The intrinsics described below construct concrete representations of the ATLAS groups from the data in the database. Each representation is accessed by its key, sequences of which are produced by the intrinsics `MatRepKeys` and `PermRepKeys` described above. The intrinsics described in this section take a key and produce a concrete representation.

<a id="function-matrixgroup-dbatlaskeymatrep"></a>
##### `MatrixGroup(K): DBAtlasKeyMatRep -> GrpMat`

Given a key to a matrix representation of an ATLAS group, construct and return the corresponding matrix group.

<a id="function-matrep-dbatlaskeymatrep"></a>
##### `MatRep(K): DBAtlasKeyMatRep -> SeqEnum[GrpMatElt]`

The generators of the matrix group designated by database key K.

<a id="function-permutationgroup-dbatlaskeypermrep"></a>
##### `PermutationGroup(K): DBAtlasKeyPermRep -> GrpPerm`

Given a key to a permutation representation of an ATLAS group, construct and return the corresponding permutation group.

<a id="function-permrep-dbatlaskeypermrep"></a>
##### `PermRep(K): DBAtlasKeyPermRep -> SeqEnum[GrpPermElt]`

The generators of the permutation group designated by database key K.

<a id="example-ex-d60e34"></a>
##### `Example: Representations of 2.J2.2 (ex-d60e34)`

We get a representation of $2.J_2.2$ from the database.

```magma
> A := ATLASGroup("2J2d2");
> PermRepKeys(A);
[]
> mrk := MatRepKeys(A);
> mrk;
[
  Matrix rep of degree 12 over GF(3),
  Matrix rep of degree 6 over GF(25) named a,
  Matrix rep of degree 12 over GF(7)
]
```

The database has no permutation representations and three matrix representations. We construct the first of the matrix groups. It is small enough to check its composition factors.

```magma
> K := mrk[1];
> M := MatrixGroup(K);
> M`Order := #A;
> RandomSchreier(M);
> CompositionFactors(M);
    G
    |  Cyclic(2)
    *
    |  J2
    *
    |  Cyclic(2)
    1
```

For efficiency, we asserted the order of the matrix group to be the order of the ATLAS group and constructed a BSGS by the random schreier.

<a id="manifolds-database"></a>
<a id="sectthreemanifolds"></a>
### Fundamental Groups of 3-Manifolds

This database consists of the fundamental groups of the 10,986 small-volume closed hyperbolic manifolds in the Hodgson–Weeks census. The presentations included were generated by Jeffrey Weeks’ program *SnapPea* (now SnapPy) `https://snappy.computop.org/`. Information about finite-index subgroups with homology was generated by Dunfield and Thurston in [[DT03](https://docs.magma-maths.org/references.md#cite-virtualhaken)].

#### Basic Functions

The basic access functions for the database are described in this section.

The result returned by the `Manifold` function is a record with a number of fields containing information about the manifold and its fundamental group. The fields of the records are as follows:

Field `Name`: A string giving a name to the manifold $M$.

Field `Volume`: The volume of $M$ as a floating point number.

Field `Homology`: A sequence of integers describing the first homology group of $M$.

Field `Group`; The fundamental group of $M$ as a finitely presented group.

Field `GoodCoverImage`: A possibly empty sequence of permutations or integers 1 representing the identity permutation. These permutations define a homomorphism from the fundamental group to $S_n$, such that the kernel of the homomorphism has infinite abelianization.

Field `GoodCover`: A list describing the construction of the good cover.

Field `Degree`: A positive integer, the degree of the `GoodCoverImage` permutation representation.

Field `KnownPosBettiCover`: A boolean value, always true in the current database.

Field `KnownWeakPosBettiCover`: A boolean value, always true in the current database.

Field `Reason`: A string, one of `"AbelianInvariants"`, `"RationalReconstruction"`, or `"MAGMA"`.

Field `Rank`: A positive integer.

Field `GoodCoverImageU`: A possibly empty sequence of permutations or integers 1 representing the identity permutation.

<a id="function-manifolddatabase"></a>
##### `ManifoldDatabase() -> DB`

Open the database and return a reference to it.

<a id="function-manifold-db-rngintelt"></a>
##### `Manifold(D, i): DB, RngIntElt -> Rec`

<a id="function-manifold-db-monstgelt"></a>
##### `Manifold(D, name): DB, MonStgElt -> Rec`

Extract the associated record from the database of fundamental groups of 3-dimensional manifolds. The manifold may be specified by the index $i$ ($1 \le i \le 11126$) or a name from the Hodgson–Weeks census.

#### Accessing the Data

The intrinsic `Manifold` is one way to access the data in the database. It may be more convenient to iterate over the database object returned by `ManifoldDatabase`. The following examples show how this may be done.

<a id="example-ex-f8e221"></a>
##### `Example: Records from the 3-Manifolds Database (ex-f8e221)`

We extract a record from the database.

```magma
> D := ManifoldDatabase();
> r := Manifold(D, 100);
> r`Name;
m019(1,4)
> r`Homology;
[ 2, 31 ]
> r`Group;
Finitely presented group on 2 generators
Relations
  $.1 * $.2^3 * $.1 * $.2 * $.1^4 * $.2 * $.1 * $.2 * $.1^4
    * $.2 = Id($)
  $.1 * $.2 * $.1 * $.2^2 * $.1^-3 * $.2^2 = Id($)
> r`GoodCoverImage;
[
  (1, 2, 4, 6, 5, 8, 7, 9, 3),
  (1, 3, 5, 4, 7, 6, 9, 8, 2)
]
```

In [[DT03](https://docs.magma-maths.org/references.md#cite-virtualhaken)], Dunfield and Thurston note that they found 132 manifolds with positive Betti number. We find them in the database as those records where the `Degree` is 1. We then search the database for one of these, but by name. Both searches use the facility to iterate over the database that was mentioned above.

```magma
> D := ManifoldDatabase();
> pos_betti := {r`Name:r in D|r`Degree eq 1};
> #pos_betti;
132
> Random(pos_betti);
s527(-5,1)
> exists(r){r:r in D|r`Name eq "s527(-5,1)"};
true
> F := r`Group; F;
Finitely presented group F on 2 generators
Relations
  F.1^2 * F.2^2 * F.1^2 * F.2^-1 * F.1^2 * F.2^2 * F.1^2 *
  F.2^2 * F.1^-1 * F.2^2 = Id(F)
  F.1^2 * F.2^2 * F.1^2 * F.2 * F.1^2 * F.2^2 * F.1^2 * F.2
  * F.1^2 * F.2^2 * F.1^2 * F.2 * F.1^2 * F.2^2 * F.1^2 *
  F.2 * F.1^2 * F.2^2 * F.1^2 * F.2 * F.1^2 * F.2^2 * F.1^2
  * F.2^2 * F.1^-3 * F.2^2 = Id(F)
> AbelianQuotientInvariants(F);
[ 7, 0 ]
> r`Homology;
[ 0, 7 ]
```

As expected, we see that the fundamental group has infinite abelianization.

<a id="automatic-group-database"></a>
<a id="sectautomaticgroup"></a>
### Automatic Groups of 3-Manifolds

This database contains automatic groups for 5,389 of the 10,986 small-volume closed hyperbolic manifolds in the Hodgson–Weeks census.

<a id="function-automaticgroup-rngintelt"></a>
#### `AutomaticGroup(i): RngIntElt -> GrpAtc`

<a id="function-automaticgroup-monstgelt"></a>
#### `AutomaticGroup(name): MonStgElt -> GrpAtc`

<a id="function-automaticgroup-rec"></a>
#### `AutomaticGroup(r): Rec -> GrpAtc`

Returns the automatic group associated with the specified hyperbolic manifold, if present in the database. The manifold may be specified as an index $i$ ($1 \le i \le 5800$), a name from the Hodgson–Weeks census, or a record from the manifold database (as described in Section [Fundamental Groups of 3-Manifolds](https://docs.magma-maths.org/FiniteGroups/DatabasesOfGroups/3-manifolds-database.md#sectthreemanifolds)).

<a id="function-automaticgroupindices"></a>
#### `AutomaticGroupIndices() -> [RngIntElt]`

Returns a sequence of the valid indices for use with `AutomaticGroup`.

<a id="function-automaticgroupnames"></a>
#### `AutomaticGroupNames() -> [MonStgElt]`

Returns a sequence of the valid names for use with `AutomaticGroup`.

<a id="grp-auto"></a>
<a id="chapgrpauto"></a>
## Automorphism Groups

- [Introduction](https://docs.magma-maths.org/FiniteGroups/AutomorphismGroups/introduction.md)
- [Creation of Automorphism Groups](https://docs.magma-maths.org/FiniteGroups/AutomorphismGroups/creation.md)
  - [`AutomorphismGroup(G): Grp → GrpAuto`](https://docs.magma-maths.org/FiniteGroups/AutomorphismGroups/creation.md#function-automorphismgroup-grp)
  - [Example: Automorphisms of a Non-Soluble Matrix Group](https://docs.magma-maths.org/FiniteGroups/AutomorphismGroups/creation.md#example-ex-1ac639)
  - [`AutomorphismGroup(G, Q, I): Grp, SeqEnum[GrpElt], SeqEnum[SeqEnum[GrpElt]] → GrpAuto`](https://docs.magma-maths.org/FiniteGroups/AutomorphismGroups/creation.md#function-automorphismgroup-grp-seqenum-grpelt-seqenum-seqenum-grpelt)
- [Access Functions](https://docs.magma-maths.org/FiniteGroups/AutomorphismGroups/access.md)
  - [`Group(A): GrpAuto → Grp`](https://docs.magma-maths.org/FiniteGroups/AutomorphismGroups/access.md#function-group-grpauto)
  - [`NumberOfGenerators(A): GrpAuto → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/AutomorphismGroups/access.md#function-numberofgenerators-grpauto)
  - [`Ngens(A): GrpAuto → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/AutomorphismGroups/access.md#function-ngens-grpauto)
  - [`NumberOfPCGenerators(A): GrpAuto → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/AutomorphismGroups/access.md#function-numberofpcgenerators-grpauto)
  - [`NPCGenerators(A): GrpAuto → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/AutomorphismGroups/access.md#function-npcgenerators-grpauto)
  - [`NPCgens(A): GrpAuto → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/AutomorphismGroups/access.md#function-npcgens-grpauto)
  - [`Generators(A): GrpAuto → SetEnum`](https://docs.magma-maths.org/FiniteGroups/AutomorphismGroups/access.md#function-generators-grpauto)
  - [`PCGenerators(A): GrpAuto → SetIndx`](https://docs.magma-maths.org/FiniteGroups/AutomorphismGroups/access.md#function-pcgenerators-grpauto)
  - [`InnerGenerators(A): GrpAuto → SeqEnum`](https://docs.magma-maths.org/FiniteGroups/AutomorphismGroups/access.md#function-innergenerators-grpauto)
  - [`CharacteristicSeries(A): GrpAuto → SeqEnum`](https://docs.magma-maths.org/FiniteGroups/AutomorphismGroups/access.md#function-characteristicseries-grpauto)
  - [`IsSoluble(A): GrpAuto → BoolElt`](https://docs.magma-maths.org/FiniteGroups/AutomorphismGroups/access.md#function-issoluble-grpauto)
  - [`IsSolvable(A): GrpAuto → BoolElt`](https://docs.magma-maths.org/FiniteGroups/AutomorphismGroups/access.md#function-issolvable-grpauto)
  - [`IsSolubleAutomorphismGroupPGroup(A): GrpAuto → BoolElt`](https://docs.magma-maths.org/FiniteGroups/AutomorphismGroups/access.md#function-issolubleautomorphismgrouppgroup-grpauto)
  - [`IsSolvableAutomorphismGroupPGroup(A): GrpAuto → BoolElt`](https://docs.magma-maths.org/FiniteGroups/AutomorphismGroups/access.md#function-issolvableautomorphismgrouppgroup-grpauto)
- [Order Functions](https://docs.magma-maths.org/FiniteGroups/AutomorphismGroups/order.md)
  - [`Order(A): GrpAuto → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/AutomorphismGroups/order.md#function-order-grpauto)
  - [`# A: GrpAuto → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/AutomorphismGroups/order.md#operation-operation-grpauto-rngintelt)
  - [`FactoredOrder(A): GrpAuto → [ <RngIntElt, RngIntElt> ]`](https://docs.magma-maths.org/FiniteGroups/AutomorphismGroups/order.md#function-factoredorder-grpauto)
  - [`OuterOrder(A): GrpAuto → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/AutomorphismGroups/order.md#function-outerorder-grpauto)
  - [Example: Automorphism Group of PGL(2, 9)](https://docs.magma-maths.org/FiniteGroups/AutomorphismGroups/order.md#example-ex-829895)
- [Representations of an Automorphism Group](https://docs.magma-maths.org/FiniteGroups/AutomorphismGroups/representations.md)
  - [`PermutationRepresentation(A): GrpAuto → Map, GrpPerm, SetIndx`](https://docs.magma-maths.org/FiniteGroups/AutomorphismGroups/representations.md#function-permutationrepresentation-grpauto)
  - [`PermutationGroup(A): GrpAuto → GrpPerm`](https://docs.magma-maths.org/FiniteGroups/AutomorphismGroups/representations.md#function-permutationgroup-grpauto)
  - [`PermutationSupport(A): GrpAuto → SetIndx`](https://docs.magma-maths.org/FiniteGroups/AutomorphismGroups/representations.md#function-permutationsupport-grpauto)
  - [`PCGroupAutomorphismGroupPGroup(A): GrpAuto → BoolElt, Map, GrpPC`](https://docs.magma-maths.org/FiniteGroups/AutomorphismGroups/representations.md#function-pcgroupautomorphismgrouppgroup-grpauto)
  - [`FPGroup(A): GrpAuto → GrpFP, Map`](https://docs.magma-maths.org/FiniteGroups/AutomorphismGroups/representations.md#function-fpgroup-grpauto)
  - [`OuterFPGroup(A): GrpAuto → GrpFP, Map`](https://docs.magma-maths.org/FiniteGroups/AutomorphismGroups/representations.md#function-outerfpgroup-grpauto)
  - [Example: Permutation Representation and Presentation](https://docs.magma-maths.org/FiniteGroups/AutomorphismGroups/representations.md#example-ex-194f40)
  - [Example: Automorphisms of the Higman-Sims Group](https://docs.magma-maths.org/FiniteGroups/AutomorphismGroups/representations.md#example-ex-a8dd10)
- [Automorphisms](https://docs.magma-maths.org/FiniteGroups/AutomorphismGroups/element.md)
  - [`A . i: GrpAuto, RngIntElt → GrpAutoElt`](https://docs.magma-maths.org/FiniteGroups/AutomorphismGroups/element.md#operation-operation-grpauto-rngintelt-grpautoelt)
  - [`Identity(A): GrpAuto → GrpAutoElt`](https://docs.magma-maths.org/FiniteGroups/AutomorphismGroups/element.md#function-identity-grpauto)
  - [`Id(A): GrpAuto → GrpAutoElt`](https://docs.magma-maths.org/FiniteGroups/AutomorphismGroups/element.md#function-id-grpauto)
  - [`A ! 1: GrpAuto, RngIntElt → GrpAutoElt`](https://docs.magma-maths.org/FiniteGroups/AutomorphismGroups/element.md#operation-op-grpauto-rngintelt)
  - [`A ! f: GrpAuto, Map → GrpAutoElt`](https://docs.magma-maths.org/FiniteGroups/AutomorphismGroups/element.md#operation-op-grpauto-map)
  - [`Order(f): GrpAutoElt → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/AutomorphismGroups/element.md#function-order-grpautoelt)
  - [`f * g: GrpAutoElt, GrpAutoElt → GrpAutoElt`](https://docs.magma-maths.org/FiniteGroups/AutomorphismGroups/element.md#operation-op-times-grpautoelt-grpautoelt)
  - [`f ^ n: GrpAutoElt, RngIntElt → GrpAutoElt`](https://docs.magma-maths.org/FiniteGroups/AutomorphismGroups/element.md#operation-op-pow-grpautoelt-rngintelt)
  - [`(g₁, ..., gᵣ): GrpAutoElt, ..., GrpAutoElt → GrpAutoElt`](https://docs.magma-maths.org/FiniteGroups/AutomorphismGroups/element.md#literal-literal-g1-gr-grpautoelt-grpautoelt-grpautoelt)
  - [`g eq h: GrpAutoElt, GrpAutoElt → BoolElt`](https://docs.magma-maths.org/FiniteGroups/AutomorphismGroups/element.md#operation-op-eq-grpautoelt-grpautoelt)
  - [`g ne h: GrpAutoElt, GrpAutoElt → BoolElt`](https://docs.magma-maths.org/FiniteGroups/AutomorphismGroups/element.md#operation-op-ne-grpautoelt-grpautoelt)
  - [`IsInner(f): GrpAutoElt → BoolElt, GrpElt`](https://docs.magma-maths.org/FiniteGroups/AutomorphismGroups/element.md#function-isinner-grpautoelt)
  - [Example: Arithmetic with Automorphisms](https://docs.magma-maths.org/FiniteGroups/AutomorphismGroups/element.md#example-ex-4eb08f)
  - [Example: Characteristic Subgroups](https://docs.magma-maths.org/FiniteGroups/AutomorphismGroups/element.md#example-ex-4a4c20)
- [Stored Attributes of an Automorphism Group](https://docs.magma-maths.org/FiniteGroups/AutomorphismGroups/attributes.md)
  - [`HasAttribute(A, s): GrpAuto, MonStgElt → BoolElt, .`](https://docs.magma-maths.org/FiniteGroups/AutomorphismGroups/attributes.md#function-hasattribute-grpauto-monstgelt)
  - [`AssertAttribute(A, s, v): GrpAuto, MonStgElt, .`](https://docs.magma-maths.org/FiniteGroups/AutomorphismGroups/attributes.md#procedure-assertattribute-grpauto-monstgelt)
  - [Example: Automorphisms of a Group of Order 904](https://docs.magma-maths.org/FiniteGroups/AutomorphismGroups/attributes.md#example-ex-0cc28f)
  - [Example: Outer Automorphism Group of A6](https://docs.magma-maths.org/FiniteGroups/AutomorphismGroups/attributes.md#example-ex-531b03)
- [Holomorphs](https://docs.magma-maths.org/FiniteGroups/AutomorphismGroups/holomorphs.md)
  - [`Holomorph(G): Grp → GrpPerm, HomGrp, HomGrp`](https://docs.magma-maths.org/FiniteGroups/AutomorphismGroups/holomorphs.md#function-holomorph-grp)
  - [`Holomorph(GrpFP, G): Grp → Cat[GrpFP], GrpFP, HomGrp, HomGrp`](https://docs.magma-maths.org/FiniteGroups/AutomorphismGroups/holomorphs.md#function-holomorph-grp-2)
  - [`Holomorph(G, A): Grp, GrpAuto → GrpPerm, HomGrp, HomGrp`](https://docs.magma-maths.org/FiniteGroups/AutomorphismGroups/holomorphs.md#function-holomorph-grp-grpauto)
  - [`Holomorph(GrpFP, G, A): Cat[GrpFP], Grp, GrpAuto → GrpFP, HomGrp, HomGrp`](https://docs.magma-maths.org/FiniteGroups/AutomorphismGroups/holomorphs.md#function-holomorph-cat-grpfp-grp-grpauto)
  - [Example: Holomorph of PGL(2, 9)](https://docs.magma-maths.org/FiniteGroups/AutomorphismGroups/holomorphs.md#example-ex-fba5ab)
- [Bibliography](https://docs.magma-maths.org/FiniteGroups/AutomorphismGroups/bibliography.md)

### Introduction

Magma provides facilities for constructing and working with automorphism groups of various objects. In this chapter we describe the machinery provided in Magma for groups of automorphisms in the case of groups.

An *automorphism* of a group $G$ is a bijective homomorphism from $G$ to itself. The set of all automorphisms of $G$ forms a group $U$ known as the *automorphism group* of $G$. A subgroup $A$ of $U$ will be referred to as a *group of automorphisms* of $G$. The group $G$ is called the *base group* of a group of automorphisms $A$ and we say that $A$ acts on $G$. Each Magma automorphism group $A$ stores, as part of its data structure, a generating set for its base group, and each automorphism of $A$ is described by its action on these generators.

The full group of automorphisms may be found using an algorithm that proceeds as follows: A series of characteristic subgroups

$$
1 = N_r < N_{r-1} < \ldots < N_1=L < G
$$

is constructed for the given group $G$, such that each $N_i/N_{i+1}$ is elementary abelian and such that $G/L$ has no non-trivial soluble normal subgroup. The automorphism group is found for each of the associated factor groups of $G$, starting with the top factor $G/L$ and lifting through each layer $N_i/N_{i+1}$ in turn, until we finally have the automorphism group for $G$ itself. The general algorithm for a non-soluble group is described in Cannon and Holt [[CH03](https://docs.magma-maths.org/references.md#cite-autos-permg)]. More specialised versions are described by Eick, Leedham-Green, and O’Brien [[ELGO02](https://docs.magma-maths.org/references.md#cite-elo-auts)] ($p$-groups) and Smith [[Smi94](https://docs.magma-maths.org/references.md#cite-smith-thesis)] (soluble groups). This general class of algorithms will be referred to collectively as *lifting algorithms*.

When $G$ is a non-soluble permutation or matrix group, the algorithm relies on a database of automorphism groups for the non-cyclic simple factors of $G$, hence the non-abelian composition factors of $G$ must belong to a restricted list. In V2.20 this list includes all simple groups of order at most $1.6\times10^7$, the alternating groups of degree at most $2499$, $L_2(q)$, $L_3(q)$, $L_4(q)$, $L_5(q)$, $L_6(q)$ and $L_7(q)$ for all $q$, $U_3(q)$ for all $q$, $U_4(q)$ for all $q$, $S_4(q)$ for all $q$, $L_d(2)$ for $d \le 14$, and the following groups: $U_5(3)$, $U_6(2)$, $U_7(2)$, $U_8(2)$, $S_6(3)$, $S_6(4)$, $S_6(5)$, $S_8(2)$, $S_8(3)$, $S_{10}(2)$, $S_{12}(2)$, $O^\pm_8(2)$, $O^\pm_8(3)$, $O^\pm_8(4)$, $O^\pm_{10}(2)$, $O^\pm_{12}(2)$, $O_7(3)$, $O_7(5)$, $O_9(3)$, $G_2(4)$, $G_2(5)$, ${}^3D_4(2)$, ${}^2F_4(2)'$, $Co_2$, $Co_3$, $He$, $Fi_{22}$, $Ru$, $Suz$, $ON$. The list is being extended regularly.

An automorphism group $A$ of $G$ is represented as a set of homomorphisms of $G$ into itself. We shall refer to this as the mappings representation of $A$. The full automorphism group is also returned as a finitely presented group and, in addition, it is also possible to construct a permutation representation of the automorphism.

The family of all groups of automorphisms forms a category. The objects are the automorphism groups and the morphisms are group homomorphisms. The Magma designation for this category of automorphism groups is `GrpAuto`.

### Creation of Automorphism Groups

An automorphism group of the finite group $G$ may be created in one of two ways. Firstly, the full automorphism group of $G$ may be constructed by invoking an appropriate lifting algorithm. Secondly, an arbitrary group of automorphisms $A$ of $G$ may be created by giving a set of generators for $A$ defined in terms of their action on a set of generators for $G$.

<a id="function-automorphismgroup-grp"></a>
#### `AutomorphismGroup(G): Grp -> GrpAuto`

```magma
SmallOuterAutGroup: RngIntElt                    Default: 20000
Print             : RngIntElt                    Default: 0
PrintSearchCount  : RngIntElt                    Default: 1000
```

Given a finite group $G$, construct the full automorphism group $F$ of $G$. The group $G$ may be a permutation group, a (finite) matrix group or a finite soluble group given by a pc-presentation. The function returns the full automorphism group of $G$ as a group of mappings (i.e., as a group of type `GrpAuto`). If $G$ is a permutation or matrix group, then the automorphism group $F$ is also computed as a finitely presented group and can be accessed via the function `FPGroup(F)`. A function `PermutationRepresentation` is provided that when applied to $F$ attempts to construct a faithful permutation representation of reasonable degree (see below).

`SmallOuterAutGroup := t`: Specify the strategy for the backtrack search when testing an automorphism for lifting to the next layer. If the outer automorphism group $O$ at the previous level has order at most $t$, then the regular representation of $O$ is used, otherwise the program tries to find a smaller degree permutation representation of $O$.

The level of verbose printing. The possible values are 0, 1, 2, or 3.

`PrintSearchCount := s`: If `Print := 3`, then a message is printed at each $s$-th iteration during the backtrack search for lifting automorphisms.

In the case of a non-soluble group, the algorithm described in Cannon and Holt [[CH03](https://docs.magma-maths.org/references.md#cite-autos-permg)] is used. If $G$ is a $p$-group of type [`GrpPC`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/index-finite-soluble-groups.md#chapgrppc) the algorithm described in Eick, Leedham-Green, and O’Brien [[ELGO02](https://docs.magma-maths.org/references.md#cite-elo-auts)] is used. For more details see Section [$p$-group](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/automorphism-group.md#pgrp-auto). If $G$ is of type [`GrpPC`](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/index-finite-soluble-groups.md#chapgrppc) but is not a $p$-group, the algorithm of Smith [[Smi94](https://docs.magma-maths.org/references.md#cite-smith-thesis)], as extended by Smith and Slattery, is used. For more details see Section [Automorphism Group](https://docs.magma-maths.org/FiniteGroups/FiniteSolubleGroups/automorphism-group.md#solgrp-auto).

When $G$ is a non-soluble permutation or matrix group, the algorithm relies on a database of automorphism groups for the non-cyclic simple factors of $G$, hence the non-abelian composition factors of $G$ must belong to a restricted list. In V2.11 this list includes all simple groups of order at most $1.6\times10^7$, the alternating groups of degree at most $1000$, all groups from several generic families, including $PSL(2, q)$, $PSL(3, q)$, $PSL(4, p)$, $PSL(5, p)$, $PSU(3, p)$ and $PSp(4, p)$ and the sporadic groups $M_{11}$, $M_{12}$, $M_{22}$, $M_{23}$, $M_{24}$, $J_1$, $J_2$, $J_3$, $HS$, $McL$, $Co3$, $He$, and others. The list is being extended regularly.

<a id="example-ex-1ac639"></a>
#### `Example: Automorphisms of a Non-Soluble Matrix Group (ex-1ac639)`

We create a non-soluble group $G$ of $4 \times 4$ matrices defined over the field of $8$-th roots of unity and construct its automorphism group.

```magma
> L<zeta_8> := CyclotomicField(8);
> i := -zeta_8^2;
> t := zeta_8^3;
> G := MatrixGroup< 4, L |
>            [ 1/2, 1/2, 1/2, 1/2,
>              1/2,-1/2, 1/2,-1/2,
>              1/2, 1/2,-1/2,-1/2,
>              1/2,-1/2,-1/2, 1/2 ],
>            DiagonalMatrix( [1,1,1,-1] ),
>            DiagonalMatrix( [1,i,1,i] ),
>            DiagonalMatrix( [t,t,t,t] ) >;
> Order(G);
92160
> CompositionFactors(G);
    G
    |  Cyclic(2)
    *
    |  Alternating(6)
    *
    |  Cyclic(2)
    *
    |  Cyclic(2)
    *
    |  Cyclic(2)
    *
    |  Cyclic(2)
    *
    |  Cyclic(2)
    *
    |  Cyclic(2)
    *
    |  Cyclic(2)
    1
> A := AutomorphismGroup(G);
> Order(A);
92160
```

<a id="function-automorphismgroup-grp-seqenum-grpelt-seqenum-seqenum-grpelt"></a>
#### `AutomorphismGroup(G, Q, I): Grp, SeqEnum[GrpElt], SeqEnum[SeqEnum[GrpElt]] -> GrpAuto`

Let $G$ be a finite group and let $Q$ be a sequence of elements which generate $G$. Let $\phi_1, \ldots, \phi_r$ be a sequence of automorphisms of $G$ that generate the group of automorphisms $A$. The group $A$ is specified by a sequence $I$ of length $r$ where the $i$-th term of $I$ defines $\phi_i$ in terms of a sequence containing the images of the elements of $Q$ under the action of $\phi_i$. The function returns the group of automorphisms $A$ of $G$.

### Access Functions

The functions described here provide access to basic information stored for an automorphism group $A$.

<a id="function-group-grpauto"></a>
#### `Group(A): GrpAuto -> Grp`

Given a group of automorphisms $A$ of the group $G$, return the base group $G$ on which $A$ acts.

<a id="function-numberofgenerators-grpauto"></a>
#### `NumberOfGenerators(A): GrpAuto -> RngIntElt`

<a id="function-ngens-grpauto"></a>
#### `Ngens(A): GrpAuto -> RngIntElt`

Given a group of automorphisms $A$ of the group $G$, return the number of defining generators for $A$.

<a id="function-numberofpcgenerators-grpauto"></a>
#### `NumberOfPCGenerators(A): GrpAuto -> RngIntElt`

<a id="function-npcgenerators-grpauto"></a>
#### `NPCGenerators(A): GrpAuto -> RngIntElt`

<a id="function-npcgens-grpauto"></a>
#### `NPCgens(A): GrpAuto -> RngIntElt`

Given a group of automorphisms $A$ of the group $G$, where a pc-representation has been created for $A$ (and attribute `PCGenerators` is set on $A$), return the number of pc-generators for $A$.

<a id="function-generators-grpauto"></a>
#### `Generators(A): GrpAuto -> SetEnum`

Given a group of automorphisms $A$ of the group $G$, return a set containing the defining generators of $A$.

<a id="function-pcgenerators-grpauto"></a>
#### `PCGenerators(A): GrpAuto -> SetIndx`

Given a group of automorphisms $A$ of the group $G$, where a pc-representation has been created for $A$ (and attribute `PCGenerators` is set on $A$), return an indexed set containing the pc-generators of $A$.

<a id="function-innergenerators-grpauto"></a>
#### `InnerGenerators(A): GrpAuto -> SeqEnum`

Given the full group of automorphisms $A$ of the group $G$, return a sequence of generators for the inner automorphism group of the base group of $A$ (attribute `InnerGenerators`), if this attribute has been set.

<a id="function-characteristicseries-grpauto"></a>
#### `CharacteristicSeries(A): GrpAuto -> SeqEnum`

Given a group of automorphisms $A$ of the group $G$, return the value of the characteristic series of $G$ used to compute $A$, if this attribute has been set.

<a id="function-issoluble-grpauto"></a>
#### `IsSoluble(A): GrpAuto -> BoolElt`

<a id="function-issolvable-grpauto"></a>
#### `IsSolvable(A): GrpAuto -> BoolElt`

Given a group of automorphisms $A$ of the group $G$, return the value of $A$’s attribute `Soluble`, if this attribute has been set.

<a id="function-issolubleautomorphismgrouppgroup-grpauto"></a>
#### `IsSolubleAutomorphismGroupPGroup(A): GrpAuto -> BoolElt`

<a id="function-issolvableautomorphismgrouppgroup-grpauto"></a>
#### `IsSolvableAutomorphismGroupPGroup(A): GrpAuto -> BoolElt`

Given a group of automorphisms $A$ of a $p$-group $G$ constructed using the intrinsic `AutomorphismGroup(G)` or any equivalent alias, determine if $A$ is soluble and return the result. This function also sets the `Soluble` attribute on $A$.

### Order Functions

Unless the order is already known, each of the functions in this family will create a faithful permutation representation of the group of automorphisms in order to compute the order.

<a id="function-order-grpauto"></a>
#### `Order(A): GrpAuto -> RngIntElt`

<a id="operation-operation-grpauto-rngintelt"></a>
#### `# A: GrpAuto -> RngIntElt`

The order of the group of automorphisms $A$, returned as an integer. If not already known, this function will create a permutation representation for $A$.

<a id="function-factoredorder-grpauto"></a>
#### `FactoredOrder(A): GrpAuto -> [ <RngIntElt, RngIntElt> ]`

The factored order of the group of automorphisms $A$. If not already known, this function will create a permutation representation for $A$.

<a id="function-outerorder-grpauto"></a>
#### `OuterOrder(A): GrpAuto -> RngIntElt`

The order of the outer automorphism group associated with the group of automorphisms $A$.

<a id="example-ex-829895"></a>
#### `Example: Automorphism Group of PGL(2, 9) (ex-829895)`

We create the non-soluble group $G = PGL(2, 9)$ and examine the properties of its automorphism group.

```magma
> G := PGL(2, 9);
> A := AutomorphismGroup(G);
> A;
A group of automorphisms of GrpPerm: G, Degree 10, Order 2^4 * 3^2 * 5
Generators:
    Automorphism of GrpPerm: G, Degree 10, Order 2^4 * 3^2 * 5 which maps:
        (3, 5, 9, 6, 7, 4, 8, 10) |--> (1, 7, 3, 5, 4, 2, 10, 9)
        (1, 8, 2)(3, 4, 5)(6, 10, 7) |--> (1, 6, 8)(2, 7, 10)(3, 9, 5)
    Automorphism of GrpPerm: G, Degree 10, Order 2^4 * 3^2 * 5 which maps:
        (3, 5, 9, 6, 7, 4, 8, 10) |--> (1, 4, 6, 10, 7, 8, 5, 9)
        (1, 8, 2)(3, 4, 5)(6, 10, 7) |--> (1, 9, 10)(2, 6, 3)(4, 8, 7)
    Automorphism of GrpPerm: G, Degree 10, Order 2^4 * 3^2 * 5 which maps:
        (3, 5, 9, 6, 7, 4, 8, 10) |--> (3, 5, 9, 6, 7, 4, 8, 10)
        (1, 8, 2)(3, 4, 5)(6, 10, 7) |--> (1, 10, 2)(3, 4, 7)(5, 8, 9)
    Automorphism of GrpPerm: G, Degree 10, Order 2^4 * 3^2 * 5 which maps:
        (3, 5, 9, 6, 7, 4, 8, 10) |--> (1, 10, 3, 5, 2, 4, 7, 6)
        (1, 8, 2)(3, 4, 5)(6, 10, 7) |--> (1, 6, 2)(3, 7, 5)(4, 9, 8)
> #A;
1440
> FactoredOrder(A);
[ <2, 5>, <3, 2>, <5, 1> ]
> OuterOrder(A);
2
> InnerGenerators(A);
[
    Automorphism of GrpPerm: G, Degree 10, Order 2^4 * 3^2 * 5 which maps:
        (3, 5, 9, 6, 7, 4, 8, 10) |--> (1, 7, 3, 5, 4, 2, 10, 9)
        (1, 8, 2)(3, 4, 5)(6, 10, 7) |--> (1, 6, 8)(2, 7, 10)(3, 9, 5),
    Automorphism of GrpPerm: G, Degree 10, Order 2^4 * 3^2 * 5 which maps:
        (3, 5, 9, 6, 7, 4, 8, 10) |--> (1, 4, 6, 10, 7, 8, 5, 9)
        (1, 8, 2)(3, 4, 5)(6, 10, 7) |--> (1, 9, 10)(2, 6, 3)(4, 8, 7),
    Automorphism of GrpPerm: G, Degree 10, Order 2^4 * 3^2 * 5 which maps:
        (3, 5, 9, 6, 7, 4, 8, 10) |--> (3, 5, 9, 6, 7, 4, 8, 10)
        (1, 8, 2)(3, 4, 5)(6, 10, 7) |--> (1, 10, 2)(3, 4, 7)(5, 8, 9)
]
> CharacteristicSeries(A);
[
    Permutation group G acting on a set of cardinality 10
    Order = 720 = 2^4 * 3^2 * 5
        (3, 5, 9, 6, 7, 4, 8, 10)
        (1, 8, 2)(3, 4, 5)(6, 10, 7),
    Permutation group acting on a set of cardinality 10
    Order = 1
]
```

### Representations of an Automorphism Group

To compute with automorphism groups, Magma uses various concrete representations of the group. These are summarised in this section.

<a id="function-permutationrepresentation-grpauto"></a>
#### `PermutationRepresentation(A): GrpAuto -> Map, GrpPerm, SetIndx`

Construct a permutation representation of the group of automorphisms $A$. The function finds a union of conjugacy classes of the base group $G$ which is closed under the action of $A$ and with $G$-normal closure equal to $G$. The permutation action of $A$ on such a set is faithful. The results returned are the representation of $A$ as a homomorphism $A \to P$, the image of this homomorphism as a permutation group with standard support, and the set of elements of $G$ used.

<a id="function-permutationgroup-grpauto"></a>
#### `PermutationGroup(A): GrpAuto -> GrpPerm`

Given a group of automorphisms $A$ of a group $G$, this function returns a permutation group isomorphic to $A$ as defined in the description of the function `PermutationRepresentation`.

<a id="function-permutationsupport-grpauto"></a>
#### `PermutationSupport(A): GrpAuto -> SetIndx`

Given a group of automorphisms $A$ of a group $G$, this function returns the set of elements of $G$ (i.e., a union of conjugacy classes) used as the support of the permutation group constructed by the `PermutationRepresentation` function.

<a id="function-pcgroupautomorphismgrouppgroup-grpauto"></a>
#### `PCGroupAutomorphismGroupPGroup(A): GrpAuto -> BoolElt, Map, GrpPC`

Attempt to directly construct a pc-representation for the group of automorphisms $A$ of a conditioned p-group $G$. $A$ must have been constructing using the `AutomorphismGroup` intrinsic, or any equivalent alias. The results returned are a boolean value indicating the solubility of $A$, and if soluble, a representation of $A$ as a homomorphism $A \to P$ and the image of this homomorphism as a pc-group.

<a id="function-fpgroup-grpauto"></a>
#### `FPGroup(A): GrpAuto -> GrpFP, Map`

A presentation for the group of automorphisms $A$ on the generators of $A$. The isomorphism from the finitely presented group to the group of automorphisms $A$ is also returned.

<a id="function-outerfpgroup-grpauto"></a>
#### `OuterFPGroup(A): GrpAuto -> GrpFP, Map`

Suppose that $A$ is the full group of automorphisms of a group $G$. This function returns a finitely presented group $O$ isomorphic to the outer automorphism group of the base group $G$. The natural homomorphism from `FPGroup(A)` onto $O$ is also returned.

<a id="example-ex-194f40"></a>
#### `Example: Permutation Representation and Presentation (ex-194f40)`

We calculate a permutation representation and presentation for the group of automorphisms of $PSL(2, 9)$.

```magma
> G := PGL(2, 9);
> A := AutomorphismGroup(G);
> PermutationGroup(A);
Permutation group acting on a set of cardinality 36
Order = 1440 = 2^5 * 3^2 * 5
    (1, 30)(3, 27)(5, 17)(6, 24)(8, 9)(10, 14)(11, 13)(12, 32) (15, 34)(16, 21)
       (18, 25)(19, 28)(22, 29)(23, 31)(26, 33)(35, 36)
    (1, 32, 19, 22)(2, 34)(3, 18, 7, 17)(4, 25, 30, 31) (5, 23, 33, 24)
       (6, 15, 26, 21)(8, 16, 29, 20)(9, 35, 14, 27) (10, 13, 11, 12)(28, 36)
    (1, 2, 3, 5, 8, 13, 22, 31)(4, 7, 9, 15, 24, 26, 34, 29)
       (6, 10, 17, 23, 32, 33, 28, 35)(11, 19, 27, 16, 25, 21, 30, 36)
       (12, 20, 14, 18)
    (1, 32, 33, 12, 21, 6)(2, 34, 26, 35, 17, 16)(3, 28, 22, 7, 18, 13)
       (4, 31, 20, 29, 24, 11)(5, 19, 25, 10, 15, 8)(9, 30, 36, 14, 23, 27)
> F<x, y, z, t> := FPGroup(A);
> F;
Finitely presented group F on 4 generators
Relations
    x^2 = Id(F)
    y^4 = Id(F)
    (x * y^-1)^5 = Id(F)
    y^-2 * x * y^-2 * x * y^-2 * x * y^2 * x * y^2 * x = Id(F)
    z^-1 * x * z * y^-1 * x^-1 * y^-2 * x^-1 * y * x^-1 *
       y^-2 * x^-1 * y * x^-1 * y^-1 * x^-1 = Id(F)
    z^-1 * y * z * y * x^-1 * y * x^-1 * y^-1 * x^-1 = Id(F)
    z^2 * y^-1 * x^-1 * y * x^-1 * y^-1 * x^-1 = Id(F)
    x^t = y * x * y^-1
    y^t = y^-1 * x * y * x * y
    z^t = z * x * y^-1 * x
    t^2 = x * y^2 * x * y^-1 * x * y
```

<a id="example-ex-a8dd10"></a>
#### `Example: Automorphisms of the Higman-Sims Group (ex-a8dd10)`

We illustrate the process of finding a low degree permutation representation of an automorphism group using the above functions. We start with the Higman-Sims sporadic simple group, construct its automorphism group, and then use the function `PermutationGroup` to obtain a permutation representation.

```magma
> load hs100;
Loading "/home/magma/libs/pergps/hs100"
The simple group of Higman-Sims represented as a
permutation group of degree 100.
Order: 44 352 000 = 2^9 * 3^2 * 5^3 * 7 * 11.
Base: 1, 2, 3, 4, 5, 6.
Group: G
> aut := AutomorphismGroup(G);
> P := PermutationGroup(aut);
> P;
Permutation group P acting on a set of cardinality 5775
Order = 88704000 = 2^10 * 3^2 * 5^3 * 7 * 11
```

We’ve got a permutation representation on 5775 letters. Now we want to get it on 100 letters, so we need to find the subgroup of index 100.

```magma
> lix := LowIndexSubgroups(P, 100);
> [ Index(P, H) : H in lix];
[ 1, 2, 100 ]
```

There it is, so we can compute the corresponding permutation representation.

```magma
> H := CosetImage(P, lix[3]);
> H;
Permutation group H acting on a set of cardinality 100
> CompositionFactors(H);
    G
    |  Cyclic(2)
    *
    |  HS
    1
```

### Automorphisms

The elements of a group of automorphisms are automorphisms of the base group, so Magma treats them as both homomorphisms and group elements. Thus they may be applied to elements and subgroups of the base group as a homomorphism, or they may be multiplied and have inverses taken as group elements. Of course, these last two operations are also homomorphism operations, being composition and the usual inverse of a bijection. Elements of a group of automorphisms are of type `GrpAutoElt`.

<a id="operation-operation-grpauto-rngintelt-grpautoelt"></a>
#### `A . i: GrpAuto, RngIntElt -> GrpAutoElt`

Let $A$ be a group of automorphisms of a group $G$ and let $i$ be an integer such that $-n \le i \le n$, where $n$ is the number of generators of $A$. This operator returns the $i$-th generator for $A$. A negative subscript indicates that the inverse of the generator is to be created. Finally, $A.0$ denotes the identity of $A$.

<a id="function-identity-grpauto"></a>
#### `Identity(A): GrpAuto -> GrpAutoElt`

<a id="function-id-grpauto"></a>
#### `Id(A): GrpAuto -> GrpAutoElt`

<a id="operation-op-grpauto-rngintelt"></a>
#### `A ! 1: GrpAuto, RngIntElt -> GrpAutoElt`

The identity element of the group of automorphisms $A$.

<a id="operation-op-grpauto-map"></a>
#### `A ! f: GrpAuto, Map -> GrpAutoElt`

Let $A$ be a group of automorphisms of a group $G$. Given an automorphism $f$ of $G$, represented as a Magma map, this function returns the element of $A$ corresponding to $f$. An error will result if $f$ is not in the group generated by the generators of $A$. This uses the permutation representation of $A$ to test for membership.

<a id="function-order-grpautoelt"></a>
#### `Order(f): GrpAutoElt -> RngIntElt`

The order of the group automorphism $f$.

<a id="operation-op-times-grpautoelt-grpautoelt"></a>
#### `f * g: GrpAutoElt, GrpAutoElt -> GrpAutoElt`

The product of the group automorphisms $f$ and $g$. If $f$ and $g$ are regarded as maps, this function returns their composite: first apply $f$, then apply $g$.

<a id="operation-op-pow-grpautoelt-rngintelt"></a>
#### `f ^ n: GrpAutoElt, RngIntElt -> GrpAutoElt`

The $n$th power of the group automorphism $f$. The integer $n$ may be positive or negative.

<a id="literal-literal-g1-gr-grpautoelt-grpautoelt-grpautoelt"></a>
#### `(g₁, ..., gᵣ): GrpAutoElt, ..., GrpAutoElt -> GrpAutoElt`

The left-normed commutator of the group automorphisms $g_1, \dots, g_r$. Each of $g_1, \dots, g_r$ must belong to a common automorphism group.

<a id="operation-op-eq-grpautoelt-grpautoelt"></a>
#### `g eq h: GrpAutoElt, GrpAutoElt -> BoolElt`

Given group automorphisms $g$ and $h$ belonging to the same automorphism group, return `true` if $g$ and $h$ are the same element, `false` otherwise.

<a id="operation-op-ne-grpautoelt-grpautoelt"></a>
#### `g ne h: GrpAutoElt, GrpAutoElt -> BoolElt`

Given group automorphisms $g$ and $h$ belonging to the same automorphism group, return `false` if $g$ and $h$ are the same element, `true` otherwise.

<a id="function-isinner-grpautoelt"></a>
#### `IsInner(f): GrpAutoElt -> BoolElt, GrpElt`

Returns `true` if the group automorphism $f$ is an inner automorphism of the base group, `false` otherwise. If $f$ is inner, then an element of the base group with conjugation action equal to the action of $f$ is also returned.

<a id="example-ex-4eb08f"></a>
#### `Example: Arithmetic with Automorphisms (ex-4eb08f)`

We illustrate some arithmetic operations with elements of the full group of automorphisms of a group of order $81$.

```magma
> G := SmallGroup(81, 10);
> G;
GrpPC : G of order 81 = 3^4
PC-Relations:
  G.1^3 = G.4,
  G.2^3 = G.4^2,
  G.2^G.1 = G.2 * G.3,
  G.3^G.1 = G.3 * G.4
> A := AutomorphismGroup(G);
> #A;
486
> Ngens(A);
5
> IsInner(A.3);
false
> Order(A.3);
3
> A.3;
Automorphism of GrpPC : G of order 3 which maps:
  G.1 |--> G.1
  G.2 |--> G.2 * G.4^2
  G.3 |--> G.3
  G.4 |--> G.4
> A.3*A.4;
Automorphism of GrpPC : G which maps:
  G.1 |--> G.1
  G.2 |--> G.2 * G.3 * G.4^2
  G.3 |--> G.3 * G.4
  G.4 |--> G.4
> (A.3*A.4)^3;
Automorphism of GrpPC : G which maps:
  G.1 |--> G.1
  G.2 |--> G.2
  G.3 |--> G.3
  G.4 |--> G.4
> $1 eq Id(A);
true
```

<a id="example-ex-4a4c20"></a>
#### `Example: Characteristic Subgroups (ex-4a4c20)`

We can use the automorphism group machinery to determine the characteristic subgroups of a group.

```magma
> CharacteristicSubgroups := function(G)
>    local A, outers, NS, CS;
>    A := AutomorphismGroup(G);
>    outers := [ a : a in Generators(A) | not IsInner(a) ];
>    NS := NormalSubgroups(G);
>    CS := [n : n in NS | forall{a: a in outers| a(n`subgroup) eq n`subgroup }];
>    return CS;
> end function;
>
> CS := CharacteristicSubgroups(DirectProduct(Alt(4),Alt(4)));
> [c`order: c in CS];
[ 1, 16, 144 ]
> G := SmallGroup(512,298);
> #NormalSubgroups(G);
42
> #CharacteristicSubgroups(G);
28
```

### Stored Attributes of an Automorphism Group

Groups of automorphisms have several attributes that may be stored as part of their data structure. The function `HasAttribute` is used to test if an attribute is stored and to retrieve its value, while the function `AssertAttribute` is used to set attribute values. The user is warned that when using `AssertAttribute` the data given is *not* checked for validity, apart from some simple type checks. *Setting attributes incorrectly will result in errors.*

<a id="function-hasattribute-grpauto-monstgelt"></a>
#### `HasAttribute(A, s): GrpAuto, MonStgElt -> BoolElt, .`

<a id="procedure-assertattribute-grpauto-monstgelt"></a>
#### `AssertAttribute(A, s, v): GrpAuto, MonStgElt, .`

The `HasAttribute` function returns whether the group of automorphisms $A$ has the attribute named by the string $s$ defined and, if so, also returns the value of the attribute.

The `AssertAttribute` procedure sets the attribute of the group of automorphisms group named by string $s$ to have value $v$. The possible names are:

`Group`: The base group of the automorphism group. This is always set.

`Order`: The order of the automorphism group. It is an integer and may be set by giving either an integer or a factored integer.

`OuterOrder`: The order of the outer automorphism group associated with $A$. It is an integer and may be set by giving either an integer or a factored integer.

`Soluble`: (also `Solvable`) A boolean value telling whether or not the automorphism group is soluble.

`InnerGenerators`: A sequence of generators of $A$ known to be inner automorphisms.

`InnerMap`: A homomorphism from the base group to the automorphism group taking each base group element to its corresponding inner automorphism.

`ClassAction`: Stores the result of the `PermutationRepresentation` function call.

`ClassImage`: Stores the result of the `PermutationGroup` function call.

`ClassUnion`: Stores the result of the `ClassUnion` function call.

`FpGroup`: Stores the result of the `FPGroup` function call. The attribute is a pair $\langle F, m \rangle$ where $F$ is an fp-group and $m$ is an isomorphism $m:F\to A$. $F$ and $m$ are the two return values of `FPGroup(A)`.

`OuterFpGroup`: Stores the result of the `OuterFPGroup` function call. The attribute is a pair $\langle O, f \rangle$ where $O$ is an fp-group and $f$ is an epimorphism $f:F\to O$, where $F$ is the first component of the `FpGroup` attribute. The kernel of $f$ is the inner automorphism group. $O$ and $f$ are the two return values of `OuterFPGroup(A)`.

`GenWeights`: `WeightSubgroupOrders`: See the section on automorphism groups in the chapter on soluble groups for details.

<a id="example-ex-0cc28f"></a>
#### `Example: Automorphisms of a Group of Order 904 (ex-0cc28f)`

We select a group of order 904 from the small groups database and compute its group of automorphisms.

```magma
> G := SmallGroup(904, 4);
> FactoredOrder(G);
[ <2, 3>, <113, 1> ]
> FactoredOrder(Centre(G));
[ <2, 1> ]
> A := AutomorphismGroup(G);
> FactoredOrder(A);
[ <2, 7>, <7, 1>, <113, 1> ]
> HasAttribute(A, "FpGroup");
false
> HasAttribute(A, "OuterFpGroup");
false
> F,m := FPGroup(A);
> AssertAttribute(A, "FpGroup", <F,m>);
```

Note that values for some attributes, such as `FpGroup`, have not been calculated by the original `AutomorphismGroup` call, but they may be calculated and set later if desired. The outer automorphism group has order $2^5\times 7$. We find the characteristic subgroups of `G`.

```magma
> n := NormalSubgroups(G);
> [x`order : x in n];
[ 1, 2, 113, 4, 226, 452, 452, 452, 904 ]
> characteristics := [s : x in n |
>   forall{f: f in Generators(A) | s@f eq s}
>   where s is x`subgroup];
> [#s : s in characteristics];
[ 1, 2, 113, 4, 226, 452, 904 ]
```

Note that two of the normal subgroups of order 452 are not characteristic.

<a id="example-ex-531b03"></a>
#### `Example: Outer Automorphism Group of A6 (ex-531b03)`

```magma
> G := AlternatingGroup(6);
> A := AutomorphismGroup(G);
> HasAttribute(A, "OuterFpGroup");
true
> F, f := FPGroup(A);
> O, g := OuterFPGroup(A);
> O;
Finitely presented group O on 2 generators
Relations
  O.1^2 = Id(O)
  O.2^2 = Id(O)
  (O.1 * O.2)^2 = Id(O)
> A`OuterOrder;
4
```

We find the outer automorphism group is elementary abelian of order 4. The direct product of `G` with itself has maximal subgroups isomorphic to `G`, in the form of diagonal subgroups. We can construct four non-conjugate examples using the outer automorphism group. The first example can be constructed without using an outer automorphism.

```magma
> GG, ins := DirectProduct(G, G);
> M := sub<GG|[(x@ins[1])*(x@ins[2]):x in Generators(G)]>;
> IsMaximal(GG, M);
true
```

The subgroup `M` is the first, the obvious diagonal, constructed using just the embeddings returned by the direct product function. We get others by twisting the second factor using an outer automorphism. First we get (representatives of) the outer automorphisms explicitly.

```magma
> outers := {x @@ g @ f : x in [O.1, O.2, O.1*O.2]};
> Representative(outers);
Automorphism of GrpPerm: G, Degree 6, Order 2^3 * 3^2 * 5 which maps:
  (1, 2)(3, 4, 5, 6) |--> (1, 3, 6, 2)(4, 5)
  (1, 2, 3) |--> (1, 4, 2)(3, 5, 6)
```

The set `outers` now contains three distinct outer automorphisms of `G`. We use them to get three more diagonal subgroups.

```magma
> diags := [M] cat
> [sub<GG|[(x @ ins[1])*(x @ f @ ins[2]):x in Generators(G)]>:
>   f in outers];
> [IsMaximal(GG, m) : m in diags];
[ true, true, true, true ]
> IsConjugate(GG, diags[2], diags[4]);
false
```

The other five tests for conjugacy will give similarly negative results.

### Holomorphs

Given a group $G$ and the full group of automorphisms $A$ of $G$ then the holomorph of $G$ is the semidirect product $G \times_\theta A$, where $\theta: A \rightarrow Aut(G)$ is the identity map.

<a id="function-holomorph-grp"></a>
#### `Holomorph(G): Grp -> GrpPerm, HomGrp, HomGrp`

<a id="function-holomorph-grp-2"></a>
#### `Holomorph(GrpFP, G): Grp -> Cat[GrpFP], GrpFP, HomGrp, HomGrp`

Given a finite permutation, matrix, or pc-group $G$ with full group of automorphisms $A$, this function returns the semidirect product $E$ of $G$ by $A$. The group $E$ is returned as a permutation group (or a finitely presented group if `GrpFP` is specified) of degree $|G|$ in which $G$ is a regular normal subgroup, and $A$ is the stabilizer of the point $1$. The embedding map $G \ar E$, and the natural epimorphism $E \ar A$ are also returned. In the returned group $E$, the generators of $G$ appear first, followed by those of $A$.

<a id="function-holomorph-grp-grpauto"></a>
#### `Holomorph(G, A): Grp, GrpAuto -> GrpPerm, HomGrp, HomGrp`

<a id="function-holomorph-cat-grpfp-grp-grpauto"></a>
#### `Holomorph(GrpFP, G, A): Cat[GrpFP], Grp, GrpAuto -> GrpFP, HomGrp, HomGrp`

Given a finite permutation, matrix or pc-group $G$ and a group of automorphisms $A$, this function returns the semidirect product $E$ of $G$ by $A$. The group $E$ is returned as a permutation group (or a finitely presented group if `GrpFP` is specified) of degree $|G|$ in which $G$ is a regular normal subgroup, and $A$ is the stabilizer of the point $1$. The embedding map $G \rightarrow E$, and the natural epimorphism $E \rightarrow A$ are also returned. In the returned group $E$, the generators of $G$ appear first, followed by those of $A$.

<a id="example-ex-fba5ab"></a>
#### `Example: Holomorph of PGL(2, 9) (ex-fba5ab)`

We construct the holomorph of the group $G = PGL(2, 9)$.

```magma
> G := PGL(2, 9);
> E := Holomorph(G); E;
Permutation group E acting on a set of cardinality 720
> #E;
1036800
> CompositionFactors(E);
    G
    |  Cyclic(2)
    *
    |  Cyclic(2)
    *
    |  Cyclic(2)
    *
    |  Alternating(6)
    *
    |  Alternating(6)
    1
```

<a id="cohomology"></a>
<a id="grpcohom-main"></a>
## Cohomology and Extensions

- [Introduction](https://docs.magma-maths.org/FiniteGroups/CohomologyAndExtensions/intro.md)
- [Creation of a Cohomology Module](https://docs.magma-maths.org/FiniteGroups/CohomologyAndExtensions/creation.md)
  - [`CohomologyModule(G, M): GrpPerm, ModGrp → ModCoho`](https://docs.magma-maths.org/FiniteGroups/CohomologyAndExtensions/creation.md#function-grpcoh-cohomologymodule)
  - [`CohomologyModule(G, M): GrpPC, ModGrp → ModCoho`](https://docs.magma-maths.org/FiniteGroups/CohomologyAndExtensions/creation.md#function-cohomologymodule-grppc-modgrp)
  - [`CohomologyModule(G, M): GrpMat, ModGrp → ModCoho`](https://docs.magma-maths.org/FiniteGroups/CohomologyAndExtensions/creation.md#function-cohomologymodule-grpmat-modgrp)
  - [`CohomologyModule(G, M): GrpFP, ModGrp → ModCoho`](https://docs.magma-maths.org/FiniteGroups/CohomologyAndExtensions/creation.md#function-cohomologymodule-grpfp-modgrp)
  - [`CohomologyModule(G, Q, T): GrpPerm, SeqEnum, SeqEnum → ModCoho`](https://docs.magma-maths.org/FiniteGroups/CohomologyAndExtensions/creation.md#function-cohomologymodule-grpperm-seqenum-seqenum)
  - [`CohomologyModule(G, Q, T): GrpPC, SeqEnum, SeqEnum → ModCoho`](https://docs.magma-maths.org/FiniteGroups/CohomologyAndExtensions/creation.md#function-cohomologymodule-grppc-seqenum-seqenum)
  - [`CohomologyModule(G, Q, T): GrpMat, SeqEnum, SeqEnum → ModCoho`](https://docs.magma-maths.org/FiniteGroups/CohomologyAndExtensions/creation.md#function-cohomologymodule-grpmat-seqenum-seqenum)
  - [`CohomologyModule(G, Q, T): GrpFP, SeqEnum, SeqEnum → ModCoho`](https://docs.magma-maths.org/FiniteGroups/CohomologyAndExtensions/creation.md#function-cohomologymodule-grpfp-seqenum-seqenum)
  - [Example: Cohomology Module for PSL(3, 2)](https://docs.magma-maths.org/FiniteGroups/CohomologyAndExtensions/creation.md#example-ex-8b4abf)
  - [Example: Cohomology Module for ASL(3, 5)](https://docs.magma-maths.org/FiniteGroups/CohomologyAndExtensions/creation.md#example-ex-233494)
  - [Example: Cohomology Module for a Cyclic Group](https://docs.magma-maths.org/FiniteGroups/CohomologyAndExtensions/creation.md#example-ex-0c0fe6)
  - [Example: Cohomology Module for an Infinite Group](https://docs.magma-maths.org/FiniteGroups/CohomologyAndExtensions/creation.md#example-ex-e9e40a)
  - [`CohomologyModule(G, A, M): GrpPerm, GrpAb, Any → ModCoho`](https://docs.magma-maths.org/FiniteGroups/CohomologyAndExtensions/creation.md#function-cohomologymodule-grpperm-grpab-any)
- [Accessing Properties of the Cohomology Module](https://docs.magma-maths.org/FiniteGroups/CohomologyAndExtensions/structure-invar.md)
  - [`Module(CM): ModCoho → ModGrp`](https://docs.magma-maths.org/FiniteGroups/CohomologyAndExtensions/structure-invar.md#function-module-modcoho)
  - [`Invariants(CM): ModCoho → SeqEnum`](https://docs.magma-maths.org/FiniteGroups/CohomologyAndExtensions/structure-invar.md#function-invariants-modcoho)
  - [`Dimension(CM): ModCoho → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/CohomologyAndExtensions/structure-invar.md#function-dimension-modcoho)
  - [`Ring(CM): ModCoho → ModGrp`](https://docs.magma-maths.org/FiniteGroups/CohomologyAndExtensions/structure-invar.md#function-ring-modcoho)
  - [`Group(CM): ModCoho → Grp`](https://docs.magma-maths.org/FiniteGroups/CohomologyAndExtensions/structure-invar.md#function-group-modcoho)
  - [`FPGroup(CM): ModCoho → Grp, HomGrp`](https://docs.magma-maths.org/FiniteGroups/CohomologyAndExtensions/structure-invar.md#function-fpgroup-modcoho)
  - [`MatrixOfElement(CM, g): ModCoho, GrpElt → AlgMatElt`](https://docs.magma-maths.org/FiniteGroups/CohomologyAndExtensions/structure-invar.md#function-matrixofelement-modcoho-grpelt)
  - [Example: Properties of a Cohomology Module](https://docs.magma-maths.org/FiniteGroups/CohomologyAndExtensions/structure-invar.md#example-ex-fdbfad)
- [Calculating Cohomology](https://docs.magma-maths.org/FiniteGroups/CohomologyAndExtensions/cohomology-groups.md)
  - [`CohomologyGroup(CM, n): ModCoho, RngIntElt → ModTupRng`](https://docs.magma-maths.org/FiniteGroups/CohomologyAndExtensions/cohomology-groups.md#function-cohomologygroup-modcoho-rngintelt)
  - [Example: Cohomology for a Cyclic Group of Order 4](https://docs.magma-maths.org/FiniteGroups/CohomologyAndExtensions/cohomology-groups.md#example-ex-68b620)
  - [Example: Cohomology of an Infinite FP-Group](https://docs.magma-maths.org/FiniteGroups/CohomologyAndExtensions/cohomology-groups.md#example-ex-0db52b)
  - [`CohomologicalDimension(CM, n): ModCoho, RngIntElt → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/CohomologyAndExtensions/cohomology-groups.md#function-cohomologicaldimension-modcoho-rngintelt)
  - [`CohomologicalDimension(M, n): ModGrp, RngIntElt → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/CohomologyAndExtensions/cohomology-groups.md#function-cohomologicaldimension-modgrp-n)
  - [`CohomologicalDimensions(M, n): ModGrp, RngIntElt → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/CohomologyAndExtensions/cohomology-groups.md#function-cohomologicaldimensions-modgrp-n)
  - [`CohomologicalDimension(G, M, n): GrpPerm, ModRng, RngIntElt → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/CohomologyAndExtensions/cohomology-groups.md#function-cohomologicaldimension-grpperm-modrng-rngintelt)
  - [`H1Dimension(F, f, M): GrpFP, Map, ModGrp → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/CohomologyAndExtensions/cohomology-groups.md#function-h1dimension-grpfp-map-modgrp)
  - [`H1Dimension(G, f, K): GrpFP, Map, Rng → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/CohomologyAndExtensions/cohomology-groups.md#function-h1dimension-grpfp-map-rng)
  - [`H1DimensionSymmetricSquare(G, f, K): GrpFP, Map, Rng → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/CohomologyAndExtensions/cohomology-groups.md#function-h1dimensionsymmetricsquare-grpfp-map-rng)
  - [`H1DimensionExteriorSquare(G, f, K): GrpFP, Map, Rng → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/CohomologyAndExtensions/cohomology-groups.md#function-h1dimensionexteriorsquare-grpfp-map-rng)
  - [Example: Cohomology of A8](https://docs.magma-maths.org/FiniteGroups/CohomologyAndExtensions/cohomology-groups.md#example-ex-096719)
  - [Example: Cohomology of ASL(3, 5)](https://docs.magma-maths.org/FiniteGroups/CohomologyAndExtensions/cohomology-groups.md#example-ex-46f77b)
  - [Example: Cohomology Where the Old Method Fails](https://docs.magma-maths.org/FiniteGroups/CohomologyAndExtensions/cohomology-groups.md#example-ex-023d07)
- [Cocycles](https://docs.magma-maths.org/FiniteGroups/CohomologyAndExtensions/cocycles.md)
  - [`ZeroCocycle(CM, s): ModCoho, SeqEnum → UserProgram`](https://docs.magma-maths.org/FiniteGroups/CohomologyAndExtensions/cocycles.md#function-zerococycle-modcoho-seqenum)
  - [`ZeroCocycle(CM, s): ModCoho, ModTupRngElt → UserProgram`](https://docs.magma-maths.org/FiniteGroups/CohomologyAndExtensions/cocycles.md#function-zerococycle-modcoho-modtuprngelt)
  - [`IdentifyZeroCocycle(CM, s): ModCoho, UserProgram → ModTupRngElt`](https://docs.magma-maths.org/FiniteGroups/CohomologyAndExtensions/cocycles.md#function-identifyzerococycle-modcoho-userprogram)
  - [`OneCocycle(CM, s): ModCoho, SeqEnum → UserProgram`](https://docs.magma-maths.org/FiniteGroups/CohomologyAndExtensions/cocycles.md#function-onecocycle-modcoho-seqenum)
  - [`OneCocycle(CM, s): ModCoho, ModTupRngElt → UserProgram`](https://docs.magma-maths.org/FiniteGroups/CohomologyAndExtensions/cocycles.md#function-onecocycle-modcoho-modtuprngelt)
  - [`IdentifyOneCocycle(CM, s): ModCoho, UserProgram → ModTupRngElt`](https://docs.magma-maths.org/FiniteGroups/CohomologyAndExtensions/cocycles.md#function-identifyonecocycle-modcoho-userprogram)
  - [`IsOneCoboundary(CM, s): ModCoho, UserProgram → BoolElt, UserProgram`](https://docs.magma-maths.org/FiniteGroups/CohomologyAndExtensions/cocycles.md#function-isonecoboundary-modcoho-userprogram)
  - [`TwoCocycle(CM, s): ModCoho, SeqEnum → UserProgram`](https://docs.magma-maths.org/FiniteGroups/CohomologyAndExtensions/cocycles.md#function-twococycle-modcoho-seqenum)
  - [`TwoCocycle(CM, s): ModCoho, ModTupRngElt → UserProgram`](https://docs.magma-maths.org/FiniteGroups/CohomologyAndExtensions/cocycles.md#function-twococycle-modcoho-modtuprngelt)
  - [`IdentifyTwoCocycle(CM, s): ModCoho, UserProgram → ModTupRngElt`](https://docs.magma-maths.org/FiniteGroups/CohomologyAndExtensions/cocycles.md#function-identifytwococycle-modcoho-userprogram)
  - [`IsTwoCoboundary(CM, s): ModCoho, UserProgram → BoolElt, UserProgram`](https://docs.magma-maths.org/FiniteGroups/CohomologyAndExtensions/cocycles.md#function-istwocoboundary-modcoho-userprogram)
  - [Example: Cocycles for a Cyclic Group](https://docs.magma-maths.org/FiniteGroups/CohomologyAndExtensions/cocycles.md#example-ex-d41d4c)
- [The Restriction to a Subgroup](https://docs.magma-maths.org/FiniteGroups/CohomologyAndExtensions/restriction.md)
  - [`Restriction(CM, H): ModCoho, Grp → ModCoho`](https://docs.magma-maths.org/FiniteGroups/CohomologyAndExtensions/restriction.md#function-restriction-modcoho-grp)
  - [Example: Restriction to a Sylow Subgroup](https://docs.magma-maths.org/FiniteGroups/CohomologyAndExtensions/restriction.md#example-ex-a1fddf)
- [Other Operations on Cohomology Modules](https://docs.magma-maths.org/FiniteGroups/CohomologyAndExtensions/other-operations.md)
  - [`CorestrictionMapImage(G, C, c, i): Grp, ModCoho, UserProgram, RngIntElt → UserProgram`](https://docs.magma-maths.org/FiniteGroups/CohomologyAndExtensions/other-operations.md#function-corestrictionmapimage-grp-modcoho-userprogram-rngintelt)
  - [`CorestrictCocycle(G, C, c, i): Grp, ModCoho, UserProgram, RngIntElt → UserProgram`](https://docs.magma-maths.org/FiniteGroups/CohomologyAndExtensions/other-operations.md#function-corestrictcocycle-grp-modcoho-userprogram-rngintelt)
  - [`InflationMapImage(M, c): Map, UserProgram → UserProgram`](https://docs.magma-maths.org/FiniteGroups/CohomologyAndExtensions/other-operations.md#function-inflationmapimage-map-userprogram)
  - [`LiftCocycle(M, c): Map, UserProgram → UserProgram`](https://docs.magma-maths.org/FiniteGroups/CohomologyAndExtensions/other-operations.md#function-liftcocycle-map-userprogram)
  - [`CoboundaryMapImage(M, i, c): ModCoho, RngIntElt, UserProgram → UserProgram`](https://docs.magma-maths.org/FiniteGroups/CohomologyAndExtensions/other-operations.md#function-coboundarymapimage-modcoho-rngintelt-userprogram)
- [Constructing Extensions](https://docs.magma-maths.org/FiniteGroups/CohomologyAndExtensions/extensions.md)
  - [`Extension(CM, s): ModCoho, SeqEnum → Grp, HomGrp, Map`](https://docs.magma-maths.org/FiniteGroups/CohomologyAndExtensions/extensions.md#function-grpcoh-extension)
  - [`Extension(CM, s): ModCoho, ModTupRngElt → Grp, HomGrp, Map`](https://docs.magma-maths.org/FiniteGroups/CohomologyAndExtensions/extensions.md#function-extension-modcoho-modtuprngelt)
  - [`Extension(GrpPerm, CM, s): Cat, ModCoho, SeqEnum → GrpPerm, HomGrp, Map`](https://docs.magma-maths.org/FiniteGroups/CohomologyAndExtensions/extensions.md#function-extension-cat-modcoho-seqenum)
  - [`Extension(GrpPerm, CM, s): Cat, ModCoho, ModTupRngElt → GrpPerm, HomGrp, Map`](https://docs.magma-maths.org/FiniteGroups/CohomologyAndExtensions/extensions.md#function-extension-cat-modcoho-modtuprngelt)
  - [Example: Schur Cover of A7](https://docs.magma-maths.org/FiniteGroups/CohomologyAndExtensions/extensions.md#example-ex-f0c0e3)
  - [Example: Dempwolff Group Using a Chosen Subgroup](https://docs.magma-maths.org/FiniteGroups/CohomologyAndExtensions/extensions.md#example-ex-a52bf2)
  - [`SplitExtension(CM): ModCoho → Grp, HomGrp, Map`](https://docs.magma-maths.org/FiniteGroups/CohomologyAndExtensions/extensions.md#function-splitextension-modcoho)
  - [`SplitExtension(G, M): ModCoho → Grp, ModGrp -> HomGrp, Map`](https://docs.magma-maths.org/FiniteGroups/CohomologyAndExtensions/extensions.md#function-splitextension-modcoho-2)
  - [`SplitExtension(M): ModCoho → ModGrp -> HomGrp, Map`](https://docs.magma-maths.org/FiniteGroups/CohomologyAndExtensions/extensions.md#function-splitextension-modcoho-3)
  - [`SplitExtension(GrpPerm,CM): Cat, ModCoho → GrpPerm, HomGrp, Map`](https://docs.magma-maths.org/FiniteGroups/CohomologyAndExtensions/extensions.md#function-splitextension-cat-modcoho)
  - [`SplitExtension(GrpPerm,G,M): Cat, ModCoho → GrpPerm, HomGrp, Map`](https://docs.magma-maths.org/FiniteGroups/CohomologyAndExtensions/extensions.md#function-splitextension-cat-modcoho-2)
  - [`SplitExtension(GrpPerm,M): Cat, ModCoho → GrpPerm, HomGrp, Map`](https://docs.magma-maths.org/FiniteGroups/CohomologyAndExtensions/extensions.md#function-splitextension-cat-modcoho-3)
  - [Example: Split Extension Using Module Elements](https://docs.magma-maths.org/FiniteGroups/CohomologyAndExtensions/extensions.md#example-ex-b445d6)
  - [Example: Split Extension Using Cosets](https://docs.magma-maths.org/FiniteGroups/CohomologyAndExtensions/extensions.md#example-ex-6ad635)
  - [`pMultiplicator(G, p): GrpPerm, RngIntElt → [ RngIntElt ]`](https://docs.magma-maths.org/FiniteGroups/CohomologyAndExtensions/extensions.md#function-pmultiplicator-grpperm-rngintelt)
  - [`pCover(G, F, p): GrpPerm, GrpFP, RngIntElt → GrpFP`](https://docs.magma-maths.org/FiniteGroups/CohomologyAndExtensions/extensions.md#function-pcover-grpperm-grpfp-rngintelt)
  - [Example: Non-Split Extension by A8](https://docs.magma-maths.org/FiniteGroups/CohomologyAndExtensions/extensions.md#example-ex-f7eaba)
  - [Example: Dempwolff Group from a Core-Free Subgroup](https://docs.magma-maths.org/FiniteGroups/CohomologyAndExtensions/extensions.md#example-ex-1cc4cf)
  - [Example: Cohomology of an Integral Permutation Module](https://docs.magma-maths.org/FiniteGroups/CohomologyAndExtensions/extensions.md#example-ex-75b180)
- [Constructing Distinct Extensions](https://docs.magma-maths.org/FiniteGroups/CohomologyAndExtensions/extensions-2.md)
  - [`DistinctExtensions(CM): ModCoho → SeqEnum`](https://docs.magma-maths.org/FiniteGroups/CohomologyAndExtensions/extensions-2.md#function-grpcoh-distinctextensions)
  - [Example: Extensions of a Trivial Module](https://docs.magma-maths.org/FiniteGroups/CohomologyAndExtensions/extensions-2.md#example-ex-a94c9d)
  - [`ExtensionsOfElementaryAbelianGroup(p, d, G): RngIntElt, RngIntElt, GrpPerm → SeqEnum`](https://docs.magma-maths.org/FiniteGroups/CohomologyAndExtensions/extensions-2.md#function-extensionsofelementaryabeliangroup-rngintelt-rngintelt-grpperm)
  - [Example: Extensions of an Elementary Abelian Group](https://docs.magma-maths.org/FiniteGroups/CohomologyAndExtensions/extensions-2.md#example-ex-e97a7d)
  - [`ExtensionsOfSolubleGroup(H, G): GrpPerm, GrpPerm → SeqEnum`](https://docs.magma-maths.org/FiniteGroups/CohomologyAndExtensions/extensions-2.md#function-extensionsofsolublegroup-grpperm-grpperm)
  - [Example: Extensions of the Dihedral Group of Order 8](https://docs.magma-maths.org/FiniteGroups/CohomologyAndExtensions/extensions-2.md#example-ex-334528)
  - [Example: Extensions by a Cyclic Group of Order 4](https://docs.magma-maths.org/FiniteGroups/CohomologyAndExtensions/extensions-2.md#example-ex-ff8afd)
  - [`IsExtensionOf(G): GrpPerm → [], {}`](https://docs.magma-maths.org/FiniteGroups/CohomologyAndExtensions/extensions-2.md#function-grpcoh-isextensionof)
  - [`IsExtensionOf(L): [GrpPerm] → [], []`](https://docs.magma-maths.org/FiniteGroups/CohomologyAndExtensions/extensions-2.md#function-isextensionof-grpperm)
- [Finite Group Cohomology](https://docs.magma-maths.org/FiniteGroups/CohomologyAndExtensions/group-cohomology.md)
  - [Creation of Gamma-groups](https://docs.magma-maths.org/FiniteGroups/CohomologyAndExtensions/group-cohomology.md#creation-of-gamma-groups)
    - [`GammaGroup(Gamma, A, action): Grp, Grp, Map[Grp, GrpAuto] → GGrp`](https://docs.magma-maths.org/FiniteGroups/CohomologyAndExtensions/group-cohomology.md#function-gammagroup-grp-grp-map-grp-grpauto)
    - [`InducedGammaGroup(A, B): GGrp, Grp → GGrp`](https://docs.magma-maths.org/FiniteGroups/CohomologyAndExtensions/group-cohomology.md#function-inducedgammagroup-ggrp-grp)
    - [Example: Creating a Gamma-Group](https://docs.magma-maths.org/FiniteGroups/CohomologyAndExtensions/group-cohomology.md#example-ex-379641)
    - [`IsNormalised(B, action): Grp, Map → BoolElt`](https://docs.magma-maths.org/FiniteGroups/CohomologyAndExtensions/group-cohomology.md#function-isnormalised-grp-map)
    - [`IsInduced(AmodB): GGrp → BoolElt, GGrp, GGrp, Map, Map`](https://docs.magma-maths.org/FiniteGroups/CohomologyAndExtensions/group-cohomology.md#function-isinduced-ggrp)
  - [Accessing Information](https://docs.magma-maths.org/FiniteGroups/CohomologyAndExtensions/group-cohomology.md#accessing-information)
    - [`Group(A): GGrp → Grp`](https://docs.magma-maths.org/FiniteGroups/CohomologyAndExtensions/group-cohomology.md#function-group-ggrp)
    - [`GammaAction(A): GGrp → Map[Grp, GrpAuto]`](https://docs.magma-maths.org/FiniteGroups/CohomologyAndExtensions/group-cohomology.md#function-gammaaction-ggrp)
    - [`ActingGroup(A): GGrp → Grp`](https://docs.magma-maths.org/FiniteGroups/CohomologyAndExtensions/group-cohomology.md#function-actinggroup-ggrp)
  - [One Cocycles](https://docs.magma-maths.org/FiniteGroups/CohomologyAndExtensions/group-cohomology.md#one-cocycles)
    - [`OneCocycle(A, imgs): GGrp, SeqEnum[GrpElt] → OneCoC`](https://docs.magma-maths.org/FiniteGroups/CohomologyAndExtensions/group-cohomology.md#function-onecocycle-ggrp-seqenum-grpelt)
    - [`OneCocycle(A, alpha): GGrp, Map[Grp,Grp] → OneCoC`](https://docs.magma-maths.org/FiniteGroups/CohomologyAndExtensions/group-cohomology.md#function-onecocycle-ggrp-map-grp-grp)
    - [`TrivialOneCocycle(A): GGrp → OneCoC`](https://docs.magma-maths.org/FiniteGroups/CohomologyAndExtensions/group-cohomology.md#function-trivialonecocycle-ggrp)
    - [`IsOneCocycle(A, imgs): GGrp, SeqEnum[GrpElt] → BoolElt, OneCoC`](https://docs.magma-maths.org/FiniteGroups/CohomologyAndExtensions/group-cohomology.md#function-isonecocycle-ggrp-seqenum-grpelt)
    - [`IsOneCocycle(A, alpha): GGrp, Map[Grp,Grp] → BoolElt, OneCoC`](https://docs.magma-maths.org/FiniteGroups/CohomologyAndExtensions/group-cohomology.md#function-isonecocycle-ggrp-map-grp-grp)
    - [`AreCohomologous(alpha, beta): OneCoC, OneCoC → BoolElt, GrpElt`](https://docs.magma-maths.org/FiniteGroups/CohomologyAndExtensions/group-cohomology.md#function-arecohomologous-onecoc-onecoc)
    - [`CohomologyClass(alpha): OneCoC → SetIndx[OneCoC]`](https://docs.magma-maths.org/FiniteGroups/CohomologyAndExtensions/group-cohomology.md#function-cohomologyclass-onecoc)
    - [`InducedOneCocycle(AmodB, alpha): GGrp, OneCoC → OneCoC`](https://docs.magma-maths.org/FiniteGroups/CohomologyAndExtensions/group-cohomology.md#function-inducedonecocycle-ggrp-onecoc)
    - [`InducedOneCocycle(A, B, alpha): GGrp, Grp, OneCoC → OneCoC`](https://docs.magma-maths.org/FiniteGroups/CohomologyAndExtensions/group-cohomology.md#function-inducedonecocycle-ggrp-grp-onecoc)
    - [`ExtendedOneCocycle(alpha): OneCoC → SetEnum[OneCoC]`](https://docs.magma-maths.org/FiniteGroups/CohomologyAndExtensions/group-cohomology.md#function-extendedonecocycle-onecoc)
    - [`ExtendedCohomologyClass(alpha): OneCoC → SetEnum[OneCoC]`](https://docs.magma-maths.org/FiniteGroups/CohomologyAndExtensions/group-cohomology.md#function-extendedcohomologyclass-onecoc)
    - [`GammaGroup(alpha): OneCoC → GGrp`](https://docs.magma-maths.org/FiniteGroups/CohomologyAndExtensions/group-cohomology.md#function-gammagroup-onecoc)
    - [`CocycleMap(alpha): OneCoC → Map`](https://docs.magma-maths.org/FiniteGroups/CohomologyAndExtensions/group-cohomology.md#function-cocyclemap-onecoc)
  - [Group Cohomology](https://docs.magma-maths.org/FiniteGroups/CohomologyAndExtensions/group-cohomology.md#one-cocycles-2)
    - [`Cohomology(A, n): GGrp, RngIntElt → SetEnum[OneCoC]`](https://docs.magma-maths.org/FiniteGroups/CohomologyAndExtensions/group-cohomology.md#function-cohomology-ggrp-rngintelt)
    - [`OneCohomology(A): GGrp → SetEnum[OneCoC]`](https://docs.magma-maths.org/FiniteGroups/CohomologyAndExtensions/group-cohomology.md#function-onecohomology-ggrp)
    - [`TwistedGroup(A, alpha): GGrp, OneCoC → GGrp`](https://docs.magma-maths.org/FiniteGroups/CohomologyAndExtensions/group-cohomology.md#function-twistedgroup-ggrp-onecoc)
    - [Example: Gamma-Group Cohomology of D8](https://docs.magma-maths.org/FiniteGroups/CohomologyAndExtensions/group-cohomology.md#example-ex-82c924)
- [Bibliography](https://docs.magma-maths.org/FiniteGroups/CohomologyAndExtensions/bibliography.md)

### Introduction

The following collection of cohomology functions is designed to provide a flexible set of tools for computing with first and second cohomology groups of any type of finite group acting on any reasonable module, including a module defined by an action on an arbitrary finitely generated abelian group. First (but not second) cohomology groups can also be calculated for infinite groups defined by a finite presentation.

Zero-cocycles, one-cocycles, and two-cocycles may be computed and identified. Extensions of modules by groups can be constructed as finitely presented groups, or as PC-groups when the acting group is a PC-group. It is also possible to compute a representative set of extensions of the module by the group each of which is distinct up to a group isomorphism fixing the module. These functions complement, but do not completely supplant, an older collection of functions pertaining to cohomology groups, Schur multiplicators, and covering groups which apply to permutation groups (see Chapter [Permutation Groups](https://docs.magma-maths.org/FiniteGroups/PermutationGroups/index-permutation-groups.md#chapgrpperm) on Permutation Groups).

The first cohomology group $H^1(G,M)$ is calculated as the nullspace of a certain matrix. The details can be found in Section 5 of [[CCH01a](https://docs.magma-maths.org/references.md#cite-cch01)]. This immediately allows manipulation and identification of one-cocycles. The second cohomology group $H^2(G,M)$ is more difficult to compute. While it can also be found as the nullspace of a suitable matrix, this matrix can be uncomfortably large in big examples. For soluble groups defined by a PC-presentation, the matrix corresponds to solving the consistency equations for a PC-presentation of a general extension of the module by the group, which depends on the number of group generators rather than its order, and is manageable for quite large groups. For permutation and matrix groups $G$, the size of the matrix for which the nullspace is required is much larger, but can often be reduced to a reasonable size by using a base and strong generating set for $G$. In the case where only the dimension of $H^2(G,M)$ is required, and $M$ is a module over a finite field of prime order $p$, then the calculation of this dimension can be reduced to the determination of $H^2(Q,M)$ for a suitable collection of $p$-subgroups $Q$ of $G$. The latter calculation can be carried out efficiently using the PC-presentation approach (see [[Hol85b](https://docs.magma-maths.org/references.md#cite-holt-cohom)] for details).

To use the new functions, the user must initially invoke the function [`CohomologyModule`](https://docs.magma-maths.org/FiniteGroups/CohomologyAndExtensions/creation.md#function-grpcoh-cohomologymodule), which creates a special object for the group action corresponding to the module, and all subsequent (new) cohomology functions take this object as their first argument.

In the case of a finite permutation or matrix group $G$ acting on a module $M$ over a prime field, the dimension of $H^2(G,M)$ may be found much more quickly by executing `CohomologicalDimension(CM, 2)`, where ${\rm CM}$ is the cohomology module for the action of $G$ on $M$, rather than by invoking `Dimension(CohomologyGroup(CM, 2))`. However, the former call does not allow the possibility of subsequent calculations with two-cocycles or extensions.

The equivalent older function, `CohomologicalDimension(G, M, 2);` (for a permutation group $G$) is often faster still for small examples, but the new function will succeed on much larger examples than the old. For the convenience of the reader, some of these older functions are described in this section of the Handbook. For complete details about the older functions, see the section on cohomology in the chapter on Permutation Groups.

<a id="creation"></a>
<a id="grpcoh-creation-of-module"></a>
### Creation of a Cohomology Module

In order to compute the cohomology of a group with respect to a $G$-module $M$, it is first necessary to construct a data structure known as a *cohomology module*.

<a id="function-grpcoh-cohomologymodule"></a>
#### `CohomologyModule(G, M): GrpPerm, ModGrp -> ModCoho`

<a id="function-cohomologymodule-grppc-modgrp"></a>
#### `CohomologyModule(G, M): GrpPC, ModGrp -> ModCoho`

<a id="function-cohomologymodule-grpmat-modgrp"></a>
#### `CohomologyModule(G, M): GrpMat, ModGrp -> ModCoho`

<a id="function-cohomologymodule-grpfp-modgrp"></a>
#### `CohomologyModule(G, M): GrpFP, ModGrp -> ModCoho`

Given a group $G$ and a $G$-module $M$ with acting group $G$ this function returns a cohomology module for the action of $G$. The group $G$ may be a finite permutation group, a finite matrix group, a PC-group, or any finitely presented group. For the PC-group case, however, the PC-presentation of $G$ must be conditioned. This can be achieved by first executing the statement `G := ConditionedGroup(G);`

<a id="function-cohomologymodule-grpperm-seqenum-seqenum"></a>
#### `CohomologyModule(G, Q, T): GrpPerm, SeqEnum, SeqEnum -> ModCoho`

<a id="function-cohomologymodule-grppc-seqenum-seqenum"></a>
#### `CohomologyModule(G, Q, T): GrpPC, SeqEnum, SeqEnum -> ModCoho`

<a id="function-cohomologymodule-grpmat-seqenum-seqenum"></a>
#### `CohomologyModule(G, Q, T): GrpMat, SeqEnum, SeqEnum -> ModCoho`

<a id="function-cohomologymodule-grpfp-seqenum-seqenum"></a>
#### `CohomologyModule(G, Q, T): GrpFP, SeqEnum, SeqEnum -> ModCoho`

Let $G$ be a group which acts on a finitely-generated abelian group with invariants given by the sequence $Q$, and action described by $T$. The action $T$ is given in the form of a sequence of $d \times d$ matrices over the integers, where $d$ is the length of $T$, and `T[i]` defines the action of the $i$-th generator of $G$ on the abelian group. The function returns a cohomology module for the action of $G$. The group $G$ may be a finite permutation group, a finite matrix group, a PC-group, or any finitely presented group. For the PC-group case, however, the PC-presentation of $G$ must be conditioned. This can be achieved by first executing the statement `G := ConditionedGroup(G);`

<a id="example-ex-8b4abf"></a>
#### `Example: Cohomology Module for PSL(3, 2) (ex-8b4abf)`

We construct the cohomology module for ${\rm PSL}(3, 2)$ acting on a module of dimension $3$ over $GF(2)$. We first need to find a module of dimension $3$.

```magma
> G := PSL(3, 2);
> Irrs := AbsolutelyIrreducibleModules(G, GF(2));
> Irrs;
[
    GModule of dimension 1 over GF(2),
    GModule of dimension 3 over GF(2),
    GModule of dimension 3 over GF(2),
    GModule of dimension 8 over GF(2)
]
> M := Irrs[2];
> CM := CohomologyModule(G, M);
> CM;
Cohomology Module
```

<a id="example-ex-233494"></a>
#### `Example: Cohomology Module for ASL(3, 5) (ex-233494)`

We construct a cohomology module for a group $G$ acting on an elementary abelian subgroup $N$ of $G$.

```magma
> G := ASL(3,5);
> ChiefFactors(G);
    G
    |  A(2, 5)                    = L(3, 5)
    *
    |  Cyclic(5) (3 copies)
    1
> N := pCore(G,5);
> M := GModule(G,N);
> CM := CohomologyModule(G,M);
```

<a id="example-ex-0c0fe6"></a>
#### `Example: Cohomology Module for a Cyclic Group (ex-0c0fe6)`

Now we construct a cohomology module for a cyclic group of order $4$ acting on an abelian group with invariants $[2,4]$.

```magma
> G:=CyclicGroup(4);
> mats := [ Matrix(Integers(),2,2,[1,2,1,3]) ];
> invar := [2,4];
> CM := CohomologyModule(G,invar,mats);
> CM;
Cohomology Module
```

<a id="example-ex-e9e40a"></a>
#### `Example: Cohomology Module for an Infinite Group (ex-e9e40a)`

Now we construct a cohomology module for an infinite FP-group.

```magma
> G := Group<x,y | x^2,y^3,(x*y)^7 >;
> L := LowIndexSubgroups(G, <7,7>);
> Index(G,L[1]);
7
> Q := CosetImage(G,L[1]);
> PM := PermutationModule(Q, Integers());
> cons := Constituents(PM);
> cons;
[
    GModule of dimension 1 over Integer Ring,
    GModule of dimension 6 over Integer Ring
]
> mats := ActionGenerators(cons[2]);
> M := GModule(G,mats);
> CM := CohomologyModule(G,M);
```

<a id="function-cohomologymodule-grpperm-grpab-any"></a>
#### `CohomologyModule(G, A, M): GrpPerm, GrpAb, Any -> ModCoho`

For a permutation group $G$ acting on some abelian group $A$ through $M$, compute the cohomology module. $M$ has to be either a map from $G$ into the endomorphisms of $A$, or a sequence of endomorphisms of $A$, one for each of the generators of $G$.

### Accessing Properties of the Cohomology Module

The functions described in this section merely return data used to define the cohomology module. In each case, the argument ${\rm CM}$ must be a cohomology module returned by a call to `CohomologyModule`.

<a id="function-module-modcoho"></a>
#### `Module(CM): ModCoho -> ModGrp`

The $K[G]$-module used to define the cohomology module ${\rm CM}$. An error occurs if ${\rm CM}$ was defined by an action on a finitely generated abelian group.

<a id="function-invariants-modcoho"></a>
#### `Invariants(CM): ModCoho -> SeqEnum`

Given a cohomology module ${\rm CM}$ that was defined by an action on a finitely generated abelian group $A$, return the invariants of $A$. If ${\rm CM}$ was not defined by an action on an abelian group, an error results.

<a id="function-dimension-modcoho"></a>
#### `Dimension(CM): ModCoho -> RngIntElt`

Let ${\rm CM}$ be a cohomology module. If ${\rm CM}$ was defined by the action of a group on an $R$-module $M$, return the dimension of $M$. In the case in which ${\rm CM}$ was defined by the action of a group on a finitely generated abelian group $A$, the rank of $A$ is returned.

<a id="function-ring-modcoho"></a>
#### `Ring(CM): ModCoho -> ModGrp`

The ring over which the module used to define the cohomology module ${\rm CM}$ is defined. If ${\rm CM}$ is defined in terms of an action on a finitely generated abelian group $A$, then the ring will be the integers if $A$ is infinite, and the integers modulo the exponent of $A$ if $A$ is finite.

<a id="function-group-modcoho"></a>
#### `Group(CM): ModCoho -> Grp`

The group used to define action on the cohomology module ${\rm CM}$.

<a id="function-fpgroup-modcoho"></a>
#### `FPGroup(CM): ModCoho -> Grp, HomGrp`

Given a cohomology module ${\rm CM}$ with associated group $G$, return a finitely presented group $F$ isomorphic to $G$ and the isomorphism from $F$ to $G$. This presentation is on a strong generating set if $G$ is a permutation or matrix group. It is used in the construction of presentations of extensions returned by the function [`Extension`](https://docs.magma-maths.org/FiniteGroups/CohomologyAndExtensions/extensions.md#function-grpcoh-extension).

<a id="function-matrixofelement-modcoho-grpelt"></a>
#### `MatrixOfElement(CM, g): ModCoho, GrpElt -> AlgMatElt`

The matrix representing the action of the element $g$ in the group of ${\rm CM}$ on the module of ${\rm CM}$.

<a id="example-ex-fdbfad"></a>
#### `Example: Properties of a Cohomology Module (ex-fdbfad)`

Following on from example [Cohomology Module for a Cyclic Group](https://docs.magma-maths.org/FiniteGroups/CohomologyAndExtensions/creation.md#example-ex-0c0fe6) above:

```magma
> G:=CyclicGroup(4);
> mats := [ Matrix(Integers(),2,2,[1,2,1,3]) ];
> invar := [2,4];
> CM := CohomologyModule(G,invar,mats);
> Invariants(CM);
[ 2, 4 ]
> FPGroup(CM);
Finitely presented group on 1 generator
Relations
    $.1^4 = Id($)
Mapping from: GrpFP to GrpPerm: G
> MatrixOfElement(CM, G.1^2);
[1 0]
[0 3]
```

### Calculating Cohomology

<a id="function-cohomologygroup-modcoho-rngintelt"></a>
#### `CohomologyGroup(CM, n): ModCoho, RngIntElt -> ModTupRng`

Given a cohomology module ${\rm CM}$ for the group $G$ acting on the module $M$ and a non-negative integer $n$ taking one of the values $0$, $1$, or $2$, this function returns the cohomology group $H^n(G,M)$. For modules defined over the ring of integers only, $n$ may also be equal to 3. (In this case, $H^3(G,M)$ is computed as $H^2(G, M \otimes_Z Q/Z)$.) If the group used to define ${\rm CM}$ was a finitely presented group, then $n$ may only be equal to $0$ or $1$. Note that ${\rm CM}$ must be a module returned by invoking `CohomologyModule`.

<a id="example-ex-68b620"></a>
#### `Example: Cohomology for a Cyclic Group of Order 4 (ex-68b620)`

Following on from example [Cohomology Module for a Cyclic Group](https://docs.magma-maths.org/FiniteGroups/CohomologyAndExtensions/creation.md#example-ex-0c0fe6) above:

```magma
> G:=CyclicGroup(4);
> mats := [ Matrix(Integers(),2,2,[1,2,1,3]) ];
> invar := [2,4];
> CM := CohomologyModule(G,invar,mats);
> CohomologyGroup(CM,0);
Full Quotient RSpace of degree 1 over Integer Ring
Column moduli:
[ 2 ]
> CohomologyGroup(CM,1);
Full Quotient RSpace of degree 1 over Integer Ring
Column moduli:
[ 2 ]
> CohomologyGroup(CM,2);
Full Quotient RSpace of degree 1 over Integer Ring
Column moduli:
[ 2 ]
```

<a id="example-ex-0db52b"></a>
#### `Example: Cohomology of an Infinite FP-Group (ex-0db52b)`

Following on from example [Cohomology Module for an Infinite Group](https://docs.magma-maths.org/FiniteGroups/CohomologyAndExtensions/creation.md#example-ex-e9e40a) above:

```magma
> G := Group<x,y | x^2,y^3,(x*y)^7 >;
> L := LowIndexSubgroups(G, <7,7>);
> Q := CosetImage(G,L[1]);
> PM := PermutationModule(Q, Integers());
> cons := Constituents(PM);
> mats := ActionGenerators(cons[2]);
> M := GModule(G,mats);
> CM := CohomologyModule(G,M);
> CohomologyGroup(CM,0);
Full Quotient RSpace of degree 0 over Integer Ring
Column moduli:
[ ]
> CohomologyGroup(CM,1);
Full Quotient RSpace of degree 1 over Integer Ring
Column moduli:
[ 7 ]
> CohomologyGroup(CM,2);
Runtime error: Second cohomology groups are not implemented for GrpFP
```

<a id="function-cohomologicaldimension-modcoho-rngintelt"></a>
#### `CohomologicalDimension(CM, n): ModCoho, RngIntElt -> RngIntElt`

Given a cohomology module ${\rm CM}$ for the group $G$ acting on the module $M$ defined over a finite field $K$ and a non-negative integer $n$ taking one of the values $0$, $1$, or $2$, this function returns the dimension of $H^n(G,M)$ over $K$. Note that this function may only be applied to the module returned by a call to `CohomologyModule(G, M)`, where $M$ is a module over a finite field $K$. When $n = 2$, this function is faster and may be applied to much larger examples than `CohomologyGroup(CM, n)` but, unlike that function, it does not enable the user to compute with explicit extensions and two-cocycles.

Note that there are some alternative functions for performing these calculations described in other manual chapters.

<a id="function-cohomologicaldimension-modgrp-n"></a>
#### `CohomologicalDimension(M, n): ModGrp, RngIntElt -> RngIntElt`

For $K[G]$-module $M$ (with $K$ a finite field and $G$ a finite group), compute and return the $K$-dimension of the cohomology group $H^n(G,M)$ for $n \ge 0$. For $n=0$ and 1, this is carried out by using the function `CohomologicalDimension(CM,n)` just described. For $n \ge 2$, it is done recursively using projective covers and dimension shifting to reduce to the case $n=1$. See Section [Projective Indecomposable Modules](https://docs.magma-maths.org/RepresentationTheory/ModulesOverAnAlgebraAndGroupRepresentations/projective-indecomposable-modules.md#projective-indecomposable-modules) in Chapter [Modules over an Algebra and Group Representations](https://docs.magma-maths.org/RepresentationTheory/ModulesOverAnAlgebraAndGroupRepresentations/index-modules-over-an-algebra-and-group-representations.md#chapmodalg) for further details and examples.

<a id="function-cohomologicaldimensions-modgrp-n"></a>
#### `CohomologicalDimensions(M, n): ModGrp, RngIntElt -> RngIntElt`

For $K[G]$-module $M$ (with $K$ a finite field and $G$ a finite group), compute and return the sequence of $K$-dimensions of the cohomology groups $H^k(G,M)$ for $1 \le k \le n$. On account of the recursive method used, this is quicker than computing them all individually.

<a id="function-cohomologicaldimension-grpperm-modrng-rngintelt"></a>
#### `CohomologicalDimension(G, M, n): GrpPerm, ModRng, RngIntElt -> RngIntElt`

Given the permutation group $G$, the $K[G]$-module $M$, and an integer $n$ (equal to 1 or 2), return the dimension of the $n$-th cohomology group of $G$ acting on $M$. *Note that* $K$ *must be a finite field of prime order*. This function invokes Derek Holt’s original C cohomology code (see [[Hol85b](https://docs.magma-maths.org/references.md#cite-holt-cohom)]). In some cases it will be faster than the function that uses the cohomology module data structure.

<a id="function-h1dimension-grpfp-map-modgrp"></a>
#### `H1Dimension(F, f, M): GrpFP, Map, ModGrp -> RngIntElt`

This function returns the dimension of the first cohomology group of the $F$-module $M_F$, where $F$ is a finitely presented group, $f$ is an epimorphism from $F$ onto a finite group $G$ and $M$ is a $G$-module that has been lifted to $M_F$. Again, this function is generally much faster, since it uses sparse matrices.

<a id="function-h1dimension-grpfp-map-rng"></a>
#### `H1Dimension(G, f, K): GrpFP, Map, Rng -> RngIntElt`

This function is equivalent to `CohomologicalDimension(G, M, 1)` where `M := PermutationModule(P, K)` and $P$ is defined by the images of generators of G under the map $f$, but is generally much faster, since it uses sparse matrices and avoids the explicit construction of the permutation module.

<a id="function-h1dimensionsymmetricsquare-grpfp-map-rng"></a>
#### `H1DimensionSymmetricSquare(G, f, K): GrpFP, Map, Rng -> RngIntElt`

<a id="function-h1dimensionexteriorsquare-grpfp-map-rng"></a>
#### `H1DimensionExteriorSquare(G, f, K): GrpFP, Map, Rng -> RngIntElt`

These functions are equivalent to `CohomologicalDimension(G, M, 1)` where $M$ is the symmetric square or exterior square, respectively, of `PermutationModule(P, R)`, and $P$ is defined by the images of generators of G under the map $f$. But the functions are generally much faster, since they use sparse matrices and avoid the explicit construction of the modules.

<a id="example-ex-096719"></a>
#### `Example: Cohomology of A8 (ex-096719)`

We examine the first and second cohomology groups of the group $A_8$.

```magma
> G := Alt(8);
> M := PermutationModule(G, GF(3));
```

We first calculate the dimensions of $H^1(G,M)$ and $H^2(G,M)$ using the old functions.

```magma
> time CohomologicalDimension(G, M, 1);
0
Time: 0.020
> time CohomologicalDimension(G, M, 2);
1
Time: 0.020
```

We now recalculate the dimensions of $H^1(G,M)$ and $H^2(G,M)$ using the new functions.

```magma
> X := CohomologyModule(G, M);
> time CohomologicalDimension(X, 1);
0
Time: 0.020
> time CohomologicalDimension(X, 2);
1
Time: 0.920
> X := CohomologyModule(G, M);
> time C:=CohomologyGroup(X, 2);
Time: 4.070
> C;
Full Vector space of degree 1 over GF(3)
```

<a id="example-ex-46f77b"></a>
#### `Example: Cohomology of ASL(3, 5) (ex-46f77b)`

We do a similar comparison with Example [Cohomology Module for ASL(3, 5)](https://docs.magma-maths.org/FiniteGroups/CohomologyAndExtensions/creation.md#example-ex-233494) above.

```magma
> G := ASL(3,5);
> N := pCore(G,5);
> M := GModule(G,N);
> CM := CohomologyModule(G,M);
> time [CohomologyGroup(CM,i) : i in [0..2]];
[
    Full Vector space of degree 0 over GF(5),

    Full Vector space of degree 1 over GF(5),

    Full Vector space of degree 1 over GF(5)
]
Time: 46.940
> CM := CohomologyModule(G,M);
> time [CohomologicalDimension(CM,i) : i in [0..2]];
[ 0, 1, 1 ]
Time: 0.320
```

<a id="example-ex-023d07"></a>
#### `Example: Cohomology Where the Old Method Fails (ex-023d07)`

In the case of $\Omega^-(8,3)$ acting on its natural module, the new function succeeds, but the old function does not.

```magma
> G := OmegaMinus(8, 3);
> M := GModule(G);
> X := CohomologyModule(G, M);
> time CohomologicalDimension(X, 2);
2
Time: 290.280
> phi, P := PermutationRepresentation(G);
> MM := GModule(P, [ActionGenerator(M, i): i in [1..Ngens(G)]] );
> time CohomologicalDimension(P, MM, 2);

Out of space.

>> time CohomologicalDimension(P, MM, 2);
                              ^
Runtime error in 'CohomologicalDimension': Cohomology failed
```

### Cocycles

Before invoking the functions in this section, it is necessary to first invoke the function `CohomologyGroup(CM, n)` for the appropriate $n$.

For $n = 0,1$ or 2, an $n$*-cocycle* is a function from $G^n$ to the module $M$, where elements of $G^n$ are represented as an $n$-tuple $\langle g_1, \ldots, g_n \rangle$ of group elements, for which a certain relation is satisfied. These relations are consistent with the Magma convention of the use of right actions, and so they are slightly different from those encountered in many textbooks, where left actions are more common.

$0$-, $1$-, and $2$-cocycles $z$, $o$, and $t$, respectively, satisfy the following relations for all $g,h \in G$.

$$
z(\langle \rangle)^g = z(\langle \rangle);
$$

$$
o(\langle gh \rangle) = o(\langle g \rangle)^h + o(\langle h \rangle);
$$

$$
t(\langle gh,k \rangle) + t(\langle g,h \rangle)^k
= t(\langle g,hk \rangle) + t(\langle h,k \rangle) .
$$

<a id="function-zerococycle-modcoho-seqenum"></a>
#### `ZeroCocycle(CM, s): ModCoho, SeqEnum -> UserProgram`

<a id="function-zerococycle-modcoho-modtuprngelt"></a>
#### `ZeroCocycle(CM, s): ModCoho, ModTupRngElt -> UserProgram`

Given a cohomology module ${\rm CM}$ constructed from the $K[G]$-module $M$ and an element $s$ of the cohomology group $H^0(G,M)$ associated with ${\rm CM}$, this function returns the corresponding zero-cocycle. The zero-cocycle is returned as a function of the $0$-tuple $\langle \rangle$, of which the image is an element of the fixed point submodule of $M$. The argument $s$ may either be given as an element of $H^0(G,M)$ or as a sequence of integers defining such an element.

<a id="function-identifyzerococycle-modcoho-userprogram"></a>
#### `IdentifyZeroCocycle(CM, s): ModCoho, UserProgram -> ModTupRngElt`

Given a cohomology module ${\rm CM}$ constructed from the $K[G]$-module $M$ and a zero-cocycle given as a function of the $0$-tuple $\langle \rangle$, of which the image is an element of the fixed point submodule of $M$, this function returns the corresponding element of $H^0(G,M)$. Hence this function is the inverse function to `ZeroCocycle`.

<a id="function-onecocycle-modcoho-seqenum"></a>
#### `OneCocycle(CM, s): ModCoho, SeqEnum -> UserProgram`

<a id="function-onecocycle-modcoho-modtuprngelt"></a>
#### `OneCocycle(CM, s): ModCoho, ModTupRngElt -> UserProgram`

Given a cohomology module ${\rm CM}$ constructed from the $K[G]$-module $M$ and an element $s$ of the cohomology group $H^1(G,M)$ associated with ${\rm CM}$, the function returns a corresponding one-cocycle. The one-cocycle is returned as a function from $G$ to the module $M$, where elements $g$ of $G$ are represented as $1$-tuples $\langle g \rangle$. The argument $s$ may either be given as an element of $H^1(G,M)$ or as a sequence of integers defining such an element.

<a id="function-identifyonecocycle-modcoho-userprogram"></a>
#### `IdentifyOneCocycle(CM, s): ModCoho, UserProgram -> ModTupRngElt`

Given a cohomology module ${\rm CM}$ constructed from the $K[G]$-module $M$ and a one-cycle $s$ for ${\rm CM}$, specified as a function from $G$ to the module $M$ (where elements $g$ of $G$ are represented as $1$-tuples $\langle g \rangle$), this function returns the corresponding element of $H^1(G,M)$. Thus, the function is the inverse to `OneCocycle`.

<a id="function-isonecoboundary-modcoho-userprogram"></a>
#### `IsOneCoboundary(CM, s): ModCoho, UserProgram -> BoolElt, UserProgram`

Given a cohomology module ${\rm CM}$ constructed from the $K[G]$-module $M$ and a one-cycle $s$ for ${\rm CM}$, specified as a function from $G$ to the module $M$ (where elements $g$ of $G$ are represented as $1$-tuples $\langle g \rangle$), this function determines whether the cocycle is a 1-coboundary; that is, whether it corresponds to the zero element of $H^1(G,M)$. If so, then it also returns a corresponding 0-cochain $t(\langle \rangle)$ that satisfies $s(\langle g \rangle) = t(\langle \rangle) - t(\langle \rangle)^g$ for all $g \in G$.

<a id="function-twococycle-modcoho-seqenum"></a>
#### `TwoCocycle(CM, s): ModCoho, SeqEnum -> UserProgram`

<a id="function-twococycle-modcoho-modtuprngelt"></a>
#### `TwoCocycle(CM, s): ModCoho, ModTupRngElt -> UserProgram`

Given a cohomology module ${\rm CM}$ constructed from the $K[G]$-module $M$ and an element $s$ of the cohomology group $H^2(G,M)$ associated with ${\rm CM}$, the function returns a corresponding two-cocycle. The two-cocycle is returned as a function from $G\times G$ to the module $M$, where elements of $G \times G$ are represented as $2$-tuples $\langle g_1,g_2 \rangle$. The argument $s$ may either be given as an element of $H^2(G,M)$ or as a sequence of integers defining such an element.

<a id="function-identifytwococycle-modcoho-userprogram"></a>
#### `IdentifyTwoCocycle(CM, s): ModCoho, UserProgram -> ModTupRngElt`

Given a cohomology module ${\rm CM}$ constructed from the $K[G]$-module $M$ and a two-cycle $s$ for ${\rm CM}$, specified as a function from $G\times G$ to the module $M$ (where elements of $G \times G$ are represented as $2$-tuples $\langle g_1,g_2 \rangle$), this function returns the corresponding element of $H^2(G,M)$. Thus, the function is the inverse to `TwoCocycle`.

<a id="function-istwocoboundary-modcoho-userprogram"></a>
#### `IsTwoCoboundary(CM, s): ModCoho, UserProgram -> BoolElt, UserProgram`

Given a cohomology module ${\rm CM}$ constructed from the $K[G]$-module $M$ and a two-cycle $s$ for ${\rm CM}$, specified as a function from $G$ to the module $M$ (where elements of $G \times G$ are represented as $2$-tuples $\langle g_1,g_2 \rangle$), this function determines whether the cocycle is a 2-coboundary; that is, whether it corresponds to the zero element of $H^2(G,M)$. If so, then it also returns a corresponding 1-cochain $t(\langle g \rangle)$ that satisfies $s(\langle g,h \rangle) = t(\langle g \rangle)^h + t(\langle h \rangle) - t(\langle gh \rangle)$ for all $g, h \in G$.

<a id="example-ex-d41d4c"></a>
#### `Example: Cocycles for a Cyclic Group (ex-d41d4c)`

An easy example where the module is an abelian group defined by its invariant factors.

```magma
> G := PermutationGroup< 4 | (1,2,3,4) >;
> invar:=[2,4,4];
> mats := [ Matrix(Integers(),3,3,[1,2,0,0,0,1,0,1,2]) ];
> X := CohomologyModule(G,invar,mats);
> C := CohomologyGroup(X,0);
> C;
Full Quotient RSpace of degree 1 over Integer Ring
Column moduli:
[ 4 ]
> ZeroCocycle(X,[3]);
function(tp) ... end function
> $1(X);
(-1 -1 -3)
> IdentifyZeroCocycle(X,func<x|-$1>);
(1)
> C := CohomologyGroup(X,1);
> C;
Full Quotient RSpace of degree 2 over Integer Ring
Column moduli:
[ 2, 2 ]
> z1 := OneCocycle(X,[1,0]);
> z2 := OneCocycle(X,[0,1]);
> z1(<G.1>);
(1 0 0)
> z := func< x | z1(x)+z2(x) >;
> IdentifyOneCocycle(X,z);
(1 1)
> C := CohomologyGroup(X,2);
> C;
Full Quotient RSpace of degree 1 over Integer Ring
Column moduli:
[ 4 ]
> z1 := TwoCocycle(X,[1]);
> z1(<G.1,G.1^2>);
(1 1 3)
> z := func< xy | z1(xy)+z1(xy) >;
> IdentifyTwoCocycle(X,z);
(2)
```

### The Restriction to a Subgroup

<a id="function-restriction-modcoho-grp"></a>
#### `Restriction(CM, H): ModCoho, Grp -> ModCoho`

Given a cohomology module for a group $G$ and a subgroup $H$ of $G$, form the restriction of the input cohomology module to $H$.

Note that, denoting this restriction by CMH, we can define the restriction maps on the first and second cohomology groups of CM by

```magma
>  res1 := hom<CohomologyGroup(CM, 1) -> CohomologyGroup(CMH, 1) |
>                        x:->IdentifyOneCocycle(CMH,OneCocycle(CM,x)) >;
>  res2 := hom<CohomologyGroup(CM, 2) -> CohomologyGroup(CMH, 2) |
>                        x:->IdentifyTwoCocycle(CMH,TwoCocycle(CM,x)) >;
```

<a id="example-ex-a1fddf"></a>
#### `Example: Restriction to a Sylow Subgroup (ex-a1fddf)`

In this example we define $G$ to be the group $GL(3,2)$ and $H$ to be the Sylow $2$-subgroup of $G$. We illustrate how to calculate the restriction mappings of $H^n(G, M)$ to $H^n(G, MH)$, where $MH$ is the restriction of $M$ to $H$.

```magma
> G := GL(3, 2);
> M := GModule(G);
> H := Sylow(G, 2);
> CG := CohomologyModule(G, M);
> CH := Restriction(CG, H);
```

We first consider $H^1(G, M)$.

```magma
> H1G := CohomologyGroup(CG, 1); H1G;
Full Vector space of degree 1 over GF(2)
> H1H := CohomologyGroup(CH, 1); H1H;
Full Vector space of degree 2 over GF(2)
> res1 := hom<H1G -> H1H | x:->IdentifyOneCocycle(CH,OneCocycle(CG,x)) >;
> res1(H1G.1);
(1 1)
```

We now consider $H^2(G, M)$.

```magma
> H2G := CohomologyGroup(CG, 2); H2G;
Full Vector space of degree 1 over GF(2)
> H2H := CohomologyGroup(CH, 2); H2H;
Full Vector space of degree 3 over GF(2)
> res2 := hom<H2G -> H2H | x:-> IdentifyTwoCocycle(CH,TwoCocycle(CG,x)) >;
> res2(H2G.1);
(0 0 1)
```

In the case of a zero restriction, we can find a corresponding coboundary.

```magma
> H:=sub< G | G.2, G.2^(G.1*G.2*G.1) >;
> #H;
21
> CH := Restriction(CG, H);
> CohomologyGroup(CH, 1); CohomologyGroup(CH, 2);
Full Vector space of degree 0 over GF(2)
Full Vector space of degree 0 over GF(2)
> t:=TwoCocycle(CG,[1]);
> isc, o := IsTwoCoboundary(CH, t);
> isc;
true
> forall{ <h,k> : h in H, k in H | t(<h,k>) eq
>            o(<h>)*MatrixOfElement(CH,k) + o(<k>) - o(<h*k>) };
true
```

### Other Operations on Cohomology Modules

<a id="function-corestrictionmapimage-grp-modcoho-userprogram-rngintelt"></a>
#### `CorestrictionMapImage(G, C, c, i): Grp, ModCoho, UserProgram, RngIntElt -> UserProgram`

<a id="function-corestrictcocycle-grp-modcoho-userprogram-rngintelt"></a>
#### `CorestrictCocycle(G, C, c, i): Grp, ModCoho, UserProgram, RngIntElt -> UserProgram`

Given an $i$-cochain $c$ for the cohomology module $C$ which has to be defined wrt. to some subgroup $U$ of $G$, return the corestriction of $c$ to $H^i(G, \ldots)$.

<a id="function-inflationmapimage-map-userprogram"></a>
#### `InflationMapImage(M, c): Map, UserProgram -> UserProgram`

<a id="function-liftcocycle-map-userprogram"></a>
#### `LiftCocycle(M, c): Map, UserProgram -> UserProgram`

```magma
NewCodomain: Any                          Default: false
Level      : RngIntElt                    Default: false
```

Given a cochain $c: G^i \to X$ and a (transversal) map $H \to G$, return the inflation (lift) of $c$ to $H$, ie. a cochain $d:H^i \to X$ defined by $d(h) := c(M(h))$. If `Level` is given $c$ is assumed to be in the cohomology group of that level, ie. $i :=$`Level`. If `Level` is not specified, Magma tries its best to guess the correct level.

If `NewCodomain` is given, the values of $d$ are coerced into this structure.

<a id="function-coboundarymapimage-modcoho-rngintelt-userprogram"></a>
#### `CoboundaryMapImage(M, i, c): ModCoho, RngIntElt, UserProgram -> UserProgram`

For a cohomology module $M$, a level $i$, and a $i$-cochain $c$ (as a user program), return a $i+1$-coboundary as obtained from the cohomological coboundary operator.

### Constructing Extensions

<a id="function-grpcoh-extension"></a>
#### `Extension(CM, s): ModCoho, SeqEnum -> Grp, HomGrp, Map`

<a id="function-extension-modcoho-modtuprngelt"></a>
#### `Extension(CM, s): ModCoho, ModTupRngElt -> Grp, HomGrp, Map`

Given the cohomology module ${\rm CM}$ for the group $G$ acting on the module $M$ and an element $s$ of $H^2(G,M)$, this function returns the corresponding extension $E$ of the module $M$ by $G$ as a finitely presented group. The generators of $E$ are chosen so that the generators of the acting group $G$ (or rather strong generators for $G$ when $G$ is a permutation or matrix group) come first, and the generators of $M$ come last. The argument $s$ should be either an element of $H^2(G,M)$ or a sequence of integers defining such an element.

The projection from $E$ to $G$ and the injection from an abelian group isomorphic to $M$ to $E$ are also returned.

This function may only be applied when the module $M$ used to define ${\rm CM}$ is defined over a finite field of prime order, the integers, or as an abelian group in a call of `CohomologyModule(G, Q, T)`.

<a id="function-extension-cat-modcoho-seqenum"></a>
#### `Extension(GrpPerm, CM, s): Cat, ModCoho, SeqEnum -> GrpPerm, HomGrp, Map`

<a id="function-extension-cat-modcoho-modtuprngelt"></a>
#### `Extension(GrpPerm, CM, s): Cat, ModCoho, ModTupRngElt -> GrpPerm, HomGrp, Map`

```magma
UseSubgp: BoolElt                    Default: false
Subgp   : Grp                        Default: sub< G | >
```

Given the cohomology module ${\rm CM}$ for the group $G$ acting on the module $M$, this function attempts to construct a permutation group $P$ isomorphic to the extension of $M$ by $G$ defined by the argument $s$, which should be either an element of $H^2(G,M)$ or a sequence of integers defining such an element. The natural homomorphism from $P$ to $G$ and the embedding of an abelian group isomorphic to $M$ into $P$ are also returned. This will of course work only if $M$ is finite, and currently it only works if the group $G$ has type `GrpPerm` or `GrpMat`.

If $G$ is moderately small then the action on the cosets of a subgroup of $M$ with index as large as possible is used.

For larger groups $G$, it can help to use the `UseSubgp` option, in which case the `Subgp` optional parameter should be set to be a subgroup $H$ of $G$. By default, this option will be tried if the degree of $P$ would otherwise have been greater than 500000, and $H$ will be chosen to have index about $100$ in $G$.

<a id="example-ex-f0c0e3"></a>
#### `Example: Schur Cover of A7 (ex-f0c0e3)`

In the first example, we construct a faithful permutation representation of the Schur cover $6.A_7$ of $A_7$ in two steps, and then find the smallest degree of a faithful representation of this group.

```magma
> G := Alt(7);
> M := TrivialModule(G, GF(3));
> CM := CohomologyModule(G, M);
> CohomologyGroup(CM, 2);
Full Vector space of degree 1 over GF(3)
> P := Extension(GrpPerm, CM, [1]);
> Degree(P);
45
>   M := TrivialModule(P, GF(2));
>   CM := CohomologyModule(P, M);
>   CohomologyGroup(CM, 2);
Full Vector space of degree 1 over GF(2)
>   P := Extension(GrpPerm, CM, [1]);
>   Degree(P);
720
> ChiefFactors(P);
    G
    |  Alternating(7)
    *
    |  Cyclic(2)
    *
    |  Cyclic(3)
    1
> _, PP := MinimalDegreePermutationRepresentation(P);
> Degree(PP);
285
```

<a id="example-ex-a52bf2"></a>
#### `Example: Dempwolff Group Using a Chosen Subgroup (ex-a52bf2)`

In the second example we use the `UseSubgp` option to find a faithful permutation representation of the *Dempwolff group* which is a non-split extension of the natural module of $G = {\rm GL}(5,2)$ by $G$. Again we go on to find the smallest degree of a faithful representation.

```magma
> G := GL(5,2);
> M := GModule(G);
> CM := CohomologyModule(G, M);
> CohomologyGroup(CM, 2);
Full Vector space of degree 1 over GF(2)
> max := [m`subgroup : m in MaximalSubgroups(G)];
> [Index(G,m) : m in max];
[ 64512, 155, 155, 31, 31 ]
> P := Extension(GrpPerm, CM, [1] : UseSubgp := true, Subgp := max[2]);
> Degree(P);
138880
> ChiefFactors(P);
    G
    |  A(4, 2)                    = L(5, 2)
    *
    |  Cyclic(2) (5 copies)
    1
> _, PP := MinimalDegreePermutationRepresentation(P);
> Degree(PP);
3968
```

<a id="function-splitextension-modcoho"></a>
#### `SplitExtension(CM): ModCoho -> Grp, HomGrp, Map`

Given the cohomology module ${\rm CM}$ for the group $G$ acting on the module $M$, this function returns the split extension $E$ of the module $M$ by $G$ as a finitely presented group. The generators of $E$ are chosen so that the generators of the acting group $G$ (or strong generators for $G$ when $G$ is a permutation or matrix group) come first, and the generators of $M$ come last. The extension returned is the same as for `Extension(CM, s)` with $s$ taken as the zero element of $H^2(G,M)$, but `SplitExtension` is much faster, and does not require $H^2(G,M)$ to be calculated first. This function will also work when the group used to define ${\rm CM}$ was a finitely presented group.

The projection from $E$ to $G$ and the injection from an abelian group isomorphic to $M$ to $E$ are also returned.

This function may only be applied when the module $M$ used to define ${\rm CM}$ is defined over a finite field of prime order, the integers, or as an abelian group in a call of `CohomologyModule(G, Q, T)`.

<a id="function-splitextension-modcoho-2"></a>
#### `SplitExtension(G, M): ModCoho -> Grp, ModGrp -> HomGrp, Map`

<a id="function-splitextension-modcoho-3"></a>
#### `SplitExtension(M): ModCoho -> ModGrp -> HomGrp, Map`

A presentation of the split extension of the module $M$ for the group $G$. In the first version $G$ should be equal to `Group(M)`. These functions simply call and return `SplitExtension(CohomologyModule(G,M))`.

<a id="function-splitextension-cat-modcoho"></a>
#### `SplitExtension(GrpPerm, CM): Cat, ModCoho -> GrpPerm, HomGrp, Map`

<a id="function-splitextension-cat-modcoho-2"></a>
#### `SplitExtension(GrpPerm, G, M): Cat, ModCoho -> GrpPerm, HomGrp, Map`

<a id="function-splitextension-cat-modcoho-3"></a>
#### `SplitExtension(GrpPerm, M): Cat, ModCoho -> GrpPerm, HomGrp, Map`

These functions attempt to construct a permutation group $P$ isomorphic to the split extension of $M$ by $G$ where ${\rm CM}$ is the cohomology module for $G$ on $M$ in the first version, and $G$ is equal to `Group(M)` in the third version. The natural homomorphism from $P$ to $G$ and the embedding of an abelian group isomorphic to $M$ into $P$ are also returned. They will of course work only if $M$ is finite, and currently they only work if the group $G$ has type `GrpPerm` or `GrpMat`.

If $M$ is moderately small then the elements of $M$ will be used as all or part of the set on which $P$ acts. Other possible actions are tried if $M$ if too large.

<a id="example-ex-b445d6"></a>
#### `Example: Split Extension Using Module Elements (ex-b445d6)`

In the first example, $|G|$ is large compared with $|M|$, so we use the natural action of $M:G$ on the elements of $M$.

```magma
> G:=GL(8,2);
> G := GL(8,2);
> M := GModule(GL(8,2));
> P := SplitExtension(GrpPerm, M);
> Degree(P);
256
> #P;
1369104324918194995200
```

<a id="example-ex-6ad635"></a>
#### `Example: Split Extension Using Cosets (ex-6ad635)`

In the second example, $|M|$ is large compared with $|G|$, and we use the action on the cosets of a maximal subgroup of $M$.

```magma
> G := Alt(7);
> I := IrreducibleModules(G, GF(3));
> I;
[
    GModule of dimension 1 over GF(3),
    GModule of dimension 6 over GF(3),
    GModule of dimension 13 over GF(3),
    GModule of dimension 15 over GF(3),
    GModule of dimension 20 over GF(3)
]
> P := SplitExtension(GrpPerm, G, I[5]);
> Degree(P);
7560
> #P;
8786696690520
```

<a id="function-pmultiplicator-grpperm-rngintelt"></a>
#### `pMultiplicator(G, p): GrpPerm, RngIntElt -> [ RngIntElt ]`

Given the permutation group $G$ and a prime $p$ dividing the order of $G$, return the invariant factors of the $p$-part of the Schur multiplicator of $G$. This function calls Derek Holt’s original cohomology code (see [[Hol84](https://docs.magma-maths.org/references.md#cite-holt-multiplier)]).

<a id="function-pcover-grpperm-grpfp-rngintelt"></a>
#### `pCover(G, F, p): GrpPerm, GrpFP, RngIntElt -> GrpFP`

Given the permutation group $G$ and the finitely presented group $F$ such that $G$ is an epimorphic image of $F$ in the sense described below, and a prime $p$, return a presentation for the $p$-cover of $G$, constructed as an extension of the $p$-multiplier by $F$. Note that the epimorphism of $F$ onto $G$ must satisfy the conditions that, firstly, the generators of $F$ are in one-to-one correspondence with those of $G$ and, secondly, the relations of $F$ are satisfied by the generators of $G$. In other words, the mapping taking the $i$-th generator of $F$ to the $i$-th generator of $G$ must be an epimorphism. Usually this mapping will be an isomorphism, although this is not mandatory. This function calls Derek Holt’s original cohomology code (see [[Hol85a](https://docs.magma-maths.org/references.md#cite-holt-cover)]).

<a id="example-ex-f7eaba"></a>
#### `Example: Non-Split Extension by A8 (ex-f7eaba)`

We apply the machinery to construct a non-split extension of the elementary abelian group of order $3^8$ by $A_8$.

```magma
> G := Alt(8);
> M := PermutationModule(G,GF(3));
> X := CohomologyModule(G,M);
> C := CohomologyGroup(X,2);
> C;
Full Vector space of degree 1 over GF(3)
```

The function `Extension` is used to construct a non-split extension $E$ of the module $M$ by the group $G$.

```magma
> E := Extension(X,[1]);
```

The object $E$ is a finitely presented group, in which the 8 module generators come last. We now construct a faithful permutation representation of $E$. This is initially rather large, but we can reduce the degree by using `DegreeReduction`.

```magma
> n := Ngens(E);
> D := sub< E | [E.i : i in [n-7..n-1]] >;
> ct := CosetTable(E, D : CosetLimit:=10^6, Hard:=true);
> P := CosetTableToPermutationGroup(E,ct);
> Degree(P);
60480
> #P eq 3^8 * #G;
true
> P := DegreeReduction(P);
> Degree(P);
```

We extract the normal subgroup of order $3^8$ of the extension $E$, and verify that the extension is non-split.

```magma
> Q := sub<P | [P.i : i in [n-7..n]] >;
> #Q eq 3^8;
true
> IsNormal(P,Q);
true
> Complements(P,Q);
[]
```

<a id="example-ex-1cc4cf"></a>
#### `Example: Dempwolff Group from a Core-Free Subgroup (ex-1cc4cf)`

As a more challenging example, we construct a permutation representation of the Dempwolff group. i.e., the non-split extension of $L_5(2)$ by its natural module (see also Example [Dempwolff Group Using a Chosen Subgroup](https://docs.magma-maths.org/FiniteGroups/CohomologyAndExtensions/extensions.md#example-ex-a52bf2) above).

```magma
> G := SL(5,2);
> M := GModule(G);
> CM := CohomologyModule(G,M);
> time CohomologyGroup(CM,2);
Full Vector space of degree 1 over GF(2)
Time: 10.370
> E, rho := Extension(CM,[1]);
> n := Ngens(E);
```

We look for a core-free subgroup $D$ of $E$ of order $16 \times 21$, which would have index 952320 in $E$. One of the four subgroups in the list `cands` below must have that property. The other three will have index 476160 and will not be core-free.

```magma
> S := Stabiliser(G, sub<V|V.2,V.3,V.4,V.5>) where V := VectorSpace(G);
> H := Subgroups(S : OrderEqual:=21)[1]`subgroup;
> EH1 := H.1 @@ rho;
> EH2 := H.2 @@ rho;
> cands := [ sub< E | [E.i : i in [n-3 .. n]], EH1, EH2 >,
>            sub< E | [E.i : i in [n-3 .. n]], E.(n-4)*EH1, EH2 >,
>            sub< E | [E.i : i in [n-3 .. n]], EH1, E.(n-4)*EH2 >,
>            sub< E | [E.i : i in [n-3 .. n]], E.(n-4)*EH1, E.(n-4)*EH2 > ];
> time for D in cands do
>   ct := CosetTable(E, D : CosetLimit:=10^7, Hard:=true);
>   if #ct eq 2 * Index(G,H) then
>     "Got it!";
>     break;
>   end if;
> end for;
Got it!
Time: 76.980
> P := CosetTableToPermutationGroup(E,ct);
> Degree(P);
952320
> time P := DegreeReduction(P);
Time: 20.850
> Degree(P);
7440
```

The smallest degree of a faithful permutation representation of this group is 3938, so we have not done badly!

<a id="example-ex-75b180"></a>
#### `Example: Cohomology of an Integral Permutation Module (ex-75b180)`

We investigate the cohomology of the permutation module for $A_5$ taken over the integers.

```magma
> G := Alt(5);
> M := PermutationModule(G,Integers());
> X := CohomologyModule(G,M);
> CohomologyGroup(X,0);
Full Quotient RSpace of degree 1 over Integer Ring
Column moduli:
[ 0 ]
> CohomologyGroup(X,1);
Full Quotient RSpace of degree 0 over Integer Ring
Column moduli:
[ ]
> CohomologyGroup(X,2);
Full Quotient RSpace of degree 1 over Integer Ring
Column moduli:
[ 3 ]
```

While we can form extensions of $M$ in this case, we are unable to determine the distinct extensions.

```magma
> E := Extension(X,[1]);
> E;
Finitely presented group E on 8 generators
Relations
    (E.4, E.5) = Id(E)
    (E.4, E.6) = Id(E)
    (E.4, E.7) = Id(E)
    (E.4, E.8) = Id(E)
    (E.5, E.6) = Id(E)
    (E.5, E.7) = Id(E)
    (E.5, E.8) = Id(E)
    (E.6, E.7) = Id(E)
    (E.6, E.8) = Id(E)
    (E.7, E.8) = Id(E)
    (E.1, E.4^-1) = Id(E)
    (E.1, E.5^-1) = Id(E)
    E.1^-1 * E.6 * E.1 * E.7^-1 = Id(E)
    E.1^-1 * E.7 * E.1 * E.8^-1 = Id(E)
    E.1^-1 * E.8 * E.1 * E.6^-1 = Id(E)
    E.2^-1 * E.4 * E.2 * E.5^-1 = Id(E)
    E.2^-1 * E.5 * E.2 * E.6^-1 = Id(E)
    E.2^-1 * E.6 * E.2 * E.4^-1 = Id(E)
    (E.2, E.7^-1) = Id(E)
    (E.2, E.8^-1) = Id(E)
    (E.3, E.4^-1) = Id(E)
    E.3^-1 * E.5 * E.3 * E.6^-1 = Id(E)
    E.3^-1 * E.6 * E.3 * E.7^-1 = Id(E)
    E.3^-1 * E.7 * E.3 * E.5^-1 = Id(E)
    (E.3, E.8^-1) = Id(E)
    E.1^-3 * E.4^-1 * E.5^-2 = Id(E)
    (E.1^-1 * E.3^-1)^2 = Id(E)
    E.3^-3 * E.4 * E.8^2 = Id(E)
    E.2^-1 * E.1 * E.3^-1 * E.2 * E.1^-1 * E.4^-1 * E.8^2 = Id(E)
    E.2 * E.3 * E.2 * E.3 * E.8^-4 = Id(E)
    E.2^-1 * E.3^-1 * E.2^2 * E.3^-1 * E.4 * E.5 * E.6^-2 * E.7 = Id(E)
> DE := DistinctExtensions(X);
Sorry, can only compute distinct extensions over prime field or finite abelian
group
```

### Constructing Distinct Extensions

The functions below compute the distinct extensions of one group by another.

<a id="function-grpcoh-distinctextensions"></a>
#### `DistinctExtensions(CM): ModCoho -> SeqEnum`

Given the cohomology module ${\rm CM}$ for the group $G$ acting on the module $M$, this function returns a sequence containing all of the distinct extensions of the module $M$ by $G$, each in the form returned by `Extension(CM, s)`. Two such extensions $E_1$, $E_2$ are regarded as being distinct if there is no group isomorphism from one to the other that maps the subgroup of $E_1$ corresponding to $M$ to the subgroup of $E_2$ corresponding to $M$.

This function may only be applied when the module $M$ used to define ${\rm CM}$ is defined over a finite field of prime order, the integers, or as an abelian group in a call of `CohomologyModule(G, Q, T)`.

<a id="example-ex-a94c9d"></a>
#### `Example: Extensions of a Trivial Module (ex-a94c9d)`

We consider the extensions of the trivial module over $GF(2)$ by the group $Z_2 \times Z_2$.

```magma
> G := DirectProduct(CyclicGroup(2),CyclicGroup(2));
> M := TrivialModule(G,GF(2));
> C := CohomologyModule(G,M);
> CohomologicalDimension(C,2);
3
> D := DistinctExtensions(C);
> #D;
4
```

So there are $2^3 = 8$ equivalence classes of extensions. But only four are distinct up to an isomorphism fixing the module. To examine them, we form permutation representations:

```magma
> DP := [ CosetImage(g,sub<g|>) : g in D ];
> [IsAbelian(d): d in DP];
[ true, true, false, false ]
// the first two are abelian
> [IsIsomorphic(d,DihedralGroup(4)) : d in DP];
[ false, false, true, false ]
// The third one is dihedral
> #[g : g in DP[4] | Order(g) eq 4];
6
```

So the fourth group must be the quaternion group.

<a id="function-extensionsofelementaryabeliangroup-rngintelt-rngintelt-grpperm"></a>
#### `ExtensionsOfElementaryAbelianGroup(p, d, G): RngIntElt, RngIntElt, GrpPerm -> SeqEnum`

Given a prime $p$, a positive integer $d$, and a permutation group $G$, this function returns a list of finitely presented groups which are isomorphic to the distinct extensions of an elementary abelian group $N$ of order $p^d$ by $G$. Two such extensions $E_1$ and $E_2$ with normal subgroups $N_1$ and $N_2$ isomorphic to $N$ are considered to be distinct if there is no group isomorphism $G_1 \rightarrow G_2$ that maps $N_1$ to $N_2$. Each extension $E$ is defined on $d + r$ generators, where $r$ is the number of generators of $G$. The last $d$ of these generators generate the normal subgroup $N$, and the quotient of $E$ by $N$ is a presentation of $G$ on its own generators.

<a id="example-ex-e97a7d"></a>
#### `Example: Extensions of an Elementary Abelian Group (ex-e97a7d)`

We form the distinct extensions of the elementary abelian group $Z_2 \times Z_2$ by the alternating group $A_4$.

```magma
> E := ExtensionsOfElementaryAbelianGroup(2,2,Alt(4));
> #E;
4
```

So there are four distinct extensions of an elementary group of order $4$ by $A_4$

```magma
> EP := [ CosetImage(g,sub<g|>) : g in E ];
> [#Centre(e): e in EP];
[ 1, 1, 4, 4 ]
```

The first two have nontrivial action on the module. The module generators in the extensions come last, so these will be $e.3$ and $e.4$. We can use this to test which of the extensions are non-split.

```magma
> [ Complements(e,sub<e|e.3,e.4>) eq [] : e in EP];
[ false, true, false, true ]
> AbelianInvariants(Sylow(EP[2],2));
[ 4, 4 ]
```

So the first and fourth extensions split and the second and third do not. $EP[2]$ has a normal abelian subgroup of type $[4,4]$.

<a id="function-extensionsofsolublegroup-grpperm-grpperm"></a>
#### `ExtensionsOfSolubleGroup(H, G): GrpPerm, GrpPerm -> SeqEnum`

Given permutation groups $G$ and $H$, where $H$ is soluble, this function returns a sequence of finitely presented groups, the terms of which are isomorphic to the distinct extensions of $H$ by $G$. Two such extensions $E_1$ and $E_2$ with normal subgroups $H_1$ and $H_2$ isomorphic to $H$ are considered to be distinct if there is no group isomorphism $G_1 \rightarrow G_2$ that maps $H_1$ to $H_2$. Each extension $E$ is defined on $d + r$ generators, where the last $d$ generators generate the normal subgroup $H$, and the quotient of $E$ by $H$ is a presentation for $G$ on its own generators. (The last $d$ generators of $E$ do not correspond to the original generators of $H$, but to a PC-generating sequence for $H$.)

<a id="example-ex-334528"></a>
#### `Example: Extensions of the Dihedral Group of Order 8 (ex-334528)`

How many extensions are there of a dihedral group of order $8$ by itself? This calculation is currently rather slow.

```magma
> D4 := DihedralGroup(4);
> time S := ExtensionsOfSolubleGroup(D4, D4);
Time: 120.210
> #S;
20
> ES := [CosetImage(g,sub<g|>) : g in S ];
> [#Centre(g): g in ES];
[ 4, 2, 4, 2, 4, 2, 2, 4, 2, 4, 4, 2, 4, 2, 4, 2, 4, 2, 4, 2 ]
> [NilpotencyClass(g) : g in ES ];
[ 2, 3, 2, 3, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 ]
> [Exponent(g): g in ES];
[ 4, 8, 4, 8, 4, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8 ]
```

<a id="example-ex-ff8afd"></a>
#### `Example: Extensions by a Cyclic Group of Order 4 (ex-ff8afd)`

We determine the distinct extensions of the abelian group with invariants $[2,4,4]$ by the cyclic group of order $4$.

```magma
> Z := Integers();
> G := PermutationGroup<4 | (1,2,4,3)>;
> Q := [2, 4, 4];
> T := [ Matrix(Z,3,3,[1,2,0,0,0,1,0,1,2]) ];
> CM := CohomologyModule(G, Q, T);
> extns := DistinctExtensions(CM);
> extns;
[
    Finitely presented group on 4 generators
    Relations
        $.2^2 = Id($)
        $.3^4 = Id($)
        $.4^4 = Id($)
        ($.2, $.3) = Id($)
        ($.2, $.4) = Id($)
        ($.3, $.4) = Id($)
        $.1^-1 * $.2 * $.1 * $.3^-2 * $.2^-1 = Id($)
        $.1^-1 * $.3 * $.1 * $.4^-1 = Id($)
        $.1^-1 * $.4 * $.1 * $.4^-2 * $.3^-1 = Id($)
        $.1^4 = Id($),

    Finitely presented group on 4 generators
    Relations
        $.2^2 = Id($)
        $.3^4 = Id($)
        $.4^4 = Id($)
        ($.2, $.3) = Id($)
        ($.2, $.4) = Id($)
        ($.3, $.4) = Id($)
        $.1^-1 * $.2 * $.1 * $.3^-2 * $.2^-1 = Id($)
        $.1^-1 * $.3 * $.1 * $.4^-1 = Id($)
        $.1^-1 * $.4 * $.1 * $.4^-2 * $.3^-1 = Id($)
        $.1^4 * $.2^-1 * $.3^-1 * $.4^-3 = Id($),

    Finitely presented group on 4 generators
    Relations
        $.2^2 = Id($)
        $.3^4 = Id($)
        $.4^4 = Id($)
        ($.2, $.3) = Id($)
        ($.2, $.4) = Id($)
        ($.3, $.4) = Id($)
        $.1^-1 * $.2 * $.1 * $.3^-2 * $.2^-1 = Id($)
        $.1^-1 * $.3 * $.1 * $.4^-1 = Id($)
        $.1^-1 * $.4 * $.1 * $.4^-2 * $.3^-1 = Id($)
        $.1^4 * $.3^-2 * $.4^-2 = Id($)
]
```

Since the extensions are soluble groups, we construct pc-presentations of each and verify that no two of the groups are isomorphic.

```magma
> E1 := SolubleQuotient(extns[1]);
> E2 := SolubleQuotient(extns[2]);
> E3 := SolubleQuotient(extns[3]);
> IsIsomorphic(E1, E2);
false
> IsIsomorphic(E1, E3);
false
> IsIsomorphic(E2, E3);
false
```

<a id="function-grpcoh-isextensionof"></a>
#### `IsExtensionOf(G): GrpPerm -> [], {}`

```magma
Degree     : RngInt                    Default: 0
MaxId      : RngInt                    Default: 15
DegreeBound: RngInt                    Default: Infinity()
```

For a given permutation group $G$, find normal abelian subgroup $A<G$ such that $G$ can be obtained by extending $G/A$ by $A$. The function returns a sequence of tuples $T$ containing

\- the cohomology module of $G/A$ acting on $A$

\- the $2$-cocycle as an element in $H^2(G/A, A)$ corresponding to $G$

\- the actual $2$-cocycle as a user defined function

\- a pair $\langle a, b\rangle$ giving the degree $a$ of the transitive group $G/A$ and the number $b$ identifying the group in the data base. If $b$ is larger than 20 (or `MaxId`) the hash value of the group is returned instead.

\- the abelian invariants of $A$

\- a set containing all pairs $\langle a, b\rangle$ such that $_aT_b$ can be obtained through this extension process.

If `DegreeBound` is given, only subgroups $A$ are considered such that $G/A$ has less than `DegreeBound` many elements. The list considered contains only subgroups that are maximal under the restrictions. If `Degree` is given, $G/A$ must have exactly `Degree` many elements.

<a id="function-isextensionof-grpperm"></a>
#### `IsExtensionOf(L): [GrpPerm] -> [], []`

```magma
Degree     : RngInt                    Default: 0
MaxId      : RngInt                    Default: 15
DegreeBound: RngInt                    Default: Infinity()
```

For all groups $G$ in $L$, [`IsExtensionOf`](https://docs.magma-maths.org/FiniteGroups/CohomologyAndExtensions/extensions-2.md#function-grpcoh-isextensionof) is called. The first sequence returned contains tuples as in [`IsExtensionOf`](https://docs.magma-maths.org/FiniteGroups/CohomologyAndExtensions/extensions-2.md#function-grpcoh-isextensionof) above. The sequence is minimal such that all groups in $L$ can be generated using the cohomology modules in the sequence. The second return value contains a set of pairs $\langle a, b\rangle$ describing all transitive groups that can be obtained through the processes.

<a id="group-cohomology"></a>
<a id="sectgrpcohom"></a>
### Finite Group Cohomology

This section describes Magma functions for computing the first cohomology group of a finite group with coefficients in a finite (not necessarily abelian) group. These functions are based on [[Hal05](https://docs.magma-maths.org/references.md#cite-sh)].

Let $\Gamma$ be a group. A group $A$ on which $\Gamma$ acts by group automorphisms from the right, is called a $\Gamma$*-group*. Given a $\Gamma$-group $A$, define

$$
H^0(\Gamma,A) :=  \{ a\in A \mid  a^\sigma = a  {\hbox{ for all }} \sigma\in\Gamma  \}.
$$

A $1$*-cocycle of* $\Gamma$ *on* $A$ is a map

$$
\alpha: \Gamma \rightarrow A, \quad  \sigma \mapsto \alpha_\sigma,
$$

such that

$$
\alpha_{\sigma\tau} = (\alpha_\sigma)^\tau  \alpha_\tau
          \quad\hbox{ for all } \sigma,\tau\in\Gamma.
$$

Two cocycles $\alpha,\beta$ on $A$ are called *cohomologous* (with respect to $a$) if there exists $a\in A$, such that $\beta_\sigma = a^{-\sigma} \cdot \alpha_\sigma \cdot a$ for all $\sigma\in\Gamma$. Note that being cohomologous is an equivalence relation.

We denote by $Z^1(\Gamma, A)$ the set of all $1$-cocycles of $\Gamma$ on $A$. We denote by $[\alpha]$ the equivalence class of $\alpha$ and by $H^1(\Gamma, A)$ the set of equivalence classes of $1$-cocycles.

$Z^1(\Gamma, A)$ and $H^1(\Gamma, A)$ are *pointed sets*.

The constant map $t: \sigma \mapsto 1$ is the distinguished element of $Z^1(\Gamma, A)$, called the *trivial* $1$*-cocycle*. Its cohomology class is the distinguished element of $H^1(\Gamma, A)$.

A twisted form $A_\beta$ of $A$ by the cocycle $\beta\in Z^1(\Gamma,A)$ is the same group $A$ but with a different action of $\Gamma$ on it, given by

$$
a * \sigma := a^{\sigma \alpha_\sigma}
     \quad\hbox{ for }\sigma\in\Gamma \hbox{ and } a\in A.
$$

<a id="gamma-groups"></a>
<a id="subsectggrp"></a>
#### Creation of Gamma-groups

This section describes intrinsics dealing with cocycles and the first cohomology.

<a id="function-gammagroup-grp-grp-map-grp-grpauto"></a>
##### `GammaGroup(Gamma, A, action): Grp, Grp, Map[Grp, GrpAuto] -> GGrp`

Given a group $A$ and a group $\Gamma$ acting on it by the map `action`, return the object of type `GGrp`, which is the Group $A$ together with this particular action of $\Gamma$. The map `action` must be a homomorphism from $\Gamma$ to the automorphism group of $A$.

If $B$ is a normal subgroup of $A$ and normalised by the action of $\Gamma$ on $A$ (thus a $\Gamma$-group itself), then the action of $\Gamma$ on $A$ induces in the natural way to $A/B$. It is possible to create such a group:

<a id="function-inducedgammagroup-ggrp-grp"></a>
##### `InducedGammaGroup(A, B): GGrp, Grp -> GGrp`

Given a $\Gamma$-group $A$ and a normal subgroup $B$ normalised by the action of $\Gamma$, return the induced $\Gamma$-group $A/B$.

<a id="example-ex-379641"></a>
##### `Example: Creating a Gamma-Group (ex-379641)`

Let $\Gamma$ act on $A$ by conjugation:

```magma
> A := SymmetricGroup(4);
> Gamma := sub<A|(1,2,3), (1,2)>;
> action := hom< Gamma -> Aut(A) |
>             g :-> iso< A -> A | a :-> a^g, a :-> a^(g^-1) > >;
> A := GammaGroup( Gamma, A, action );
> A;
Gamma-group:  Symmetric group acting on a set of cardinality 4
Order = 24 = 2^3 * 3
(1, 2, 3, 4)
(1, 2)
Gamma-action: Mapping from: GrpPerm: $, Degree 4 to
Set of all automorphisms of GrpPerm: $, Degree 4, Order 2^3 * 3
given by a rule [no inverse]
Gamma:        Permutation group acting on a set of cardinality 4
(1, 2, 3)
(1, 2)
>
```

and $B$ be a normal subgroup of $A$:

```magma
> B := AlternatingGroup(4);
> AmodB := InducedGammaGroup( A, B );
> AmodB;
Gamma-group:  Symmetric group acting on a set of cardinality 2
Order = 2
(1, 2)
(1, 2)
Gamma-action: Mapping from: GrpPerm: $, Degree 4, Order 2 * 3 to
Set of all automorphisms of GrpPerm: $, Degree 2, Order 2
given by a rule [no inverse]
Gamma:        Permutation group acting on a set of cardinality 4
Order = 6 = 2 * 3
(1, 2, 3)
(1, 2)
Induced from another Gamma-group
```

<a id="function-isnormalised-grp-map"></a>
##### `IsNormalised(B, action): Grp, Map -> BoolElt`

Returns `true` if the group $B$ is normalised by the action `action`, where `action` is as above.

<a id="function-isinduced-ggrp"></a>
##### `IsInduced(AmodB): GGrp -> BoolElt, GGrp, GGrp, Map, Map`

Returns `true` iff the $\Gamma$-group *AmodB* was created as an induced $\Gamma$-group. If it is, then the $\Gamma$-groups $A$, $B$, the projection and representative maps are returned as well.

<a id="access"></a>
<a id="subsectinfoggrp"></a>
#### Accessing Information

<a id="function-group-ggrp"></a>
##### `Group(A): GGrp -> Grp`

Returns the group $A$ as a `Grp` object to be used in Magma.

<a id="function-gammaaction-ggrp"></a>
##### `GammaAction(A): GGrp -> Map[Grp, GrpAuto]`

Returns the action of $\Gamma$ on $A$ as a map.

<a id="function-actinggroup-ggrp"></a>
##### `ActingGroup(A): GGrp -> Grp`

Returns the group $\Gamma$ acting on $A$.

<a id="subsectonecoc"></a>
<a id="id2"></a>
#### One Cocycles

<a id="function-onecocycle-ggrp-seqenum-grpelt"></a>
##### `OneCocycle(A, imgs): GGrp, SeqEnum[GrpElt] -> OneCoC`

<a id="function-onecocycle-ggrp-map-grp-grp"></a>
##### `OneCocycle(A, alpha): GGrp, Map[Grp,Grp] -> OneCoC`

```magma
Check: BoolElt                    Default: true
```

If the map $\alpha:\Gamma \rightarrow A$ or the sequence `imgs` of images of the generators $\Gamma.1,...,\Gamma.n$ defines a $1$-cocycle, return the $1$-cocycle. By default, the map is checked to define a $1$-cocycle. If it doesn’t, `OneCocycle` will abort with an error. This check can be disabled by setting the optional argument `Check` to `false`.

<a id="function-trivialonecocycle-ggrp"></a>
##### `TrivialOneCocycle(A): GGrp -> OneCoC`

Return the trivial $1$-cocycle.

<a id="function-isonecocycle-ggrp-seqenum-grpelt"></a>
##### `IsOneCocycle(A, imgs): GGrp, SeqEnum[GrpElt] -> BoolElt, OneCoC`

<a id="function-isonecocycle-ggrp-map-grp-grp"></a>
##### `IsOneCocycle(A, alpha): GGrp, Map[Grp,Grp] -> BoolElt, OneCoC`

Return true if the map $\alpha:\Gamma \rightarrow A$ or the sequence `imgs` of images of the generators $\Gamma.1,...,\Gamma.n$ defines a $1$-cocycle and `false` otherwise. If `true`, return the cocycle as the second argument.

Note that `IsOneCocycle` does not abort with an error in contrast to `OneCocycle` if the map does not define a cocycle.

<a id="function-arecohomologous-onecoc-onecoc"></a>
##### `AreCohomologous(alpha, beta): OneCoC, OneCoC -> BoolElt, GrpElt`

Return `true` if and only if the $1$-cocycles $\alpha$ and $\beta$ are cohomologous. If they are, return the intertwining element as the second return value.

<a id="function-cohomologyclass-onecoc"></a>
##### `CohomologyClass(alpha): OneCoC -> SetIndx[OneCoC]`

Return the cohomology class of the $1$-cocycle $\alpha$.

<a id="function-inducedonecocycle-ggrp-onecoc"></a>
##### `InducedOneCocycle(AmodB, alpha): GGrp, OneCoC -> OneCoC`

<a id="function-inducedonecocycle-ggrp-grp-onecoc"></a>
##### `InducedOneCocycle(A, B, alpha): GGrp, Grp, OneCoC -> OneCoC`

Given a $1$-cocycle on $A$, return the induced $1$-cocycle on *AmodB*. The second version will generate the induced $\Gamma$-group $A/B$ first.

<a id="function-extendedonecocycle-onecoc"></a>
##### `ExtendedOneCocycle(alpha): OneCoC -> SetEnum[OneCoC]`

```magma
OnlyOne: BoolElt                    Default: false
```

Given a $1$-cocycle on an induced $\Gamma$-group $A/B$, return the set of all non-cohomologous $1$-cocycles on $A$, which induce to $\alpha$. If the optional argument `OnlyOne` is `true`, the set will contain at most one $1$-cocycle. If $\alpha$ is not extendible, the returned set is empty.

<a id="function-extendedcohomologyclass-onecoc"></a>
##### `ExtendedCohomologyClass(alpha): OneCoC -> SetEnum[OneCoC]`

Given a $1$-cocycle on an induced $\Gamma$-group $A/B$, return the set of all non-cohomologous $1$-cocycles on $A$, which induce to a cocycle in the cohomology class of $\alpha$. If no such cocycles on $A$ exist, the returned set is empty.

<a id="function-gammagroup-onecoc"></a>
##### `GammaGroup(alpha): OneCoC -> GGrp`

Return the $\Gamma$-group on which $\alpha$ is defined.

<a id="function-cocyclemap-onecoc"></a>
##### `CocycleMap(alpha): OneCoC -> Map`

Return the `Map` object corresponding to $\alpha$.

<a id="one-cocycles-2"></a>
<a id="secttwistedtori"></a>
<a id="sectgaloiscohom"></a>
<a id="id3"></a>
#### Group Cohomology

<a id="function-cohomology-ggrp-rngintelt"></a>
##### `Cohomology(A, n): GGrp, RngIntElt -> SetEnum[OneCoC]`

Given a finite $\Gamma$-group $A$ and an integer $n$ (currently restricted to being $1$) return the $n$-th cohomology group $H^n(\Gamma, A)$. Since the group $A$ is not assumed to be abelian, only $n=0,1$ can be used. Currently, only $n=1$ implemented. (The zero cohomology of $A$ is the subgroup of $A$ centralised by $\Gamma$ and can be constructed using group theoretical methods available in Magma.)

<a id="function-onecohomology-ggrp"></a>
##### `OneCohomology(A): GGrp -> SetEnum[OneCoC]`

Return the first cohomology $H^1(\Gamma, A)$. as a set of representatives of all cohomology classes. If the group $A$ is abelian, existing code by Derek Holt is used (see Chapter [Cohomology and Extensions](https://docs.magma-maths.org/FiniteGroups/CohomologyAndExtensions/index-cohomology-and-extensions.md#grpcohom-main)). Otherwise use [[Hal05](https://docs.magma-maths.org/references.md#cite-sh)].

<a id="function-twistedgroup-ggrp-onecoc"></a>
##### `TwistedGroup(A, alpha): GGrp, OneCoC -> GGrp`

Given the $\Gamma$-group $A$ and a $1$-cocycle $\alpha$ on it, return the twisted $\Gamma$-group $A_\alpha$.

<a id="example-ex-82c924"></a>
##### `Example: Gamma-Group Cohomology of D8 (ex-82c924)`

First, we create the group $A=D_8$. The returned group is the usual permutation group on the octagon. $\Gamma$ is the Normaliser of $A$ in $S_8$ and is acting by conjugation.

```magma
> A := DihedralGroup(8);
> Gamma := sub< Sym(8) | (1, 2, 3, 4, 5, 6, 7, 8),
>    (1, 8)(2, 7)(3, 6)(4, 5), (2, 4)(3, 7)(6, 8) >;
> A^Gamma eq A;
true
> Gamma;
Permutation group Gamma acting on a set of cardinality 8
Order = 32 = 2^5
    (1, 2, 3, 4, 5, 6, 7, 8)
    (1, 8)(2, 7)(3, 6)(4, 5)
    (2, 4)(3, 7)(6, 8)
> action := hom< Gamma -> Aut(A) |
>             g :-> iso< A -> A | a :-> a^g, a :-> a^(g^-1) > >;
> A := GammaGroup( Gamma, A, action );
```

Now let $B$ be the center of $A$ and create the induced $\Gamma$-group $A/B$:

```magma
> B := Center(Group(A));
> AmodB := InducedGammaGroup(A, B);
```

Create the trivial $1$-cocycle on $A/B$ and compute its cohomology class:

```magma
> triv := TrivialOneCocycle(AmodB);
> CohomologyClass( triv );
{@
    One-Cocycle
    defined by [
    Id($),
    Id($),
    Id($)
    ],
    One-Cocycle
    defined by [
    Id($),
    (1, 4)(2, 7)(3, 8)(5, 6),
    (1, 4)(2, 7)(3, 8)(5, 6)
    ],
    One-Cocycle
    defined by [
    (1, 4)(2, 7)(3, 8)(5, 6),
    Id($),
    (1, 4)(2, 7)(3, 8)(5, 6)
    ],
    One-Cocycle
    defined by [
    (1, 4)(2, 7)(3, 8)(5, 6),
    (1, 4)(2, 7)(3, 8)(5, 6),
    Id($)
    ]
@}
```

Pick one of the cocycles in this class and compute the intertwining element:

```magma
> alpha := Random($1);alpha;
One-Cocycle
defined by [
(1, 4)(2, 7)(3, 8)(5, 6),
(1, 4)(2, 7)(3, 8)(5, 6),
Id($)
]
> bo, a := AreCohomologous(alpha,triv);
> bo; a;
true
(1, 5)(2, 8)(3, 7)(4, 6)
```

Now create another cocycle on $A/B$ and extend it to $A$:

```magma
> alpha := OneCocycle( AmodB,
>                [Group(AmodB)| (1, 7, 4, 2)(3, 5, 8, 6),
>                               (1, 2, 4, 7)(3, 6, 8, 5),
>                               1 ] );
> ExtendedOneCocycle(alpha);
{
    One-Cocycle
    defined by [
    (1, 4, 7, 2, 5, 8, 3, 6),
    (1, 2, 3, 4, 5, 6, 7, 8),
    Id($)
    ],
    One-Cocycle
    defined by [
    (1, 8, 7, 6, 5, 4, 3, 2),
    (1, 6, 3, 8, 5, 2, 7, 4),
    Id($)
    ]
}
```

Pick a cocycle $\beta$ in this set and check if it really induces to $\alpha$:

```magma
> beta := Rep($1);
> InducedOneCocycle(AmodB, beta) eq alpha;
true
```

Finally, create the twisted group $A_\beta$:

```magma
> A_beta := TwistedGroup(A, beta);
> A_beta;
Gamma-group:  Permutation group acting on a set of cardinality 8
Order = 16 = 2^4
(1, 2, 3, 4, 5, 6, 7, 8)
(1, 8)(2, 7)(3, 6)(4, 5)
Gamma-action: Mapping from: GrpPerm: $, Degree 8, Order 2^5 to
Set of all automorphisms of GrpPerm: $, Degree 8, Order 2^4
given by a rule [no inverse]
Gamma:        Permutation group acting on a set of cardinality 8
Order = 32 = 2^5
(1, 2, 3, 4, 5, 6, 7, 8)
(1, 8)(2, 7)(3, 6)(4, 5)
(2, 4)(3, 7)(6, 8)
>
```

<a id="grpred"></a>
<a id="id1"></a>
## Reductive Groups

- [Introduction](https://docs.magma-maths.org/FiniteGroups/ReductiveGroups/introduction.md)
  - [Definitions and Background](https://docs.magma-maths.org/FiniteGroups/ReductiveGroups/introduction.md#definitions-and-background)
  - [Categories](https://docs.magma-maths.org/FiniteGroups/ReductiveGroups/introduction.md#categories)
- [Creation of Reductive Groups](https://docs.magma-maths.org/FiniteGroups/ReductiveGroups/creation.md)
  - [`ReductiveGroup(G0, Comp): GrpLie, Grp → GrpRed`](https://docs.magma-maths.org/FiniteGroups/ReductiveGroups/creation.md#function-reductivegroup-grplie-grp)
  - [`ReductiveGroup(group_data): List → GrpRed`](https://docs.magma-maths.org/FiniteGroups/ReductiveGroups/creation.md#function-reductivegroup-list)
  - [`SymplecticGroup(V): SpcPlr → GrpRed`](https://docs.magma-maths.org/FiniteGroups/ReductiveGroups/creation.md#function-symplecticgroup-spcplr)
  - [`SymplecticGroup(n, F): RngIntElt, Fld → GrpRed`](https://docs.magma-maths.org/FiniteGroups/ReductiveGroups/creation.md#function-symplecticgroup-rngintelt-fld)
  - [`SymplecticGroup(Q): AlgMatElt[Fld] → GrpRed`](https://docs.magma-maths.org/FiniteGroups/ReductiveGroups/creation.md#function-symplecticgroup-algmatelt-fld)
  - [`SymplecticGroup(Q): AlgMatElt[Rng] → GrpRed`](https://docs.magma-maths.org/FiniteGroups/ReductiveGroups/creation.md#function-symplecticgroup-algmatelt-rng)
  - [`OrthogonalGroup(V): SpcPlr → GrpRed`](https://docs.magma-maths.org/FiniteGroups/ReductiveGroups/creation.md#function-orthogonalgroup-spcplr)
  - [`OrthogonalGroup(n, F): RngIntElt, Fld → GrpRed`](https://docs.magma-maths.org/FiniteGroups/ReductiveGroups/creation.md#function-orthogonalgroup-rngintelt-fld)
  - [`OrthogonalGroup(Q): AlgMatElt[Fld] → GrpRed`](https://docs.magma-maths.org/FiniteGroups/ReductiveGroups/creation.md#function-orthogonalgroup-algmatelt-fld)
  - [`OrthogonalGroup(Q): AlgMatElt[Rng] → GrpRed`](https://docs.magma-maths.org/FiniteGroups/ReductiveGroups/creation.md#function-orthogonalgroup-algmatelt-rng)
  - [`SpecialOrthogonalGroup(V): SpcPlr → GrpRed`](https://docs.magma-maths.org/FiniteGroups/ReductiveGroups/creation.md#function-specialorthogonalgroup-spcplr)
  - [`SpecialOrthogonalGroup(n, F): RngIntElt, Fld → GrpRed`](https://docs.magma-maths.org/FiniteGroups/ReductiveGroups/creation.md#function-specialorthogonalgroup-rngintelt-fld)
  - [`SpecialOrthogonalGroup(Q): AlgMatElt[Fld] → GrpRed`](https://docs.magma-maths.org/FiniteGroups/ReductiveGroups/creation.md#function-specialorthogonalgroup-algmatelt-fld)
  - [`SpecialOrthogonalGroup(Q): AlgMatElt[Rng] → GrpRed`](https://docs.magma-maths.org/FiniteGroups/ReductiveGroups/creation.md#function-specialorthogonalgroup-algmatelt-rng)
  - [`UnitaryGroup(V): SpcPlr → GrpRed`](https://docs.magma-maths.org/FiniteGroups/ReductiveGroups/creation.md#function-unitarygroup-spcplr)
  - [`UnitaryGroup(n, F): RngIntElt, Fld → GrpRed`](https://docs.magma-maths.org/FiniteGroups/ReductiveGroups/creation.md#function-unitarygroup-rngintelt-fld)
  - [`UnitaryGroup(Q): AlgMatElt[Fld] → GrpRed`](https://docs.magma-maths.org/FiniteGroups/ReductiveGroups/creation.md#function-unitarygroup-algmatelt-fld)
  - [`UnitaryGroup(Q): AlgMatElt[Rng] → GrpRed`](https://docs.magma-maths.org/FiniteGroups/ReductiveGroups/creation.md#function-unitarygroup-algmatelt-rng)
- [Properties of Reductive Groups](https://docs.magma-maths.org/FiniteGroups/ReductiveGroups/properties.md)
  - [`ConnectedComponent(G): GrpRed → GrpRed`](https://docs.magma-maths.org/FiniteGroups/ReductiveGroups/properties.md#function-connectedcomponent-grpred)
  - [`ComponentGroup(G): GrpRed → GrpRed`](https://docs.magma-maths.org/FiniteGroups/ReductiveGroups/properties.md#function-componentgroup-grpred)
  - [`SplittingField(G): GrpRed → Fld`](https://docs.magma-maths.org/FiniteGroups/ReductiveGroups/properties.md#function-splittingfield-grpred)
  - [`FieldOfDefinition(G): GrpRed → Fld`](https://docs.magma-maths.org/FiniteGroups/ReductiveGroups/properties.md#function-fieldofdefinition-grpred)
  - [`BaseRing(G): GrpRed → Fld`](https://docs.magma-maths.org/FiniteGroups/ReductiveGroups/properties.md#function-basering-grpred)
  - [`CartanName(G): GrpRed → MonStgElt`](https://docs.magma-maths.org/FiniteGroups/ReductiveGroups/properties.md#function-cartanname-grpred)
  - [`InnerForm(G, i): GrpRed, RngIntElt → SpcPlr`](https://docs.magma-maths.org/FiniteGroups/ReductiveGroups/properties.md#function-innerform-grpred-rngintelt)
  - [`InnerForms(G): GrpRed → [ SpcPlr ]`](https://docs.magma-maths.org/FiniteGroups/ReductiveGroups/properties.md#function-innerforms-grpred)
  - [`Dimension(G): GrpRed → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/ReductiveGroups/properties.md#function-dimension-grpred)
  - [`Degree(G): GrpRed → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/ReductiveGroups/properties.md#function-degree-grpred)
  - [`Rank(G): GrpRed → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/ReductiveGroups/properties.md#function-rank-grpred)
  - [Predicates](https://docs.magma-maths.org/FiniteGroups/ReductiveGroups/properties.md#predicates)
    - [`IsConnected(G): GrpRed → BoolElt`](https://docs.magma-maths.org/FiniteGroups/ReductiveGroups/properties.md#function-isconnected-grpred)
    - [`IsOrthogonal(G): GrpRed → BoolElt`](https://docs.magma-maths.org/FiniteGroups/ReductiveGroups/properties.md#function-isorthogonal-grpred)
    - [`IsSpecialOrthogonal(G): GrpRed → BoolElt`](https://docs.magma-maths.org/FiniteGroups/ReductiveGroups/properties.md#function-isspecialorthogonal-grpred)
    - [`IsSymplectic(G): GrpRed → BoolElt`](https://docs.magma-maths.org/FiniteGroups/ReductiveGroups/properties.md#function-issymplectic-grpred)
    - [`IsUnitary(G): GrpRed → BoolElt`](https://docs.magma-maths.org/FiniteGroups/ReductiveGroups/properties.md#function-isunitary-grpred)
    - [`IsCompact(G): GrpRed → BoolElt`](https://docs.magma-maths.org/FiniteGroups/ReductiveGroups/properties.md#function-iscompact-grpred)
- [Operations on Reductive Groups](https://docs.magma-maths.org/FiniteGroups/ReductiveGroups/ops.md)
  - [`GetSplitPrimeWithSquare(G): GrpRed → RngIntElt`](https://docs.magma-maths.org/FiniteGroups/ReductiveGroups/ops.md#function-getsplitprimewithsquare-grpred)
  - [Base change](https://docs.magma-maths.org/FiniteGroups/ReductiveGroups/ops.md#base-change)
    - [`ChangeRing(G, S): GrpRed, Rng → GrpRed`](https://docs.magma-maths.org/FiniteGroups/ReductiveGroups/ops.md#function-changering-grpred-rng)
- [Elements of Reductive Groups](https://docs.magma-maths.org/FiniteGroups/ReductiveGroups/elements.md)
  - [`Parent(g): GrpRedElt → GrpRed`](https://docs.magma-maths.org/FiniteGroups/ReductiveGroups/elements.md#function-parent-grpredelt)
  - [Arithmetic of Elements](https://docs.magma-maths.org/FiniteGroups/ReductiveGroups/elements.md#arithmetic-of-elements)
    - [`x * y: GrpRedElt, GrpRedElt → GrpRedElt`](https://docs.magma-maths.org/FiniteGroups/ReductiveGroups/elements.md#operation-op-times-grpredelt-grpredelt)
    - [`x ^ n: GrpRedElt, RngIntElt → GrpRedElt`](https://docs.magma-maths.org/FiniteGroups/ReductiveGroups/elements.md#operation-op-pow-grpredelt-rngintelt)
  - [Other Operations with Elements](https://docs.magma-maths.org/FiniteGroups/ReductiveGroups/elements.md#other-operations-with-elements)
    - [`ElementToSequence(x): GrpRedElt → SeqEnum`](https://docs.magma-maths.org/FiniteGroups/ReductiveGroups/elements.md#function-elementtosequence-grpredelt)
    - [`Eltseq(x): GrpRedElt → SeqEnum`](https://docs.magma-maths.org/FiniteGroups/ReductiveGroups/elements.md#function-eltseq-grpredelt)
- [Bibliography](https://docs.magma-maths.org/FiniteGroups/ReductiveGroups/bibliography.md)

### Introduction

The first version of this package was released in V2.29 (October 2025). It has been developed further in each subsequent release, and is still under development. We encourage users to send feedback regarding the package, and desirable features or improvements.

The package contains implementations of certain reductive groups. The primary focus is on orthogonal and unitary groups.

The main purposes of the current functionality are to serve as a basis for representations of reductive groups and algebraic modular forms.

#### Definitions and Background

Reductive groups are group schemes with a trivial unipotent radical (maximal connected unipotent subgroup). Alternatively, these are the groups whose category of representations is semisimple.

If $G$ is a reductive group, the connected component of the identity $G^{\circ}$ is a normal subgroup, and the quotient $G / G^{\circ}$ is the *component group* of $G$. At the moment, only split extensions $G \simeq G^{\circ} \times (G / G^{\circ})$ are supported.

If $G$ is connected, then $R(G)$, the radical of $G$ (maximal connected solvable subgroup), is central and $G / R(G)$ is semisimple. If $G$ is connected and semisimple, it is isomorphic to a direct product $G_1 \times \cdots \times G_n$ of almost-simple groups $G_1, \ldots, G_n$, where almost-simple means that they are isogenous to a simple group.

Assume that $G$ is defined over a field $F$, and let $G_{\overline{F}} := G \times_{F} \overline{F}$ be its base change to $\overline{F}$. When $G_{\overline{F}}$ is connected and almost-simple, it is completely determined by its root datum. In order to determine $G$, one needs to specify an element of $H^1({\operatorname{Gal}}(\overline{F}/ F), G)$, or equivalently a Witt index and a semisimple anisotropic kernel. [[Tit66](https://docs.magma-maths.org/references.md#cite-tits1966classification), Theorem 2] For the classical groups, this can be done by specifying a division algebra $H$ over $F$ and a sesquilinear bilinear form over $H$. At the moment, the package only supports the case of $H$ a field, and the bilinear form either symmetric or Hermitian with respect to complex conjugation.

Every reductive group can be embedded into ${\rm GL}_n$. In Magma, a `GrpRed` object consists of the group $G$ together with its embedding $G \to {\rm GL}_n$.

#### Categories

The Magma category for reductive groups is `GrpRed`, while elements in these spaces have type `GrpRedElt`.

### Creation of Reductive Groups

In the current implementation only certain reductive groups are supported. In particular, the component group is assumed to give rise to a split extension, and if $G^{\circ} \simeq G_1 \times \cdots \times G_n$ is a product of almost-simple groups, the only inner forms $G_1, \ldots G_n$ that are supported are either orthogonal or hermitian, over a number field.

In future releases it will be possible to create more reductive groups.

<a id="function-reductivegroup-grplie-grp"></a>
#### `ReductiveGroup(G0, Comp): GrpLie, Grp -> GrpRed`

```magma
InnerForms: [ AlgMatElt ]                    Default: []
```

Creates the reductive group with connected component of the identity `G0` and component group `Comp`, such that the extension is split. `InnerForms` is a list of inner forms, listing for each non-toroidal factor the inner form over the base field.

<a id="function-reductivegroup-list"></a>
#### `ReductiveGroup(group_data): List -> GrpRed`

Creates the reductive group described by `group_data`, where `group_data` is formed as a list of pairs, each pair consisting of a field name and field value. The fields are `"INNER_FORMS"`, `"ROOT_DATUM"`, `"BASE_FIELD"`, and `"COMP_GROUP"`.

The value of the field `"BASE_FIELD"` should be of type `Fld` and consist of the field of definition of $G$. The value of the field `"ROOT_DATUM"` should be a list of $4$ pairs, consisting of a field name and field value, where the field names are `"SIMPLE_ROOTS"`, `"SIMPLE_COROOTS"`, `"SIGNS"`, and `"TYPES"`, and their values should be the same as in the constructor for `RootDatum`, two matrices representing the simple roots and coroots, signs for each extraspecial pair, and Cartan type.

<a id="function-symplecticgroup-spcplr"></a>
#### `SymplecticGroup(V): SpcPlr -> GrpRed`

<a id="function-symplecticgroup-rngintelt-fld"></a>
#### `SymplecticGroup(n, F): RngIntElt, Fld -> GrpRed`

<a id="function-symplecticgroup-algmatelt-fld"></a>
#### `SymplecticGroup(Q): AlgMatElt[Fld] -> GrpRed`

<a id="function-symplecticgroup-algmatelt-rng"></a>
#### `SymplecticGroup(Q): AlgMatElt[Rng] -> GrpRed`

The symplectic group ${\operatorname{Sp}}(V)$ associated to the symplectic space $V$, the standard symplectic form on $F^n$ (where $n$ must be even), or the alternating form $Q$.

<a id="function-orthogonalgroup-spcplr"></a>
#### `OrthogonalGroup(V): SpcPlr -> GrpRed`

<a id="function-orthogonalgroup-rngintelt-fld"></a>
#### `OrthogonalGroup(n, F): RngIntElt, Fld -> GrpRed`

<a id="function-orthogonalgroup-algmatelt-fld"></a>
#### `OrthogonalGroup(Q): AlgMatElt[Fld] -> GrpRed`

<a id="function-orthogonalgroup-algmatelt-rng"></a>
#### `OrthogonalGroup(Q): AlgMatElt[Rng] -> GrpRed`

The orthogonal group ${\rm O}(V)$ associated to the quadratic space $V$, the standard split quadratic form on $F^n$, or the symmetric form $Q$.

<a id="function-specialorthogonalgroup-spcplr"></a>
#### `SpecialOrthogonalGroup(V): SpcPlr -> GrpRed`

<a id="function-specialorthogonalgroup-rngintelt-fld"></a>
#### `SpecialOrthogonalGroup(n, F): RngIntElt, Fld -> GrpRed`

<a id="function-specialorthogonalgroup-algmatelt-fld"></a>
#### `SpecialOrthogonalGroup(Q): AlgMatElt[Fld] -> GrpRed`

<a id="function-specialorthogonalgroup-algmatelt-rng"></a>
#### `SpecialOrthogonalGroup(Q): AlgMatElt[Rng] -> GrpRed`

The special orthogonal group ${\operatorname{SO}}(V)$ associated to the quadratic space $V$, the standard split quadratic form on $F^n$, or the symmetric form $Q$.

<a id="function-unitarygroup-spcplr"></a>
#### `UnitaryGroup(V): SpcPlr -> GrpRed`

<a id="function-unitarygroup-rngintelt-fld"></a>
#### `UnitaryGroup(n, F): RngIntElt, Fld -> GrpRed`

<a id="function-unitarygroup-algmatelt-fld"></a>
#### `UnitaryGroup(Q): AlgMatElt[Fld] -> GrpRed`

<a id="function-unitarygroup-algmatelt-rng"></a>
#### `UnitaryGroup(Q): AlgMatElt[Rng] -> GrpRed`

The unitary group $U(V)$ associated to the hermitian space $V$, the standard hermitian form on $F^n$, or the hermitian form $Q$.

### Properties of Reductive Groups

<a id="function-connectedcomponent-grpred"></a>
#### `ConnectedComponent(G): GrpRed -> GrpRed`

The connected component of the identity, $G^{\circ}$.

<a id="function-componentgroup-grpred"></a>
#### `ComponentGroup(G): GrpRed -> GrpRed`

The component group of $G$.

<a id="function-splittingfield-grpred"></a>
#### `SplittingField(G): GrpRed -> Fld`

The field over which $G$ splits.

<a id="function-fieldofdefinition-grpred"></a>
#### `FieldOfDefinition(G): GrpRed -> Fld`

<a id="function-basering-grpred"></a>
#### `BaseRing(G): GrpRed -> Fld`

The field of definition of $G$.

<a id="function-cartanname-grpred"></a>
#### `CartanName(G): GrpRed -> MonStgElt`

A string concatenating the Cartan types of all simple factors and tori of the connected component of $G$.

<a id="function-innerform-grpred-rngintelt"></a>
#### `InnerForm(G, i): GrpRed, RngIntElt -> SpcPlr`

The inner form corresponding to the $i$-th simple factor.

<a id="function-innerforms-grpred"></a>
#### `InnerForms(G): GrpRed -> [ SpcPlr ]`

The inner forms defining the simple factors of $G$.

<a id="function-dimension-grpred"></a>
#### `Dimension(G): GrpRed -> RngIntElt`

<a id="function-degree-grpred"></a>
#### `Degree(G): GrpRed -> RngIntElt`

Returns $n$ such that $G$ embeds into ${\rm GL}_n$ through the representation via its inner forms.

<a id="function-rank-grpred"></a>
#### `Rank(G): GrpRed -> RngIntElt`

The rank of $G$.

#### Predicates

<a id="function-isconnected-grpred"></a>
##### `IsConnected(G): GrpRed -> BoolElt`

Returns `true` iff $G$ is connected.

<a id="function-isorthogonal-grpred"></a>
##### `IsOrthogonal(G): GrpRed -> BoolElt`

Returns `true` iff $G$ is an orthogonal group.

<a id="function-isspecialorthogonal-grpred"></a>
##### `IsSpecialOrthogonal(G): GrpRed -> BoolElt`

Returns `true` iff $G$ is a special orthogonal group.

<a id="function-issymplectic-grpred"></a>
##### `IsSymplectic(G): GrpRed -> BoolElt`

Returns `true` iff $G$ is a symplectic group.

<a id="function-isunitary-grpred"></a>
##### `IsUnitary(G): GrpRed -> BoolElt`

Returns `true` iff $G$ is a unitary group.

<a id="function-iscompact-grpred"></a>
##### `IsCompact(G): GrpRed -> BoolElt`

Returns `true` iff $G$ is a compact form. Only relevant for groups defined over number fields.

### Operations on Reductive Groups

<a id="function-getsplitprimewithsquare-grpred"></a>
#### `GetSplitPrimeWithSquare(G): GrpRed -> RngIntElt`

```magma
LowerBound: RngIntElt                    Default: 2
```

Given a reductive group $G$ over ${\mathbb{Q}}$, returns a prime $p$ where $G_p$ is split, and $2$ is a square.

#### Base change

<a id="function-changering-grpred-rng"></a>
##### `ChangeRing(G, S): GrpRed, Rng -> GrpRed`

Given a reductive group $G$ with base ring $R$, together with a ring $S$, construct the reductive group $G_S$ with base ring $S$ obtained by coercing the coefficients of elements of $R$ into $S$.

### Elements of Reductive Groups

<a id="function-parent-grpredelt"></a>
#### `Parent(g): GrpRedElt -> GrpRed`

The parent of $g$.

#### Arithmetic of Elements

<a id="operation-op-times-grpredelt-grpredelt"></a>
##### `x * y: GrpRedElt, GrpRedElt -> GrpRedElt`

The product of elements $x$ and $y$ of a reductive group.

<a id="operation-op-pow-grpredelt-rngintelt"></a>
##### `x ^ n: GrpRedElt, RngIntElt -> GrpRedElt`

The product of the element $x$ of a reductive group with itself $n$ times.

#### Other Operations with Elements

<a id="function-elementtosequence-grpredelt"></a>
##### `ElementToSequence(x): GrpRedElt -> SeqEnum`

<a id="function-eltseq-grpredelt"></a>
##### `Eltseq(x): GrpRedElt -> SeqEnum`

Given an element $x$ of a reductive group $G$, returns a sequence representing $x$.
