2026-2027 Programming for Chemistry course at the University of Milan
The course introduces students to imperative programming by referring to the Python language. The course is divided in two parts: the first presents Python and its object-oriented features, the second focuses on libraries that can be useful in scientific computation and data analysis, in particular NumPy and SciPy.
Where: Computer room 311, settore didattico, via Celoria
When: Tuesdays and Fridays 08:30-10:30, starting from Friday 02/10/2026
What: 48 hours (24 lab-lectures, 2 hours each)
Who: Dr. Davide Ceresoli, davide.ceresoli@cnr.it
You are free to bring your own laptop. In this case, on first lecture you’ll be required to setup a working Python system with Jupyter or VSCode. If you prefer working in the cloud, you will be requested to setup an account on Google Colab or Kaggle.
There are plenty of Python books/tutorial/course available for free, on many different topics. For example, a good book is How to think like a computer scientist in Python 3. Python 3 cheat sheet.
Because of AI code assistants (ChatGPT, Claude, Gemini, …) the exam will be individual and it will consist in few general questions + coding a simple algorithm. The exercises will be taken from The Python workbook by B. Stephenson.
| Day | Hour | Room | Lec | Topic |
|---|---|---|---|---|
| 02/10/2026 | 08:30-10:30 | 311 | 01 | Introduction to Python and tools (slides, notebook) |
| 06/10/2026 | 08:30-10:30 | 311 | 02 | Variables, data types, operators, conditionals, loops (notebook) |
| 09/10/2026 | 08:30-10:30 | 311 | 03 | Variables, data types, operators, conditionals, loops (continued) |
| 13/10/2026 | 08:30-10:30 | 311 | 04 | Lists, tuples, sets, dictionaries, strings (notebook) |
| 16/10/2026 | 08:30-10:30 | 311 | 05 | Lists, tuples, sets, dictionaries, strings (continued) |
| 20/10/2026 | 08:30-10:30 | 311 | 06 | Functions: parameters, scope, return values (notebook) |
| 23/10/2026 | 08:30-10:30 | 311 | 07 | Q&A + exercise session #1 (notebook) |
| 27/10/2026 | 08:30-10:30 | 311 | 08 | Advanced functions: recursion, lambdas (notebook) |
| 30/10/2026 | 08:30-10:30 | 311 | 09 | Misc topics: random numbers, file I/O (notebook) |
| 06/11/2026 | 08:30-10:30 | 311 | 10 | Applications to chemistry (notebook) |
| 10/11/2026 | 08:30-10:30 | 311 | 11 | Object Oriented Programming (notebook) |
| 13/11/2026 | 08:30-10:30 | 311 | 12 | Advanced Object Oriented Programming (notebook) |
| 17/11/2026 | 08:30-10:30 | 311 | 13 | Computer Graphics (notebook) |
| 20/11/2026 | 08:30-10:30 | 311 | 14 | Q&A + exercise session #2 (notebook) |
| 24/11/2026 | 08:30-10:30 | 311 | 15 | Let’s code a game (notebook) |
| 27/11/2026 | 08:30-10:30 | 311 | 16 | Numpy & Matplotlib (notebook) |
| 01/12/2026 | 08:30-10:30 | 311 | 17 | Applications to chemistry (notebook) |
| 04/12/2026 | 08:30-10:30 | 311 | 18 | ASE (notebook) |
| 11/12/2026 | 08:30-10:30 | 311 | 19 | Machine Learning with scikit-learn (notebook) |
| 15/12/2026 | 08:30-10:30 | 311 | 20 | Chemoinformatics with RDkit (notebook) |
| 18/12/2026 | 08:30-10:30 | 311 | 21 | Neural networksit (notebook) |
| 22/12/2026 | 08:30-10:30 | 311 | 22 | Vibe coding (notebook) |
| 08/01/2027 | 08:30-10:30 | 311 | 23 | Python problems & excercise session #3 |
| 12/01/2027 | 08:30-10:30 | 311 | 24 | Excercise session #4 & Farewel |