3456
3456
for out,sol in zip(ufo_value,solution):
3457
3457
self.assertAlmostEqual(out, sol)
3459
def test_aloha_expr_VVS1(self):
3460
"""Test analytical expression for VVS from SILH.
3461
This checks that P(-1,1)**2 is correct."""
3464
aloha_lib.KERNEL.clean()
3465
from models.mssm.object_library import Lorentz
3466
VVS1 = Lorentz(name = 'VVS1',
3467
spins = [ 3, 3, 1 ],
3468
structure = 'P(1,1)*P(2,1) - P(-1,1)**2*Metric(1,2)')
3469
builder = create_aloha.AbstractRoutineBuilder(VVS1)
3470
amp = builder.compute_routine(0)
3472
solution = """subroutine VVS1_0(V1, V2, S3, COUP,vertex)
3475
parameter (CI=(0d0,1d0))
3488
P1(2) = dimag(V1(2))
3489
P1(3) = dimag(V1(1))
3490
TMP1 = (P1(0)*V1(3)-P1(1)*V1(4)-P1(2)*V1(5)-P1(3)*V1(6))
3491
TMP0 = (V2(3)*P1(0)-V2(4)*P1(1)-V2(5)*P1(2)-V2(6)*P1(3))
3492
TMP3 = (P1(0)*P1(0)-P1(1)*P1(1)-P1(2)*P1(2)-P1(3)*P1(3))
3493
TMP2 = (V2(3)*V1(3)-V2(4)*V1(4)-V2(5)*V1(5)-V2(6)*V1(6))
3494
vertex = COUP*S3(3)*(-CI*(TMP0*TMP1)+CI*(TMP2*TMP3))
3499
routine = amp.write(output_dir=None, language='Fortran')
3500
split_solution = [l.strip() for l in solution.split('\n')]
3501
split_routine = [l.strip() for l in routine.split('\n')]
3502
self.assertEqual(split_solution, split_routine)
3503
self.assertEqual(len(split_routine), len(split_solution))
3506
V1_1, V1_2, V1_3, V1_4 = 1,2,3,4
3507
V2_1, V2_2, V2_3, V2_4 = 5,5,6,7
3508
S3_1, S3_2, S3_3, S3_4 = 10,20,32,44
3509
P1_0, P1_1, P1_2, P1_3 = 1,2,3,6
3510
M1 = P1_0**2 - P1_1**2 - P1_2**2 - P1_3**2
3512
cImag = complex(0,1)
3514
for name, expr in amp.contracted.items():
3515
exec('%s = %s' % (name,expr))
3518
ufo_value = eval(str(amp.expr.get_rep([0])))
3519
self.assertAlmostEqual(ufo_value, 1080j)
3460
3523
def test_aloha_expr_FFV2C1(self):
3461
3524
"""Test analytical expression for fermion clash routine"""