# # file: comm2.gap # # purpose: By the given structure constants of an anticommutative algebra, # computes its commutative 2-cocycles and symmetric invariant bilinear # forms. # This is accompanying code to the paper # "Commutative 2-cocycles on Lie algebras". # # created: Pasha Zusmanovich Aug 25 2009 # # latest revisions history: # Dec 4 2009,Jan 26 2010 cosmetics # Feb 5 2010 do not account for unnecessary equations in SymmInvBilinForm # Sep 18 2011,Sep 20 2014,Oct 25 2015 comments # # this function calculates the space of commutative 2-cocycles # on a given anticommutative algebra L Comm2Cocycles := function (L) local _add, K, N, T, Mat, s, i, j, k, l; _add := function (i, j, s, element) local f, tmp; if (i > j) then tmp := i; i := j; j := tmp; fi; f := (2*N-i+2)*(i-1)/2 + j-i+1; Mat[f][s] := Mat[f][s] + element; end; K := LeftActingDomain (L); N := Dimension (L); T := StructureConstantsTable (Basis(L)); # compose a homogeneous linear system of N(N-1)(N-2)/6 equations: # # f([e_i,e_j],e_k) + f([e_k,e_i],e_j) + f([e_j,e_k],e_i) = 0 # 1 <= i < j < k <= N # # in N(N+1)/2 unknowns f(e_i,e_j), 1 <= i <= j <= N Mat := NullMat (N*(N+1)/2, N*(N-1)*(N-2)/6, K); s := 0; for i in [1..N] do for j in [(i+1)..N] do for k in [(j+1)..N] do s := s+1; for l in [1..N] do _add (l, k, s, SCTableEntry (T, i,j,l)); _add (l, j, s, SCTableEntry (T, k,i,l)); _add (l, i, s, SCTableEntry (T, j,k,l)); od; od; od; od; return (NullspaceMatDestructive (Mat)); end; # this function calculates the space of symmetric bilinear invariant forms # on a given anticommutative algebra L SymmInvBilinForm := function (L) local _add, K, N, T, Mat, s, i, j, k, l; _add := function (i, j, s, element) local f, tmp; if (i > j) then tmp := i; i := j; j := tmp; fi; f := (2*N-i+2)*(i-1)/2 + j-i+1; Mat[f][s] := Mat[f][s] + element; end; K := LeftActingDomain (L); N := Dimension (L); T := StructureConstantsTable (Basis(L)); # compose a homogeneous linear system of N(N+1)(2N+1)/6 equations: # f([e_i,e_j],e_k) + f(e_i,[e_k,e_j]) = 0, 1 <= i,j <= N, max(i,j) <= k <= N # # note that equation obtained by interchanging i and k leads to the same # equation, and interchaning j and k is a consequence of equations for # (i,j,k) and (j,i,k) # # \sum_l C_{ij}^l f(e_l,e_k) + \sum_l C_{kj}^l f(e_i,e_l) = 0 # # in N(N+1)/2 unknowns f(e_i,e_j), 1 <= i <= j <= N Mat := NullMat (N*(N+1)/2, N*(N+1)*(2*N+1)/6, K); s := 0; for i in [1..N] do for j in [1..N] do for k in [Maximum(i,j)..N] do s := s+1; for l in [1..N] do _add (l, k, s, SCTableEntry (T, i,j,l)); _add (i, l, s, SCTableEntry (T, k,j,l)); od; od; od; od; return (NullspaceMatDestructive (Mat)); end; # check that for all classical Lie algebras of rank 2 in characteristic 3, # the space of commutative 2-cocycles is 1-dimensional for type in ["A", "B", "G"] do L := SimpleLieAlgebra (type, 2, GF(3)); Print (Length (Comm2Cocycles (L)), "\n"); ZL := LieCenter (L); if (Dimension (ZL) > 0) then Print (Length (Comm2Cocycles (L/ZL)), "\n"); fi; od; # examples of computations of symmetric invariant bilinear forms: # # B := SymmInvBilinForm (SimpleLieAlgebra ("F", 4, GF(3))); # Print (B, "\n", Length (B), "\n"); # # B := SymmInvBilinForm (SimpleLieAlgebra ("E", 6, GF(3))); # Print (B, "\n", Length (B), "\n"); # # completes within ~10 minutes on an Intel Xeon 3.20GHz CPU, # requiring 1GB of memory (-o option) # B := SymmInvBilinForm (SimpleLieAlgebra ("E", 7, GF(3))); # Print (B, "\n", Length (B), "\n"); # end of comm2.gap