I want to get the following series expansion:
Series[QPochhammer[q, q, 3], {q, 0,4}]
but in Mathematica 11.0, I obtain the following gibberish:
There weren't any problems of this kind in Mathematica 8.0.
The following example with the infinite product
Series[QPochhammer[q, q], {q, 0, 4}]
works perfectly fine, producing the series
Documentation regarding QPochhammer
can be found here.
Q: What causes this problem with finite products and how to avoid it?
Answer
The reason it doesn't work is because somewhere between v10.0 and v10.3, the seventh definition of QPochhammer
was modified to check that the second argument does not depend on the expansion parameter.
To restore previous behavior, clear the seventh definition,
(*Triggers loading of definitions*)
Series[QPochhammer[0, x, 3], {x, 0, 1}];
(*Unprotect*)
Unprotect[QPochhammer];
QPochhammer /:
System`Private`InternalSeries[
HoldPattern[QPochhammer][System`SeriesDump`w_,
System`SeriesDump`q_,
System`SeriesDump`k_Integer?Positive], {System`SeriesDump`z_,
System`SeriesDump`p_, System`SeriesDump`n_Integer}] /;
Internal`DependsOnQ[System`SeriesDump`w, System`SeriesDump`z] && !
Internal`DependsOnQ[{System`SeriesDump`q, System`SeriesDump`p},
System`SeriesDump`z] =.
Then add the definition from earlier versions,
QPochhammer /:
System`Private`InternalSeries[
HoldPattern[QPochhammer][System`SeriesDump`w_,
System`SeriesDump`q_,
System`SeriesDump`k_Integer?Positive], {System`SeriesDump`z_,
System`SeriesDump`p_, System`SeriesDump`n_Integer}] /;
Internal`DependsOnQ[System`SeriesDump`w, System`SeriesDump`z] :=
Module[{System`SeriesDump`lim, System`SeriesDump`ord,
System`SeriesDump`qq, System`SeriesDump`ww},
System`SeriesDump`lim =
System`SeriesDump`getExpansionPoint[System`SeriesDump`w,
System`SeriesDump`z,
System`SeriesDump`p]; (System`SeriesDump`ord =
Min[System`SeriesDump`k,
System`SeriesDump`AdjustExpansionOrder[System`SeriesDump`w,
System`SeriesDump`lim, System`SeriesDump`z,
System`SeriesDump`p, System`SeriesDump`n]];
System`SeriesDump`ww =
System`Private`InternalSeries[
System`SeriesDump`w, {System`SeriesDump`z, System`SeriesDump`p,
System`SeriesDump`n}];
System`SeriesDump`qq =
System`Private`InternalSeries[
System`SeriesDump`q, {System`SeriesDump`z, System`SeriesDump`p,
System`SeriesDump`n}];
1 + Plus @@
Table[(-System`SeriesDump`ww)^
System`SeriesDump`m System`SeriesDump`qq^
Binomial[System`SeriesDump`m, 2] QBinomial[
System`SeriesDump`k, System`SeriesDump`m,
System`SeriesDump`qq], {System`SeriesDump`m,
System`SeriesDump`ord}]) /; System`SeriesDump`lim === 0];
Protect[QPochhammer];
Now we get the desired behavior,
Series[QPochhammer[q, q, 3], {q, 0, 4}]
Warning The seventh definition was modified in later releases probably because someone discovered that it leads to incorrect results in some cases. Proceed with caution.
Comments
Post a Comment