TransWikia.com

Optimizing a series expansion for high order in $x$

Mathematica Asked on March 23, 2021

I would like to expand the following function at $x sim 0$ up to some high $x_text{max} = Delta_text{max}$:

$$16 sum_{Delta=1}^{Delta_text{max}} sum_{s=0}^{Delta-2} f_{Delta,s} frac{(s+Delta)(1+s-Delta)}{(s-Delta)(1+s+Delta)} _2F_1 left(frac{1}{2},-s,frac{1}{2}-s,1right) _2F_1 left(frac{1}{2},2+Delta,frac{5}{2}+Delta,x^2 right) x^{2+Delta}, tag{1}$$

where $f_{Delta,s}$ are numerical coefficients. The series expansion should be performed after doing the following replacement (everywhere except in the subscript of $f_{Delta,s}$ and in the summation limits):

$$Delta to Delta + g^2 Delta^{(2)}_{Delta,s} + g^4 Delta^{(4)}_{Delta,s}, tag{2}$$

and expanding in $g$. Again the $Delta^{(k)}$ are numbers, which depend on $Delta$ and $s$. I am not interested in $log$ terms, which can be discarded by setting the rule $log x to 0$.

So far I wrote the following simple code:

Δmax=5;
ℒ0s2 = 1/((s - Δ) (1 + s + Δ)) 16 x^(2 + Δ) (1 + s - Δ) (s + Δ) Hypergeometric2F1[1/2, -s, 1/2 - s, 1] Hypergeometric2F1[1/2, 2 + Δ, 5/2 + Δ, x^2]
Sum[Series[(f[Δ, s] Series[ℒ0s2 /. {Δ -> 
Δ + g^2 Δ2[Δ, s] + g^4 Δ4[Δ, s]}, {g, 0, 4}] /. {Log[x] -> 0} // Normal) /. {Δ -> ΔΔ, s -> ss}, {x, 0, Δmax}] /. _?(N[#] == 0 &) :> 0 // Normal, {ΔΔ, 2, Δmax}, {ss, 0, ΔΔ - 2}]

Unfortunately this is insanely inefficient for high $Delta_text{max}$. For $Delta_text{max}=5$ the computation takes less than a second, for $Delta_text{max}=10$ about $20$ seconds, for $Delta_text{max}=15$ it took $3$ minutes,… I let it run the whole night yesterday to reach my goal, which is at least $Delta_text{max}=60$, and it was still running this morning!

Any suggestion how this expansion could be done (much) faster?

One Answer

I found a workaround. As indicated in the comment, the idea is to expand the series in $g$ manually by doing the derivatives and then expand each sum individually.

The concatenation of Series seems to be the reason why the code was so slow. The computation now only takes a few minutes.

Answered by Jxx on March 23, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP