From 9919f3a10e2f925723e60d5a734ca6ef551148df Mon Sep 17 00:00:00 2001 From: Olivier Mattelaer Date: Thu, 30 May 2024 10:17:43 +0200 Subject: [PATCH 1/3] change model_handling to support unary --- .../CODEGEN/PLUGIN/CUDACPP_SA_OUTPUT/model_handling.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/epochX/cudacpp/CODEGEN/PLUGIN/CUDACPP_SA_OUTPUT/model_handling.py b/epochX/cudacpp/CODEGEN/PLUGIN/CUDACPP_SA_OUTPUT/model_handling.py index 6e7a11d111..dfc67117ed 100644 --- a/epochX/cudacpp/CODEGEN/PLUGIN/CUDACPP_SA_OUTPUT/model_handling.py +++ b/epochX/cudacpp/CODEGEN/PLUGIN/CUDACPP_SA_OUTPUT/model_handling.py @@ -432,8 +432,8 @@ def define_expression(self): else: mydict['pre_%s' %c] = '' mydict['post_%s'%c] = '' - # This affects '( *vertex ) = ' in HelAmps_sm.cc - out.write(' %(pre_vertex)svertex%(post_vertex)s = %(pre_coup)sCOUP%(post_coup)s * %(num)s;\n' % mydict) + # This affects '( *vertex ) = ' in HelAmps_sm.cc + out.write(' %(pre_vertex)svertex%(post_vertex)s = Ccoeff * %(pre_coup)sCOUP%(post_coup)s * %(num)s;\n' % mydict) else: mydict= {} if self.type2def['pointer_vertex'] in ['*']: @@ -464,6 +464,10 @@ def define_expression(self): else: mydict['declnamedenom'] = 'denom' # AV self.declaration.add(('complex','denom')) + + # need to add the unary operator before the coupling + if mydict['coup'] != 'one': # but in case where the coupling is not used (one) + mydict['pre_coup'] = 'Ccoeff * %s' % mydict['pre_coup'] if not aloha.complex_mass: # This affects 'denom = COUP' in HelAmps_sm.cc if self.routine.denominator: @@ -478,7 +482,7 @@ def define_expression(self): if self.routine.denominator: raise Exception('modify denominator are not compatible with complex mass scheme') # This affects 'denom = COUP' in HelAmps_sm.cc - out.write(' %(declnamedenom)s = %(pre_coup)s%(coup)s%(post_coup)s / ( ( P%(i)s[0] * P%(i)s[0] ) - ( P%(i)s[1] *P%(i)s[1] ) - ( P%(i)s[2] * P%(i)s[2] ) - ( P%(i)s[3] * P%(i)s[3] ) - ( M%(i)s * M%(i)s ) );\n' % mydict) # AV + out.write(' %(declnamedenom)s = %(pre_coup)s%(coup)s%(post_coup)s / ( ( P%(i)s[0] * P%(i)s[0] ) - ( P%(i)s[1] *P%(i)s[1] ) - ( P%(i)s[2] * P%(i)s[2] ) - ( P%(i)s[3] * P%(i)s[3] ) - ( M%(i)s * M%(i)s ) );\n' % mydict) # AV ###self.declaration.add(('complex','denom')) # AV moved earlier (or simply removed) if aloha.loop_mode: ptype = 'list_complex' else: ptype = 'list_double' From 0194e9d0e13949db7c179211d1f63dc923fc5b68 Mon Sep 17 00:00:00 2001 From: Olivier Mattelaer Date: Thu, 30 May 2024 10:29:19 +0200 Subject: [PATCH 2/3] try to fix formatting --- .../cudacpp/CODEGEN/PLUGIN/CUDACPP_SA_OUTPUT/model_handling.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epochX/cudacpp/CODEGEN/PLUGIN/CUDACPP_SA_OUTPUT/model_handling.py b/epochX/cudacpp/CODEGEN/PLUGIN/CUDACPP_SA_OUTPUT/model_handling.py index dfc67117ed..a936da5acf 100644 --- a/epochX/cudacpp/CODEGEN/PLUGIN/CUDACPP_SA_OUTPUT/model_handling.py +++ b/epochX/cudacpp/CODEGEN/PLUGIN/CUDACPP_SA_OUTPUT/model_handling.py @@ -482,7 +482,7 @@ def define_expression(self): if self.routine.denominator: raise Exception('modify denominator are not compatible with complex mass scheme') # This affects 'denom = COUP' in HelAmps_sm.cc - out.write(' %(declnamedenom)s = %(pre_coup)s%(coup)s%(post_coup)s / ( ( P%(i)s[0] * P%(i)s[0] ) - ( P%(i)s[1] *P%(i)s[1] ) - ( P%(i)s[2] * P%(i)s[2] ) - ( P%(i)s[3] * P%(i)s[3] ) - ( M%(i)s * M%(i)s ) );\n' % mydict) # AV + out.write(' %(declnamedenom)s = %(pre_coup)s%(coup)s%(post_coup)s / ( ( P%(i)s[0] * P%(i)s[0] ) - ( P%(i)s[1] *P%(i)s[1] ) - ( P%(i)s[2] * P%(i)s[2] ) - ( P%(i)s[3] * P%(i)s[3] ) - ( M%(i)s * M%(i)s ) );\n' % mydict) # AV ###self.declaration.add(('complex','denom')) # AV moved earlier (or simply removed) if aloha.loop_mode: ptype = 'list_complex' else: ptype = 'list_double' From 992f7001417e16d07eed8569c1c60816121549ec Mon Sep 17 00:00:00 2001 From: Olivier Mattelaer Date: Thu, 30 May 2024 10:34:47 +0200 Subject: [PATCH 3/3] try to fix formatting (2) --- .../cudacpp/CODEGEN/PLUGIN/CUDACPP_SA_OUTPUT/model_handling.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epochX/cudacpp/CODEGEN/PLUGIN/CUDACPP_SA_OUTPUT/model_handling.py b/epochX/cudacpp/CODEGEN/PLUGIN/CUDACPP_SA_OUTPUT/model_handling.py index a936da5acf..53213121d9 100644 --- a/epochX/cudacpp/CODEGEN/PLUGIN/CUDACPP_SA_OUTPUT/model_handling.py +++ b/epochX/cudacpp/CODEGEN/PLUGIN/CUDACPP_SA_OUTPUT/model_handling.py @@ -467,7 +467,7 @@ def define_expression(self): # need to add the unary operator before the coupling if mydict['coup'] != 'one': # but in case where the coupling is not used (one) - mydict['pre_coup'] = 'Ccoeff * %s' % mydict['pre_coup'] + mydict['pre_coup'] = 'Ccoeff * %s' % mydict['pre_coup'] if not aloha.complex_mass: # This affects 'denom = COUP' in HelAmps_sm.cc if self.routine.denominator: