Repackage python-flint to include arb and flint as shared libraries
Project description
Python-FLINT
Python extension module wrapping FLINT (Fast Library for Number Theory) and Arb (arbitrary-precision ball arithmetic). Features:
- Integers, rationals, integers mod n
- Real and complex numbers with rigorous error tracking
- Polynomials, power series and matrices over all the above types
- Lots of mathematical functions
Documentation: http://fredrikj.net/python-flint/
Repository: https://github.com/fredrik-johansson/python-flint/
Author: Fredrik Johansson fredrik.johansson@gmail.com
Installation
First install both FLINT (version 2.5 or later) and Arb (version 2.15 or later). See:
The latest release of Python-FLINT can then be installed using:
pip install python-flint
Python-FLINT can also be installed git checkout or a source archive as follows:
pip install .
See the documentation for further notes on building and installing Python-FLINT.
Examples
Import Python-FLINT:
>>> from flint import *
Number-theoretic functions:
>>> fmpz(1000).partitions_p()
24061467864032622473692149727991
>>> fmpq.bernoulli(64)
-106783830147866529886385444979142647942017/510
Polynomial arithmetic:
>>> a = fmpz_poly([1,2,3]); b = fmpz_poly([2,3,4]); a.gcd(a * b)
3*x^2 + 2*x + 1
>>> a = fmpz_poly(list(range(10001))); b = fmpz_poly(list(range(10000))); a.gcd(a * b).degree()
10000
>>> x = fmpz_poly([0,1]); ((1-x**2)*(1+x**3)**3*(1+x+2*x)).factor()
(-1, [(3*x + 1, 1), (x + (-1), 1), (x^2 + (-1)*x + 1, 3), (x + 1, 4)])
Matrix arithmetic:
>>> fmpz_mat([[1,1],[1,0]]) ** 10
[89, 55]
[55, 34]
>>> fmpq_mat.hilbert(10,10).det()
1/46206893947914691316295628839036278726983680000000000
Numerical evaluation:
>>> showgood(lambda: (arb.pi() * arb(163).sqrt()).exp() - 640320**3 - 744, dps=25)
-7.499274028018143111206461e-13
>>> showgood(lambda: (arb.pi() * 10**100 + arb(1)/1000).sin(), dps=25)
0.0009999998333333416666664683
Numerical integration:
>>> ctx.dps = 30
>>> acb.integral(lambda x, _: (-x**2).exp(), -100, 100) ** 2
[3.141592653589793238462643383 +/- 3.11e-28]
To do
- Write more tests and add missing docstrings
- Wrap missing flint types: finite fields, p-adic numbers, multiprecision integer mods, rational functions
- Vector or array types (maybe)
- Many convenience methods
- Write generic implementations of functions missing for specific FLINT types
- Proper handling of special values in various places (throwing Python exceptions instead of aborting, etc.)
- Various automatic conversions
- Conversions to and from external types (numpy, sage, sympy, mpmath, gmpy)
- Improved printing and string input/output
- IPython hooks (TeX pretty-printing etc.)
- Windows support
License
Python-FLINT is licensed MIT. FLINT and Arb are LGPL v2.1+.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Hashes for flint_py-0.3.2-cp37-cp37m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b2ac0ea12ba4e88203b81c36863d8bcc9f8e140309f7929bc29953c673a74a35 |
|
MD5 | 35514151cdccc5111fb7dc3552190745 |
|
BLAKE2b-256 | e77b82f2ac51730321258f8e945e876a68de353b0c4e138ec8da39ebeafdbb55 |
Hashes for flint_py-0.3.2-cp36-cp36m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | af9bc16382163a6370afaf0c2b931126c11a29b8d01bbb6f5688ed529286a718 |
|
MD5 | db277ebdd34bc65d3f46d150a2a83bca |
|
BLAKE2b-256 | 02e58da85d521eebc05242855fafda2cb59d83d10dee2437550a0ce97339f66e |
Hashes for flint_py-0.3.2-cp35-cp35m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 270f0c22807b1d8bcde898a9da88183566bab455817cd18100552feba414052c |
|
MD5 | 1891d5b8104a5a275bfde4f0215922c9 |
|
BLAKE2b-256 | 2629587f4c2fff4072eda8c529e3d69d907d1b3f490de24879d7511c509bcdfe |
Hashes for flint_py-0.3.2-cp34-cp34m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f615dbde6f97027e28536a7f59564622a01203271fc5839ffb0c6a10e4903658 |
|
MD5 | 979af936f160ec427ccaf54c557a2849 |
|
BLAKE2b-256 | 7a5094320c85174d690de2ab853f377dc9209830fe4e647a500b0cd7f17ab4e0 |
Hashes for flint_py-0.3.2-cp27-cp27m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3fdc46350e730b950923504a13d6017a8365807ccd4ed4fa0aab2ab6dbb54bbd |
|
MD5 | a0cb3916e6afd089ccf6166931dcbf32 |
|
BLAKE2b-256 | a479d63a904697a31c45b60f8b479643996eaf8abaa5742b08f86e24f33b6756 |