Sage-Symbolics Making a new system for performing Calculus and - - PowerPoint PPT Presentation

sage symbolics making a new system for performing
SMART_READER_LITE
LIVE PREVIEW

Sage-Symbolics Making a new system for performing Calculus and - - PowerPoint PPT Presentation

Introduction Progress Benchmarks Future Plans Sage-Symbolics Making a new system for performing Calculus and Physics Gary Furnish August 6, 2008 Gary Furnish Sage Symbolics Introduction Progress Benchmarks Future Plans Introduction


slide-1
SLIDE 1

Introduction Progress Benchmarks Future Plans

Sage-Symbolics Making a new system for performing Calculus and Physics

Gary Furnish August 6, 2008

Gary Furnish Sage Symbolics

slide-2
SLIDE 2

Introduction Progress Benchmarks Future Plans

Introduction

Gary Furnish Sage Symbolics

slide-3
SLIDE 3

Introduction Progress Benchmarks Future Plans

Introduction

Sage needs a strong system for performing calculus in order to effectively compete with Mathematica and Maple.

Gary Furnish Sage Symbolics

slide-4
SLIDE 4

Introduction Progress Benchmarks Future Plans

Introduction

Sage needs a strong system for performing calculus in order to effectively compete with Mathematica and Maple. Sage currently uses Maxima through a pexpect interface.

Gary Furnish Sage Symbolics

slide-5
SLIDE 5

Introduction Progress Benchmarks Future Plans

Introduction

Sage needs a strong system for performing calculus in order to effectively compete with Mathematica and Maple. Sage currently uses Maxima through a pexpect interface. However pexpect is slow, especially for performing numerous small calculations.

Gary Furnish Sage Symbolics

slide-6
SLIDE 6

Introduction Progress Benchmarks Future Plans

Introduction

Sage needs a strong system for performing calculus in order to effectively compete with Mathematica and Maple. Sage currently uses Maxima through a pexpect interface. However pexpect is slow, especially for performing numerous small calculations. It is hard to extend Maxima as it is written in lisp.

Gary Furnish Sage Symbolics

slide-7
SLIDE 7

Introduction Progress Benchmarks Future Plans

Design Goals

Gary Furnish Sage Symbolics

slide-8
SLIDE 8

Introduction Progress Benchmarks Future Plans

Design Goals

Sage-Symbolics should be very fast.

Gary Furnish Sage Symbolics

slide-9
SLIDE 9

Introduction Progress Benchmarks Future Plans

Design Goals

Sage-Symbolics should be very fast. Sage-Symbolics should be maintainable.

Gary Furnish Sage Symbolics

slide-10
SLIDE 10

Introduction Progress Benchmarks Future Plans

Design Goals

Sage-Symbolics should be very fast. Sage-Symbolics should be maintainable. Sage-Symbolics should present a good platform to build more complicated symbolic algorithms off of.

Gary Furnish Sage Symbolics

slide-11
SLIDE 11

Introduction Progress Benchmarks Future Plans

Design Goals

Sage-Symbolics should be very fast. Sage-Symbolics should be maintainable. Sage-Symbolics should present a good platform to build more complicated symbolic algorithms off of. Most importantly, it must be easy to use.

Gary Furnish Sage Symbolics

slide-12
SLIDE 12

Introduction Progress Benchmarks Future Plans

More Design Goals

However, given an opportunity to start from scratch, we have a rare chance to do it right. Sage has a great mathematical type system (Coercion). It contains a built in knowledge of Rings, Modules, etc. We can use this to our advantage to design a significantly more powerful symbolic manipulation platform.

Gary Furnish Sage Symbolics

slide-13
SLIDE 13

Introduction Progress Benchmarks Future Plans

New Frontier

Mathematica and Maple don’t have something analagous to Coercion. Poor native differential geometry support in most general purpose CAS’s. No easy way to do noncommutative symbolics. No way to add new operations as first class objects.

Gary Furnish Sage Symbolics

slide-14
SLIDE 14

Introduction Progress Benchmarks Future Plans

New Frontier

Mathematica and Maple don’t have something analagous to Coercion. Poor native differential geometry support in most general purpose CAS’s. No easy way to do noncommutative symbolics. No way to add new operations as first class objects. Should we care?

Gary Furnish Sage Symbolics

slide-15
SLIDE 15

Introduction Progress Benchmarks Future Plans

Physics

Quantum Field Theory – Indexed and Tensorial expressions Quantum Mechanics – Noncommutative Expressions General Relativity – Differential Geometry Needs are only served by special case programs or code. No general purpose enviroment for all needs.

Gary Furnish Sage Symbolics

slide-16
SLIDE 16

Introduction Progress Benchmarks Future Plans

More Design Goals

Noncommutative symbolic manipulations the natural starting point. Commutative symbols are a special case Calculus is just a small fraction of what we have to support Support for arbitrary types of symbols... let X be a matrix Still has to be fast.

Gary Furnish Sage Symbolics

slide-17
SLIDE 17

Introduction Progress Benchmarks Future Plans

Progress

Noncommutative operations “just work” So do most calculus operations Native support for unevaluated functions. Native derivation Symbolic Matricies (but no RREF yet) Global Non-recursive pattern matching Fast (But it could be even faster)

Gary Furnish Sage Symbolics

slide-18
SLIDE 18

Introduction Progress Benchmarks Future Plans

Maxima Interface

Still using Maxima for complicated operations Integrals, Factorization, Summation, Laplace Assumptions don’t work yet, but are getting there. The Maxima interface is faster then it used to be. Unevaluated functions work better

Gary Furnish Sage Symbolics

slide-19
SLIDE 19

Introduction Progress Benchmarks Future Plans

f = 5*x*y*z +y**10*x expand(f+int(10000*random())) * (f+int(10000*random()))) Sympy: 12.9 ms Symbolics: 4.25 ms Maxima: 57.4 ms

Gary Furnish Sage Symbolics

slide-20
SLIDE 20

Introduction Progress Benchmarks Future Plans

f = 5*x*y*z +y**10*x expand(f+int(10000*random())) * (f+int(10000*random()))) Sympy: 12.9 ms Symbolics: 4.25 ms Maxima: 57.4 ms expand(f*(f+1) * (f+int(10000*random())) * (f+int(10000*random())) * (f+int(10000*random()))) Sympy: 76.4 ms Symbolics: 41.4 ms Maxima: 47.1 ms

Gary Furnish Sage Symbolics

slide-21
SLIDE 21

Introduction Progress Benchmarks Future Plans

expand(f*(f+1) * (f+int(10000*random())) * (f+int(10000*random())) * (f+int(10000*random())) * (f+int(10000*random())) * (f+int(10000*random())) * (f+int(10000*random())) Sympy: 379ms Symbolics: 113 ms Maxima: 93ms

Gary Furnish Sage Symbolics

slide-22
SLIDE 22

Introduction Progress Benchmarks Future Plans

expand(f*(f+1) * (f+int(10000*random())) * (f+int(10000*random())) * (f+int(10000*random())) * (f+int(10000*random())) * (f+int(10000*random())) * (f+int(10000*random())) Sympy: 379ms Symbolics: 113 ms Maxima: 93ms expand(f*(f+1) * (f+int(10000*random())) * (f+int(10000 * random())) * (f+int(10000*random())) * (f+int(10000*random())) * (f+int(10000*random())) * (f+int(10000*random())) * (f+int(10000*random()))) Symbolics: 171ms Maxima: 126 ms Mathematica: 4ms

Gary Furnish Sage Symbolics

slide-23
SLIDE 23

Introduction Progress Benchmarks Future Plans

expand(f*(f+1) * (f+int(10000*random())) * (f+int(10000*random())) * (f+int(10000*random())) * (f+int(10000*random())) * (f+int(10000*random())) * (f+int(10000*random())) Sympy: 379ms Symbolics: 113 ms Maxima: 93ms expand(f*(f+1) * (f+int(10000*random())) * (f+int(10000 * random())) * (f+int(10000*random())) * (f+int(10000*random())) * (f+int(10000*random())) * (f+int(10000*random())) * (f+int(10000*random()))) Symbolics: 171ms Maxima: 126 ms Mathematica: 4ms Maxima through Sage Sympy with caching enabled Sympy with caching disabled performs really poorly Sympy Core faster then symbolics right now*

Gary Furnish Sage Symbolics

slide-24
SLIDE 24

Introduction Progress Benchmarks Future Plans

Analysis

Profilers: Memory initialization expensive Use pools, help some via TPALLOC Real problem is cython autogenerated TPNEW Modify Cython to emit better code and link symbolics at once Alternatively hand written C TPNEW functions

Gary Furnish Sage Symbolics

slide-25
SLIDE 25

Introduction Progress Benchmarks Future Plans

Analysis

Noncommutative algebra detection code Solution: Seperate Noncommutative and Commutative multiplication classes

Gary Furnish Sage Symbolics

slide-26
SLIDE 26

Introduction Progress Benchmarks Future Plans

Analysis

Noncommutative algebra detection code Solution: Seperate Noncommutative and Commutative multiplication classes Excessive memory creation: Change multiplication class for commutative rings to store constant seprately Change multiplication classes to store powers without an additional class

Gary Furnish Sage Symbolics

slide-27
SLIDE 27

Introduction Progress Benchmarks Future Plans

Analysis

Not a flaw in the design – a consequence of wanting noncommutative symbolics from the start Can be fixed without too much trouble 1-3 order of magnitude speedup should be possible from these changes.

Gary Furnish Sage Symbolics

slide-28
SLIDE 28

Introduction Progress Benchmarks Future Plans

Near Term Goals (Next month)

Gary Furnish Sage Symbolics

slide-29
SLIDE 29

Introduction Progress Benchmarks Future Plans

Near Term Goals (Next month)

Write enough of an assumption engine so that Maxima assumptions work again (necessary for many integrals) Finish trig default simplifications Minimal piecewise function support (to current level of support) Symbolic polynomials should use libSingular Seperate out noncommutative and commutative cases for multiplication Optimize memory creation overhead if necessary for merge Write doctests, start formal review process

Gary Furnish Sage Symbolics

slide-30
SLIDE 30

Introduction Progress Benchmarks Future Plans

Future Plans

Switch all simplification to new pattern matching engine Full differential geometry support Optimize memory creation overhead (running theme) More advanced algorithms for addition/multiplication? Basic integration algorithms

Gary Furnish Sage Symbolics

slide-31
SLIDE 31

Introduction Progress Benchmarks Future Plans

Demoes

Now I will show some demoes of what I have done.

Gary Furnish Sage Symbolics

slide-32
SLIDE 32

Introduction Progress Benchmarks Future Plans

Questions

Questions?

Gary Furnish Sage Symbolics