On this page

Computational Physics Using Python

Jan 16, 2021

#python


Why choose Python?

We are now in the twenty-first century, and a profound technological change has also emerged. Sometimes the analytical solution of a mathematical problem is challenging to obtain, and we simulate and solve the problem from our computational power. A computer is a mighty machine when you can instruct it properly. High-level computer languages like C++, Java, and Python are derived from low-level languages like C, and Assembly, which directly communicate with the system hardware. Python, Matlab, and Mathematica are all interpreted languages, but Python is open source, whereas others are subscribed based on commercial products. The subscription cost is enormous for a student, but most research institutes buy subscriptions and allow students to use them for free.

In most cases, school-level institutes only provide that costly subscription. We happily adopt C/C++ and Java(free) because these are common and accessible languages. But, sometimes, these languages only provide some of the tools to college students/researchers they need. So we search for the suitable one to do those specific tasks, and in that situation, most likely, you will be trapped if you choose a subscribed-based language. Ask yourself, what will you do then when you get a job at an organization that does not provide that software for free or you do not have enough money to buy a subscription? You have already spent hundreds of hours learning that language, and now if you want to go for open source one, you need to spend hundreds of hours again.

Python is a free and open-source programming language with endless modules for almost every case. Each module has many libraries, which makes our task even more straightforward. Here are some modules that researchers need to know:

  • Numerical Python (NumPy) [use for numerical problem solving]
  • Matplotlib [for plotting and visualization]
  • Scientific Python (Scipy) [It has many scientific tools like linear algebra solver, interpolation, etc.]
  • Symbolic Python (Sympy) [It deals with symbolic tasks like integrations, derivatives, etc.]
  • Computational Physics by Mark Newman
  • Python for Scientists by John M. Stewart