Syntax error at ')' (LexToken(),')',1,56)).

Asked by Zhaowei Song

I was running g g > h h with a SILH NLO model I generate with feynrules when I encountered this bug.
Error detected in "launch"
write debug file MG5_debug
If you need help with this issue please contact us on https://answers.launchpad.net/mg5amcnlo
str : Syntax error at ')' (LexToken(),')',1,56)).
I wonder how I can locate the file with bug and fix it.

Question information

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

This means that the error is within the UFO file.
the MG5_debug should contain information about the line within the code that detect the ")" missing in the UFO file.
If you go to that file and print the expression that he is currently parsing, you should be able to identify the problematic part of the UFO model and then go back to FeynRules to regenerate it (or ...)

Cheers,

Olivier

Revision history for this message
Zhaowei Song (zhaowei12345678) said :
#2

Thank you for your attention.
this is content of debug file.
Traceback (most recent call last):
  File "/home/parallels/Downloads/MG5_aMC_v3.5.0/MG5_aMC_v3_5_0/madgraph/interface/extended_cmd.py", line 1543, in onecmd
    return self.onecmd_orig(line, **opt)
  File "/home/parallels/Downloads/MG5_aMC_v3.5.0/MG5_aMC_v3_5_0/madgraph/interface/extended_cmd.py", line 1492, in onecmd_orig
    return func(arg, **opt)
  File "/home/parallels/Downloads/MG5_aMC_v3.5.0/MG5_aMC_v3_5_0/madgraph/interface/master_interface.py", line 514, in do_launch
    return self.cmd.do_launch(self, line, *argss, **opts)
  File "/home/parallels/Downloads/MG5_aMC_v3.5.0/MG5_aMC_v3_5_0/madgraph/interface/madgraph_interface.py", line 7376, in do_launch
    self.check_launch(args, options)
  File "/home/parallels/Downloads/MG5_aMC_v3.5.0/MG5_aMC_v3_5_0/madgraph/interface/master_interface.py", line 376, in check_launch
    return self.cmd.check_launch(self, *args, **opts)
  File "/home/parallels/Downloads/MG5_aMC_v3.5.0/MG5_aMC_v3_5_0/madgraph/interface/madgraph_interface.py", line 1321, in check_launch
    self.do_output('')
  File "/home/parallels/Downloads/MG5_aMC_v3.5.0/MG5_aMC_v3_5_0/madgraph/interface/master_interface.py", line 299, in do_output
    self.cmd.do_output(self, line, *args, **opts)
  File "/home/parallels/Downloads/MG5_aMC_v3.5.0/MG5_aMC_v3_5_0/madgraph/interface/madgraph_interface.py", line 8277, in do_output
    self.finalize(nojpeg, flaglist=flaglist)
  File "/home/parallels/Downloads/MG5_aMC_v3.5.0/MG5_aMC_v3_5_0/madgraph/interface/madgraph_interface.py", line 8575, in finalize
    self._curr_exporter.convert_model(self._curr_model,
  File "/home/parallels/Downloads/MG5_aMC_v3.5.0/MG5_aMC_v3_5_0/madgraph/loop/loop_exporters.py", line 570, in convert_model
    super(LoopProcessExporterFortranSA, self).convert_model(model,
  File "/home/parallels/Downloads/MG5_aMC_v3.5.0/MG5_aMC_v3_5_0/madgraph/iolibs/export_v4.py", line 4105, in convert_model
    super(ProcessExporterFortranME,self).convert_model(model,
  File "/home/parallels/Downloads/MG5_aMC_v3.5.0/MG5_aMC_v3_5_0/madgraph/iolibs/export_v4.py", line 946, in convert_model
    model_builder.build(wanted_couplings)
  File "/home/parallels/Downloads/MG5_aMC_v3.5.0/MG5_aMC_v3_5_0/madgraph/iolibs/export_v4.py", line 6649, in build
    self.write_all()
  File "/home/parallels/Downloads/MG5_aMC_v3.5.0/MG5_aMC_v3_5_0/madgraph/iolibs/export_v4.py", line 6692, in write_all
    self.create_couplings()
  File "/home/parallels/Downloads/MG5_aMC_v3.5.0/MG5_aMC_v3_5_0/madgraph/iolibs/export_v4.py", line 7243, in create_couplings
    self.create_couplings_part(i + 1, data, dp=True, mp=self.opt['mp'])
  File "/home/parallels/Downloads/MG5_aMC_v3.5.0/MG5_aMC_v3_5_0/madgraph/iolibs/export_v4.py", line 7845, in create_couplings_part
    self.p_to_f.parse(coupling.expr)))
  File "/home/parallels/Downloads/MG5_aMC_v3.5.0/MG5_aMC_v3_5_0/madgraph/iolibs/ufo_expression_parsers.py", line 67, in parse
    self.y.parse(buf)
  File "/home/parallels/Downloads/MG5_aMC_v3.5.0/MG5_aMC_v3_5_0/vendor/ply/yacc.py", line 278, in parse
    return self.parseopt_notrack(input,lexer,debug,tracking,tokenfunc)
  File "/home/parallels/Downloads/MG5_aMC_v3.5.0/MG5_aMC_v3_5_0/vendor/ply/yacc.py", line 1060, in parseopt_notrack
    tok = self.errorfunc(errtoken)
  File "/home/parallels/Downloads/MG5_aMC_v3.5.0/MG5_aMC_v3_5_0/madgraph/iolibs/ufo_expression_parsers.py", line 295, in p_error
    raise ModelError("Syntax error at '%s' (%s)." %(p.value,p))
madgraph.iolibs.ufo_expression_parsers.ModelError: Syntax error at ')' (LexToken(),')',1,56)).
I can't locate the file with bug, can you help me with it?

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

So around
"/home/parallels/Downloads/MG5_aMC_v3.5.0/MG5_aMC_v3_5_0/madgraph/iolibs/export_v4.py", line 7845, in create_couplings_part
you can print the problematic line by adding
print(coupling.expr) before the above line.

Cheers,

Olivier

Revision history for this message
Zhaowei Song (zhaowei12345678) said :
#4

I did as you said and the result is:-((mdl_complexi*mdl_yc)/mdl_sqrt__2).
But I couldn't find this line in my ufo model file
what is wrong

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

Are you sure that you did print the correct line?

If I test the parsing on that input, it works without any issue

> expr = '-((mdl_complexi*mdl_yc)/mdl_sqrt__2)'
> converted = ufo_to_fortran.parse(expr)
> self.assertEqual(converted,
> '-((mdl_complexi*mdl_yc)/mdl_sqrt__2)')

Actually the expression
> -((mdl_complexi*mdl_yc)/mdl_sqrt__2)
seems to have been converted already (but i can be wrong since they are
many successive operation applied on such expression.

Cheers,

Olivier

> On 30 Jul 2023, at 07:05, Zhaowei Song <email address hidden> wrote:
>
> :-((mdl_complexi*mdl_yc)/mdl_sqrt__2)

Can you help with this problem?

Provide an answer of your own, or ask Zhaowei Song for more information if necessary.

To post a message you must log in.