William Hart

Nemo: a computer algebra package for Julia

Introducing

A computer algebra package for the Julia programming language. http://nemocas.org/ William Hart

Nemo: a computer algebra package for Julia

Background 2006 2010 2013 2014 2015 2015 2016

David Harvey and I began the Flint C library for fast arithmetic Fredrik Johansson, Sebastian Pancratz and I began Flint 2, complete rewrite of Flint Claus Fieker and I began Antic C library for number eld element arithmetic Claus Fieker, Tommy Hofmann, Fredrik Johansson and I began Nemo generics Oleksandr Motsak and I began Singular.jl package in Julia Tommy Hofmann and Claus Fieker began Hecke algebraic number theory package e7.6m grant for computer algebra, will fund OSCAR computer algebra system William Hart

Nemo: a computer algebra package for Julia

New features in Flint I

LGPL license

William Hart

Nemo: a computer algebra package for Julia

New features in Flint I I

LGPL license Exception system

William Hart

Nemo: a computer algebra package for Julia

New features in Flint I I I

LGPL license Exception system Quadratic sieve factorisation

William Hart

Nemo: a computer algebra package for Julia

New features in Flint I I I I

LGPL license Exception system Quadratic sieve factorisation Elliptic curve factorisation

William Hart

Nemo: a computer algebra package for Julia

New features in Flint I I I I I

LGPL license Exception system Quadratic sieve factorisation Elliptic curve factorisation APRCL primality test

William Hart

Nemo: a computer algebra package for Julia

New features in Flint I I I I I I

LGPL license Exception system Quadratic sieve factorisation Elliptic curve factorisation APRCL primality test Parallelised FFT

William Hart

Nemo: a computer algebra package for Julia

New features in Flint I I I I I I I

LGPL license Exception system Quadratic sieve factorisation Elliptic curve factorisation APRCL primality test Parallelised FFT Howell form

William Hart

Nemo: a computer algebra package for Julia

New features in Flint I I I I I I I I

LGPL license Exception system Quadratic sieve factorisation Elliptic curve factorisation APRCL primality test Parallelised FFT Howell form Characteristic and minimal polynomial

William Hart

Nemo: a computer algebra package for Julia

New features in Flint I I I I I I I I I

LGPL license Exception system Quadratic sieve factorisation Elliptic curve factorisation APRCL primality test Parallelised FFT Howell form Characteristic and minimal polynomial van Hoeij factorisation for Z[x ]

William Hart

Nemo: a computer algebra package for Julia

New features in Flint I I I I I I I I I I

LGPL license Exception system Quadratic sieve factorisation Elliptic curve factorisation APRCL primality test Parallelised FFT Howell form Characteristic and minimal polynomial van Hoeij factorisation for Z[x ] Multivariate polynomial arithmetic Z[x , y , z , . . .] William Hart

Nemo: a computer algebra package for Julia

Integer factorisation : Quadratic sieve

Table : Quadratic sieve timings

Digits 50 59 68 77 83

Pari/GP 0.43 3.8 38 257 2200

Flint (1 core) 0.55 3.0 21 140 1500

William Hart

Flint (4 cores) 0.39 1.7 14 52 540

Nemo: a computer algebra package for Julia

APRCL primality test timings

William Hart

Nemo: a computer algebra package for Julia

FFT: Integer and polynomial multiplication Table : FFT timings

Words 110k 360k 1.3m 4.6m 26m 120m 500m

1 core 0.07s 0.3s 1.1s 4.5s 28s 140s 800s William Hart

4 cores 0.05s 0.1 0.4s 1.5s 9s 48s 240s

8 cores 0.05s 0.1s 0.3s 1.0s 6s 33s 150s

Nemo: a computer algebra package for Julia

Characteristic and minimal polynomial

Table : Charpoly and minpoly timings

Op Sage 6.9 Pari 2.7.4 Magma 2.21-4 Giac 1.2.2 Flint Charpoly 0.2s 0.6s 0.06s 0.06s 0.04s Minpoly 0.07s >160 hrs 0.05s 0.06s 0.04s for 80 × 80 matrix over Z with entries in [−20, 20] and minpoly of degree 40. William Hart

Nemo: a computer algebra package for Julia

Multivariate multiplication Table : Dense Fateman multiply bench

n 5 10 15 20 25 30 4 variables

Sage 0.008s 0.56s 10s 76s 430s 1800s

Singular 0.001s 0.18s 5.6s 66s 410s 1500s

William Hart

Magma 0.002s 0.12s 1.9s 16s 98s 440s

Giac 0.0002s 0.006s 0.11s 0.62s 2.8s 14s

Flint 0.0002s 0.004s 0.045s 0.50s 2.3s 10s

Nemo: a computer algebra package for Julia

Multivariate multiplication Table : Sparse Pearce multiply bench

n 4 6 8 10 12 14 16 5 variables

Sage 0.01s 0.20s 2.0s 11s 57s 210s 790s

Singular 0.003s 0.08s 1.4s 9.5s 38s 160s 510s

William Hart

Magma 0.006s 0.08s 0.68s 3.0s 11s 37s 94s

Giac 0.004s 0.03s 0.28s 1.5s 4.8s 14s 39s

Flint 0.002s 0.02s 0.12s 0.55s 2.5s 11s 26s

Nemo: a computer algebra package for Julia

Exact quotient Table : Dense quotient only

n 5 10 15 20 25 30 4 variables

Sage 0.02s 1.1s 28s 340s 2500s

Singular 0.003s 0.11s 1.5s 19s 130s 470s

Magma 0.002s 0.16s 3.5s 35s 210s 830s

William Hart

Giac 0.0002s 0.0039s 0.049 0.25s 1.1s 6.0s

Flint 0.0001s 0.0022s 0.022s 0.15s 0.93s 3.6s

Nemo: a computer algebra package for Julia

Exact quotient Table : Sparse quotient only

n 4 6 8 10 12 14 16 5 variables

Sage 0.49s 107s

Singular 0.02s 0.24s 1.6s 6.7s 26s 98s 280s

William Hart

Magma 0.005s 0.17s 3.1s 27s 140s 630s 2300s

Giac 0.001s 0.014s 0.12s 0.93s 2.5s 8.0s 22s

Flint 0.0008s 0.010s 0.068s 0.34s 1.7s 6.7s 19s

Nemo: a computer algebra package for Julia

Divisibility testing Table : Dense divisibility test with quotient

n Sage Singular 5 0.02s 0.006s 10 1.1s 0.56s 15 28s 15s 20 340s 150s 25 2500s 840s 30 3100s 4 variables, returns quotient William Hart

Magma 0.002s 0.16s 3.3s 31s 200s 830s

Giac 0.001s 0.05s 0.15s 0.90s 4.1s 21s

Flint 0.0005s 0.020s 0.054s 0.48s 2.3s 11s

Nemo: a computer algebra package for Julia

Divisibility testing Table : Sparse divisibility test with quotient

n Sage Singular 4 0.49s 0.03s 6 107s 0.54s 8 6.6s 10 38s 12 160s 14 600s 16 1900s 5 variables, returns quotient William Hart

Magma 0.005s 0.17s 3.1s 27s 140s 630s 2300s

Giac 0.002s 0.024s 0.19s 1.3s 4.3s 14s 40s

Flint 0.002s 0.021s 0.15s 0.69s 2.8s 9.0s 26s

Nemo: a computer algebra package for Julia

Language for generic programming In 2010 I started looking for a language for generic programming:

William Hart

Nemo: a computer algebra package for Julia

Language for generic programming In 2010 I started looking for a language for generic programming: Support for Windows, Linux, Mac I

William Hart

Nemo: a computer algebra package for Julia

Language for generic programming In 2010 I started looking for a language for generic programming: Support for Windows, Linux, Mac 64 bit integers and double precision oats I

I

William Hart

Nemo: a computer algebra package for Julia

Language for generic programming In 2010 I started looking for a language for generic programming: Support for Windows, Linux, Mac 64 bit integers and double precision oats Console/REPL mode I

I I

William Hart

Nemo: a computer algebra package for Julia

Language for generic programming In 2010 I started looking for a language for generic programming: Support for Windows, Linux, Mac 64 bit integers and double precision oats Console/REPL mode Operator overloading I

I I I

William Hart

Nemo: a computer algebra package for Julia

Language for generic programming In 2010 I started looking for a language for generic programming: Support for Windows, Linux, Mac 64 bit integers and double precision oats Console/REPL mode Operator overloading Fast generics and metaprogramming I

I I I

I

William Hart

Nemo: a computer algebra package for Julia

Language for generic programming In 2010 I started looking for a language for generic programming: Support for Windows, Linux, Mac 64 bit integers and double precision oats Console/REPL mode Operator overloading Fast generics and metaprogramming Maintained and popular I

I I I

I

I

William Hart

Nemo: a computer algebra package for Julia

Language for generic programming In 2010 I started looking for a language for generic programming: Support for Windows, Linux, Mac 64 bit integers and double precision oats Console/REPL mode Operator overloading Fast generics and metaprogramming Maintained and popular Open source I

I I I

I

I

I

William Hart

Nemo: a computer algebra package for Julia

Language for generic programming In 2010 I started looking for a language for generic programming: Support for Windows, Linux, Mac 64 bit integers and double precision oats Console/REPL mode Operator overloading Fast generics and metaprogramming Maintained and popular Open source Imperative syntax I

I I I

I

I

I

I

William Hart

Nemo: a computer algebra package for Julia

Language for generic programming In 2010 I started looking for a language for generic programming: Support for Windows, Linux, Mac 64 bit integers and double precision oats Console/REPL mode Operator overloading Fast generics and metaprogramming Maintained and popular Open source Imperative syntax Garbage collected I

I I I

I

I

I

I

I

William Hart

Nemo: a computer algebra package for Julia

Language for generic programming In 2010 I started looking for a language for generic programming: Support for Windows, Linux, Mac 64 bit integers and double precision oats Console/REPL mode Operator overloading Fast generics and metaprogramming Maintained and popular Open source Imperative syntax Garbage collected Easy/ecient C interop I

I I I

I

I

I

I

I

I

William Hart

Nemo: a computer algebra package for Julia

Ecient generics

William Hart

Nemo: a computer algebra package for Julia

Ecient generics

William Hart

Nemo: a computer algebra package for Julia

William Hart

Nemo: a computer algebra package for Julia

I I I I I I

JIT compilation : near C performance. Designed by mathematically minded people. Open Source (MIT License). Actively developed since 2009. Supports Windows, OSX, Linux, BSD. Friendly C/Python-like (imperative) syntax. William Hart

Nemo: a computer algebra package for Julia

Julia is polymorphic: gcd ( a : : I n t ,

b : : Int )

gcd ( a : : B i g I n t , g c d {T <:

b : : BigInt )

F i e l d } ( a : : P o l y {T} , b : : P o l y {T} )

William Hart

Nemo: a computer algebra package for Julia

Julia is polymorphic: gcd ( a : : I n t ,

b : : Int )

gcd ( a : : B i g I n t , g c d {T <:

b : : BigInt )

F i e l d } ( a : : P o l y {T} , b : : P o l y {T} )

Julia supports multimethods: ∗( a : : ∗( a : :

Int ,

b : : Matrix { I n t })

Matrix { I n t } , b : : I n t )

William Hart

Nemo: a computer algebra package for Julia

Julia is polymorphic: gcd ( a : : I n t ,

b : : Int )

gcd ( a : : B i g I n t , g c d {T <:

b : : BigInt )

F i e l d } ( a : : P o l y {T} , b : : P o l y {T} )

Julia supports multimethods: ∗( a : : ∗( a : :

Int ,

b : : Matrix { I n t })

Matrix { I n t } , b : : I n t )

Julia supports triangular dispatch: ∗ {T

<: Q u o t i e n t R i n g ,

S <: P o l y {T} } ( x : : T ,

William Hart

y : : S)

Nemo: a computer algebra package for Julia

Julia supports coercion in a natural way: +{T <: Domain } ( a : : L a u r e n t {T} , b : : S e r i e s { F r a c t i o n F i e l d {T} } )

William Hart

Nemo: a computer algebra package for Julia

Julia supports coercion in a natural way: +{T <: Domain } ( a : : L a u r e n t {T} , b : : S e r i e s { F r a c t i o n F i e l d {T} } )

Julia supports: Custom array indexing Custom printing of objects Custom promotion rules and conversions I I I

William Hart

Nemo: a computer algebra package for Julia

Julia supports coercion in a natural way: +{T <: Domain } ( a : : L a u r e n t {T} , b : : S e r i e s { F r a c t i o n F i e l d {T} } )

Julia supports: Custom array indexing Custom printing of objects Custom promotion rules and conversions Coming soon in Julia: Traits I I I

I

William Hart

Nemo: a computer algebra package for Julia

William Hart

Nemo: a computer algebra package for Julia

Interfaces to C libraries: Flint I

William Hart

Nemo: a computer algebra package for Julia

Interfaces to C libraries: Flint Arb I

I

William Hart

Nemo: a computer algebra package for Julia

Interfaces to C libraries: Flint Arb Antic I

I

I

William Hart

Nemo: a computer algebra package for Julia

Interfaces to C libraries: Flint Arb Antic Singular kernel (via Singular.jl) I

I

I

I

William Hart

Nemo: a computer algebra package for Julia

Interfaces to C libraries: Flint Arb Antic Singular kernel (via Singular.jl) Generic algorithms: Residue rings I

I

I

I

I

William Hart

Nemo: a computer algebra package for Julia

Interfaces to C libraries: Flint Arb Antic Singular kernel (via Singular.jl) Generic algorithms: Residue rings Fraction elds I

I

I

I

I

I

William Hart

Nemo: a computer algebra package for Julia

Interfaces to C libraries: Flint Arb Antic Singular kernel (via Singular.jl) Generic algorithms: Residue rings Fraction elds Dense univariate polynomials I

I

I

I

I

I

I

William Hart

Nemo: a computer algebra package for Julia

Interfaces to C libraries: Flint Arb Antic Singular kernel (via Singular.jl) Generic algorithms: Residue rings Fraction elds Dense univariate polynomials Sparse distributed multivariate polynomials I

I

I

I

I

I

I

I

William Hart

Nemo: a computer algebra package for Julia

Interfaces to C libraries: Flint Arb Antic Singular kernel (via Singular.jl) Generic algorithms: Residue rings Fraction elds Dense univariate polynomials Sparse distributed multivariate polynomials Dense linear algebra I

I

I

I

I

I

I

I

I

William Hart

Nemo: a computer algebra package for Julia

Interfaces to C libraries: Flint Arb Antic Singular kernel (via Singular.jl) Generic algorithms: Residue rings Fraction elds Dense univariate polynomials Sparse distributed multivariate polynomials Dense linear algebra Power series : absolute and relative I

I

I

I

I

I

I

I

I

I

William Hart

Nemo: a computer algebra package for Julia

Interfaces to C libraries: Flint Arb Antic Singular kernel (via Singular.jl) Generic algorithms: Residue rings Fraction elds Dense univariate polynomials Sparse distributed multivariate polynomials Dense linear algebra Power series : absolute and relative Permutation groups I

I

I

I

I

I

I

I

I

I

I

William Hart

Nemo: a computer algebra package for Julia

Hecke

http://www.github.com/thofma/Hecke.git Orders and ideals in absolute number elds Fast ideal and element arithmetic in absolute number elds Veried computations with approximations using interval arithmetic whenever necessary (e.g. computation with embeddings or residue computation of Dedekind zeta functions) Sparse linear algebra over Z Class and unit group computation Pseudo-Hermite normal form for modules over Dedekind domains Beginnings of class eld theory and relative extensions I I I

I I I

I

William Hart

Nemo: a computer algebra package for Julia

Future plans: Global function elds Class formations and more Galois cohomology Galois module structure Noncommutative algebras and orders I

I I I

William Hart

Nemo: a computer algebra package for Julia

Thank You

http://nemocas.org/

William Hart

Nemo: a computer algebra package for Julia