Proposing Mathematica 9 compatibility fix

Report the bugs you found
Post Reply
AlexanderVoigt
Posts: 23
Joined: 13. Apr 2016, 14:59

Proposing Mathematica 9 compatibility fix

Post by AlexanderVoigt » 7. Nov 2017, 12:49

Dear Florian and Mark,

I'm currently experimenting with the

Code: Select all

Calc2LoopCorrections[EWSB]
function to generate the 2-loop corrections to the Higgs pole mass.

However, I stumbled upon an incompatibility with Mathematica 9:

Code: Select all

In[6]:= Calc2LoopCorrections[EWSB];                                             
Calculating 2 loop corrections
Building Coupling List 4pt pole: Dynamic[fourptcouplingstatus]
Generating tadpole diagrams

Extract::psl: Position specification {All, 1, 1} in 
    Extract[{{{C[Ah, Ah, hh]}, {CouplingAhAhhh, cplAhAhhh}, {}, {λ, v}, 
       -I v λ, {Ah, Ah, hh}}, <<14>>, 
      {{C[Fu, VG, bar[Fu]]}, <<5>>, 
       {bar[Fu[{gt1, ct1}]], Fu[<<1>>], VG[{ct3, lt3}]}}}, {All, <<2>>}] is not
     a machine-sized integer or a list of machine-sized integers.
Since I have only Mathematica 9 on my computer, this is an issue for me.

However, I think this little issue is very easy to fix. I was able to fix it by adding

Code: Select all

Unprotect[Extract];
Extract[expr_, {All,1,1}] := First[First[#]]& /@ expr;
Protect[Extract];
before the start of SARAH. So, since it is easy to fix, what do you think about replacing the calls of

Code: Select all

Extract[_,{All,1,1}]
by the custom new function

Code: Select all

(* equivalent to Extract[expr_,{All,1,1}] *)
ExtractAll11[expr_] := First[First[#]]& /@ expr;
In this way the call to

Code: Select all

Calc2LoopCorrections[EWSB]
would be compatible with Mathematica 9. What do you think?

Many thanks and best regards,
Alex

FStaub
Site Admin
Posts: 822
Joined: 13. Apr 2016, 14:05

Re: Proposing Mathematica 9 compatibility fix

Post by FStaub » 7. Nov 2017, 12:57

Hi Alex,

thanks for the suggestion. However, I just wonder if there isn't also the problem with StringRiffle command which is also not available in matheamtica 9?!

Cheers,
Florian

AlexanderVoigt
Posts: 23
Joined: 13. Apr 2016, 14:59

Re: Proposing Mathematica 9 compatibility fix

Post by AlexanderVoigt » 8. Nov 2017, 10:53

Dear Florian,

you are absolutely right, StringRiffle[] is not available in Mathematica 9 either.
So far I was able to circumvent this incompatibility by defining

Code: Select all

StringRiffle[s_List, char_:" "] := StringJoin[Riffle[s, char]];
So, also here one could easily fix the incompatibility by replacing the call to StringRiffle[] by the following custom SARAH function

Code: Select all

SARAHStringRiffle[s_List, char_:" "] := StringJoin[Riffle[s, char]];
What do you think?

Best regards,
Alex

Post Reply