An Introduction to Specialised Computer Algebra Systems

A historical perspective in Celestial Mechanics Algebraic structures Polynomial representations Data structures for polynomials An Introduction to Sp...
Author: Griffin Miles
3 downloads 2 Views 954KB Size
A historical perspective in Celestial Mechanics Algebraic structures Polynomial representations Data structures for polynomials

An Introduction to Specialised Computer Algebra Systems Francesco Biscani Advanced Concepts Team European Space Agency (ESTEC)

Course on Differential Equations and Computer Algebra Estella, Spain – October 29-30, 2010

Francesco Biscani

An Introduction to Specialised Computer Algebra Systems

A historical perspective in Celestial Mechanics Algebraic structures Polynomial representations Data structures for polynomials

Outline

1

A historical perspective in Celestial Mechanics

2

Algebraic structures

3

Polynomial representations

4

Data structures for polynomials

Francesco Biscani

An Introduction to Specialised Computer Algebra Systems

A historical perspective in Celestial Mechanics Algebraic structures Polynomial representations Data structures for polynomials

Outline

1

A historical perspective in Celestial Mechanics

2

Algebraic structures

3

Polynomial representations

4

Data structures for polynomials

Francesco Biscani

An Introduction to Specialised Computer Algebra Systems

A historical perspective in Celestial Mechanics Algebraic structures Polynomial representations Data structures for polynomials

Human Algebra Systems

Euler: lunar theory (incredibili stvdio atqve indefesso labore) Delaunay: lunar theory based on Hamiltonian formalism Le Verrier: analytical development of the planetary disturbing function, discovery of Neptune Hill-Brown: lunar theory Doodson: analytical development of the tide-generating potential

Francesco Biscani

An Introduction to Specialised Computer Algebra Systems

A historical perspective in Celestial Mechanics Algebraic structures Polynomial representations Data structures for polynomials

The Computer Age

Herget & Musen (1959) Broucke & Garthwaite (1969) Deprit & Rom (1971) ... Ivanova (2001) San-Juan & Abad (2001) Laskar & Gastineau (2005,2010)

Francesco Biscani

An Introduction to Specialised Computer Algebra Systems

A historical perspective in Celestial Mechanics Algebraic structures Polynomial representations Data structures for polynomials

Why Specialised Manipulators?

Pros Performance (up to multiple orders of magnitude) Capabilities (e.g., truncated products) Algorithms Cons Limited to specific contexts Steeper learning curve Availability, documentation, etc.

Francesco Biscani

An Introduction to Specialised Computer Algebra Systems

A historical perspective in Celestial Mechanics Algebraic structures Polynomial representations Data structures for polynomials

Outline

1

A historical perspective in Celestial Mechanics

2

Algebraic structures

3

Polynomial representations

4

Data structures for polynomials

Francesco Biscani

An Introduction to Specialised Computer Algebra Systems

A historical perspective in Celestial Mechanics Algebraic structures Polynomial representations Data structures for polynomials

Manipulation of what? Polynomials: X

Ci pi

i

Fourier series: X i

  cos Ci (i · t) sin

Poisson series: XX i

j

  cos Ci,j p (i · t) sin j

Echeloned Poisson series:   XXX Y cos Ci,j,k pk (l · d)δj,l (i · t) sin i

j

k

Francesco Biscani

l

An Introduction to Specialised Computer Algebra Systems

A historical perspective in Celestial Mechanics Algebraic structures Polynomial representations Data structures for polynomials

Why polynomials?

Arguably one of the simplest algebraic structures Widely used in many areas of mathematics, science and engineering Well studied (e.g., polynomial division, GCD, Gr¨obner basis, etc.) From the computer algebra POV, they easily extend to power series, Laurent-Puiseux series, Fourier series, etc.

Francesco Biscani

An Introduction to Specialised Computer Algebra Systems

A historical perspective in Celestial Mechanics Algebraic structures Polynomial representations Data structures for polynomials

Outline

1

A historical perspective in Celestial Mechanics

2

Algebraic structures

3

Polynomial representations

4

Data structures for polynomials

Francesco Biscani

An Introduction to Specialised Computer Algebra Systems

A historical perspective in Celestial Mechanics Algebraic structures Polynomial representations Data structures for polynomials

Representing polynomials

Questions to answer: which coefficients types? which exponents types? which operations do I need to perform? And ultimately: which data structure(s)?

Francesco Biscani

An Introduction to Specialised Computer Algebra Systems

A historical perspective in Celestial Mechanics Algebraic structures Polynomial representations Data structures for polynomials

The univariate case Dense vs sparse P [C , x] =

n X

Ci x i

i=0

Dense representation: all monomials are explicitly stored up to degree n: C0

C1

...

Cn

Sparse representation: only monomials with non-zero coefficients are stored. (Ci1 , i1 ) −→ (Ci2 , i2 ) −→ (Ci3 , i3 ) −→ . . . Francesco Biscani

An Introduction to Specialised Computer Algebra Systems

A historical perspective in Celestial Mechanics Algebraic structures Polynomial representations Data structures for polynomials

The multivariate case Recursive vs distributed P [C , (x1 , . . . , xn )] Recursive representation: a multivariate polynomial is a univariate polynomial with multivariate polynomials as coefficients: P [C , (x1 , . . . , xn )] = P [P [C , (x2 , . . . , xn )] , x1 ] Distributed representation: a multivariate polynomial is a collection of multivariate monomials: X P [C , (x1 , . . . , xn )] = Cj xj j∈Jn

Francesco Biscani

An Introduction to Specialised Computer Algebra Systems

A historical perspective in Celestial Mechanics Algebraic structures Polynomial representations Data structures for polynomials

Summary

Bi-dimensional choice space: (dense,sparse) × (recursive,distributed) Each possibility has its pros & cons Specialised CAS adopt various different representations, depending on the purposes

Francesco Biscani

An Introduction to Specialised Computer Algebra Systems

A historical perspective in Celestial Mechanics Algebraic structures Polynomial representations Data structures for polynomials

Outline

1

A historical perspective in Celestial Mechanics

2

Algebraic structures

3

Polynomial representations

4

Data structures for polynomials

Francesco Biscani

An Introduction to Specialised Computer Algebra Systems

A historical perspective in Celestial Mechanics Algebraic structures Polynomial representations Data structures for polynomials

Vector

set of contiguous memory locations storing coefficients simplest data structure lowest memory overhead optimal memory access patterns random-access container very good for univariate and dense polynomials wasteful for multivariate and sparse polynomials: P(x) = 1 + x 1000

Francesco Biscani

An Introduction to Specialised Computer Algebra Systems

A historical perspective in Celestial Mechanics Algebraic structures Polynomial representations Data structures for polynomials

Linked list

chain of (coefficient,exponent) pairs (Ci1 , i1 ) −→ (Ci2 , i2 ) −→ (Ci3 , i3 ) −→ . . . each node of the list contains coefficient, exponent and a pointer to the next node space overhead with respect to vectors in the general case useful for sparse and multivariate polynomials search for a specific term is O(n) suboptimal memory access patterns

Francesco Biscani

An Introduction to Specialised Computer Algebra Systems

A historical perspective in Celestial Mechanics Algebraic structures Polynomial representations Data structures for polynomials

Binary search tree

tree structure that keeps node ordered according to a user-defined criterion each node has at most two children, one “greater-than”, the other “less-than” the parent most operations have O(log n) complexity useful for sparse and multivariate polynomials often-used ordering criterions: total degree, lexicographic, reverse lexicographic same suboptimal memory access patterns as the linked list

Francesco Biscani

An Introduction to Specialised Computer Algebra Systems

A historical perspective in Celestial Mechanics Algebraic structures Polynomial representations Data structures for polynomials

Hashing containers

Francesco Biscani

An Introduction to Specialised Computer Algebra Systems

A historical perspective in Celestial Mechanics Algebraic structures Polynomial representations Data structures for polynomials

Hashing containers (cont.)

best theoretical performances: amortized O(1) average complexity for search, insertion, deletion lots of details to make them work right: hash function, collision resolution, resizing policy, etc. unordered containers standard implementations have poor memory access patterns effective for multivariate and sparse polynomials

Francesco Biscani

An Introduction to Specialised Computer Algebra Systems

A historical perspective in Celestial Mechanics Algebraic structures Polynomial representations Data structures for polynomials

Many possibilities and variations

bloom filters, tries (including burst tries, Patricia tries and other variations), skip lists, heaps, geobuckets, cuckoo hashing, ... http://en.wikipedia.org/wiki/List_of_data_structures

Francesco Biscani

An Introduction to Specialised Computer Algebra Systems