Python Pari Library?

跟風遠走 提交于 2019-12-06 06:18:40

问题


Pari/GP is an excellent library for functions relating to number theory. The problem is that there doesn't seem to be an up to date wrapper for python anywhere around, (pari-python uses an old version of pari) and I'm wondering if anyone knows of some other library/wrapper that is similar to pari or one that uses pari.

I'm aware of SAGE, but it's far too large for my needs. GMPY is excellent as well, but there are some intrinsic pari functions that I miss, and I'd much rather use python than the provided GP environment. NZMATH, mpmath, scipy and sympy were all taken into consideration as well.

On a related note, does anyone have any suggestions on loading the pari dll itself and using the functions contained in it? I've tried to very little success, other than loading it and learning about function pointers.


回答1:


Actually, pari-python works with the latest stable release of PARI. And it is very easy to use:

>>> from pari import *
>>> fibonacci(100)
354224848179261915075
>>> intnum(0,1,lambda x:x**2)
0.3333333333333333333333333333
>>> 


来源:https://stackoverflow.com/questions/2506087/python-pari-library

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!