[GAP Forum] Representing Clifford Algebras

mim_ at op.pl mim_ at op.pl
Tue Nov 24 08:26:33 GMT 2009


Hello,

Have you found the way to represent Clifford algebras in GAP ? 

Personally I have represented monomial from Clifford algebra as list [cf, ind] where <cf> is coefficient and <ind> are list of indexes e.g. e12=[1, [1,2]] and -e12=[-1,[1,2]].

See below functions which I have created. In my functions I have assumed that either ei*ei=1 or ei*ei=-1 for given algebra. See below functions <cliff_mult_plus> and <cliff_mult_minus>.

Regards,
Marek

# 2009-05-08 Create function which generate abstract clifford algebra 
# elements are represented as list with coefficients e123= [1,2,3] or [1, [1,2,3]] etc
# Define first function for multiplying list elements. 
# Phase 1: Apply bubble sort to the concatenated list, each exchange of element will change the sign
# Phase 2: Multiply all neighbour identical elements. The result will depend on the signature of Clifford algebra
#  i.e. whether e1 * e1 = 1 or -1.
# This function should return new element (sorted list of integers) and sign 1 or -1.

# Note: for sorting we can use SignPerm(Sortex(list)) functions which return permutation and calculates its sign. 
#   In the same time <list> is sorted.
# Examples:
# SignPerm(Sortex([1,3,2])) = -1  ; [2,3,1] -> 1;  [1,2,1] -> -1; 
# 
# Such a solution does not require writing function for bubble sort.

# Case when all squares of generators are equal to 1
cliff_mult_plus:=function(a,b)
  local res, sign, ind;
  res:=Concatenation(a,b);
  sign:=SignPerm(Sortex(res));   # sort
  # now we remove all repeats
  ind:=First([1..Length(res)-1], s->res[s]=res[s+1]);
  while (ind <> fail) do
     res:=Concatenation(res{[1..ind-1]}, res{[ind+2..Length(res)]});
     ind:=First([1..Length(res)-1], s->res[s]=res[s+1]);
  od;
  return [sign, res];     
end;

lie_bracket_plus:=function(a,b)
    local c,d;
    c:=cliff_mult_plus(a,b); 
    d:=cliff_mult_plus(b,a); 
    if c=d then return [0,[]];
    else return [c[1]-d[1], c[2]];
    fi;
end;

# Case when all squares of generators are equal to -1
cliff_mult_minus:=function(a,b)
  local res, sign, ind;
  res:=Concatenation(a,b);
  sign:=SignPerm(Sortex(res));   # sort
  # now we have to remove all repeats and change sign for each removal
  ind:=First([1..Length(res)-1], s->res[s]=res[s+1]);
  while (ind <> fail) do
     res:=Concatenation(res{[1..ind-1]}, res{[ind+2..Length(res)]});
     sign:=-sign;
     ind:=First([1..Length(res)-1], s->res[s]=res[s+1]);
  od;
  return [sign, res];     
end;
  
# 2009-05-22 function return SCT table for Lie algebra with cllifford algebra elements
# parameters: bas - basis of clifford Lie algebra in form [[1,2], [2,3],...]
sct_lie_alg_cliff_plus:=function(bas)
  local T, dim, s,t,res, pos;
  dim:=Length(bas);
  T:=EmptySCTable(dim, 0, "antisymmetric");
  for s in [1..dim-1] do
     for t in [s+1..dim] do
       res:=lie_bracket_plus(bas[s], bas[t]);
       if res[1]<>0 then
         pos:=Position(bas, res[2]);
         SetEntrySCTable(T,s,t, [res[1],pos]);
       fi;
     od;
  od;
  return T;
end;;





More information about the Forum mailing list