**CoReLG** (Computing with Real Lie Groups) is a **GAP** package for computing with (semi-)simple real Lie algebras. Various capabilities of the package have to do with the action of the adjoint group of a real Lie algebra (such as the nilpotent orbits, and non-conjugate Cartan subalgebras). CoReLG is also the acronym of the EU funded Marie Curie project carried out by the first author of the package at the University of Trento.

The simple real Lie algebras have been classified, and this classification is the main theoretical tool that we use, as it determines the objects that we work with. In Section 1.1 we give a brief account of this classification. We refer to the standard works in the literature (e.g., [Kna02]) for an in-depth discussion. The algorithms of this package are described in [DG13] and [DFG13].

We remark that the package still is under development, and its functionality is continuously extended. The package **SLA**, [Gra12], is required.

Let mathfrakg^c denote a complex simple Lie algebra. Then there are two types of simple real Lie algebras associated to mathfrakg^c: the *realification* of mathfrakg^c (this means that mathfrakg^c is viewed as an algebra over R, of dimension 2dim mathfrakg^c), and the *real forms* mathfrakg of mathfrakg^c (this means that mathfrakg⊗_RC is isomorphic to mathfrakg^c). It is straightforward to construct the realification of mathfrakg^c; so in the rest of this section we concentrate on the real forms of mathfrakg^c.

A Lie algebra is said to be *compact* if its Killing form is negative definite. The complex Lie algebra mathfrakg^c has a unique (up to isomorphism) compact real form mathfraku. In the sequel we fix the compact form mathfraku. Then mathfrakg^c = mathfraku + imath mathfraku, where imath is the complex unit; so we get an antilinear map τ : mathfrakg^c-> mathfrakg^c by τ(x+ imath y) = x- imath y, where x,y∈ mathfraku. This is called the *conjugation* of mathfrakg^c with respect to mathfraku.

Now let θ be an automorphism of mathfrakg^c of order 2, commuting with τ. Then θ stabilises mathfraku, so the latter is the direct sum of the ± 1-eigenspaces of θ, say mathfraku = mathfraku_1 ⊕ mathfraku_-1. Set mathfrakk = mathfraku_1 and mathfrakp = imathfraku_-1. Then mathfrakg =mathfrakg(θ)= mathfrakk ⊕ mathfrakp is a real form of mathfrakg^c. Regarding this construction we remark the following:

mathfrakg = mathfrakk⊕ mathfrakp is called a

*Cartan decomposition*. It is unique up to inner automorphisms of mathfrakg.The map θ is a

*Cartan involution*; it is the identity on mathfrakk and acts as multiplication by -1 on mathfrakp)mathfrakk is compact, and it is a maximal compact subalgebra of mathfrakg.

Two real forms are isomorphic if and only if the corresponding Cartan involutions are conjugate in the automorphism group of mathfrakg^c.

The automorphism θ is described by two pieces of data: a list of signs (s_1,...,s_r) of length equal to the rank r of mathfrakg, and a permutation π of 1,..., r, leaving the list of signs invariant. Let α_1,..., α_r denote the simple roots of mathfrakg^c with corresponding canonical generators x_i, y_i, h_i. Then θ(x_i) = s_i x_π(i), θ(y_i) = s_i y_π(i), θ(h_i) = h_π(i).

Let mathfrakg be a real form of the complex Lie algebra mathfrakg^c, with Cartan decomposition mathfrakg = mathfrakk⊕ mathfrakp. A Cartan subalgebra mathfrakh of mathfrakg is *standard* (with respect to this Cartan decomposition) if mathfrakh = (mathfrakh∩ mathfrakk)⊕ (mathfrakh∩mathfrakp), or, equivalently, when mathfrakh is stable under the Cartan involution θ.

It is a fact that every Cartan subalgebra of mathfrakg is conjugate by an inner automorphism to a standard one ([Kna02], Proposition 6.59). Moreover, there is a finite number of non-conjugate (by inner automorphisms) Cartan subalgebras of mathfrakg ([Kna02], Proposition 6.64). A standard Cartan subalgebra mathfrakh is said to be *maximally compact* if the dimension of mathfrakh∩ mathfrakk is maximal (among all standard Cartan subalgebras). It is called *maximally non-compact* if the dimension of mathfrakh∩ mathfrakp is maximal. We have that all maximally compact Cartan subalgebras are conjugate via the inner automorphism group. The same holds for all maximally non-compact Cartan subalgebras ([Kna02], Proposition 6.61).

A subspace of mathfrakp is said to be a *Cartan subspace* if it consists of commuting elements. If mathfrakh is a maximally non-compact standard Cartan subalgebra, then mathfrakc = mathfrakh∩ mathfrakp is a Cartan subspace. The other Cartan subalgebras (i.e., representatives of the conjugacy classes of the Cartan subalgebras under the inner automorphism group) can be constructed such that their intersection with mathfrakp is contained in mathfrakc.

Every standard Cartan subalgebra mathfrakh of mathfrakg yields a corresponding root system Φ of mathfrakg^c. Let α∈Φ, then a short argument shows that α∘θ (where α∘θ (h) = α(θ(h)) for h∈ mathfrakh) is also a root (i.e., lies in Φ). This way we get an automorphism of order 2 of the root system Φ.

Now let mathfrakh be a maximally compact standard Cartan subalgebra of mathfrakg, with root system Φ. Then it can be shown that there is a basis of simple roots ∆⊂Φ which is θ-stable. Write ∆ = {α_1,...,α_r}, and let x_i,y_i,h_i be a corresponding set of canonical generators. Then there is a sequence of signs (s_1,...,s_r) and a permutation π of 1,...,r such that θ(x_i) = s_i x_π(i). Now we encode this information in the Dynkin diagram of Φ. If s_i=-1 then we paint the node corresponding to α_i black. Also, if π(i)=j ≠ i then the nodes corresponding to α_i, α_j are connected by an arrow. The resulting diagram is called a *Vogan diagram* of mathfrakg. It determines the real form mathfrakg up to isomorphism. The signs s_i are not uniquely determined. However, it is possible to make a ``canonical'' choice for the signs so that the Vogan diagram is uniquely determined.

Now let mathfrakh be a maximally non-compact standard Cartan subalgebra of mathfrakg, with root system Φ. Then, in general, there is no basis of simple roots which is stable under θ. However we can still define a diagram, in the following way. Let mathfrakc = mathfrakh∩ mathfrakp be the Cartan subspace contained in mathfrakh. Let Φ_c = { α∈ Φ ∣ α∘θ = α} = { α∈ Φ ∣ α(mathfrakc) = 0} be the set of *compact roots *. Then there is a choice of positive roots Φ^+ such that α∘θ ∈ Φ^- for all *non-compact* positive roots α∈ Φ^+. Let ∆ denote the basis of simple roots corresponding to Φ^+. A theorem due to Satake says that there is a bijection τ : ∆-> ∆ such that τ(α) = α if α∈ Φ_c, and for non-compact α∈∆ we have α∘θ = -τ(α) - ∑_γ∈∆_c c_α,γ γ, where ∆_c = ∆ ∩ Φ_c and the c_α,γ are non-negative integers. Now we take the Dynkin diagram corresponding to ∆, where the nodes corresponding to the compact roots are painted black, and the nodes corresponding to a pair α,τ(α), if they are unequal, are joined by arrows. The resulting diagram is called the *Satake diagram* of mathfrakg. It determines the real form mathfrakg up to isomorphism.

By G^c, G we denote the adjoint groups of mathfrakg^c and mathfrakg respectively. The nilpotent G^c-orbits in mathfrakg^c have been classified by so-called weighted Dynkin diagrams. A nilpotent G^c-orbit in mathfrakg^c may have no intersection with the real form mathfrakg. On the other hand, when it does have an intersection, then this may split into several G-orbits.

Let e be an element of a nilpotent G-orbit in mathfrakg. By the Jacobson-Morozov theorem, e lies in an mathfraksl_2-triple (e,h,f); here this means that [h,e]=2e, [h,f]=-2f, and [e,f]=h. The triple is called a *real Cayley triple* if θ(e) = -f, θ(f)=-e and θ(h) = -h, where θ is the Cartan involution of mathfrakg. Every nilpotent orbit has a representative lying in a real Cayley triple.

To define a Lie algebra by a multiplication table over the reals, it usually suffices to take a subfield of the real field as base field. However, the algorithms contained in this package very often need a Chevalley basis of the Lie algebra at hand, which is defined only over the complex field. Computations with such a Chevalley basis take place behind the scenes, and the result is again defined over the reals. However, the computations would not be possible if the Lie algebra is just defined over (a subfield of) the reals. For this reason, we require that the base field contains the imaginary unit `E(4)`.

Furthermore, in many algorithms it is necessary to take square roots of elements of the base field. So the ideal base field would contain the imaginary unit, as well as being closed under taking square roots. However, such a field is difficult to construct and to work with on a computer. For this reason we have provided the field `SqrtField` containing the square roots of all rational numbers. Mathematically, this is the field Q^sqrt}(imath) with Q^sqrt}=Q({sqrtp∣ p a prime}) and imath=sqrt-1∈C. Clearly, Q^sqrt}(imath) is an infinite extension of the rationals Q, and every f in Q^sqrt}(imath) can be uniquely written as f=∑_j=1^m r_i sqrtk_j for Gaussian rationals r_i∈Q(imath) and pairwise distinct squarefree positive integers k_1,...,k_m. Thus, f can be described efficiently by its coefficient vector [[r_1,k_1],...,[r_j,k_j]]. We comment on our implementation of Q^sqrt}(imath) in Chapter 2.

Although it is possible to try most functions of the package using the base field `CF(4)`, for example, it is likely that many computations will result in an error, because of the lack of square roots in that field. Many more computations are possible over `SqrtField`, but also in that case, of course, a computation may result in an error because we cannot construct a particular square root. Also, computations over `SqrtField` tend to be significantly slower than over, say, `CF(4)`; see the next example. But that is a price we have to pay (at least, in order to be able to do some computations).

gap> L:=RealFormById("E",8,2); <Lie algebra of dimension 248 over SqrtField> gap> allCSA := CartanSubalgebrasOfRealForm(L);;time; 67224 gap> L:=RealFormById("E",8,2,CF(4)); <Lie algebra of dimension 248 over GaussianRationals> gap> allCSA := CartanSubalgebrasOfRealForm(L);;time; 7301 # We remark that both computations are exactly the same; # the difference in timing is caused by the fact that # arithmetic over SqrtField is slower.

generated by GAPDoc2HTML