/PHYS6350-ComputationalPhysics

Lecture notes and code for the course PHYS6350 Computational Physics at the University of Houston

Primary LanguageJupyter Notebook

Computational Physics course (PHYS 6350)

This repository contains the lecture notes and program code for the graduate course PHYS6350 Computational Physics at the University of Houston taught at the University of Houston.

The course is designed for graduate/advanced undergraduate physics students. The focus is on the concepts behind the numerical methods used in computational physics over the implementation. For this reason, most of the code is in Python and uses Jupyter Notebooks for presentation. For the same reason, many standard routines (such as linear equation solvers) are reimplemented.

Textbooks

There is no assigned textbook but the following textbooks can be useful:

Many of the problems and examples are taken from the first book, these are referenced in the lecture notes where applicable.

Syllabus

The syllabus for the course taught in Spring 2023 is available here

Lecture notes and code

  • Lecture notes: folder lectures
  • Sample programs and notebooks: folder code

Course outline

  1. Plotting [Lecture (pdf), Code (ipynb)]

  2. Floating-point precision [Lecture (pdf), Code (ipynb)]

  3. Interpolation [Lecture (pdf), Code (ipynb)]

    • Nearest-neighbor
    • Linear
    • Interpolating polynomial
    • Bilinear (two variables)
  4. Non-linear equations

    • Lecture 1 (pdf, pptx), Code (ipynb)
      • Bisection method
      • Secant and Newton-Raphson method
    • Lecture 2 (pdf, pptx)
      • Roots of a polynomial (ipynb)
      • Multi-dimenstional Newton and Broyden methods (ipynb)
      • Search for extrema (minimum/maximum) (ipynb)
  5. Numerical integration

    • Lecture 1 (pdf, pptx), Code (ipynb)
      • Rectangle, trapezoidal, and Simpson rules
      • Composite and adaptive rules, error control
      • Improper integrals
    • Lecture 2 (pdf), Code (ipynb)
      • Newton-Cotes quadrature
      • Clenshaw-Curtis quadrature
      • Gaussian quadrature
  6. Numerical differentiation [Lecture (pdf), Code (ipynb)]

    • Forward, backward, and central difference
    • High-order approximations and derivatives
    • Balancing truncation and round-off errors
  7. Ordinary differential equations (ODE) [Code (ipynb)]

    • Lecture 1 (pdf)
      • Euler, midpoint (RK2), and RK4 methods
      • Adaptive step
      • Stiff equations, stability, and implicit methods
      • Systems of ODEs
      • Simple pendulum
    • Lecture 2 (pdf))
      • Leapfrog, modified midpoint and Bulirsch-Stoer methods
      • Simple pendulum
      • Comet motion, SIR model
      • Boundary value problems and the shooting method
  8. Classical mechanics problems [Lecture (pdf, pptx), Code (ipynb)]

    • Three-body problem
    • Non-linear pendulum
    • Double pendulum and chaotic motion (simulation + animation code (ipynb))
  9. Molecular dynamics [Lecture (pdf), Code (ipynb)]

    • Classical N-body problem
    • Lennard-Jones fluid
    • Equilibration and thermodynamics
  10. Linear algebra [Code (ipynb)]

    • Lecture 1 (pdf)
      • Gaussian elimination
      • Pivoting
      • LU-decomposition
    • Lecture 2 (pdf)
      • Matrix inversion
      • Tri- and band-diagonal systems
      • QR decomposition
      • Eigenvalue problem
  11. Partial differential equations (PDE) [Code (ipynb)]

    • Lecture 1 (pdf)
      • Boundary value problems
      • Finite difference method
      • Jacobi and Gauss-Seidel methods
    • Lecture 2 (pdf, pptx)
      • Initial value problems
      • FTCS, implicit, and Crank-Nicolson schemes
      • Heat equation
      • Wave equation
  12. Random numbers and Monte Carlo methods [Code (ipynb)]

    • Lecture 1 (pdf)
      • Pseudo-random number generators
      • Computing integrals
        • As the area under the curve
        • Mean-value method
      • Sampling non-uniformly distributed random numbers
        • Inverse transform sampling
        • Rejection sampling
    • Lecture 2 (pdf)
      • Multi-dimensional integrals
      • Importance sampling
  13. Statistical physics problems

    • Lecture 1 (pdf), Code (ipynb)
      • Markov Chain Monte Carlo (MCMC)
      • Metropolis-Hastings algorithm
      • 2D Ising model
    • Lecture 2 (pdf. pptx), Code (ipynb)
      • Simulated annealing
      • Percolation threshold simulation
  14. Quantum mechanics [Lecture (pdf), Code (ipynb)]

    • Matrix method for eigenenergies and eigenstates
    • Time-dependent Schroedinger equation
  15. Fourier transform [Lecture (pdf), Code (ipynb)]

    • Discrete Fourier Transform
    • Fast Fourier Transform
  16. Introduction to Machine Learning [Lecture (pdf)]

  17. Introduction to Parallel Computing [Lecture (pdf)]

    • Basic terminology
    • OpenMP examples (cpp)
    • Molecular dynamics with NVIDIA CUDA (cpp)

Usage

Feel free to use and redistribute the material with an appropriate reference.

Copyright (C) 2023 Volodymyr Vovchenko