madgraph5 / madgraph4gpu

GPU development for the Madgraph5_aMC@NLO event generator software package
30 stars 33 forks source link

Cross section mismatch (fortran/cpp) in SUSY gg_tt #825

Closed valassi closed 4 months ago

valassi commented 6 months ago

Cross section mismatch (fortran/cpp) in SUSY gg_tt

In PR #824 I fixed SUSY codegen, builds and internal tests cuda/cpp. But now I ALSO added the test comparing to fortran and this fails

In tmad/logs_susyggtt_mad/log_susyggtt_mad_d_inl0_hrd0.txt

ERROR! xsec from fortran (44.598860065419856) and cpp (171.81273026311101) differ by more than 3E-14 (2.85240183294
1188)
oliviermattelaer commented 4 months ago

I have started to investigate this, and this is related to the fact that in the fortran code the coupling is "muliply by -1":

When I deactivate the function that allow the "-1" factor in madgraph, then I do have perfect agreement.

To comment below seems wrong: please ignore

CALL FFV1_1(W(1,3),W(1,1),-GC_51,MDL_MT, ZERO,W(1,5))

Which seems to not be handle correctly in this case by the CPP output code: The call for that particular line in the CPP code is

FFV1_1<W_ACCESS, CD_ACCESS>( w_fp[2], w_fp[0], COUPs[1], 1.0, cIPD[0], cIPD[1], w_fp[4] );

So in this case the "coefficient" is one and not -1 ... CORRECTION the code is correctly:

      FFV1_1<W_ACCESS, CD_ACCESS>( w_fp[2], w_fp[0], COUPs[1], -1.0, cIPD[0], cIPD[1], w_fp[4] );

@valassi do you have a quick idea why? (If not do not bother, I will find it)

oliviermattelaer commented 4 months ago

further update: the "-1" is just ignored by the cpp aloha code:

 template<class W_ACCESS, class A_ACCESS, class C_ACCESS>
  __device__ void
  FFV1_0( const fptype allF1[],
          const fptype allF2[],
          const fptype allV3[],
          const fptype allCOUP[],
          const double Ccoeff,
          fptype allvertexes[] )
  {
    mgDebug( 0, __FUNCTION__ );
    const cxtype_sv* F1 = W_ACCESS::kernelAccessConst( allF1 );
    const cxtype_sv* F2 = W_ACCESS::kernelAccessConst( allF2 );
    const cxtype_sv* V3 = W_ACCESS::kernelAccessConst( allV3 );
    const cxtype_sv COUP = C_ACCESS::kernelAccessConst( allCOUP );
    cxtype_sv* vertex = A_ACCESS::kernelAccess( allvertexes );
    const cxtype cI = cxmake( 0., 1. );
    const cxtype_sv TMP5 = ( F1[2] * ( F2[4] * ( V3[2] + V3[5] ) + F2[5] * ( V3[3] + cI * V3[4] ) ) + ( F1[3] * ( F2[4] * ( V3[3] - cI * V3[4] ) + F2[5] * ( V3[2] - V3[5] ) ) + ( F1[4] * ( F2[2] * ( V3[2] - V3[5] ) - F2[3] * ( V3[3] + cI * V3[4] ) ) + F1[5] * ( F2[2] * ( -V3[3] + cI * V3[4] ) + F2[3] * ( V3[2] + V3[5] ) ) ) ) );
    ( *vertex ) = COUP * -cI * TMP5;
    mgDebug( 1, __FUNCTION__ );
    return;
valassi commented 4 months ago

Hi @oliviermattelaer thanks for the patch in PR #850!

As mentioned in https://github.com/madgraph5/madgraph4gpu/pull/850#issuecomment-2139208110 it seems that this #825 is fixed: the cross sections from fortran and cppp for susy_gg_tt now agree.

Instead the susy_gg_t1t1 test still gives no cross section (#826 is not fixed).

And by the way all processes change Parameters.h, so I will rerun all tests.

Thanks! Andrea

valassi commented 4 months ago

This is now fixed in Olivier's #850 and my #860, both merged