Table of Contents

Why use Python?

Python is a computer programming language that is becoming increasingly popular in Physics. It is easy to learn and has a quite user-friendly syntax. Python has become one of the most popular languages for teaching computer-programming and is being adopted in UCD Science (a new first-year module “Computation for Scientists” is under development to run in 2021-2022). In addition, the module ACM 20030 “Computational Science”, core for all Physics students, is delivered through Python.

One of the reasons Python is so popular is that there is an incredible range of libraries availabe for it, making it a very easy and powerful language to use to tackle a range of problems. Python programs can sometimes run much slower than programs written in languages like C++, even though they can be developed much quicker, and in certain high-performance applications C++ may be a better choice. However, with attention to detail in how Python code is structured and through using appropriate libraries, the performance of Python code can be improved.

Python in the Advanced Laboratories

In 2014 the staff of the Advanced Physics Laboratories replaced three software packages/languages (C++, MATLAB, and MATHCAD) that were used with Python, allowing data aqcuisition, data analysis and computational physics to be done with the one language.

The aim of this section of the web site is to provide a centralised place for UCD Physics students to access reference material, advice, and hints and tips on using Python to solve problems and analyse and present data in their lecture and laboratory courses.