问题
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