MathGroup Archive 2005

[Date Index] [Thread Index] [Author Index]

Search the Archive

Grassmann Calculus / Indexed Objects / Simplify

  • To: mathgroup at smc.vnet.net
  • Subject: [mg60763] Grassmann Calculus / Indexed Objects / Simplify
  • From: Robert Schoefbeck <schoefbeck at hep.itp.tuwien.ac.at>
  • Date: Wed, 28 Sep 2005 01:40:59 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

Hello all,

I want to implement superspace calculations in a mathematica package.
I define (code below) grassmannian theta-variables with upper and lower, 
dotted and undotted indices. Having declared (anti)- commutativity
with DeclareOdd i use myTimes to handle multiplications of Superfields.

Dummy indices are generated by use of Unique[]. All this multiplication 
stuff works pretty well but looking at the one but last output i have 
the problem that contractions with different dummies are not recognized 
as equal.

My questions are: Is there a way to tell mathematica to keep the 
information that indices are equal but forgetting about the name of the 
dummy?

I'd also like to pull indices with metrics, something like

e[a,b]theta[b]=theta[a]

How should i implement the defining relations for index pulling
(i have vector, and chiral/antichiral spinor indices, color indices and 
so on) such that 1) Simplify can handle them?

any help is welcome, does maybe someone have a sample application of how
to handle indices?
i'd also appreciate any comment on the code.

robert schoefbeck




short description:

OddPQ tests whether an object has odd parity or not

mytimes handles ,multiplications

CSF[phi,lambda,F]  ... chiral superfield defined by component fields 
(lambda is odd)
ACSF ... antichiral Superfield


Code:



Notebook[{
Cell[BoxData[
     \(\(Clear[myTimes];\)\)], "Input"],

Cell[BoxData[
     \(\(\(Clear[DeclareOdd, OddPQ, myTimes]\[IndentingNewLine]
     \(DeclareOdd[
           var__] := \(\((OddPQ[#] =
                 True)\) &\) /@ {var};\)\[IndentingNewLine]
     \(\(DeclareEven[
           var__] := \(\((OddPQ[#] =
                 False)\) &\) /@ {var};\)\(\[IndentingNewLine]\)
     \)\)\( (*OddPQ[myTimes[x__]] :=
         Mod[Count[OddPQ /@ {x}, True], 2] \[Equal]
           1*) \)\)\)], "Input"],

Cell[BoxData[
     \(\(DeclareOdd[\[Theta][\[Alpha]_], \[Theta]b[\[Alpha]_]];\)\)], \
"Input"],

Cell[BoxData[
     \(\(OddPQ[x_?NumericQ] := False;\)\)], "Input"],

Cell[BoxData[
     \(\(DeclareOdd[\[Theta][\[Alpha]_], \[Theta]b[\[Alpha]_]];\)\)], \
"Input"],

Cell["rearranging of elementary Odd variables", "Text"],

Cell[BoxData[{
     \(myTimes[a___, x_, b___, x_, c___] /; OddPQ[x] :=
       0\), "\[IndentingNewLine]",
     \(myTimes[x___] /; \((And @@ \(OddPQ /@ {x}\))\) &&
           Not[OrderedQ[{x}]] :=
       Signature[{x}]*myTimes[Sequence @@ Sort[{x}]]\)}], "Input"],

Cell["linearity", "Text"],

Cell[BoxData[
     \(myTimes[x___, y_Plus, z___] := \(myTimes[x, #, z] &\) /@
         y\)], "Input"],

Cell[BoxData[
     \(myTimes[x___, y_Times, z___] :=
       myTimes[x, Apply[Sequence, y], z]\)], "Input"],

Cell[BoxData[
     \(myTimes[x___, y_myTimes, z___] :=
       myTimes[x, Apply[Sequence, y], z]\)], "Input"],

Cell["a single expression in mytimes whose head is not myTimes", \
"Text"],

Cell[BoxData[
     \(myTimes[a_] /; Head[a] =!= Times := a\)], "Input"],

Cell["\<\
after linearity downvalues: myTimes\[Rule]Times if possible\
\>", "Text"],

Cell[BoxData[
     \(myTimes[a_, b_] /; \(! OddPQ[a]\) || \(! OddPQ[b]\) :=
       a*b\)], "Input"],

Cell[BoxData[
     \(\(myTimes[] = 1;\)\)], "Input"],

Cell["\<\
split off avars in myTimes (corrected version: Length[coms>0])\
\>", "Text"],

Cell[BoxData[
     \(myTimes[vars__] /; Length[{vars}] > 2 :=
       Module[{vl = {vars}, antis, coms, exponents},
         antis = Select[vl, OddPQ]; \[IndentingNewLine]coms =
           Complement[vl,
             antis]; \[IndentingNewLine]exponents = \(Count[
                 vl, #] &\) /@
             coms; \[IndentingNewLine]Inner[Power, coms, exponents,
               Times]*Apply[myTimes, antis] /;
           Length[coms] > 0]\)], "Input"],

Cell["4-dim chiral thetas", "Text"],

Cell[BoxData[
     \(myTimes[
           x___] /; \((Length[{x}] > 2 &&
             Max\ [\(Count[{x}, #[_]] &\) /@
                   Union[Select[{x}, OddPQ] /.
                       f_[_] \[RuleDelayed] f]] > 2)\) :=
       0\)], "Input"],

Cell["END", "Text"],

Cell[BoxData[
     \(\(DeclareOdd[\[Theta][_], \[Theta]b[_]];\)\)], "Input"],

Cell[BoxData[{
     \(\(Format[\[Theta]b[
             Index[\[Alpha]_,
               down]]] := \[Theta]\&_\_\[Alpha]\& . ;\)\), "\
\[IndentingNewLine]",
     \(\(Format[\[Theta]b[
             Index[\[Alpha]_,
               up]]] := \[Theta]\&_\^\[Alpha]\& . ;\)\)}], "Input"],

Cell[BoxData[{
     \(\(Format[\[Theta][
             Index[\[Alpha]_,
               down]]] := \[Theta]\_\[Alpha];\)\), \
"\[IndentingNewLine]",
     \(\(Format[\[Theta][
             Index[\[Alpha]_,
               up]]] := \[Theta]\^\[Alpha];\)\)}], "Input"],

Cell[BoxData[
     \(Format[myConjugate[x_]] := x\&_\)], "Input"],

Cell[BoxData[{
     \(\(Clear[CSF];\)\), "\[IndentingNewLine]",
     \(\(\(CSF[0, 0, F_Symbol] :=
       Module[{ad1, au1}, indid1 = Unique[\[Alpha]];
         ad1 = Index[indid1, down];
         au1 = Index[indid1,
             up]; \[IndentingNewLine]F\ myTimes[\[Theta][
               ad1], \[Theta][au1]]]\)\(\[IndentingNewLine]\)
     \)\)}], "Input"],

Cell[BoxData[
     \(\(CSF[\[Phi]_Symbol, \[Lambda]_Symbol, F_Symbol] :=
         Module[{ad1, ad2, au1, au2, indid1, indid2},
           indid1 = Unique[\[Alpha]]; indid2 = Unique[\[Alpha]];
           ad1 = Index[indid1, down]; au1 = Index[indid1, up];
           ad2 = Index[indid2, down];
           au2 = Index[indid2,
               up]; \[IndentingNewLine]DeclareOdd[\[Lambda][_]]; \
\[IndentingNewLine]DeclareEven[\[Phi]]; \[IndentingNewLine]Format[\
\[Lambda][Index[\[Alpha]_,
                   down]]] := \[Lambda]\_\[Alpha]; \
\[IndentingNewLine]Format[\[Lambda][
                 Index[\[Alpha]_,
                   up]]] := \[Lambda]\^\[Alpha]; \[IndentingNewLine]\
\[Phi] + Sqrt[2] myTimes[\[Theta][au1], \[Lambda][ad1]] +
             F\ myTimes[\[Theta][au2], \[Theta][
                   ad2]]];\)\)], "Input"],

Cell[BoxData[
     \(\(ACSF[\[Phi]_Symbol, \[Lambda]_Symbol, F_Symbol] :=
         Module[{ad1, ad2, au1, au2, indid1, indid2},
           indid1 = Unique[\[Alpha]]; indid2 = Unique[\[Alpha]];
           au1 = Index[indid1, up]; ad1 = Index[indid1, down];
           au2 = Index[indid2, up];
           ad2 = Index[indid2,
               down]; \[IndentingNewLine]DeclareOdd[\[Lambda][_]]; \
\[IndentingNewLine]DeclareEven[\[Phi]]; \
\[IndentingNewLine]Format[\(myConjugate[\[Lambda]]\)[
                 Index[\[Alpha]_,
                   down]]] := \[Lambda]\&_\_\[Alpha]\& . ; \
\[IndentingNewLine]Format[\(myConjugate[\[Lambda]]\)[
                 Index[\[Alpha]_,
                   up]]] := \[Lambda]\&_\^\[Alpha]\& . ; \
\[IndentingNewLine]myConjugate[\[Phi]] +
             Sqrt[2]
               myTimes[\[Theta]b[ad1], \(myConjugate[\[Lambda]]\)[
                   au1]] +
             myConjugate[
                 F]\ myTimes[\[Theta]b[ad2], \[Theta]b[
                   au2]]];\)\)], "Input"],

Cell[CellGroupData[{

Cell[BoxData[
     \(CSF[\[Phi], \[Lambda], F]\)], "Input"],

Cell[BoxData[
     FormBox[
       RowBox[{"\[Phi]", "+",
         RowBox[{\(\@2\), " ",
           RowBox[{"myTimes", "(",
             RowBox[{
               FormBox[\(\[Theta]\^\[Alpha]$792\),
                 "TraditionalForm"], ",",
               FormBox[\(\[Lambda]\_\[Alpha]$792\),
                 "TraditionalForm"]}], ")"}]}], "-",
         RowBox[{"F", " ",
           RowBox[{"myTimes", "(",
             RowBox[{
               FormBox[\(\[Theta]\_\[Alpha]$793\),
                 "TraditionalForm"], ",",
               FormBox[\(\[Theta]\^\[Alpha]$793\),
                 "TraditionalForm"]}], ")"}]}]}],
       TraditionalForm]], "Output"]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[
     \(myTimes[CSF[\[Phi], \[Lambda], F],
       CSF[\[Phi], \[Lambda], F]]\)], "Input"],

Cell[BoxData[
     FormBox[
       RowBox[{\(\[Phi]\^2\), "+",
         RowBox[{\(\@2\), " ",
           RowBox[{"myTimes", "(",
             RowBox[{
               FormBox[\(\[Theta]\^\[Alpha]$795\),
                 "TraditionalForm"], ",",
               FormBox[\(\[Lambda]\_\[Alpha]$795\),
                 "TraditionalForm"]}], ")"}], " ", "\[Phi]"}], "-",
         RowBox[{"F", " ",
           RowBox[{"myTimes", "(",
             RowBox[{
               FormBox[\(\[Theta]\_\[Alpha]$796\),
                 "TraditionalForm"], ",",
               FormBox[\(\[Theta]\^\[Alpha]$796\),
                 "TraditionalForm"]}], ")"}], " ", "\[Phi]"}], "+",
         RowBox[{\(\@2\), " ",
           RowBox[{"myTimes", "(",
             RowBox[{
               FormBox[\(\[Theta]\^\[Alpha]$798\),
                 "TraditionalForm"], ",",
               FormBox[\(\[Lambda]\_\[Alpha]$798\),
                 "TraditionalForm"]}], ")"}], " ", "\[Phi]"}], "-",
         RowBox[{"F", " ",
           RowBox[{"myTimes", "(",
             RowBox[{
               FormBox[\(\[Theta]\_\[Alpha]$799\),
                 "TraditionalForm"], ",",
               FormBox[\(\[Theta]\^\[Alpha]$799\),
                 "TraditionalForm"]}], ")"}], " ", "\[Phi]"}], "-",
         RowBox[{"2", " ",
           RowBox[{"myTimes", "(",
             RowBox[{
               FormBox[\(\[Theta]\^\[Alpha]$795\),
                 "TraditionalForm"], ",",
               FormBox[\(\[Theta]\^\[Alpha]$798\),
                 "TraditionalForm"], ",",
               FormBox[\(\[Lambda]\_\[Alpha]$795\),
                 "TraditionalForm"], ",",
               FormBox[\(\[Lambda]\_\[Alpha]$798\),
                 "TraditionalForm"]}], ")"}]}]}],
       TraditionalForm]], "Output"]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[
     \(myTimes[ACSF[\[Phi], \[Lambda], F],
       CSF[\[Phi], \[Lambda], F]]\)], "Input"],

Cell[BoxData[
     FormBox[
       RowBox[{
         RowBox[{"\[Phi]", " ",
           FormBox[\(\[Phi]\&_\),
             "TraditionalForm"]}], "+",
         RowBox[{\(\@2\), " ",
           RowBox[{"myTimes", "(",
             RowBox[{
               FormBox[\(\[Theta]\^\[Alpha]$816\),
                 "TraditionalForm"], ",",
               FormBox[\(\[Lambda]\_\[Alpha]$816\),
                 "TraditionalForm"]}], ")"}], " ",
           FormBox[\(\[Phi]\&_\),
             "TraditionalForm"]}], "-",
         RowBox[{"F", " ",
           RowBox[{"myTimes", "(",
             RowBox[{
               FormBox[\(\[Theta]\_\[Alpha]$817\),
                 "TraditionalForm"], ",",
               FormBox[\(\[Theta]\^\[Alpha]$817\),
                 "TraditionalForm"]}], ")"}], " ",
           FormBox[\(\[Phi]\&_\),
             "TraditionalForm"]}], "+",
         RowBox[{"\[Phi]", " ",
           FormBox[\(F\&_\),
             "TraditionalForm"], " ",
           RowBox[{"myTimes", "(",
             RowBox[{
               FormBox[\(\[Theta]\&_\_\(\[Alpha]$814\& . \)\),
                 "TraditionalForm"], ",",
               FormBox[\(\[Theta]\&_\^\(\[Alpha]$814\& . \)\),
                 "TraditionalForm"]}], ")"}]}], "+",
         RowBox[{\(\@2\), " ",
           FormBox[\(F\&_\),
             "TraditionalForm"], " ",
           RowBox[{"myTimes", "(",
             RowBox[{
               FormBox[\(\[Theta]\^\[Alpha]$816\),
                 "TraditionalForm"], ",",
               FormBox[\(\[Theta]\&_\_\(\[Alpha]$814\& . \)\),
                 "TraditionalForm"], ",",
               FormBox[\(\[Theta]\&_\^\(\[Alpha]$814\& . \)\),
                 "TraditionalForm"], ",",
               FormBox[\(\[Lambda]\_\[Alpha]$816\),
                 "TraditionalForm"]}], ")"}]}], "-",
         RowBox[{"F", " ",
           FormBox[\(F\&_\),
             "TraditionalForm"], " ",
           RowBox[{"myTimes", "(",
             RowBox[{
               FormBox[\(\[Theta]\_\[Alpha]$817\),
                 "TraditionalForm"], ",",
               FormBox[\(\[Theta]\^\[Alpha]$817\),
                 "TraditionalForm"], ",",
               FormBox[\(\[Theta]\&_\_\(\[Alpha]$814\& . \)\),
                 "TraditionalForm"], ",",
               FormBox[\(\[Theta]\&_\^\(\[Alpha]$814\& . \)\),
                 "TraditionalForm"]}], ")"}]}], "-",
         RowBox[{"2", " ",
           RowBox[{"myTimes", "(",
             RowBox[{
               FormBox[\(\[Theta]\^\[Alpha]$816\),
                 "TraditionalForm"], ",",
               FormBox[\(\[Theta]\&_\_\(\[Alpha]$813\& . \)\),
                 "TraditionalForm"], ",",
               FormBox[\(\[Lambda]\_\[Alpha]$816\),
                 "TraditionalForm"]}], ")"}], " ",
           FormBox[\(\[Lambda]\&_\^\(\[Alpha]$813\& . \)\),
             "TraditionalForm"]}], "-",
         RowBox[{\(\@2\), " ", "F", " ",
           RowBox[{"myTimes", "(",
             RowBox[{
               FormBox[\(\[Theta]\_\[Alpha]$817\),
                 "TraditionalForm"], ",",
               FormBox[\(\[Theta]\^\[Alpha]$817\),
                 "TraditionalForm"], ",",
               FormBox[\(\[Theta]\&_\_\(\[Alpha]$813\& . \)\),
                 "TraditionalForm"]}], ")"}], " ",
           FormBox[\(\[Lambda]\&_\^\(\[Alpha]$813\& . \)\),
             "TraditionalForm"]}], "+",
         RowBox[{\(\@2\), " ", "\[Phi]", " ",
           FormBox[\(\[Theta]\&_\_\(\[Alpha]$813\& . \)\),
             "TraditionalForm"], " ",
           FormBox[\(\[Lambda]\&_\^\(\[Alpha]$813\& . \)\),
             "TraditionalForm"]}]}], TraditionalForm]], "Output"]
}, Open  ]]
}
]



  • Prev by Date: Re: Checking for a given phrase in an expression
  • Next by Date: Re: Bug in Mathematica ?
  • Previous by thread: SVG Authoring Tool Chain Report
  • Next by thread: Re: Grassmann Calculus / Indexed Objects / Simplify