Jacobi theta函数导数的实现

Implementation of derivatives of Jacobi theta function

我正在寻找 python 的 Jacobi theta 函数导数的实现。我找到了这个

http://mpmath.googlecode.com/svn/trunk/doc/build/functions/elliptic.html#jtheta

但是,导数是根据错误的参数计算的。我想要关于 q 而不是 z 的导数。有谁知道获得这个的最佳方法?仅以有限差分对数值求导并不能很好地工作(当我这样做时,我使用的 ODE 求解器崩溃了)。

(实际上我也只想要特殊情况 z=0,如果可能的话。E4 Eisenstein 系列的相同问题也足够了)

谢谢!

这个关系应该对你有帮助:http://functions.wolfram.com/EllipticFunctions/EllipticTheta2/13/01/0002/ https://en.wikipedia.org/wiki/Theta_function#A_solution_to_heat_equation

def jtheta_dq(n, z, q):
    # cf. http://functions.wolfram.com/EllipticFunctions/EllipticTheta2/13/01/0002/
    return -mpmath.jtheta(n, z, q, 2)/(4*q)