KeyError : '(0,)'

Asked by Ilirjan Margjeka

How can I fix this error?

Command "output HH" interrupted with error:
KeyError : (0,)

The debug file is:

#************************************************************
#* MadGraph5_aMC@NLO *
#* *
#* * * *
#* * * * * *
#* * * * * 5 * * * * *
#* * * * * *
#* * * *
#* *
#* *
#* VERSION 2.6.3.2 2018-06-22 *
#* *
#* 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 default_unset_couplings 99
set group_subprocesses Auto
set ignore_six_quark_processes False
set loop_optimized_output True
set loop_color_flows False
set gauge unitary
set complex_mass_scheme False
set max_npoint_for_channel 0
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~
import model /lustrehome/imargjek/CMSSW_8_0_26_patch1/src/MG5_aMC_v2_6_3_2/models/BSM_gg_hh
generate p p > h h
output HH
Traceback (most recent call last):
  File "/lustrehome/imargjek/CMSSW_8_0_26_patch1/src/MG5_aMC_v2_6_3_2/madgraph/interface/extended_cmd.py", line 1501, in onecmd
    return self.onecmd_orig(line, **opt)
  File "/lustrehome/imargjek/CMSSW_8_0_26_patch1/src/MG5_aMC_v2_6_3_2/madgraph/interface/extended_cmd.py", line 1450, in onecmd_orig
    return func(arg, **opt)
  File "/lustrehome/imargjek/CMSSW_8_0_26_patch1/src/MG5_aMC_v2_6_3_2/madgraph/interface/master_interface.py", line 292, in do_output
    self.cmd.do_output(self, line, *args, **opts)
  File "/lustrehome/imargjek/CMSSW_8_0_26_patch1/src/MG5_aMC_v2_6_3_2/madgraph/interface/madgraph_interface.py", line 7632, in do_output
    self.finalize(nojpeg, flaglist=flaglist)
  File "/lustrehome/imargjek/CMSSW_8_0_26_patch1/src/MG5_aMC_v2_6_3_2/madgraph/interface/madgraph_interface.py", line 7920, in finalize
    wanted_couplings)
  File "/lustrehome/imargjek/CMSSW_8_0_26_patch1/src/MG5_aMC_v2_6_3_2/madgraph/iolibs/export_v4.py", line 3509, in convert_model
    wanted_lorentz, wanted_couplings)
  File "/lustrehome/imargjek/CMSSW_8_0_26_patch1/src/MG5_aMC_v2_6_3_2/madgraph/iolibs/export_v4.py", line 893, in convert_model
    aloha_model.write(write_dir, 'Fortran')
  File "/lustrehome/imargjek/CMSSW_8_0_26_patch1/src/MG5_aMC_v2_6_3_2/aloha/create_aloha.py", line 1019, in write
    abstract_routine.write(output_dir, language)
  File "/lustrehome/imargjek/CMSSW_8_0_26_patch1/src/MG5_aMC_v2_6_3_2/aloha/create_aloha.py", line 90, in write
    text = writer.write(mode=mode, **opt)
  File "/lustrehome/imargjek/CMSSW_8_0_26_patch1/src/MG5_aMC_v2_6_3_2/aloha/aloha_writers.py", line 241, in write
    core_text = self.define_expression()
  File "/lustrehome/imargjek/CMSSW_8_0_26_patch1/src/MG5_aMC_v2_6_3_2/aloha/aloha_writers.py", line 765, in define_expression
    formatted = self.write_obj(numerator.get_rep([0]))
  File "/lustrehome/imargjek/CMSSW_8_0_26_patch1/src/MG5_aMC_v2_6_3_2/aloha/aloha_lib.py", line 1110, in get_rep
    return self[tuple(indices)]
KeyError: (0,)
                          MadGraph5_aMC@NLO Options
                          ----------------
        complex_mass_scheme : False
    default_unset_couplings : 99
                      gauge : unitary
         group_subprocesses : Auto
  ignore_six_quark_processes : False
           loop_color_flows : False
      loop_optimized_output : True
  low_mem_multicore_nlo_generation : False
     max_npoint_for_channel : 0
               stdout_level : 20 (user set)

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

                      Configuration Options
                      ---------------------
                        OLP : MadLoop
                    amcfast : amcfast-config
                   applgrid : applgrid-config
                auto_update : 7
         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
               cpp_compiler : None
             crash_on_error : False
               delphes_path : ./Delphes
                 eps_viewer : None
        exrootanalysis_path : ./ExRootAnalysis
              f2py_compiler : 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
          madanalysis5_path : None (user set)
           madanalysis_path : ./MadAnalysis
  mg5amc_py8_interface_path : None (user set)
                      ninja : ./HEPTools/lib
        output_dependencies : external
                      pjfry : None (user set)
            pythia-pgs_path : ./pythia-pgs
               pythia8_path : None (user set)
                    samurai : None
               syscalc_path : ./SysCalc
                    td_path : ./td
                text_editor : None
                thepeg_path : None (user set)
                    timeout : 60
                web_browser : None

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

Hi,

Ok such non standard model (they do not follow the UFO convention) are not compatible with the latest optimization of the UFO model. This indicates potential sensitivity of your model to numerical inaccuracy issue. I would suggest to be careful on that point.

Here is the patch to fix the issue:

=== modified file 'models/import_ufo.py'
--- models/import_ufo.py 2018-06-15 13:28:53 +0000
+++ models/import_ufo.py 2018-07-11 14:06:33 +0000
@@ -646,14 +646,15 @@
                 continue
             names = [interaction['lorentz'][i] for i in to_lor[key]]
             names.sort()
-
+ if self.lorentz_info[names[0]].get('structure') == 'external':
+ continue
             # get name of the new lorentz
             if tuple(names) in self.lorentz_combine:
                 # already created new loretnz
                 new_name = self.lorentz_combine[tuple(names)]
             else:
                 new_name = self.add_merge_lorentz(names)
-
+
             # remove the old couplings
             color, coup = key
             to_remove = [(color, lor) for lor in to_lor[key]]
@@ -1371,6 +1372,7 @@
     def add_lorentz(self, name, spins , expr):
         """ Add a Lorentz expression which is not present in the UFO """

+ logger.debug('MG5 converter defines %s to %s', name, expr)
         assert name not in [l.name for l in self.model['lorentz']]
         with misc.TMP_variable(self.ufomodel.object_library, 'all_lorentz',
                                self.model['lorentz']):

Cheers and thanks,

Olivier

Revision history for this message
Ilirjan Margjeka (ilir92) said :
#2

I still get the same error, even though I did the changes you told me :

Command "output shohim" interrupted with error:
KeyError : (0,)
Please report this bug on https://bugs.launchpad.net/mg5amcnlo
More information is found in 'MG5_debug'.
Please attach this file to your report.

#* MadGraph5_aMC@NLO *
#* *
#* * * *
#* * * * * *
#* * * * * 5 * * * * *
#* * * * * *
#* * * *
#* *
#* *
#* VERSION 2.6.3.2 2018-06-22 *
#* *
#* 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 default_unset_couplings 99
set group_subprocesses Auto
set ignore_six_quark_processes False
set loop_optimized_output True
set loop_color_flows False
set gauge unitary
set complex_mass_scheme False
set max_npoint_for_channel 0
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~
import model /lustrehome/imargjek/CMSSW_8_0_26_patch1/src/MG5_aMC_v2_6_3_2/models/BSM_gg_hh
generate p p > h h
output HH_fk
Traceback (most recent call last):
  File "/lustrehome/imargjek/CMSSW_8_0_26_patch1/src/MG5_aMC_v2_6_3_2/madgraph/interface/extended_cmd.py", line 1501, in onecmd
    return self.onecmd_orig(line, **opt)
  File "/lustrehome/imargjek/CMSSW_8_0_26_patch1/src/MG5_aMC_v2_6_3_2/madgraph/interface/extended_cmd.py", line 1450, in onecmd_orig
    return func(arg, **opt)
  File "/lustrehome/imargjek/CMSSW_8_0_26_patch1/src/MG5_aMC_v2_6_3_2/madgraph/interface/master_interface.py", line 292, in do_output
    self.cmd.do_output(self, line, *args, **opts)
  File "/lustrehome/imargjek/CMSSW_8_0_26_patch1/src/MG5_aMC_v2_6_3_2/madgraph/interface/madgraph_interface.py", line 7632, in do_output
    self.finalize(nojpeg, flaglist=flaglist)
  File "/lustrehome/imargjek/CMSSW_8_0_26_patch1/src/MG5_aMC_v2_6_3_2/madgraph/interface/madgraph_interface.py", line 7920, in finalize
    wanted_couplings)
  File "/lustrehome/imargjek/CMSSW_8_0_26_patch1/src/MG5_aMC_v2_6_3_2/madgraph/iolibs/export_v4.py", line 3509, in convert_model
    wanted_lorentz, wanted_couplings)
  File "/lustrehome/imargjek/CMSSW_8_0_26_patch1/src/MG5_aMC_v2_6_3_2/madgraph/iolibs/export_v4.py", line 893, in convert_model
    aloha_model.write(write_dir, 'Fortran')
  File "/lustrehome/imargjek/CMSSW_8_0_26_patch1/src/MG5_aMC_v2_6_3_2/aloha/create_aloha.py", line 1019, in write
    abstract_routine.write(output_dir, language)
  File "/lustrehome/imargjek/CMSSW_8_0_26_patch1/src/MG5_aMC_v2_6_3_2/aloha/create_aloha.py", line 90, in write
    text = writer.write(mode=mode, **opt)
  File "/lustrehome/imargjek/CMSSW_8_0_26_patch1/src/MG5_aMC_v2_6_3_2/aloha/aloha_writers.py", line 241, in write
    core_text = self.define_expression()
  File "/lustrehome/imargjek/CMSSW_8_0_26_patch1/src/MG5_aMC_v2_6_3_2/aloha/aloha_writers.py", line 765, in define_expression
    formatted = self.write_obj(numerator.get_rep([0]))
  File "/lustrehome/imargjek/CMSSW_8_0_26_patch1/src/MG5_aMC_v2_6_3_2/aloha/aloha_lib.py", line 1110, in get_rep
    return self[tuple(indices)]
KeyError: (0,)
                          MadGraph5_aMC@NLO Options
                          ----------------
        complex_mass_scheme : False
    default_unset_couplings : 99
                      gauge : unitary
         group_subprocesses : Auto
  ignore_six_quark_processes : False
           loop_color_flows : False
      loop_optimized_output : True
  low_mem_multicore_nlo_generation : False
     max_npoint_for_channel : 0
               stdout_level : 20 (user set)

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

                      Configuration Options
                      ---------------------
                        OLP : MadLoop
                    amcfast : amcfast-config
                   applgrid : applgrid-config
                auto_update : 7
         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
               cpp_compiler : None
             crash_on_error : False
               delphes_path : ./Delphes
                 eps_viewer : None
        exrootanalysis_path : /lustrehome/imargjek/CMSSW_8_0_26_patch1/src/MG5_aMC_v2_6_3_2/ExRootAnalysis (user set)
              f2py_compiler : 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
          madanalysis5_path : None (user set)
           madanalysis_path : ./MadAnalysis
  mg5amc_py8_interface_path : None (user set)
                      ninja : ./HEPTools/lib
        output_dependencies : external
                      pjfry : None (user set)
            pythia-pgs_path : ./pythia-pgs
               pythia8_path : None (user set)
                    samurai : None
               syscalc_path : ./SysCalc
                    td_path : ./td
                text_editor : None
                thepeg_path : None (user set)
                    timeout : 60
                web_browser : None

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

Please remove all .pkl files in your model directory

Cheers,

Olivier

> On 11 Jul 2018, at 17:08, Ilirjan Margjeka <email address hidden> wrote:
>
> Question #670817 on MadGraph5_aMC@NLO changed:
> https://answers.launchpad.net/mg5amcnlo/+question/670817
>
> Ilirjan Margjeka posted a new comment:
> I still get the same error, even though I did the changes you told me :
>
> Command "output shohim" interrupted with error:
> KeyError : (0,)
> Please report this bug on https://bugs.launchpad.net/mg5amcnlo
> More information is found in 'MG5_debug'.
> Please attach this file to your report.
>
>
> #* MadGraph5_aMC@NLO *
> #* *
> #* * * *
> #* * * * * *
> #* * * * * 5 * * * * *
> #* * * * * *
> #* * * *
> #* *
> #* *
> #* VERSION 2.6.3.2 2018-06-22 *
> #* *
> #* 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 default_unset_couplings 99
> set group_subprocesses Auto
> set ignore_six_quark_processes False
> set loop_optimized_output True
> set loop_color_flows False
> set gauge unitary
> set complex_mass_scheme False
> set max_npoint_for_channel 0
> 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~
> import model /lustrehome/imargjek/CMSSW_8_0_26_patch1/src/MG5_aMC_v2_6_3_2/models/BSM_gg_hh
> generate p p > h h
> output HH_fk
> Traceback (most recent call last):
> File "/lustrehome/imargjek/CMSSW_8_0_26_patch1/src/MG5_aMC_v2_6_3_2/madgraph/interface/extended_cmd.py", line 1501, in onecmd
> return self.onecmd_orig(line, **opt)
> File "/lustrehome/imargjek/CMSSW_8_0_26_patch1/src/MG5_aMC_v2_6_3_2/madgraph/interface/extended_cmd.py", line 1450, in onecmd_orig
> return func(arg, **opt)
> File "/lustrehome/imargjek/CMSSW_8_0_26_patch1/src/MG5_aMC_v2_6_3_2/madgraph/interface/master_interface.py", line 292, in do_output
> self.cmd.do_output(self, line, *args, **opts)
> File "/lustrehome/imargjek/CMSSW_8_0_26_patch1/src/MG5_aMC_v2_6_3_2/madgraph/interface/madgraph_interface.py", line 7632, in do_output
> self.finalize(nojpeg, flaglist=flaglist)
> File "/lustrehome/imargjek/CMSSW_8_0_26_patch1/src/MG5_aMC_v2_6_3_2/madgraph/interface/madgraph_interface.py", line 7920, in finalize
> wanted_couplings)
> File "/lustrehome/imargjek/CMSSW_8_0_26_patch1/src/MG5_aMC_v2_6_3_2/madgraph/iolibs/export_v4.py", line 3509, in convert_model
> wanted_lorentz, wanted_couplings)
> File "/lustrehome/imargjek/CMSSW_8_0_26_patch1/src/MG5_aMC_v2_6_3_2/madgraph/iolibs/export_v4.py", line 893, in convert_model
> aloha_model.write(write_dir, 'Fortran')
> File "/lustrehome/imargjek/CMSSW_8_0_26_patch1/src/MG5_aMC_v2_6_3_2/aloha/create_aloha.py", line 1019, in write
> abstract_routine.write(output_dir, language)
> File "/lustrehome/imargjek/CMSSW_8_0_26_patch1/src/MG5_aMC_v2_6_3_2/aloha/create_aloha.py", line 90, in write
> text = writer.write(mode=mode, **opt)
> File "/lustrehome/imargjek/CMSSW_8_0_26_patch1/src/MG5_aMC_v2_6_3_2/aloha/aloha_writers.py", line 241, in write
> core_text = self.define_expression()
> File "/lustrehome/imargjek/CMSSW_8_0_26_patch1/src/MG5_aMC_v2_6_3_2/aloha/aloha_writers.py", line 765, in define_expression
> formatted = self.write_obj(numerator.get_rep([0]))
> File "/lustrehome/imargjek/CMSSW_8_0_26_patch1/src/MG5_aMC_v2_6_3_2/aloha/aloha_lib.py", line 1110, in get_rep
> return self[tuple(indices)]
> KeyError: (0,)
> MadGraph5_aMC@NLO Options
> ----------------
> complex_mass_scheme : False
> default_unset_couplings : 99
> gauge : unitary
> group_subprocesses : Auto
> ignore_six_quark_processes : False
> loop_color_flows : False
> loop_optimized_output : True
> low_mem_multicore_nlo_generation : False
> max_npoint_for_channel : 0
> stdout_level : 20 (user set)
>
> MadEvent Options
> ----------------
> automatic_html_opening : True
> nb_core : None
> notification_center : True
> run_mode : 2
>
> Configuration Options
> ---------------------
> OLP : MadLoop
> amcfast : amcfast-config
> applgrid : applgrid-config
> auto_update : 7
> 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
> cpp_compiler : None
> crash_on_error : False
> delphes_path : ./Delphes
> eps_viewer : None
> exrootanalysis_path : /lustrehome/imargjek/CMSSW_8_0_26_patch1/src/MG5_aMC_v2_6_3_2/ExRootAnalysis (user set)
> f2py_compiler : 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
> madanalysis5_path : None (user set)
> madanalysis_path : ./MadAnalysis
> mg5amc_py8_interface_path : None (user set)
> ninja : ./HEPTools/lib
> output_dependencies : external
> pjfry : None (user set)
> pythia-pgs_path : ./pythia-pgs
> pythia8_path : None (user set)
> samurai : None
> syscalc_path : ./SysCalc
> td_path : ./td
> text_editor : None
> thepeg_path : None (user set)
> timeout : 60
> web_browser : None
>
> --
> You received this question notification because you are an answer
> contact for MadGraph5_aMC@NLO.

Revision history for this message
Ilirjan Margjeka (ilir92) said :
#4

I just did it, but this causes a total crash of all of it. in other works it doesnt make it work at all by removing all .pkl files.

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

It works nicely for me ...
Can you be more specific about what the error you face now?

Cheers,

Olivier

Can you help with this problem?

Provide an answer of your own, or ask Ilirjan Margjeka for more information if necessary.

To post a message you must log in.