Octonions
and the irreducible representation of Lie algebra g2

And a bit of homogenous representation of sphere (S^6): 
(S^6)= (Subscript[G, 2])/ SU (3)

Srdjan Vukmirovic

This notebook has a dual purpose. As first, it roughly implements the octonionic multiplication and calculates  the commutator relations of the Lie algebra g2. As second, it is an advanced example  of Mathematica's power in calculations that often happen in Geometry when the problem is reduced to Linear Algebra level (matrices). Besides, a homogenous representation of the sphere (S^6) using octonions is given.

Word of caution: The author is aware that the programming style  in this notebook is not an exemplary one. It could be improved in many ways, but I leave it as it is since it represents a common workflow of doing  Mathematica aided research.

Implementation of the octonion multiplication

The octonion multiplication we will denote by ∘ (SmallCircle) sign. That sign is entered by pressing Ctrl, then typing sc, and pressing Ctrl key again.  Alternatively, the expression a∘b is entered as SmallCircle[a, b].

Note, that because of non-associativity, the brackets are mandatory. Hence, the input a∘b∘c is not an octonion multiplication, but (a∘b)∘c is.

Note the internal Mathematica difference :

FullForm[(a∘b)∘
        c]

FullForm[a∘b∘c]

In the language of Mathematica we say that the function SmallCircle is not Flat.

The basis octonions are denoted by  e0 to e7, with  e0 being the unity (1).

bazni  =  {e0,  e1,  e2,  e3,  e4,  e5,  e6,  
          e7};
imag  =  { e1,  e2,  e3,  e4,  e5,  e6,  
          e7};
BazniQ[x_] :=   MemberQ[bazni,  x];
ImagQ[x_] :=   MemberQ[imag,  x];
NotBazniQ[x_] :=   Not[BazniQ[x]];

Implementation of multiplication and distributivity

SmallCircle /:  SmallCircle[x_,  y_] :=  
        SmallCircle[Expand[x],  
            Expand[y]] /;  ((Expand[x] =!= x)  ||  (Expand[y] =!= 
                  y));
SmallCircle /:  SmallCircle[x_Plus,  y_] :=  
        Distribute[
          Unevaluated[SmallCircle[x,  y]]]; 
SmallCircle /:  SmallCircle[x_,  y_Plus] :=  
        Distribute[
          Unevaluated[SmallCircle[x,  y]]]; 
SmallCircle  /:  SmallCircle[Times[x__, y_?BazniQ],  z_] :=  
        Times[x,  SmallCircle[y, z]];
SmallCircle  /:  SmallCircle[z_,  Times[  x__, y_?BazniQ]] :=  
        Times[x,  SmallCircle[z, y]];
SmallCircle  /:  
        SmallCircle[x_?ImagQ, 
          x_?ImagQ] := -e0;
SmallCircle  /: 
        SmallCircle[x_?ImagQ,  y_?ImagQ] := - SmallCircle[y,  x] /;  
          OrderedQ[{y,  x}];
SmallCircle  /:  SmallCircle[0, x_] := 
        0;
SmallCircle  /:  SmallCircle[x_, 0] := 
        0;
SmallCircle  /:  SmallCircle[e0, x_] := 
        x;
SmallCircle  /:  SmallCircle[x_, e0] := x;

The multiplication table

SmallCircle[e1,  e2]  =  e3;
SmallCircle[e1,  e3]  =  -e2;
SmallCircle[e1,  e4]  =  e5;
SmallCircle[e1,  e5]  =  -e4;
SmallCircle[e1,  e6]  =  -e7;
SmallCircle[e1,  e7]  =  
        e6;

SmallCircle[e2,  e3]  =  e1;
SmallCircle[e2,  e4]  =  e6;
SmallCircle[e2,  e5]  =  e7;
SmallCircle[e2,  e6]  =  -e4;
SmallCircle[e2,  
          e7]  =  -e5;

SmallCircle[e3,  e4]  =  e7;
SmallCircle[e3,  e5]  =  -e6;
SmallCircle[e3,  e6]  =  e5;
SmallCircle[e3,  
          e7]  =  -e4;

SmallCircle[e4,  e5]  =  e1;
SmallCircle[e4,  e6]  =  e2;
SmallCircle[e4,  e7]  =  
        e3;

SmallCircle[e5,  e6]  =  -e3;
SmallCircle[e5,  e7]  =  
        e2;

SmallCircle[e6,  e7]  =  -e1;

An example

((a e1  +  b e5)∘(e3  +  
              a e6))∘ e7

The representation of the Lie algebra g2.

As first we define the commutator

Kom[x_,  y_] := x∘y  -  y∘x

Now, each pair x, y of imaginary octonions defines a derivation (Subscript[D, xy]) = D_{x,y} of octaves. All derivations of octaves form the Lie algebra g2.

Der[x_,  y_][a_] :=  
      Kom[Kom[x, y],  a]  -  
        3 ((x∘y)∘a  -  
              x∘(y∘a))

I don't know, who has found the formula above. Anyway, hands down.
It is easy to "check" that these are indeed derivations. Define the "checking" function for the derivation D_{x,y}.

f[a_,  b_][x_,  
        y_] := (Der[a,  b][
            x∘ y] == Der[a,  b][x] ∘ 
              y  +  x∘ Der[a,  b][y]  )

And, check an all the basic vectors, for instance, Der_{e3, e7}

Outer[f[e3, e7], bazni, bazni] // Simplify

Now, we apply the checking procedure  for all Der_{ei,ej}, and see that all of them are derivations:

Outer[(And  @@ Flatten[Outer[f[#1, #2], bazni, bazni]]) &,  
      bazni,  bazni]

A kind of problem is that there dependent derivations among the  Der_{e3,e7}. It is clear that Der_{ei,ei}=0, and that Der_{ei,ej} = -Der_{ej,ei}, but there are still 21 derivation left, and we know that there are only 14 independent, since the dimension of g2 is 14. But it is a piece of cake to find the dependences using the Mathematica.

We construct the matrix of the operator Der_{ei, ej} in the standard basis. Then we flatten the matrix (transform it to the vector). The result is the function DerVector.

DerMatrix[x_,  y_]  :=  
        Table[Coefficient[Der[x,  y][imag[[i]]],  
            imag[[j]]],  {j, 1, 7},  {i,   1,  
            7}];
DerVector[x_,  y_]  :=  
        DerMatrix[x,  y] // Flatten;

The next command shows that the vectors Der_{e1, ei}, Der_{e2, ei}, Der_{e4, ei} (i.e. derivations) are independent for all ei. There are 14 of them so they for a basis of g2.

NullSpace[
{Flatten[
            DerVector[imag[[1]],  
              imag[[2]]]], 
Flatten[
            DerVector[imag[[1]],  
              imag[[3]]]], 
Flatten[
            DerVector[imag[[1]],  
              imag[[4]]]], 
Flatten[
            DerVector[imag[[1]],  
              imag[[5]]]], 
Flatten[
            DerVector[imag[[1]],  
              imag[[6]]]], 
Flatten[
            DerVector[imag[[1]],  
              imag[[7]]]], 
Flatten[
            DerVector[imag[[2]],  
              imag[[3]]]], 
Flatten[
            DerVector[imag[[2]],  
              imag[[4]]]], 
Flatten[
            DerVector[imag[[2]],  
              imag[[5]]]], 
Flatten[
            DerVector[imag[[2]],  
              imag[[6]]]], 
Flatten[
            DerVector[imag[[2]],  
              imag[[7]]]], 
Flatten[
            DerVector[imag[[4]],  
              imag[[5]]]], 
Flatten[
            DerVector[imag[[4]],  
              imag[[6]]]], 
Flatten[
            DerVector[imag[[4]],  imag[[7]]]]
} // 
        Transpose]

Adding the derivation Der_{e3, e4} (as the last one), we see that it is dependent, and see that the dependecy is: Der_{e3, e4}- Der_{e1, e6} + Der_{e2, e5}:

NullSpace[
{Flatten[
            DerVector[imag[[1]],  
              imag[[2]]]], 
Flatten[
            DerVector[imag[[1]],  
              imag[[3]]]], 
Flatten[
            DerVector[imag[[1]],  
              imag[[4]]]], 
Flatten[
            DerVector[imag[[1]],  
              imag[[5]]]], 
Flatten[
            DerVector[imag[[1]],  
              imag[[6]]]], 
Flatten[
            DerVector[imag[[1]],  
              imag[[7]]]], 
Flatten[
            DerVector[imag[[2]],  
              imag[[3]]]], 
Flatten[
            DerVector[imag[[2]],  
              imag[[4]]]], 
Flatten[
            DerVector[imag[[2]],  
              imag[[5]]]], 
Flatten[
            DerVector[imag[[2]],  
              imag[[6]]]], 
Flatten[
            DerVector[imag[[2]],  
              imag[[7]]]], 
Flatten[
            DerVector[imag[[4]],  
              imag[[5]]]], 
Flatten[
            DerVector[imag[[4]],  
              imag[[6]]]], 
Flatten[
            DerVector[imag[[4]],  
              imag[[7]]]], 
Flatten[
            DerVector[imag[[3]],  imag[[4]]]]
} // 
        Transpose]

Similary, we get the rest of the dependency relations:

(Subscript[D, 34])  =  (Subscript[D, 16]) - (Subscript[D, 25]),  (Subscript[D, 35])  =  (Subscript[D, 17]) - (Subscript[D, 24]),  
    (Subscript[D, 36])  = - (Subscript[D, 14]) - (Subscript[D, 27]),  (Subscript[D, 37])  =  -(Subscript[D, 15]) - (Subscript[D, 26]),  
    (Subscript[D, 56])  =  (Subscript[D, 12]) - (Subscript[D, 47]),  (Subscript[D, 57])  =  (Subscript[D, 13]) - (Subscript[D, 45]),  
    (Subscript[D, 67])  =  (Subscript[D, 23]) - (Subscript[D, 45]).

The commutator relations of the Lie algebra g2

Now we use 14 independent derivation matrices dd**, to calculate the commutator relations of the algebra g2.

dd12  = 1/2  DerMatrix[e1,  e2];
dd13  =  1/2  DerMatrix[e1,  e3];
dd14  =  1/2  DerMatrix[e1,  e4];
dd15  = 1/2  DerMatrix[e1,  e5];
dd16  = 1/2  DerMatrix[e1,  e6];
dd17  = 1/2  DerMatrix[e1,  e7];
dd23  = 1/2  DerMatrix[e2,  e3];
dd24  = 1/2  DerMatrix[e2,  e4];
dd25  =  1/2  DerMatrix[e2,  e5];
dd26  = 1/2  DerMatrix[e2,  e6];
dd27  =  1/2  DerMatrix[e2,  e7];
dd45  =  1/2  DerMatrix[e4,  e5];
dd46  = 1/2  DerMatrix[e4,  e6];
dd47  =  1/2  DerMatrix[e4,  e7];

Of course,using the power ofMathematicawe could have writen this in more compact form,but we leave it for clarity.

The commutator relations of g2

We now define the standard commutator of the matrices.

KomMat[x_,  y_] := x . y  -  y . x

It is easy for Mathematica to calculate the commutator, but it is not easy to express the result in the terms of the basis.

KomMat[dd12,  dd14] // MatrixForm

Hence, we are going to make an auxilary function express which will print out all the commutators.

basis  =  {dd12,  dd13,  dd14,  dd15,  dd16,  dd17,  dd23, 
        dd24,  dd25,  dd26,  dd27,  dd45,  dd46,  dd47}; 
    textbasis  =  {d12,  d13,  d14,  d15,  d16,  d17,  d23, d24,  
        d25,  d26,  d27,  d45,  d46,  d47, 0};

express[x_,  
        y_] :=  -NullSpace[
Append[
                  Flatten  /@  basis,  Flatten[KomMat[x, y]]] // 
                Transpose][[1]] . textbasis

Finally, we print out all the commutators at once.

For[i  =  1,  
      i  <  15,  i++,  
For[j  =  i + 1,  
        j < 15,  j++, 
Print["[" <> 
            ToString[textbasis[[i]]] <> "," <> 
            ToString[textbasis[[j]]] <> "]=" <> 
            ToString[
              express[basis[[i]],  
                basis[[j]]]]]
]
]

The decomposition of g2 that corresponds to sphere (S^6) representation.

There is a homogenous representation (but not a symmetrical one) of a sphere (S^6): (S^6)= (Subscript[G, 2])/ SU (3) .  
                At the Lie algebra level this reads :  g2  =  
            su (3)  +  m, \(where\ m\ is\ a\ subspace\ of\ g2\ representing\ the\ tangent\ space\ of\ the\ sphere . \ Hence\ m\ is\ 6 - dimensional\), and su (3) is 8-dimensional .  We now change the basis and find the corresponding commutators.

basis = {mm1  =   dd12,  mm2  =   dd13,  mm3  =  dd14, 
          mm4  =   dd15, mm5  =  dd16, 
          mm6  =    dd17, 
hh1  = dd12 +  2 dd47,  
          hh2  =  dd13 -  2 dd46,  hh3  =  dd14 -  2 dd27, 
          hh4  =  dd15 +  2 dd26, hh5  =  dd16 -  2 dd25, 
          hh6  =  dd17 +  2 dd24,  hh7  =  dd23,  
          hh8 = dd45};

textbasis  =  {m1,  m2,  m3,  m4,  m5,  m6,  h1,  h2,  
          h3,  h4,  h5,  h6,  h7,  h8,  0};

For[i  =  1,  
      i  <  15,  i++,  
For[j  =  i + 1,  
        j < 15,  j++, 
Print["[" <> 
            ToString[textbasis[[i]]] <> "," <> 
            ToString[textbasis[[j]]] <> "]=" <> 
            ToString[
              express[basis[[i]],  
                basis[[j]]]]]
]
]

I stop here. I am sure that if you have understood the Mathematica code written here, you will be able to write your own functions that will serve  your reseach. No more lengthy and boring calculations. We all know how to multiply matrices, and we should concentrate on the hidden maths instead. With Mathematica it's a piece of cake.

References

The remarkable paper by Baez, entitled Octonions (http://math.ucr.edu/home/baez/Octonions/octonions.html)