Skip to content

Commit

Permalink
Fixed bugs in IsoIndicesSupply and CombinationLists (Issue #1)
Browse files Browse the repository at this point in the history
  • Loading branch information
vsht committed Apr 23, 2022
1 parent 3edecf7 commit 2457cc1
Show file tree
Hide file tree
Showing 2 changed files with 1,777 additions and 27 deletions.
48 changes: 21 additions & 27 deletions Shared/Objects.m
Original file line number Diff line number Diff line change
Expand Up @@ -1262,6 +1262,11 @@ the gauge group SU(n). This dimension is given by the setting of the option \
(Ecker, Kambor and Wyler (1992), CERN-TH.6610/92). \
To evaluate use ArgumentsSupply.";

CombinationLists::usage =
"CombinationLists[l, n] returns a list of all possible sets containing n
elements from the list l. (this function is probably in the combinatorics
package, but we have enough in memory already)";

Begin["`Package`"]
End[]

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

(* --------------------------------------------------------------------- *)
(*Functions in context FeynCalc`Private`*)

BeginPackage["FeynCalc`"];

(*CombinationLists[l, n] returns a list of all possible sets containing n
elements from the list l. (this function is probably in the combinatorics
package, but we have enough in memory already)*)

Begin["`Private`"];

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

End[];
EndPackage[];

(* --------------------------------------------------------------------- *)


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


IsoIndicesSupply[aa_, (optss___Rule | optss___List)] :=
(
FCPrint[2,
"Starting with number ", $IsoIndicesCounter];
Block[{tmp},

FCPrint[2, "Starting with number ", $IsoIndicesCounter];
iicintern = 0;
aa //.{
tmp = aa //.{
(c_?(!FreeQ[{#}, IsoDot[_, _], Infinity] &))^n_ :> (FCPrint[2, "Fixing powers"]; times1 @@ Table[c, {n}])
} /. IsoSymmetricCross -> isctemp //. {
(
FCPrint[2, "Recursively resolving iso-vector products"];
{indicesdotrule[optss], indicescrossrule[optss], indicessymmcrossrule[optss]}
) } /. {
};
tmp = tmp /. IsoSymmetricCross -> isctemp;
FCPrint[2, "Recursively resolving iso-vector products"];
tmp = tmp //. Join[{indicesdotrule[optss], indicescrossrule[optss], indicessymmcrossrule[optss]}];

tmp = tmp /. {
sunitemp -> SUNIndex,
supptemp -> id,
isctemp -> IsoSymmetricCross
} //. freeindicesrules0 /.
};
tmp = tmp //. freeindicesrules0 /.
If[ NumerateFree /. Flatten[{optss}] /. Options[IsoIndicesSupply],
FCPrint[2, "Non-contracted indices will be numerated"];
freeindicesrules1[optss],
Expand All @@ -5402,8 +5394,10 @@ dimensional representations (2 for SU(2) and 3 for SU(3)). *)
{
Conjugate[a_Symbol][(SUNIndex | ExplicitSUNIndex)[i_]][x_Symbol] :> Conjugate[a[x][SUNIndex[i]](*[x]*)],
Conjugate[a_Symbol][(SUNIndex | ExplicitSUNIndex)[i_]] :> Conjugate[a[SUNIndex[i]]]
}
);
};
tmp
];



(* Support functions for UIndicesSupply: *)
Expand Down
Loading

0 comments on commit 2457cc1

Please sign in to comment.