generatePOLEfunctions bug?

Report the bugs you found
Post Reply
JPEllis
Posts: 71
Joined: 28. Apr 2016, 10:34

generatePOLEfunctions bug?

Post by JPEllis » 12. Feb 2018, 03:13

Hi,

I'm having issues with Mathemtica trying to index lists incorrectly which ultimately originate from the call

Code: Select all

generatePOLEfunctions[2, ZoSSSS, {1, 1, 2, 2}, {1, 1, 2, 2}, {{1 -> ps3, 2 -> ps4, 3 -> ps1, 4 -> ps2}}]
when generating the Ah.m file.

Going through the debug, the error comes down to the following segment (taken from Mathematica's debugger, hence the extra $NNN everywhere)

Code: Select all

particlesincoupling = Transpose[setofindices$153632[[Scalarcouplingnumber$153632]]][[1]];
indicesincoupling = Transpose[setofindices$153632[[Scalarcouplingnumber$153632]]][[2]];
setofpairs = {{}, {}}; orderedfieldsincoupling = diag$153632[[1, j$153632]] /. {C[x__] -> {x}};

For[k$153632 = 1, k$153632 <= 4, k$153632++, 
    AppendTo[setofpairs[[{1, 1, 2, 2}[[indicesincoupling[[k$153632]] /. indextonumber]]]], {particlesincoupling[[k$153632]], indicesincoupling[[k$153632]]}];
];

newcouplingindices = {{}, {}, {}, {}};

pp1 = Position[orderedfieldsincoupling, setofpairs[[1, 1, 1]], 1][[1, 1]];
pp2 = Position[orderedfieldsincoupling, setofpairs[[1, 2, 1]], 1][[1, 1]];
pp3 = Position[orderedfieldsincoupling, setofpairs[[2, 1, 1]], 1][[2, 1]];
pp4 = Position[orderedfieldsincoupling, setofpairs[[2, 2, 1]], 1][[2, 1]];

newcouplingindices[[pp1]] = setofpairs[[1, 1]];
newcouplingindices[[pp2]] = setofpairs[[1, 2]];
newcouplingindices[[pp3]] = setofpairs[[2, 1]];
newcouplingindices[[pp4]] = setofpairs[[2, 2]];

indicestowrite$153632 = {};
For[k$153632 = 1, k$153632 <= 4, k$153632++,
    AppendTo[indicestowrite$153632, {orderedfieldsincoupling[[k$153632]], newcouplingindices[[k$153632, 2]]}]
];
AppendTo[allindicesstrings$153632, {indicestowrite$153632, diag$153632[[1, j$153632]] /. a_[{x__}] -> a}];
To help understand the origin of the error, here are the values of a few relevant variables:

Code: Select all

orderedfieldsincoupling: {DS, DS, conj[DS], conj[DS]}
setofpairs: {{{conj[DS], i1}, {conj[DS], i2}}, {{DS, i3}, {DS, i4}}}
pp1: 3
pp2: 3
pp3: 2
pp4: 2
newcouplingindices: {{}, {DS, i4}, {conj[DS], i2}, {}}
So the issue appears to be in the identification of pp1 through to pp4 which is only finds indices 2 and 3 because the same field appears multiple times. As a result, the newcouplingindices variable is not property initialized. In this particular instance, the first and last elements of newcouplingindices are empty lists which leads to an error when Mathematica attempts to fetch to second element of this sublist.

I'm not familiar enough with the code here to fix it, but do you have an idea what might be cause of this issue? Did I find a bug in SARAH itself? Or do you suspect it is a bug in my implementation of the model? In this instance, DS corresponds to two complex scalars.

Josh
Joshua Ellis jpellis.me

MDGoodsell
Posts: 17
Joined: 25. Aug 2017, 08:41

Re: generatePOLEfunctions bug?

Post by MDGoodsell » 15. Feb 2018, 09:54

Dear Joshua,

I am sorry but I cannot reproduce the problem (I've tried creating some other models and can't find an issue). It is possible there is a bug but I'd have to see your model files; please email them to me (I will treat them with utmost confidence!) and let me know your mathematica version -- my email address is printed out when you start creating the 2 loop output when running MakeSPheno -- and I'll try to see what is going wrong.

Best,
Mark

Post Reply