Topic outline

  • Status of the Course Compulsory course of the Advanced Energy Technologies major and Materials Physics and Quantum Technology major. Alternative course of the Engineering Physics minor. 
    Level of the Course The course is only for students who have completed their Bachelor's Degree. 
    Teaching Period 

    2022-2023 Spring III-V

    2023-2024 Spring III-V

    Learning Outcomes 

    After completing the course, the student

    • can identify and describe basic models and simulation techniques that are frequently used to solve physical problems in various fields of computational physics, such as quantum, statistical, condensed matter or materials physics
    • can use these approaches to solve their own computational physics problems
    • can implement these tools into their own codes

    Understand and implement various models appearing in computational quantum, statistical condensed matter and materials physics. 

    Assessment Methods and Criteria 

    Computational assignments


    Contact teaching: 48 hrs 
    Independent work: 70 hrs

    Study Material 

    Lecture notes and additional supporting material

    Substitutes for Courses 

    This course will replace the course Tfy-3.4423

    Grading Scale 0-5 
    Registration for Courses 

    registration via WebOodi.

    Language of instruction and studies 

    Teaching language: English

    Languages of study attainment: English

  • Available from 31 December 2023

    The lectures for the course are pre-recorded and fully available at the beginning - it is up to you how you use them. They are a mixture of presented material and interactive examples using Python. Each topic of the course is focused on a two-week slot with associated exercise sessions. Extended material for each lecture is available here as Jupyter notebooks (also as non-interactive html), so that the lectures focus on the core concepts, and discussions and examples of them.

    The course is based on the revised edition of the book Computational Physics by Mark Newman, but several aspects have been expanded upon and updated. The extended material below should cover everything needed for the course, but the book is still an excellent general introduction and is strongly recommended to those interested.

    The lecture topics are as follows:

    • Topic 1 - Python programming for physicists (Prof. Adam Foster)
      • Intro to Python and Jupyter notebooks
      • Controlling output format, writing data files, using modules, optional and keyword function arguments, list comprehensions
      • Numpy and external packages
      • Graphics and visualization
      • Accuracy and speed
    • Topic 2 - Integrals and derivatives (Prof. Patrick Rinke)
    • Topic 3 - Solution of linear and nonlinear equations (Prof. Patrick Rinke)
    • Topic 4 - Fourier transforms (Prof. Adam Foster)
    • Topic 5 - Differential equations (Prof. Patrick Rinke)
    • Topic 6 - Random processes and Monte Carlo methods (Prof. Adam Foster)

  • Available from 31 December 2023

    Exercises are downloaded and submitted through MyCourses with a deadline of every 2 weeks. The exercise support sessions will be every Thursday during the first 12 weeks of the course.

    Assistants for the course: 

    • Jarno Laakso ( -- Exercises 1, 3, 5
    • Lauri Kurki ( -- Exercises 2, 4, 6

  • The final six weeks of the course are focused on student projects. Here, the approach introduced in the course is applied to a problem of the students' choice, from their own research or interests. If you are not sure what you want to do, take a look at the examples below for inspiration or ask us.

    The project is submitted as a Jupyter notebook containing all relevant introduction, code, results and discussion (if you have separate figures or data, then please submit a single compressed file). Submissions in other formats without prior approval will be penalized.

    Before you begin your project, please submit a brief outline using the template in the section below. The deadline for this is April 3rd.

    The deadline for project submission is 17th May.

    Examples from previous projects

    • 2D Fluid Simulation using Boltzmann-Lattice methods
    • Simulation of the celestial bodies of the Solar system
    • 2D Ising model
    • Diffusion Limited Aggregation
    • Optimal Roof Inclination Angle for Solar Panels in Helsinki
    • Reactor neutronics by finite element method
    • Electrical properties of percolating random networks of conducting 2D sticks
    • Double pendulum
    • Ground State Energy of Helium using Variational Monte Carlo
    • Finite element solution of the wave equation
    • Monte Carlo methods to render more realistic looking images
    • Simulating the trajectory of an impurity ion in a magnetized plasma
    • Computer vision algorithms and the biomechanics of running
    • Numerical Heisenberg-Langevin equation solver for parametric amplification of quantum noise
    • Brownian Motion in an External Potential

    Project grading

    The projects will be graded in the following three categories for a total of 80:

    • Presentation (20)
      • Structure of the project should follow general scientific practice.
      • Figures are clear and informative, with captions and labels, referenced within the text.
      • Use citations where appropriate.
    • Technical (30)
      • Good use of comments.
      • Optimal use of functions/classes with documentation.
      • Discussion of computational efficiency.
    • Research (30)
      • Introduction framing the project and the scientific question you are exploring.
      • Justification of the methods chosen.
      • Good flow in the results, explaining each step and justifying the next one.
      • Analysis of parameters and sources of error.
      • Relevant conclusions based on the results.

    To aid in preparing a good project, you can also see examples of previous submissions that achieved almost full marks in every category below.

  • The grading of the course is based on the following:

    • 20 points for each set of exercises (max. 120) with individual exercise questions having varying point values.
    • 80 points for the project.

    At least 50% of the points is required in both components to pass the course i.e. 60/120 in exercises and 40/80 in the project.

  • Instructions to get Python

    On this course, we will use Python and some common packages for scientific computing. This page contains separate guides for two alternative approaches:

    1. Setting up the Python environment for the course using Anaconda
    2. Setting up the Python environment for the course using virtualenv (Aalto Linux)

    Anaconda is a distribution of Python that works on all the most common operating systems (Linux, Windows, MacOS) and makes installing the required packages easy. On Aalto managed Linux computers the approach using Anaconda will not work, and the guide for virtualenv should be followed instead! We recommend following the instructions on this page to get a version of Python that’s been tested to work with the lecture materials and exercises. We cannot guarantee that your own custom installation of Python works. If you have trouble getting Python to work, come to the exercise session for help, or email one of the assistants.

    Setting up the Python environment for the course using Anaconda

    Step 1. Installing Anaconda (Linux)
    On a Linux computer follow these steps to install Anaconda:

    1. Download the latest version of Miniconda at This is essentially the same software as Anaconda but it takes less space and is faster to install.

    2. Open terminal and go to the folder where the file was downloaded

    3. Run


    and follow the instructions.

    Step 1. Installing Anaconda (Windows, MacOs)
    If you’re using Windows or MacOS, download the latest miniconda version for your operating system and install the software using the graphical installer.

    Now you should have a working installation of conda on your system. Next we will create a dedicated Python environment for this course.

    Step 2. Download the environment file here

    Step 3. Go to the download folder and create the environment with

    conda env create -f  environment.yml

    More information available at

    Step 4. Activate the environment with

    conda activate cp

    and you should see “(cp)” at the start of a line in your terminal which means you have a working python environment tailored for this course. Here, ‘cp’ is the name of the environment, short for computational physics. When you open a new terminal window and wish to use this environment you have to run

    conda activate cp 

    Setting up the Python environment for the course using virtualenv (Aalto Linux)

    If you are using an Aalto managed Linux computer, such as in the exercise room, the approach using Anaconda will not work. This guide goes through setting up the Python environment using virtualenv. You can also access an Aalto Linux computer remotely at There you should choose the Ubuntu 20.04 virtual machine.

    Step 1. Install virtualenv by running

    python3 -m pip install virtualenv

    Step 2. Create a virtual Python environment by running

    python3 -m virtualenv cp

    Step 3. Activate the virtual environment that was created by running

    source cp/bin/activate

    Step 4. Install the required Python packages to the virtual environment using pip:

    python -m pip install numpy matplotlib scipy librosa scikit-learn jupyter

    Step 5. Now you can open Jupyter notebook files by running


    in the folder where the notebook file is located. If the virtual environment that you created has been activated, jupyter-notebook should automatically use the virtual environment's Python interpreter for running the code in the notebook. When you open a new terminal window and wish to use this environment you have to run

    source cp/bin/activate

    before opening a Jupyter notebook.