EP4210 - Computational Physics
Kirit Makwana
Department of Physics, IIT Hyderabad
Kirit MakwanaDepartment of Physics, IIT Hyderabad
EP4210 - Computational Physics 1 / 10
The purpose of computation is insight, not numbers - Richard Hamming
Kirit MakwanaDepartment of Physics, IIT Hyderabad
EP4210 - Computational Physics 2 / 10
Study resources
Computational Methods for Physics - Joel Franklin
Computational Physics - Nicholas Giordano and Hisao Nakanishi
[Link]
Kirit MakwanaDepartment of Physics, IIT Hyderabad
EP4210 - Computational Physics 3 / 10
Motivation
Many fields involve mathematical problems that cannot be solved by
analytical calculations
With the invention of computers, it became possible to get solutions
to such problems by computational methods
There is an extremely wide variety of computational methods and it is
impossible to teach all of them
We will focus on some basic methods which have wide applicability
and apply them to some physics problems
Why to study computational physics in era of AI and ChatGPT? -
Fundamental understanding is always needed even if ready made tools
are available, and we need human understanding to check whether
the results are correct
Also, even advanced AI models often given erroneous results
Kirit MakwanaDepartment of Physics, IIT Hyderabad
EP4210 - Computational Physics 4 / 10
Logistics
You will need a computer and some programming tool
I will be using Python for teaching and examples
I recommend everyone to use Python for their coding assignments in
this class
Please feel free to ask questions during class
You can email me if you have any questions about the course.
Office: Room PH-212, Physics department, AD3 block
Evaluation
▶ Assignments (10%)
▶ Class participation (20%)
▶ Two exams (50%)
▶ Project(20%)
▶ Assignments and projects will be checked for plagiarism - although
discussion is allowed, entire code has to be written by yourself
▶ Avoid use of Generative AI (like chatGPT)
Assignments, exams and project are mandatory. Only exception is
valid medical leave certified by IITH clinic
Kirit MakwanaDepartment of Physics, IIT Hyderabad
EP4210 - Computational Physics 5 / 10
Course contents (Tentative)
Python programming
Root finding
Numerical integration and differentiation
Solving Differential equations
▶ First order ODEs
▶ Time stepping methods
▶ Iterative methods
▶ Finite difference methods
Monte Carlo methods
Spectral methods
Neural networks
Kirit MakwanaDepartment of Physics, IIT Hyderabad
EP4210 - Computational Physics 6 / 10
Questions
Have you written any program in any programming language?
Which language have you used - Fortran, C/++, Matlab, Python
Do you know ”while” loop?
Do you know ”subroutine”?
Have you made a plot/figure with any programming language?
Do you know Newton method?
Do you know Verlet method?
Kirit MakwanaDepartment of Physics, IIT Hyderabad
EP4210 - Computational Physics 7 / 10
About Python
It is a high-level language with English like syntax
So it is easy to learn
It is free
It has lots of packages with pre-programmed libraries
However, Python is slower than lower level languages like Fortran or C
It also requires more memory
Kirit MakwanaDepartment of Physics, IIT Hyderabad
EP4210 - Computational Physics 8 / 10
Python installation
Install Anaconda Python 3.X
[Link]
Python tutorials:
[Link]
getting-started/
[Link]
[Link]
To change anything in the setup, open Anaconda Prompt from the
start menu, go to the anaconda directory by using cd command, and
then type “conda” - it will show all the options
Similar thing can be done in Linux, where there is an executable file
called “conda”
Kirit MakwanaDepartment of Physics, IIT Hyderabad
EP4210 - Computational Physics 9 / 10
Key tools/commands
Python launch
Simple mathematical operations
Conda install numpy, scipy, matplotlib
iPython
Text files and programs
[Link]
how-to-use-jupyter-notebooks
lists
arrays, mathematical operations on arrays
math module
Conditional statements
Matrices, multiplication
For loops
If...then...else
functions
matplotlib
Kirit MakwanaDepartment of Physics, IIT Hyderabad
EP4210 - Computational Physics 10 / 10