Mathematica中的虚拟索引和约束

时间:2012-02-17 14:27:43

标签: wolfram-mathematica indices

我希望Mathematica根据某些约束简化表达式。例如:

M = p.k p.k

给出约束:

p(mu) * p(nu) = \delta(mu,nu)

应该给出

M = k^2

但我不知道如何指定虚拟索引,我也不太确定我应该在哪里放置约束本身。在Simplify的论证中?

1 个答案:

答案 0 :(得分:2)

In[1]:= FilePrint["dummyindices.m"]
<<HighEnergyPhysics`FeynCalc`
Print[" "];
{$AL[1], $AL[2]} = {mu, nu};  (* $AL are predefined dummy indices *)
M = SP[p,k] * SP[p,k];        (* this defines p.k * p.k *)
SP[k, k] = k2;                (* abbreviate the scalar product k^2 by k2 *)
constraint = FeynCalcInternal[ 
               FourVector[p,mu] FourVector[p,nu] -> MetricTensor[mu, nu] 
];       (* this is one way of specifying the constraint *)
(* use the Uncontract function http://www.feyncalc.org/FeynCalcBook/Uncontract/*)
Print["uncontracting : ", FCF[ tmp = Uncontract[M, k, Pair->All, Unique->False]]];
Print["contract and using the constraint : ",
       FeynCalcExternal @ Contract[tmp /. constraint]
]

In[2]:= <<dummyindices.m
Loading FeynCalc from /home/rolfm/HighEnergyPhysics
FeynCalc 8.1.0 Type ?FeynCalc for help or visit http://www.feyncalc.org/
$PrePrint is set to FeynCalcForm. Use FI and FC to change the display format.
Loading FeynArts, see www.feynarts.de for documentation
FeynArts 3.4 patched for use with FeynCalc

uncontracting :  k[mu] k[nu] p[mu] p[nu]
contract and using the constraint : k2
相关问题