Python for Scientific Computing

Slides:



Advertisements
Similar presentations
Guy Griffiths. General purpose interpreted programming language Widely used by scientists and programmers of all stripes Supported by many 3 rd -party.
Advertisements

Script Languages in Science CCOM Student Seminar Series Kurt Schwehr 12-Nov-2008.
Python Introduction.
Dr. Chris Musselle – Consultant R Meets Julia Dr Chris Musselle.
Introduction to MATLAB Session 1 Prepared By: Dina El Kholy Ahmed Dalal Statistics Course – Biomedical Department -year 3.
You can make this in matlab!. Matlab Introduction and Matrices.
Company Overview for GDF Suez December 29, Enthought’s Business Enthought provides products and consulting services for scientific software solutions.
Introduction to Python By Neil Cook Twitter: njcuk Slides/Notes:
Introduction to Julia: Why are we doing this to you? (Fall 2015) Steven G. Johnson, MIT Applied Math MIT classes , 18.06, ,
Scientific Computing Beyond Matlab Nov 19, 2012 Jason Su.
Computational Physics Introduction 3/30/11. Goals  Calculate solutions to physics problems  All physics problems can be formulated mathematically. 
Scientific Computing with NumPy & SciPy NumPy Installation and Documentation  Not much on the home page—don’t buy the guide, it’s.
1 Computer Programming (ECGD2102 ) Using MATLAB Instructor: Eng. Eman Al.Swaity Lecture (1): Introduction.
FLUKA GUI Status FLUKA Meeting CERN, 10/7/2006.
Scientific Python Numpy Linear Algebra Matrices Scipy Signal Processing Optimization IPython Interactive Console Matplotlib Plotting Sympy Symbolic Math.
Linear Algebra Libraries: BLAS, LAPACK, ScaLAPACK, PLASMA, MAGMA
Ch 1. A Python Q&A Session. Why do people use Python? Software Quality Developer productivity Program portability Support Libraries Component integration.
CIS 601 Fall 2003 Introduction to MATLAB Longin Jan Latecki Based on the lectures of Rolf Lakaemper and David Young.
COMP 4332 Tutorial 1 Feb 16 WANG YUE Tutorial Overview & Learning Python.
Python & NetworkX Youn-Hee Han
CIS 595 MATLAB First Impressions. MATLAB This introduction will give Some basic ideas Main advantages and drawbacks compared to other languages.
Linear Algebra Libraries: BLAS, LAPACK, ScaLAPACK, PLASMA, MAGMA Shirley Moore CPS5401 Fall 2013 svmoore.pbworks.com November 12, 2012.
NumPy, SciPy, Mpi4Py Shepelenko Olha. History of NumPy Originally, Python was not developed as a language for numerical computing. However, due to its.
SimTK 1.0 Workshop Downloads Jack Middleton March 20, 2008.
Python – It's great By J J M Kilner. Introduction to Python.
Python Scripting for Computational Science CPS 5401 Fall 2014 Shirley Moore, Instructor October 6,
Python: powerful interpreted language
DOE/Office of Science/ASCR (Sandia National Laboratories)
PH2150 Scientific Computing Skills
IBM Predictive Analytics Virtual Users’ Group Meeting March 30, 2016
Matlab.
CSC391/691 Intro to OpenCV Dr. Rongzhong Li Fall 2016
Chapter 1 Introduction.
Basic 1964 PC general purpose Imperative Small Easy to use.
PH2150 Scientific Computing Skills
Software for scientific calculations
Chapter 1 Introduction.
National Scientific Library at Tbilisi State University
Compiling Dynamic Data Structures in Python to Enable the Use of Multi-core and Many-core Libraries Bin Ren, Gagan Agrawal 9/18/2018.
INTRODUCTION TO BASIC MATLAB
MATLAB DENC 2533 ECADD LAB 9.
Prepared by Kimberly Sayre and Jinbo Bi
AUTOMATED SESSION PLANNING. In the present world, everything has become automated. By, a click everything is being processed. But the preparation of the.
Henning Schulzrinne Advanced Programming
Introduction to programming languages, Algorithms & flowcharts
Introduction to MATLAB
The Future of Fortran is Bright …
CSE Social Media & Text Analytics
Part I – Matlab Basics.
High Level Programming Languages
Compiler Back End Panel
Use of Mathematics using Technology (Maltlab)
Brief Intro to Python for Statistics
Matlab tutorial course
MXNet Internals Cyrus M. Vahid, Principal Solutions Architect,
Compiler Back End Panel
What's New in eCognition 9
Communication and Coding Theory Lab(CS491)
Scientific Python Introduction
Scipy 'Ecosystem' containing a variety of scientific packages including iPython, numpy, matplotlib, and pandas. numpy is both a system for constructing.
Simulation And Modeling
Introduction to Matlab
Chapter 1: Programming Basics, Python History and Program Components
Python for Data Analysis
Introduction To MATLAB
Collecting, Analyzing, and Visualizing Data with Python Part I
What's New in eCognition 9
Igor Stančin, Alan Jović to: {igor.stancin,
PYTHON - VARIABLES AND OPERATORS
Presentation transcript:

Python for Scientific Computing Wim R.M. Cardoen Center for High Performance Computing wim.cardoen@utah.edu Fall 2010

Overview Python NumPy SciPy Matplotlib Python using C/C++ and Fortran IPython 11/18/2018

Why Python? High-level interpreted language Very clear syntax =>easy-to-read Open source Platform independent Large number of libraries Binding to all standard GUI kits (TkInter, Qt, ..) Powerful automated testing tools Easily integrated with C/C++, and Fortran Actively used and extended by scientists 11/18/2018

Python Language Clear syntax -> easy to understand Indentation for blocks Use of namespace, exception handling Automatic doc.: doc strings & pydoc Dynamic typing Supports both procedural & OO approach Easy code testing Garbage collecting Functional programming, iterators,… 11/18/2018

11/18/2018

11/18/2018

Numpy:Why? The “trad.” Python list: can contain data of whatever type => memory el. may have different sizes the list can grow & shrink dynamically passing through list by loops/iterators => not very efficient for numerical calculations. We need something more efficient: python + fast math=> NumPy 11/18/2018

Multi-dimensional array object i.e. ndarray 1. homogeneous (all have the same type) 2. indexing/slicing 3. vectorization 4. broadcasting Derived objects such as masked arrays, matrices 1. matrix: derived from ndarray: always 2D attributes: T(transpose), H (hermit. conj.), I (invert) 2. masked arrays: missing or invalid entries Universal func.: operates on ndarrays in el-by-el fashion NumPy: basic toolkit for other packages e.g. SciPy,... 11/18/2018

11/18/2018

NumPy and Scipy require: Fast Linear Algebra routines: What’s under the hood? NumPy and Scipy require: Fast Linear Algebra routines: BLAS, LAPACK / ATLAS / GOTO-BLAS FFT Routines: routines for computing the DFT UMFPACK: routines for solving unsymmetric sparse linear systems Alternative: MKL (Intel) 11/18/2018

SciPy collection of mathematical algorithms contains several subpackages, e.g.: scipy.linalg scipy.fftpack scipy.optimize scipy.integrate scipy.interpolate scipy.special … 11/18/2018

11/18/2018

11/18/2018

11/18/2018

11/18/2018

11/18/2018

11/18/2018

11/18/2018

11/18/2018

11/18/2018

MatplotLib produces publication quality 2D plots supports Latex commands >= 0.99: inclusion of mplot3D (3D pics) Note: Mayavi: 3D Scientific Data Visualization http://code.enthought.com/projects/mayavi/ 11/18/2018

11/18/2018

11/18/2018

11/18/2018

11/18/2018

11/18/2018

11/18/2018

Source: http://en.wikipedia.org/wiki/Delaunay_triangulation 11/18/2018

Interfacing C/C++ and Python Approaches for C/C++: SWIG: Simplied Wrapper & Interface Generator Weave: inclusion C/C++ code in Python PyInline: inline other languages in Python Pyrex: python with C-data types Approaches for Fortan: f2py f2py -c --fcompiler=gfortran -m essai essai.f90 import essai essai.trial(13) # subroutine trial(x) defined in “essai.f90” 11/18/2018

11/18/2018

11/18/2018

11/18/2018

11/18/2018

Ipython Enhanced interactive Python shell TAB-completion explore objects using ? %run command debug python script output/input cache history Suppress output call system commands … 11/18/2018

Additional packages MPI: MPI4PY SymPy: Symbolic Math PIL: Python Imaging Library Mayavi Interactive 3D Visualization PyMol : 3D Molecular Viewer NLopt: Non-linear optimization 11/18/2018

Links: http://www.python.org/ http://numpy.scipy.org http://www.scipy.org http://matplotlib.sourceforge.net http://ipython.scipy.org 11/18/2018