# Evaluating ME using standalone MG code

Hello,

I am trying to produce and use standalone code for ME computation using MadGraph. For this I use the prescription from here: https://cp3.irmp.ucl.ac.be/projects/madgraph/wiki/FAQ-General-4 , from the secion labelled 'Full library of process in python for version 2.6.0 and 2.7.0 ' to have a single python library for the full set of matrix-element with different final states 4mu, 4e, 2mu2e and 2e2mu. Note that I use MG v2.7.3 for this computation.

First, I generate the process as such:

import model SMEFTatNLO-cpG_ctp_cpt (cpG_ctp_cpt is just a custom restrict_card that I create in the SMEFTatNLO model)
generate g g > l+ l- l+ l- /g QCD=4 QED=4 NP^2==4
output standalone gg4l_OpgSquared_standalone --prefix=int

This should produce the tree-level ggH process available with the dim-6 operators of SMEFTatNLO.

Then I do 'make allmatrix2py.so' and use the library for ME computations as such for a rough example:

import allmatrix2py
allmatrix2py.initialise('../Cards/param_card.dat')

def invert_momenta(p):
""" fortran/C-python do not order table in the same order"""
new_p = []
for i in range(len(p[0])): new_p.append([0]*len(p))
for i, onep in enumerate(p):
for j, x in enumerate(onep):
new_p[j][i] = x
return new_p
p =[[ 0.5000000E+03, 0.0000000E+00, 0.0000000E+00, 0.5000000E+03],
[0.5000000E+03, 0.0000000E+00, 0.0000000E+00, -0.5000000E+03],
[ 0.8855133E+02, -0.2210069E+02, 0.4008035E+02, -0.7580543E+02],
[ 0.3283294E+03, -0.1038496E+03, -0.3019338E+03, 0.7649492E+02],
[ 0.1523581E+03, -0.1058810E+03, -0.9770964E+02, 0.4954839E+02],
[ 0.4307611E+03, 0.2318313E+03, 0.3595630E+03, -0.5023788E+02]
]

p =invert_momenta(p)
nhel = -1 # means sum over all helicity
pdgs = [21,21,11,-11,13,-13] #which pdg is requested
scale2 = 0.0 #only used for loop matrix element. should be set to 0 for tree-level
alphas=0.13

ans = allmatrix2py.smatrixhel(pdgs,p,alphas,scale2,nhel)
print ans

Now, no matter the four momenta, the answer always seems to be 0.0.

Note that for the simple example of 'generate p p > t t~' I do get a decent answer. Also, this issue seems to only arise when trying to have a single python library for the full set of matrix-element. It works okay for each of the SubProcesses/P_xx_xxxx using the prescription in the same webpage.

Is there a way to resolve this issue? We would prefer to have the code for the full set of SubProcesses if possible.

Thanks,
Jay Sandesara

## Question information

Language:
English Edit question
Status:
Solved
For:
Assignee:
No assignee Edit question
Solved by:
Olivier Mattelaer
Solved:
Last query:
 Revision history for this message Olivier Mattelaer (olivier-mattelaer) said on 2021-08-24: #1

Hi,

The standalone fortran code does not perform the permutation of momenta (doing that in fortran would be very complex).
So you have to provide the particle and the pdg in the correct order.
g g > l+ l- l+ l-
I doubt that the pdg that you provide
[21,21,11,-11,13,-13]
is correct since particle 11 is e- while in your process definition you do have "l+"
so that pdg list is not present in your fortran library and returns 0

Cheers,

Olivier

 Revision history for this message Jay Sandesara (jaysandesara) said on 2021-08-24: #2

Thanks Olivier Mattelaer, that solved my question.