upiterbarg / mpmath

Automatically exported from code.google.com/p/mpmath
Other
0 stars 0 forks source link

Wrong summation index in the documentation to elliptic.jtheta #179

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hi, 

the jacobi theta functions appear to evaluate correctly, but the
documentation states a wrong defining formula.

What steps will reproduce the problem?
1. import mpmath
2. help(mpmath.elliptic.jtheta)

What is the expected output? 

for theta_3:

1+2\sum_1^\infty q^{n^2} \cos(2 n u)

for theta_4:

1+2\sum_1^\infty (-1)^{n} q^{n^2} \cos(2 n u)

this is the definition in Abramowitz and Stegun and in the Mathematica
documentation.

What do you see instead?

for theta_3:

1+2\sum_0^\infty q^{n^2} \cos(2 n u)

for theta_4:

1+2\sum_0^\infty (-q)^{n^2} \cos(2 n u)

What version of the product are you using? On what operating system?

0.13, python 2.6
Please provide any additional information below.

I agree that (-1)^(n^2) = (-1)^n, but the lower summation index is still
wrong. I checked by evaluating a few random values. The implementation
reproduces the _correct definition_, only the documentation is wrong. 

Original issue reported on code.google.com by bckr...@gmail.com on 19 Jan 2010 at 6:00

GoogleCodeExporter commented 9 years ago
Agree, it's a simple typo in the documentation. The docstrings added in r1040 
should
be correct. The online documentation will be updated eventually. Thanks for 
reporting
this!

Original comment by fredrik....@gmail.com on 19 Jan 2010 at 8:33