UFOError : unsupported operand when importing model in MadDM

Asked by Lianyou SHAN

Dear Experts,

Within a maddm ( auto installed from MG5 v3.2) session I tried :

import model myModel

then I saw

UFOError : unsupported operand type(s) for /: 'Parameter' and 'float'
Please report this bug on https://bugs.launchpad.net/mg5amcnlo

I guess there was some mistaken when I prepared the .fr for FeynRule to produce my UFO folder.

I checked the file parameters.py and so on in comparison to those in SM and failed to find out an apparent difference. Unfortunately from the thrown error I can not guess more.

Is there some clue for me to dig more ?

Thanks alot in advance !

   Lianyou

Question information

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

You should look at the file MG5_debug where the line of the crash is reported and add some print statement around that line such that you will know which expression of your model is problematic.

Cheers,

Olivier

> On 5 Oct 2021, at 06:30, Lianyou SHAN <email address hidden> wrote:
>
> New question #698962 on MadGraph5_aMC@NLO:
> https://answers.launchpad.net/mg5amcnlo/+question/698962
>
> Dear Experts,
>
> Within a maddm ( auto installed from MG5 v3.2) session I tried :
>
> import model myModel
>
> then I saw
>
> UFOError : unsupported operand type(s) for /: 'Parameter' and 'float'
> Please report this bug on https://bugs.launchpad.net/mg5amcnlo
>
> I guess there was some mistaken when I prepared the .fr for FeynRule to produce my UFO folder.
>
> I checked the file parameters.py and so on in comparison to those in SM and failed to find out an apparent difference. Unfortunately from the thrown error I can not guess more.
>
> Is there some clue for me to dig more ?
>
> Thanks alot in advance !
>
> Lianyou
>
> --
> You received this question notification because you are an answer
> contact for MadGraph5_aMC@NLO.

Revision history for this message
Lianyou SHAN (lyshan) said :
#2

Dear Oliver,

Many thanks for your suggestion.

Now the crashing is located at

 __import__( myModel )

under

with misc.TMP_variable(sys, 'path', [os.sep.join(path_split[:-1]),os.sep.join(path_split)]):

in

models/__init__.py

Unfortunately I haven't uncovered this __import__() , ( seeming like a python system function ),
or there is something within MG5 to prepare myModel into a python module before importing ?

Thanks !

    Lianyou
The full _debug came like :

  File "/home/shanly/newPrime/MG5aMCv320/madgraph/interface/extended_cmd.py", line 1548, in onecmd
    return self.onecmd_orig(line, **opt)
  File "/home/shanly/newPrime/MG5aMCv320/madgraph/interface/extended_cmd.py", line 1497, in onecmd_orig
    return func(arg, **opt)
  File "/home/shanly/newPrime/MG5aMCv320/PLUGIN/maddm/maddm_interface.py", line 720, in do_import
    return super(MadDM_interface, self).do_import(line, *args, **opts)
  File "/home/shanly/newPrime/MG5aMCv320/madgraph/interface/master_interface.py", line 281, in do_import
    self.cmd.do_import(self, *args, **opts)
  File "/home/shanly/newPrime/MG5aMCv320/madgraph/interface/madgraph_interface.py", line 5567, in do_import
    complex_mass_scheme=self.options['complex_mass_scheme'])
  File "/home/shanly/newPrime/MG5aMCv320/models/import_ufo.py", line 250, in import_model
    model = import_full_model(model_path, decay, prefix)
  File "/home/shanly/newPrime/MG5aMCv320/models/import_ufo.py", line 397, in import_full_model
    ufo_model = ufomodels.load_model(model_path, decay)
  File "/home/shanly/newPrime/MG5aMCv320/models/__init__.py", line 80, in load_model
    raise UFOError(str(error))
UFOError: unsupported operand type(s) for /: 'Parameter' and 'float'

Revision history for this message
Best Olivier Mattelaer (olivier-mattelaer) said :
#3

Then the problem seems deeper.

You can go to the directory above your UFO model
then start a normal python shell and do
import XXXXXXX
where XXXXXXX is the directory name of your UFO mode

This should include more information

Cheers,

Olivier

> On 5 Oct 2021, at 12:11, Lianyou SHAN <email address hidden> wrote:
>
> Question #698962 on MadGraph5_aMC@NLO changed:
> https://answers.launchpad.net/mg5amcnlo/+question/698962
>
> Status: Answered => Open
>
> Lianyou SHAN is still having a problem:
> Dear Oliver,
>
> Many thanks for your suggestion.
>
> Now the crashing is located at
>
> __import__( myModel )
>
> under
>
> with misc.TMP_variable(sys, 'path',
> [os.sep.join(path_split[:-1]),os.sep.join(path_split)]):
>
> in
>
> models/__init__.py
>
> Unfortunately I haven't uncovered this __import__() , ( seeming like a python system function ),
> or there is something within MG5 to prepare myModel into a python module before importing ?
>
> Thanks !
>
> Lianyou
> The full _debug came like :
>
> File "/home/shanly/newPrime/MG5aMCv320/madgraph/interface/extended_cmd.py", line 1548, in onecmd
> return self.onecmd_orig(line, **opt)
> File "/home/shanly/newPrime/MG5aMCv320/madgraph/interface/extended_cmd.py", line 1497, in onecmd_orig
> return func(arg, **opt)
> File "/home/shanly/newPrime/MG5aMCv320/PLUGIN/maddm/maddm_interface.py", line 720, in do_import
> return super(MadDM_interface, self).do_import(line, *args, **opts)
> File "/home/shanly/newPrime/MG5aMCv320/madgraph/interface/master_interface.py", line 281, in do_import
> self.cmd.do_import(self, *args, **opts)
> File "/home/shanly/newPrime/MG5aMCv320/madgraph/interface/madgraph_interface.py", line 5567, in do_import
> complex_mass_scheme=self.options['complex_mass_scheme'])
> File "/home/shanly/newPrime/MG5aMCv320/models/import_ufo.py", line 250, in import_model
> model = import_full_model(model_path, decay, prefix)
> File "/home/shanly/newPrime/MG5aMCv320/models/import_ufo.py", line 397, in import_full_model
> ufo_model = ufomodels.load_model(model_path, decay)
> File "/home/shanly/newPrime/MG5aMCv320/models/__init__.py", line 80, in load_model
> raise UFOError(str(error))
> UFOError: unsupported operand type(s) for /: 'Parameter' and 'float'
>
> --
> You received this question notification because you are an answer
> contact for MadGraph5_aMC@NLO.

Revision history for this message
Lianyou SHAN (lyshan) said :
#4

Dear Olivier,

Many thanks, the direct using of python helped.

In my FeynFule script I used

M$Parameters = {

     WZp == {
        ...
        Value -> MZp/10. ,
   ...
     }
}

FR did not give extra quotation ( ' ' ) to this mixture of number and character and led to problems.

Thanks for helping to spot.

    Lianyou

Revision history for this message
Lianyou SHAN (lyshan) said :
#5

Thanks Olivier Mattelaer, that solved my question.