コード例 #1
0
    def __init__(self, fksproc=None, real_me_list =[], real_amp_list=[], 
            loop_optimized = False, **opts):#test written
        """ constructor, starts from a FKSProcess, 
        sets reals and color links. Real_me_list and real_amp_list are the lists of pre-genrated
        matrix elements in 1-1 correspondence with the amplitudes"""
        
        if fksproc != None:
            self.born_matrix_element = helas_objects.HelasMatrixElement(
                                    fksproc.born_amp, **opts)
            self.real_processes = []
            self.orders = fksproc.born_proc.get('orders')
            self.perturbation = fksproc.perturbation
            real_amps_new = []
            # combine for example u u~ > t t~ and d d~ > t t~
            for proc in fksproc.real_amps:
                fksreal_me = FKSHelasRealProcess(proc, real_me_list, real_amp_list, **opts)
                try:
                    other = self.real_processes[self.real_processes.index(fksreal_me)]
                    other.matrix_element.get('processes').extend(\
                            fksreal_me.matrix_element.get('processes') )
                except ValueError:
                    if fksreal_me.matrix_element.get('processes') and \
                            fksreal_me.matrix_element.get('diagrams'):
                        self.real_processes.append(fksreal_me)
                        real_amps_new.append(proc)
            fksproc.real_amps = real_amps_new
            if fksproc.virt_amp:
                self.virt_matrix_element = \
                  loop_helas_objects.LoopHelasMatrixElement(fksproc.virt_amp, 
                          optimized_output = loop_optimized)
            else: 
                self.virt_matrix_element = None
#            self.color_links_info = fksproc.find_color_links()
            self.color_links = []
コード例 #2
0
ファイル: IOTests.py プロジェクト: mfasDa/MadGraph5
    def run(self, IOTestManagerInstance=None):
        """ Run the test and returns the path where the files have been 
        produced and relative to which the paths in TestedFiles are specified. """
        self.clean_output()

        model = self.procdef.get('model')
        self.exporter = self.test_instance.get_exporter_withName(\
                                                            self.exporter_name)
        myloopamp = loop_diagram_generation.LoopAmplitude(self.procdef)
        isOptimized = isinstance(self.exporter, \
                           loop_exporters.LoopProcessOptimizedExporterFortranSA)
        hel_amp=loop_helas_objects.LoopHelasMatrixElement(\
                                        myloopamp,optimized_output=isOptimized)

        self.exporter.copy_template(model)
        self.exporter.generate_loop_subprocess(hel_amp,
                                               self.helasModel,
                                               unique_id=1)

        wanted_lorentz = hel_amp.get_used_lorentz()
        wanted_couplings = list(set(sum(hel_amp.get_used_couplings(), [])))
        self.exporter.convert_model(model, wanted_lorentz, wanted_couplings)

        proc_name = 'P' + hel_amp.get('processes')[0].shell_string()
        return pjoin(self.outputPath, 'SubProcesses', proc_name)
コード例 #3
0
    def testIO_Loop_sqso_uux_ddx(self):
        """ target: [loop_matrix(.*)\.f]
        """

        myleglist = base_objects.LegList()
        myleglist.append(base_objects.Leg({'id': 2, 'state': False}))
        myleglist.append(base_objects.Leg({'id': -2, 'state': False}))
        myleglist.append(base_objects.Leg({'id': 1, 'state': True}))
        myleglist.append(base_objects.Leg({'id': -1, 'state': True}))

        fortran_model=\
          helas_call_writers.FortranUFOHelasCallWriterOptimized(self.model,False)

        SO_tests = [({}, ['QCD',
                          'QED'], {}, {}, ['QCD',
                                           'QED'], 'QCDQEDpert_default'),
                    ({}, ['QCD'], {}, {}, ['QCD'], 'QCDpert_default'),
                    ({}, ['QED'], {}, {}, ['QED'], 'QEDpert_default'),
                    ({}, ['QCD', 'QED'], {
                        'QCD': 4
                    }, {
                        'QCD': '=='
                    }, ['QCD', 'QED'], 'QCDQEDpert_QCDsq_eq_4'),
                    ({}, ['QCD', 'QED'], {
                        'QED': 4
                    }, {
                        'QCD': '<='
                    }, ['QCD', 'QED'], 'QCDQEDpert_QEDsq_le_4'),
                    ({}, ['QCD', 'QED'], {
                        'QCD': 4
                    }, {
                        'QCD': '>'
                    }, ['QCD', 'QED'], 'QCDQEDpert_QCDsq_gt_4'),
                    ({
                        'QED': 2
                    }, ['QCD', 'QED'], {
                        'QCD': 0,
                        'QED': 2
                    }, {
                        'QCD': '>',
                        'QED': '>'
                    }, ['QCD',
                        'QED'], 'QCDQEDpert_QCDsq_gt_0_QEDAmpAndQEDsq_gt_2'),
                    ({
                        'QED': 2
                    }, ['QCD', 'QED'], {
                        'WEIGHTED': 10,
                        'QED': 2
                    }, {
                        'WEIGHTED': '<=',
                        'QED': '>'
                    }, ['WEIGHTED', 'QCD',
                        'QED'], 'QCDQEDpert_WGTsq_le_10_QEDAmpAndQEDsq_gt_2')]

        for orders, pert_orders, sq_orders , sq_orders_type, split_orders, name \
                                                                    in SO_tests:
            myproc = base_objects.Process({
                'legs': myleglist,
                'model': self.model,
                'orders': orders,
                'squared_orders': sq_orders,
                'perturbation_couplings': pert_orders,
                'sqorders_types': sq_orders_type,
                'split_orders': split_orders
            })

            myloopamp = loop_diagram_generation.LoopAmplitude(myproc)
            matrix_element=loop_helas_objects.LoopHelasMatrixElement(\
                                                myloopamp,optimized_output=True)
            writer = writers.FortranWriter(\
                                     pjoin(self.IOpath,'loop_matrix_%s.f'%name))

            # It is enough here to generate and check the filer loop_matrix.f
            # only here. For that we must initialize the general replacement
            # dictionary first (The four functions below are normally directly
            # called from the write_matrix_element function in the exporter
            # [but we don't call it here because we only want the file
            # loop_matrix.f]).
            matrix_element.rep_dict = self.exporter.\
                                   generate_general_replace_dict(matrix_element)

            # and for the same reason also force the computation of the analytical
            # information in the Helas loop diagrams.
            matrix_element.compute_all_analytic_information(
                self.exporter.get_aloha_model(self.model))

            # Finally the entries specific to the optimized output
            self.exporter.set_optimized_output_specific_replace_dict_entries(\
                                                                 matrix_element)

            # We can then finally write out 'loop_matrix.f'
            self.exporter.write_loopmatrix(writer,
                                           matrix_element,
                                           fortran_model,
                                           noSplit=True,
                                           write_auxiliary_files=False)