initial upload

This commit is contained in:
2025-10-21 11:20:44 +08:00
parent ad1b18ba06
commit 4333398dbe
131 changed files with 124404 additions and 0 deletions

35
scientific-computing-1/.gitignore vendored Normal file
View File

@@ -0,0 +1,35 @@
*.py[cod]
# C extensions
*.so
# Packages
*.egg
*.egg-info
dist
build
eggs
parts
bin
var
sdist
develop-eggs
.installed.cfg
lib
lib64
# Installer logs
pip-log.txt
# Unit test / coverage reports
.coverage
.tox
nosetests.xml
# Translations
*.mo
# Mr Developer
.mr.developer.cfg
.project
.pydevproject

View File

@@ -0,0 +1,643 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Introduction to scientific computing with Python"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"J.R. Johansson (jrjohansson at gmail.com)\n",
"\n",
"The latest version of this [IPython notebook](http://ipython.org/notebook.html) lecture is available at [http://github.com/jrjohansson/scientific-python-lectures](http://github.com/jrjohansson/scientific-python-lectures).\n",
"\n",
"The other notebooks in this lecture series are indexed at [http://jrjohansson.github.io](http://jrjohansson.github.io)."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## The role of computing in science"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Science has traditionally been divided into experimental and theoretical disciplines, but during the last several decades computing has emerged as a very important part of science. Scientific computing is often closely related to theory, but it also has many characteristics in common with experimental work. It is therefore often viewed as a new third branch of science. In most fields of science, computational work is an important complement to both experiments and theory, and nowadays a vast majority of both experimental and theoretical papers involve some numerical calculations, simulations or computer modeling.\n",
"<center>\n",
"<img src=\"images/theory-experiment-computation.png\" width=\"300\">\n",
"</center>\n",
"\n",
"In experimental and theoretical sciences there are well established codes of conducts for how results and methods are published and made available to other scientists. For example, in theoretical sciences, derivations, proofs and other results are published in full detail, or made available upon request. Likewise, in experimental sciences, the methods used and the results are published, and all experimental data should be available upon request. It is considered unscientific to withhold crucial details in a theoretical proof or experimental method, that would hinder other scientists from replicating and reproducing the results.\n",
"\n",
"In computational sciences there are not yet any well established guidelines for how source code and generated data should be handled. For example, it is relatively rare that source code used in simulations for published papers are provided to readers, in contrast to the open nature of experimental and theoretical work. And it is not uncommon that source code for simulation software is withheld and considered a competitive advantage (or unnecessary to publish). \n",
"\n",
"However, this issue has recently started to attract increasing attention, and a number of editorials in high-profile journals have called for increased openness in computational sciences. Some prestigious journals, including Science, have even started to demand of authors to provide the source code for simulation software used in publications to readers upon request. \n",
"\n",
"Discussions are also ongoing on how to facilitate distribution of scientific software, for example as supplementary materials to scientific papers."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### References"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
" * [Reproducible Research in Computational Science](http://dx.doi.org/10.1126/science.1213847), Roger D. Peng, Science 334, 1226 (2011).\n",
"\n",
" * [Shining Light into Black Boxes](http://dx.doi.org/10.1126/science.1218263), A. Morin et al., Science 336, 159-160 (2012).\n",
" \n",
" * [The case for open computer programs](http://dx.doi.org/doi:10.1038/nature10836), D.C. Ince, Nature 482, 485 (2012)."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Requirements on scientific computing"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"**Replication** and **reproducibility** are two of the cornerstones in the scientific method. With respect to numerical work, complying with these concepts have the following practical implications:\n",
"\n",
"* Replication: An author of a scientific paper that involves numerical calculations should be able to rerun the simulations and replicate the results upon request. Other scientist should also be able to perform the same calculations and obtain the same results, given the information about the methods used in a publication.\n",
"\n",
"* Reproducibility: The results obtained from numerical simulations should be reproducible with an independent implementation of the method, or using a different method altogether. \n",
"\n",
"\n",
"In summary: A sound scientific result should be reproducible, and a sound scientific study should be replicable.\n",
"\n",
"\n",
"To achieve these goals, we need to:\n",
"\n",
"* Keep and take note of *exactly* which source code and version that was used to produce data and figures in published papers.\n",
"\n",
"* Record information of which version of external software that was used. Keep access to the environment that was used.\n",
"\n",
"* Make sure that old codes and notes are backed up and kept for future reference. \n",
"\n",
"* Be ready to give additional information about the methods used, and perhaps also the simulation codes, to an interested reader who requests it (even years after the paper was published!).\n",
"\n",
"* Ideally codes should be published online, to make it easier for other scientists interested in the codes to access it."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Tools for managing source code"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Ensuring replicability and reproducibility of scientific simulations is a *complicated problem*, but there are good tools to help with this:\n",
"\n",
"* Revision Control System (RCS) software. \n",
" * Good choices include:\n",
" * git - http://git-scm.com\n",
" * mercurial - http://mercurial.selenic.com. Also known as `hg`.\n",
" * subversion - http://subversion.apache.org. Also known as `svn`.\n",
"\n",
"* Online repositories for source code. Available as both private and public repositories. \n",
" * Some good alternatives are\n",
" * Github - http://www.github.com\n",
" * Bitbucket - http://www.bitbucket.com\n",
" * Privately hosted repositories on the university's or department's servers.\n",
"\n",
"#### Note\n",
"\t\n",
"Repositories are also excellent for version controlling manuscripts, figures, thesis files, data files, lab logs, etc. Basically for any digital content that must be preserved and is frequently updated. Again, both public and private repositories are readily available. They are also excellent collaboration tools!"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## What is Python?"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"[Python](http://www.python.org/) is a modern, general-purpose, object-oriented, high-level programming language.\n",
"\n",
"General characteristics of Python:\n",
"\n",
"* **clean and simple language:** Easy-to-read and intuitive code, easy-to-learn minimalistic syntax, maintainability scales well with size of projects.\n",
"* **expressive language:** Fewer lines of code, fewer bugs, easier to maintain.\n",
"\n",
"Technical details:\n",
"\n",
"* **dynamically typed:** No need to define the type of variables, function arguments or return types.\n",
"* **automatic memory management:** No need to explicitly allocate and deallocate memory for variables and data arrays. No memory leak bugs. \n",
"* **interpreted:** No need to compile the code. The Python interpreter reads and executes the python code directly.\n",
"\n",
"Advantages:\n",
"\n",
"* The main advantage is ease of programming, minimizing the time required to develop, debug and maintain the code.\n",
"* Well designed language that encourage many good programming practices:\n",
" * Modular and object-oriented programming, good system for packaging and re-use of code. This often results in more transparent, maintainable and bug-free code.\n",
" * Documentation tightly integrated with the code.\n",
"* A large standard library, and a large collection of add-on packages.\n",
"\n",
"Disadvantages:\n",
"\n",
"* Since Python is an interpreted and dynamically typed programming language, the execution of python code can be slow compared to compiled statically typed programming languages, such as C and Fortran. \n",
"* Somewhat decentralized, with different environment, packages and documentation spread out at different places. Can make it harder to get started."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## What makes python suitable for scientific computing?"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<img src=\"./images/optimizing-what.png\" width=\"600\">\n",
"\n",
"* Python has a strong position in scientific computing: \n",
" * Large community of users, easy to find help and documentation.\n",
"\n",
"* Extensive ecosystem of scientific libraries and environments\n",
" * numpy: http://numpy.scipy.org - Numerical Python\n",
" * scipy: http://www.scipy.org - Scientific Python\n",
" * matplotlib: http://www.matplotlib.org - graphics library\n",
"\n",
"* Great performance due to close integration with time-tested and highly optimized codes written in C and Fortran:\n",
" * blas, atlas blas, lapack, arpack, Intel MKL, ...\n",
"\n",
"* Good support for \n",
" * Parallel processing with processes and threads\n",
" * Interprocess communication (MPI)\n",
" * GPU computing (OpenCL and CUDA)\n",
"\n",
"* Readily available and suitable for use on high-performance computing clusters. \n",
"\n",
"* No license costs, no unnecessary use of research budget.\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### The scientific python software stack"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<!-- <img src=\"./images/scientific-python-stack.svg\" width=\"300\"> -->\n",
"<img src=\"./images/scientific-python-stack.png\" width=\"300\">"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Python environments"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Python is not only a programming language, but often also refers to the standard implementation of the interpreter (technically referred to as [CPython](http://en.wikipedia.org/wiki/CPython)) that actually runs the python code on a computer.\n",
"\n",
"There are also many different environments through which the python interpreter can be used. Each environment has different advantages and is suitable for different workflows. One strength of python is that it is versatile and can be used in complementary ways, but it can be confusing for beginners so we will start with a brief survey of python environments that are useful for scientific computing."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Python interpreter"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"The standard way to use the Python programming language is to use the Python interpreter to run python code. The python interpreter is a program that reads and execute the python code in files passed to it as arguments. At the command prompt, the command ``python`` is used to invoke the Python interpreter.\n",
"\n",
"For example, to run a file ``my-program.py`` that contains python code from the command prompt, use::\n",
"\n",
" $ python my-program.py\n",
"\n",
"We can also start the interpreter by simply typing ``python`` at the command line, and interactively type python code into the interpreter. \n",
"\n",
"<!-- <img src=\"files/images/python-screenshot.jpg\" width=\"600\"> -->\n",
"<img src=\"./images/python-screenshot.jpg\" width=\"600\">\n",
"\n",
"\n",
"This is often how we want to work when developing scientific applications, or when doing small calculations. But the standard python interpreter is not very convenient for this kind of work, due to a number of limitations."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### IPython"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"IPython is an interactive shell that addresses the limitation of the standard python interpreter, and it is a work-horse for scientific use of python. It provides an interactive prompt to the python interpreter with a greatly improved user-friendliness.\n",
"\n",
"<!-- <img src=\"./images/ipython-screenshot.jpg\" width=\"600\"> -->\n",
"<img src=\"./images/ipython-screenshot.jpg\" width=\"600\">\n",
"\n",
"Some of the many useful features of IPython includes:\n",
"\n",
"* Command history, which can be browsed with the up and down arrows on the keyboard.\n",
"* Tab auto-completion.\n",
"* In-line editing of code.\n",
"* Object introspection, and automatic extract of documentation strings from python objects like classes and functions.\n",
"* Good interaction with operating system shell.\n",
"* Support for multiple parallel back-end processes, that can run on computing clusters or cloud services like Amazon EC2.\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### IPython notebook"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"[IPython notebook](http://ipython.org/notebook.html) is an HTML-based notebook environment for Python, similar to Mathematica or Maple. It is based on the IPython shell, but provides a cell-based environment with great interactivity, where calculations can be organized and documented in a structured way.\n",
"\n",
"<!-- <img src=\"./images/ipython-notebook-screenshot.jpg\" width=\"800\"> -->\n",
"<img src=\"./images/ipython-notebook-screenshot.jpg\" width=\"800\">\n",
"\n",
"Although using a web browser as graphical interface, IPython notebooks are usually run locally, from the same computer that run the browser. To start a new IPython notebook session, run the following command:\n",
"\n",
" $ ipython notebook\n",
"\n",
"from a directory where you want the notebooks to be stored. This will open a new browser window (or a new tab in an existing window) with an index page where existing notebooks are shown and from which new notebooks can be created."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Spyder"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"[Spyder](http://code.google.com/p/spyderlib/) is a MATLAB-like IDE for scientific computing with python. It has the many advantages of a traditional IDE environment, for example that everything from code editing, execution and debugging is carried out in a single environment, and work on different calculations can be organized as projects in the IDE environment.\n",
"\n",
"<!-- <img src=\"./images/spyder-screenshot.jpg\" width=\"800\"> -->\n",
"<img src=\"./images/spyder-screenshot.jpg\" width=\"800\">\n",
"\n",
"Some advantages of Spyder:\n",
"\n",
"* Powerful code editor, with syntax high-lighting, dynamic code introspection and integration with the python debugger.\n",
"* Variable explorer, IPython command prompt.\n",
"* Integrated documentation and help."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Versions of Python"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"There are currently two versions of python: Python 2 and Python 3. Python 3 will eventually supersede Python 2, but it is not backward-compatible with Python 2. A lot of existing python code and packages has been written for Python 2, and it is still the most wide-spread version. For these lectures either version will be fine, but it is probably easier to stick with Python 2 for now, because it is more readily available via prebuilt packages and binary installers.\n",
"\n",
"To see which version of Python you have, run\n",
" \n",
" $ python --version\n",
" Python 2.7.3\n",
" $ python3.2 --version\n",
" Python 3.2.3\n",
"\n",
"Several versions of Python can be installed in parallel, as shown above.\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Installation"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Conda"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"The best way to set-up a scientific Python environment is to use the cross-platform package manager `conda` from Continuum Analytics. First download and install miniconda http://conda.pydata.org/miniconda.html or Anaconda (see below). Next, to install the required libraries for these notebooks, simply run:\n",
"\n",
" $ conda install ipython ipython-notebook spyder numpy scipy sympy matplotlib cython\n",
"\n",
"This should be sufficient to get a working environment on any platform supported by `conda`."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Linux"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"In Ubuntu Linux, to installing python and all the requirements run:\n",
"\n",
" $ sudo apt-get install python ipython ipython-notebook\n",
"$ sudo apt-get install python-numpy python-scipy python-matplotlib python-sympy\n",
" $ sudo apt-get install spyder"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### MacOS X"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"*Macports*\n",
"\n",
"Python is included by default in Mac OS X, but for our purposes it will be useful to install a new python environment using [Macports](http://www.macports.org/), because it makes it much easier to install all the required additional packages. Using Macports, we can install what we need with:\n",
"\n",
" $ sudo port install py27-ipython +pyside+notebook+parallel+scientific\n",
" $ sudo port install py27-scipy py27-matplotlib py27-sympy\n",
" $ sudo port install py27-spyder\n",
"\n",
"These will associate the commands `python` and `ipython` with the versions installed via macports (instead of the one that is shipped with Mac OS X), run the following commands:\n",
"\n",
" $ sudo port select python python27\n",
" $ sudo port select ipython ipython27\n",
"\n",
"*Fink*\n",
"\n",
"Or, alternatively, you can use the [Fink](http://www.finkproject.org/) package manager. After installing Fink, use the following command to install python and the packages that we need:\n",
"\n",
" $ sudo fink install python27 ipython-py27 numpy-py27 matplotlib-py27 scipy-py27 sympy-py27\n",
" $ sudo fink install spyder-mac-py27"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Windows"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Windows lacks a good packaging system, so the easiest way to setup a Python environment is to install a pre-packaged distribution. Some good alternatives are:\n",
"\n",
" * [Enthought Python Distribution](http://www.enthought.com/products/epd.php). EPD is a commercial product but is available free for academic use.\n",
" * [Anaconda](http://continuum.io/downloads.html). The Anaconda Python distribution comes with many scientific computing and data science packages and is free, including for commercial use and redistribution. It also has add-on products such as Accelerate, IOPro, and MKL Optimizations, which have free trials and are free for academic use.\n",
" * [Python(x,y)](http://code.google.com/p/pythonxy/). Fully open source.\n",
"\n",
"\n",
"\n",
"#### Note\n",
"\n",
"EPD and Anaconda are also available for Linux and Max OS X."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Further reading"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
" * [Python](http://www.python.org). The official Python web site.\n",
" * [Python tutorials](http://docs.python.org/2/tutorial). The official Python tutorials.\n",
" * [Think Python](http://www.greenteapress.com/thinkpython). A free book on Python."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Python and module versions"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Since there are several different versions of Python and each Python package has its own release cycle and version number (for example scipy, numpy, matplotlib, etc., which we installed above and will discuss in detail in the following lectures), it is important for the reproducibility of an IPython notebook to record the versions of all these different software packages. If this is done properly it will be easy to reproduce the environment that was used to run a notebook, but if not it can be hard to know what was used to produce the results in a notebook.\n",
"\n",
"To encourage the practice of recording Python and module versions in notebooks, I've created a simple IPython extension that produces a table with versions numbers of selected software components. I believe that it is a good practice to include this kind of table in every notebook you create. \n",
"\n",
"To install this IPython extension, use `pip install version_information`:"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"collapsed": false,
"jupyter": {
"outputs_hidden": false
}
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Collecting version-information\n",
"Installing collected packages: version-information\n",
"Successfully installed version-information-1.0.3\n"
]
}
],
"source": [
"# you only need to do this once\n",
"!pip install --upgrade version_information"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"or alternatively run (deprecated method):"
]
},
{
"cell_type": "raw",
"metadata": {},
"source": [
"# you only need to do this once\n",
"%install_ext http://raw.github.com/jrjohansson/version_information/master/version_information.py"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Now, to load the extension and produce the version table"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {
"collapsed": false,
"jupyter": {
"outputs_hidden": false
}
},
"outputs": [
{
"data": {
"application/json": {
"Software versions": [
{
"module": "Python",
"version": "2.7.10 64bit [GCC 4.2.1 (Apple Inc. build 5577)]"
},
{
"module": "IPython",
"version": "3.2.1"
},
{
"module": "OS",
"version": "Darwin 14.1.0 x86_64 i386 64bit"
},
{
"module": "numpy",
"version": "1.9.2"
},
{
"module": "scipy",
"version": "0.16.0"
},
{
"module": "matplotlib",
"version": "1.4.3"
},
{
"module": "sympy",
"version": "0.7.6"
},
{
"module": "version_information",
"version": "1.0.3"
}
]
},
"text/html": [
"<table><tr><th>Software</th><th>Version</th></tr><tr><td>Python</td><td>2.7.10 64bit [GCC 4.2.1 (Apple Inc. build 5577)]</td></tr><tr><td>IPython</td><td>3.2.1</td></tr><tr><td>OS</td><td>Darwin 14.1.0 x86_64 i386 64bit</td></tr><tr><td>numpy</td><td>1.9.2</td></tr><tr><td>scipy</td><td>0.16.0</td></tr><tr><td>matplotlib</td><td>1.4.3</td></tr><tr><td>sympy</td><td>0.7.6</td></tr><tr><td>version_information</td><td>1.0.3</td></tr><tr><td colspan='2'>Sat Aug 15 10:38:48 2015 JST</td></tr></table>"
],
"text/latex": [
"\\begin{tabular}{|l|l|}\\hline\n",
"{\\bf Software} & {\\bf Version} \\\\ \\hline\\hline\n",
"Python & 2.7.10 64bit [GCC 4.2.1 (Apple Inc. build 5577)] \\\\ \\hline\n",
"IPython & 3.2.1 \\\\ \\hline\n",
"OS & Darwin 14.1.0 x86\\_64 i386 64bit \\\\ \\hline\n",
"numpy & 1.9.2 \\\\ \\hline\n",
"scipy & 0.16.0 \\\\ \\hline\n",
"matplotlib & 1.4.3 \\\\ \\hline\n",
"sympy & 0.7.6 \\\\ \\hline\n",
"version_information & 1.0.3 \\\\ \\hline\n",
"\\hline \\multicolumn{2}{|l|}{Sat Aug 15 10:38:48 2015 JST} \\\\ \\hline\n",
"\\end{tabular}\n"
],
"text/plain": [
"Software versions\n",
"Python 2.7.10 64bit [GCC 4.2.1 (Apple Inc. build 5577)]\n",
"IPython 3.2.1\n",
"OS Darwin 14.1.0 x86_64 i386 64bit\n",
"numpy 1.9.2\n",
"scipy 0.16.0\n",
"matplotlib 1.4.3\n",
"sympy 0.7.6\n",
"version_information 1.0.3\n",
"Sat Aug 15 10:38:48 2015 JST"
]
},
"execution_count": 2,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"%load_ext version_information\n",
"\n",
"%version_information numpy, scipy, matplotlib, sympy, version_information"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.11"
}
},
"nbformat": 4,
"nbformat_minor": 4
}

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,26 @@
#
# Build a PDF with all the notebooks
#
TEMPLATE=chapter
NOTEBOOKS=Lecture-0-Scientific-Computing-with-Python.ipynb \
Lecture-1-Introduction-to-Python-Programming.ipynb \
Lecture-2-Numpy.ipynb Lecture-3-Scipy.ipynb \
Lecture-4-Matplotlib.ipynb Lecture-5-Sympy.ipynb \
Lecture-6A-Fortran-and-C.ipynb Lecture-6B-HPC.ipynb \
Lecture-7-Revision-Control-Software.ipynb
LATEXFILES=$(NOTEBOOKS:.ipynb=.tex)
.ipynb.tex:
jupyter nbconvert --to latex --template $(TEMPLATE) $<
all: latexfiles buildpdf
latexfiles:
for notebook in $(NOTEBOOKS) ; do \
jupyter nbconvert --to latex --template $(TEMPLATE) $$notebook ; \
done
buildpdf: latexfiles
pdflatex Scientific-Computing-with-Python.tex

View File

@@ -0,0 +1,40 @@
Lectures on scientific computing with Python
============================================
<a href="https://notebooks.azure.com/import/gh/jrjohansson/scientific-python-lectures"><img src="https://notebooks.azure.com/launch.png" /></a>
A set of lectures on scientific computing with Python, using IPython notebooks.
To open these notebooks in IPython, download the files to a directory on your computer and from that directory run:
$ ipython notebook
This will open a new page in your browser with a list of the available notebooks.
Should this error `[TerminalIPythonApp] WARNING | File not found: u'notebook'` pop up, please install Jupyter by following the [instructions](http://jupyter.readthedocs.io/en/latest/install.html) and execute the following command to run the notebook:
$ jupyter notebook
Online read-only versions
=========================
Use the following links:
* [Lecture-0 Scientific Computing with Python](http://nbviewer.ipython.org/urls/raw.github.com/jrjohansson/scientific-python-lectures/master/Lecture-0-Scientific-Computing-with-Python.ipynb)
* [Lecture-1 Introduction to Python Programming](http://nbviewer.ipython.org/urls/raw.github.com/jrjohansson/scientific-python-lectures/master/Lecture-1-Introduction-to-Python-Programming.ipynb)
* [Lecture-2 Numpy - multidimensional data arrays](http://nbviewer.ipython.org/urls/raw.github.com/jrjohansson/scientific-python-lectures/master/Lecture-2-Numpy.ipynb)
* [Lecture-3 Scipy - Library of scientific algorithms](http://nbviewer.ipython.org/urls/raw.github.com/jrjohansson/scientific-python-lectures/master/Lecture-3-Scipy.ipynb)
* [Lecture-4 Matplotlib - 2D and 3D plotting](http://nbviewer.ipython.org/urls/raw.github.com/jrjohansson/scientific-python-lectures/master/Lecture-4-Matplotlib.ipynb)
* [Lecture-5 Sympy - Symbolic algebra](http://nbviewer.ipython.org/urls/raw.github.com/jrjohansson/scientific-python-lectures/master/Lecture-5-Sympy.ipynb)
* [Lecture-6A C and Fortran integration](http://nbviewer.ipython.org/urls/raw.github.com/jrjohansson/scientific-python-lectures/master/Lecture-6A-Fortran-and-C.ipynb)
* [Lecture-6B HPC](http://nbviewer.ipython.org/urls/raw.github.com/jrjohansson/scientific-python-lectures/master/Lecture-6B-HPC.ipynb)
* [Lecture-7 Revision Control Software](http://nbviewer.ipython.org/urls/raw.github.com/jrjohansson/scientific-python-lectures/master/Lecture-7-Revision-Control-Software.ipynb)
A PDF file containing all the lectures is available here: [Scientific Computing with Python](http://raw.github.com/jrjohansson/scientific-python-lectures/master/Scientific-Computing-with-Python.pdf)
License
=======
This work is licensed under a [Creative Commons Attribution 3.0 Unported License.](http://creativecommons.org/licenses/by/3.0/)

View File

@@ -0,0 +1,260 @@
\documentclass{report}
\usepackage{graphicx}
\makeatletter
\def\maxwidth{\ifdim\Gin@nat@width>\linewidth\linewidth
\else\Gin@nat@width\fi}
\makeatother
\let\Oldincludegraphics\includegraphics
\renewcommand{\includegraphics}[1]{\Oldincludegraphics[width=.8\maxwidth]{#1}}
\usepackage{caption}
\DeclareCaptionLabelFormat{nolabel}{}
\captionsetup{labelformat=nolabel}
\usepackage{adjustbox} % Used to constrain images to a maximum size
\usepackage{xcolor} % Allow colors to be defined
\usepackage{enumerate} % Needed for markdown enumerations to work
\usepackage{geometry} % Used to adjust the document margins
\usepackage{amsmath} % Equations
\usepackage{amssymb} % Equations
\usepackage{textcomp} % defines textquotesingle
\AtBeginDocument{%
\def\PYZsq{\textquotesingle}% Upright quotes in Pygmentized code
}
\usepackage{upquote} % Upright quotes for verbatim code
\usepackage{eurosym} % defines \euro
\usepackage[mathletters]{ucs} % Extended unicode (utf-8) support
\usepackage[utf8x]{inputenc} % Allow utf-8 characters in the tex document
\usepackage{fancyvrb} % verbatim replacement that allows latex
\usepackage{grffile} % extends the file name processing of package graphics
\usepackage{hyperref}
\usepackage{longtable} % longtable support required by pandoc >1.10
\usepackage{booktabs} % table support for pandoc > 1.12.2
\usepackage[normalem]{ulem} % ulem is needed to support strikethroughs (\sout)
% Colors for the hyperref package
\definecolor{urlcolor}{rgb}{0,.145,.698}
\definecolor{linkcolor}{rgb}{.71,0.21,0.01}
\definecolor{citecolor}{rgb}{.12,.54,.11}
% ANSI colors
\definecolor{ansi-black}{HTML}{3E424D}
\definecolor{ansi-black-intense}{HTML}{282C36}
\definecolor{ansi-red}{HTML}{E75C58}
\definecolor{ansi-red-intense}{HTML}{B22B31}
\definecolor{ansi-green}{HTML}{00A250}
\definecolor{ansi-green-intense}{HTML}{007427}
\definecolor{ansi-yellow}{HTML}{DDB62B}
\definecolor{ansi-yellow-intense}{HTML}{B27D12}
\definecolor{ansi-blue}{HTML}{208FFB}
\definecolor{ansi-blue-intense}{HTML}{0065CA}
\definecolor{ansi-magenta}{HTML}{D160C4}
\definecolor{ansi-magenta-intense}{HTML}{A03196}
\definecolor{ansi-cyan}{HTML}{60C6C8}
\definecolor{ansi-cyan-intense}{HTML}{258F8F}
\definecolor{ansi-white}{HTML}{C5C1B4}
\definecolor{ansi-white-intense}{HTML}{A1A6B2}
% commands and environments needed by pandoc snippets
% extracted from the output of `pandoc -s`
\providecommand{\tightlist}{%
\setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
\DefineVerbatimEnvironment{Highlighting}{Verbatim}{commandchars=\\\{\}}
% Add ',fontsize=\small' for more characters per line
\newenvironment{Shaded}{}{}
\newcommand{\KeywordTok}[1]{\textcolor[rgb]{0.00,0.44,0.13}{\textbf{{#1}}}}
\newcommand{\DataTypeTok}[1]{\textcolor[rgb]{0.56,0.13,0.00}{{#1}}}
\newcommand{\DecValTok}[1]{\textcolor[rgb]{0.25,0.63,0.44}{{#1}}}
\newcommand{\BaseNTok}[1]{\textcolor[rgb]{0.25,0.63,0.44}{{#1}}}
\newcommand{\FloatTok}[1]{\textcolor[rgb]{0.25,0.63,0.44}{{#1}}}
\newcommand{\CharTok}[1]{\textcolor[rgb]{0.25,0.44,0.63}{{#1}}}
\newcommand{\StringTok}[1]{\textcolor[rgb]{0.25,0.44,0.63}{{#1}}}
\newcommand{\CommentTok}[1]{\textcolor[rgb]{0.38,0.63,0.69}{\textit{{#1}}}}
\newcommand{\OtherTok}[1]{\textcolor[rgb]{0.00,0.44,0.13}{{#1}}}
\newcommand{\AlertTok}[1]{\textcolor[rgb]{1.00,0.00,0.00}{\textbf{{#1}}}}
\newcommand{\FunctionTok}[1]{\textcolor[rgb]{0.02,0.16,0.49}{{#1}}}
\newcommand{\RegionMarkerTok}[1]{{#1}}
\newcommand{\ErrorTok}[1]{\textcolor[rgb]{1.00,0.00,0.00}{\textbf{{#1}}}}
\newcommand{\NormalTok}[1]{{#1}}
% Additional commands for more recent versions of Pandoc
\newcommand{\ConstantTok}[1]{\textcolor[rgb]{0.53,0.00,0.00}{{#1}}}
\newcommand{\SpecialCharTok}[1]{\textcolor[rgb]{0.25,0.44,0.63}{{#1}}}
\newcommand{\VerbatimStringTok}[1]{\textcolor[rgb]{0.25,0.44,0.63}{{#1}}}
\newcommand{\SpecialStringTok}[1]{\textcolor[rgb]{0.73,0.40,0.53}{{#1}}}
\newcommand{\ImportTok}[1]{{#1}}
\newcommand{\DocumentationTok}[1]{\textcolor[rgb]{0.73,0.13,0.13}{\textit{{#1}}}}
\newcommand{\AnnotationTok}[1]{\textcolor[rgb]{0.38,0.63,0.69}{\textbf{\textit{{#1}}}}}
\newcommand{\CommentVarTok}[1]{\textcolor[rgb]{0.38,0.63,0.69}{\textbf{\textit{{#1}}}}}
\newcommand{\VariableTok}[1]{\textcolor[rgb]{0.10,0.09,0.49}{{#1}}}
\newcommand{\ControlFlowTok}[1]{\textcolor[rgb]{0.00,0.44,0.13}{\textbf{{#1}}}}
\newcommand{\OperatorTok}[1]{\textcolor[rgb]{0.40,0.40,0.40}{{#1}}}
\newcommand{\BuiltInTok}[1]{{#1}}
\newcommand{\ExtensionTok}[1]{{#1}}
\newcommand{\PreprocessorTok}[1]{\textcolor[rgb]{0.74,0.48,0.00}{{#1}}}
\newcommand{\AttributeTok}[1]{\textcolor[rgb]{0.49,0.56,0.16}{{#1}}}
\newcommand{\InformationTok}[1]{\textcolor[rgb]{0.38,0.63,0.69}{\textbf{\textit{{#1}}}}}
\newcommand{\WarningTok}[1]{\textcolor[rgb]{0.38,0.63,0.69}{\textbf{\textit{{#1}}}}}
% Define a nice break command that doesn't care if a line doesn't already
% exist.
\def\br{\hspace*{\fill} \\* }
% Math Jax compatability definitions
\def\gt{>}
\def\lt{<}
% Pygments definitions
\makeatletter
\def\PY@reset{\let\PY@it=\relax \let\PY@bf=\relax%
\let\PY@ul=\relax \let\PY@tc=\relax%
\let\PY@bc=\relax \let\PY@ff=\relax}
\def\PY@tok#1{\csname PY@tok@#1\endcsname}
\def\PY@toks#1+{\ifx\relax#1\empty\else%
\PY@tok{#1}\expandafter\PY@toks\fi}
\def\PY@do#1{\PY@bc{\PY@tc{\PY@ul{%
\PY@it{\PY@bf{\PY@ff{#1}}}}}}}
\def\PY#1#2{\PY@reset\PY@toks#1+\relax+\PY@do{#2}}
\expandafter\def\csname PY@tok@gd\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.63,0.00,0.00}{##1}}}
\expandafter\def\csname PY@tok@gu\endcsname{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.50,0.00,0.50}{##1}}}
\expandafter\def\csname PY@tok@gt\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.00,0.27,0.87}{##1}}}
\expandafter\def\csname PY@tok@gs\endcsname{\let\PY@bf=\textbf}
\expandafter\def\csname PY@tok@gr\endcsname{\def\PY@tc##1{\textcolor[rgb]{1.00,0.00,0.00}{##1}}}
\expandafter\def\csname PY@tok@cm\endcsname{\let\PY@it=\textit\def\PY@tc##1{\textcolor[rgb]{0.25,0.50,0.50}{##1}}}
\expandafter\def\csname PY@tok@vg\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.10,0.09,0.49}{##1}}}
\expandafter\def\csname PY@tok@vi\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.10,0.09,0.49}{##1}}}
\expandafter\def\csname PY@tok@mh\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.40,0.40,0.40}{##1}}}
\expandafter\def\csname PY@tok@cs\endcsname{\let\PY@it=\textit\def\PY@tc##1{\textcolor[rgb]{0.25,0.50,0.50}{##1}}}
\expandafter\def\csname PY@tok@ge\endcsname{\let\PY@it=\textit}
\expandafter\def\csname PY@tok@vc\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.10,0.09,0.49}{##1}}}
\expandafter\def\csname PY@tok@il\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.40,0.40,0.40}{##1}}}
\expandafter\def\csname PY@tok@go\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.53,0.53,0.53}{##1}}}
\expandafter\def\csname PY@tok@cp\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.74,0.48,0.00}{##1}}}
\expandafter\def\csname PY@tok@gi\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.00,0.63,0.00}{##1}}}
\expandafter\def\csname PY@tok@gh\endcsname{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.00,0.00,0.50}{##1}}}
\expandafter\def\csname PY@tok@ni\endcsname{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.60,0.60,0.60}{##1}}}
\expandafter\def\csname PY@tok@nl\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.63,0.63,0.00}{##1}}}
\expandafter\def\csname PY@tok@nn\endcsname{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.00,0.00,1.00}{##1}}}
\expandafter\def\csname PY@tok@no\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.53,0.00,0.00}{##1}}}
\expandafter\def\csname PY@tok@na\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.49,0.56,0.16}{##1}}}
\expandafter\def\csname PY@tok@nb\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.00,0.50,0.00}{##1}}}
\expandafter\def\csname PY@tok@nc\endcsname{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.00,0.00,1.00}{##1}}}
\expandafter\def\csname PY@tok@nd\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.67,0.13,1.00}{##1}}}
\expandafter\def\csname PY@tok@ne\endcsname{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.82,0.25,0.23}{##1}}}
\expandafter\def\csname PY@tok@nf\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.00,0.00,1.00}{##1}}}
\expandafter\def\csname PY@tok@si\endcsname{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.73,0.40,0.53}{##1}}}
\expandafter\def\csname PY@tok@s2\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.73,0.13,0.13}{##1}}}
\expandafter\def\csname PY@tok@nt\endcsname{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.00,0.50,0.00}{##1}}}
\expandafter\def\csname PY@tok@nv\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.10,0.09,0.49}{##1}}}
\expandafter\def\csname PY@tok@s1\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.73,0.13,0.13}{##1}}}
\expandafter\def\csname PY@tok@ch\endcsname{\let\PY@it=\textit\def\PY@tc##1{\textcolor[rgb]{0.25,0.50,0.50}{##1}}}
\expandafter\def\csname PY@tok@m\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.40,0.40,0.40}{##1}}}
\expandafter\def\csname PY@tok@gp\endcsname{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.00,0.00,0.50}{##1}}}
\expandafter\def\csname PY@tok@sh\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.73,0.13,0.13}{##1}}}
\expandafter\def\csname PY@tok@ow\endcsname{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.67,0.13,1.00}{##1}}}
\expandafter\def\csname PY@tok@sx\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.00,0.50,0.00}{##1}}}
\expandafter\def\csname PY@tok@bp\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.00,0.50,0.00}{##1}}}
\expandafter\def\csname PY@tok@c1\endcsname{\let\PY@it=\textit\def\PY@tc##1{\textcolor[rgb]{0.25,0.50,0.50}{##1}}}
\expandafter\def\csname PY@tok@o\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.40,0.40,0.40}{##1}}}
\expandafter\def\csname PY@tok@kc\endcsname{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.00,0.50,0.00}{##1}}}
\expandafter\def\csname PY@tok@c\endcsname{\let\PY@it=\textit\def\PY@tc##1{\textcolor[rgb]{0.25,0.50,0.50}{##1}}}
\expandafter\def\csname PY@tok@mf\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.40,0.40,0.40}{##1}}}
\expandafter\def\csname PY@tok@err\endcsname{\def\PY@bc##1{\setlength{\fboxsep}{0pt}\fcolorbox[rgb]{1.00,0.00,0.00}{1,1,1}{\strut ##1}}}
\expandafter\def\csname PY@tok@mb\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.40,0.40,0.40}{##1}}}
\expandafter\def\csname PY@tok@ss\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.10,0.09,0.49}{##1}}}
\expandafter\def\csname PY@tok@sr\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.73,0.40,0.53}{##1}}}
\expandafter\def\csname PY@tok@mo\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.40,0.40,0.40}{##1}}}
\expandafter\def\csname PY@tok@kd\endcsname{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.00,0.50,0.00}{##1}}}
\expandafter\def\csname PY@tok@mi\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.40,0.40,0.40}{##1}}}
\expandafter\def\csname PY@tok@kn\endcsname{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.00,0.50,0.00}{##1}}}
\expandafter\def\csname PY@tok@cpf\endcsname{\let\PY@it=\textit\def\PY@tc##1{\textcolor[rgb]{0.25,0.50,0.50}{##1}}}
\expandafter\def\csname PY@tok@kr\endcsname{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.00,0.50,0.00}{##1}}}
\expandafter\def\csname PY@tok@s\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.73,0.13,0.13}{##1}}}
\expandafter\def\csname PY@tok@kp\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.00,0.50,0.00}{##1}}}
\expandafter\def\csname PY@tok@w\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.73,0.73,0.73}{##1}}}
\expandafter\def\csname PY@tok@kt\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.69,0.00,0.25}{##1}}}
\expandafter\def\csname PY@tok@sc\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.73,0.13,0.13}{##1}}}
\expandafter\def\csname PY@tok@sb\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.73,0.13,0.13}{##1}}}
\expandafter\def\csname PY@tok@k\endcsname{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.00,0.50,0.00}{##1}}}
\expandafter\def\csname PY@tok@se\endcsname{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.73,0.40,0.13}{##1}}}
\expandafter\def\csname PY@tok@sd\endcsname{\let\PY@it=\textit\def\PY@tc##1{\textcolor[rgb]{0.73,0.13,0.13}{##1}}}
\def\PYZbs{\char`\\}
\def\PYZus{\char`\_}
\def\PYZob{\char`\{}
\def\PYZcb{\char`\}}
\def\PYZca{\char`\^}
\def\PYZam{\char`\&}
\def\PYZlt{\char`\<}
\def\PYZgt{\char`\>}
\def\PYZsh{\char`\#}
\def\PYZpc{\char`\%}
\def\PYZdl{\char`\$}
\def\PYZhy{\char`\-}
\def\PYZsq{\char`\'}
\def\PYZdq{\char`\"}
\def\PYZti{\char`\~}
% for compatibility with earlier versions
\def\PYZat{@}
\def\PYZlb{[}
\def\PYZrb{]}
\makeatother
% Exact colors from NB
\definecolor{incolor}{rgb}{0.0, 0.0, 0.5}
\definecolor{outcolor}{rgb}{0.545, 0.0, 0.0}
% Prevent overflowing lines due to hard-to-break entities
\sloppy
% Setup hyperref package
\hypersetup{
breaklinks=true, % so long urls are correctly broken across lines
colorlinks=true,
urlcolor=urlcolor,
linkcolor=linkcolor,
citecolor=citecolor,
}
% Slightly bigger margins than the latex defaults
\geometry{verbose,tmargin=1in,bmargin=1in,lmargin=1in,rmargin=1in}
\title{Introduction to Scientific Computing in Python}
\author{Robert Johansson}
\begin{document}
\maketitle
\tableofcontents
\newpage
\input{Lecture-0-Scientific-Computing-with-Python}
\newpage
\input{Lecture-1-Introduction-to-Python-Programming}
\newpage
\input{Lecture-2-Numpy}
\newpage
\input{Lecture-3-Scipy}
\newpage
\input{Lecture-4-Matplotlib}
\newpage
\input{Lecture-5-Sympy}
\newpage
\input{Lecture-6A-Fortran-and-C}
\newpage
\input{Lecture-6B-HPC}
\newpage
\input{Lecture-7-Revision-Control-Software}
\end{document}

View File

@@ -0,0 +1,120 @@
((*- extends 'display_priority.tplx' -*))
%===============================================================================
% Abstract overrides
%===============================================================================
((* block header *))
((* endblock header *))
((* block body *))
((( super() )))
((* endblock body *))
%===============================================================================
% Support blocks
%===============================================================================
% Displaying simple data text
((* block data_text *))
\begin{verbatim}
((( output.data['text/plain'] )))
\end{verbatim}
((* endblock data_text *))
% Display python error text as-is
((* block error *))
\begin{Verbatim}[commandchars=\\\{\}]
((( super() )))
\end{Verbatim}
((* endblock error *))
((* block traceback_line *))
((( line | indent | strip_ansi | escape_latex )))
((* endblock traceback_line *))
% Display stream ouput with coloring
((* block stream *))
\begin{Verbatim}[commandchars=\\\{\}]
((( output.text | escape_latex | ansi2latex )))
\end{Verbatim}
((* endblock stream *))
% Display latex
((* block data_latex -*))
((( output.data['text/latex'] | citation2latex | strip_files_prefix | markdown2latex )))
((* endblock data_latex *))
% Display markdown
((* block data_markdown -*))
((( output.data['text/markdown'] | citation2latex | strip_files_prefix | markdown2latex )))
((* endblock data_markdown *))
% Default mechanism for rendering figures
((*- block data_png -*))((( draw_figure(output.metadata.filenames['image/png']) )))((*- endblock -*))
((*- block data_jpg -*))((( draw_figure(output.metadata.filenames['image/jpeg']) )))((*- endblock -*))
((*- block data_svg -*))((( draw_figure(output.metadata.filenames['image/svg+xml']) )))((*- endblock -*))
((*- block data_pdf -*))((( draw_figure(output.metadata.filenames['application/pdf']) )))((*- endblock -*))
% Draw a figure using the graphicx package.
((* macro draw_figure(filename) -*))
((* set filename = filename | posix_path *))
((*- block figure scoped -*))
\begin{center}
\adjustimage{max size={0.9\linewidth}{0.9\paperheight}}{((( filename )))}
\end{center}
{ \hspace*{\fill} \\}
((*- endblock figure -*))
((*- endmacro *))
% Render markdown
((* block markdowncell scoped *))
((( cell.source | citation2latex | strip_files_prefix | markdown2latex(extra_args=["--chapters"]) )))
((* endblock markdowncell *))
% Don't display unknown types
((* block unknowncell scoped *))
((* endblock unknowncell *))
%===============================================================================
% Input
%===============================================================================
((* block input scoped *))
((( add_prompt(cell.source | highlight_code(strip_verbatim=True), cell, 'In ', 'incolor') )))
((* endblock input *))
%===============================================================================
% Output
%===============================================================================
((* block execute_result scoped *))
((*- for type in output.data | filter_data_type -*))
((*- if type in ['text/plain']*))
((( add_prompt(output.data['text/plain'] | escape_latex, cell, 'Out', 'outcolor') )))
((* else -*))
\texttt{\color{outcolor}Out[{\color{outcolor}((( cell.execution_count )))}]:}((( super() )))
((*- endif -*))
((*- endfor -*))
((* endblock execute_result *))
%==============================================================================
% Support Macros
%==============================================================================
% Name: draw_prompt
% Purpose: Renders an output/input prompt
((* macro add_prompt(text, cell, prompt, prompt_color) -*))
((*- if cell.execution_count is defined -*))
((*- set execution_count = "" ~ (cell.execution_count | replace(None, " ")) -*))
((*- else -*))
((*- set execution_count = " " -*))
((*- endif -*))
((*- set indention = " " * (execution_count | length + 7) -*))
\begin{Verbatim}[commandchars=\\\{\}]
((( text | add_prompts(first='{\color{' ~ prompt_color ~ '}' ~ prompt ~ '[{\\color{' ~ prompt_color ~ '}' ~ execution_count ~ '}]:} ', cont=indention) )))
\end{Verbatim}
((*- endmacro *))

Binary file not shown.

After

Width:  |  Height:  |  Size: 107 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 114 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 146 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 547 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 154 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 137 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

View File

@@ -0,0 +1,307 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="130.75"
height="145.75002"
id="svg2"
version="1.1"
inkscape:version="0.48.3.1 r9886"
sodipodi:docname="scientific-python-stack.svg"
inkscape:export-filename="scientific-python-stack.png"
inkscape:export-xdpi="344.17001"
inkscape:export-ydpi="344.17001">
<defs
id="defs4">
<path
sodipodi:end="2.6179939"
sodipodi:start="0.55850536"
d="m 317.89812,194.20932 a 79.64286,79.64286 0 0 1 -136.51371,-2.38286 l 68.97274,-39.82142 z"
sodipodi:ry="79.64286"
sodipodi:rx="79.64286"
sodipodi:cy="152.00504"
sodipodi:cx="250.35715"
id="path3779-9-1-34-2"
style="fill:#e6e6e6;fill-opacity:1;stroke:#666666;stroke-width:2;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0"
sodipodi:type="arc"
transform="matrix(-1,0,0,1,423.66072,164.10715)" />
<path
style="fill:none;stroke:none"
d="m 121.78572,347.71932 c 27.47833,37.9228 73.84073,35.52916 108.21428,3.21429"
id="path4417-4"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cc" />
<path
style="fill:none;stroke:none"
d="m 175.71429,252.36218 c 45.17969,12.19595 56.69027,45.75883 52.5,89.28571"
id="path4415-2"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cc" />
<path
style="fill:none;stroke:none"
d="m 123.21428,340.21932 c -9.44058,-51.7873 13.51269,-77.59604 47.14286,-88.21428"
id="path4375-0"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cc" />
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="3.959798"
inkscape:cx="38.576964"
inkscape:cy="52.333249"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="true"
showguides="false"
inkscape:snap-global="true"
inkscape:window-width="1791"
inkscape:window-height="1027"
inkscape:window-x="127"
inkscape:window-y="24"
inkscape:window-maximized="0"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0">
<inkscape:grid
type="xygrid"
id="grid2985"
empspacing="5"
visible="true"
enabled="true"
snapvisiblegridlinesonly="true"
originx="-299.625px"
originy="-794.62499px" />
</sodipodi:namedview>
<metadata
id="metadata7">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(-299.625,-111.98717)">
<flowRoot
xml:space="preserve"
id="flowRoot4680"
style="font-size:14px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Liberation Serif;-inkscape-font-specification:Liberation Serif"><flowRegion
id="flowRegion4682"><rect
id="rect4684"
width="296.42856"
height="350"
x="-3.5714285"
y="125.21932" /></flowRegion><flowPara
id="flowPara4686" /></flowRoot> <flowRoot
xml:space="preserve"
id="flowRoot4688"
style="font-size:14px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Liberation Serif;-inkscape-font-specification:Liberation Serif"><flowRegion
id="flowRegion4690"><rect
id="rect4692"
width="271.42856"
height="291.42856"
x="60.714287"
y="168.07646" /></flowRegion><flowPara
id="flowPara4694" /></flowRoot> <rect
style="fill:#f2f2f2;fill-opacity:1;stroke:#000000;stroke-width:0.75;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0"
id="rect3210"
width="40"
height="25"
x="345"
y="172.36218"
rx="2" />
<rect
style="fill:#f2f2f2;fill-opacity:1;stroke:#000000;stroke-width:0.75;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0"
id="rect3210-4"
width="40"
height="25"
x="390"
y="172.36218"
rx="2" />
<rect
style="fill:#f2f2f2;fill-opacity:1;stroke:#000000;stroke-width:0.75;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0"
id="rect3210-4-8"
width="85"
height="25"
x="345"
y="202.36218"
rx="2" />
<rect
style="fill:#f2f2f2;fill-opacity:1;stroke:#000000;stroke-width:0.75;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0"
id="rect3210-3"
width="40"
height="54.999992"
x="300"
y="172.36218"
rx="2" />
<rect
style="fill:#f2f2f2;fill-opacity:1;stroke:#000000;stroke-width:0.75;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0"
id="rect3210-4-8-7"
width="130"
height="25"
x="300"
y="232.36218"
rx="2" />
<rect
style="fill:#f2f2f2;fill-opacity:1;stroke:#000000;stroke-width:0.75;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0"
id="rect3210-4-8-7-7"
width="130"
height="25"
x="300"
y="142.36218"
rx="2" />
<rect
style="fill:#f2f2f2;fill-opacity:1;stroke:#000000;stroke-width:0.75;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0"
id="rect3210-4-8-7-7-3"
width="130"
height="25"
x="300"
y="112.36217"
rx="2" />
<text
xml:space="preserve"
style="font-size:14px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;font-family:Liberation Serif;-inkscape-font-specification:Liberation Serif"
x="364.99414"
y="243.57697"
id="text4544-9-8"
sodipodi:linespacing="125%"><tspan
sodipodi:role="line"
id="tspan4546-5-8"
x="364.99414"
y="243.57697"
style="font-size:8px;font-weight:bold;text-align:center;text-anchor:middle;fill:#0066ff;-inkscape-font-specification:Liberation Serif Bold">Python</tspan><tspan
sodipodi:role="line"
x="364.99414"
y="251.6396"
id="tspan4552-8-0"
style="font-size:6px;text-align:center;text-anchor:middle">Lecture 1</tspan></text>
<text
xml:space="preserve"
style="font-size:14px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;font-family:Liberation Serif;-inkscape-font-specification:Liberation Serif"
x="387.46289"
y="213.42072"
id="text4544-9-8-5"
sodipodi:linespacing="125%"><tspan
sodipodi:role="line"
id="tspan4546-5-8-9"
x="387.46289"
y="213.42072"
style="font-size:8px;font-weight:bold;text-align:center;text-anchor:middle;fill:#0066ff;-inkscape-font-specification:Liberation Serif Bold">Numpy</tspan><tspan
sodipodi:role="line"
x="387.46289"
y="221.48335"
id="tspan4552-8-0-5"
style="font-size:6px;text-align:center;text-anchor:middle">Lecture 2</tspan></text>
<text
xml:space="preserve"
style="font-size:14px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;font-family:Liberation Serif;-inkscape-font-specification:Liberation Serif"
x="365.03076"
y="183.57697"
id="text4544-9-8-5-0-9"
sodipodi:linespacing="125%"><tspan
sodipodi:role="line"
id="tspan4546-5-8-9-7-5"
x="365.03076"
y="183.57697"
style="font-size:8px;font-weight:bold;text-align:center;text-anchor:middle;fill:#0066ff;-inkscape-font-specification:Liberation Serif Bold">Scipy</tspan><tspan
sodipodi:role="line"
x="365.03076"
y="191.6396"
id="tspan4552-8-0-5-6-1"
style="font-size:6px;text-align:center;text-anchor:middle">Lecture 3</tspan></text>
<text
xml:space="preserve"
style="font-size:14px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;font-family:Liberation Serif;-inkscape-font-specification:Liberation Serif"
x="410.05664"
y="183.57697"
id="text4544-9-8-5-0"
sodipodi:linespacing="125%"><tspan
sodipodi:role="line"
id="tspan4546-5-8-9-7"
x="410.05664"
y="183.57697"
style="font-size:8px;font-weight:bold;text-align:center;text-anchor:middle;fill:#0066ff;-inkscape-font-specification:Liberation Serif Bold">matplotlib</tspan><tspan
sodipodi:role="line"
x="410.05664"
y="191.6396"
id="tspan4552-8-0-5-6"
style="font-size:6px;text-align:center;text-anchor:middle">Lecture 4</tspan></text>
<text
xml:space="preserve"
style="font-size:14px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;font-family:Liberation Serif;-inkscape-font-specification:Liberation Serif"
x="319.82617"
y="198.45"
id="text4544-9-8-5-0-9-7"
sodipodi:linespacing="125%"><tspan
sodipodi:role="line"
id="tspan4546-5-8-9-7-5-9"
x="319.82617"
y="198.45"
style="font-size:8px;font-weight:bold;text-align:center;text-anchor:middle;fill:#0066ff;-inkscape-font-specification:Liberation Serif Bold">Sympy</tspan><tspan
sodipodi:role="line"
x="319.82617"
y="206.51263"
id="tspan4552-8-0-5-6-1-6"
style="font-size:6px;text-align:center;text-anchor:middle">Lecture 5</tspan></text>
<text
xml:space="preserve"
style="font-size:14px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;font-family:Liberation Serif;-inkscape-font-specification:Liberation Serif"
x="364.90039"
y="152.9588"
id="text4544-9-8-9"
sodipodi:linespacing="125%"><tspan
sodipodi:role="line"
id="tspan4546-5-8-91"
x="364.90039"
y="152.9588"
style="font-size:8px;font-weight:bold;text-align:center;text-anchor:middle;fill:#0066ff;-inkscape-font-specification:Liberation Serif Bold">Other packages and toolboxes</tspan><tspan
sodipodi:role="line"
x="364.90039"
y="161.02144"
id="tspan4552-8-0-2"
style="font-size:6px;text-align:center;text-anchor:middle">for example QuTiP</tspan></text>
<text
xml:space="preserve"
style="font-size:14px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;font-family:Liberation Serif;-inkscape-font-specification:Liberation Serif"
x="364.99609"
y="126.5985"
id="text4544-9-8-9-0"
sodipodi:linespacing="125%"><tspan
sodipodi:role="line"
x="364.99609"
y="126.5985"
id="tspan4552-8-0-2-0"
style="font-size:8px;font-weight:bold;text-align:center;text-anchor:middle;fill:#0066ff;-inkscape-font-specification:Liberation Serif Bold">User programs</tspan></text>
<flowRoot
xml:space="preserve"
id="flowRoot3370"
style="font-size:40px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
transform="translate(447.52906,234.62469)"><flowRegion
id="flowRegion3372"><rect
id="rect3374"
width="277.79196"
height="474.7717"
x="-11.111678"
y="-223.85219" /></flowRegion><flowPara
id="flowPara3376" /></flowRoot> </g>
</svg>

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 583 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 123 KiB

View File

@@ -0,0 +1,292 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="164.94188"
height="164.04639"
id="svg2"
version="1.1"
inkscape:version="0.48.3.1 r9886"
sodipodi:docname="theory-experiment-computation.pdf"
inkscape:export-filename="theory-experiment-computation.png"
inkscape:export-xdpi="436.48999"
inkscape:export-ydpi="436.48999">
<defs
id="defs4">
<path
sodipodi:end="2.6179939"
sodipodi:start="0.55850536"
d="m 317.89812,194.20932 a 79.64286,79.64286 0 0 1 -136.51371,-2.38286 l 68.97274,-39.82142 z"
sodipodi:ry="79.64286"
sodipodi:rx="79.64286"
sodipodi:cy="152.00504"
sodipodi:cx="250.35715"
id="path3779-9-1-34-2"
style="fill:#e6e6e6;fill-opacity:1;stroke:#666666;stroke-width:2;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0"
sodipodi:type="arc"
transform="matrix(-1,0,0,1,423.66072,164.10715)" />
<path
style="fill:none;stroke:none"
d="m 121.78572,347.71932 c 27.47833,37.9228 73.84073,35.52916 108.21428,3.21429"
id="path4417-4"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cc" />
<path
style="fill:none;stroke:none"
d="m 175.71429,252.36218 c 45.17969,12.19595 56.69027,45.75883 52.5,89.28571"
id="path4415-2"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cc" />
<path
style="fill:none;stroke:none"
d="m 123.21428,340.21932 c -9.44058,-51.7873 13.51269,-77.59604 47.14286,-88.21428"
id="path4375-0"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cc" />
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="0.98994949"
inkscape:cx="-137.18251"
inkscape:cy="97.52171"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="true"
showguides="false"
inkscape:snap-global="false"
inkscape:window-width="1791"
inkscape:window-height="1200"
inkscape:window-x="419"
inkscape:window-y="141"
inkscape:window-maximized="0"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0">
<inkscape:grid
type="xygrid"
id="grid2985"
empspacing="5"
visible="true"
enabled="true"
snapvisiblegridlinesonly="true"
originx="-447.52906px"
originy="-653.6911px" />
</sodipodi:namedview>
<metadata
id="metadata7">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(-447.52906,-234.62469)">
<path
transform="matrix(-1,0,0,1,780.26121,166.51252)"
sodipodi:type="arc"
style="fill:#e6e6e6;fill-opacity:1;stroke:#666666;stroke-width:1;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0"
id="path3779-9-1-34-5"
sodipodi:cx="250.35715"
sodipodi:cy="152.00504"
sodipodi:rx="79.64286"
sodipodi:ry="79.64286"
d="m 317.89812,194.20932 c -23.30878,37.30185 -72.44341,48.64548 -109.74526,25.33669 -11.05732,-6.90938 -20.24918,-16.42783 -26.76845,-27.71955 l 68.97274,-39.82142 z"
sodipodi:start="0.55850536"
sodipodi:end="2.6179939" />
<path
transform="matrix(-1,0,0,1,782.67193,162.76252)"
sodipodi:type="arc"
style="fill:#e6e6e6;fill-opacity:1;stroke:#666666;stroke-width:1;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0"
id="path3779-9-1-8-5-4"
sodipodi:cx="250.35715"
sodipodi:cy="152.00504"
sodipodi:rx="79.64286"
sodipodi:ry="79.64286"
d="m 181.38441,191.82646 c -21.99277,-38.09259 -8.94128,-86.8014 29.15131,-108.794166 12.10724,-6.990121 25.84119,-10.670119 39.82143,-10.670119 l 0,79.642865 z"
sodipodi:start="2.6179939"
sodipodi:end="4.712389" />
<path
transform="matrix(-1,0,0,1,778.02907,162.76252)"
sodipodi:type="arc"
style="fill:#e6e6e6;fill-opacity:1;stroke:#666666;stroke-width:1;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0"
id="path3779-9-1-8-3-3-0"
sodipodi:cx="250.35715"
sodipodi:cy="152.00504"
sodipodi:rx="79.64286"
sodipodi:ry="79.64286"
d="m 250.35715,72.362175 c 43.98554,1e-6 79.64286,35.657325 79.64286,79.642865 0,14.9241 -4.19332,29.54793 -12.10189,42.20428 l -67.54097,-42.20428 z"
sodipodi:start="4.712389"
sodipodi:end="6.8416907" />
<path
style="fill:none;stroke:none"
d="m 479.81477,342.62469 c -9.44058,-51.7873 13.51269,-77.59604 47.14286,-88.21428"
id="path4495"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cc" />
<path
style="fill:none;stroke:none"
d="m 532.31478,254.76755 c 45.17969,12.19595 56.69027,45.75883 52.5,89.28571"
id="path4499"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cc" />
<path
style="fill:none;stroke:none"
d="m 478.38621,350.12469 c 27.47833,37.9228 73.84073,35.52916 108.21428,3.21429"
id="path4501"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cc" />
<text
xml:space="preserve"
style="font-size:14px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;font-family:Liberation Serif;-inkscape-font-specification:Liberation Serif"
x="531.23541"
y="353.33661"
id="text4544"
sodipodi:linespacing="125%"><tspan
sodipodi:role="line"
id="tspan4546"
x="531.23541"
y="353.33661"
style="font-size:11px;font-weight:bold;fill:#0066ff;-inkscape-font-specification:Liberation Serif Bold">Experiment</tspan><tspan
sodipodi:role="line"
x="531.23541"
y="364.18057"
id="tspan4548"
style="font-size:8px;text-align:center;text-anchor:middle">measurements, observations,</tspan><tspan
sodipodi:role="line"
x="531.23541"
y="374.18057"
id="tspan4562"
style="font-size:8px;text-align:center;text-anchor:middle">collect data, test hypothesis,</tspan><tspan
sodipodi:role="line"
x="531.23541"
y="384.18057"
style="font-size:10px;text-align:center;text-anchor:middle"
id="tspan4613"><tspan
style="font-size:8px"
id="tspan4615">...</tspan></tspan><tspan
sodipodi:role="line"
x="531.23541"
y="394.18057"
id="tspan4552" /></text>
<text
xml:space="preserve"
style="font-size:14px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;font-family:Liberation Serif;-inkscape-font-specification:Liberation Serif"
x="466.14908"
y="276.60513"
id="text4544-9"
sodipodi:linespacing="125%"><tspan
sodipodi:role="line"
id="tspan4546-5"
x="466.14908"
y="276.60513"
style="font-size:11px;font-weight:bold;text-align:start;text-anchor:start;fill:#0066ff;-inkscape-font-specification:Liberation Serif Bold">Theory</tspan><tspan
sodipodi:role="line"
x="466.14908"
y="287.4491"
id="tspan4562-0"
style="font-size:8px;text-align:start;text-anchor:start"> develop models,</tspan><tspan
sodipodi:role="line"
x="466.14908"
y="297.4491"
style="font-size:8px;text-align:start;text-anchor:start"
id="tspan4605"> hypothesis,</tspan><tspan
sodipodi:role="line"
x="466.14908"
y="307.4491"
style="font-size:8px;text-align:start;text-anchor:start"
id="tspan4607"> predictions, </tspan><tspan
sodipodi:role="line"
x="466.14908"
y="317.4491"
style="font-size:8px;text-align:start;text-anchor:start"
id="tspan4611"> conclusions,</tspan><tspan
sodipodi:role="line"
x="466.14908"
y="327.4491"
style="font-size:8px;text-align:start;text-anchor:start"
id="tspan4676"> ...</tspan><tspan
sodipodi:role="line"
x="466.14908"
y="337.4491"
id="tspan4552-8"
style="font-size:8px" /></text>
<text
xml:space="preserve"
style="font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;font-family:Liberation Serif;-inkscape-font-specification:Liberation Serif"
x="535.32928"
y="276.60513"
id="text4544-9-5"
sodipodi:linespacing="125%"><tspan
sodipodi:role="line"
id="tspan4546-5-7"
x="535.32928"
y="276.60513"
style="font-size:11px;font-weight:bold;text-align:start;text-anchor:start;fill:#0066ff;-inkscape-font-specification:Liberation Serif Bold">Computation</tspan><tspan
sodipodi:role="line"
x="535.32928"
y="287.4491"
style="font-size:8px;text-align:start;text-anchor:start;fill:#1c2422"
id="tspan4660"> simulate models,</tspan><tspan
sodipodi:role="line"
x="535.32928"
y="297.4491"
style="font-size:8px;text-align:start;text-anchor:start;fill:#1c2422"
id="tspan4662"> test hypothesis,</tspan><tspan
sodipodi:role="line"
x="535.32928"
y="307.4491"
id="tspan4552-8-6"
style="font-size:8px;text-align:start;text-anchor:start;fill:#1c2422"> observations,</tspan><tspan
sodipodi:role="line"
x="535.32928"
y="317.4491"
style="font-size:8px;text-align:start;text-anchor:start;fill:#1c2422"
id="tspan4674"> visualizations, </tspan><tspan
sodipodi:role="line"
x="535.32928"
y="327.4491"
style="font-size:8px;text-align:start;text-anchor:start;fill:#1c2422"
id="tspan4678"> ...</tspan></text>
<flowRoot
xml:space="preserve"
id="flowRoot4680"
style="font-size:14px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Liberation Serif;-inkscape-font-specification:Liberation Serif"><flowRegion
id="flowRegion4682"><rect
id="rect4684"
width="296.42856"
height="350"
x="-3.5714285"
y="125.21932" /></flowRegion><flowPara
id="flowPara4686"></flowPara></flowRoot> <flowRoot
xml:space="preserve"
id="flowRoot4688"
style="font-size:14px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Liberation Serif;-inkscape-font-specification:Liberation Serif"><flowRegion
id="flowRegion4690"><rect
id="rect4692"
width="271.42856"
height="291.42856"
x="60.714287"
y="168.07646" /></flowRegion><flowPara
id="flowPara4694"></flowPara></flowRoot> </g>
</svg>

After

Width:  |  Height:  |  Size: 12 KiB

View File

@@ -0,0 +1,4 @@
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
print("Hej världen!")

View File

@@ -0,0 +1,3 @@
#!/usr/bin/env python
print("Hello world!")

File diff suppressed because it is too large Load Diff