Skip to content

Commit 2457cc1

Browse files
committed
Fixed bugs in IsoIndicesSupply and CombinationLists (Issue #1)
1 parent 3edecf7 commit 2457cc1

File tree

2 files changed

+1777
-27
lines changed

2 files changed

+1777
-27
lines changed

Shared/Objects.m

+21-27
Original file line numberDiff line numberDiff line change
@@ -1262,6 +1262,11 @@ the gauge group SU(n). This dimension is given by the setting of the option \
12621262
(Ecker, Kambor and Wyler (1992), CERN-TH.6610/92). \
12631263
To evaluate use ArgumentsSupply.";
12641264

1265+
CombinationLists::usage =
1266+
"CombinationLists[l, n] returns a list of all possible sets containing n
1267+
elements from the list l. (this function is probably in the combinatorics
1268+
package, but we have enough in memory already)";
1269+
12651270
Begin["`Package`"]
12661271
End[]
12671272

@@ -2588,25 +2593,10 @@ spanning SU(2) are defined (H. F. Jones, Groups, Representations and Physics,
25882593
SelfConjugation[$ScalarHeads[_]] :=
25892594
True;
25902595

2591-
(* --------------------------------------------------------------------- *)
2592-
(*Functions in context FeynCalc`Private`*)
2593-
2594-
BeginPackage["FeynCalc`"];
2595-
2596-
(*CombinationLists[l, n] returns a list of all possible sets containing n
2597-
elements from the list l. (this function is probably in the combinatorics
2598-
package, but we have enough in memory already)*)
2599-
2600-
Begin["`Private`"];
26012596

26022597
CombinationLists[m_List, n_Integer] :=
26032598
Union[Select[Sort /@ Flatten[Outer[List, Sequence @@ Table[m, {n}]], n - 1], (Union[#] === #) &]];
26042599

2605-
End[];
2606-
EndPackage[];
2607-
2608-
(* --------------------------------------------------------------------- *)
2609-
26102600

26112601
Options[UGenerator] = {
26122602
SUNN -> 2,
@@ -5376,21 +5366,23 @@ dimensional representations (2 for SU(2) and 3 for SU(3)). *)
53765366

53775367

53785368
IsoIndicesSupply[aa_, (optss___Rule | optss___List)] :=
5379-
(
5380-
FCPrint[2,
5381-
"Starting with number ", $IsoIndicesCounter];
5369+
Block[{tmp},
5370+
5371+
FCPrint[2, "Starting with number ", $IsoIndicesCounter];
53825372
iicintern = 0;
5383-
aa //.{
5373+
tmp = aa //.{
53845374
(c_?(!FreeQ[{#}, IsoDot[_, _], Infinity] &))^n_ :> (FCPrint[2, "Fixing powers"]; times1 @@ Table[c, {n}])
5385-
} /. IsoSymmetricCross -> isctemp //. {
5386-
(
5387-
FCPrint[2, "Recursively resolving iso-vector products"];
5388-
{indicesdotrule[optss], indicescrossrule[optss], indicessymmcrossrule[optss]}
5389-
) } /. {
5375+
};
5376+
tmp = tmp /. IsoSymmetricCross -> isctemp;
5377+
FCPrint[2, "Recursively resolving iso-vector products"];
5378+
tmp = tmp //. Join[{indicesdotrule[optss], indicescrossrule[optss], indicessymmcrossrule[optss]}];
5379+
5380+
tmp = tmp /. {
53905381
sunitemp -> SUNIndex,
53915382
supptemp -> id,
53925383
isctemp -> IsoSymmetricCross
5393-
} //. freeindicesrules0 /.
5384+
};
5385+
tmp = tmp //. freeindicesrules0 /.
53945386
If[ NumerateFree /. Flatten[{optss}] /. Options[IsoIndicesSupply],
53955387
FCPrint[2, "Non-contracted indices will be numerated"];
53965388
freeindicesrules1[optss],
@@ -5402,8 +5394,10 @@ dimensional representations (2 for SU(2) and 3 for SU(3)). *)
54025394
{
54035395
Conjugate[a_Symbol][(SUNIndex | ExplicitSUNIndex)[i_]][x_Symbol] :> Conjugate[a[x][SUNIndex[i]](*[x]*)],
54045396
Conjugate[a_Symbol][(SUNIndex | ExplicitSUNIndex)[i_]] :> Conjugate[a[SUNIndex[i]]]
5405-
}
5406-
);
5397+
};
5398+
tmp
5399+
];
5400+
54075401

54085402

54095403
(* Support functions for UIndicesSupply: *)

0 commit comments

Comments
 (0)