Numerics
Table of contents
- Numerical methods
- Programming languages
- Data visualization
- Linux and windows
- High performance computing
- Advanced scientific programs/examples
- LaTeX
Numerical methods
- Eric Ayars, Computational physics with python (Good for beginners).
- Alejandro Garcia, Numerical Methods for Physics (A more advanced book with examples of Python, Matlab, C/C++ or Fortran).
- Morten Hjorth-Jensen, COMPUTATIONAL PHYSICS lecture note (A comprehensive guide with examples of C/C++ and Fortran).
- Finite difference method: Wikipedia: Finite difference coefficient and Finite Difference Coefficients Calculator.
Numerical relativity
- Miguel Alcubierre, Introduction to 3+1 Numerical Relativity.
- Thomas W. Baumgarte, Numerical Relativity.
Programming languages
Python
- 廖雪峰python教程 (A comprehensive tutorial written in Chinese).
- Numba makes Python code fast. Tips: Specify the variable types when using numba if you wanna ensure very high precision.
Mathematica
- FAST INTRODUCTION FOR MATH STUDENTS (Good for beginners).
- An Elementary Introduction to the Wolfram Language
- Leonid Shifrin, Mathematica® programming: an advanced introduction
- 10 Tips for Writing Fast Mathematica Code (Very helpful tips).
- How do I accelerate NIntegrate evaluations? (Very helpful tips).
- Examples for random walk
C/C++ and Fortran
Data visualization
- Python matplotlib. (1) Github matplotlib-cheatsheet. (2) To customize the plot style (figure size, fonts etc.), just write a “style” file saving in path like “C:(user name).matplotlib\stylelib\” (on Windows). See customizing matplotlib and changes to the default style for detailed description. Download my style file example.
- Mathematica plot.(1) Choose appropriate plots. (2) Do specify PlotTheme. (3) Using MaTeX to create LaTeX fonts for ticks and labels.
- Simple 3D Programming Using VPython
- Use ImageMagick to create .gif from images. (1) Create .gif,
convert -delay 50 -loop 0 image_*.png movie.gif
. Here-delay 50
means the delay between images is 50/100 seconds,-loop 0
cause the gif to loop over and over again, and the name of images should be in proper alphabetic order like “…, image_09, image_10, image_11, …” instead of “…, image_9, image_10, image_11”. - Use FFmpeg to create .flv from images. (1) Create .flv,
ffmpeg -i image_%04d.png -r 5 -vcodec flv movie.flv
. Here-i
specifies the printf string that was used to make the names of the individual plot files,-r 5
specifies the number of frames per second is 5, and-vcodec
is the video codec for Flash, which is calledflv
. - Use Mathcha to draw Feynman diagrams.
Linux and windows
- Unix/Linux Command Cheat Sheet and my cheat sheet.
- UNIX Tutorial for Beginners, BASH Programming – Introduction HOW-TO and Linux思维导图
- Vim Cheat Sheet
- Vim/Guide and Vim tips and tricks
- Table of Basic PowerShell Commands
- BASH and PowerShell Quick Reference
- Windows Command Prompt Cheatsheet
High performance computing
Using clusters
- Center for Research Computing documentation at Rice
- Research Computing Documentation, University of South Florida (involving settings for specific softwares)
- Exercise: running python in the cluster
- How to run graphical user interface on Windows? (1) Have a SSH client, e.g. Linux subsystem. (2) Install and open Xming. (3) Enter in BASH
export DISPLAY=localhost:0.0
. (4) Connect cluster throughssh -X user@nots.rice.edu
. (5) Tryxterm
to see if there is a window opening. If yes, then congratulations!
MPI
- Blaise Barney, Message Passing Interface (MPI)
- William Gropp, Tutorial on MPI: The Message-Passing Interface
Advanced scientific programs/examples
- Mpmath, for real and complex floating-point arithmetic with arbitrary precision. (Python)
- LATTICEEASY, for lattice simulations of the evolution of interacting scalar fields in an expanding universe. (C/C++)
- CAMB (Code for Anisotropies in the Microwave Background). There is also a web interface for it. (Python/Fortran)
LaTeX
Tutorial
- Wikibooks: LaTeX and LaTeX Guide
- Using templates, e.g. REVTeX (
sudo apt-get install texlive-publishers
), LaTeX Templates and ShareLaTeX.
Install LaTeX on Windows
- Download MiKTeX on the official website.
- Install TeXstudio to write Latex codes.
- To set dark theme of TeXstudio on windows, download “texstudio_dark_theme.zip“.
Install LaTeX on Ubuntu
sudo apt-get update
sudo apt-get install texlive
sudo apt-get install texstudio
You can replace “texlive” by one of the following commands (click here for details)
- texlive-base – 136 MB
- texlive-latex-recommended – 177 MB
- texlive – 240 MB
- texlive-latex-extra – 404 MB
- texlive-full – 4714 MB