-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added FCLoopAddMissingHigherOrdersWarning
- Loading branch information
Showing
5 changed files
with
237 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
FeynCalc/Documentation/Markdown/FCLoopAddMissingHigherOrdersWarning.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
## FCLoopAddMissingHigherOrdersWarning | ||
|
||
`FCLoopAddMissingHigherOrdersWarning[expr, ep, fun]` determines the highest `ep`-power $n$ in the given expression and adds a warning flag of order $\textrm{ep}^n+1$. This is meant to prevent incorrect results stemming insufficient high expansions of `expr` in `ep` | ||
|
||
### See also | ||
|
||
[Overview](Extra/FeynCalc.md), [FCFeynmanParametrize](FCFeynmanParametrize.md), [FCFeynmanPrepare](FCFeynmanPrepare.md). | ||
|
||
### Examples | ||
|
||
```mathematica | ||
FCLoopAddMissingHigherOrdersWarning[1/ep^2 cc1 + 1/ep cc2, ep, epHelp] | ||
``` | ||
|
||
$$\frac{\text{cc1}}{\text{ep}^2}+\frac{\text{cc2}}{\text{ep}}+(1+i) \;\text{epHelp}$$ | ||
|
||
```mathematica | ||
FCLoopAddMissingHigherOrdersWarning[cc1, ep, epHelp] | ||
``` | ||
|
||
$$\text{cc1}+(1+i) \;\text{ep} \;\text{epHelp}$$ | ||
|
||
```mathematica | ||
FCLoopAddMissingHigherOrdersWarning[cc1, ep, epHelp, Complex -> False] | ||
``` | ||
|
||
$$\text{cc1}+\text{ep} \;\text{epHelp}$$ | ||
|
||
```mathematica | ||
FCLoopAddMissingHigherOrdersWarning[cc1, ep, epHelp, Names -> False] | ||
``` | ||
|
||
$$\text{cc1}+(1+i) \;\text{ep} \;\text{epHelp}$$ | ||
|
||
```mathematica | ||
FCLoopAddMissingHigherOrdersWarning[GLI[topo1, {1, 1, 1, 1, 1}] -> cc1/ep^2 + cc2/ep + cc3 , ep, epHelp] | ||
``` | ||
|
||
$$G^{\text{topo1}}(1,1,1,1,1)\to \frac{\text{cc1}}{\text{ep}^2}+\frac{\text{cc2}}{\text{ep}}+\text{cc3}+(1+i) \;\text{ep} \;\text{epHelp}(\text{topo1X11111})$$ |
38 changes: 38 additions & 0 deletions
38
FeynCalc/Documentation/Mathematica/LoopIntegrals/FCLoopAddMissingHigherOrdersWarning.m
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
(* ::Package:: *) | ||
|
||
|
||
|
||
|
||
(* ::Section:: *) | ||
(*FCLoopAddMissingHigherOrdersWarning*) | ||
|
||
|
||
(* ::Text:: *) | ||
(*`FCLoopAddMissingHigherOrdersWarning[expr, ep, fun]` determines the highest `ep`-power $n$ in the given expression and adds a warning flag of order $\textrm{ep}^n+1$. This is meant to prevent incorrect results stemming insufficient high expansions of `expr` in `ep`*) | ||
|
||
|
||
(* ::Subsection:: *) | ||
(*See also*) | ||
|
||
|
||
(* ::Text:: *) | ||
(*[Overview](Extra/FeynCalc.md), [FCFeynmanParametrize](FCFeynmanParametrize.md), [FCFeynmanPrepare](FCFeynmanPrepare.md).*) | ||
|
||
|
||
(* ::Subsection:: *) | ||
(*Examples*) | ||
|
||
|
||
FCLoopAddMissingHigherOrdersWarning[1/ep^2cc1+1/ep cc2,ep,epHelp] | ||
|
||
|
||
FCLoopAddMissingHigherOrdersWarning[cc1,ep,epHelp] | ||
|
||
|
||
FCLoopAddMissingHigherOrdersWarning[cc1,ep,epHelp,Complex->False] | ||
|
||
|
||
FCLoopAddMissingHigherOrdersWarning[cc1,ep,epHelp,Names->False] | ||
|
||
|
||
FCLoopAddMissingHigherOrdersWarning[GLI[topo1,{1,1,1,1,1}]->cc1/ep^2+cc2/ep+cc3 ,ep,epHelp] |
110 changes: 110 additions & 0 deletions
110
FeynCalc/LoopIntegrals/FCLoopAddMissingHigherOrdersWarning.m
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
(* ::Package:: *) | ||
|
||
(* ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ *) | ||
|
||
(* :Title: FCLoopAddMissingHigherOrdersWarning *) | ||
|
||
(* | ||
This software is covered by the GNU General Public License 3. | ||
Copyright (C) 1990-2024 Rolf Mertig | ||
Copyright (C) 1997-2024 Frederik Orellana | ||
Copyright (C) 2014-2024 Vladyslav Shtabovenko | ||
*) | ||
|
||
(* :Summary: Add scalings of masses and momenta *) | ||
|
||
(* ------------------------------------------------------------------------ *) | ||
|
||
FCLoopAddMissingHigherOrdersWarning::usage = | ||
"FCLoopAddMissingHigherOrdersWarning[expr, ep, fun] determines the highest | ||
ep-power $n$ in the given expression and adds a warning flag of order | ||
$\\textrm{ep}^n+1$. This is meant to prevent incorrect results stemming | ||
insufficient high expansions of expr in ep"; | ||
|
||
FCLoopAddMissingHigherOrdersWarning::failmsg = | ||
"Error! FCLoopAddMissingHigherOrdersWarning has encountered a fatal problem and must abort the computation. \ | ||
The problem reads: `1`" | ||
|
||
Begin["`Package`"] | ||
End[] | ||
|
||
Begin["`FCLoopAddMissingHigherOrdersWarning`Private`"] | ||
|
||
fclamhoVerbose::usage = ""; | ||
|
||
Options[FCLoopAddMissingHigherOrdersWarning] = { | ||
FCE -> False, | ||
FCI -> False, | ||
FCVerbose -> False, | ||
Names -> Automatic, | ||
"LHS" -> None, | ||
Complex -> True | ||
}; | ||
|
||
FCLoopAddMissingHigherOrdersWarning[ex_List, ep_, fun_, opts:OptionsPattern[]]:= | ||
Map[FCLoopAddMissingHigherOrdersWarning[#, ep, fun, opts]&,ex]; | ||
|
||
FCLoopAddMissingHigherOrdersWarning[Rule[a_,b_], ep_, fun_, opts:OptionsPattern[]]:= | ||
Rule[a,FCLoopAddMissingHigherOrdersWarning[b, ep, fun, opts, "LHS"->a]]; | ||
|
||
FCLoopAddMissingHigherOrdersWarning[RuleDelayed[a_,b_], ep_, fun_, opts:OptionsPattern[]]:= | ||
rd[a,FCLoopAddMissingHigherOrdersWarning[b, ep, fun, opts, "LHS"->a]] /. rd ->RuleDelayed; | ||
|
||
FCLoopAddMissingHigherOrdersWarning[expr_, ep_, fun_, OptionsPattern[]] := | ||
Block[{ epPower, res , optNames, pref, epHelpName, optLHS}, | ||
|
||
|
||
optNames = OptionValue[Names]; | ||
optLHS = OptionValue["LHS"]; | ||
|
||
If [OptionValue[FCVerbose]===False, | ||
fclamhoVerbose=$VeryVerbose, | ||
If[MatchQ[OptionValue[FCVerbose], _Integer], | ||
fclamhoVerbose=OptionValue[FCVerbose] | ||
]; | ||
]; | ||
|
||
If[ OptionValue[Complex], | ||
pref = (1+I), | ||
pref = 1 | ||
]; | ||
|
||
If[ optNames===Automatic, | ||
|
||
If[ optLHS===None, | ||
epHelpName = fun, | ||
Which[ | ||
Head[optLHS]===GLI, | ||
epHelpName=fun[FCLoopGLIToSymbol[optLHS]], | ||
True, | ||
Message[FCLoopAddMissingHigherOrdersWarning::failmsg, "Unsupported value of the LHS option."]; | ||
Abort[] | ||
]; | ||
], | ||
|
||
|
||
epHelpName = fun | ||
]; | ||
|
||
|
||
FCPrint[1,"FCLoopAddMissingHigherOrdersWarning: Entering.", FCDoControl->fclamhoVerbose]; | ||
FCPrint[3,"FCLoopAddMissingHigherOrdersWarning: Entering with: ", expr, FCDoControl->fclamhoVerbose]; | ||
|
||
epPower = Exponent[expr,ep]; | ||
|
||
If[ !IntegerQ[epPower], | ||
Message[FCLoopAddMissingHigherOrdersWarning::failmsg, "Failed to extract the highest power of " <> ToString[ep]]; | ||
Abort[] | ||
]; | ||
|
||
res = expr + pref*epHelpName*ep^(epPower+1); | ||
|
||
FCPrint[1,"FCLoopAddMissingHigherOrdersWarning: Leaving.", FCDoControl->fclamhoVerbose]; | ||
|
||
res | ||
|
||
]/; !MemberQ[{Rule,RuleDelayed,List},Head[expr]] | ||
|
||
|
||
FCPrint[1,"FCLoopAddMissingHigherOrdersWarning.m loaded."]; | ||
End[] |
49 changes: 49 additions & 0 deletions
49
Tests/LoopIntegrals/FCLoopAddMissingHigherOrdersWarning.test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
|
||
|
||
(* :Title: FCLoopAddMissingHigherOrdersWarning.test *) | ||
|
||
(* | ||
This software is covered by the GNU General Public License 3. | ||
Copyright (C) 1990-2024 Rolf Mertig | ||
Copyright (C) 1997-2024 Frederik Orellana | ||
Copyright (C) 2014-2024 Vladyslav Shtabovenko | ||
*) | ||
|
||
(* :Summary: Framework independent unit tests for FCLoopAddMissingHigherOrdersWarning *) | ||
|
||
(* ------------------------------------------------------------------------ *) | ||
|
||
Tests`LoopIntegrals`fcstFCLoopAddMissingHigherOrdersWarning = | ||
({ | ||
{"fcstFCLoopAddMissingHigherOrdersWarning-ID1", | ||
"FCLoopAddMissingHigherOrdersWarning[1/ep^2cc,ep,epHelp]", | ||
"cc/ep^2 + ((1 + I)*epHelp)/ep"}, | ||
{"fcstFCLoopAddMissingHigherOrdersWarning-ID2", | ||
"FCLoopAddMissingHigherOrdersWarning[1/ep^2cc1+1/ep \ | ||
cc2,ep,epHelp]", "cc1/ep^2 + cc2/ep + (1 + I)*epHelp"}, | ||
{"fcstFCLoopAddMissingHigherOrdersWarning-ID3", | ||
"FCLoopAddMissingHigherOrdersWarning[cc1,ep,epHelp]", | ||
"cc1 + (1 + I)*ep*epHelp"}, | ||
{"fcstFCLoopAddMissingHigherOrdersWarning-ID4", | ||
"FCLoopAddMissingHigherOrdersWarning[cc1,ep,epHelp,Complex->False]\ | ||
", "cc1 + ep*epHelp"}, | ||
{"fcstFCLoopAddMissingHigherOrdersWarning-ID5", | ||
"FCLoopAddMissingHigherOrdersWarning[cc1,ep,epHelp,Names->False]", | ||
"cc1 + (1 + I)*ep*epHelp"}, | ||
{"fcstFCLoopAddMissingHigherOrdersWarning-ID6", | ||
"FCLoopAddMissingHigherOrdersWarning[GLI[topo1,{1,1,1,1,1}]->cc1/\ | ||
ep^2+cc2/ep+cc3 ,ep,epHelp,Names->False]", | ||
"GLI[topo1, {1, 1, 1, 1, 1}] -> cc3 + cc1/ep^2 + cc2/ep + (1 + \ | ||
I)*ep*epHelp"}, | ||
{"fcstFCLoopAddMissingHigherOrdersWarning-ID7", | ||
"FCLoopAddMissingHigherOrdersWarning[GLI[topo1,{1,1,1,1,1}]->cc1/\ | ||
ep^2+cc2/ep+cc3 ,ep,epHelp]", | ||
"GLI[topo1, {1, 1, 1, 1, 1}] -> cc3 + cc1/ep^2 + cc2/ep + (1 + \ | ||
I)*ep*epHelp[topo1X11111]"}, | ||
{"fcstFCLoopAddMissingHigherOrdersWarning-ID8", | ||
"FCLoopAddMissingHigherOrdersWarning[{GLI[topo1,{1,1,1,1,1}]->cc1/\ | ||
ep^2+cc2/ep+cc3} ,ep,epHelp]", | ||
"{GLI[topo1, {1, 1, 1, 1, 1}] -> cc3 + cc1/ep^2 + cc2/ep + (1 + \ | ||
I)*ep*epHelp[topo1X11111]}"} | ||
}) | ||
|