Sage and Sage-Combinat demo, LACIM 2010, Montreal -- Sage Reference Manual v4.5 system:sage
Arithmetic:
Symbolic calculations:
Statistics:
sage: plot(sin(x), -pi, pi, fill = ‘axis’)
Taylor approximation:
Type plot( and then press the TAB key:
Click on Help at the top of this page
There is also Live Documentation in which you can evaluate the examples.
Introspection:
Looking at the sources:
Here is a function that computes in pure Python:
Let us compare this with the Cython version:
A function to count the number of integer partitions with parts in a given set:
Let’s see how long it takes to find the number of partitions of 500 into odd parts:
Make two changes:
Surely two tiny changes in some Python code can’t make it much faster:
ToDo
Summary:
- Every mathematical object (element, set, category, ...) is modeled by a Python object</li>
- All combinatorial classes share a uniform interface</li>
Summary:
- Basic combinatorial classes + constructions give a flexible toolbox
- This is made possible by uniform interfaces
- Lazy algorithms and data structures for large / infinite sets (iterators, ...)
Integer lists:
Fibonacci words:
Binary trees:
Juggling automaton:
This example used PALP and J-mol
An infinite periodic word:
The Fibonacci word:
The Thue-Morse word:
A random word over the alphabet [0, 1] of length 1000:
The fixed point of a morphism:
Their prefixes of length 1000:
A comparison of their complexity function:
Construction of a permutation and builds its associated Rauzy diagram:
Let us now construct a self-similar interval exchange transformation associated to a loop in the Rauzy diagram:
We can plot it and all its power:
Check the self similarity of T:
And get the symbolic coding of 0 using the substitution associated to the path:
Affine Weyl groups:
Classical basis:
Jack polynomials:
Macdonald polynomials: