Skip to content

Commit

Permalink
change model_handling to support unary
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviermattelaer committed May 30, 2024
1 parent 9770d2a commit 9919f3a
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 ['*']:
Expand Down Expand Up @@ -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:
Expand All @@ -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'
Expand Down

0 comments on commit 9919f3a

Please sign in to comment.