Closed stla closed 1 year ago
I still have my R-C++ implementation of @fremling 's algorithm. It also gives the wrong sign.
Now I checked with Wolfram, and the Python library is indeed right.
For theta 3, with
tau = -i*log(q)/pi = 0.1498653698657948 + 0.15017823767320393i
the FORTRAN implementation gives
theta3(0,tau) = 2.0061026281212841 +0.8298431381942418i,
so it would appear this has the correct sign.
Thanks @fremling ! Weird, I have to check why I got the opposite.
You're right, works perfectly.
@simonp0420 I suspect the problem lies in my function alpha
. Because it has a square root, and possibly its sign can be the two possibilities. I don't see what could be the problem otherwise.
I confirm. Everything works now! I replaced the expressions involving alpha
.
I'm surprised the unit tests work because I already tried to get rid of alpha
and there were some failures.
I'm surprised the unit tests work because I already tried to get rid of
alpha
and there were some failures.
I see: they didn't fail because I used @fremling's jtheta3
function in the Dedekind eta function. Otherwise they fail :-( Lost again...
Works now. I believe formula 20.4.6 here is wrong, it is only true up to the sign. So I use a direct implementation of the derivative now.
This seems definitely ok now :)
My R implementation of the Jacobi theta functions is the same as the Julia implementation, and it gives:
Assuming the Python library mpmath has the right values, then the above three results are wrong: the right values are the opposite of these ones.
I'm wondering what is the result of @fremling 's Fortran implementation.
I don't know whether this is related, but
jtheta1(0, q)
is very close to 0 for this value of the nomeq
.cc @simonp0420