UFOError : invalid syntax (object_library.py, line 268)

Bug #2042963 reported by Gerald Gilbert-Thorple
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MadGraph5_aMC@NLO
New
Undecided
Unassigned

Bug Description

Command "import model 2HDM_NLO" interrupted with error:
UFOError : invalid syntax (object_library.py, line 268)

Line 268 is: raise UFOError("UFO does not support yet more than one occurence of CTParameters in the couplings values.")

Maybe it wants to complain about something I did, but didn't succeed.

I am using Python 3.8.10. Debug file follows:

#************************************************************
#* MadGraph5_aMC@NLO *
#* *
#* * * *
#* * * * * *
#* * * * * 5 * * * * *
#* * * * * *
#* * * *
#* *
#* *
#* VERSION 3.5.1 2023-07-11 *
#* *
#* The MadGraph5_aMC@NLO Development Team - Find us at *
#* https://server06.fynu.ucl.ac.be/projects/madgraph *
#* *
#************************************************************
#* *
#* Command File for MadGraph5_aMC@NLO *
#* *
#* run as ./bin/mg5_aMC filename *
#* *
#************************************************************
set group_subprocesses Auto
set ignore_six_quark_processes False
set low_mem_multicore_nlo_generation False
set complex_mass_scheme False
set include_lepton_initiated_processes False
set gauge unitary
set loop_optimized_output True
set loop_color_flows False
set max_npoint_for_channel 0
set default_unset_couplings 99
set max_t_for_channel 99
set zerowidth_tchannel True
set nlo_mixed_expansion True
import model sm
define p = g u c d s u~ c~ d~ s~
define j = g u c d s u~ c~ d~ s~
define l+ = e+ mu+
define l- = e- mu-
define vl = ve vm vt
define vl~ = ve~ vm~ vt~
set auto_convert_model T
import model 2HDM_NLO
import model 2HDM
Traceback (most recent call last):
  File "/home/jcline/MG5_aMC_v3_5_1/models/__init__.py", line 76, in load_model
    __import__(path_split[-1])
  File "/home/jcline/MG5_aMC_v3_5_1/models/2HDM/__init__.py", line 2, in <module>
    import particles
  File "/home/jcline/MG5_aMC_v3_5_1/models/2HDM/particles.py", line 8, in <module>
    import parameters as Param
  File "/home/jcline/MG5_aMC_v3_5_1/models/2HDM/parameters.py", line 551, in <module>
    value = rhot*Power(Vcb,2),
NameError: name 'rhot' is not defined

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/jcline/MG5_aMC_v3_5_1/madgraph/interface/madgraph_interface.py", line 5619, in do_import
    self._curr_model = import_ufo.import_model(args[1], prefix=prefix,
  File "/home/jcline/MG5_aMC_v3_5_1/models/import_ufo.py", line 250, in import_model
    model = import_full_model(model_path, decay, prefix)
  File "/home/jcline/MG5_aMC_v3_5_1/models/import_ufo.py", line 405, in import_full_model
    ufo_model = ufomodels.load_model(model_path, decay)
  File "/home/jcline/MG5_aMC_v3_5_1/models/__init__.py", line 78, in load_model
    raise UFOError(str(error))
models.UFOError: name 'rhot' is not defined

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/jcline/MG5_aMC_v3_5_1/madgraph/interface/madgraph_interface.py", line 5633, in do_import
    self.exec_cmd('import %s' % line, errorhandling=False, printcmd=True, precmd=False, postcmd=False)
  File "/home/jcline/MG5_aMC_v3_5_1/madgraph/interface/extended_cmd.py", line 1572, in exec_cmd
    stop = Cmd.onecmd_orig(current_interface, line, **opt)
  File "/home/jcline/MG5_aMC_v3_5_1/madgraph/interface/extended_cmd.py", line 1492, in onecmd_orig
    return func(arg, **opt)
  File "/home/jcline/MG5_aMC_v3_5_1/madgraph/interface/master_interface.py", line 281, in do_import
    self.cmd.do_import(self, *args, **opts)
  File "/home/jcline/MG5_aMC_v3_5_1/madgraph/interface/madgraph_interface.py", line 5637, in do_import
    raise self.InvalidCmd('UFO model not python3 compatible. You can convert it via the command \nconvert model %s\nYou can also type \"set auto_convert_model T\" to automatically convert all python2 module to be python3 compatible in the future.' % model_path)
madgraph.InvalidCmd: UFO model not python3 compatible. You can convert it via the command
convert model /home/jcline/MG5_aMC_v3_5_1/models/2HDM
You can also type "set auto_convert_model T" to automatically convert all python2 module to be python3 compatible in the future.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/jcline/MG5_aMC_v3_5_1/madgraph/interface/extended_cmd.py", line 1543, in onecmd
    return self.onecmd_orig(line, **opt)
  File "/home/jcline/MG5_aMC_v3_5_1/madgraph/interface/extended_cmd.py", line 1492, in onecmd_orig
    return func(arg, **opt)
  File "/home/jcline/MG5_aMC_v3_5_1/madgraph/interface/master_interface.py", line 281, in do_import
    self.cmd.do_import(self, *args, **opts)
  File "/home/jcline/MG5_aMC_v3_5_1/madgraph/interface/madgraph_interface.py", line 5635, in do_import
    raise err
  File "/home/jcline/MG5_aMC_v3_5_1/madgraph/interface/madgraph_interface.py", line 5619, in do_import
    self._curr_model = import_ufo.import_model(args[1], prefix=prefix,
  File "/home/jcline/MG5_aMC_v3_5_1/models/import_ufo.py", line 250, in import_model
    model = import_full_model(model_path, decay, prefix)
  File "/home/jcline/MG5_aMC_v3_5_1/models/import_ufo.py", line 405, in import_full_model
    ufo_model = ufomodels.load_model(model_path, decay)
  File "/home/jcline/MG5_aMC_v3_5_1/models/__init__.py", line 78, in load_model
    raise UFOError(str(error))
models.UFOError: invalid syntax (object_library.py, line 268)
                          MadGraph5_aMC@NLO Options
                          ----------------
                auto_update : 7
        complex_mass_scheme : False
    default_unset_couplings : 99
                      gauge : unitary
         group_subprocesses : Auto
  ignore_six_quark_processes : False
  include_lepton_initiated_processes : False
           loop_color_flows : False
      loop_optimized_output : True
  low_mem_multicore_nlo_generation : False
     max_npoint_for_channel : 0
          max_t_for_channel : 99
        nlo_mixed_expansion : True
               stdout_level : 20 (user set)
         zerowidth_tchannel : True

                         MadEvent Options
                          ----------------
     automatic_html_opening : True
                    nb_core : None
        notification_center : True
                   run_mode : 2

                      Configuration Options
                      ---------------------
                        OLP : MadLoop
   acknowledged_v3.1_syntax : False
         auto_convert_model : True (user set)
         cluster_local_path : None
           cluster_nb_retry : 1
              cluster_queue : None (user set)
         cluster_retry_wait : 300
               cluster_size : 100
      cluster_status_update : (600, 30)
          cluster_temp_path : None
               cluster_type : condor
                    collier : ./HEPTools/lib
                contur_path : ./HEPTools/contur
               cpp_compiler : None
             crash_on_error : False
               delphes_path : ./Delphes
                      eMELA : None (user set)
                 eps_viewer : None
        exrootanalysis_path : ./ExRootAnalysis
              f2py_compiler : None
          f2py_compiler_py2 : None
          f2py_compiler_py3 : None
                    fastjet : None (user set)
           fortran_compiler : None
                      golem : None (user set)
                 hepmc_path : None (user set)
                  hwpp_path : None (user set)
                     lhapdf : lhapdf-config
                 lhapdf_py2 : None
                 lhapdf_py3 : None
          madanalysis5_path : None (user set)
           madanalysis_path : ./MadAnalysis
  mg5amc_py8_interface_path : None (user set)
                      ninja : ./HEPTools/lib
        output_dependencies : external
                   pineappl : pineappl
            pythia-pgs_path : ./pythia-pgs
               pythia8_path : None (user set)
                 rivet_path : ./HEPTools/rivet
                    samurai : None
               syscalc_path : ./SysCalc
                    td_path : ./td
                text_editor : None
                thepeg_path : None (user set)
                    timeout : 60
                web_browser : None
                  yoda_path : ./HEPTools/yoda

Revision history for this message
Gerald Gilbert-Thorple (gxgilthor) wrote :

In the meantime I have managed to get past this error, but only reaching a second one that has me perplexed:

Command "import model 2HDM" interrupted with error:
UFOError : name 'rhot' is not defined

However it is defined in parameters.py,

rhot = Parameter(name = 'rhot',
                 nature = 'internal',
                 type = 'real',
                 value = 'etat*rhob',
                 texname = '\\text{rhot}')

and the external parameters etat and rhob on which it depends have also received values prior to that in parameters.py,
rhob = Parameter(name = 'rhob',
                 nature = 'external',
                 type = 'real',
                 value = 0.05,
                 texname = '\\text{rhob}',
                 lhablock = 'NEWYUKAWA',
                 lhacode = [ 2 ])

etat = Parameter(name = 'etat',
                 nature = 'external',
                 type = 'real',
                 value = 1.6,
                 texname = '\\text{etat}',
                 lhablock = 'NEWYUKAWA',
                 lhacode = [ 3 ])

I attached the parameters.py file

Revision history for this message
Gerald Gilbert-Thorple (gxgilthor) wrote :

oh sorry, I forgot to include debug file for that last bug, it is attached now

Revision history for this message
Gerald Gilbert-Thorple (gxgilthor) wrote :

I read the debug file (sorry, should have done that first) and I see the problem: the value of rhot is invoked before it gets assigned. I don't know why it appears in this order in parameters.py, since in my feynrules params.fr, things are assigned in the right order. Perhaps subsequent restrictions that were loaded caused the order to be changed?

Revision history for this message
Gerald Gilbert-Thorple (gxgilthor) wrote :

oh never mind, my mistake, I meant to change the quantity that was invoking it to an internal variable.
sorry about all this, it's my first time to use MG. But the original bug might have some validity.

Revision history for this message
Olivier Mattelaer (olivier-mattelaer) wrote :

Hi,

You mean this error?
UFOError : invalid syntax (object_library.py, line 268)
Line 268 is: raise UFOError("UFO does not support yet more than one occurence of CTParameters in the couplings values.")

This is an "internal" check of the UFO failing.
So at that stage it does not even allowed MG5aMC to handle the model (since it fails to load with that error). So the first question is if generating that feature within the UFO model is a bug of Feynrules or a feature badly implemented. If it is the second, you should ask the FeynRules author to update that line/file to avoid the error.

In that case, it might well be the first time that a UFO model generated without such limitation... So one can expect weird behavior of any any code using such UFO model. But let's wait to see if one need to check that point or not.

Cheers,

Olivier

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.