Skip to content

Commit

Permalink
Added FCLoopAddMissingHigherOrdersWarning
Browse files Browse the repository at this point in the history
  • Loading branch information
vsht committed Jul 12, 2024
1 parent f72a240 commit 5d510ad
Show file tree
Hide file tree
Showing 5 changed files with 237 additions and 0 deletions.
1 change: 1 addition & 0 deletions FeynCalc/Documentation/Markdown/Extra/FeynCalc.md
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,7 @@ FeynCalc is a Mathematica package for algebraic calculations in Quantum Field Th
- [FCIteratedIntegralEvaluate](../FCIteratedIntegralEvaluate.md), [FCIteratedIntegralSimplify](../FCIteratedIntegralSimplify.md) - manipulations of Chen's iterated integrals
- [FCFeynmanFindDivergences](../FCFeynmanFindDivergences.md), [FCFeynmanRegularizeDivergence](../FCFeynmanRegularizeDivergence.md), [FCFeynmanParameterJoin](../FCFeynmanParameterJoin.md), [FCFeynmanParametrize](../FCFeynmanParametrize.md), [FCFeynmanPrepare](../FCFeynmanPrepare.md), [FCFeynmanProjectiveQ](../FCFeynmanProjectiveQ.md), [FCFeynmanProjectivize](../FCFeynmanProjectivize.md), [FCMellinJoin](../FCMellinJoin.md) - derivation and manipulation of Feynman parameter integrals
- [FCLoopAddEdgeTags](../FCLoopAddEdgeTags.md), [FCLoopGraphPlot](../FCLoopGraphPlot.md), [FCLoopIntegralToGraph](../FCLoopIntegralToGraph.md), [FCLoopPropagatorsToLineMomenta](../FCLoopPropagatorsToLineMomenta.md) - create and plot graphs representing loop integrals
- [FCLoopAddMissingHigherOrdersWarning](../FCLoopAddMissingHigherOrdersWarning.md) - adds a warning flag to the given $\epsilon$-expansion
- [FCLoopApplyTopologyMappings](../FCLoopApplyTopologyMappings.md), [FCLoopCreateRuleGLIToGLI](../FCLoopCreateRuleGLIToGLI.md), [FCLoopFindMomentumShifts](../FCLoopFindMomentumShifts.md), [FCLoopFindIntegralMappings](../FCLoopFindIntegralMappings.md), [FCLoopFindSubtopologies](../FCLoopFindSubtopologies.md), [FCLoopFindTopologies](../FCLoopFindTopologies.md), [FCLoopFindTopologyMappings](../FCLoopFindTopologyMappings.md), [FCLoopPakOrder](../FCLoopPakOrder.md), [FCLoopToPakForm](../FCLoopToPakForm.md) - loop integral topology identification and minimization
- [FCGraphCuttableQ](../FCGraphCuttableQ.md), [FCGraphFindPath](../FCGraphFindPath.md) - graph manipulations
- [FCLoopBasisCreateScalarProducts](../FCLoopBasisCreateScalarProducts.md) - auxiliary function that generates all possible loop momenta dependent scalar products
Expand Down
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})$$
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 FeynCalc/LoopIntegrals/FCLoopAddMissingHigherOrdersWarning.m
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 Tests/LoopIntegrals/FCLoopAddMissingHigherOrdersWarning.test
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]}"}
})

0 comments on commit 5d510ad

Please sign in to comment.