.. _SectGrpLieAuto:

.. _automorphisms:

Automorphisms
=============

The following functions construct the standard automorphisms of a group of Lie
type, as described in :cite:`Carter-small` (except for the graph
automorphism of :math:`G_2`). In many cases, including the finite groups, every
automorphism is a product of these standard automorphisms.

.. _SubsectGrpLieAutoBasic:

.. _automorphisms-basic:

Basic Functionality
-------------------

.. magma:function:: AutomorphismGroup(G)
   :input_types: GrpLie
   :output_types: GrpLieAuto
   :label: AutomorphismGroup_GrpLie

   Automorphism group of a group of Lie type :math:`G`.

.. magma:function:: IdentityAutomorphism(G)
   :input_types: GrpLie
   :output_types: GrpLieAutoElt
   :label: IdentityAutomorphism_GrpLie

.. magma:function:: One(A)
   :input_types: GrpLieAuto
   :output_types: GrpLieAutoElt
   :label: One_GrpLieAuto

.. magma:function:: Id(A)
   :input_types: GrpLieAuto
   :output_types: GrpLieAutoElt
   :label: Id_GrpLieAuto

   The identity automorphism of the group of Lie type :math:`G`.

.. magma:function:: Mapping(a)
   :input_types: GrpLieAutoElt
   :output_types: Map
   :label: Mapping_GrpLieAutoElt

   The map object associated with the automorphism :math:`a`.

.. magma:function:: Automorphism(m)
   :input_types: Map
   :output_types: GrpLieAutoElt
   :label: Automorphism_Map

   Given a map object :math:`m` from :math:`G` to :math:`G`, which is an
   isomorphism, returns the associated automorphism as an automorphism of a group
   of Lie type.

.. magma:operation:: h * g
   :input_types: GrpLieAutoElt, GrpLieAutoElt
   :output_types: GrpLieAutoElt
   :label: op_times_GrpLieAutoElt_GrpLieAutoElt

   The composition of the group of Lie type automorphisms :math:`h` and :math:`g`.

.. magma:operation:: h \^ n
   :input_types: GrpLieAutoElt, RngIntElt
   :output_types: GrpLieAutoElt

   The :math:`n`\ th power of the group of Lie type automorphism :math:`h`.

.. magma:operation:: g \^ h
   :input_types: GrpLieAutoElt, GrpLieAutoElt
   :output_types: GrpLieAutoElt

   The conjugate :math:`h^{-1}gh`, where :math:`g` and :math:`h` are group of Lie
   type automorphisms :math:`g` and :math:`h`

.. magma:function:: Domain(A)
   :input_types: GrpLieAuto
   :output_types: GrpLie
   :label: Domain_GrpLieAuto

.. magma:function:: Codomain(A)
   :input_types: GrpLieAuto
   :output_types: GrpLie
   :label: Codomain_GrpLieAuto

.. magma:function:: Domain(h)
   :input_types: GrpLieAutoElt
   :output_types: GrpLie
   :label: Domain_GrpLieAutoElt

.. magma:function:: Codomain(h)
   :input_types: GrpLieAutoElt
   :output_types: GrpLie
   :label: Codomain_GrpLieAutoElt

   Domain or codomain of an automorphism of a group of Lie type or of the group of
   automorphisms.

.. _SubsectGrpLieAutoSpecial:

.. _automorphisms-special:

Constructing Special  Automorphisms
-----------------------------------

.. magma:function:: InnerAutomorphism(G, x)
   :input_types: GrpLie, GrpLieElt
   :output_types: Map
   :label: InnerAutomorphism_GrpLie_GrpLieElt

   The inner automorphism taking :math:`g\in G` to :math:`g^x`, where :math:`x` is
   an element of the group of Lie type :math:`G`.

.. magma:function:: DiagonalAutomorphism(G, v)
   :input_types: GrpLie, ModTupRngElt
   :output_types: Map
   :label: DiagonalAutomorphism_GrpLie_ModTupRngElt

   The diagonal automorphism of the semisimple group of Lie type :math:`G` given by
   the vector :math:`v`. Let :math:`n` be the semisimple rank of :math:`G` and let
   :math:`k` be its base field. Then :math:`v` must be a vector in :math:`k^n` with
   every component nonzero. The function returns the automorphism given by the
   character :math:`\chi` defined by :math:`\chi(\alpha_i)=v_i`, where
   :math:`\alpha_i` is the :math:`i`\ th simple root. Since our groups are
   algebraic, a diagonal automorphism is just a special case of an inner
   automorphism.

.. magma:function:: GraphAutomorphism(G, p)
   :input_types: GrpLie, GrpPermElt
   :output_types: Map
   :label: GraphAutomorphism_GrpLie_GrpPermElt

.. magma:function:: DiagramAutomorphism(G, p)
   :input_types: GrpLie, GrpPermElt
   :output_types: Map
   :label: DiagramAutomorphism_GrpLie_GrpPermElt
   :parameters: SimpleSigns : Any : 1

   The graph automorphism of the group of Lie type :math:`G` given by the
   permutation :math:`p`. The permutation must act on the indices of simple roots
   of :math:`G` or the indices of all roots of :math:`G`. The graph automorphism of
   the group of type :math:`G_2` has not been implemented yet.

   The optional parameter ``SimpleSigns`` can be used to specify the signs
   corresponding to each simple root. This should either be a sequence of integers
   :math:`\pm1`, or a single integer :math:`\pm1`.

.. magma:function:: FieldAutomorphism(G, sigma)
   :input_types: GrpLie, Map
   :output_types: Map
   :label: FieldAutomorphism_GrpLie_Map

   The field automorphism of the group of Lie type :math:`G` induced by
   :math:`\sigma`, an element of the automorphism group of the base field of
   :math:`G`

.. magma:function:: RandomAutomorphism(G)
   :input_types: GrpLie
   :output_types: GrpLieAutoElt
   :label: RandomAutomorphism_GrpLie

.. magma:function:: Random(A)
   :input_types: GrpLieAuto
   :output_types: GrpLieAutoElt
   :label: Random_GrpLieAuto

   A random element in :math:`A`, the automorphism group of the group of Lie type
   :math:`G`.

.. magma:function:: DualityAutomorphism(G)
   :input_types: GrpLie
   :output_types: GrpLieAutoElt
   :label: DualityAutomorphism_GrpLie

   The duality automorphism of :math:`G`. This is an automorphism that takes every
   unipotent term :math:`x_r(t)` to :math:`x_s(\pm t)`, where :math:`s=`
   ``Negative(RootDatum(G),r))``.

.. magma:function:: FrobeniusMap(G,q)
   :input_types: GrpLie, RngIntElt
   :output_types: GrpLieAutoElt
   :label: FrobeniusMap_GrpLie_RngIntElt

   The Frobenius automorphism of the finite group of Lie type :math:`G` gotten by
   :math:`q`\ th powers in the base field. The integer :math:`q` must be a power of
   the characteristic of the base field of :math:`G`.

.. _SubsectGrpLieAutoSpecial:

.. _automorphisms-ops:

Operations and Properties of Automorphisms
------------------------------------------

.. magma:function:: DecomposeAutomorphism(h)
   :input_types: GrpLieAutoElt
   :output_types: GrpLieAutoElt, GrpLieAutoElt,
   :label: DecomposeAutomorphism_GrpLieAutoElt

GrpLieAutoElt, Rec

Given a group of Lie type automorphism :math:`h`, this returns a field
automorphism :math:`f`, a graph automorphism :math:`g` and an inner automorphism
:math:`i` such that :math:`h=fgi`. This only works for groups defined over
finite fields. The algorithm is due to Scott Murray and Sergei Haller.

.. magma:function:: IsAlgebraic(h)
   :input_types: GrpLieAutoElt
   :output_types: BoolElt
   :label: IsAlgebraic_GrpLieAutoElt

   Returns ``true`` if and only if the automorphism :math:`h` is algebraic.

.. magma:example:: Example: Automorphism
   :label: Automorphism

   Some automorphisms of :math:`B_2(4)` The automorphism of :math:`B_2(4)` whose
   stabiliser is :math:`{}^2\!B_2(4)` is constructed by the following code.

   .. code-block:: magma

      > G := GroupOfLieType("B2", GF(4));
      > A := AutomorphismGroup(G);
      > A!1 eq IdentityAutomorphism(G);
      true
      %%a> assert $1;
      > g := GraphAutomorphism(G, Sym(2)!(1,2));
      > g;
      Automorphism of Group of Lie type B2 over Finite field of size 2^2
      given by: Mapping from: Group of Lie type  to Group of Lie type 
      given by a rule
      Decomposition:
        Mapping from: GF(2^2) to GF(2^2) given by a rule,
        (1, 2),
        1
      > sigma := iso< GF(4) -> GF(4) | x :-> x^2, x :-> x^2 >;
      > h := FieldAutomorphism(G, sigma) * g;
      > h in A;
      true
      %%a> assert $1;
      > f,g,i := DecomposeAutomorphism(h);
      > assert f*g*i eq h;
