formfactor python error: undefined reference to `p_'

Asked by Mamutjan

I wanted to modify anomalous quartic coupling by a form factor so that:
a -> a/(1+aamass^2/massscale^2)^2

I found and tried to follow this link (Method1: Pure Python):
https://cp3.irmp.ucl.ac.be/projects/madgraph/wiki/FormFactors

To fix MadGraph output errors, I had to do the following:
1. change "HeavTheta" to "theta_function" in "form_factors.py" second import statement
2. add "import function_library" at the top of "__init__.py"
3. "import formfactors as ForFac" to "import form_factors as ForFac" (with underscore, like the file name) in lorentz.py

I guess above is either due to a typo on the wiki, or some version difference in my environment (i5-3337U CPU, Ubuntu 14.04x64, MG5_aMC_v2_2_3, Python 2.7.6). Finally I got the following error:

MadGraph5Error: A compilation Error occurs ...
    ../../lib//libdhelas.a(FF7_0.o): In function `ff7_0_':
    FF7_0.f:(.text+0x559): undefined reference to `p_'
    FF7_0.f:(.text+0x57d): undefined reference to `p_'
    collect2: error: ld returned 1 exit status
    make: *** [gensym] Error 1

= = = = = = = = = = = = = = = =
Here are some detail about my files and full error stack:

**1. Model: (generated using FeynRules 2.0 on Windows)
added two Lagrangians to SM Lagrangian
LaQ0 := Block[{mu,nu,mu1,ii},
  ExpandIndices[-(1/4) F0 Pi aEW FS[A,mu,nu] FS[A,mu,nu] Wi[mu1,ii] Wi[mu1,ii] / 10^6 , FlavorExpand->SU2W]];

LaQc := Block[{mu,nu1,nu2,ii},
  ExpandIndices[-(1/4) Fc Pi aEW FS[A,mu,nu1] FS[A,mu,nu2] Wi[nu1,ii] Wi[nu2,ii] / 10^6 , FlavorExpand->SU2W]];

where F0, Fc are:
M$Parameters = {
  F0 == {
 ParameterType -> External,
    BlockName -> ANOINPUTS,
 Tex -> Subscript[f, 0],
    InteractionOrder -> {NP,1},
 Value -> 2.,
    Description -> "L_aQ0 coefficient"
  },
  Fc == {
 ParameterType -> External,
    BlockName -> ANOINPUTS,
 Tex -> Subscript[f, 0],
    InteractionOrder -> {NP,1},
 Value -> 2.,
    Description -> "L_aQc coefficient"
  },

**2. I wanted to modify F0 by the formfactor:
a -> a/(1+aamass^2/massscale^2)^2

in my form_factors.py:
AAA = FormFactor(name = 'AAA',
                 type = 'real',
                 value = '(1.0/(1.0 + p(-1,1)*p(-1,2)/(2*(10**6))))' )

**3. Identifying the interactions I wanted to modify in vertices.py:
V_93 = Vertex(name = 'V_93',
              particles = [ P.a, P.a, P.W__minus__, P.W__plus__ ],
              color = [ '1' ],
              lorentz = [ L.VVVV2, L.VVVV3, L.VVVV7 ],
              couplings = {(0,0):C.GC_54,(0,1):C.GC_5,(0,2):C.GC_52})

"L.VVVV2", "L.VVVV3" are FC and SM couplings, so I changed "L.VVVV7" to "L.FF7"

**4. Lorentz structure associated to it in lorentz.py:
VVVV7 = Lorentz(name = 'VVVV7',
                spins = [ 3, 3, 3, 3 ],
                structure = 'P(1,2)*P(2,1)*Metric(3,4) - P(-1,1)*P(-1,2)*Metric(1,2)*Metric(3,4)')

so besides "import form_factors as ForFac" at the top, I added:
FF7 = Lorentz(name = 'FF7',
                spins = [ 3, 3, 3, 3 ],
                structure = 'AAA*P(1,2)*P(2,1)*Metric(3,4) - AAA*P(-1,1)*P(-1,2)*Metric(1,2)*Metric(3,4)',
                formfactors = [ForFac.AAA] )

**5. in MadGraph, after imporing the model, when launching the process
generate a a > w+ w- NP=2
(set lpp 2)
I got the error (dump from run_01_tag_1_debug.log):

#************************************************************
#* MadGraph5_aMC@NLO/MadEvent *
#* *
#* * * *
#* * * * * *
#* * * * * 5 * * * * *
#* * * * * *
#* * * *
#* *
#* *
#* VERSION 2.2.3 2015-02-10 *
#* *
#* The MadGraph5_aMC@NLO Development Team - Find us at *
#* https://server06.fynu.ucl.ac.be/projects/madgraph *
#* *
#************************************************************
#* *
#* Command File for MadEvent *
#* *
#* run as ./bin/madevent.py filename *
#* *
#************************************************************
generate_events run_01
Traceback (most recent call last):
  File "/home/abdueni/MG5_aMC_v2_2_3/madgraph/interface/extended_cmd.py", line 879, in onecmd
    return self.onecmd_orig(line, **opt)
  File "/home/abdueni/MG5_aMC_v2_2_3/madgraph/interface/extended_cmd.py", line 872, in onecmd_orig
    return func(arg, **opt)
  File "/home/abdueni/MG5_aMC_v2_2_3/madgraph/interface/madevent_interface.py", line 1924, in do_generate_events
    postcmd=False)
  File "/home/abdueni/MG5_aMC_v2_2_3/madgraph/interface/extended_cmd.py", line 919, in exec_cmd
    stop = Cmd.onecmd_orig(current_interface, line, **opt)
  File "/home/abdueni/MG5_aMC_v2_2_3/madgraph/interface/extended_cmd.py", line 872, in onecmd_orig
    return func(arg, **opt)
  File "/home/abdueni/MG5_aMC_v2_2_3/madgraph/interface/madevent_interface.py", line 2331, in do_survey
    self.compile(['gensym'], cwd=Pdir)
  File "/home/abdueni/MG5_aMC_v2_2_3/madgraph/interface/extended_cmd.py", line 987, in compile
    return misc.compile(nb_core=self.options['nb_core'], *args, **opts)
  File "/home/abdueni/MG5_aMC_v2_2_3/madgraph/various/misc.py", line 311, in compile
    raise MadGraph5Error, error_text
MadGraph5Error: A compilation Error occurs when trying to compile /home/abdueni/Quartic_UFO_aaww/SubProcesses/P0_aa_wpwm.
The compilation fails with the following output message:
    gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -w -c -o symmetry.o symmetry.f
    touch qmass.inc
    gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -w -c -o cuts.o cuts.f
    gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -w -c -o cluster.o cluster.f
    gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -w -c -o myamp.o myamp.f
    gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -w -c -o genps.o genps.f
    gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -w -c -o initcluster.o initcluster.f
    gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -w -c -o setscales.o setscales.f
    gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -w -c -o reweight.o reweight.f
    gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -w -c -o get_color.o get_color.f
    gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -w -c -o idenparts.o idenparts.f
    gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -w -c -o matrix1.o matrix1.f
    gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -w -c -o setcuts.o setcuts.f
    gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -w -o gensym symmetry.o setcuts.o cuts.o cluster.o myamp.o genps.o initcluster.o setscales.o reweight.o get_color.o idenparts.o matrix1.o -L../../lib/ -ldhelas -ldsample -lmodel -lgeneric -lpdf -lcernlib
    ../../lib//libdhelas.a(FF7_0.o): In function `ff7_0_':
    FF7_0.f:(.text+0x559): undefined reference to `p_'
    FF7_0.f:(.text+0x57d): undefined reference to `p_'
    collect2: error: ld returned 1 exit status
    make: *** [gensym] Error 1

Please try to fix this compilations issue and retry.
Help might be found at https://answers.launchpad.net/madgraph5.
If you think that this is a bug, you can report this at https://bugs.launchpad.net/madgraph5
                              Run Options
                              -----------
               stdout_level : 20 (user set)

                         MadEvent Options
                         ----------------
     automatic_html_opening : False (user set)
          cluster_temp_path : None
              cluster_queue : None (user set)
             cluster_memory : None (user set)
               cluster_time : None (user set)
                    nb_core : 4 (user set)
                   run_mode : 2

                      Configuration Options
                      ---------------------
                text_editor : None
      cluster_status_update : (600, 30)
               pythia8_path : None (user set)
                  hwpp_path : None (user set)
            pythia-pgs_path : None (user set)
                    td_path : None (user set)
               delphes_path : None (user set)
                thepeg_path : None (user set)
               cluster_type : condor
        exrootanalysis_path : None (user set)
                 eps_viewer : None
                web_browser : None
               syscalc_path : None (user set)
           madanalysis_path : None (user set)
                     lhapdf : lhapdf-config
                 hepmc_path : None (user set)
         cluster_retry_wait : 300
           fortran_compiler : None
                auto_update : 7 (user set)
           cluster_nb_retry : 1
                    timeout : 60
               cpp_compiler : None

Question information

Language:
English Edit question
Status:
Solved
For:
MadGraph5_aMC@NLO Edit question
Assignee:
No assignee Edit question
Solved by:
Mamutjan
Solved:
Last query:
Last reply:
Revision history for this message
Mamutjan (mamutjan) said :
#1

Solved.
"undefined reference to `p_" was to due to a typo. It should be upper case P not lower case one in form_factors.py:

AAA = FormFactor(name = 'AAA',
                 type = 'real',
                 value = '(1.0/(1.0 + P(-1,1)*P(-1,2)/(2*(10**6))))**2' )

(I also forgot ^2)