Comments (4)
Hi Vlad,
I usually do a little bit more in Mathematica before creating the Fill statements. I Collect against the integral function names on the RHS of the rules, and apply something like GCoeffSimplify2
to the coefficients.
ep does not end up in the prf, which helps stop the terms becoming too big for FORM (and I will later expand in ep in FORM with a routine which acts on the "denep" denominators).
If I am expanding in more symbols than just ep, I arrange that they end up in their own "den..." functions also. Then the prf functions contain only symbols which won't be expanded later.
Since performance on the Mathematica side can be an issue for large tables I split each reduction table into many parts and process each part in parallel.
(* Slightly modified, from Arnd Behring *)
crCollect[expr_,pat_,f_:Identity]:=
Module[{patalt,vars,res},
If[expr===0,
Return[f[expr]]
];
patalt=If[Head[pat]===List,Alternatives@@pat,pat];
vars=Union@Cases[expr,patalt,{0,Infinity}];
If[Length[vars]===0,
Return[f[expr]]
];
res=CoefficientRules[expr,vars];
res=Map[Apply[Times,vars^#[[1]]]*f[#[[2]]]&,res];
res=Total[res];
Return[res]
];
GCoeffSimplify2[x_] := Module[{numer,denom,coeff},
coeff = Together[x];
numer = Collect[Numerator[coeff], ep,
num
];
denom = FactorList[Denominator[coeff]];
denom = Map[
(#/.{
{a_/;ContainsAll[Variables[a],{ep}], p_}:>denep[a]^p,
{a_ /; ContainsNone[Variables[a], {ep}], p_} :> den[a]^p
})&
,
denom
];
denom = denom/.List->Times;
coeff = crCollect[numer*denom, {ep,_denep},
(prf[Numerator[#],Denominator[#]]& @ Factor[Together[#/.{num[a_]->a,den[b_]->1/b}]])&
]/.{denep[ep]->1/ep};
Return[coeff];
];
As you suggest, you can alternatively create expressions instead of fill statements (wrapping the names in [] makes life much easier here...) and process them in FORM with InParallel;
helping performance when processing many tiny expressions. Those results can be converted to fill statements with some simple regex.
from form.
Assuming your lsclD = 4-2*ep
, your second rule ends up something like:
((denep[1 + 2*ep]*prf[-45, 8*gkin^2*meta^4*u0b^4])/ep +
(denep[1 + 2*ep]*prf[-1, 4*gkin^2*meta^4*u0b^4])/ep^3 +
denep[1 + 2*ep]*prf[9, 2*gkin^2*meta^4*u0b^4] +
(denep[1 + 2*ep]*prf[17, 8*gkin^2*meta^4*u0b^4])/ep^2)*
topology1[1, 0, 1, 0, 1, 0, 0] +
((denep[1 + 2*ep]*prf[-1, gkin*meta^2*u0b^2])/ep +
(denep[1 + 2*ep]*prf[1, 4*gkin*meta^2*u0b^2])/ep^2 +
denep[1 + 2*ep]*prf[3, 4*gkin*meta^2*u0b^2])*
topology100[1, 1, 0, 0, 1, 1, 0]
from form.
from form.
Hi Vlad,
I usually do a little bit more in Mathematica before creating the Fill statements. I Collect against the integral function names on the RHS of the rules, and apply something like
GCoeffSimplify2
to the coefficients.ep does not end up in the prf, which helps stop the terms becoming too big for FORM (and I will later expand in ep in FORM with a routine which acts on the "denep" denominators). If I am expanding in more symbols than just ep, I arrange that they end up in their own "den..." functions also. Then the prf functions contain only symbols which won't be expanded later.
Since performance on the Mathematica side can be an issue for large tables I split each reduction table into many parts and process each part in parallel.
Hi Josh,
many thanks for your input. At the moment I'm using FeynCalc`s Collect2 for organizing the prefactors and my own routine for loading the tables. The source codes for both can be found in the FeynCalc repo.
However, I noticed that the Mathematica parts of my setup are the one that require most time on the cluster, so I started to think of possibilities to minimize their amount in my code. At some point I would also like to make that code public and since not all universities actually have Mma site licenses, parallelizing Mathematica scripts might not be a viable option for everyone.
But InParallel
indeed looks very interesting, I haven't really thought about that before.
Another way: : Do not construct the fill statements directly, but make an expression with the elements of the table mentioned as arguments of a function f; After that use the FillExpression statement to fill the table.
Dear Jos,
thanks a lot, this indeed sounds like an interesting solution, since somehow I overlooked fillexpression
when browsing through the manual.
I think now I've been given enough food for thought to implement something that works reasonably well, thanks again to Josh and Jos :)
from form.
Related Issues (20)
- 'max'i'' does not work HOT 3
- Tensors with zeros as arguments vanish HOT 3
- Can we have Cygwin and MinGW, MinGW64 dlls for ms windows usage? HOT 3
- Segfault during optimisation of complicated expressions HOT 2
- A #do loop over variables from a fold? HOT 8
- I know nothing about this project, but...
- FORM compatibility HOT 5
- What are the system configuration requirements to install FORM? HOT 1
- Please tell me whether my hp laptop with the following hardware system specifications is compatible with FORM or not HOT 1
- Can FORM be installed and run on a laptop with 4 GB RAM? HOT 1
- Packages for configuration in Cygwin HOT 3
- Compiling FORM with --enable-static-link HOT 10
- A question regarding --disable-native HOT 3
- Behavior of implicit sets containing linear combinations of vectors HOT 1
- Improving format mathematica? HOT 5
- gcc-13 runtime error HOT 4
- Compilation of documentation fails in case of compilation from tarball. HOT 1
- Building FORM failed by passing `Windows API` option HOT 4
- identify and polyratfun HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from form.