/msph402b

Python codes for MSPH402B - Computational Physics, taught at the Department of Physics, The University of Burdwan

Primary LanguageJupyter NotebookMIT LicenseMIT

MSPH402B

Python lectures and codes for MSPH402B - Computational Physics, taught at the Department of Physics, The University of Burdwan

A repository of all my codes, tutorial lectures and simulations used to teach Computational Physics to masters students at the Department of Physics in The University of Burdwan

The simulations are written in the Python programming language.

The lecture slides can be found @ My Google Drive

The website for this Course is @ https://bit.ly/msph402b

Background

Instructions

You can run these python codes by installing the requisite software in your computer, or online through Google Colab.

  1. Recommended: In case you cannot install Python locally on your computer, you may run the codes through Google Colab by clicking on the links to the jupyter notebooks below, then clicking on the "Open in Colab" button at the top of the notebook. This will work on any computer, mobile or tablet that has internet access and a standard web browser like Google Chrome, Microsoft Edge, Firefox or whatever. However, these codes will run on colab servers, rather than locally on your computer. This is usually not a problem, although the servers might be slow.

  2. In order to run these programs locally in your computer (instead of Google Colab), perform the following steps.

    • On regular console computers (desktops or laptops):
      • Install GitHub Desktop after downloading it from its website @ desktop.github.com
      • Then, download this repository by cloning it using GitHub Desktop (see this doc for details).
      • Finally, download and install the anaconda python distribution (anaconda @ https://www.anaconda.com/). Anaconda includes Jupyter notebooks and the Spyder IDE, either of which can be readily used for designing and running python code. Also, see this blog entry on how to install anaconda.
    • On Android devices:
      • You can install Pydroid to design and run python programs.
      • See this video for setup instructions.
      • I do not recommend using Git or jupyter on mobile phones (too complicated for small screens), although git apps for Android do exist in the store. You can check them out if you wish. Alternative ways of getting these codes are discussed below.
  3. If you're having problems with Git, and do not want to use Google Colab, you can simply copy-paste the codes individually into your local python setup:

    • Click on the "Copy raw contents" button on the top-right corner of the github page of a particular code (to the right of the 'Blame' button).

    • Then, paste it into a text editor or a running python IDE like Spyder or Pydroid in order to execute it.

    • However, this will only work for regular Python, not for Jupyter notebooks. For the latter, you can either run them in Google Colab, or copy-paste each code cell from the jupyter notebook to a local Python file in your device. This should work well on Android devices, where it is difficult to run jupyter locally. Note, however, that IPython magics won't work in regular Python, and you'll have to delete or rewrite them.

List of Tutorials and Codes

Use the following links:

Scientific Python Tutorials:

Numerical Methods, Example Codes:

License

This work is licensed under a MIT License

Author

Analabha Roy
Assistant Professor,
Department of Physics,
The University of Burdwan
Bardhaman, India 713104
Webpage: https://www.ph.utexas.edu/~daneel