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.0-cp37-cp37m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 73a416ede6a01d6e4a917a0ef061e69d78e6c46a6bdc73f4bfacbd0fb73bf2f3 |
|
MD5 | f52220f0431f9d3407c868c76a57f08b |
|
BLAKE2b-256 | 4cd04da402cda046b296a2d6b5dc438b93f4c30affb18a6a3e7830e078e72eb4 |
Hashes for flint_py-0.3.0-cp36-cp36m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5483e4b2d30ff88cef57ae0cff2dcb5e598a8afe56be7787942c725d731c1b27 |
|
MD5 | c2b864046ef009aa6963b1d2ed4f5112 |
|
BLAKE2b-256 | 06ddc4feae19357cccdcf68898a0055c2e0be98bf2fecf468a2a912b39e00439 |
Hashes for flint_py-0.3.0-cp35-cp35m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f40b1bf33055db22852b7eb41e1c8af324735e872e82940b8b330be4ea3bbd54 |
|
MD5 | 33d30474faccba61f55367715ba56d53 |
|
BLAKE2b-256 | 22183513abf68c506b0f62d41b40c42e7048a18c4618bfeb3d70782924534f01 |
Hashes for flint_py-0.3.0-cp34-cp34m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7db722451bfee40da13fb29efc88bac142d3c8c0f64473046785cc6ae5102d63 |
|
MD5 | a553b2cc8d64d062dde465b58c1c2e6a |
|
BLAKE2b-256 | dedcd1230271679f073ce485990a5a0b61f30da5de49747482121c861fb37925 |
Hashes for flint_py-0.3.0-cp27-cp27mu-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 25cf2b3c7725b29f696d257474b7307fe1943a8c26df5465180f8860059f12ae |
|
MD5 | afcd565cdde190b47d995196eeab3051 |
|
BLAKE2b-256 | 0a37313838e935ac22e17c5e2c55e35b2f3c8d7b1a62c6b014006389b5d65717 |
Hashes for flint_py-0.3.0-cp27-cp27m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1a1dbc27ac7adf8290db148dc27c6fa322f9154443daf4a025bdafc8c5b7ec37 |
|
MD5 | 36216fdea9e732ac920b4400b024761d |
|
BLAKE2b-256 | dd2a463d72c0134e5d1b4b898ca26b786e68b39463d922cc26ac91ee7405672c |