gpt4 book ai didi

numpy - numpy 中有 elliptictheta 函数吗?

转载 作者:行者123 更新时间:2023-12-05 04:15:09 24 4
gpt4 key购买 nike

我需要 EllipticTheta mathematica中的函数,不知道numpy中有没有对应的函数。尤其是第二种吧。

最佳答案

试试这个:http://www.google.com/search?q=python+elliptic+theta

mpmath 具有 jacobi theta 函数:

http://docs.sympy.org/0.7.6/modules/mpmath/functions/elliptic.html#jacobi-theta-functions

如果你想要一个向量化的函数,你可以这样写

import mpmath
import numpy as np

jtheta = np.vectorize(mpmath.jtheta, 'D')

print(jtheta(1,2,1j*np.linspace(0,0.9,15)))

请注意,np.vectorize 不会加速它——它只是允许它直接在数组输入上工作。 mpmath 函数与套利。精度 float ,所以它们有时会比等价物慢以机器精度 fp 实现的功能。

关于numpy - numpy 中有 elliptictheta 函数吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33169101/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com