2
2
Analytic.m
3
3
Translation of InsertFields output into
4
4
analytic expressions
5
- last modified 4 Feb 16 th
5
+ last modified 10 Mar 18 th
6
6
*)
7
7
8
8
Begin ["`Analytic`" ]
56
56
57
57
CreateFeynAmp [ tops :TopologyList [info___ ][___ ], options___ Rule ] :=
58
58
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 ]},
61
60
62
61
If [ (alevel = ResolveLevel [AmplitudeLevel /. opt /. {info } /.
63
62
Options [InsertFields ]]) === $Failed ,
81
80
amps = PickLevel [alevel ][tops ];
82
81
Scan [ If [FreeQ [amps , # ], Message [CreateFeynAmp ::nolevel , # ]]& , alevel ];
83
82
84
- amps = CreateAmpTop /@ ( amps //.
83
+ amps = amps //.
85
84
(_ -> 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" ]];
89
89
90
90
head = FeynAmpList [info ] /.
91
91
(Process -> iorule_ ) :> (Process ->
99
99
]
100
100
101
101
102
- iomom [ 1 , n_ ] = FourMomentum [Incoming , n ]
102
+ iomom [ 1 , n_ ] : = FourMomentum [Incoming , n ]
103
103
104
- iomom [ 2 , n_ ] = FourMomentum [Outgoing , n ]
104
+ iomom [ 2 , n_ ] : = FourMomentum [Outgoing , n ]
105
105
106
106
107
- CreateAmpTop [ P$Topology ] = Sequence []
107
+ CreateAmpTop [ P$Topology ] = {}
108
108
109
109
CreateAmpTop [ top :P$Topology -> ins_ ] :=
110
110
Block [ {momtop , imom , oldmom , amp , c , toppref , mtf , mc = 0 , gennr = 0 },
134
134
135
135
toppref = pref /. LoopNumber :> Genus [top ];
136
136
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" ]];
140
139
amp
141
140
]
142
141
@@ -192,7 +191,7 @@ Since momenta on tree propagators (Propagator[Internal])
192
191
193
192
RenumberMom [ _ , _ Integer ] := FourMomentum [Internal , ++ mc ]
194
193
195
- RenumberMom [ _ , id_ ] = FourMomentum [Internal , id ]
194
+ RenumberMom [ _ , id_ ] : = FourMomentum [Internal , id ]
196
195
197
196
198
197
MomConservation [ top_ , vert_ ] := Throw [top ] /; FreeQ [top , ZZZ ]
@@ -207,64 +206,59 @@ Since momenta on tree propagators (Propagator[Internal])
207
206
]
208
207
]
209
208
210
- IncomingMomentum [ v_ , _ [v_ , v_ , ___ ] ] = 0
209
+ IncomingMomentum [ v_ , _ [v_ , v_ , ___ ] ] : = 0
211
210
212
- IncomingMomentum [ v_ , _ [v_ , _ , ___ , m_ ] ] = - m
211
+ IncomingMomentum [ v_ , _ [v_ , _ , ___ , m_ ] ] : = - m
213
212
214
- IncomingMomentum [ v_ , _ [_ , v_ , ___ , m_ ] ] = m
213
+ IncomingMomentum [ v_ , _ [_ , v_ , ___ , m_ ] ] : = m
215
214
216
215
IncomingMomentum [ __ ] = 0
217
216
218
217
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 ];
228
222
gm = Append [
229
223
Union [ Cases [amp [[3 ]], P$InsertionObjects , Infinity , Heads -> True ] ],
230
224
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 ]
236
229
]
237
230
231
+
238
232
FieldNumber [ fi_ ] := Sequence @@ Cases [fi , Field [n_ ] :> n , Infinity , 1 ] /;
239
- ! FreeQ [fi , orig ]
233
+ ! FreeQ [fi , track ]
240
234
241
235
242
236
(* Create the basic amplitude *)
243
237
244
- CreateAmpGraph [ top_ , FeynmanGraph [s_ , ___ ][ru__ ] ] :=
238
+ CreateAmpGraph [top_ ][ FeynmanGraph [sym_ , ___ ][ru__ ] ] :=
245
239
Block [ {c , res , props , vert , faden , prden = {},
246
- scalars = {RelativeCF , toppref , 1 / s }},
240
+ scalars = {RelativeCF , toppref , 1 / sym }},
247
241
248
242
c [_ ] = 0 ;
249
243
res = AddKinematicIndices /@ (List @@ top /. {ru });
244
+
250
245
mtf = 1 ;
251
246
If [ $FermionLines , res = MakeFermionChains [res ] ];
252
247
253
248
(* props contains the propagators not involved in gmcs *)
254
249
props = Cases [res , Propagator [_ ][__ ]];
255
250
vert = Vertices [props ];
256
251
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 *)
259
254
res = res /. ch :_ dot | _ tr :> ResolveChain [ch ];
260
255
261
256
(* now the remaining vertices *)
262
257
vert = ResolveGeneric /@ vert ;
263
-
264
- (* TakeNC does the multiplication business. It also updates
265
- scalars and prden *)
266
258
res = Join [vert , res /. Propagator -> ResolvePropagator /. gaugeru ] /.
267
259
PV -> TakeNC ;
260
+ (* TakeNC does the multiplication business.
261
+ It also updates scalars and prden *)
268
262
269
263
FeynAmp [
270
264
GraphID [Topology == topnr , Generic == ++ gennr ],
@@ -276,16 +270,15 @@ Since momenta on tree propagators (Propagator[Internal])
276
270
]
277
271
278
272
279
- AddKinematicIndices [
280
- Propagator [type_ ][vert__ , s_ . fi_ [ind___ ], mom_ ] ] :=
273
+ AddKinematicIndices [ Propagator [type_ ][vert__ , s_ . fi_ [ind___ ], mom_ ] ] :=
281
274
Block [ {ki = KinematicIndices [fi ], kin },
282
275
If [ Length [ki ] === 0 , kin = Seq [],
283
276
kin = If [ FreeQ [{vert }, Vertex [1 ]],
284
277
Rule @@ Transpose [{Index [# , ++ c [# ]], Index [# , ++ c [# ]]}& /@ ki ],
285
278
(* else *)
286
279
Index [# , ++ c [# ]]& /@ ki
287
280
] ];
288
- Propagator [type ][vert , s fi [ind , mom , kin ]]
281
+ Propagator [type ][vert , s fi [ind , ResolveType [ type ], mom , kin ]]
289
282
]
290
283
291
284
@@ -349,11 +342,11 @@ explicit spinor index with which it is possible (outside of FeynArts)
349
342
Select [top , FreeQ [# [[3 ]], nc ]& ] )
350
343
351
344
352
- MakeFermionChains [ top_ ] := top /; FreeQ [top , p$nc ]
345
+ MakeFermionChains [ top_ ] := top /; FreeQ [top , P$NonCommuting ]
353
346
354
347
MakeFermionChains [ top_ ] :=
355
348
Block [ {ch = {}, res , ext },
356
- res = Fold [NCSelect , top , Flatten [{ P$NonCommuting }] ];
349
+ res = Fold [NCSelect , top , P$ChainBuildOrder ];
357
350
res = Flatten [{res , Cases [ch , gmc [c__ ] :> Chkgmc [Fixgmc [c ]], Infinity ]}];
358
351
359
352
(* Since fermion chains are always traversed opposite to the
@@ -374,7 +367,7 @@ need another (-1)^(Length[ext]/2).
374
367
]
375
368
376
369
377
- Leg [ Vertex [1 ][n_ ] ] = n
370
+ Leg [ Vertex [1 ][n_ ] ] : = n
378
371
379
372
Leg [ _ ] = {}
380
373
@@ -410,12 +403,12 @@ need another (-1)^(Length[ext]/2).
410
403
411
404
ResolveGeneric [ vert :Vertex [_ , cto_ :0 ][_ ], chainprops___ ] :=
412
405
Block [ {v , perm },
413
- v = SignedMixers /@ TakeInc [vert ]/@ Flatten [{chainprops , props }];
406
+ v = SignedMixers /@ Level [ TakeInc [vert ]/@ Flatten [{chainprops , props }], { 2 }];
414
407
perm = FindVertex [ToGeneric [v ], Generic ];
415
408
If [ perm === $Failed , Return [{}] ];
416
409
v = v [[perm ]];
417
410
If [ cto < 0 ,
418
- I PV [ If [FreeQ [v , p$nc ], Identity , NonCommutative ][
411
+ I PV [ If [FreeQ [v , P$NonCommuting ], Identity , NonCommutative ][
419
412
VertexFunction [- cto ]@@ v ] ],
420
413
(* else *)
421
414
AnalyticalCoupling [cto ]@@ v ]
@@ -433,15 +426,15 @@ need another (-1)^(Length[ext]/2).
433
426
)
434
427
435
428
436
- LeftVertex [ p1 :_ [Vertex [1 ][_ ], __ ] ] = p1
429
+ LeftVertex [ p1 :_ [Vertex [1 ][_ ], __ ] ] : = p1
437
430
438
431
LeftVertex [ p1 :_ [v_ , __ ] ] := (
439
432
vert = DeleteCases [vert , v ];
440
433
Seq [ResolveGeneric [v , p1 ], p1 ]
441
434
)
442
435
443
436
444
- RightVertex [ p2 :_ [_ , Vertex [1 ][_ ], ___ ] ] = p2
437
+ RightVertex [ p2 :_ [_ , Vertex [1 ][_ ], ___ ] ] : = p2
445
438
446
439
RightVertex [ p2 :_ [_ , v_ , ___ ] ] := (
447
440
vert = DeleteCases [vert , v ];
@@ -472,12 +465,10 @@ need another (-1)^(Length[ext]/2).
472
465
the head or else the kinematical information is altered. *)
473
466
ResolvePropagator [type_ ][ _ , _ , part_ ] :=
474
467
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 ];
479
470
If [ Head [res ] === PV ,
480
- res /. Mass [ fi_ ] :> Mass [ fi , ResolveType [ type ]] ,
471
+ res ,
481
472
(* else *)
482
473
Message [CreateFeynAmp ::noprop , part ]; Propagator [part ] ]
483
474
]
@@ -505,16 +496,20 @@ need another (-1)^(Length[ext]/2).
505
496
LoopPD @@ Cases [p , _ PropagatorDenominator ]
506
497
507
498
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
+ ]
511
505
512
506
513
- SortPD [ PropagatorDenominator [mom_ , mass__ ] ] :=
514
- PropagatorDenominator [ Expand [- mom ], mass ] /;
515
- ! FreeQ [mom , - FourMomentum [Internal , _ ]]
507
+ ToFAD [ pd :{{0 , _ }, ___ } ] := Times @@ Last /@ pd
516
508
517
- SortPD [ p_ ] = p
509
+ ToFAD [ pd_ ] := FeynAmpDenominator @@ (Last /@ pd /.
510
+ PropagatorDenominator [mom_ , mass__ ] :>
511
+ PropagatorDenominator [ Expand [- mom ], mass ] /;
512
+ ! FreeQ [mom , - FourMomentum [Internal , _ ]])
518
513
519
514
520
515
Attributes [ FeynAmpDenominator ] = {Orderless }
@@ -534,15 +529,13 @@ need another (-1)^(Length[ext]/2).
534
529
SumOver [i , l , ext ] /; r === Range [l ]
535
530
536
531
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
540
533
541
- CreateAmpIns [ top_ , gm_ , sgen_ , gr :FeynmanGraph [s_ , ___ ][ru__ ] ] :=
534
+ CreateAmpIns [top_ , gm_ , symgen_ ][ gr :FeynmanGraph [sym_ , ___ ][ru__ ] ] :=
542
535
Block [ {ext , int , ins , deltas },
543
- ins = ReplacePart [gm , sgen / s , - 1 ] /. {ru } /.
536
+ ins = ReplacePart [gm , symgen / sym , - 1 ] /. {ru } /.
544
537
anti -> AntiParticle /.
545
- app [ x_ . ( fi : P$Generic ) [n__ ], k__ ] :> x fi [n , k ];
538
+ track [ s_ . fi_ [n__ ], k__ ] :> s fi [n , k ];
546
539
deltas = DeleteCases [ Union @@ CouplingDeltas /@
547
540
Union [ Cases [ins , G [_ ][cto_ ][fi__ ][_ ] :> FieldPoint [cto ][fi ]] ],
548
541
_ Integer ];
@@ -659,7 +652,7 @@ kinematical expression (for a G[-]). If neither method resolves TheC,
659
652
SequenceForm [StringTake [ToString [type ], 3 ], i ]
660
653
661
654
662
- PickLevel [ _ ][ tops_ TopologyList ] = tops
655
+ PickLevel [ _ ][ tops_ TopologyList ] : = tops
663
656
664
657
PickLevel [ lev_ ][ tops :TopologyList [___ ][___ ] ] :=
665
658
Block [ {Rule , levels , res },
@@ -814,7 +807,7 @@ kinematical expression (for a G[-]). If neither method resolves TheC,
814
807
815
808
FermionRouting [ gr_ :{}, top :P$Topology , ___ ] := Level [
816
809
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 ],
818
811
{- 1 } ]
819
812
820
813
@@ -868,7 +861,7 @@ kinematical expression (for a G[-]). If neither method resolves TheC,
868
861
] /. (FeynmanGraph [__ ][__ ] -> _ []) :> Seq [] ) /.
869
862
(Topology [__ ][__ ] -> _ []) :> Seq []
870
863
871
- DiagramRemove [ _ ][ t_ ] = t
864
+ DiagramRemove [ _ ][ t_ ] : = t
872
865
873
866
874
867
ToJoin [ h :Topology == _ , r__ ] := {h , ToJoin [r ]}
0 commit comments