10
Alan Edelman Mathematics Computer Science & AI Laboratories June 9, 2014 Jeff Bezanson, Stefan Karpinski, Viral Shah and may collaborators worldwide Try Julia/Ijulia today google: julia downloads 8pm room 4

Alan Edelman Mathematics Computer Science & AI Laboratories June 9, 2014 Jeff Bezanson, Stefan Karpinski, Viral Shah and may collaborators worldwide Try

Embed Size (px)

Citation preview

Page 1: Alan Edelman Mathematics Computer Science & AI Laboratories June 9, 2014 Jeff Bezanson, Stefan Karpinski, Viral Shah and may collaborators worldwide Try

Alan EdelmanMathematics

Computer Science & AI LaboratoriesJune 9, 2014

Jeff Bezanson, Stefan Karpinski, Viral Shah and may collaborators worldwide

Try Julia/Ijulia todaygoogle: julia downloads8pm room 4

Page 2: Alan Edelman Mathematics Computer Science & AI Laboratories June 9, 2014 Jeff Bezanson, Stefan Karpinski, Viral Shah and may collaborators worldwide Try

2/30

Stereotypes• Computer Scientists don’t take

derivatives• but computer scientists are great

at abstractions • Computational Scientists can’t

declare types• but computational scientists are

great at engineering simulations and numerical algorithms

Page 3: Alan Edelman Mathematics Computer Science & AI Laboratories June 9, 2014 Jeff Bezanson, Stefan Karpinski, Viral Shah and may collaborators worldwide Try

3

methods objects

Object-oriented programming with classes

What can I do with/to a thing?

top uppay fare

lose

buy

top uppay fare

lose

buy

pay farelose

buy

class-based OO

classes are morefundamentalthan methods

Page 4: Alan Edelman Mathematics Computer Science & AI Laboratories June 9, 2014 Jeff Bezanson, Stefan Karpinski, Viral Shah and may collaborators worldwide Try

4

Object-oriented programming with multi-methods

What can I do with/to a thing?

top up

pay fare

lose

buy

genericfunction

objectsmethods

multimethods

relationships betweenobjects and functions

Page 5: Alan Edelman Mathematics Computer Science & AI Laboratories June 9, 2014 Jeff Bezanson, Stefan Karpinski, Viral Shah and may collaborators worldwide Try

5

Multi-methods with type hierarchy

top up

pay fare

lose

buy

genericfunction

objectsmethods

rechargeablesubwaypass

single-usesubwayticket

is a subtype of

subwayticket

abstract object

Page 6: Alan Edelman Mathematics Computer Science & AI Laboratories June 9, 2014 Jeff Bezanson, Stefan Karpinski, Viral Shah and may collaborators worldwide Try

6

Poincaré quipped:“Mathematics is the art of giving the same name to different things.”

Technical computing is the art of applying operations to objects with the same name that represent different things.

-- The Julia Team

Abstractions

Page 7: Alan Edelman Mathematics Computer Science & AI Laboratories June 9, 2014 Jeff Bezanson, Stefan Karpinski, Viral Shah and may collaborators worldwide Try

7

Multi-methods for linear algebra

What can I do with/to a thing?

find eigenvalues and eigenvectors

find singular values

find singular values and vectors

find eigenvalues

genericfunction

objectsmethods

general matrix

symmetric tridiagonal matrix

bidiagonal matrix

Methods can take advantage of special matrix structures

eigvals

eigfact

svdvals

svdfact

Matrix

SymTridiagonal

Bidiagonal

Page 8: Alan Edelman Mathematics Computer Science & AI Laboratories June 9, 2014 Jeff Bezanson, Stefan Karpinski, Viral Shah and may collaborators worldwide Try

8/30

The “Two Language” Problem• As long as the developers’ language is harder than

the users language, technical computing will always be hindered

Page 9: Alan Edelman Mathematics Computer Science & AI Laboratories June 9, 2014 Jeff Bezanson, Stefan Karpinski, Viral Shah and may collaborators worldwide Try

9/30

What might you ask from your language?• A whole laundry list of easy to call functions:• http://julia.readthedocs.org/en/latest/packages/packag

elist/

• Performance• Can develop libraries• Flexibility• Parallelism• Abstractions• Easy to call other languages/unnecessary to call …

Page 10: Alan Edelman Mathematics Computer Science & AI Laboratories June 9, 2014 Jeff Bezanson, Stefan Karpinski, Viral Shah and may collaborators worldwide Try

10/30

Notebooks to demo

• What is multiple dispatch?• iterators• Inspired today• Parallel Tracy widom• Web server• Block SVD• Fractals• Linear Algebra Tutorial• The Colors of Chemistry