1

I'm trying to compute wick contractions knowing that: $\langle a_a a_b \rangle = \delta_{ab}$. So far I've the following

Deltas[nn_ /; EvenQ[nn], first_: True] := 
 If[nn == 2, If[first, Delta[a, b], {{a, b}}], Module[{},
   lowerOrder = symDeltas[nn - 2, False];
   newIndices = {a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p}[[{nn - 1, nn}]];
   result = (#~Join~newIndices) & /@ lowerOrder;
   Do[
    term = lowerOrder[[termNumber]];
    index = term[[indexNumber]];
    term[[indexNumber]] = newIndices[[1]];
    AppendTo[result, term~Join~{index, newIndices[[2]]}];
    , {termNumber, 1, Length[lowerOrder]}, {indexNumber, 1, nn - 2}]; 
   If[first, Module[{},
     step1 = Partition[#, {2}] & /@ result;
     step2 = Map[Delta[Sequence @@ #] &, step1, {2}];
     Plus @@ Map[Times @@ # &, step2]]
     , result]
   ]
  ]

This works up to 12 generators, but if I plug 14 (ie $\langle a_1 \cdots a_{14} \rangle$) it doesn't work. I guess it's a problem of the recursion because I don't get an error nor the solution. How could I fix the code so it works?

Jasimud
  • 119
  • 3

0 Answers0