.. _SectRSOp:

.. _operators-root-sys:

Operators on Root Systems
=========================

.. magma:operation:: R1 eq R2
   :input_types: RootSys, RootSys
   :output_types: BoolElt
   :label: op_eq_RootSys_RootSys

   Returns ``true`` if, and only if, the root systems :math:`R_1` and :math:`R_2`
   are identical.

.. magma:function:: IsIsomorphic(R1, R2)
   :input_types: RootSys, RootSys
   :output_types: BoolElt
   :label: IsIsomorphic_RootSys_RootSys

   Returns ``true`` if, and only if, root systems :math:`R_1` and :math:`R_2` are
   isomorphic.

.. magma:function:: IsCartanEquivalent(R1, R2)
   :input_types: RootSys, RootSys
   :output_types: BoolElt
   :label: IsCartanEquivalent_RootSys_RootSys

   Returns ``true`` if, and only if, the crystallographic root systems :math:`R_1`
   and :math:`R_2` are Cartan equivalent, i.e. their Cartan matrices are the same
   modulo a permutation of the underlying basis.

.. magma:example:: Example: Isomorphism
   :label: Isomorphism

   Note that the root systems :math:`B_n` and :math:`C_n` are isomorphic but not
   Cartan equivalent. Hence Cartan equivalence is *not* an invariant of a root
   system since it depends on the particular representation of the (co)roots within
   the (co)root space.

   .. code-block:: magma

      > R := RootSystem("B4");  S := RootSystem("C4");
      > IsIsomorphic(R, S);
      true
      %%a> assert $1;
      > IsCartanEquivalent(R, S);
      false
      %%a> assert not $1;

.. magma:function:: CartanName(R)
   :input_types: RootSys
   :output_types: List
   :label: CartanName_RootSys

   The Cartan name of the root system :math:`R`
   (Section :ref:`SectCartanFinAff`).

.. magma:function:: CoxeterDiagram(R)
   :input_types: RootSys
   :label: CoxeterDiagram_RootSys

   Print the Coxeter diagram of the root system :math:`R`
   (Section :ref:`SectCartanFinAff`).

.. magma:function:: DynkinDiagram(R)
   :input_types: RootSys
   :label: DynkinDiagram_RootSys

   Print the Dynkin diagram of the root system :math:`R`
   (Section :ref:`SectCartanFinAff`). If :math:`R` is not
   crystallographic, an error is flagged.

.. magma:function:: CoxeterMatrix(R)
   :input_types: RootSys
   :output_types: AlgMatElt
   :label: CoxeterMatrix_RootSys

   The Coxeter matrix of the root system :math:`R`
   (Section :ref:`SectCartanCoxMat`).

.. magma:function:: CoxeterGraph(R)
   :input_types: RootSys
   :output_types: GrphUnd
   :label: CoxeterGraph_RootSys

   The Coxeter graph of the root system :math:`R`
   (Section :ref:`SectCartanCoxGrph`).

.. magma:function:: CartanMatrix(R)
   :input_types: RootSys
   :output_types: AlgMatElt
   :label: CartanMatrix_RootSys

   The Cartan matrix of the root system :math:`R`
   (Section :ref:`SectCartanCarMat`).

.. magma:function:: DynkinDigraph(R)
   :input_types: RootSys
   :output_types: GrphDir
   :label: DynkinDigraph_RootSys

   The Dynkin digraph of the root system :math:`R`
   (Section :ref:`SectCartanDynDigrph`). If :math:`R` is not
   crystallographic, an error is flagged.

.. magma:example:: Example: Diagrams
   :label: Diagrams

   .. code-block:: magma

      > R := RootSystem("F4");
      > DynkinDiagram(R);
 
      F4    1 - 2 =>= 3 - 4
      > CoxeterDiagram(R);
 
      F4    1 - 2 === 3 - 4

.. magma:function:: BaseField(R)
   :input_types: RootSys
   :output_types: Fld
   :label: BaseField_RootSys

.. magma:function:: BaseRing(R)
   :input_types: RootSys
   :output_types: Fld
   :label: BaseRing_RootSys

   The field over which the root system :math:`R` is defined.

.. magma:function:: RealInjection(R)
   :input_types: RootSys
   :output_types: .
   :label: RealInjection_RootSys

   The real injection of the root system :math:`R`
   (Section :ref:`SectRSConstr`).

.. magma:function:: Rank(R)
   :input_types: RootSys
   :output_types: RngIntElt
   :label: Rank_RootSys

   The rank of the root system :math:`R`, i.e. the number of simple (co)roots.

.. magma:function:: Dimension(R)
   :input_types: RootSys
   :output_types: RngIntElt
   :label: Dimension_RootSys

   The dimension of the root system :math:`R`, i.e. the dimension of the (co)root
   space. This is always at least as large as the rank, with equality when
   :math:`R` is semisimple.

.. magma:function:: CoxeterGroupOrder(R)
   :input_types: RootSys
   :output_types: RngIntElt
   :label: CoxeterGroupOrder_RootSys

   The order of the Coxeter group of the root system :math:`R`.

.. magma:example:: Example: Basic Operations
   :label: BasicOperations

   .. code-block:: magma

      > R := RootSystem("I2(7)");
      > BaseField(R);
      Number Field with defining polynomial x^3 - x^2 - 2*x + 1 over the
      Rational Field
      > Rank(R) eq Dimension(R);
      true
      %%a> assert $1;
      > CoxeterGroupOrder(R);
      14
      %%a> assert $1 eq 14;
