numpy - numpy 中有 elliptictheta 函数吗?

我需要 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 实现的功能。

https://stackoverflow.com/questions/33169101/

相关文章:

laravel - 如何在 Laravel 的容器中重新绑定(bind)?

cmake - 如何编写功能测试脚本在cmake/ctest下运行

time - NetLogo 时间扩展 : Plotting graphs does not wor

session - 身份验证为匿名的用户已尝试访问拥有的 session

android - 将抽屉导航添加到现有的 Android 谷歌地图

angularjs - 如何使用 Firebase 和 AngularJS 创建评论线程?

maven - 在 Nexus 中部署后,POM.xml 中的变量没有被解析?

elixir - 左外连接与 Elixir 的理解

c++11 - 将 char16_t 转换为 long/integer,(相当于 atoi/atol

codeigniter - 从数据库下载文件或在 codeigniter 中保存文件夹