开发者

Python Pari Library?

开发者 https://www.devze.com 2022-12-24 23:31 出处:网络
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 versio

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 wond开发者_如何学编程ering 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.


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
>>> 
0

精彩评论

暂无评论...
验证码 换一张
取 消