Пример #1
0
    def test_fks_helas_process_init(self):
        """tests the correct initialization of a FKSHelasProcess object.
        in particular checks:
        -- born ME
        -- list of FKSHelasRealProcesses
        -- color links
        -- fks_infos
        """
        #ug> ug
        fks1 = fks_base.FKSProcess(self.myproc1)
        #uu~> dd~
        fks3 = fks_base.FKSProcess(self.myproc3)

        pdg_list1 = []
        real_amp_list1 = diagram_generation.AmplitudeList()
        pdg_list3 = []
        real_amp_list3 = diagram_generation.AmplitudeList()
        fks1.generate_reals(pdg_list1, real_amp_list1)
        fks3.generate_reals(pdg_list3, real_amp_list3)

        me_list = []
        me_id_list = []
        me_list3 = []
        me_id_list3 = []
        res_me_list = []
        res_me_id_list = []

        helas_born_proc = fks_helas.FKSHelasProcess(fks1, me_list, me_id_list)
        helas_born_proc3 = fks_helas.FKSHelasProcess(fks3, me_list3,
                                                     me_id_list3)

        self.assertEqual(helas_born_proc.born_matrix_element,
                         helas_objects.HelasMatrixElement(fks1.born_amp))
        res_reals = []
        for real in fks1.real_amps:
            res_reals.append(
                fks_helas.FKSHelasRealProcess(real, res_me_list,
                                              res_me_id_list))
            # the process u g > u g g corresponds to 4 fks configs
            if real.pdgs == array.array('i', [2, 21, 2, 21, 21]):
                self.assertEqual(len(real.fks_infos), 4)
            else:
                # any other process has only 1 fks config
                self.assertEqual(len(real.fks_infos), 1)

        self.assertEqual(me_list, res_me_list)
        self.assertEqual(me_id_list, res_me_id_list)
        self.assertEqual(8, len(helas_born_proc.real_processes))
        self.assertNotEqual(helas_born_proc.born_matrix_element,
                            helas_born_proc3.born_matrix_element)
        for a, b in zip(helas_born_proc3.real_processes,
                        helas_born_proc.real_processes):
            self.assertNotEqual(a, b)
Пример #2
0
    def test_fks_helas_real_process_init(self):
        """tests the correct initialization of an FKSHelasRealProcess, from a 
        FKSRealProc. The process uu~>dd~ is used as born.
        For the real we use uu~>dd~(j) g(i).
        We test The correct initialization of:
        --i/j fks
        --permutation
        --matrix element
        """
        #uu~> dd~
        fks3 = fks_base.FKSProcess(self.myproc3)

        fksleglist = copy.copy(
            fks_common.to_fks_legs(self.myleglist3, self.mymodel))
        amplist = []
        amp_id_list = []
        me_list = []
        me_id_list = []

        fksleglist.append(
            fks_common.to_fks_leg(
                MG.Leg({
                    'id': 21,
                    'state': True,
                    'number': 5,
                    'from_group': True
                }), self.mymodel))
        fksleglist[0]['fks'] = 'n'
        fksleglist[1]['fks'] = 'n'
        fksleglist[2]['fks'] = 'n'
        fksleglist[3]['fks'] = 'j'
        fksleglist[4]['fks'] = 'i'

        real_proc = fks_base.FKSRealProcess(fks3.born_proc, fksleglist, 4, 0)
        real_proc.generate_real_amplitude()
        helas_real_proc = fks_helas.FKSHelasRealProcess(
            real_proc, me_list, me_id_list)
        self.assertEqual(helas_real_proc.fks_infos, [{
            'i': 5,
            'j': 4,
            'ij': 4,
            'ij_glu': 0,
            'need_color_links': True
        }])
        target_me = helas_objects.HelasMatrixElement(real_proc.amplitude)
        self.assertEqual(helas_real_proc.matrix_element, target_me)
        self.assertEqual(helas_real_proc.matrix_element.get('color_matrix'),
                         target_me.get('color_matrix'))