~maddevelopers/mg5amcnlo/3.3.0

« back to all changes in this revision

Viewing changes to madgraph/iolibs/export_python.py

  • Committer: olivier-mattelaer
  • Date: 2021-11-08 08:25:41 UTC
  • Revision ID: olivier-mattelaer-20211108082541-nivc1i4l164z6y5u
merge with 2.7.0_gpu version 368->371: fixing randomness in ordering

Show diffs side-by-side

added added

removed removed

Lines of Context:
235
235
            # the same coefficient (up to a sign), put it in front
236
236
            list_fracs = [abs(coefficient[0][1]) for coefficient in coeff_list]
237
237
            common_factor = False
238
 
            diff_fracs = list(set(list_fracs))
 
238
            diff_fracs = misc.make_unique(list_fracs)
239
239
            if len(diff_fracs) == 1 and abs(diff_fracs[0]) != 1:
240
240
                common_factor = True
241
241
                global_factor = diff_fracs[0]
364
364
                      matrix_element.get_all_wavefunctions()]
365
365
        parameters += [wf.get('width') for wf in \
366
366
                       matrix_element.get_all_wavefunctions()]
367
 
        parameters = list(set(parameters))
 
367
        parameters = misc.make_unique(parameters)
368
368
        if 'ZERO' in parameters:
369
369
            parameters.remove('ZERO')
370
370
 
371
371
        # Get all couplings used
372
372
 
373
373
        
374
 
        couplings = list(set([c.replace('-', '') for func \
 
374
        couplings = misc.make_unique([c.replace('-', '') for func \
375
375
                              in matrix_element.get_all_wavefunctions() + \
376
376
                              matrix_element.get_all_amplitudes() for c in func.get('coupling')
377
 
                              if func.get('mothers') ]))
 
377
                              if func.get('mothers') ])
378
378
        
379
379
        return "\n        ".join([\
380
380
                         "%(param)s = model.get(\'parameter_dict\')[\"%(param)s\"]"\