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.4-cp37-cp37m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 51537625e9ffae9f2e4354e01c77486a0f7fa82475d113079630525225359326 |
|
MD5 | 16c7baddcb52dad562956d6e6c159142 |
|
BLAKE2b-256 | f77e81fc3853aba72907f34ccb628fb838972638d6c33c7bfa50a544f2f05570 |
Hashes for flint_py-0.3.4-cp36-cp36m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5a6de18b2c38983578ac6afa16c22f943dca768b4f01d643fe0ddc1a11d0f2d5 |
|
MD5 | 976336d18b4287a1024ff291a8d42fd6 |
|
BLAKE2b-256 | ecd3cfd07d325e5240abe4922d4e9bd627d3af16b87cf4dca1872274bf1ada5f |
Hashes for flint_py-0.3.4-cp35-cp35m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 387e3bde46a22936bb2ed5f9972d126c80d073d69009a8aed50908da8d50787e |
|
MD5 | cc936a5880568975a1c87583bb2a15f5 |
|
BLAKE2b-256 | c0dabce116301099fb5ac8f7dea9693ac000d1c4e5ceb5bc779bd08684a898b1 |
Hashes for flint_py-0.3.4-cp34-cp34m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | df29d2b3640e1f450f1d76eb036aad3530581250b103c1c654f26ce4def5c2bb |
|
MD5 | 1a78a83fe046af455d87c16ac4616e6b |
|
BLAKE2b-256 | 0e48aacb31d13579b53052da92ac2b1697ff242838800b058c7fb4acab0daae1 |
Hashes for flint_py-0.3.4-cp27-cp27mu-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 64a06d7c6837cd3d89f1a1ef62ef7f4e94b59663b98e8fa302b9b630f02b8752 |
|
MD5 | ed2ccb2ae173bfd86f41352b372b2ac1 |
|
BLAKE2b-256 | bbcf9ab08f593f68c0915966d4c5bfecd8da2c85bc4a673933651741d5f2fd16 |
Hashes for flint_py-0.3.4-cp27-cp27m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3a4afaa0e3c9226ffce2112bf2cee09d90d11ca05f8e5c3b27fa87d4486c8581 |
|
MD5 | cde13f3e0127edf7b1af81d12d7ffb71 |
|
BLAKE2b-256 | cd1ed72338d43f51a84a18fd4c2327080d81bc60bee7b0238335a6c75161b852 |