I have one case (Nn=1) for 7 Polynomials as following:
p1= a[0]*b[0] + c[0]*d[0] + e[0]*f[0] + g[0]*h[0];
p2= a[1]*c[1] + b[1]*d[1] + e[1]*g[1] + f[1]*h[1];
p3= a[2]*d[2] + b[2]*c[2] + e[2]*h[2] + f[2]*g[2];
p4= a[3]*e[3] + b[3]*f[3] + c[3]*g[3] + d[3]*h[3];
p5= a[4]*f[4] + b[4]*e[4] + c[4]*h[4] + d[4]*g[4];
p6= a[5]*g[5] + b[5]*h[5] + c[5]*e[5] + d[5]*f[5];
p7= a[6]*h[6] + b[6]*g[6] + c[6]*f[6] + d[6]*e[6];
and I want to pick up 4 terms from the 7*4=28 terms such as a[0]*b[0]
, c[0]*d[0]
and so on, which gives me the output in the form of a[x1]*b[x2]*c[x3]*d[x4]*e[x5]*f[x6]*g[x7]*h[x8]
(we can later write it as FF[x1,x2,x3,x4,x5,x6,x7,x8]
).
The way I do is as following:
outputstemp={};
outputs={};
FFnCaseList={a[c1_]*b[c2_]*c[c3_]*d[c4_]*e[c5_]*f[c6_]*g[c7_]*h[c8_]->FF[c1,c2,c3,c4,c5,c6,c7,c8], a[_]->0, b[_]->0, c[_]->0, d[_]->0, e[_]->0, f[_]->0, g[_]->0, h[_]->0, x_[_]^n_->0};
AllRows = (p1+p2+p3+p4+p5+p6+p7)^4;
AppendTo[outputstemp, ExpandAll[AllRows]];
Timing[AppendTo[outputs, outputstemp/.FFnCaseList];]
the time is
{10.2344, Null}
So is there any quick way to do this? If I have many different cases (for example Nn=6000) of 7 Polynomials, then I can make a loop that run similar things Nn times (6000*10s). That will takes roughly 16.7 hours!!!
Any comments or suggestions are appreciated! Thank you very much!