~madteam/mg5amcnlo/series2.0

« back to all changes in this revision

Viewing changes to tests/unit_tests/iolibs/test_export_v4.py

  • Committer: olivier-mattelaer
  • Date: 2020-08-21 09:16:56 UTC
  • mfrom: (284.2.24 python3)
  • Revision ID: olivier-mattelaer-20200821091656-iizux2mj94tkssuo
pass to 2.8.0 (and move to python3 branch)

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
 
16
16
"""Unit test library for the export v4 format routines"""
17
17
 
18
 
import StringIO
 
18
from __future__ import absolute_import
 
19
import six
 
20
StringIO = six
19
21
import copy
20
22
import fractions
21
23
import os 
22
24
import sys
 
25
from six.moves import range
23
26
 
24
27
root_path = os.path.split(os.path.dirname(os.path.realpath( __file__ )))[0]
25
28
sys.path.append(os.path.join(root_path, os.path.pardir, os.path.pardir))
464
467
        symmetry, perms, ident_perms = \
465
468
                  diagram_symmetry.find_symmetry(subprocess_group)
466
469
 
467
 
        self.assertEqual(symmetry, [1,1,1,1,1,1])
 
470
        self.assertEqual(symmetry, [1,1,1,1,1])
468
471
        self.assertEqual(perms,
469
 
                         [[0,1,2,3],[0,1,2,3],[0,1,2,3],[0,1,2,3],[0,1,2,3],[0,1,2,3]])
 
472
                         [[0,1,2,3],[0,1,2,3],[0,1,2,3],[0,1,2,3],[0,1,2,3]])
470
473
        self.assertEqual(ident_perms,
471
474
                         [[0,1,2,3]])
472
475
 
2007
2010
        self.assertTrue('F2PY=$(DEFAULT_F2PY_COMPILER)' in LO_text)
2008
2011
        self.assertTrue('FC=$(DEFAULT_F_COMPILER)' in LO_text)
2009
2012
        if os.path.exists(pjoin(MG5DIR, 'bin', 'create_release.py')):
2010
 
            self.assertTrue('DEFAULT_F2PY_COMPILER=f2py' in LO_text)
 
2013
#            self.assertTrue('DEFAULT_F2PY_COMPILER=f2py' in LO_text)
2011
2014
            self.assertTrue('DEFAULT_F_COMPILER=gfortran' in LO_text)            
2012
2015
#            NLO_text = open(pjoin(MG5DIR, 'Template','NLO','Source','make_opts.inc')).read()
2013
2016
#            self.assertTrue('DEFAULT_F2PY_COMPILER=f2py' in NLO_text)
9783
9786
      IMPLICIT NONE
9784
9787
      COMPLEX*16 CI
9785
9788
      PARAMETER (CI=(0D0,1D0))
 
9789
      COMPLEX*16 COUP
 
9790
      COMPLEX*16 F1(6)
9786
9791
      COMPLEX*16 F2(*)
 
9792
      REAL*8 M1
 
9793
      REAL*8 P1(0:3)
9787
9794
      COMPLEX*16 V3(*)
9788
 
      REAL*8 P1(0:3)
9789
 
      REAL*8 M1
9790
9795
      REAL*8 W1
9791
 
      COMPLEX*16 F1(6)
9792
9796
      COMPLEX*16 DENOM
9793
 
      COMPLEX*16 COUP
9794
9797
      ENTRY FFV1_2(F2, V3, COUP, M1, W1,F1)
9795
9798
 
9796
9799
      F1(1) = +F2(1)+V3(1)
9839
9842
        
9840
9843
        # couplings
9841
9844
        self.assertEqual(len(mg4_model.coups_dep), 3)
9842
 
        sol = ['GC_1', 'GC_2', 'GC_3', 'GC_5', 'GC_6', 'GC_7', 'GC_8', 'GC_21', 'GC_30', 'GC_31', 'GC_32', 'GC_33', 'GC_34', 'GC_35', 'GC_36', 'GC_37', 'GC_39', 'GC_51','GC_52', 'GC_53', 'GC_55', 'GC_56', 'GC_57', 'GC_58', 'GC_59', 'GC_60', 'GC_61', 'GC_62', 'GC_63', 'GC_64', 'GC_65', 'GC_66', 'GC_68', 'GC_69', 'GC_70', 'GC_71', 'GC_72', 'GC_75', 'GC_76', 'GC_77', 'GC_80', 'GC_81', 'GC_82', 'GC_83', 'GC_94', 'GC_95', 'GC_97', 'GC_98', 'GC_99', 'GC_100']
9843
 
        
 
9845
        sol = ['GC_1', 'GC_2', 'GC_3', 'GC_5', 'GC_6', 'GC_7', 'GC_8', 'GC_15', 'GC_21', 'GC_31', 'GC_32', 'GC_33', 'GC_34', 'GC_35', 'GC_36', 'GC_37', 'GC_38', 'GC_50', 'GC_52', 'GC_53', 'GC_54', 'GC_55', 'GC_57', 'GC_58', 'GC_59', 'GC_60', 'GC_61', 'GC_62', 'GC_63', 'GC_64', 'GC_65', 'GC_66', 'GC_68', 'GC_69', 'GC_70', 'GC_71', 'GC_72', 'GC_74', 'GC_76', 'GC_77', 'GC_80', 'GC_81', 'GC_82', 'GC_83', 'GC_94', 'GC_95', 'GC_96', 'GC_98', 'GC_99', 'GC_100']
 
9846
 
9844
9847
        self.assertEqual(sol, [ p.name for p in mg4_model.coups_indep])
9845
9848
 
9846
9849
        
9878
9881
 
9879
9882
 
9880
9883
        mg4_model.pass_parameter_to_case_insensitive()
9881
 
 
9882
 
        self.assertEqual(CWc.name,'cw__2')
 
9884
        self.assertEqual(CWc.name,'cw')
9883
9885
        self.assertEqual(CWc.expr,'mz__2**2 * Mz2')
9884
 
        self.assertEqual(Cw.name,'cw__3')
9885
 
        self.assertEqual(Cw.expr,'mz__2**2 * Mz2 * cw__2')
9886
 
        
 
9886
        self.assertEqual(Cw.name,'cw__2')
 
9887
        self.assertEqual(Cw.expr,'mz__2**2 * Mz2 * cw__3')
 
9888
        self.assertEqual(CW.name,'cw__3')
 
9889
 
9887
9890
        self.assertEqual(Mzc.name,'mz__2')
9888
9891
        
9889
9892