Skip to content

Commit 521b8aa

Browse files
committed
FeynArts 3.10; Last update: 16 Mar 18;
* Significant improvements to deriving unknown shapes from known ones (ShapeSources, ShapeHook). * Added possibility to use particles' propagator type in Classes coupling.
1 parent fcafa0d commit 521b8aa

File tree

384 files changed

+2035
-582
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

384 files changed

+2035
-582
lines changed

FeynArts.m

Lines changed: 176 additions & 84 deletions
Large diffs are not rendered by default.

FeynArts/Analytic.m

Lines changed: 63 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Analytic.m
33
Translation of InsertFields output into
44
analytic expressions
5-
last modified 4 Feb 16 th
5+
last modified 10 Mar 18 th
66
*)
77

88
Begin["`Analytic`"]
@@ -56,8 +56,7 @@
5656

5757
CreateFeynAmp[ tops:TopologyList[info___][___], options___Rule ] :=
5858
Block[ {alevel, pref, next, gaugeru, truncru, momcons, graphinfo, toplist,
59-
amps, head, topnr = 1, p$nc = Level[P$NonCommuting, {-1}, Alternatives],
60-
opt = ActualOptions[CreateFeynAmp, options]},
59+
amps, head, topnr = 1, opt = ActualOptions[CreateFeynAmp, options]},
6160

6261
If[ (alevel = ResolveLevel[AmplitudeLevel /. opt /. {info} /.
6362
Options[InsertFields]]) === $Failed,
@@ -81,11 +80,12 @@
8180
amps = PickLevel[alevel][tops];
8281
Scan[ If[FreeQ[amps, #], Message[CreateFeynAmp::nolevel, #]]&, alevel ];
8382

84-
amps = CreateAmpTop/@ ( amps //.
83+
amps = amps //.
8584
(_ -> Insertions[_][]) :> Seq[] /.
86-
(Field[i_] -> fi:P$Generic) :> (Field[i] -> fi[Index[Generic, i]]) );
87-
FAPrint[1, "in total: ",
88-
Statistics[{Insertions[Generic]@@ amps}, alevel, " amplitude"]];
85+
(Field[i_] -> fi:P$Generic) :> (Field[i] -> fi[Index[Generic, i]]);
86+
amps = Level[CreateAmpTop/@ amps, {2}, Insertions[Generic]];
87+
88+
FAPrint[1, "in total: ", Statistics[{amps}, alevel, " amplitude"]];
8989

9090
head = FeynAmpList[info] /.
9191
(Process -> iorule_) :> (Process ->
@@ -99,12 +99,12 @@
9999
]
100100

101101

102-
iomom[ 1, n_ ] = FourMomentum[Incoming, n]
102+
iomom[ 1, n_ ] := FourMomentum[Incoming, n]
103103

104-
iomom[ 2, n_ ] = FourMomentum[Outgoing, n]
104+
iomom[ 2, n_ ] := FourMomentum[Outgoing, n]
105105

106106

107-
CreateAmpTop[ P$Topology ] = Sequence[]
107+
CreateAmpTop[ P$Topology ] = {}
108108

109109
CreateAmpTop[ top:P$Topology -> ins_ ] :=
110110
Block[ {momtop, imom, oldmom, amp, c, toppref, mtf, mc = 0, gennr = 0},
@@ -134,9 +134,8 @@
134134

135135
toppref = pref /. LoopNumber :> Genus[top];
136136

137-
amp = Sequence@@ (CreateAmpGraph[momtop, #]&)/@ ins;
138-
FAPrint[2, "> Top. ", topnr++, ": ",
139-
Statistics[{Insertions[Generic][amp]}, alevel, " amplitude"]];
137+
amp = CreateAmpGraph[momtop]/@ ins;
138+
FAPrint[2, "> Top. ", topnr++, ": ", Statistics[{amp}, alevel, " amplitude"]];
140139
amp
141140
]
142141

@@ -192,7 +191,7 @@ Since momenta on tree propagators (Propagator[Internal])
192191

193192
RenumberMom[ _, _Integer ] := FourMomentum[Internal, ++mc]
194193

195-
RenumberMom[ _, id_ ] = FourMomentum[Internal, id]
194+
RenumberMom[ _, id_ ] := FourMomentum[Internal, id]
196195

197196

198197
MomConservation[ top_, vert_ ] := Throw[top] /; FreeQ[top, ZZZ]
@@ -207,64 +206,59 @@ Since momenta on tree propagators (Propagator[Internal])
207206
]
208207
]
209208

210-
IncomingMomentum[ v_, _[v_, v_, ___] ] = 0
209+
IncomingMomentum[ v_, _[v_, v_, ___] ] := 0
211210

212-
IncomingMomentum[ v_, _[v_, _, ___, m_] ] = -m
211+
IncomingMomentum[ v_, _[v_, _, ___, m_] ] := -m
213212

214-
IncomingMomentum[ v_, _[_, v_, ___, m_] ] = m
213+
IncomingMomentum[ v_, _[_, v_, ___, m_] ] := m
215214

216215
IncomingMomentum[ __ ] = 0
217216

218217

219-
app[ fi_ ] = fi
220-
221-
222-
CreateAmpGraph[ top_, gr:FeynmanGraph[s_, ___][__] -> ins_ ] :=
223-
Block[ {amp, gm, rawgm, orig, anti},
224-
(* must save Field[n] information to be able to subsequently
225-
apply the insertion rules of deeper levels *)
226-
amp = CreateAmpGraph[ top,
227-
gr /. (n_ -> x_. fi_[i__]) :> (n -> x fi[i, orig[x, n]]) ];
218+
CreateAmpGraph[top_][ gr:FeynmanGraph[sym_, ___][__] -> ins_ ] :=
219+
Block[ {track, amp, gm, gmraw, anti},
220+
amp = CreateAmpGraph[top] @
221+
Replace[gr, (n_ -> s_. fi_[i___]) :> (n -> s fi[i, track[s, n]]), 1];
228222
gm = Append[
229223
Union[ Cases[amp[[3]], P$InsertionObjects, Infinity, Heads -> True] ],
230224
RelativeCF ];
231-
rawgm = gm /.
232-
s1_. _[__, orig[s2_, fi_], k___] :>
233-
app[ If[s1 === s2, fi, anti[fi]], k ];
234-
Append[amp, gm -> (CreateAmpIns[top, rawgm, s mtf, #]&)/@ ins] /.
235-
orig[__] :> Seq[]
225+
gmraw = gm /. s1_. _[__, track[s2_, fi_], k___] :>
226+
track[If[s1 === s2, fi, anti[fi]], k];
227+
Append[amp, gm -> CreateAmpIns[top, gmraw, sym mtf]/@ ins ] /.
228+
fi_[i__, _track, ___] :> fi[i]
236229
]
237230

231+
238232
FieldNumber[ fi_ ] := Sequence@@ Cases[fi, Field[n_] :> n, Infinity, 1] /;
239-
!FreeQ[fi, orig]
233+
!FreeQ[fi, track]
240234

241235

242236
(* Create the basic amplitude *)
243237

244-
CreateAmpGraph[ top_, FeynmanGraph[s_, ___][ru__] ] :=
238+
CreateAmpGraph[top_][ FeynmanGraph[sym_, ___][ru__] ] :=
245239
Block[ {c, res, props, vert, faden, prden = {},
246-
scalars = {RelativeCF, toppref, 1/s}},
240+
scalars = {RelativeCF, toppref, 1/sym}},
247241

248242
c[_] = 0;
249243
res = AddKinematicIndices/@ (List@@ top /. {ru});
244+
250245
mtf = 1;
251246
If[ $FermionLines, res = MakeFermionChains[res] ];
252247

253248
(* props contains the propagators not involved in gmcs *)
254249
props = Cases[res, Propagator[_][__]];
255250
vert = Vertices[props];
256251

257-
(* insert the vertices in fermion chains first. Note that
258-
MidVertex and ToChain modify vert *)
252+
(* insert the vertices in fermion chains first.
253+
Note that MidVertex and ToChain modify vert *)
259254
res = res /. ch:_dot | _tr :> ResolveChain[ch];
260255

261256
(* now the remaining vertices *)
262257
vert = ResolveGeneric/@ vert;
263-
264-
(* TakeNC does the multiplication business. It also updates
265-
scalars and prden *)
266258
res = Join[vert, res /. Propagator -> ResolvePropagator /. gaugeru] /.
267259
PV -> TakeNC;
260+
(* TakeNC does the multiplication business.
261+
It also updates scalars and prden *)
268262

269263
FeynAmp[
270264
GraphID[Topology == topnr, Generic == ++gennr],
@@ -276,16 +270,15 @@ Since momenta on tree propagators (Propagator[Internal])
276270
]
277271

278272

279-
AddKinematicIndices[
280-
Propagator[type_][vert__, s_. fi_[ind___], mom_] ] :=
273+
AddKinematicIndices[ Propagator[type_][vert__, s_. fi_[ind___], mom_] ] :=
281274
Block[ {ki = KinematicIndices[fi], kin},
282275
If[ Length[ki] === 0, kin = Seq[],
283276
kin = If[ FreeQ[{vert}, Vertex[1]],
284277
Rule@@ Transpose[{Index[#, ++c[#]], Index[#, ++c[#]]}&/@ ki],
285278
(* else *)
286279
Index[#, ++c[#]]&/@ ki
287280
] ];
288-
Propagator[type][vert, s fi[ind, mom, kin]]
281+
Propagator[type][vert, s fi[ind, ResolveType[type], mom, kin]]
289282
]
290283

291284

@@ -349,11 +342,11 @@ explicit spinor index with which it is possible (outside of FeynArts)
349342
Select[top, FreeQ[#[[3]], nc]&] )
350343

351344

352-
MakeFermionChains[ top_ ] := top /; FreeQ[top, p$nc]
345+
MakeFermionChains[ top_ ] := top /; FreeQ[top, P$NonCommuting]
353346

354347
MakeFermionChains[ top_ ] :=
355348
Block[ {ch = {}, res, ext},
356-
res = Fold[NCSelect, top, Flatten[{P$NonCommuting}]];
349+
res = Fold[NCSelect, top, P$ChainBuildOrder];
357350
res = Flatten[{res, Cases[ch, gmc[c__] :> Chkgmc[Fixgmc[c]], Infinity]}];
358351

359352
(* Since fermion chains are always traversed opposite to the
@@ -374,7 +367,7 @@ need another (-1)^(Length[ext]/2).
374367
]
375368

376369

377-
Leg[ Vertex[1][n_] ] = n
370+
Leg[ Vertex[1][n_] ] := n
378371

379372
Leg[ _ ] = {}
380373

@@ -410,12 +403,12 @@ need another (-1)^(Length[ext]/2).
410403

411404
ResolveGeneric[ vert:Vertex[_, cto_:0][_], chainprops___ ] :=
412405
Block[ {v, perm},
413-
v = SignedMixers/@ TakeInc[vert]/@ Flatten[{chainprops, props}];
406+
v = SignedMixers/@ Level[TakeInc[vert]/@ Flatten[{chainprops, props}], {2}];
414407
perm = FindVertex[ToGeneric[v], Generic];
415408
If[ perm === $Failed, Return[{}] ];
416409
v = v[[perm]];
417410
If[ cto < 0,
418-
I PV[ If[FreeQ[v, p$nc], Identity, NonCommutative][
411+
I PV[ If[FreeQ[v, P$NonCommuting], Identity, NonCommutative][
419412
VertexFunction[-cto]@@ v ] ],
420413
(* else *)
421414
AnalyticalCoupling[cto]@@ v ]
@@ -433,15 +426,15 @@ need another (-1)^(Length[ext]/2).
433426
)
434427

435428

436-
LeftVertex[ p1:_[Vertex[1][_], __] ] = p1
429+
LeftVertex[ p1:_[Vertex[1][_], __] ] := p1
437430

438431
LeftVertex[ p1:_[v_, __] ] := (
439432
vert = DeleteCases[vert, v];
440433
Seq[ResolveGeneric[v, p1], p1]
441434
)
442435

443436

444-
RightVertex[ p2:_[_, Vertex[1][_], ___] ] = p2
437+
RightVertex[ p2:_[_, Vertex[1][_], ___] ] := p2
445438

446439
RightVertex[ p2:_[_, v_, ___] ] := (
447440
vert = DeleteCases[vert, v];
@@ -472,12 +465,10 @@ need another (-1)^(Length[ext]/2).
472465
the head or else the kinematical information is altered. *)
473466
ResolvePropagator[type_][ _, _, part_ ] :=
474467
Block[ {res},
475-
res = MapAt[
476-
# /. {_Loop -> Internal, Incoming | Outgoing -> External} &,
477-
AnalyticalPropagator[type][part],
478-
0 ];
468+
res = AnalyticalPropagator[ResolveType[type]][part] /.
469+
AnalyticalPropagator[Loop] :> AnalyticalPropagator[Internal];
479470
If[ Head[res] === PV,
480-
res /. Mass[fi_] :> Mass[fi, ResolveType[type]],
471+
res,
481472
(* else *)
482473
Message[CreateFeynAmp::noprop, part]; Propagator[part] ]
483474
]
@@ -505,16 +496,20 @@ need another (-1)^(Length[ext]/2).
505496
LoopPD@@ Cases[p, _PropagatorDenominator]
506497

507498
LoopPD[ p__PropagatorDenominator ] :=
508-
Times@@ Select[{p}, FreeQ[#, FourMomentum[Internal, _]]&] *
509-
FeynAmpDenominator@@ SortPD/@
510-
Select[{p}, !FreeQ[#, FourMomentum[Internal, _]]&]
499+
Block[ {b},
500+
b = Plus@@ Cases[#, FourMomentum[Internal, i_] :> 2^i, Infinity]&/@ {p};
501+
b = (BitOr@@ BitAnd[b, Sign[1 - BitAnd[b, #]]])&/@ b;
502+
Times@@ ToFAD/@
503+
Split[Sort @ Transpose[{b, {p}}], First[#1] === First[#2] &]
504+
]
511505

512506

513-
SortPD[ PropagatorDenominator[mom_, mass__] ] :=
514-
PropagatorDenominator[ Expand[-mom], mass ] /;
515-
!FreeQ[mom, -FourMomentum[Internal, _]]
507+
ToFAD[ pd:{{0, _}, ___} ] := Times@@ Last/@ pd
516508

517-
SortPD[ p_ ] = p
509+
ToFAD[ pd_ ] := FeynAmpDenominator@@ (Last/@ pd /.
510+
PropagatorDenominator[mom_, mass__] :>
511+
PropagatorDenominator[ Expand[-mom], mass ] /;
512+
!FreeQ[mom, -FourMomentum[Internal, _]])
518513

519514

520515
Attributes[ FeynAmpDenominator ] = {Orderless}
@@ -534,15 +529,13 @@ need another (-1)^(Length[ext]/2).
534529
SumOver[i, l, ext] /; r === Range[l]
535530

536531

537-
CreateAmpIns[ top_, gm_, sgen_, gr_ -> ins_ ] :=
538-
CreateAmpIns[top, gm, sgen, gr] ->
539-
(CreateAmpIns[top, gm, sgen, #]&)/@ ins
532+
c_CreateAmpIns[ gr_ -> ins_ ] := c[gr] -> c/@ ins
540533

541-
CreateAmpIns[ top_, gm_, sgen_, gr:FeynmanGraph[s_, ___][ru__] ] :=
534+
CreateAmpIns[top_, gm_, symgen_][ gr:FeynmanGraph[sym_, ___][ru__] ] :=
542535
Block[ {ext, int, ins, deltas},
543-
ins = ReplacePart[gm, sgen/s, -1] /. {ru} /.
536+
ins = ReplacePart[gm, symgen/sym, -1] /. {ru} /.
544537
anti -> AntiParticle /.
545-
app[ x_. (fi:P$Generic)[n__], k__ ] :> x fi[n, k];
538+
track[ s_. fi_[n__], k__ ] :> s fi[n, k];
546539
deltas = DeleteCases[ Union@@ CouplingDeltas/@
547540
Union[ Cases[ins, G[_][cto_][fi__][_] :> FieldPoint[cto][fi]] ],
548541
_Integer ];
@@ -659,7 +652,7 @@ kinematical expression (for a G[-]). If neither method resolves TheC,
659652
SequenceForm[StringTake[ToString[type], 3], i]
660653

661654

662-
PickLevel[ _ ][ tops_TopologyList ] = tops
655+
PickLevel[ _ ][ tops_TopologyList ] := tops
663656

664657
PickLevel[ lev_ ][ tops:TopologyList[___][___] ] :=
665658
Block[ {Rule, levels, res},
@@ -814,7 +807,7 @@ kinematical expression (for a G[-]). If neither method resolves TheC,
814807

815808
FermionRouting[ gr_:{}, top:P$Topology, ___ ] := Level[
816809
merge@@ Apply[ prop[ #1[[1]], #2[[1]] ]&,
817-
Select[AddFieldNo[top] /. List@@ gr, !FreeQ[#, p$nc]&], 1 ],
810+
Select[AddFieldNo[top] /. List@@ gr, !FreeQ[#, P$NonCommuting]&], 1 ],
818811
{-1} ]
819812

820813

@@ -868,7 +861,7 @@ kinematical expression (for a G[-]). If neither method resolves TheC,
868861
] /. (FeynmanGraph[__][__] -> _[]) :> Seq[] ) /.
869862
(Topology[__][__] -> _[]) :> Seq[]
870863

871-
DiagramRemove[ _ ][ t_ ] = t
864+
DiagramRemove[ _ ][ t_ ] := t
872865

873866

874867
ToJoin[ h:Topology == _, r__ ] := {h, ToJoin[r]}

0 commit comments

Comments
 (0)