Flint2-0.1.0.5: Haskell bindings for the flint library for number theory
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.Number.Flint

Description

What is FLINT ?

FLINT is a C library for doing number theory, freely available under the GNU LGPL at https://flintlib.org

Some domains handled by FLINT are \(\mathbb{Z}\), \(\mathbb{Q}\), \(\mathbb{F}_q\), \(\overline{\mathbb{Q}}\), \(\mathbb{C}\) and \(Q[x,y,z]\). At its core, FLINT provides arithmetic in standard rings such as the integers, rationals, algebraic, real, complex and p-adic numbers, finite fields, and number fields. It also provides polynomials (univariate and multivariate), power series, and matrices.

FLINT covers a wide range of functionality: primality testing, integer factorisation, multivariate polynomial GCD and factorisation, FFTs, multimodular reconstruction, special functions, exact and approximate linear algebra, LLL, finite field embeddings, and more.

Mature & widely used

FLINT is the work of dozens of contributors, spanning 15+ years of development. The upcoming FLINT 3.0 release comprises 8,000 documented functions, 3,500 test programs, and 900,000 lines of code.

FLINT runs on most common platforms, including Linux, macOS and Windows on typical hardware configurations. Several computer algebra systems rely on FLINT as a back-end library, including SageMath, Oscar, Singular, Macaulay2, Maple and Mathematica. Wrappers are also available for various programming languages, including Python and Julia.

At the research frontier

FLINT has been used for many large scale research computations (for example: A Trillion Triangles) and has been cited in hundreds of publications. FLINT's authors themselves have published more than 20 papers describing new algorithms first implemented within or on top of FLINT.

Efficient

FLINT is designed for all operand sizes, from single-word to multi-gigabyte. It implements many low-level optimisations and chooses automatically between basecase, intermediate, asymptotically fast and special-purpose algorithms depending on the size and structure of the problem. Many algorithms are fully parallel (multithreaded) and some key functions use SIMD acceleration.

Handles real numbers

FLINT has advanced support for real and complex numbers, implemented using ball arithmetic. It covers a variety of numerical functionality (polynomial arithmetic, transcendental functions, numerical integration, linear algebra, etc.) with arbitrary precision and with rigorous error bounds. FLINT also provides an exact (symbolic) model of real and complex numbers with the ability to decide equalities.

Developer-friendly

FLINT has a developer-friendly GMP-like C API which makes it easy to write performant and type-safe code with fine-grained control over in-place mutations, memory allocation, precision, conversions between representations, and algorithm parameters. FLINT also provides well-documented access to most of its internals. Finally, the FLINT project is developed openly in collaboration with the community, and welcomes contributions (feature requests, bug reports, patches, testing, documentation, general feedback) from anyone.

Note: this functionality is new in FLINT 3.0 and is due to merging the spin-off projects Arb, Antic and Calcium which were previously maintained as standalone libraries.

Now this functionality is also available in Haskell!

The modules in Flint provide a access to most of the functionality in flintlib. Many of the data structures have been translated to Haskell. Typically an object of type x_t in flint will be called X and can be created with a function name newX and a applied to a flint function with a withX function. E.g. the integers in flint with the type Fmpz will be created in the IO monad using newFmpz and used with the withFmpz function.

Synopsis

Documentation

Integers

Factorization of integers

Arithmtic and special functions for integers

Integers mod n

Rational numbers

APRCL primality testing

FFT

Quadratic sieve

Integers mod n

Groups and other structures

Number fields and algebraic numbers

Real and complex numbers

Real

Complex

Exact real and complex numbers

Partitions

Bernoulli numbers

Finite Fields

NMod

Zech

p-adic Numbers

Floating-point support code