def setUp(self): self.base_model_scalar = import_ufo.import_model('sextet_diquarks') self.full_model_scalar = \ model_reader.ModelReader(self.base_model_scalar) self.full_model_scalar.set_parameters_and_couplings() self.full_model_scalar.get('parameter_dict')['mdl_MSIX'] = 1.e5 self.base_model_4ferm = import_ufo.import_model('uutt_sch_4fermion') self.full_model_4ferm = \ model_reader.ModelReader(self.base_model_4ferm) self.full_model_4ferm.set_parameters_and_couplings()
def setUp(self): m_path = import_ufo.find_ufo_path('triplet_diquarks') self.base_model = import_ufo.import_model(m_path) self.full_model = model_reader.ModelReader(self.base_model) self.full_model.set_parameters_and_couplings() # Set top quark mass to 0 to compare with literature expression self.full_model.get('parameter_dict')['mdl_MT'] = 0. self.full_model.get('parameter_dict')['mdl_WT'] = 0.
def __init__(self, model, filepath=None): """ model is a valid MG5 model, filepath is the path were to write the param_card.dat """ # Compute the value of all dependant parameter if isinstance(model, model_reader.ModelReader): self.model = model else: self.model = model_reader.ModelReader(model) self.model.set_parameters_and_couplings() # Organize the data self.external = self.model['parameters'][('external', )] self.param_dict = self.create_param_dict() self.define_not_dep_param() if filepath: self.define_output_file(filepath) self.write_card()
def test_run_python_matrix_element(self): """Test a complete running of a Python matrix element without writing any files""" # Import the SM sm_path = import_ufo.find_ufo_path('sm') model = import_ufo.import_model(sm_path) myleglist = base_objects.LegList() myleglist.append( base_objects.Leg({ 'id': -11, 'state': False, 'number': 1 })) myleglist.append( base_objects.Leg({ 'id': 11, 'state': False, 'number': 2 })) myleglist.append( base_objects.Leg({ 'id': 22, 'state': True, 'number': 3 })) myleglist.append( base_objects.Leg({ 'id': 22, 'state': True, 'number': 4 })) myleglist.append( base_objects.Leg({ 'id': 22, 'state': True, 'number': 5 })) myproc = base_objects.Process({'legs': myleglist, 'model': model}) myamplitude = diagram_generation.Amplitude({'process': myproc}) mymatrixelement = helas_objects.HelasMatrixElement(myamplitude) # Create only the needed aloha routines wanted_lorentz = mymatrixelement.get_used_lorentz() aloha_model = create_aloha.AbstractALOHAModel(model.get('name')) aloha_model.compute_subset(wanted_lorentz) # Write out the routines in Python aloha_routines = [] for routine in aloha_model.values(): aloha_routines.append(routine.write(output_dir = None, language = 'Python').\ replace('import wavefunctions', 'import aloha.template_files.wavefunctions as wavefunctions')) # Define the routines to be available globally for routine in aloha_routines: exec(routine, globals()) # Write the matrix element(s) in Python mypythonmodel = helas_call_writers.PythonUFOHelasCallWriter(\ model) exporter = export_python.ProcessExporterPython(\ mymatrixelement, mypythonmodel) matrix_methods = exporter.get_python_matrix_methods() # Calculate parameters and couplings full_model = model_reader.ModelReader(model) full_model.set_parameters_and_couplings() # Define a momentum p = [[ 0.5000000e+03, 0.0000000e+00, 0.0000000e+00, 0.5000000e+03, 0.0000000e+00 ], [ 0.5000000e+03, 0.0000000e+00, 0.0000000e+00, -0.5000000e+03, 0.0000000e+00 ], [ 0.4585788e+03, 0.1694532e+03, 0.3796537e+03, -0.1935025e+03, 0.6607249e-05 ], [ 0.3640666e+03, -0.1832987e+02, -0.3477043e+03, 0.1063496e+03, 0.7979012e-05 ], [ 0.1773546e+03, -0.1511234e+03, -0.3194936e+02, 0.8715287e+02, 0.1348699e-05 ]] # Evaluate the matrix element for the given momenta answer = 1.39189717257175028e-007 for process in matrix_methods.keys(): # Define Python matrix element for process exec(matrix_methods[process]) # Calculate the matrix element for the momentum p value = eval("Matrix_0_epem_aaa().smatrix(p, full_model)") self.assertTrue(abs(value-answer)/answer < 1e-6, "Value is: %.9e should be %.9e" % \ (abs(value), answer))
def setUp(self): """Set up decay model""" #Read the full SM sm_path = import_ufo.find_ufo_path('sm') self.base_model = import_ufo.import_model(sm_path) self.model_reader = model_reader.ModelReader(self.base_model)